text
stringlengths
2
999k
import pandas import re import string import sys """split-data.py: split data into different classes according to labels""" __author__ = "YuanSun" def main(input_file, output_path): df = pandas.read_csv(input_file) n = max(df['label'].values) # split file according to labels for i in range(1, n+1): ...
#openbrowser.py import pyautogui import time import webbrowser #chrome = (662,1048) #pyautogui.click(chrome) url = 'https://www.google.com' webbrowser.open(url) time.sleep(3) pyautogui.write('thailand') pyautogui.press('enter') ####### def Search(word): time.sleep(3) for i in range(7): ...
# Python 3 # Be sure you have followed the instructions to download the 98-0.txt, # the text of A Tale of Two Cities, by Charles Dickens import collections file=open('98-0.txt', encoding="utf8") # if you want to use stopwords, here's an example of how to do this # stopwords = set(line.strip() for line in open('stop...
import math import torch import torch.nn as nn import torch.nn.functional as F from .common_layers import * from .cbam import CBAM_Module from torchvision.models.resnet import BasicBlock, Bottleneck class CbamBlock(nn.Module): expansion = 1 def __init__(self, inplanes, planes, stride=1, downsample=None): super(...
import numpy as np from matplotlib import pyplot as plt import open3d as o3d from mpl_toolkits.mplot3d import Axes3D from time import time, sleep from quaternion import rotate, mat_from_quaternion_np, conjugate_np, multiply_np, to_magnitude_np, conjugate, multiply, to_magnitude from helpers import randquat, slerp, quat...
import os import logging from flask import Flask, render_template, Response, send_from_directory, request, current_app flask_app = Flask(__name__) logging.basicConfig() log = logging.getLogger(__name__) @flask_app.route("/") def main(): return render_template('main.html', title='Inventory') @flask_app.route("/s...
""" Collection of Numpy linear algebra functions, wrapped to fit Ivy syntax and signature. """ # global import numpy as _np import ivy as _ivy from typing import Union, Tuple from collections import namedtuple svd = _np.linalg.svd def matrix_norm(x, p=2, axes=None, keepdims=False): axes = (-2, -1) if axes is ...
"""We want to share these two methods between the ShopItemsView class and also the Patch methods, so they are implemented in a separate helper file here.""" from sqlalchemy import and_ from app import db from apps.shop.models import ShopCategories, ShopItemsCategoriesMapping, ShopItemsURLMapping def add_ca...
import asyncio import os.path import time import sys import platform import queue import traceback import os import webbrowser from decimal import Decimal from functools import partial, lru_cache from typing import (NamedTuple, Callable, Optional, TYPE_CHECKING, Union, List, Dict, Any, Sequence, Ite...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from . import account_invoice from . import crm_lead from . import crm_team from . import res_users from . import sale_order
#! /usr/bin/env python3 """Unit tests for ulist This test case can be executed individually, or with all other test cases thru testsuite_framework.py. __author__ = "http://www.gemalto.com" Copyright 2001-2012 gemalto Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com This file is part of pyscard. py...
import matplotlib.pyplot as plt import matplotlib.tri as tri import numpy as np ngridx = 100 ngridy = 200 # define the hyperparameter space (epsilon = 1-20, C=1-10) epsilon_min = 1 epsilon_max = 10 C_min = 1 C_max =10 epsilon = list(np.arange(epsilon_min,epsilon_max,1)) C = list(np.arange(C_min,C_max,1)) #calculate ...
from notetool.secret.secret import (SecretManage, read_secret, set_secret_path, write_secret) from notetool.tool.build import get_version, version_add from .compress import decompress from .log import log, logger from .path import delete_file, exists_file, path_parse, rename
# -*- coding: utf-8 -*- import json import os import subprocess import sys from distutils.spawn import find_executable import click import frappe from frappe.commands import get_site, pass_context from frappe.exceptions import SiteNotSpecifiedError from frappe.utils import get_bench_path, update_progress_bar, cint ...
#!/usr/bin/python import unittest from main import compute_precedence, compute_serial class Test18(unittest.TestCase): def assertComputeSerial(self, line, result): self.assertEquals(compute_serial(line), result) def test_compute_serial_simple(self): self.assertComputeSerial('2', 2) ...
# check working directory #import os #WORKINGDIR = os.path.normpath(os.getcwd()) #print("Current Working direcotory:\t{}".format(WORKINGDIR)) #folders = WORKINGDIR.split(os.sep) #if folders.pop() in ['notebook', 'src', 'talks']: # WORKINGDIR = os.sep.join(folders) # print("Changed to New working directory:\t{dir}".fo...
import json import os def arquivo_json_existe(file_name): return os.path.exists(file_name) def busca_registro_no_arquivo(arquivo,registro): for x in range(len(arquivo)): if registro['id'] == arquivo[x]['id']: return x return False def ler_arquivo_json(nome_arquivo): with open...
# -*- coding: utf-8 -*- ''' Created on 2014年9月30日 @author: Rayleigh ''' import KNN as kNN from numpy import * dataSet, labels = kNN.createDataSet() testX = array([0.2, 0.9]) k = 3 outputLabel = kNN.kNNClassify(testX, dataSet, labels, 3) print "Your input is:", testX, "and classified to class: ", outputLabel testX ...
# -*- coding: utf-8 -*- """Functional tests using WebTest. See: http://webtest.readthedocs.org/ """ from flask import url_for from socialShrink.user.models import User from .factories import UserFactory class TestLoggingIn: """Login.""" def test_can_log_in_returns_200(self, user, testapp): """Logi...
# (C) Datadog, Inc. 2016-present # All rights reserved # Licensed under Simplified BSD License (see LICENSE) from google.protobuf.internal.decoder import _DecodeVarint32 # pylint: disable=E0611,E0401 from . import metrics_pb2 # Deprecated, please use the PrometheusCheck class def parse_metric_family(buf): """ ...
"""CrawlSpider v2""" from .rules import Rule from .spider import CrawlSpider
# 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 you under the Apache License, Version 2.0 (the # "License"); you may not u...
# modified from /Users/janet/Dropbox/meta4_bins_data_and_files/170118_read_mappings_by_sample/plot_frac_mapped.py # coding: utf-8 print('import packages...') # In[1]: import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt import pandas as pd import seaborn as sns print('done importing packages.....
"""Provide functionality to interact with Cast devices on the network.""" import asyncio import logging from typing import Optional import pychromecast from pychromecast.controllers.homeassistant import HomeAssistantController from pychromecast.controllers.multizone import MultizoneManager from pychromecast.socket_cli...
import json from io import BytesIO from pathlib import Path from tokenize import tokenize import click SECTIONS = [ 'md_buttons', 'md_install', 'py_install', 'md_create', 'py_create', 'md_script', 'py_script', 'md_display', 'py_display', ] @click.command() @click.option( '-t'...
import re from pathlib import Path from notary.models import LICENSES as SUPPORTED_LICENSES def guess_license(name): """Returns a list of classes that extend the :class:`License` abstract base class. :param name: If a string is sent, it checks if it's a substring of any of the supported licenses. If it i...
# Generated by Django 4.0a1 on 2021-09-24 12:02 # Modified on 2021-10-06 to remove any content. from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("euphro_auth", "0001_initial"), ] operations = []
# coding: utf-8 """ eBay Finances API This API is used to retrieve seller payouts and monetary transaction details related to those payouts. # noqa: E501 OpenAPI spec version: 1.9.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 impo...
# -*- coding: utf-8 -*- """Console script for ctx_to_zooniverse.""" import click @click.command() def main(args=None): """Console script for ctx_to_zooniverse.""" click.echo("Replace this message by putting your code into " "ctx_to_zooniverse.cli.main") click.echo("See click documentation...
# nuScenes dev-kit. # Code written by Sergi Adipraja Widjaja, 2019. # + Map mask by Kiwoo Shin, 2019. # + Methods operating on NuScenesMap and NuScenes by Holger Caesar, 2019. import json import os import random from typing import Dict, List, Tuple, Optional, Union import cv2 import descartes import matplotlib.gridsp...
from config import * import numpy as np class Test_model(): """ Class builds container with predictive models based Parameters ---------- train: tf.data.Datasets Тренировочный, предобработатнный датасет """ def __init__(self, models:list=[], im...
""" Copyright (c) 2018-2021 Qualcomm Technologies, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met: * Redistributions of source code must retain...
# Copyright Contributors to the Open Shading Language project. # SPDX-License-Identifier: BSD-3-Clause # https://github.com/imageworks/OpenShadingLanguage # Turn an LLVM-compiled bitfile into a C++ source file where the compiled # bitcode is in a huge array. from __future__ import print_function, absolute_import imp...
"""Base classes and definitions common to all Fields.""" import abc import enum import functools import io import os import typing import warnings from typing import Any from typing import BinaryIO from typing import Callable from typing import Generic from typing import Iterable from typing import Mapping from typing...
""" Created on Aug 26, 2011 @author: guillaume """ # Imports from scipy import (zeros, asarray, pi, cos, sqrt) from scipy.constants import hbar, mu_0 from chemex.constants import gamma from chemex.bases.two_states.iph_aph import (R_IXY, R_2SZIXY, DR_XY, ...
""" This module contains various classes for performing tokenization, stemming, and filtering. """ from miso.data.tokenizers.tokenizer import Token, Tokenizer from miso.data.tokenizers.word_tokenizer import WordTokenizer
import os import time from pathlib import Path from typing import Optional import fsspec import posixpath from aiohttp.client_exceptions import ServerDisconnectedError from .. import config from .download_manager import DownloadConfig, map_nested from .file_utils import get_authentication_headers_for_url, is_local_pa...
'''initialize''' from .userweibospider import UserWeiboSpider
# Copyright 1999-2018 Alibaba Group Holding Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
import oneflow.experimental.nn as nn from utils.layer_norm import LayerNorm class SublayerConnection(nn.Module): """ A residual connection followed by a layer norm. Note for code simplicity the norm is first as opposed to last. """ def __init__(self, size, dropout): super(SublayerConnecti...
# # Copyright (C) 2014-2019 S[&]T, The Netherlands. # from __future__ import absolute_import, division, print_function from muninn._compat import string_types as basestring from muninn.schema import * from muninn.visitor import TypeVisitor class _ConfigParser(TypeVisitor): def visit(self, type, value): ...
from PyQt5.QtWidgets import QProgressBar class Progress(QProgressBar): def __init__(self, parent=None): super(Progress, self).__init__(parent)
# -*- coding: UTF-8 -*- from django.conf.urls import url, include from cmdb import views, views_ajax urlpatterns = [ url(r'^$', views.getHostList, name='getHostList'), url(r'^getHostList/$', views.getHostList, name='getHostList'), url(r'^addHostForm/$', views.addHostForm, name='addHostForm'), url(r...
__version__ = '0.3.3'
from django.contrib import admin from django.contrib.auth.admin import UserAdmin # from django.contrib.auth.models import User # @admin.register(UserAdmin) # class UserAdmin(UserAdmin): # list_display = ('active', 'username', 'email', 'first_name', 'last_name') # list_filter = ('active', 'username', 'email') #...
# -*- coding: utf-8 -*- """ Created on Thu Jul 25 17:16:36 2019 @author: epyir """ import glob import numpy as np import torch import torch.nn as nn from torch.utils.data import Dataset from torch.autograd import Variable import torchvision.transforms as transforms import os.path as osp from PIL import Image import js...
from django.urls import path from sch import views urlpatterns = [ path('ls1/',views.list,name='ls1'), path('footer1',views.footer1,name='fo1'), path('subs1',views.subs1,name='sub1') ]
''' P22 must be connected to the onewire sensor via 4K7 pull-up resistor ''' import time import machine from machine import Pin class OneWire: CMD_SEARCHROM = const(0xf0) CMD_READROM = const(0x33) CMD_MATCHROM = const(0x55) CMD_SKIPROM = const(0xcc) def __init__(self, pin): self.pin = pi...
# Create your views here. # Create your views here. from django.views.generic.list import ListView # from django_filters.rest_framework import DjangoFilterBackend, FilterSet, OrderingFilter from django_gotolong.nach.models import Nach class NachListView(ListView): model = Nach # if pagination is desired ...
# the main chanpy of the project import getmac import time from datetime import datetime from random import randint import json import requests as req from webapp.user_login_app import mongo from db.flaskdbreader import int2dt import numpy as np class Client: def __init__(self): self._t = None se...
# Copyright 2017 Workiva # 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 #...
# exported from PySB model 'model' from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD Model() Monomer('Ligand', ['Receptor']) Monomer('ParpU', ['C3A']) Monomer('C8A', ['BidU', 'C3pro']) Monomer('SmacM', ['BaxA']) Monomer('BaxM', ['BidM', '...
# -*- coding: utf-8 -*- # ***************************************************************************** # NICOS, the Networked Instrument Control System of the MLZ # Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS) # # This program is free software; you can redistribute it and/or modify it under # the t...
"""An API for dealing with orientation and rotations in 3-D space. """ import numpy as np from walle.core import constants, quaternion, utils from walle.core.matrix import RotationMatrix from walle.core.orthogonal import is_proper_rotm class Orientation(object): """A convenience class for manipulating 3-D orienta...
# coding: utf-8 import flask import flask_wtf import wtforms import auth import config import model import util from main import app ############################################################################### # Admin Stuff ############################################################################### @app.rou...
# -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2020-05-27 08:24 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('disturbance', '0060_auto_20200527_1335'), ] operat...
## @file host.py ## @brief Utility functions for hosts """ Utility functions for hosts. Detailed description (for [e]pydoc goes here) """ from pyVmomi import Vim from pyVmomi.VmomiSupport import ResolveLinks ## @param si [in] Retrieve the root folder def GetRootFolder(si): """ Retrieve the root folder. ...
import geopandas as gpd import numpy as np from shapely.geometry import LineString, Polygon, Point import os import pandas as pd from pyproj import Transformer transformer = Transformer.from_crs(4326, 2193, always_xy=True) trans_inv = Transformer.from_crs(2193, 4326, always_xy=True) def fit_plane_to_points(points: ...
from __future__ import unicode_literals, division, absolute_import from builtins import * # pylint: disable=unused-import, redefined-builtin from past.builtins import basestring from flexget import plugin from flexget.event import event from flexget.plugins.filter.seen import FilterSeen class FilterSeenInfoHash(Fil...
import os import time from argparse import ArgumentParser from os import makedirs from os.path import basename, exists from shutil import copyfile import torch import torch.backends.cudnn as cudnn from torch import nn from torch.optim import Adam, lr_scheduler from torch.utils.data import DataLoader from config.confi...
from __future__ import unicode_literals from documents.permissions import permission_document_view from documents.tests.test_views import GenericDocumentViewTestCase from ..models import Tag from ..permissions import ( permission_tag_attach, permission_tag_create, permission_tag_delete, permission_tag_edit, p...
# -*- coding: utf-8 -*- # Copyright (C) 2012 Anaconda, Inc # SPDX-License-Identifier: BSD-3-Clause """Test for python distribution information and metadata handling.""" from __future__ import absolute_import, division, print_function, unicode_literals from datetime import datetime from errno import ENOENT import os fr...
#!/usr/bin/env python # -*- coding: utf8 -*- import six from .topping import Topping from jawa.constants import ConstantClass, String from burger.util import class_from_invokedynamic class TileEntityTopping(Topping): """Gets tile entity (block entity) types.""" PROVIDES = [ "identify.tileentity.lis...
from collections import namedtuple from torch.testing._internal.common_utils import run_tests from torch.testing._internal.jit_utils import JitTestCase from torch.testing import FileCheck from torch import jit from typing import NamedTuple, List, Optional, Dict, Tuple, Any from jit.test_module_interface import TestModu...
""" Given a collection of distinct numbers, return all possible permutations. For example, [1,2,3] have the following permutations: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1] ] """ class Solution(object): def permute(self, nums): """ :type nu...
from django.views import generic from .models import (Product, LatestProducts, LaptopsCategory, SmartPhonesCategory) from c_user.models import User from django.contrib.auth.views import LoginView from .forms import UserLoginForm, RegisterForm, UserProfileUpdateForm from django.shortcuts import redi...
def is_isogram(string): letters = set() for c in string.lower(): if c in '_- ': continue if c in letters: return False letters.add(c) return True
# _ __ # | |/ /___ ___ _ __ ___ _ _ ® # | ' </ -_) -_) '_ \/ -_) '_| # |_|\_\___\___| .__/\___|_| # |_| # # Keeper Commander # Copyright 2018 Keeper Security Inc. # Contact: ops@keepersecurity.com # import os.path import importlib import logging from typing import Iterable, Union PathDelimiter = '\\' ...
from nwb_conversion_tools.basedatainterface import BaseDataInterface from spikeextractors import SpikeGLXRecordingExtractor from pynwb import NWBFile from pathlib import Path import pyopenephys from .utils_expo import process_blocksV2, process_passesV2 class ExpoDataInterface(BaseDataInterface): """Conversion cl...
from django.conf import settings from django.conf.urls import include, url from django.contrib import admin admin.autodiscover() urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'^markers.json$', 'robinson_app.views.json_markers'), url(r'^markers/(?P<photo_pk>\d*).json$', 'robinson_app.vie...
#!/usr/bin/env python # -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """Train a ROI-FCN network on a region of intere...
"""Looping Examples""" dogs = ['husky', 'beagle', 'doberman', 'dachsund', 'collie', 'mutt'] # This is an abomination! Who would do something like this? i = 0; max = len(dogs) while i < max: print(dogs[i]) i += 1 print("") # This is better, for some value of better # compared to above, but NOT Pythonic! for ...
#test module for tfrecords from deepforest import tfrecords from deepforest import utilities from deepforest import preprocess from deepforest import get_data import pytest import os import glob import tensorflow as tf import numpy as np import matplotlib.pyplot as plt from keras_retinanet.preprocessing import csv_ge...
# Find the highest number not in the list import numpy as np l = [1, 3, 5, 9, 11] a = np.array(l) ans = 1 for i in range(a.max(initial=0) - 1, max(0, a.min(initial=0)), -1): if i not in a: ans = i print(i) break A = [1, 3, 5, 9, 11] Ans = 1 for j in range(max(A)-1, max(0, min(A)), -1): ...
import _plotly_utils.basevalidators class BordercolorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="bordercolor", parent_name="treemap.marker.colorbar", **kwargs ): super(BordercolorValidator, self).__init__( plotly_name=plotly_name, ...
from blackduck import Client from blackduck.Client import HubSession from blackduck.Authentication import CookieAuth import argparse import logging from pprint import pprint logging.basicConfig( level=logging.DEBUG, format="[%(asctime)s] {%(module)s:%(lineno)d} %(levelname)s - %(message)s" ) parser = argpars...
#!/usr/bin/env python """ 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 you under the Apache License, Version 2.0 (the "License");...
""" Django settings for django_project project. Generated by 'django-admin startproject' using Django 4.0.2. For more information on this file, see https://docs.djangoproject.com/en/4.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/4.0/ref/settings/ """ impor...
# -*- coding: utf-8 -*- import zipfile import json from src.loader.xmltodict import parse from src.loader.graph import Graph class Converter(object): def __init__(self, file_path) -> None: super().__init__() with open(file_path, 'rb') as f: zip = zipfile.ZipFile(f) xml_co...
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "simsc.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the ...
from datetime import datetime import logging import pandas as pd from utils.fetcher_abstract import AbstractFetcher __all__ = ('WorldECDCFetcher',) logger = logging.getLogger(__name__) class WorldECDCFetcher(AbstractFetcher): LOAD_PLUGIN = True def fetch(self): url = 'https://opendata.ecdc.europa.e...
from django.db import models from django.utils.translation import gettext_lazy as _ from cms.models import CMSPlugin from djangocms_bootstrap5.constants import COLOR_STYLE_CHOICES from djangocms_bootstrap5.fields import AttributesField, TagTypeField from .constants import LISTGROUP_STATE_CHOICES class Bootstrap5Li...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ relative_dates.py: Getting a new relative date. """ from datetime import datetime from dateutil.relativedelta import relativedelta __author__ = "Breno RdV" __copyright__ = "Breno RdV @ raccoon.ninja" __contact__ = "http://raccoon.ninja" __license__ = "M...
from .util_functions import sort_multiple_arrays_using_one, reverse_complement, output_transcript_sequences_to_fasta, \ download_pdb_file, get_uniprot_acc_from_transcript_id, read_sbs_from_vcf from .gene_sequence_functions import get_genomic_ranges_for_gene, get_positions_from_ranges, \ get_gene_kmers_from_exon...
# -*- coding: utf-8 -*- """ Comparison of computational time for generalized linear mixed effects models Author: Fabio Sigrist, May 2021 """ import pandas as pd import numpy as np import os import time import statsmodels.genmod.bayes_mixed_glm as glm path_data = "C:\\GLMM_comparison\\" # load data group_data_P = pd....
from os.path import exists from typing import List from ...api.models import log as log_model from . import extractor from . import transformer def get_is_file(logs_path: str) -> log_model.LogFile: return log_model.LogFile( is_file=exists(logs_path), path=logs_path, ) def get_remote_addrs_c...
# -*- coding: utf-8 -*- # Copyright 2015-2021 CERN # # 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...
import os import sys import shutil import subprocess import time import re from datetime import date from datetime import datetime num_procs = [6, 5, 4, 3, 2, 1] path_dir = "/home/ashutosh/codes/dealii_code/examples/KLexpansion_results1/" code_dir = "/home/ashutosh/codes/dealii_code/examples/KLexpansion" path_dir_lis...
import heapq as hq import scipy as sp import numpy as np from openpnm.algorithms import GenericAlgorithm from openpnm.utils import logging logger = logging.getLogger(__name__) class InvasionPercolation(GenericAlgorithm): r""" A classic/basic invasion percolation algorithm optimized for speed. Parameters ...
import pytest import numpy as np from .._sky_bounds import get_rough_sky_bounds, radec_to_uv from ...wcs import FastHashingWCS @pytest.fixture def bnds_data(): wcs = FastHashingWCS(dict( naxis1=2048, naxis2=4096, equinox=2000.00000000, radesys='ICRS ', ctype1='RA---Tpv...
import os import matplotlib.pyplot as plt import pandas as pd import numpy as np import helper_methods # Get CLI args import sys if len(sys.argv) != 4: print("Usage: <input_file> <output_dir> <output_name>") exit(1) INPUT_CSV = sys.argv[1] OUTPUT_DIR = sys.argv[2] OUTPUT_NAME = sys.argv[3] OUTPUT_TYPE = "png" ...
# fmt: off import logging import os import pprint from pathlib import Path from farm.data_handler.data_silo import DataSilo from farm.data_handler.processor import SquadProcessor from farm.data_handler.utils import write_squad_predictions from farm.infer import QAInferencer from farm.modeling.adaptive_model import Ada...
# Generated by Django 3.1.8 on 2021-04-12 03:13 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('rest_app', '0004_auto_20210121_0300'), ] operations = [ migrations.AlterField( model_name='article', name='rating', ...
""" OSXMetaData class to read and write various Mac OS X metadata such as tags/keywords and Finder comments from files """ import base64 import datetime import json import logging import os.path import pathlib import plistlib # plistlib creates constants at runtime which causes pylint to complain from plistlib ...
import torch from data import IntentDset from model import ProtNet from torch import nn, optim from pytorch_pretrained_bert.optimization import BertAdam, WarmupLinearSchedule import math import argparse parser = argparse.ArgumentParser() parser.add_argument('--train_data', default='lena', type=str) parser.add_argume...
import logging import os import subprocess from pathlib import Path log = logging.getLogger("iblrig") IBLRIG_FOLDER = r"C:\iblrig" CWD = os.getcwd() BONSAI_FOLDER = Path(IBLRIG_FOLDER) / "Bonsai" bns = BONSAI_FOLDER / "Bonsai64.exe" if bns.exists(): bns = str(bns) else: bns = str(BONSAI_FOLDER / "Bonsai.exe...
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Meta checkout dependency manager for Git.""" # Files # .gclient : Current client configuration, written by 'config' comma...
# coding: utf-8 import os parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) os.sys.path.insert(0,parentdir) from fbmq import Page from example.config import CONFIG page = Page(CONFIG['FACEBOOK_TOKEN']) @page.after_send def after_send(payload, response): print('AFTER_SEND : ' + payload.to_j...
# Copyright 2022 The Flax 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 agreed to in wri...
# This is an auto-generated file. Do not edit it. from twisted.python import versions version = versions.Version('twisted.conch', 12, 3, 0)