text
stringlengths
957
885k
<filename>tehbot/plugins/challenge/hs.py<gh_stars>1-10 from tehbot.plugins.challenge import * import urllib.request, urllib.error, urllib.parse import urllib.parse import lxml.html import re url1 = "http://www.happy-security.de/utilities/hotlink/userscoring.php?username=%s" url2 = "http://www.happy-security.de/?modul=...
<filename>production_scheduling_shrdc/production_scheduling_shrdc/doctype/frepple_integration/frepple_integration.py # -*- coding: utf-8 -*- # Copyright (c) 2022, DCKY and contributors # For license information, please see license.txt from __future__ import unicode_literals # import frappe from frappe.model.document i...
import os import re import sys import copy import json import logging import configparser from androguard.misc import * from androguard.core import * from analysis_utils import AnalysisUtils from common import Conversions, JandroidException TRACE_FORWARD = 'FORWARD' TRACE_REVERSE = 'REVERSE' STOP_CONDITION_TRUE = 'Tr...
<gh_stars>10-100 # coding: utf-8 """ Test i18n class """ from __future__ import unicode_literals, absolute_import from mock import MagicMock, patch, mock_open import pytest import sugar.lib.i18n from sugar.utils.jid import jidstore # pylint: disable=W0621,R0201,R0201,W0612 @pytest.fixture def gettext_class(): ""...
<reponame>AntoninoScala/air-water-vv from proteus import StepControl from math import * import proteus.MeshTools from proteus import Domain, Context from proteus.default_n import * from proteus.Profiling import logEvent from proteus.mprans import SpatialTools as st from proteus import Gauges as ga from proteus import W...
<filename>tfx/components/infra_validator/model_server_runners/kubernetes_runner_test.py # Lint as: python2, python3 # Copyright 2020 Google LLC. 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 ...
<reponame>FranzAlbers/teb_local_planner #!/usr/bin/env python # Author: <EMAIL> import rospy, math, tf from teb_local_planner.msg import ObstacleMsg from geometry_msgs.msg import PolygonStamped, Point32, QuaternionStamped, Quaternion, TwistWithCovariance from tf.transformations import quaternion_from_euler def publ...
import numpy as np import pandas as pd import pickle import seaborn as sns import matplotlib.pyplot as plt from IPython.display import clear_output from sklearn.preprocessing import MinMaxScaler, StandardScaler from sklearn.model_selection import train_test_split from sklearn.metrics import confusion_matrix from sklea...
from django.shortcuts import render from django.views.generic import TemplateView from django.views.generic.list import ListView from django.http import JsonResponse from django.db.models import Count from .models import ChartConfig from editions.models import Edition, Period from browsing.filters import EditionListFil...
from django.contrib.auth import get_user_model from django.contrib.auth.password_validation import validate_password from django.core.exceptions import ValidationError from django.test import TestCase, override_settings from django_password_validators.password_history.password_validation import UniquePasswordsValidato...
from tkinter import * from tkinter import messagebox from io import open import sqlite3 #Functions #savebookmark: Create the database and save the bookmark def savebookmark(): #In the case that the database does not exist it creates it and also the HTML file try: myconnection=sqlite3....
<reponame>chongiadung/choinho #!/usr/bin/env python # encoding: utf-8 """ scraper_webapp.py Created by <NAME> on 2013-01-09. Copyright (c) 2013 CGD Inc. All rights reserved. """ import json from common import util_crawler as uc import web import os import config from common import util_rest as ur import crawled_produ...
# coding=utf-8 # Copyright 2021 The Trax 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 a...
<filename>lib/sqlalchemy/util/__init__.py # util/__init__.py # Copyright (C) 2005-2022 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: https://www.opensource.org/licenses/mit-license.php from collections import defaultdict as ...
<filename>src/vivarium/framework/artifact/hdf.py """ ============= HDF Interface ============= A convenience wrapper around the `tables <https://www.pytables.org>`_ and :mod:`pandas` HDF interfaces. Public Interface ---------------- The public interface consists of 5 functions: .. list-table:: HDF Public Interface ...
# *-* coding: utf-8 *-* # 抓取东方财富上的上市公司公告 # http://data.eastmoney.com/notices/ # 代码版本 python 2.7 IDE:PyCharm import requests from random import random import json import xlrd import xlwt import time import math import urllib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email....
import pytz from datetime import datetime, timedelta import numpy as np import pandas as pd import os import settings import time import random """ Convert dates to default format and timezone """ def convert_datetime_with_timezone(date, time_zone = settings.DEFAULT_TIME_ZONE, format_date=settings.DEFAULT_FORMAT):...
<gh_stars>0 from __future__ import print_function, division, absolute_import import sys import math import time import numpy as np import theano from matplotlib import pyplot as plt try: import seaborn except: pass # =========================================================================== # Progress bar ...
# -*- coding: utf-8 -*- """ Created on Thu Apr 23 23:02:12 2020 @author: Connor This file will be my CFB risk modules. """ # # Imports # import requests as reqs import numpy as np import matplotlib.pyplot as plt from scipy.special import erf _BASE ="https://collegefootballrisk.com/api" _SEASON = 1 plt.style.use("b...
#!/usr/bin/env python # -*- coding: utf-8 -*- """This module define the Frames available for computation and their relations to each other. The relations may be circular, thanks to the use of the Node class. .. code-block:: text ,---. ,-------. ,----. |G50|---bias---|EME2000|..bias..|GCRF| ...
# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All contributing project au...
<filename>updateASpace.py import os import csv import openpyxl import argparse argParse = argparse.ArgumentParser() argParse.add_argument("package", help="Package ID in Processing directory.") argParse.add_argument("-f", "--file", help="File name of spreadsheet to be updated. If no files are listed, all will be...
#!/usr/bin/env python # -*- coding: utf-8 -*- # 2020, <NAME> import multiprocessing as mp import unittest from typing import Iterable import numpy as np import pandas as pd from ..core.computation import Engine class EngineTest(unittest.TestCase): """ Tests `computation.Engine` class. """ def set...
import re class Blocks: def __init__(self): self.errors = [] self.blocks = {} # block format: { blockname : [blocktype,blockcontent,bconditional] } self.cblock = '' # current block name self.order = [] # keep the blockname indexes of self.blocks in order processed here # return True if open tag found, Fa...
<filename>portfolio/Python/scrapy/outillage/pixmania_spider.py #!/usr/bin/python # -*- coding: latin-1 -*- import os from scrapy import log from scrapy.http import Request from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.utils.url import urljoin_rfc from product_spiders.i...
""" Contains functions to fetch API information from last.fm API.""" import logging import youtube import util.web CHART_URL = 'http://lastfm-ajax-vip1.phx1.cbsig.net/kerve/charts?nr={0}&type=track&format=json' TAG_SEARCH_URL = 'http://lastfm-ajax-vip1.phx1.cbsig.net/kerve/charts?nr={0}&type=track&f=tag:{1}&...
#!/usr/bin/python3.4 # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab # 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 app...
# Problem Set 6: Simulating robots # Name: # Collaborators: # Time: import math import random import ps6_visualize import pylab # === Provided classes class Position(object): """ A Position represents a location in a two-dimensional room. """ def __init__(self, x, y): """ Initializ...
import torch import torch.nn as nn import torch.nn.functional as F class CausalConv1d(nn.Conv1d): def __init__(self, input_size, hidden_size, kernel_size, stride=1, dilation=1, groups=1, bias=True...
<reponame>sundararajan20/edgetpuvision<filename>edgetpuvision/detect.py # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LIC...
import numpy as np from matplotlib import pyplot as plt from keras.callbacks import Callback from functools import reduce import pyvips as Vips import random format_to_dtype = { 'uchar': np.uint8, 'char': np.int8, 'ushort': np.uint16, 'short': np.int16, 'uint': np.uint32, 'int': np.int32, '...
#!/usr/bin/env python # coding: utf-8 # ### Create player training dataset for player model # # - Get all able players, loop through their history, append game features of those games # - Recieve the predicted scoreline to make dataset ready for prediction # In[1]: import numpy as np import pandas as pd pd.option...
<filename>model_zoo/research/cv/AttGAN/eval.py # Copyright 2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
"""Defines for FAST Boards.""" HARDWARE_KEY = { "fast": '2000', "sys11": '1100', "wpc89": '8900', "wpc95": '9500' } RETRO_SWITCH_MAP = { # Name HEX DEC 'S11': '00', # 00 'S12': '01', # 01 'S13': '02', # 02 'S14': '03', # 03 'S15': '04', # 04 'S16': '05', # 05 ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import random import pcraster import pcraster.framework.dynamicPCRasterBase as dynamicPCRasterBase import pcraster.framework.mcPCRasterBase as mcPCRasterBase import pcraster.framework.pfPCRasterBase as pfPCRasterBase import pcraster.framework.staticPCRasterBase as staticPCR...
""" Toy example of navigating through text to find the answer to a query. This is the simplest possible version of the problem. """ from control4.core.mdp import MDP from control4.config import floatX import numpy as np def idx2onehot(i,n): out = np.zeros(n,floatX) out[i] = 1 return out class TextNavSta...
<filename>merge_vars.py<gh_stars>0 import torch import numpy as np import pandas as pd import os import sys from torchsummary import summary import torch.nn as nn from collections import defaultdict import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt matplotlib.style.use('ggplot') import seaborn as ...
<gh_stars>10-100 # Copyright 2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
<gh_stars>1-10 """ dictator ~~~~~~~~ Structured data validation library. :copyright: (c) 2015 by <NAME>. :license: BSD, see LICENSE.txt for more details. """ import string import datetime import collections from functools import wraps from itertools import imap, izip, chain __all__ = ('Boolean',...
<reponame>umimori13/mai-bot import random import imageio from io import BytesIO from typing import List, Tuple from PIL.Image import Image as IMG from PIL import Image, ImageDraw, ImageFilter from .download import get_resource def resize(img: IMG, size: Tuple[int, int]) -> IMG: return img.resize(size, Image.ANTI...
<filename>src/qt_classes.py """Defines classes to be used with Qt.""" import config from path_finding.mission_planner import MissionPlanner from PySide2.QtCore import Property from PySide2.QtCore import QAbstractListModel from PySide2.QtCore import QModelIndex from PySide2.QtCore import QObject from PySide2.QtCore impo...
from parcels import (FieldSet, ParticleSet, JITParticle, Variable, AdvectionRK4) import numpy as np import math from datetime import timedelta as delta import time as clock import os from argparse import ArgumentParser from mpi4py import MPI p = ArgumentParser(description=""" blablabla""") p.add_...
############################################################################### ## ## Copyright (C) 2013-2014 Tavendo GmbH ## ## 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 ## ## h...
<gh_stars>100-1000 __version__ = "$Id$" __docformat__ = "reStructuredText" import warnings from typing import TYPE_CHECKING, Any, Callable, Dict, Optional if TYPE_CHECKING: from .space import Space from ._chipmunk_cffi import ffi from .arbiter import Arbiter _CollisionCallbackBool = Callable[[Arbiter, "Space", ...
from pathlib import Path from helios.text import Encoding import chardet import difflib import re from binaryornot.check import is_binary _PATTERN_DIFF_LINE_INFO = re.compile(r"^@@[\x00-\x7f]*@@$") _PATTERN_DIFF_LINE_LEFT = re.compile(r"^-[\x00-\x7f]*") _PATTERN_DIFF_LINE_RIGHT = re.compile(r"^\+[\x00-\x7f]*") class...
import logging from typing import Optional import gaphas.segment # Just register the handlers in this module from gaphas.freehand import FreeHandPainter from gaphas.painter import ( BoundingBoxPainter, FocusedItemPainter, HandlePainter, ItemPainter, PainterChain, ToolPainter, ) from gaphas.too...
<reponame>ssic7i/Slavs_time # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'C:\Users\sshejko.TIV\Dropbox\slav_time\slav_time_gui.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8...
<gh_stars>0 import ephyviewer import numpy as np import os from ephyviewer.tests.testing_tools import make_video_file def test_InMemoryAnalogSignalSource(): signals = np.random.randn(1000000, 16) sample_rate = 10000. t_start = 0. source = ephyviewer.InMemoryAnalogSignalSource(signals, sample_rate...
<gh_stars>0 # AUTOGENERATED! DO NOT EDIT! File to edit: 04_plotting.ipynb (unless otherwise specified). __all__ = ['DEFAULT_COLORS', 'plot_2d_sta', 'plot_cross_correlation', 'plot_2d_fit', 'plot_ds_wheel', 'plot_dark_white_response', 'plot_fl_bars', 'plot_t_sta', 'plot_chirp', 'plot_chirpam_fit', ...
<gh_stars>1-10 # vCloud CLI 0.1 # # Copyright (c) 2014-2018 VMware, Inc. All Rights Reserved. # # This product is licensed to you under the # Apache License, Version 2.0 (the "License"). # You may not use this product except in compliance with the License. # # This product may include a number of subcomponents with # s...
<filename>wmpl/Formats/EventUWO.py """ Recompute the meteor trajectory from UWO-format event.txt files. """ import os import sys import numpy as np from wmpl.Formats.GenericArgumentParser import addSolverOptions from wmpl.Trajectory.GuralTrajectory import GuralTrajectory from wmpl.Trajectory.Trajectory import Traje...
<gh_stars>1-10 import getopt from sys import argv, exit import multiprocessing import pysam import pybedtools ## capture the arguments required for the annotations; ## 1) the annotation file ; 2) the VCF to be annotated ; 3) the name of the output file [O] otherwise, same name + anno.vcf ## if further arguments are ne...
#21datalabplugin import numpy from system import __functioncontrolfolder from model import date2secs, secs2dateString, date2msecs import dates import copy import remote import pandas as pd from remote import RemoteModel #import matplotlib.pyplot as plt import matplotlib.ticker as ticker import matplotlib.dates as plotd...
<reponame>deep-cube/deep-cube import torch import os import numpy as np from tqdm import tqdm from pprint import pprint from data_utils import array_to_video_view class SingleSquareActivatedDataset(torch.utils.data.Dataset): def __init__( self, L, C, H, W, square_persistence_length=1, ...
<filename>tradefed_cluster/note_manager.py<gh_stars>0 # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unles...
from datetime import date, datetime import decimal import requests import warnings API_ENDPOINT = 'https://api.enigma.io' API_VERSION = 'v2' # Data type mappings are based on PL/Python PostgreSQL to Python mappings # http://www.postgresql.org/docs/9.4/static/plpython-data.html _data_type_codec = { 'bigint': long...
import requests import json from bs4 import BeautifulSoup from src.scripts.scrapper.resources.css_attributes import * from src.utils import log from src.utils import io headers = { 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.106 Safari/537.36' } TYPE_TWO...
<filename>conwatch/WatchCmd.py<gh_stars>0 #!/usr/bin/env python import time import sys import subprocess import sqlite3 from ConWatchConfig import * # DAG information cmd = "" cmdargs = [] # DB information conn = None c = None def listDAGs(cmdargs): # Specify the condor_q command to run condorcmd = ['cond...
# -*- coding: utf-8 -*- import copy import sys import types from collections import defaultdict import pytest PY3 = sys.version_info[0] == 3 string_type = str if PY3 else basestring def pytest_configure(): pytest.lazy_fixture = lazy_fixture @pytest.hookimpl(tryfirst=True) def pytest_runtest_setup(item): i...
<filename>testing/MLDB-1937-svd-with-complex-select.py # # MLDB-1937-svd-with-complex-select.py # <NAME>, 2016-09-14 # This file is part of MLDB. Copyright 2016 mldb.ai inc. All rights reserved. # import random from mldb import mldb, MldbUnitTest, ResponseException class MLDB1937SvdWithComplexSelect(MldbUnitTest): ...
#Is it possible to use numpy.ufunc.reduce over an iterator of ndarrays? #I have a generator function that yields ndarrays (all of the same shape and dtype) and I would like to find the maximum value at each index. #Currently I have code that looks like this: def main(): import numpy as np import cv2 sh...
<reponame>BodenmillerGroup/spherpro<gh_stars>1-10 import colorcet import matplotlib.colors as mcolors import matplotlib.pyplot as plt import pandas as pd import spherpro.bromodules.plot_base as plot_base import spherpro.db as db LABEL_CBAR = "# of all cells with valid barcodes" LABEL_Y = "# of cells with\nmost promin...
"""Test the Basic ICN Layer implementation""" import multiprocessing import time import unittest from PiCN.Layers.ICNLayer import BasicICNLayer from PiCN.Layers.ICNLayer.ContentStore import ContentStoreMemoryExact from PiCN.Layers.ICNLayer.ForwardingInformationBase import ForwardingInformationBaseMemoryPrefix from Pi...
"""Test cases for running mypy programs using a Python interpreter. Each test case type checks a program then runs it using Python. The output (stdout) of the program is compared to expected output. Type checking uses full builtins and other stubs. Note: Currently Python interpreter paths are hard coded. Note: These...
<gh_stars>0 #!/usr/bin/env python """ SBtab Validator =============== Python script that validates SBtab files See specification for further information. """ try: from . import SBtab from . import tablibIO from . import misc except: import SBtab import tablibIO import misc import re import col...
import sys import socket import subprocess import pyxhook import time MASTER_IP = "127.0.0.1" MASTER_PORT = 6000 ZOMB_PORT = int(sys.argv[1]) log_file='/home/aman/Desktop/file.log' keys = "" last_key = '' #this function is called everytime a key is pressed. def OnKeyPress(event): global keys global last_key key...
"""***************************************************************************************** MIT License Copyright (c) 2019 <NAME>, <NAME>, <NAME> 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 So...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Sep 3 18:44:03 2019 @author: dileepn Using ScikitLearn for multiple linear regression in order to predict house prices """ import numpy as np from sklearn import linear_model from sklearn.preprocessing import PolynomialFeatures from sklearn.metrics....
<gh_stars>0 import requests, base64, json, sys, argparse, os, time import urllib3 from datetime import datetime from argparse import RawTextHelpFormatter # For Supressing warnings # urllib3.disable_warnings() #Uber ASCII Art Uber_Small_ASCII = ("" + \ " .,coxOKXNWMWl ...
<filename>platoonbot.py # インストールした discord.py を読み込む from collections import deque from sys import version from discord import channel import discord TOKEN = '' client = discord.Client() CHANNEL_ID_PARTY_1 = 000000000000000000 #小隊チャンネル1 CHANNEL_ID_PARTY_2 = 000000000000000000 #小隊チャンネル2 CHANNEL_ID_PARTY_3 = 00000000000...
import os from twyg.common import createpath from twyg.config import (Properties, NumberProperty, EnumProperty, ColorProperty) from twyg.geom import Vector2 from twyg.geomutils import arcpath from twyg.tree import Direction, opposite_dir # TODO util function in common? def defau...
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Fri Jul 15 18:56:14 2016 @author: mark """ from api import * file_writer = None def write(text, process_text=True): """ writes text into the document in a format to be decided later """ if process_text: text = text.replace('%','\%') te...
import spotipy.util as util import pandas as pd import spotipy from datetime import datetime class SpotifyUtil: ''' Utility class for accessing Spotify API ''' query_dict = { 'current_user_recently_played': 'parse_songplays', 'current_user_top_artists': 'parse_top_artists', ...
<gh_stars>0 import os import subprocess from api import api_call, post_call from config import SETTINGS from helpers import create_embed, LetterboxdError async def user_embed(username): username = username.lower() url = 'https://letterboxd.com/{}'.format(username) lbxd_id = __check_if_fixed_search(userna...
import csv import hashlib import re import time from io import StringIO from urllib.parse import urlencode from django.conf import settings from django.contrib.auth.decorators import permission_required from django.db import connections from django.db.utils import ProgrammingError from django.forms import CharField, M...
<reponame>ebursztein/SiteFab # encoding: utf-8 from .utils import get_linter_errors_list def test_e104_triggered(sitefab, empty_post): empty_post.meta.mylist = ["test", "test"] results = sitefab.linter.lint(empty_post, "", sitefab) error_list = get_linter_errors_list(results) assert "E104" in error_li...
<reponame>gabrielhartmann/cvxpy """ Copyright 2013 <NAME>, <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/licenses/LICENSE-2.0 Unless required by applicable law o...
from os import listdir, path from glob import glob from datetime import datetime from subprocess import Popen, PIPE, run from multiprocessing import cpu_count from pathlib import Path from typing import Dict import pandas as pd import torch import logging HOME_DIR = str(Path.home()) INIT_TIME = datetime.now().strftime...
import os import sys import time import redis import random import subprocess from redisrollforward.redis_aof_read import redis_aof_read from redisrollforward.redis_aof_funnel import redis_aof_funnel from behave import given, when, then, step # a@UnresolvedImport @UnusedImport from datetime import datetime # G...
import pandas as pd import os import json import tldextract import nltk import multiprocessing import time import numpy as np import networkx as nx import pke import random from tqdm import tqdm from difflib import SequenceMatcher from bs4 import BeautifulSoup from base64 import urlsafe_b64decode from collections impor...
import os import numpy as np import pytest import pytorch_lightning as pl import torch.optim.optimizer from omegaconf import OmegaConf from pl_bolts.models.vision import UNet from pytorch_lightning import seed_everything, Trainer from src.datamodules.DivaHisDB.datamodule_cropped import DivaHisDBDataModuleCropped from...
<reponame>WenjieDu/GitHub_Spider_on_Star_Fork """ This spider is created by WenjieDu to crawl information of stargazers and forkers of specified repositories on GitHub. """ import argparse import json import logging import os import random from time import sleep import pandas as pd import requests from bs4 import Beau...
""" pyt_pima_diabetes.py: binary classification (of imbalanced data) of PIMA Diabates dataset @author: <NAME> My experiments with Python, Machine Learning & Deep Learning. This code is meant for education purposes only & is not intended for commercial/production use! Use at your own risk!! I am not responsible if your...
# coding=utf-8 """Module for handling workflow definition objects. Intended for registering a new workflow type with the Configuration database. """ import ast import json from os.path import dirname, join import jsonschema from .. import ConfigDb DB = ConfigDb() def add(workflow_definition: dict, templates_root:...
from nose.tools import assert_raises from syn.types.a import ValueExplorer, ExplorationError, DiffExplorer, \ visit, find_ne from syn.base_utils import capture, assign import syn.base_utils.repl as repl #------------------------------------------------------------------------------- # NETypes def test_netypes(): ...
import numpy as np import torch from ..builder import build_processor from imix.utils.third_party_libs import VocabDict from ..utils.stream import ItemFeature from .base_infocpler import BaseInfoCpler from imix.utils.config import imixEasyDict from imix.utils.common_function import object_to_byte_tensor from copy impo...
<gh_stars>0 # coding: utf-8 # # Reddit Part One: Getting Data # # You're going to scrape the front page of https://www.reddit.com! Reddit is a magic land made of many many semi-independent kingdoms, called subreddits. We need to find out which are the most powerful. # # You are going to scrape the front page of red...
<filename>src/python/grongier/pex/_business_host.py<gh_stars>0 import datetime import pickle import codecs import uuid import decimal import base64 import json import importlib import iris from inspect import signature from grongier.dacite import from_dict from grongier.pex._common import _Common cl...
<gh_stars>0 import os import dateutil.parser from airflow.exceptions import AirflowException, AirflowSkipException from dagster import DagsterEventType, check from dagster.core.events import DagsterEvent from dagster.core.execution.api import create_execution_plan, execute_plan from dagster.core.execution.plan.plan i...
#!/usr/bin/python # # This is a poor-man's executable builder, for embedding dependencies into # our pagekite.py file until we have proper packaging. # import base64, os, sys, zlib BREEDER_NOTE = """\ # # WARNING: This is a compilation of multiple Python files. Do not edit. # """ BREEDER_PREAMBLE = """\ #!/usr/bin/p...
# -*- coding: utf-8 -*- """ Classes and functions to compute sta/lta in seiscomp3 Created on Jul 20 2021 @author: <NAME>, <EMAIL> """ #from obspy import read, UTCDateTime import obspy import os import xml.etree.ElementTree as ET import pandas as pd from obspy.core import UTCDateTime import numpy as np from concurrent....
"""Locate the position of a cluster (its center of mass) in a simulation. The module calculates the center of mass of a connected cluster of atoms, even in the case where the cluster straddles the periodic boundaries. It is OK that there are other atoms not connected to the cluster, as long as the atom with the high...
<filename>openpype/lib/project_backpack.py """These lib functions are primarily for development purposes. WARNING: This is not meant for production data. Goal is to be able create package of current state of project with related documents from mongo and files from disk to zip file and then be able recreate the projec...
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- import random import requests from bs4 import BeautifulSoup import re import json import yaml def get_domain(): return "http://mobile.yangkeduo.com/" class PingDuoDuoGood: def __init__(self, _good_name="", _good_number="", _good_price="", _good_link_url=...
<gh_stars>10-100 from netomaton import topology, utils import netomaton.rules as rules from netomaton import NodeContext, evolve from .rule_test import * class TestRules(RuleTest): def test_majority_rule(self): actual = rules.majority_rule(NodeContext(0, 1, {}, [0, 1, 2, 3, 4], [1, 2, 1, 3, 4], [1., 1., ...
import os import sys import warnings import importlib import inspect import os.path as osp import numpy as np import tensorflow as tf from tensorflow.keras.utils import Sequence from tensorflow.python.keras import callbacks as callbacks_module from tensorflow.keras.callbacks import EarlyStopping, ModelCheckpoint from ...
#!/usr/bin/env python """Module containing the MemProtMDSim class and the command line interface.""" import argparse from biobb_common.generic.biobb_object import BiobbObject from biobb_common.configuration import settings from biobb_common.tools import file_utils as fu from biobb_common.tools.file_utils import launc...
<filename>Codes/main.py<gh_stars>0 from threading import Thread from imutils.video import VideoStream import cv2 import time import imutils import math import argparse import matplotlib.pyplot as plt import numpy as np parser = argparse.ArgumentParser( description='This program calculates either the static or kin...
<gh_stars>10-100 import re def filter_data(comment): lines = comment.split('\n') line_filters = list(filter( lambda name: name.startswith('skip_line_'), [k for k, v in globals().items()] )) for i in range(len(lines) - 1, -1, -1): line = lines[i] + '' line = line.strip(' ᅠᅠᅠ ') line = cut_by_regex(lin...
<gh_stars>0 from json import JSONEncoder import logging import re import importlib import inspect import platform from ._node_index import NodeIndex from ._token import Token from ._token_kind import TokenKind from ._version import VERSION from ._diagnostic import Diagnostic from ._metadata_map import MetadataMap JSO...