text
stringlengths
957
885k
<filename>emoter/data/fitness_coach/fitness_coach_corpus.py ("'I'm here to help you learn.'", 'certainty'), ("'I'm here to help you learn.'", 'agreeable'), ("'I'm here to help you learn.'", 'positive'), ("'I'm here to help you learn.'", 'instructive'), ("'I'm here to help you learn.'", 'emphatic'), ("'I am here to help...
<reponame>kielni/megapis-python<gh_stars>0 import re import sys from bs4 import BeautifulSoup import requests from megapis.tasks.task_base import TaskBase DEFAULT_CONFIG = { 'apiKey': '', 'steamId': '', 'libraryUrl': '', 'excludeTags': '+|Valve|Valve Anti-Cheat enabled|Steam Trading Cards|Captions av...
<gh_stars>1-10 import math from tensorflow.keras.models import Sequential from tensorflow.keras.layers import * import tensorflow_probability as tfp import tensorflow as tf tfd = tfp.distributions def create_feature_extractor_block(x, units): # x = Dense(16, activation='relu')(x) # x = BatchNormalization()(x) # x...
<reponame>JustinPedersen/maya_fspy """ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. Usage: import maya_fspy.ui as mfspy_ui mfspy_ui.maya_fspy_ui() Note t...
<reponame>dmarvs/bfg-nets<filename>bfgn/tests/reporting/visualizations/test_samples.py<gh_stars>1-10 import numpy as np import pytest from bfgn.reporting.visualizations import samples @pytest.fixture() def mock_sampled(tmp_path) -> object: class MockDataBuild: window_radius = 2 loss_window_radius...
<reponame>MihailMiller/OpenAlchemy """Integration tests against database for relationships.""" import pytest from sqlalchemy.ext import declarative import open_alchemy @pytest.mark.integration def test_many_to_one(engine, sessionmaker): """ GIVEN specification with a schema with a many to one object relatio...
# Copyright 2021 <NAME> <EMAIL> # # 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 writin...
# -*- coding: utf-8 -*- #BEGIN_HEADER import sys import traceback from biokbase.workspace.client import Workspace as workspaceService import requests requests.packages.urllib3.disable_warnings() import subprocess import os import re from pprint import pprint, pformat from datetime import datetime import uuid ## SDK Ut...
<reponame>MarkusShepherd/flamme-rouge # -*- coding: utf-8 -*- """ tracks """ import logging import re from collections import deque from typing import ( TYPE_CHECKING, Any, Deque, Generator, Iterable, Iterator, Optional, Tuple, Type, Union, cast, overload, ) from .car...
from __future__ import print_function import numpy as np from openmdao.api import ExplicitComponent class VLMMtxRHSComp(ExplicitComponent): def initialize(self): self.options.declare('surfaces', types=list) def setup(self): surfaces = self.options['surfaces'] system_size = 0 ...
<gh_stars>0 # ----------------------------------------------------------------------------- # Copyright (c) 2009-2016 <NAME>. All rights reserved. # Distributed under the (new) BSD License. # ----------------------------------------------------------------------------- import numpy as np from glumpy import app, gl, glo...
<gh_stars>0 import logging from datetime import datetime from Common.Objects.Generic import GenericObject import Common.Objects.Datasets as Datasets import Common.Objects.Samples as Samples class Code(GenericObject): def __init__(self, name, parent=None, key=None): GenericObject.__init__(self, name=name, ...
<reponame>knaaptime/proplot<filename>proplot/internals/warnings.py #!/usr/bin/env python3 """ Custom warning style and deprecation functions. """ import functools import re import sys import warnings ProPlotWarning = type('ProPlotWarning', (UserWarning,), {}) def _warn_proplot(message): """ Emit a `ProPlotWa...
<filename>archs/R2plus1D.py<gh_stars>0 import torch.hub import torch.nn as nn from einops.layers.torch import Rearrange, Reduce from torchvision.models.video.resnet import VideoResNet, BasicBlock, R2Plus1dStem, Conv2Plus1D model_urls = { "r2plus1d_34_8_ig65m": "https://github.com/moabitcoin/ig65m-pytorch/releases...
<reponame>rfrye-github/ixnetwork_restpy<gh_stars>0 # MIT LICENSE # # Copyright 1997 - 2020 by IXIA Keysight # # 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, includ...
import dash import dash_core_components as dcc import dash_html_components as html import dash_table_experiments as dt from dash.dependencies import Input, Output, State from propnet import log_stream from propnet.web.layouts_models import model_layout, models_index from propnet.web.layouts_symbols import symbol_layo...
from __future__ import annotations import json import re from dataclasses import MISSING from dataclasses import Field from dataclasses import asdict from datetime import datetime from pathlib import Path from typing import Any, Callable, Dict, List, Literal, Optional, Tuple, Type, TypeVar, Union T = TypeVar("T") Jso...
<filename>loom/crossvalidate.py # Copyright (c) 2014, Salesforce.com, Inc. All rights reserved. # Copyright (c) 2015, Google, Inc. # # 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 ...
################################################################################ # Imports from django.test import TestCase from ..helperFuncsForTesting import getInfoPost, setUpHelper from .views import ERROR, FAIL, INCORRECT_CREDENTIALS, INCORRECT_FIELDS, STATUS, SUCCESS ##########################################...
<reponame>omad/datacube-experiments import click import os import pathlib import logging from create_tiles import calc_output_filenames, create_tiles, list_tile_files from ingester.utils import preserve_cwd from netcdf_writer import append_to_netcdf, MultiVariableNetCDF, SingleVariableNetCDF import eodatasets.drivers i...
############################################################################### # # The MIT License (MIT) # # Copyright (c) Tavendo GmbH # # 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 with...
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
<filename>mowgli/model/datasets.py import pickle import csv import numpy as np import tensorflow as tf import tensorflow_text as text from tensorflow.keras.preprocessing.text import Tokenizer from tensorflow_core.python.keras import backend as K from tensorflow_core.python.keras import layers from mowgli.utils import...
<reponame>kstoreyf/TreeCorr<gh_stars>0 # Copyright (c) 2003-2015 by <NAME> # # TreeCorr is free software: redistribution and use in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # 1. Redistributions of source code must retain the above copyrig...
<reponame>zynga/jasy<gh_stars>10-100 # # Jasy - Web Tooling Framework # Copyright 2010-2012 Zynga Inc. # import os import jasy.core.Console as Console from jasy.core.Permutation import getPermutation from jasy.item.Class import ClassError from jasy.js.Resolver import Resolver from jasy.js.Sorter import Sorter from j...
<filename>Data.py import csv from operator import sub import numpy as np import pandas as pd from pandas import Series, DataFrame import matplotlib.pyplot as plt from zmq import has with open(r'C:\Users\j_ney\Python\Python Project Medical Insurance Analysis\insurance.csv', 'r') as insurance_data_csv: insurance_dat...
<filename>tests/test_deserialize.py<gh_stars>0 """Test deserializing.""" import os import sys from typing import Any, Callable, Dict, List, Optional, Pattern, Tuple, Union import unittest sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) # pylint: disable=wrong-import-position import ...
import contextlib import os import subprocess from python2.client.client import Py2Client class Python2: """ Object representing a Python 2 session. Initializing a `Python2` object spawns a Python 2 subprocess. To terminate the subprocess, use the `Python2.shutdown()` method. A `Python2` object ...
<filename>opt/snobfit/python/SQSnobFit/_snobupdt.py from __future__ import print_function # Python version of SNOBFIT v2.1 "snobfit.m" MATLAB version by <NAME>. # # Modified and redistributed with permission. # Original copyright and license notice: # # Copyright (c) 2003-2008, <NAME> # All rights reserved. # # Redist...
<reponame>chmp/mdnav from __future__ import print_function import collections import json import os.path import re import sys import subprocess import webbrowser try: from urllib.parse import urlparse except ImportError: from urlparse import urlparse class FakeLogger(object): def __init__(self, active=F...
<reponame>t2y/python-study import sys import pytest from boyer_moore_horspool import boyer_moore_horspool_search from brute_force_search import brute_force_search from simplified_boyer_moore import simplified_boyer_moore_search from boyer_moore_sunday import boyer_moore_sunday_search, make_qs_table from utils import ...
<reponame>fakegit/asciimatics # -*- coding: utf-8 -*- """ This module implements a fire effect renderer. """ from __future__ import division from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from builtins import range import copy from random import rand...
<reponame>itsraina/keras # Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
<reponame>pruthvireddypuresoftware/journald-2-cloudwatch from unittest import TestCase from unittest.mock import patch, mock_open, Mock import os import json import urllib.request from main import Format, IDENTITY_DOC_URL, get_instance_identity_document IDENTITY_DOC_STR = b'''{ "devpayProductCodes" : null, "avail...
import json import logging import netaddr import random from powergslb.server.http.handler.abstract import AbstractContentHandler import powergslb.monitor import powergslb.database __all__ = ['PowerDNSContentHandler'] class PowerDNSContentHandler(AbstractContentHandler): """ PowerDNS content handler ...
<reponame>rimmartin/cctbx_project<gh_stars>0 from __future__ import division from cctbx import crystal from libtbx.utils import Sorry, date_and_time, multi_out import iotbx.phil from iotbx import reflection_file_reader from iotbx import reflection_file_utils from iotbx import crystal_symmetry_from_any import mmtbx.scal...
<gh_stars>10-100 from unittest import mock from unittest.mock import MagicMock import pytest from airflow.exceptions import AirflowException, TaskDeferred from airflow.models import DAG from airflow.models.dagrun import DagRun from airflow.models.taskinstance import TaskInstance from airflow.utils.timezone import date...
""" This module contains a class to represent a Tichu Deck. """ import random from env.card import Card from env.cards import Cards class Deck(): """ A class to represent a Tichu Deck. Contains instances of all Cards in a Tichu deck. Attributes ---------- all_cards: list of Card A lis...
<filename>mmc_export/Helpers/resourceAPI.py import asyncio from collections import namedtuple from datetime import datetime from json import loads as parse_json from pathlib import Path from re import compile as re_compile from urllib.parse import urlparse from zipfile import ZipFile import tenacity as tn from aiohttp...
# ============================================================================ # # Copyright (C) 2007-2016 Conceptive Engineering bvba. # www.conceptive.be / <EMAIL> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: ...
<reponame>AlexRogalskiy/splitgraph """Module imported by Multicorn on the Splitgraph engine server: a foreign data wrapper that communicates to Socrata datasets using sodapy.""" import json import logging from typing import Any, Dict, Optional import splitgraph.config from splitgraph.config import get_singleton from s...
<gh_stars>0 """Client side message class Authors: <NAME> <EMAIL> Date: 02.05.2020 """ import sys import selectors import json import io import struct class Message: def __init__(self, selector, sock, addr, request): self.selector = selector self.sock = sock self.addr = addr ...
<reponame>benebjoern/XAI_MovieBot<filename>moviebot/controller/messenger.py """This file contains a Messenger class which sends post requests to the facebook API.""" import requests class Messenger: def __init__(self, user_id, token): """Initializes structs and uri's for Messenger.""" self.user_...
<filename>workchains/wc_phonon.py<gh_stars>0 # Works run by the daemon (using submit) from aiida import load_dbenv, is_dbenv_loaded if not is_dbenv_loaded(): load_dbenv() from aiida.work.workchain import WorkChain, ToContext from aiida.work.workfunction import workfunction from aiida.work.run import run, submit,...
<filename>json_settings/number_setting.py<gh_stars>0 from numpy import linspace import json_settings as js class NumberSetting(js.TerminusSetting): """The special Terminus variant that is for numerical values. This class support range values in the form of arrays of min/max/num definitions. Attribu...
import pandas as pd from settings.language_strings import LANGUAGE_RECOMMENDER_ALGORITHMS_STOP, \ LANGUAGE_RECOMMENDER_ALGORITHMS_START from posprocessing.distributions import multiprocess_get_distribution from processing.multiprocessing_recommender import all_recommenders_multiprocessing from processing.singlepro...
import argparse def get_args(): parser = argparse.ArgumentParser(description='Run QTL analysis given genotype, phenotype, and annotation.') parser.add_argument('--bgen','-bg',required=False) parser.add_argument('--plink','-pg',required=False) parser.add_argument('--annotation_file','-af', required=True...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import keystoneclient.v2_0.client as ksclient import glanceclient.v2.client as glclient from novaclient import client from datetime import datetime ## #Max old snapshot count snap_max = 2 def get_keystone_creds(): try: d = {} d['...
<reponame>constantinpape/cluster_tools #! /usr/bin/python import os import sys import json import numpy as np import luigi import nifty.tools as nt import cluster_tools.utils.volume_utils as vu import cluster_tools.utils.function_utils as fu from cluster_tools.cluster_tasks import SlurmTask, LocalTask, LSFTask cla...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "<NAME>" __copyright__ = "Copyright 2022, TheCodingJ's" __credits__: "list[str]" = ["<NAME>"] __license__ = "MIT" __name__ = "HBNI Audio Stream Listener" __version__ = "v1.3.0" __updated__ = '2022-02-20 14:50:16' __maintainer__ = "<NAME>" __email__...
<reponame>CornellDataScience/Deep-Learning-Crash-Course<filename>03-Convolutional-Neural-Networks/cnn_train.py<gh_stars>10-100 """ Train a CNN on the CIFAR-10 dataset. Adapted from https://github.com/tensorflow/models/blob/master/tutorials/image/cifar10 """ import argparse import os import numpy as np import tarfile i...
from skmultiflow.data import MultilabelGenerator from skmultiflow.meta.classifier_chains import ClassifierChain, MCC, ProbabilisticClassifierChain from skmultiflow.data import make_logical from sklearn.linear_model import SGDClassifier import numpy as np def test_classifier_chains(): stream = MultilabelGenerat...
""" mfsub module. Contains the ModflowSub class. Note that the user can access the ModflowSub class as `flopy.modflow.ModflowSub`. Additional information for this MODFLOW package can be found at the `Online MODFLOW Guide <http://water.usgs.gov/ogw/modflow/MODFLOW-2005-Guide/sub.htm>`_. """ import sys imp...
from posixpath import join as urljoin import requests from ._meta import __project_link__, __project_name__, __version__ from .models import Category, Page, Post, PostRevision, PostStatus, Tag class WordPress(object): def __init__(self, url, verify_ssl=True): """ WordPress Library. Arg...
import os import configparser import functools from click.globals import get_current_context import click import keyring from ..api import APIClient, API_URL from ..core import MWDB from ..exc import MWDBError class MwdbAuthenticator(object): CONFIG_PATH = os.path.expanduser("~/.mwdb") CONFIG_FIELDS = [ ...
<filename>batch_processing_solution.py # coding: utf-8 # Image Analysis with Python - Solution for Batch Processing # The following is the script version of the tutorial's solution pipeline, where all the code # has been wrapped in a single function that can be called many times for many images. # Please refer to th...
""" Allows people in Dublin to ask the Google assistant when their bus is coming to a particular bus stop. This module provides a web service using the falcon framework which receives and responds to requests from Google's Dialogflow. The actual information is obtained by doing some good old scrapin' of the RTPI.ie si...
# -*- coding: utf-8 -*- ########### # IMPORTS # ########### # Libraries import numpy as _np import numpy.testing as _npt import pytest as _pt # Internal from pydtmc import ( MarkovChain as _MarkovChain ) ######### # TESTS # ######### def test_absorption_probabilities(p, absorption_probabilities): mc =...
<gh_stars>10-100 from sys import argv import os import pandas as pd import numpy as np from sklearn.preprocessing import OneHotEncoder from tensorflow import ConfigProto, Session from tensorflow.keras import backend as K from tensorflow.keras.models import Model from tensorflow.keras.layers import Dropout, Dense, Input...
""" Copyright 2020 The Magma Authors. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES O...
""" Stochastic Shortest Paths - Dynamic Static Model The code implementing the basic model for the Static Version. This implements the class, do not try to run this code. Run the DynamicModel_main instead. Author: <NAME> """ from collections import (namedtuple, defaultdict) import math import numpy as np import...
<gh_stars>1-10 from __future__ import annotations # for python 3.8 from pathlib import Path from PyQt6 import QtCore, QtGui, QtWidgets from PyQt6.QtWidgets import QWidget, QFileDialog, QStyle, QFrame from agstoolbox.core.settings import ConstSettings from agstoolbox.core.utils.file import dir_is_valid class DirLis...
'''Database Models for the Kookboek application''' from home_portal.extensions import db_kookboek as db class RecipesIngredients(db.Model): ''' The RecipiesIngredients class defines the attributes required to create a many-to-many relationship between recipes and ingredients. It also contains the ...
from .testdefs import * name_tests( # syntax syntax = cmp("func f(): {}"), syntax_args = cmp("func f(a, b:Int=2)->T: {}"), # format format_enter = cmp("func f():\n\t1\n\t2"), format_single = cmp("func f(): 1"), format_strip = cmp("func f(): {;0;}", "func f(): 0"), format_anon ...
import re from datetime import datetime from time import mktime from discord import Embed, Forbidden, HTTPException from discord.ext import commands, tasks from discord.ext.commands import BadArgument from discord_slash import SlashContext, cog_ext, SlashCommandOptionType from discord_slash.utils import manage_command...
#!/usr/bin/env python """ matrix_utils.py: utilities for matrix conversion This file defines the to_matrix() function, which can be used to convert Pandas dataframes or other types of array-like objects to numpy ndarrays for use in mlpack bindings. mlpack is free software; you may redistribute it and/or modify it und...
<gh_stars>0 # Copyright (c) 2018, Novo Nordisk Foundation Center for Biosustainability, # Technical University of Denmark. # # 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.ap...
<reponame>Media-Smart/volkstuner import json import logging import multiprocessing as mp import os import pickle import threading import time import copy from collections import OrderedDict from tqdm.auto import tqdm from .reporter import DistStatusReporter, FakeReporter from .resource import DistributedResource from...
<filename>buzzard/_env.py<gh_stars>0 """>>> help(buzz.env) >>> help(buzz.Env) """ import threading from collections import namedtuple import cv2 from osgeo import gdal, ogr, osr from buzzard._tools import conv, Singleton try: from collections import ChainMap except: # https://pypi.python.org/pypi/chainmap ...
#!/usr/bin/python3 # tic-tac-toe.py from random import * play = True def printGrid(): grid = "-------------" + "\n" + \ "| " + a + " | " + b + " | " + c + " | " + "\n" + \ "| " + d + " | " + e + " | " + f + " | " + "\n" + \ "| " + g + " | " + h + " | " + i + " | " + "\n" + \ "--------...
<gh_stars>0 # coding: utf-8 from __future__ import unicode_literals try: import urllib2 except ImportError: import urllib3 import requests from taggit.managers import TaggableManager from django.core.exceptions import ImproperlyConfigured from django.db import models from django.conf import settings from dja...
<filename>sunpy/net/dataretriever/sources/tests/test_goes_suvi.py import tempfile import pytest from hypothesis import given import astropy.units as u import sunpy.net.dataretriever.sources.goes as goes from sunpy.net import Fido from sunpy.net import attrs as a from sunpy.net.dataretriever.client import QueryRespon...
<filename>Code/ml_pipeline/model/Classification.py import os import pandas as pd import numpy as np from numpy import mean from numpy import std import random from sklearn.model_selection import RandomizedSearchCV from sklearn.model_selection import GridSearchCV from sklearn.model_selection import StratifiedKFold from...
<filename>cogs/botbrain/help.py<gh_stars>1-10 import logging from typing import List, Union import discord from discord.ext import commands from naotimes.bot import naoTimesBot, naoTimesContext from naotimes.helpgenerator import HelpField, HelpOption POSISI_TEXT = ", ".join(["TL", "TLC", "ENC", "ED", "TM", "TS", "QC...
<gh_stars>100-1000 from __future__ import unicode_literals import mock import unittest import pytest import pytz from django.utils import timezone from nose.tools import * # noqa from framework.auth import Auth from addons.osfstorage.models import OsfStorageFile, OsfStorageFileNode, OsfStorageFolder from osf.models...
#!/usr/bin/env python ############################################################## # universal core routines for processing SAR images with GAMMA # <NAME> 2014-2019 ############################################################## """ This module is intended as a set of generalized processing routines for modularized G...
<filename>networkapiclient/EventLog.py<gh_stars>10-100 # -*- coding:utf-8 -*- # 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...
<filename>serialFootPedalControl.py<gh_stars>1-10 import serial #from library PySerial import keyboard import json configFile = open("pedalConfig.json").read() configData = json.loads(configFile) numPedals = configData["numPedals"] #press actions (order in array is index of pedal) onKey = configData["onKey...
# coding=utf-8 # Copyright 2019 The SEED Authors # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
<reponame>dvekeman/gamification-engine # -*- coding: utf-8 -*- """models including business logic""" import datetime import logging from collections import defaultdict from datetime import timedelta import hashlib import pytz import sqlalchemy.types as ty from dateutil import relativedelta from sqlalchemy.dialects.po...
import asyncio import os import aiohttp from prometheus_client import ( CollectorRegistry, generate_latest, ) from .app_outgoing_elasticsearch import ( ESMetricsUnavailable, es_bulk_ingest, es_feed_activities_total, es_searchable_total, es_nonsearchable_total, create_activities_index, ...
<reponame>Reclusive-Trader/upbit-client # coding: utf-8 """ Upbit Open API ## REST API for Upbit Exchange - Base URL: [https://api.upbit.com] - Official Upbit API Documents: [https://docs.upbit.com] - Official Support email: [<EMAIL>] # noqa: E501 OpenAPI spec version: 1.0.0 Contact: <EMAIL> Ge...
#!/usr/bin/python # # This file is part of Ansible # # Ansible 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. # # Ansible is distribut...
<reponame>mshonichev/example_pkg<gh_stars>10-100 #!/usr/bin/env python3 # # Copyright 2017-2020 GridGain Systems. # # 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/lic...
import os import re import time import tempfile import traceback import smtplib try: from email.mime.text import MIMEText except ImportError: from email.MIMEText import MIMEText import Atlassian import utility import grapeGit as git import grapeMenu import grapeConfig import resumable import stashy.stashy.erro...
<filename>pylearn2/utils/logger.py """Local facilities to configure the logger to our needs.""" __author__ = "<NAME>" __copyright__ = "Copyright 2012, Universite de Montreal" __credits__ = ["<NAME>"] __license__ = "3-clause BSD" __email__ = "<EMAIL>" __maintainer__ = "<NAME>" # Portions cribbed from the standard libr...
from functools import partial from ipaddress import IPv4Address, IPv6Address from socket import AddressFamily # pylint: disable=no-name-in-module from typing import List, Literal, Tuple, Union, cast from wsgiref.handlers import format_date_time import h11 from anyio import BrokenResourceError, EndOfStream, create_tcp...
<reponame>bcgov/wps-api<filename>app/models/process_grib.py """ Read a grib file, and store values relevant to weather stations in database. """ import math import struct import logging import logging.config from typing import List from sqlalchemy.dialects.postgresql import array import sqlalchemy.exc import gdal impo...
<filename>test/data/generate_fmm_data.py # Script to be run with legacy Bempp to generate the comparison data. import bempp.api import numpy as np import os.path import sys # run `python generate_fmm_data.py REGENERATE` to regenerate everything REGENERATE = "REGENERATE" in sys.argv data = {} def generate_vector(si...
<filename>code/main.py import numpy as np import pandas as pd import time import logging import pprint import work_data import config def main(): logger = config.config_logger(__name__, 10) t0 = time.time() pdf_path = './data/pdf/' txt_path = './data/txt/' dict_path = './data/dict/' output_p...
import torch import torch.nn as nn from layers import NodeAttentionLayer, SemanticAttentionLayer, GRUSet2Set, AvgReadout, GATLayerImp3 class HEncoder(nn.Module): def __init__(self, nfeat, nhid, shid, alpha, nheads, mp_num, device): """Dense version of GAT and semantic level aggregation(soft attention)""" ...
<filename>src/board.py """Contains Connect 4 AI Game Implementation, such as the Board and other useful functions """ import numpy as np from typing import Dict import board_utl BOARD_ROWS: int = 6 BOARD_COLUMNS: int = 7 class Board: """Represents a board for a game of connect 4 """ def __init__(self): ...
<reponame>hinczhang/OSPyQGIS # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'MainDlg.ui' # # Created by: PyQt5 UI code generator 5.13.0 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import QApplication ...
import unittest from ctypes import ArgumentError import os import numpy as np from sdl2 import * from glaze.GL import * BASEPATH = 'shots_results' def getSDLError(): sderr = SDL_GetError() try: sderr = sderr.decode() except Exception: pass return sderr class OGL3Tester(unittest.Tes...
<reponame>alex-dudin/Aspose.Words-for-Python-via-.NET # Copyright (c) 2001-2022 Aspose Pty Ltd. All Rights Reserved. # # This file is part of Aspose.Words. The source code in this file # is only intended as a supplement to the documentation, and is provided # "as is", without warranty of any kind, either expressed or i...
import parslepy import parslepy.base import parslepy.selectors import lxml.cssselect from nose.tools import * from .tools import * class TestInvalidParseletInit(object): init_parselets = ( #{ "title": ".test #"}, # this does not raise SyntaxError in lxml<3 { "title": "/h1[@]"}, { "title": "...
import unittest import datetime import expediaRequester """ The data returned will be different at different times. Hence we just validate if we are getting a OK response. """ apiKey = "" class TestCases(unittest.TestCase): """ Base class for test cases """ def setUp(self): self.client = expe...
from django.shortcuts import render, redirect from siruco.db import Database from django.http import HttpResponse from datetime import date, datetime from django.contrib import messages import json def reservasi(request): response = {} peran = session(request, 'peran') if peran == "admin_satgas": # read all reserva...
class DerivationStep: """Step within an axiomatic derivation. Parameters ---------- content: logics.classes.propositional.Formula The formula present in the step justification: str The name of the rule or axiom used in obtaining this step. May be 'premise' as well. on_steps: lis...
<filename>3dmap-master/data/translator/Translator/kmlSorter.py ### IMPORTS ### ## KML ## from copy import deepcopy from math import floor import sys, argparse from time import time from lxml import etree from pykml import parser as kml_parser from pykml.factory import KML_ElementMaker as KML import numpy as np de...