content
stringlengths
5
1.05M
#!/opt/local/bin/python f = open('1a.txt', 'r') l = [] for n in f: l.append(int(n)) f.closed size = len(l) print("Size: ", size) ''' Iterate through the list of numbers. Because of the symmetric axiom, no need to go back and hit all the earlier numbers. ''' index1 = 0 index_max = size found = False while ind...
import sys import argparse from PyQt5.QtWidgets import ( QApplication, QDesktopWidget, QLabel, QMainWindow, QPushButton, QScrollArea, QVBoxLayout, QWidget ) from PyQt5.QtGui import QIcon, QPixmap, QPalette def make_window(filename): desktop = QDesktopWidget() avail_geom = deskt...
# Generated by Django 2.1.3 on 2018-11-20 22:16 import django.core.validators from django.db import migrations, models import home.models class Migration(migrations.Migration): dependencies = [ ('home', '0002_better_satellites'), ] operations = [ migrations.CreateModel( name...
import imutils import os import sys import time import datetime import traceback import numpy as np import cv2 import csv import pandas as pd from utils.tracker import PeopleTracker from utils.person import Person from utils.boundary import Boundary from utils.detector import Detector from utils.stream im...
#!/usr/bin/python from __future__ import division import re import sys #########################################################################################################################3 #This script was written by Nathan Whelan. # THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # ...
nums = (input("")).split() n = int(nums[0]) m = int(nums[1]) l= int(nums[2]) list1 = [] for i in range(n): request = (input("")).split() request[1] = float(request[1]) request[2] = int(request[2]) request[3] = int(request[3]) request.append(i) list1.append(request) l...
import unittest from pymmrouting.routeplanner import MultimodalRoutePlanner from pymmrouting.inferenceengine import RoutingPlanInferer from pymmrouting.orm_graphmodel import SwitchType, Mode, Session class RoutePlannerTestCase(unittest.TestCase): def setUp(self): routing_options_file = \ "test...
'''initialize''' from .map import mapParser from .misc import showText, Button, Interface from .sprites import Wall, Background, Fruit, Bomb, Hero
#!/usr/bin/env python """ Sofia has given you a schedule and two dates and told you she needs help planning her weekends. She has asked you to count each day of rest (Saturday and Sunday) starting from the initial date to final date. You should count the initial and final dates if they fall on a Saturday or Sunday. T...
import unittest from enthought.traits.api import HasTraits, Int, Range, Str class WithFloatRange(HasTraits): r = Range(0.0, 100.0) r_copied_on_change = Str _changed_handler_calls = Int def _r_changed(self, old, new): self._changed_handler_calls += 1 self.r_copied_on_change =...
import collections from .GenomeFeature import GenomeFeature class GenomeDict (collections.OrderedDict): ''' OrderedDict wrapper in which each key is a GenomeFeature values are taken from the 'data' member of the GenomeFeature instances added to the structure ''' def __init__ (self, *args): ''' initializes t...
"""Utility functions.""" import os #import h5py import numpy as np import torch from torch.utils import data from torch import nn import sys # import matplotlib.pyplot as plt import pandas import random EPS = 1e-3 np.random.seed(42) random.seed(42) def weights_init(m): if isinstance(m, nn.Conv2d): nn.init.xavie...
from django.forms import ModelForm from .models import Book from libraries.models import BookCopy class BookForm(ModelForm): class Meta: model = Book fields = ('title', 'description', 'page_count', 'author', 'cover') class BookPreviewForm(ModelForm): class Meta: model = Book ...
from decimal import Decimal import math ans=0 for y in range(math.ceil(Y-R),math.floor(Y+R)+1): d=(R**2-(Y-y)**2).sqrt() x1=math.ceil(X-d) x2=math.floor(X+d) if x1<=x2: ans+=x2-x1+1 print(ans)
from implementation.shortest_path import priority_dict def prim_spanning_tree(graph, source): distance_table = {} priority_queue = priority_dict() for i in range(graph.numVertices): distance_table[i] = (None, None) distance_table[source] = (0, source) priority_queue[source] = 0 vis...
# Generated by Django 3.0.5 on 2020-04-25 17:40 import django.contrib.gis.db.models.fields from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('browser', '0006_auto_20200425_1826'), ] operations = [ migrations.CreateModel( name='...
#imports for camera from PIL import Image from time import sleep from time import gmtime, strftime from picamera import * import RPi.GPIO as GPIO #IMPORTS FOR UPLOAD import threading import time #IMPORT CONFIG import yaml #IMPORT EXTERNAL SCRIPTS import processing ###################################################...
# pylint: disable=line-too-long,too-many-public-methods,too-few-public-methods # pylint: disable=invalid-name,global-statement from __future__ import print_function, absolute_import, division from collections import OrderedDict import jacquard.variant_caller_transforms.mutect as mutect import jacquard.utils.utils as ...
#!/usr/bin/python all_para =['Variable', 'Variable_1', 'Variable_2', 'Variable_3', 'Variable_4', 'Variable_5', 'Variable_6', 'Variable_7', 'Variable_8', 'Variable_9', 'Variable_10', 'Variable_11', 'Variable_12', 'Variable_13', 'Variable_14', 'Variable_15', 'Variable_16', 'Variable_17', 'Variable_18',...
import os from dropbox import Dropbox import dropbox.sharing def get_shared_folder_by_name(folder_name): dbx = Dropbox(os.getenv('DROPBOX_TOKEN', None)) folder = [f for f in dbx.sharing_list_folders().entries if f.name == folder_name] return folder[0] if folder else None def create_shared_...
__version__ = '0.1.0' from textworld_remote_env.client import RemoteEnv
"""Conftest """ import pytest from vision_on_edge.notifications.models import Notification from vision_on_edge.notifications.tests.factories import NotificationFactory @pytest.fixture def notification() -> Notification: """notification. Args: Returns: Notification: """ return Notificat...
# -*- coding: utf-8 -*- ## CODE DE TEST, POUR PLUS D INFORMATION VOIR LES COMMENTAIRES DU FICHIER SHUTTLEPEDESTRIANDETECTION ET SHUTTLEFLIGHTCONTROLLER ## Permet de tester la détection de personne, créer une image avec le rectangle autour d'une personne si présente, et affichage dans la console des valeurs en x et y fr...
import numpy as np from PIL import Image import random def read_image(path, dtype=np.float32, color=True): """Read an image from a file. This function reads an image from given file. The image is CHW format and the range of its value is :math:`[0, 255]`. If :obj:`color = True`, the order of the chann...
import os import math import time import base64 import asyncio from binascii import hexlify from pylru import lrucache from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor from torba.rpc.jsonrpc import RPCError, JSONRPC from torba.server.session import ElectrumX, SessionManager from torba.server impo...
from datetime import datetime from django.conf import settings from django.utils.translation import gettext_lazy as _ from django.utils import timezone def friendly_datetime(date_time): """ Given a datetime object or an int() Unix timestamp, return a friendly string like 'an hour ago', 'yesterday', '3 mo...
import platform,os machine_os = platform.system() if machine_os == 'Linux': os.system('mkdir /usr/share/astsu') os.system('cp -r * /usr/share/astsu') os.system('ln -s /usr/share/astsu/astsu.py /usr/bin/astsu') print('[+] ASTSU installed') elif machine_os == 'Windows': os.system("mkdir C:...
import pandas as pd import json import time import numpy as np from datetime import datetime import re import string import nltk from nltk.corpus import stopwords from nltk.tokenize import word_tokenize from nltk.stem import PorterStemmer from nltk.stem import WordNetLemmatizer from sklearn.feature_extraction.text imp...
import collections import os from operator import methodcaller from operator import attrgetter from functools import reduce from itertools import product __all__ = [ "ConditionalProbabilitySet", "ConditionalProbability", "Network", "Node", "ValueDistribution", "EventSet", ] class Network(obje...
import sys; datafilepath = sys.argv[1] grid = [ list(x) for x in open(datafilepath).read().splitlines() ] inf = 99999999999 for i in range(len(grid)): grid[i] = [inf] + [int(x) for x in grid[i]] + [inf] grid.insert(0,[inf]*len(grid[0])) grid.insert(len(grid),[inf]*len(grid[0])) step = 0 while True: flashers = ...
from ..decorators import * from numbers import Real @validate_args([Real, Real, Real, Real]) @ignite_global def helper_rect(self, *args): self.canvas.fill_rect(*args) self.canvas.stroke_rect(*args) @validate_args([Real, Real, Real, Real]) @ignite_global def helper_fill_rect(self, *args): s...
""" Provides method for running logistic regression for disease pathway prediction. """ from random import shuffle import numpy as np from sklearn.linear_model import LogisticRegression as SKLogisticRegression from milieu.paper.methods.method import DPPMethod class LogisticRegression(DPPMethod): """ """...
from flask import Flask from .config import DevConfig from flask_bootstrap import Bootstrap # Initializing application app = Flask(__name__) # Setting up configuration app.config.from_object(DevConfig) app.config.from_pyfile('config.py') bootstrap = Bootstrap(app) # bootstrap.init_app(app) from app import views fro...
import logging import os import torch import torch.nn as nn import sys import copy from collections import OrderedDict import math logging.basicConfig(stream=sys.stdout, level=logging.INFO, format='%(message)s') def align_and_update_state_dicts(model_state_dict, loaded_state_dict): """ Strategy: suppose tha...
class Solution: def searchRange(self, nums: List[int], target: int) -> List[int]: res = [-1, -1] lo, hi = 0, len(nums)-1 while lo < hi: mid = (hi+lo)//2 if nums[mid] < target: lo = mid+1 else: hi = mid if lo >= len(n...
import os from multiprocessing import cpu_count from src.utils.parallel import parallel_process from nussl import AudioSignal import os import glob from multiprocessing import cpu_count from . import cmd, document_parser from argparse import ArgumentParser import shutil import logging def resample_audio_file(origina...
# Generated by Django 2.2a1 on 2019-01-28 15:53 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('users', '0001_initial'), ] operations = [ migrations.C...
## CAPM ## ## install pip yfinance ## packages and imports import numpy as np import pandas as pd import datetime import matplotlib.pyplot as plt import ipywidgets as widgets import scipy.stats as scs import scipy.optimize as sco import statsmodels.api as sm import scipy.interpolate as sci from pandas_datareader imp...
from rest_framework import mixins from rest_framework.authentication import BasicAuthentication, SessionAuthentication from rest_framework.pagination import PageNumberPagination, LimitOffsetPagination from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from rest_framework...
# coding: utf-8 from hmtl.common.util import create_and_set_iterators
import csv import os from io import StringIO from django.conf import settings from django.db import IntegrityError, transaction from django.db.transaction import TransactionManagementError from django.test import RequestFactory from django.test.utils import override_settings from django.utils.dateparse import parse_da...
# -*- coding: utf-8 -*- """ Copyright (c) [2021] Huawei Technologies Co.,Ltd.ALL rights reserved. This program is licensed under Mulan PSL v2. You can use it according to the terms and conditions of the Mulan PSL v2. http://license.coscl.org.cn/MulanPSL2 THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHO...
#!/usr/bin/env python import json import math import itertools import subprocess import numpy as np import glob import re import os from Bio import SeqIO from Bio.SubsMat.MatrixInfo import blosum62 class CARD(): """ Parser for the CARD database """ def __init__(self, card_json_fp, rrna=False): ...
from CTools.cli import flags from CTools.cli import config FLAGS = flags.FLAGS
# %% [114. Flatten Binary Tree to Linked List](https://leetcode.com/problems/flatten-binary-tree-to-linked-list/) class Solution: def flatten(self, root: TreeNode) -> None: """ Do not return anything, modify root in-place instead. """ lst = list(to_list(p := root, True)) if r...
from aiohttp import web import aiolog from utils import get_logger log = get_logger(__name__) async def hello(request): log.debug("Hey") try: assert 0 except Exception: log.exception("Error occurred") return web.Response(text="Hello, world!") app = web.Application() app.router.add_...
from typing import TYPE_CHECKING, List if TYPE_CHECKING: from .base import FileSystem class AuthError(Exception): pass class ConfigError(Exception): pass class RemoteMissingDepsError(Exception): def __init__( self, fs: "FileSystem", protocol: str, url: str, ...
"""Fixer for future.standard_librayr""" from lib2to3 import fixer_base from lib2to3.fixer_util import BlankLine class FixStandardLibrary(fixer_base.BaseFix): BM_compatible = True PATTERN = r""" simple_stmt< power< 'standard_library' trailer< '.' 'install_aliases' > ...
import numpy as np import tensorflow as tf import random from gym.utils import seeding def set_all_seeds(seed=1): rng, seed = seeding.np_random(1) tf.set_random_seed(seed) np.random.seed(seed) random.seed(seed) return rng, seed def get_obs_from_traj(trajectories): trajectories = np.array(t...
""" This module contains the loss classes. Specific losses are used for regression, binary classification or multiclass classification. """ # Author: Nicolas Hug from abc import ABC, abstractmethod import numpy as np from scipy.special import expit try: # logsumexp was moved from mist to special in 0.19 from sc...
# coding=utf-8 # Copyright 2021 Google Health Research. # # 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 la...
# coding=utf8 # connect to WAMP router, join a XBR realm (with WAMP-cryptosign authentication), and # call a procedure (XBR encrypted) registered in producer buying data encryption keys
import random import torch import argparse from statistics import mean from data_process import split_data, gen_data from train import train from evaluate import evaluate_model from utils import get_sent_embed, get_word_embed from alignment_model import update_word_alignment_model, update_sent_alignment_model def ran...
# vim: sw=4:ts=4:et import unittest from saq.constants import * from saq.test import * from saq.observables import * # expected values EV_OBSERVABLE_ASSET = 'localhost' EV_OBSERVABLE_SNORT_SIGNATURE = '2809768' EV_OBSERVABLE_EMAIL_ADDRESS = 'jwdavison@valvoline.com' EV_OBSERVABLE_FILE = 'var/test.txt' EV_OBSERVABLE_...
def points(games): total_score =0 for game in games: if(game[0] > game[-1]): total_score+=3 elif(game[0] == game[-1]): total_score+=1 return total_score print(points(['1:0','2:0','3:0','4:0','2:1','3:1','4:1','3:2','4:2','4:3'])) #30 print(points(['1:1'...
import torch import torch.nn as nn class Inception(nn.Module): def __init__(self, in_planes, n1x1, n3x3red, n3x3, n5x5red, n5x5, pool_planes): super(Inception, self).__init__() # 1x1 conv branch self.b1 = nn.Sequential( nn.Conv2d(in_planes, n1x1, kernel_size=1), ...
from django.shortcuts import render from .models import Projects # Create your views here. def home(request): project = Projects.objects.all() return render(request, 'base/index.html', { 'projects': project, } )
from __future__ import print_function from builtins import object from builtins import str from typing import Dict from empire.server.common import helpers from empire.server.common.module_models import PydanticModule from empire.server.utils import data_util class Module(object): @staticmethod def generate...
from flask_script import Manager from resume import app, db, Professor, Course manager = Manager(app) # Reset database and create three professors @manager.command def deploy(): db.drop_all() db.create_all() harry_wang = Professor(name='Harry Wang', department='Management Information Systems') t_lync...
__all__ = ( 'StickerFormat', 'StickerType', ) from ...backend.export import export from ..bases import PreinstancedBase, Preinstance as P @export class StickerFormat(PreinstancedBase): """ Represents a message sticker's format's type. Attributes ---------- name : `str` The name ...
# encoding: utf-8 # # Copyright (c) 2021 https://github.com/realliyifei/ # MIT Licence. See http://opensource.org/licenses/MIT # # Created on 2021-07-14 # # This program is to rename the input string following the small-case-with-hyphen format, # you can change it to other output formats as you want import sys fro...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( month_by_name, int_or_none, ) class NDTVIE(InfoExtractor): _VALID_URL = r'^https?://(?:www\.)?ndtv\.com/video/player/[^/]*/[^/]*/(?P<id>[a-z0-9]+)' _TEST = { 'url': 'http://www.ndtv.com...
import re from enum import Enum, auto from Bio.Alphabet.IUPAC import IUPACAmbiguousDNA class SequenceType(Enum): """All possible sequence types for HGVS identifiers""" CODING = auto() GENOMIC = auto() NONCODING = auto() PROTEIN = auto() MITOCHONDRIAL = auto() CIRCULAR = auto() RNA = a...
#!/usr/bin/env python from __future__ import division, absolute_import, print_function """ JAMS Python Utilities Package offers miscellaneous functions and sub-modules in different categories. Get help on each function by typing >>> import jams >>> help(jams.function) Provided functions and modules (alphabetic w/o o...
from rest_framework import serializers from ..models import Name class NameSerializer(serializers.ModelSerializer): class Meta: model = Name fields = '__all__'
import pandas as pd import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from zipModel import featureScale # Set IEEE plotting stuff. mpl.rcParams['axes.titlesize'] = 8 mpl.rcParams['axes.labelsize'] = 6 mpl.rcParams['legend.fontsize'] = 6 mpl.rcParams['font.family'] = 'serif' mpl.rcParams['fon...
class OpenFPGA_Tile_Generator: def __init__(self, grid, netlist, library, top_module): self.fpga_size = grid self._netlist = netlist self._library = library self._top_module = top_module def create_tiles(self): ''' This will be extendned in the class ''...
# # shopping_cart.py # # Shopping Cart Exercise # # Author: Krish Sarawgi # Github: "0-krish" # NetID: ks1730 # # this is the file with all the code for the shopping-cart system import pandas import gspread from oauth2client.service_account import ServiceAccountCredentials from datetime import datetime import os f...
#!/usr/bin/env python # encoding: utf-8 """ @version : 0.1 @author : Leo @contact : 1162441289@qq.com @software : PyCharm @file : mmseg.py @time : 2019/1/5 9:55 @intro : mmseg分词方法 """ import os import pickle from math import log from collections import defaultdict def add_curr_dir(name): re...
from moontracker.models import User def test_sanity(): user = User("test", "test", "1111111111") assert user.is_authenticated() assert user.is_active() assert not user.is_anonymous()
from orrinjelo.utils.decorators import timeit from pprint import pprint class Pool(): contents = { k: 0 for k in range(9) } history = [] @staticmethod def day(): Pool.contents[9] = 0 for j in range(9): if j == 0: Pool.contents[9] = Pool.content...
array0 = [ [ 0, 0, 0], [ 0, 0, 0], [0, 0, 0] ] array1 = [ [ 1, 2, 3], [ 4, 5, 6], [7, 8, 9] ] m0 = Matrix(array0) m1 = Matrix(array1) m2 = Matrix(array1) print("m0:") m0.print() print("m1:") m1.print() print("m2:") m2.print() m2.mulc(2) print("m2:") m2.print() class MyMatrix(Matrix): de...
""" Authenticated HTTP proxy for Jupyter Notebooks Some original inspiration from https://github.com/senko/tornado-proxy """ from datetime import datetime import inspect import socket import os from urllib.parse import urlunparse, urlparse from tornado import gen, web, httpclient, httputil, process, websocket, ioloo...
import os import sys from Qt import QtWidgets, QtCore from noiceui import constants from noiceui.controller import NoiceController def load_resources(): """ loads the app resouces :return: None """ rsc_file = os.path.join(os.path.split(__file__)[0], constants.RSC_FILE) rsc_file = os.path.abspa...
import sys sys.path += ["../../", "../"] from flask_restplus import Namespace, Resource, fields from flask import current_app from commons.dbmodels import Author as AuthorModel from commons.dbmodels import Book as BookModel from commons.dbmodels import Article as ArticleModel from commons.dbmodels import ArchivalRecord...
from django.conf.urls import url, include from . import views app_name = 'shop' urlpatterns = [ url(r'^$', views.home_view, name='home_url'), url(r'^inverter/$', views.inverter_view, name='inverter_url'), url(r'^success/$', views.success, name='success_url'), url(r'^failure/$', views.failure, name='fai...
# # This file is part of snmpfwd software. # # Copyright (c) 2014-2019, Ilya Etingof <etingof@gmail.com> # License: http://snmplabs.com/snmpfwd/license.html # import sys import re from snmpfwd import error from pysnmp.proto.rfc1902 import OctetString # Constants SYMBOL_OPTION = ':' SYMBOL_SECTION_BEGIN = '{' SYMBOL_SE...
#!/usr/bin/env python # coding=utf8 # File: config.py import os import math import random import numpy from envs.env_maze import MazeTask from envs.env_maze import gen_pattern as gen_single from envs.env_maze import output_to_action from envs.env_maze import obs_to_input from epann.utils import categorical from models...
""" A simple utility module module to deal with links. Given a list of links and a base url, it will: * resolve relative links, * exclude duplicates, * strip anchors, * exclude non HTTP/HTTPs links. To further filter links pointing to images, PDFs or other non-text resources, look at the `is_media_link` method (also ...
import sys import argparse import time import requests import json import logging from datetime import datetime, timedelta import pymongo from iqmon import get_all_configs from iqmon.devices import insert_mongodoc ##------------------------------------------------------------------------- ## get_alpaca ##----------...
import caffe2_paths import os import pickle from caffe2.python import ( workspace, layer_model_helper, schema, optimizer, net_drawer ) import caffe2.python.layer_model_instantiator as instantiator import numpy as np from pinn.adjoint_mlp_lib import build_adjoint_mlp, init_model_with_schemas import pinn.data_r...
def say_hello(text): response = f"Hello, your request message was: {text}" return response
#!/usr/bin/env python import re import json import redis def main(): matcher = re.compile('group:[^:]+:user:[^:]') database = redis.Redis(decode_responses=True) for key in database.scan_iter(): if matcher.match(key): user = json.loads(database.get(key)) old_parent_index =...
""" Tests for the usage of the mock for ``requests``. """ import email.utils import io import json import socket from datetime import datetime import pytest import requests from freezegun import freeze_time from requests.exceptions import MissingSchema from requests_mock.exceptions import NoMockAddress from vws impor...
#!/usr/bin/python3 from fetcher import DocumentFetcher import logging import sys # Document fetcher settings doc_api_url = "http://localhost:5000/api/contents/" token_api_url = "http://localhost:8080/api/" token_api_user = "document-fetcher" token_api_passwd = "password" fetch_interval = 10 pfile = "fetcher.p" logle...
#!/usr/bin/env python3 """ Very simple HTTP server in python for logging requests Usage:: ./server.py [<port>] """ from http.server import BaseHTTPRequestHandler, HTTPServer import logging import time import os import sys import psutil from datetime import datetime as dt import json class MemoryFilter(logging.Fil...
import requests import hashlib import sys def request_api_data(query_char): '''requests our data and gives us a response''' url = 'https://api.pwnedpasswords.com/range/' + query_char res = requests.get(url) if res.status_code != 200: #check our response if the status is 200 raise RuntimeError(f'Error...
from django.urls import path from .views import Reading, WishList, Completed urlpatterns = [ path('reading/', Reading.as_view(), name='reading-list'), path('completed/', Completed.as_view(), name='completed-list'), path('wishlist/', WishList.as_view(), name='wish-list'), ]
#!/usr/bin/python # -*- coding: utf-8 -*- # 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. #...
""" PrivacyFlash Pro is licensed under the MIT License Copyright (c) 2019 Rafael Goldstein, David Baraka, Sarah Jin, Sebastian Zimmeck """ """ analysis.py ================================================================================ analysis.py contains the module for analyzing the project; looks for instances ...
from collections import deque def helper(q,n,k): stack = [] for i in range(1,k+1): stack.append(i) queue_ans = deque() while(len(stack) > 0): queue_ans.append(stack.pop()) for i in range(k+1,n+1): queue_ans.append(i) for i in queue_ans: print(i,end='') q = ...
# -*- coding: utf-8 -*- from pyzipcodeapi.api import ZipCodeApi API_KEY = '3dAoRheoltlrRLipalNn8LkhJAh59P5c2GAUXOjjhEK9p2zAomYw7iORS5X1U2eX' if __name__ == '__main__': # set different inputs f = 'json' u = 'km' ou = 'degrees' obj = ZipCodeApi(API_KEY) # https://www.zipcodeapi.com/rest/<api_ke...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('locations', '0004_auto_20151218_1826'), ] operations = [ migrations.AlterField( model_name='location', ...
import re import os from pathlib import Path import pickle from sEDM.sedm import EDM, sEDM from sEDM.data_fasttext import new_ft_dict if __name__ == "__main__": train_file = open(os.path.join(os.path.abspath(os.path.dirname(Path(__file__))), "train_unique_data.pkl"), "rb") data_dict_train = pickle.load(train_f...
# -*- coding: utf-8 -*- # Generated by Django 1.11.16 on 2018-11-30 01:52 from __future__ import unicode_literals import ckeditor.fields from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('articleApp', '0002_articlemodel_article_desc'), ] operations = [ ...
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function import os import pandas as pd from pandas.util.testing import makeCustomDataframe as mkdf from exhibitionist.toolbox import UrlDisplay, get_server import handlers # make sure the handlers module is on your python path # you could just ...
import sys def load_shared_modules(): import sys import os # adding Folder_2 to the system path sharedModule = os.path.join(os.getcwd(),'src', 'shared') sys.path.insert(1, sharedModule) load_shared_modules() from config import ConfigLoader from db import PostgreSql from policy_unitofwork import P...
import sys def read(file_name): with open(file_name + '.in') as file: max_num_slices, num_dif_types_pizza = file.readline().split(' ') return int(max_num_slices), int(num_dif_types_pizza), file.readline().split(' ') def write(file_name, ret): with open(file_name + '_sol.txt', 'w') as file: ...
import numpy as np import time import torch import math from online.online_utils import Queue class ActionActivator: """ Handles single time activations based on filtered/raw classifier probabilities """ def __init__(self, opts, contrast_class_indices): """ :param output_queue_size: ...
#!/usr/bin/env # -*- coding: utf-8 -*- # Copyright (C) Victor M. Mendiola Lau - All Rights Reserved # Unauthorized copying of this file, via any medium is strictly prohibited # Proprietary and confidential # Written by Victor M. Mendiola Lau <ryuzakyl@gmail.com>, February 2017 """Davies–Bouldin index (clustering valid...