text
stringlengths
957
885k
<filename>regular_language/unit_tests/test_ast_AST_expand_phrases.py<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- """ Unit Tests for ast.AST.expand_phrases() """ import unittest import nlpregex.regular_language.ast from nlpregex.regular_language.unit_tests.test_ast_helper import test_AST_help...
""" court_directory.py - Download and cache a court directory for Texas Build URLs at: https://card.txcourts.gov/DirectorySearch.aspx Copyright (c) 2020 by <NAME>, J.D. All Rights Reserved. """ import csv import json import requests from datetime import date, time URL = 'https://card.txcourts.gov/ExcelExportPublic.a...
<gh_stars>0 #!/usr/bin/env python import argparse import json import logging from time import sleep import pika import requests from requests import ConnectionError import yaml from subprocess import check_output from subprocess import CalledProcessError import boto3 import datetime as dt class ClusterDaemon(object):...
import dmc2gym import matplotlib.pyplot as plt from tqdm import tqdm import numpy as np import gym from collections import deque class FrameStack(gym.Wrapper): def __init__(self, env, k): gym.Wrapper.__init__(self, env) self._k = k self._frames = deque([], maxlen=k) shp = env.obser...
# Let's import some dependences import pandas as pd import concurrent.futures as cf from yahoofinancials import YahooFinancials import re import ast import time import requests import bs4 as bs from bs4 import BeautifulSoup # I use Wikipedia to see which companies are in the S&P500 index sp500 = 'http://en.wikipedia....
""" FreeRTOS Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the righ...
from collections import OrderedDict import os from django.core.urlresolvers import reverse from rest_framework.test import APITestCase from rest_framework import status from apps.app.models import App from apps.auth.models import User from apps.award.models import Awardee from apps.common.tests import GetResponseMixin ...
import numpy as np import sys import matplotlib.pyplot as plt from UTILS.Calculus import Calculus from UTILS.SetAxisLimit import SetAxisLimit from UTILS.Tools import Tools from UTILS.Errors import Errors import os from scipy import integrate # Theoretical background https://arxiv.org/abs/1401.5176 # Mocak, Meakin, V...
<reponame>Stevanus-Christian/tensorflow<gh_stars>0 # Copyright 2022 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/...
""" @brief test log(time=400s) """ import sys import unittest from logging import getLogger import numpy import pandas from onnxruntime import InferenceSession from pyquickhelper.pycode import ExtTestCase, skipif_circleci, ignore_warnings from sklearn.datasets import load_iris from sklearn.model_selection import t...
<reponame>tum-i4/SACPS-robotics-system<gh_stars>0 #!/usr/bin/env python3 from typing import Tuple, List import math import numpy import numpy as np from math import inf from scipy import signal from random import randrange, shuffle import rospy from geometry_msgs.msg import Point from nav_msgs.msg import OccupancyGri...
<gh_stars>0 import os import json import pathlib import logging from sys import argv, exit, stdout from datetime import date initialized = False def main(): global securePath global settings global logPath global configPath global initialized settings = None if initialized: return...
#!/usr/bin/python # -*- coding: utf-8 -*- # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
<filename>testTransition.py<gh_stars>0 # modified import unittest from transition import Board class TestBoardMethods(unittest.TestCase): def setUp(self): self.threeX3List = [['X','X','X'], ['.','.','.'], ['O','O', 'O'], ...
<filename>api/gsearch.py # -*- coding: utf-8 -*- import os import sys, io from collections import namedtuple # from selenium import webdriver # from selenium.common.exceptions import NoSuchElementException # from selenium.webdriver.common.keys import Keys from pprint import pprint from joblib import Parallel, delayed i...
#!/usr/bin/env python import os.path import re import subprocess import sys from in_file import InFile from name_utilities import enum_for_css_keyword from name_utilities import upper_first_letter import in_generator import license HEADER_TEMPLATE = """ %(license)s #ifndef %(class_name)s_h #define %(class_name)s_h...
<gh_stars>1-10 #! /usr/bin/env python import collections import datetime import locale import pathlib import shutil from typing import Dict, Iterable, Iterator, List import jinja2 import mistune from pygments import highlight from pygments.formatters import html from pygments.lexers import get_lexer_by_name locale.s...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
from django.urls import path from django.shortcuts import redirect from django.conf import settings from django.conf.urls import include, url from django.contrib import admin from django.views.decorators.csrf import csrf_exempt from wagtail.admin import urls as wagtailadmin_urls from wagtail.core import urls as wagtail...
# Generated by Django 3.0.8 on 2020-12-25 02:20 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUT...
<reponame>Robertboy18/Numerical-Algorithms-Implementation<gh_stars>0 # original author : Professor <NAME> class Autodiff_Node(object): ## A class is a recipe for creating objects (with methods and atributes). ## This is called a 'base class', which is like a boiler plate recipe that ## many other classes ...
<reponame>Croydon-Brixton/qthought<filename>qthought/agents.py # Basic library for implementing Agent systems in ProjectQ # Date: 8 Dec 2018 # Author: <NAME> # Contact: <EMAIL> from math import ceil from numpy import log2 from warnings import warn from projectq.meta import Control from projectq.ops import * ...
import base64 import hashlib import json import os import re import smtplib import sys import urllib from django.core.context_processors import csrf from django.core.validators import validate_email from django.db.utils import IntegrityError from django.http import * from django.shortcuts import render_to_response fro...
"""Combine multiple structural variation callers into single output file. Takes a simple union approach for reporting the final set of calls, reporting the evidence from each input. """ import fileinput import os import shutil import toolz as tz import vcf from bcbio import utils from bcbio.distributed.transaction i...
#!/usr/bin/env python2.7 # pylint: disable=bad-indentation, no-member, invalid-name, line-too-long import os import shutil import random import argparse import multiprocessing import cv2 import lmdb import caffe import numpy as np from jfda.config import cfg from jfda.utils import load_wider, load_celeba from jfda.uti...
<reponame>luizgfalqueto/algNum1 import math def read_a(A, n): # Função para ler os elementos para preencher a Matriz A for i in range(0, n): for j in range(0, n): A[i][j] = float(input("Digite o valor de A[{}][{}]:".format(i + 1, j + 1))) return A def read_b(b, n): # Função para ler os e...
""" Test to negative scenarios for a scaling policy. """ from test_repo.autoscale.fixtures import AutoscaleFixture from autoscale.status_codes import HttpStatusCodes import sys class ScalingPolicyNegative(AutoscaleFixture): """ Verify negative scenarios for a scaling policy """ @classmethod def s...
<reponame>MKlauck/qcomp2020 from benchmark import Benchmark from invocation import Invocation from execution import Execution from utility import * from shutil import copyfile import sys, importlib import tmptool loaded = False def assert_loaded(): if not loaded: copyfile("tool.py", os.path.join(sys.path[0], "tmpto...
""" Created on Sun Jul 08 05:03:01 2018 @Project Title: Learning and Summarizing Graphical Models using Eigen Analysis of Graph Laplacian: An Application in Analysis of Multiple Chronic Conditions @Project: EAGL (Simplification Based Graph Summarization) @author: <NAME> """ # Import Libraries import networkx as...
<reponame>yanzhaochang/PSATools-Python<filename>src/data_imexporter/parse_psse_pf.py import sys sys.path.append('..') import apis from apis import apis_system def init_powerflow_data(file): ''' Initialize the power flow data, parse the data of each component from the file and import it into memory. ...
# -*- coding: utf-8 -*- ################################################################################ ## Form generated from reading UI file 'grading2.ui' ## ## Created by: Qt User Interface Compiler version 5.15.0 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! #################...
from scipy import integrate from django.db import connection, IntegrityError, transaction import json import requests as api_requests from itertools import chain from bevim.models import Experiment, Job, Sensor, Acceleration, Amplitude, Frequency, Speed, ExperimentFrequency from bevim_project.settings import REST_BAS...
<filename>board.py<gh_stars>0 from utils import Utils from typing import List class Cell: EMPTY = 0 def __init__(self, pos: tuple, blocked: bool, size: int, value: int): self.pos = pos self.is_blocked = blocked self.value = value self.guesses = [i for i in range(1, size + 1)] ...
from PyUnityVibes.UnityFigure import UnityFigure import time, math import numpy as np # Function of the derivative of X def xdot(x, u): return np.array([[x[3, 0]*math.cos(x[2, 0])], [x[3, 0]*math.sin(x[2, 0])], [u[0, 0]], [u[1, 0]]]) # Function witch return the command to follow to assure the trajectory def contr...
<filename>adm/adm_tool.py """ **************************************************************************************************************************************************************** *********************************************************************************************************************************...
<reponame>yunjung-lee/class_python_numpy ###########################정규화###########################################33 # 정규화 : 최대값과 최소값을 이용하여 0~1 사이의 값을 갖는다. # 머신러닝(인공신경망)에서 아주 많이 사용하는 함수 import numpy as np import pandas as pd import sklearn.preprocessing from pandas import DataFrame from sklearn.preprocessing import M...
''' Created on 22 Jan 2013 @author: gfagiolo ''' import dicom # import logging #=============================================================================== # CONSTANTS #=============================================================================== #SOPClassUID = (0008, 0016) TAG_SOP_CLASS_UID = dicom.tag.Tag(d...
<filename>third_party/WebKit/Source/build/scripts/in_file.py # Copyright (C) 2013 Google Inc. 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 t...
from ..base import MultiGridEnv, MultiGrid from ..objects import * class EmptyMultiGrid(MultiGridEnv): mission = "get to the green square" metadata = {} def _gen_grid(self, width, height): self.grid = MultiGrid((width, height)) self.grid.wall_rect(0, 0, width, height) self.put_obj...
<gh_stars>1-10 import pandas as pd import geopandas import matplotlib.pyplot as plt from shapely.geometry import Point, Polygon, LineString # 英文教程 https://geopandas.readthedocs.io/en/latest/install.html # 中文教程 https://www.bbsmax.com/A/Vx5M9KyL5N/ countries = geopandas.read_file(r"geopandas-tutorial-song\data\ne_110...
import pyVmomi from django.shortcuts import render from extensions.views import tab_extension, TabExtensionDelegate from infrastructure.models import Server from resourcehandlers.vmware.pyvmomi_wrapper import get_vm_by_uuid from resourcehandlers.vmware.models import VsphereResourceHandler from resourcehandlers.vmware.v...
# # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # import sys import csv import matplotlib.pyplot as plt import matplotlib.ticker as plticker # # Usage: # # netsh trace start overwrite=yes report=dis correlation=dis traceFile=quic.etl maxSize=1024 provider={ff15e657-4f26-570e-88ab-0796b25...
#!/usr/bin/env python3 # GUI for the Python scripts of DARx automation. Made on https://github.com/chriskiehl/Gooey from gooey import Gooey, GooeyParser import sys import module_run import module_home import module_rvol import module_calibrate import config import streamtologger import json def get_positions(): #gett...
<filename>src/meltano/core/project.py """Meltano Projects.""" from __future__ import annotations import errno import logging import os import sys import threading from contextlib import contextmanager from pathlib import Path import fasteners from dotenv import dotenv_values from werkzeug.utils import secure_filenam...
<filename>ow/tests/test_catalog.py from datetime import datetime, timedelta, timezone import pytest from repoze.catalog.catalog import Catalog from repoze.catalog.indexes.field import CatalogFieldIndex from repoze.catalog.query import Eq from ow.models.workout import Workout from ow.models.user import User from ow.m...
from maraboupy import Marabou from maraboupy import MarabouCore import numpy as np class marabouEncoding: def __init__(self): self.var = {} def checkProperties(self, prop, networkFile): # Reading DNN using our own version of reading onnx file network_verified = Marabou.read_onnx_deepp...
bl_info = { "name": "Audio Proxy", "category": "Sequencer", } import bpy import os import ffmpy import sys from bpy.app.handlers import persistent class AudioProxyAddonPreferences(bpy.types.AddonPreferences): '''Preferences to store proxy file path and format''' bl_idname = __name__ output_path ...
import tensorflow as tf from tensorflow.python.layers.core import Dense import numpy as np import time # Number of Epochs epochs = 1000 # Batch Size batch_size = 50 # RNN Size rnn_size = 50 # Number of Layers num_layers = 2 # Embedding Size encoding_embedding_size = 15 decoding_embedding_size = 15 # Learning Rate l...
<gh_stars>0 """ Draw an interactive comparison plot of named result dictionaries. The plot can plot many results for large numbers of parameters against each other. The plot can answer the following questions: 1. How are the parameters distributed? 2. How large are the differences in parameter estimates between res...
<filename>src/msla/utils.py from flask import session, request, url_for from msla import app, db from .models import Log, FileUpload from user_agents import parse from werkzeug import secure_filename from datetime import datetime import hashlib import psutil import subprocess import os, re def searchResult(searchColum...
<reponame>stroxler/LibCST # 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 sys from libcst.codemod import CodemodTest from libcst.codemod.commands.convert_type_comments import Conve...
""" GeoServer interaction operations. Working assumptions for this module: * Point coordinates are passed as shapely.geometry.Point instances. * BBox coordinates are passed as (lon1, lat1, lon2, lat2). * Shapes (polygons) are passed as shapely.geometry.shape parsable objects. * All functions that require a CRS have a ...
# Copyright 2020 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 # # Unless required by applicable law or agreed to...
from setting import * from msg_box_class import * from input_Number import * from PyQt5.QtCore import pyqtSignal as pys import sys class settingForm(QtWidgets.QMainWindow,Ui_setting): fill_sig=pys(bool) grid_sig=pys(bool) fw_sig=pys(int) embbed_sig=pys(bool) eg_sig=pys(bool) p_...
# 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 # distributed under t...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Email address type. """ __license__ = """ GoLismero 2.0 - The web knife - Copyright (C) 2011-2014 Golismero project site: https://github.com/golismero Golismero project mail: <EMAIL> This program is free software; you can redistribute it and/or modify it under the t...
<filename>src/pymordemos/output_error_estimation.py #!/usr/bin/env python # This file is part of the pyMOR project (https://www.pymor.org). # Copyright pyMOR developers and contributors. All rights reserved. # License: BSD 2-Clause License (https://opensource.org/licenses/BSD-2-Clause) import numpy as np import matpl...
<filename>parsers/sourcecode/graph2subtokengraph.py """ Usage: graph2otherformat.py [options] INPUTS_FILE REWRITTEN_OUTPUTS_FILE Options: -h --help Show this screen. --debug Enable debug routines. [default: False] """ from docopt import docopt import pdb impo...
<gh_stars>0 import math import os import torch import torch.nn.functional as F from torch.nn.parameter import Parameter from torch.utils.tensorboard import SummaryWriter import numpy as np import heat_map_utils from config_file import config # Check the availability of GPUs if torch.cuda.is_available(): device =...
""" One-off script to opt-out users for email from orgs. Input: A CSV file with a user_id,org pair per line. For example: 1962921,FooX 5506350,BarX 5709986,FooX Lines formatted with a double-quoted org also work fine, such as: 5506350,"BarX" Opts-out every specified user/org combo row from email by setting the 'em...
<reponame>prakHr/opencv-computer_vision #Accessing the webcam ''' import cv2 cap = cv2.VideoCapture(0) # Check if the webcam is opened correctly if not cap.isOpened(): raise IOError("Cannot open webcam") while True: ret, frame = cap.read() frame = cv2.resize(frame, None, fx=0.5, fy=0.5,interpolation=...
# Credits # https://www.geeksforgeeks.org/create-an-empty-file-using-python/ # https://www.geeksforgeeks.org/create-a-directory-in-python/ # https://pythonguides.com/python-copy-file/ import subprocess import re import os import shutil def log_rotate_configure(user_name): subprocess.call(['apt-get', 'install', ...
# -*- coding: utf-8 -*- """ Profile: http://hl7.org/fhir/StructureDefinition/Coverage Release: STU3 Version: 3.0.2 Revision: 11917 Last updated: 2019-10-24T11:53:00+11:00 """ import typing from pydantic import Field from . import backboneelement, domainresource, fhirtypes class Coverage(domainresource.DomainResourc...
<gh_stars>0 import constants from encoder import EncoderRNN from decoder import AttnDecoderRNN from util import time_str from logger import log, write_training_log, save_dataframe, plot_and_save_histories import time from collections import OrderedDict import numpy as np import pandas as pd import torch import torch...
<filename>tests/objects/server/test_runmode.py import unittest from pyiron_base.objects.server.runmode import Runmode class TestRunmode(unittest.TestCase): def setUp(self): self.run_mode_default = Runmode() self.run_mode_modal = Runmode() self.run_mode_modal.mode = 'modal' self.run...
<reponame>kasev/textnet ### these should go easy import sys import pandas as pd pd.options.mode.chained_assignment = None # default='warn' pd.set_option('display.max_rows', 150) import numpy as np import os import string import collections import math import random import statistics as stat import re import unicoded...
# File: stats.py # Creation: Saturday December 5th 2020 # Author: <NAME> # Contact: <EMAIL> # <EMAIL> # -------- # Copyright (c) 2020 <NAME> import json from collections import defaultdict def get_user_stats(posts): """Get per user statistics. * :attr:`POST-COUNT` : The cumulative sum of posts. ...
<gh_stars>0 import os import requests import textwrap import time from urllib.parse import urlparse from sphinxcontrib.needs.api import add_need_type from sphinxcontrib.needs.api.exceptions import NeedsApiConfigException from sphinxcontrib.needs.services.base import BaseService # Additional needed options, which are...
# -*- coding: utf-8 -*- """ fresh_tomatillos.movie_args ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Provides the glue between fresh_tomatillos.get_config and fresh_tomatillos.media.Movie. The `generate_movie_args()` function defined here uses data from a config object to yield the arguments required by the Movie class's constructor....
<reponame>yairkit/flowstep3d<gh_stars>10-100 import torch from pytorch_lightning.metrics import TensorMetric from typing import Any, Optional from losses.supervised_losses import * from losses.unsupervised_losses import * from losses.common_losses import * class EPE3D(TensorMetric): def forward(self, pc_source: t...
import torch import torch.nn as nn import numpy as np from abc import ABC, abstractmethod import os import logging from .util import metric class CommonLayer(nn.Module, ABC): #Architecture of a common linear (it has to be inherited using say linear layer) def __init__(self, ip_size, op_size, act): #Parameters ...
from mrcp.panel import * from mrcp.points import * from mrcp.track import * class Curve(BaseElement): def __init__(self, pos=(0,0), color=COLOR_TRACK_DEFAULT,radius=2,left=True, up=True) -> None: super().__init__(pos=pos, color=color) self._radius=radius self._left=left self._up=up ...
<filename>scrape_reports.py import requests, json, re, urllib.parse, os from string import Template from bs4 import BeautifulSoup import new_email def read_value(soup, id): value = soup.find(id=id).get('value') if value.lower() == "n/a": return "" else: return value def get_email(email)...
import json import logging import os try: from urllib2 import HTTPError except ImportError: from urllib.error import HTTPError from django.conf import settings from django.contrib.auth import login from django.shortcuts import redirect, render from django.core.paginator import Paginator, EmptyPage, PageNotAnIn...
# Copyright 2018-2019 Capital One Services, 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 ...
<reponame>j-t-t/crash-model from .. import standardize_crashes from data.util import write_geocode_cache from jsonschema import validate import json import os import csv import pandas as pd from pandas.util.testing import assert_frame_equal import geopandas as gpd from shapely.geometry import Point import pytz import p...
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: UTF-8 -*- import mne import numpy as np from . import download as dl import os import glob import zipfile import yaml from scipy.io import loadmat from distutils.dir_util import copy_tree import shutil import pandas as pd BI2014a_URL = 'https://zenodo.org/record/3266...
<filename>erl_tabular_experiments.py import copy import os import re import numpy as np import pandas as pd from sklearn.cluster import KMeans from sklearn.metrics import roc_auc_score, f1_score from sklearn.linear_model import LinearRegression, LogisticRegression from yellowbrick.cluster import KElbowVisualizer from a...
# Copyright 2020-2021 (c) <NAME>, AFOTEK Anlagen für Oberflächentechnik GmbH # Copyright 2021 (c) <NAME>, konzeptpark GmbH # Copyright 2021 (c) <NAME>, ISW University of Stuttagart (for umati and VDW e.V.) # Copyright 2021 (c) <NAME>, VDW - Verein Deutscher Werkzeugmaschinenfabriken e.V. # Imports import os import ...
""" 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. """ from multiset_codec.msbst import ( insert_then_forward_lookup, reverse_lookup_then_remove, to_sequence, forwa...
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from update import BasicUpdateBlock, SmallUpdateBlock from extractor import BasicEncoder, SmallEncoder from corr import CorrBlock, AlternateCorrBlock from utils.utils import bilinear_sampler, coords_grid, upflow8 from utils.warp_util...
import platform import pandas as pd import sklearn import numpy as np import os from sklearn.externals import joblib from sklearn.preprocessing import LabelEncoder from sklearn.pipeline import FeatureUnion, Pipeline from sklearn.preprocessing import StandardScaler from sklearn.preprocessing import OneHotEncoder from sk...
"""Some things you just can't test as unit tests""" import os import subprocess import sys import tempfile import unittest import shutil example = """ def main(): print(gcd(15, 10)) print(gcd(45, 12)) def gcd(a, b): while b: a, b = b, a%b return a """ driver = """ from pyannotate_runtime im...
<gh_stars>0 # coding: utf-8 """ OpenLattice API OpenLattice API # noqa: E501 The version of the OpenAPI document: 0.0.1 Contact: <EMAIL> Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six from openlattice.configuration import Configuration cla...
<filename>decline_adjectives.py import spacy from spacy_iwnlp import spaCyIWNLP nlp = spacy.load('de') iwnlp = spaCyIWNLP(lemmatizer_path='case_dict/IWNLP.Lemmatizer_20181001.json') nlp.add_pipe(iwnlp) #doc = nlp("Wir mögen jene Fußballspiele mit jenen Verlängerungen, welche bei diesem Wetter stattfinden.") #for tok...
#!/usr/bin/env python2 # coding: utf-8 import datetime import logging import os import time import boto3 import s3transfer from botocore.client import Config access_key = '<KEY>' secret_key = '<KEY>' bucket_name = 'renzhi-test-bucket' file_acl = 'public-read' report_interval = 30 mega = 1024.0 * 1024.0 schedule...
import os import io import ast import inspect import pandas as pd import numpy as np from collections import deque, Counter class EndNode(): def __init__(self): """ represent the end of program """ self._fields = "" def __str__(self): return '_ast.Program_End' ...
<filename>src/VerbalizationSpace.py #!/usr/bin/env python3 # coding=utf-8 ####################################################################################### # Copyright (c) 2022, <NAME>, <NAME>, <NAME> - King's College London # All rights reserved. # # Redistribution and use in source and binary forms, with or wit...
# 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 # distributed ...
#!/usr/bin/env python3 import os import argparse import numpy as np import openml from autosklearn.classification import AutoSklearnClassifier from autosklearn.metrics import balanced_accuracy from remove_dataset_from_metadata import remove_dataset import score_ensemble def load_task(task_id): """Function used ...
<gh_stars>0 """Implementation of regularized Hough matching algorithm (RHM)""" import math import torch.nn.functional as F import torch from . import geometry def appearance_similarity(src_feats, trg_feats, cosd=3): r"""Semantic appearance similarity (exponentiated cosine)""" src_feat_norms = torch.norm(sr...
<reponame>timgates42/statsmodels<gh_stars>1-10 # -*- coding: utf-8 -*- """Examples of non-linear functions for non-parametric regression Created on Sat Jan 05 20:21:22 2013 Author: <NAME> """ import numpy as np ## Functions def fg1(x): '''Fan and Gijbels example function 1 ''' return x + 2 * np.exp(-1...
#!/usr/bin/env python3 # # (c) 2020 <NAME> <<EMAIL>> # # Please let me know about your use case of this code! import argparse import chevron import json import re import requests import os from os import path import subprocess from templates import * def optionalize(name, optional=True): return 'Option<{}>'.fo...
import torch from torch import nn from torchvision.models import resnet50, resnet18, resnet34 from torch import einsum import torch.nn.functional as F # from resnet import resnet34 try: from itertools import ifilterfalse except ImportError: from itertools import filterfalse as ifilterfalse class ConvRelu(nn.M...
import math import os import logging from qtpy.QtWidgets import (QWidget, QStyle, QStyleOption) from qtpy.QtGui import (QColor, QPainter, QBrush, QPen, QPolygon, QPolygonF, QPixmap, QMovie) from qtpy.QtCore import Property, Qt, QPoint, QPointF, QSize, Slot, QTimer from qtpy.QtDesigner impor...
import knight class Value(): @classmethod def parse(cls, stream): if not isinstance(stream, knight.Stream): stream = knight.Stream(stream) while stream.matches(r'(?:#.*?(\n|\Z)|\A[\s()\[\]{}:])*'): pass for subcls in [Number, Text, Boolean, Identifier, Null, Ast]: if None != (value := subcls.parse(s...
#!/usr/bin/python from topo_base.fabric_to_vm_inter_vn import FabricToVmInterVn from topo_base.fabric_to_vm_intra_vn import FabricToVmIntraVn from topo_base.vm_to_fabric_inter_vn import VmToFabricInterVn from topo_base.vm_to_fabric_intra_vn import VmToFabricIntraVn from topo_base.vm_to_vm_inter_vn import VmToVmInterVn...
<filename>getmovielens.py<gh_stars>0 import pandas as pd import numpy as np from sklearn.model_selection import KFold from utils.preprocessing import preprocess from utils.kfold import get_kfold import argparse import os random_state = 20191109 np.random.seed(random_state) def main(args): if not os.path.exists(ar...
#!/usr/bin/env python # 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 # # Authors: # - <NAME>, <EMAIL>, 2017 import os import re import glob from t...
import numpy as np import seaborn as sns import matplotlib.pyplot as plt from sympy.solvers import solve from sympy import Symbol from matplotlib import patches import matplotlib.patches as mpatches import scipy.io as sio # plotting configuration ratio = 1.5 figure_len, figure_width = 15*ratio, 12*ratio font_size_1, f...