content
stringlengths
5
1.05M
import praw import logging import argparse from distutils.dir_util import mkpath from praw.helpers import submission_stream from crawler_utils import save_submission def get_as_much_stuff_as_possible(storage_dir): mkpath(storage_dir, mode=0755) r = praw.Reddit(user_agent='SearchingReddit project 0.2 by /u/god...
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will b...
"""Algorithms for indexing.""" import numpy as np from recordlinkage.measures import max_pairs def _map_tril_1d_on_2d(indices, dims): """Map 1d indices on lower triangular matrix in 2d. """ N = (dims * dims - dims) / 2 m = np.ceil(np.sqrt(2 * N)) c = m - np.round(np.sqrt(2 * (N - indices))) - 1 ...
from tinder.v3.auth.sms import SMSUser from tinder.v2.auth.facebook import FBUSer if __name__ == '__main__': # v3 SMS authentication user = SMSUser('phone', email='email') user.login() matches = user.all_matches() # v2 FB authentication, not tested user = FBUSer('fb email', 'fb pas...
#coding=utf-8 ''' Challenges Set 1 Challenge 6 Break repeating-key XOR 原理:这篇blog解析得很详细:https://www.anquanke.com/post/id/161171''' import base64 import Challenge3 import Challenge5 '''计算汉明距离''' def hamming_dis(str1, str2): dis = 0 for i,j in zip(str1, str2): dis = dis + bin(ord(i) ^ ord(j)).count...
""" pusher module to handle WebPush subscriptions Generate private and public keys via py_vapid, install py-vapid (pypi), vapid --gen generates private and public keys, vapid --applicationServerKey generates application server key for frontend """ import os import json from pywebpush i...
""" Created on November 19, 2020 @author: Xinchao Song """ import os from gym import spaces import numpy as np import pybullet as p from .env import AssistiveEnv class MaskPlacingEnv(AssistiveEnv): def __init__(self, robot_type='pr2', human_control=False): super(MaskPlacingEnv, self).__init__(robot_type...
from . import solution_a from . import solution_b
import numpy as np from numpy import pi import tensorflow as tf class Particle_Tracking_Training_Data(tf.Module): def __init__(self, Nt, rings=True): self.Nt = int(Nt) self.Ny = self.Nx = 256 self.d = 3 ximg = [[[i, j] for i in np.arange(self.Ny)] for j in np.arange(self...
def is_isogram(string): return len(set([i for i in string.lower()])) == len(string)
# -*- coding: utf-8 -*- __title__ = 'Bridge Markup Language' __package_name__ = 'bridge-markup' __author__ = "Erik Sjöstrand, Gert-Jan Paulissen" __description__ = ' '.join(''' Bridge Markup Language for creating bridge (card game) bidding documents. '''.strip().split()) __email__ = "gert.jan.paulissen@gmail.com" __ver...
import sys def find(strng, ch, start=0, end=None): ix = start if end is None: end = len(strng) while ix < end: if strng[ix] == ch: return ix ix += 1 return -1 def test(did_pass): """ Print the result of a test. """ linenum = sys._getframe(1).f_lineno # Ge...
from wordsapy import Dictionary dictionary = Dictionary(api_key='') # More details: https://www.wordsapi.com/docs/#get-word-details # Definitions results = dictionary.definitions('example') for result in results: print('Definition: ' + result.definition) print('Part of speech: ' + result.partOfSpeech) # Syn...
""" Exercise: Regularization @auth: Yu-Hsiang Fu @date: 2018/09/20 """ # -------------------------------------------------------------------------------- # 1.Import packages # -------------------------------------------------------------------------------- import copy import matplotlib.pyplot as plt import numpy as np...
import sys import copy import time from random import * marker = "==================================" splitter = '================================================================================================' selects = ['是', '否'] maxBlood = 100 initKill = 0 warningBlood = 50 initSight = 0.7 levelSight = 0.05 footNa...
from evo_gym import error from evo_gym.wrappers.monitor import Monitor from evo_gym.wrappers.time_limit import TimeLimit from evo_gym.wrappers.filter_observation import FilterObservation from evo_gym.wrappers.atari_preprocessing import AtariPreprocessing from evo_gym.wrappers.rescale_action import RescaleAction from ev...
from collections import Counter def _calc_gc_content(sequence): bases = Counter(sequence) return sum(bases.get(x, 0) for x in ["G", "C", "g", "c"]) / sum(bases.values()) def _convert_contig_set(contig_set): total_len = 0 total_gc = 0 contigs = {} for v in contig_set['contigs']: gc = ...
import argparse import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns sns.set() SAC = { "Hopper-v2": [ "extra/multistep/SAC_online_n_1_Hopper-v2_1_20210907092100/evaluation.csv", "extra/multistep/SAC_online_n_1_Hopper-v2_2_20210907121407/evaluation.csv", ...
class Starrable: """ Represents an object that can be starred. """ __slots__ = () _graphql_fields = { "stargazer_count": "stargazerCount", "viewer_has_starred": "viewerHasStarred", } @property def stargazer_count(self): """ The number of stars on the st...
import sys sys.setrecursionlimit(10 ** 5) def solve(s, start, end): if start > end: return 0 if start == end: return 1 if s[start] == s[end]: return solve(s, start + 1, end - 1) + 2 else: left = solve(s, start, end - 1) right = solve(s, start + 1, end) ...
""" Vamos criar algumas visualizações sobre o periodo eleitoral do pais """ import pandas as pd import streamlit as st from opcao_grafico import visualiza_grafico from opcao_tabela import visualizar_tabela # Configurações do streamlit para a pagina web st.set_page_config( page_title="Eleições no Brasil", pag...
import bpy bpy.ops.object.select_all() bpy.ops.object.delete()
from django.test import TestCase from django.contrib.auth import get_user_model class ModelTests(TestCase): def test_create_user_with_email_successful(self): """Test creating a user with an email is successful""" email = "testfrom@app.com" password = "TestPass123" user = get_user_...
# # PySNMP MIB module SFA-INFO (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SFA-INFO # Produced by pysmi-0.3.4 at Mon Apr 29 20:53:47 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:1...
"""File save and sort players.""" # In this code Each player should be able to select a name for themself. # A player should be able to change their name. def open_filewrite(player1, player2): """Write player and points to file.""" with open('PigHighscores.txt', 'a') as file: file.write(str(player1[0]...
class Employee: increament = 1.5 employeePopulation = 0 # CONSTRUCTOR : def __init__(self, name, job, age): # self is necessary ! self.name = name self.job = job self.age = age self.increament = 2 Employee.employeePopulation +=1 # count no. of objects d...
import torch from torch import nn from torch.autograd import Variable def get_rmse_log(model, feature, label, use_gpu): model.eval() mse_loss = nn.MSELoss() if use_gpu: feature = feature.cuda() label = label.cuda() feature = Variable(feature, volatile=True) label = Variable(label, ...
from random import * import lcm from lilylcm import L06Depth from lilylcm import L07Humidity from lilylcm import L08Temperature from lilylcm import L14LEDs from lilylcm import L16ChargerCommand from lilylcm import L19DockCommand from lilylcm import pod_data_t lc = lcm.LCM() msg6 = L06Depth() msg7 = L07Humidity() msg...
#!/usr/bin/env python """WB-8618: warn the user if they are using a local key to log in to cloud""" import pytest import wandb import wandb.errors if __name__ == "__main__": # api_key starts with "local", but base_url points to cloud with pytest.raises(wandb.errors.UsageError) as e: wandb.login(key="...
import gcsfs import torch from torch import nn if __name__ == '__main__': m = nn.AdaptiveAvgPool3d((1,1,1)) input = torch.randn(1, 64, 10, 9, 8) print(input.shape) output = m(input) print(output.shape) output = output.view(-1, 64) print(output.shape)
#! /usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (C) 2013-2018 Diego Torres Milano Created on 2018-03-29 by Culebra v15.0.1 __ __ __ __ / \ / \ / \ / \ ____________________/ __\/ __\/ __\/ __\_____________________________ ___________________/ ...
# !/usr/bin/env python __version__ = "1.0.0" from distutils.core import setup setup( name='artapi', version=__version__, description='Library that helps working with Art-Api service', author='Artifacts Team', author_email='service@artifacts.io', url='https://github.com/artifactsofresearch/djan...
# Some notes on reading an article on static analysis: # https://deepsource.io/blog/introduction-static-code-analysis/ ''' # Hello world example import io import tokenize str1 = b"This is string one" str2 = b"This is string two" str1_upper = str1.upper() str2_upper = str2.upper() for input_str in ...
def função_a(): return ... def função_b(): return função_a() def função_c(): return função_b() def função_d(): return função_c() breakpoint() função_d() print('FIM!')
# ------------------------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # -------------------------------------------------------------------...
import sys import os from pathlib import Path import shutil if len(sys.argv) != 2: print("Please provide the location of the aws-models repository as the first argument") sys.exit(1) aws_models = sys.argv[1] for model in os.listdir("aws-models"): if not model.endswith('.json'): continue model...
import torch from torch.cuda import amp import torch.nn as nn import torch.nn.functional as F import torchvision from scipy.stats import truncnorm import pandas as pd import numpy as np from tqdm import tqdm import os import copy from torch.nn.functional import adaptive_avg_pool2d from metrics.vgg...
from gitlab.base import RequiredOptional, RESTManager, RESTObject from gitlab.mixins import GetWithoutIdMixin, SaveMixin, UpdateMixin __all__ = [ "NotificationSettings", "NotificationSettingsManager", "GroupNotificationSettings", "GroupNotificationSettingsManager", "ProjectNotificationSettings", ...
# 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...
# -*- coding: utf-8 -*- # @Author: Kai Shen # @Created Time: 2022/2/23 10:28 AM # @Organization: YQN # @Email: mlshenkai@163.com import torch.nn as nn import torch.nn.functional as F class LabelSmoothingCrossEntry(nn.Module): def __init__(self, eps=0.1, reduction="mean", ignore_index=-100): super(LabelSmo...
import sys import os.path from catframes.fix_resolution import process from catframes.to_video import ToVideoConverter from catframes.version import version from multiprocessing import Pool from catframes.utils import * usage = """ Catframes can resize all images in the current directory to the same size and then con...
from django.db import models import os import random from PIL import Image # Create your models here. def get_filename_ext(filepath): base_name = os.path.basename(filepath) name, ext = os.path.splitext(base_name) return name, ext def upload_image_path(instance, filename): # print(instance) #prin...
import asyncio import importlib from datetime import datetime import aiohttp.web import click import bottery from bottery.conf import settings from bottery.log import Spinner class Bottery: _loop = None _session = None _server = None # This is a feature trial, do NOT rely your application on it ...
from accounts.models import Accounts from django.contrib.auth.hashers import make_password from permissions.serializer.permission_serializer import PermissionModelSerializer from rest_framework import serializers class AccountModelListSerializer(serializers.HyperlinkedModelSerializer): username = serializers.Char...
#!/usr/bin/env python3 import configparser import os import subprocess import sys from git import Repo class Deploy: def __init__(self, path): self.path = path self.path_deploy_cfg = '{path}/deploy.cfg'.format(path=path) self.path_deploy_common_cfg = '{path}/deploy-common.cfg'.format(p...
from abc import ABC from datetime import datetime from .notifier import Notifier from .async_notifier import AsyncNotifier, MetaDelayedNotifier from .segment_locmem_client import SegmentLocMemClient class SegmentNotifier(Notifier, ABC, metaclass=MetaDelayedNotifier): __slots__ = ('timestamp', 'user', ) clien...
from sqlalchemy import Column, Integer, String, DateTime, Text from database.database_connection import database_engine as engine from datetime import datetime class UserReport(engine.Model): __tablename__ = "users_reports" id = Column(Integer, primary_key=True) username = Column(String(36)) creator...
import subprocess subprocess.run('pip install -r requirements.txt', shell=True, capture_output=True) from scripts.dupl_image_finder import * import os import string import os.path import random import argparse from tqdm import tqdm import pandas as pd import numpy as np import cv2 as cv import shutil from ...
import importlib _module = importlib.import_module("utils") func = getattr(_module, "assignmentString") print(func("name","shady"))
from .header_helpers import get_span_and_trace # noqa: F401
import os import random import matplotlib import numpy as np matplotlib.use("pdf") import matplotlib.pyplot as plt from sklearn import linear_model from paper_figures.legacy.experimental_config import * def ICDE_get_data_file(g_name, number_of_updates): return ICDE14_DIR + g_name + "_%d.txt" % number_of_update...
#!/usr/bin/env python3 """ Copyright © 2020-2021 Borys Olifirov Toolkit. - Function for series analysis: alex_delta series_point_delta series_derivate - Function for image preprocessing: back_rm mask_point_artefact Optimised at confocal images of HEK 293 cells. """ import os import logging import numpy a...
import json from pprint import pprint from ParseGTF import * import argparse import sys gtffile = '' matrixfile = '' jsonfile = '' #opts, args = getopt.getopt(sys.argv[1:],"hi:o:",["ifile=","ofile="]) parser = argparse.ArgumentParser(description='Quantification Counter') parser.add_argument('-g', action="s...
import numpy as np import pandas as pd import matplotlib.pyplot as plt #Data Source import yfinance as yf import time, datetime from datetime import datetime stock = 'NVEI.TO' #Interval required 5 minutes StartBal = 100 TL = 0 TT = 0 Bought = 0 TStop = 0 TB = 0 TS = 0 data = yf.download(tickers=stock, period='5d', int...
# # spyne - Copyright (C) Spyne contributors. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This libra...
#!/usr/bin/env python3 import csv import json import urllib.request INDEX_URL = 'https://petition.parliament.uk/archived/petitions.json' ONS_CODES_URL = 'https://petition.parliament.uk/archived/petitions/131215.json' def fetch_json(petition_url): return json.load(urllib.request.urlopen(petition_url)) def parse_...
from modules import base import torch from torch import nn import math filters_84x84 = [ [16, [8, 8], 4], [32, [4, 4], 2], [256, [11, 11], 1], ] filters_42x42 = [ [16, [4, 4], 2], [32, [4, 4], 2], [256, [11, 11], 1], ] #same architecture as rllib class ConvNet(nn.Module): def __init__(sel...
import pandas as pd import numpy as np # import sklearn from sklearn.preprocessing import MinMaxScaler, StandardScaler from sklearn.model_selection import train_test_split #matplotlib import matplotlib.pyplot as plt # libraries used for train test split import random from math import floor from types import SimpleNam...
# Python - lab 8 # var 7 # Group 2 # 4/11/2019 __doc__ = """ The simplest Python interpreter ever See more at https://vadimcpp.ru/python/laba8.html This is Backus–Naur form Syntax: <expression> ::= <digit>|<expression><operation><digit> <operation> ::= +|- <digit> ::= 1|2|3|4|5|6|7|8|9 """ class InterpretError(Ex...
# EJERCICIO: # Modifique la lista de nodos adyacentes para usar conectividad ocho # en lugar de conectividad 4 adjacents = [[1,0],[0,1],[-1,0],[0,-1]] #adjacents= [[1,0],[0,1],[-1,0],[0,-1],[1,1],[-1,1],[-1,-1],[1,-1]]
import doctest from zope.interface import implementer from zope.publisher.interfaces.browser import IDefaultBrowserLayer from zope.publisher.interfaces.browser import IBrowserRequest from ZPublisher import Retry from ZODB.POSException import ConflictError class Tracer(object): """Trace used to record pathway tak...
from backend.externals.external_aws_client import ExternalAwsClient from backend.models import Resource from backend.models.resource.ec2 import AmiImage import uuid class Ec2(ExternalAwsClient): NARUKO_AMI_NAME = 'NARUKO-{id}-{random}' NARUKO_AMI_NAME_PREFIX = 'NARUKO-{id}-' def _service_name...
#!d:\afood\food_bank_management_system_in_django_framework\foodbank\virt\scripts\python.exe from django.core import management if __name__ == "__main__": management.execute_from_command_line()
from flask_sqlalchemy import SQLAlchemy from flask_redis import FlaskRedis from flask_migrate import Migrate # from flask_rq2 import RQ from rq import Queue from morphocut_server.worker import redis_conn database = SQLAlchemy() redis_store = FlaskRedis() migrate = Migrate() redis_queue = Queue(connection=redis_conn)...
import sys with open(sys.argv[1]) as fin: features = {} for line in fin: seg = line.strip('\r\n').split('\t') if int(seg[2])>=2: if seg[0] in features: print(seg[0], seg[1], features[seg[0]]) features[seg[0]] = seg[1]
# Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
import numpy as np import pickle import os.path import csv import torch import torch.optim as optim class BaseAgent(object): def __init__(self, config, env, log_dir='/tmp/gym', tb_writer=None): self.model=None self.target_model=None self.optimizer = None self.log_dir = log_dir ...
# Copyright 2013 University of Maryland. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE.TXT file. import sys import os import time from selenium.common.exceptions import NoAlertPresentException import framework class Exploit (framework.Exploit...
""" Solution to https://adventofcode.com/2020/day/14 """ from itertools import chain, combinations from collections import namedtuple Instruction = namedtuple("Instruction", ["type", "value", "address"]) def _highest_power_of_two(val, max_power=36): for power in range(max_power + 1): if 2 ** power > va...
# ----------------------------------------------------------- # Test composing transformations. # # (C) 2020 Kevin Schlegel, Oxford, United Kingdom # Released under Apache License, Version 2.0 # email kevinschlegel@cantab.net # ----------------------------------------------------------- import numpy as np from psfdata...
#!/usr/bin/python3 # Limbo file sharing (https://github.com/kolomenkin/limbo) # Copyright 2018-2022 Sergey Kolomenkin # Licensed under MIT (https://github.com/kolomenkin/limbo/blob/master/LICENSE) # import json import logging import mimetypes import os import sys import urllib from time import time from typing import A...
#!/usr/bin/env python3 # Copyright (c) 2018, Palo Alto Networks # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" A...
class FakeOAIPMHData: fake_xml_record = """<?xml version="1.0"?> <arXiv xsi:schemaLocation="http://arxiv.org/OAI/arXiv/ http://arxiv.org/OAI/arXiv.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://arxiv.org/OAI/arXiv/"> <id>0704.0025</id> ...
print("Hello World, Python!")
class Solution: def canCross(self, stones): memo, stones, target = {}, set(stones), stones[-1] def dfs(unit, last): if unit == target: return True if (unit, last) not in memo: memo[(unit, last)] = any(dfs(unit + move, move) for move in (last - 1, last, last +...
from flask_wtf import Form from wtforms import PasswordField from wtforms.validators import DataRequired class ChangePasswordForm(Form): newPassword = PasswordField('New Password', validators=[DataRequired()]) confirmNewPassword = PasswordField('Confirm New Passwrd', validators=[DataRequired()]) oldPassw...
#!/usr/bin/env python3 import argparse import functools import logging import os import subprocess logging.basicConfig(level=logging.INFO) @functools.lru_cache(1024) def get_package_info(package): logging.info('Run `pip show %s`', package) package_info_lines = subprocess.check_output(['pip', 'show', packag...
# ============================================================================= # Copyright 2020 NVIDIA. 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://ww...
import io from flask import Flask, render_template, request, make_response, send_file import time try: from src.rover import Rover import picamera.array import picamera except ImportError as e: print(e) raise e app = Flask(__name__) rover = Rover() try: # Picamera setup cam_resolution = (2...
import json as Gson import sys def extract_argv(list_args: list) -> dict: assert type(list_args) == list, "le parametre listArgs doit etre une liste" return dict(map(lambda e: tuple(e.split("--")[1].split("=")), list_args)) if __name__ == "__main__": finalData = [] params = None try: par...
## Arruma duplicidade do C491 e C495 ## ## def exec(conexao): cursor = conexao.cursor() print("RULE 04 - Inicializando",end=' ') for c in ["C491","C495"]: #pega o r0 do C490 temp = cursor.execute("select r0 from principal where r1 = \"C490\"") temp = temp.fetchall() rs...
import typing from datetime import date from decimal import Decimal from typing_extensions import Literal import pydantic import stackprinter stackprinter.set_excepthook(style="darkbg2") from crypto_dom.kraken.definitions import ( TIMEFRAMES, TIMESTAMP_S, COUNT, ORDERID, TRADEID, ORDERSTATUS, ...
from django.shortcuts import render # Create your views here. def home(request): context = {} return render(request, 'website/home.html', context) def products(request): context = {} return render(request, 'website/products.html', context) def people(request): context = {} return render(r...
from .state import * # NOQA from .decorators import * # NOQA
# -*- coding: utf-8 -*- """ datagator.api.client.environ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: 2015 by `University of Denver <http://pardee.du.edu/>`_ :license: Apache 2.0, see LICENSE for more details. :author: `LIU Yu <liuyu@opencps.net>`_ :date: 2015/02/03 """ from __future__ import uni...
from .calc_read_noise import * from .calc_velocity import * from .ccd_offset import *
''' Copyright (c) 2021-2022 OVGU LIA Author: Harish Kumar Pakala This source code is licensed under the Apache License 2.0 (see LICENSE.txt). This source code may use other Open Source software components (see LICENSE.txt). ''' import json import requests url = "http://192.168.178.23/api/v1/registry/OVGU_LIA_Requeste...
""" Command line entry point for the script. """ import argparse import logging import logging.config import pkg_resources import sys from timesync.subcommands import task_assignments, process from timesync.utils import configuration from ruamel.yaml import YAML from ruamel.yaml.parser import ParserError as YAMLPars...
# Copyright (c) 2022, Chair of Software Technology # 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 the above copyright notice, this list of conditi...
#!/usr/bin/env python3 """ Stop Watch Program A stopwatch object that records the number of times the watch has been started until it is reset. """ from stopwatch import Stopwatch class CountingStopwatch(Stopwatch): """ A stopwatch obj inheriting from Stopwatch """ def __init__(self): super(Count...
class WriteIsoSurfaces: def __init__(self, properties, file_manager): self.file_manager = file_manager self.properties = properties def write_iso_surfaces(self): file_id = self.file_manager.create_file('system/include', 'isoSurfaces') self.file_manager.write_header(file_id, 'dic...
from unittest import IsolatedAsyncioTestCase from fastapi_framework import redis_dependency, Redis from fastapi_framework.settings import SettingsModel, Settings from fastapi_framework.database import database_dependency, DB, select class TestSettings(IsolatedAsyncioTestCase): async def test_settings_set(self): ...
import argparse import logging import os from string import Template from typing import Set from leetcode_export._version import __version__ from leetcode_export.leetcode import LeetCode def parse_args(): parser = argparse.ArgumentParser(description='Export LeetCode solutions') parser.add_argument('--cookies...
import haversine as hs import osmnx as ox def min_latitude(coordinates): """ This function returns the minimum value of latitude of a list with tuples [(lat, lon), (lat, lon)]. :param coordinates: list list with tuples. Each tuple has coordi...
from .heartbeat import Heartbeat from .monitor import Monitor
import sys import os from sys import getsizeof sys.path.append(os.path.abspath(".")) import pyctlib from pyctlib.classfunc import save_args class A: def __init__(self, a, b): save_args(vars()) a = A(1, 2)
import requests,re,sys from ics import Calendar, Event from datetime import datetime from bs4 import BeautifulSoup ''' contains all information related to pokemon distribution event ''' class Pokemon: def __init__(self): self.name = None self.description = None self.type = None se...
from aoc import AOC import re aoc = AOC(year=2020, day=14) data = aoc.load() # Part 1 mask = "X" * 36 memory = {} for line in data.lines(): if line[:4] == "mask": mask = line[7:] continue mem, val = [int(x) for x in re.search(r"mem\[(\d+)\] = (\d+)", line).groups()] memory[mem] = int( ...
import pandas as pd import sqlite3 from sklearn.feature_extraction.text import CountVectorizer from sklearn.metrics.pairwise import cosine_similarity class Restaurant: def __init__(self, max_price, people, min_price, cuisine, locality, favourite_restaurant=""): self.max_price = max_price ...
""" These classes are to help deal with ranged data things associated with those coordinates. """ import sys, re from collections import namedtuple class Locus: """A Locus is a colloction of GenomicRanges that fall within some distance of one another""" def __init__(self): self.range = None self....