code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# coding=utf-8
"""Text Classifier based on bert."""
from __future__ import absolute_import, division, print_function
import collections
import csv
import gc
import io
import logging
import math
import multiprocessing
import os
import pickle
import time
from multiprocessing import Pool, cpu_count
from multiprocessing.d... | [
"tensorflow.clip_by_value",
"modeling.BertModel",
"matplotlib.pyplot.figure",
"numpy.arange",
"tokenization.FullTokenizer",
"tensorflow.train.get_or_create_global_step",
"tensorflow.squeeze",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.grid",
"tensorflow.expand_dims",
"tensorflow.python_io.TFRe... | [((823, 834), 'multiprocessing.cpu_count', 'cpu_count', ([], {}), '()\n', (832, 834), False, 'from multiprocessing import Pool, cpu_count\n'), ((25365, 25394), 'sklearn.metrics.auc', 'sklearn.metrics.auc', (['fpr', 'tpr'], {}), '(fpr, tpr)\n', (25384, 25394), False, 'import sklearn\n'), ((25399, 25411), 'matplotlib.pyp... |
"""To implement the RFC 6902 logic for patches, there are some various complex methods needed.
For clarity, they are in this separate file as helper methods."""
from copy import deepcopy
from jsonpatch import JsonPatch
from app import db
from apps.videos.models import VideosCategoriesMapping
from apps.videos.... | [
"apps.videos.add_categories.add_categories",
"copy.deepcopy",
"jsonpatch.JsonPatch",
"app.db.session.commit",
"apps.videos.models.VideosCategoriesMapping.query.filter_by"
] | [((1361, 1385), 'jsonpatch.JsonPatch', 'JsonPatch', (['video_patches'], {}), '(video_patches)\n', (1370, 1385), False, 'from jsonpatch import JsonPatch\n'), ((1939, 1954), 'copy.deepcopy', 'deepcopy', (['patch'], {}), '(patch)\n', (1947, 1954), False, 'from copy import deepcopy\n'), ((2866, 2906), 'apps.videos.add_cate... |
"""NDN TLV Encoder"""
from PiCN.Layers.PacketEncodingLayer.Encoder import BasicEncoder
from PiCN.Packets import Packet, Content, Interest, Nack, NackReason, Name, UnknownPacket
from PiCNExternal.pyndn.encoding.tlv.tlv.tlv_encoder import TlvEncoder
from PiCNExternal.pyndn.encoding.tlv.tlv.tlv_decoder import TlvD... | [
"PiCN.Packets.Content",
"PiCNExternal.pyndn.encoding.tlv.tlv.tlv_decoder.TlvDecoder",
"PiCN.Packets.Name",
"random.SystemRandom",
"PiCN.Packets.UnknownPacket",
"PiCN.Packets.Nack",
"hashlib.sha256",
"PiCNExternal.pyndn.encoding.tlv.tlv.tlv_encoder.TlvEncoder",
"PiCN.Packets.Interest"
] | [((6416, 6428), 'PiCNExternal.pyndn.encoding.tlv.tlv.tlv_encoder.TlvEncoder', 'TlvEncoder', ([], {}), '()\n', (6426, 6428), False, 'from PiCNExternal.pyndn.encoding.tlv.tlv.tlv_encoder import TlvEncoder\n'), ((7129, 7141), 'PiCNExternal.pyndn.encoding.tlv.tlv.tlv_encoder.TlvEncoder', 'TlvEncoder', ([], {}), '()\n', (71... |
from django.contrib import admin
# Register your models here.
from .models import InventoryRequest
class InventoryRequestAdmin(admin.ModelAdmin):
list_display = ['user', 'name', 'total', 'unit', 'status']
admin.site.register(InventoryRequest, InventoryRequestAdmin) | [
"django.contrib.admin.site.register"
] | [((214, 274), 'django.contrib.admin.site.register', 'admin.site.register', (['InventoryRequest', 'InventoryRequestAdmin'], {}), '(InventoryRequest, InventoryRequestAdmin)\n', (233, 274), False, 'from django.contrib import admin\n')] |
from data import create_dataset
from models import create_model
from util.util import save_images
import numpy as np
from util.util import mkdir
import argparse
from PIL import Image
import torchvision.transforms as transforms
def transform():
transform_list = []
transform_list += [transforms.ToTensor()]
... | [
"argparse.ArgumentParser",
"models.create_model",
"PIL.Image.open",
"util.util.save_images",
"torchvision.transforms.Compose",
"torchvision.transforms.Normalize",
"util.util.mkdir",
"torchvision.transforms.ToTensor"
] | [((406, 440), 'torchvision.transforms.Compose', 'transforms.Compose', (['transform_list'], {}), '(transform_list)\n', (424, 440), True, 'import torchvision.transforms as transforms\n'), ((832, 849), 'models.create_model', 'create_model', (['opt'], {}), '(opt)\n', (844, 849), False, 'from models import create_model\n'),... |
import numpy as np
import matplotlib.pyplot as plt
def plotLossGraph(loss_history, iter_count):
plt.figure()
plt.plot(np.arange(iter_count), loss_history)
plt.xlabel('Number of Iterations')
plt.ylabel('Loss')
plt.show()
| [
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((102, 114), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (112, 114), True, 'import matplotlib.pyplot as plt\n'), ((169, 203), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""Number of Iterations"""'], {}), "('Number of Iterations')\n", (179, 203), True, 'import matplotlib.pyplot as plt\n'), ((208, 226)... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
**Project Name:** MakeHuman
**Product Home Page:** http://www.makehumancommunity.org/
**Github Code Home Page:** https://github.com/makehumancommunity/
**Authors:** <NAME>
**Copyright(c):** MakeHuman Team 2001-2019
**Licensing:** AG... | [
"pprint.PrettyPrinter",
"gui.DocumentEdit",
"gui.Button"
] | [((2492, 2514), 'pprint.PrettyPrinter', 'pprint.PrettyPrinter', ([], {}), '()\n', (2512, 2514), False, 'import pprint\n'), ((2741, 2760), 'gui.Button', 'gui.Button', (['"""Clear"""'], {}), "('Clear')\n", (2751, 2760), False, 'import gui\n'), ((2800, 2818), 'gui.DocumentEdit', 'gui.DocumentEdit', ([], {}), '()\n', (2816... |
"""
@version:
author:yunnaidan
@time: 2018/10/26
@file: PIdatabase.py
@function:
"""
import os
import time
import obspy
import numpy as np
from scipy.integrate import simps
from obspy.core.utcdatetime import UTCDateTime
import multiprocessing
from dyntripy.utils import psd, load_gf, gf
def psd_integral(pxx_all, f, f... | [
"dyntripy.utils.gf",
"os.path.exists",
"obspy.core.utcdatetime.UTCDateTime",
"time.sleep",
"numpy.where",
"dyntripy.utils.load_gf",
"dyntripy.utils.psd",
"multiprocessing.Pool",
"scipy.integrate.simps"
] | [((398, 435), 'numpy.where', 'np.where', (['((f >= f_min) & (f <= f_max))'], {}), '((f >= f_min) & (f <= f_max))\n', (406, 435), True, 'import numpy as np\n'), ((805, 842), 'scipy.integrate.simps', 'simps', (['pxx_tar_remove_response', 'f_tar'], {}), '(pxx_tar_remove_response, f_tar)\n', (810, 842), False, 'from scipy.... |
#!/usr/bin/env python
from distutils.core import setup
setup(name='obosthan',
version='1.0',
author='<NAME>',
author_email='<EMAIL>',
url='',
description='A generic 2d objects abstraction library for Python',
download_url='',
classifiers=['Development Status :: 4 - Beta',
... | [
"distutils.core.setup"
] | [((57, 379), 'distutils.core.setup', 'setup', ([], {'name': '"""obosthan"""', 'version': '"""1.0"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '""""""', 'description': '"""A generic 2d objects abstraction library for Python"""', 'download_url': '""""""', 'classifiers': "['Development Status :: ... |
from .series import Series
from collections.abc import Iterable
import numpy as np
import pandas as pd
import random
class DataFrame:
def __init__(self, values, index=None, columns=None, copy=True):
self.dict = {}
l = 0
try:
if columns is not None:
for key in col... | [
"pandas.DataFrame",
"numpy.vectorize",
"numpy.empty",
"numpy.append",
"numpy.array"
] | [((7065, 7111), 'pandas.DataFrame', 'pd.DataFrame', (['self.dict', 'self.index'], {'copy': 'copy'}), '(self.dict, self.index, copy=copy)\n', (7077, 7111), True, 'import pandas as pd\n'), ((1460, 1486), 'numpy.array', 'np.array', (['index'], {'copy': 'copy'}), '(index, copy=copy)\n', (1468, 1486), True, 'import numpy as... |
import inspect
import tubular.testing.helpers as h
import tubular
import pandas as pd
import numpy as np
from unittest import mock
from _pytest.mark.structures import ParameterSet
def test_arguments():
"""Test arguments for arguments of tubular.testing.helpers.index_preserved_params."""
expected_arguments = ... | [
"pandas.DataFrame",
"unittest.mock.patch.object",
"numpy.random.seed",
"inspect.getfullargspec",
"tubular.testing.helpers.assert_equal_dispatch",
"tubular.testing.helpers.index_preserved_params",
"numpy.random.randint",
"pandas.concat"
] | [((361, 409), 'inspect.getfullargspec', 'inspect.getfullargspec', (['h.index_preserved_params'], {}), '(h.index_preserved_params)\n', (383, 409), False, 'import inspect\n'), ((1033, 1096), 'pandas.DataFrame', 'pd.DataFrame', (["{'a': [1, 2, 3], 'b': [4, 5, 6]}"], {'index': '[7, 8, 9]'}), "({'a': [1, 2, 3], 'b': [4, 5, ... |
from logging import getLogger
from time import sleep
from serial import Serial, SerialException
from prehensor.domain.iChargeStation import IChargeStation
logger = getLogger(__name__)
class ChargeStation(IChargeStation):
timeout = 1
def __init__(self) -> None:
try:
self._charge_station... | [
"serial.Serial",
"logging.getLogger",
"time.sleep"
] | [((167, 186), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (176, 186), False, 'from logging import getLogger\n'), ((737, 756), 'time.sleep', 'sleep', (['self.timeout'], {}), '(self.timeout)\n', (742, 756), False, 'from time import sleep\n'), ((323, 367), 'serial.Serial', 'Serial', (['"""/dev/tt... |
import cv2 as cv
import numpy as np
from skimage.color import label2rgb
from skimage.morphology import diamond
from matching_pcb.image import to_rgb
def _color(mask, color):
return np.stack([mask * c for c in color], axis=2)
def draw_bbox(image, bbox, color=(255, 0, 0)):
x1, y1, w, h = list(map(int, bbox))... | [
"numpy.stack",
"numpy.zeros_like",
"skimage.color.label2rgb",
"cv2.dilate",
"skimage.morphology.diamond",
"matching_pcb.image.to_rgb",
"numpy.clip",
"cv2.rectangle",
"PIL.Image.fromarray",
"numpy.concatenate"
] | [((188, 233), 'numpy.stack', 'np.stack', (['[(mask * c) for c in color]'], {'axis': '(2)'}), '([(mask * c) for c in color], axis=2)\n', (196, 233), True, 'import numpy as np\n'), ((374, 410), 'cv2.rectangle', 'cv.rectangle', (['image', 'pt1', 'pt2', 'color'], {}), '(image, pt1, pt2, color)\n', (386, 410), True, 'import... |
"""
setup.py
Copyright (c) 2021 SatoshiTsutsumi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, ... | [
"platform.system",
"setuptools.setup",
"platform.architecture"
] | [((1836, 2202), 'setuptools.setup', 'setup', ([], {'name': '"""rjpeg"""', 'version': '__version__', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https://github.com/SatoshiTsutsumi/Thermal-SDK-Python"""', 'description': '"""Thermal SDK for Python"""', 'long_description': '""""""', 'ext_modules':... |
#
# Unit Tests for the Task class
#
# <NAME> (<EMAIL>)
# <NAME> (<EMAIL>) 2007-08-31
#
from __future__ import absolute_import
from ...util import six
import time
import random
import logging
from .. import Task
#LOGDEBUG = True # COMMENTED BECAUSE NOT USED
# =================================================... | [
"random.random",
"logging.getLogger"
] | [((3474, 3511), 'logging.getLogger', 'logging.getLogger', (['"""TestTask01Logger"""'], {}), "('TestTask01Logger')\n", (3491, 3511), False, 'import logging\n'), ((651, 666), 'random.random', 'random.random', ([], {}), '()\n', (664, 666), False, 'import random\n')] |
import scrapy
from empoweredautoparts.items import EmpoweredautopartsItem
from empoweredautoparts.scraping_utility import process_description
class EmpoweredautopartsSpider(scrapy.Spider):
name = "empoweredautoparts"
allowed_domains = ["empoweredautoparts.com.au"]
start_urls = ["https://www.empoweredauto... | [
"empoweredautoparts.items.EmpoweredautopartsItem",
"scrapy.Request"
] | [((1442, 1466), 'empoweredautoparts.items.EmpoweredautopartsItem', 'EmpoweredautopartsItem', ([], {}), '()\n', (1464, 1466), False, 'from empoweredautoparts.items import EmpoweredautopartsItem\n'), ((470, 527), 'scrapy.Request', 'scrapy.Request', ([], {'url': 'start_url', 'callback': 'self.inititialize'}), '(url=start_... |
"""Organizes and shares business logic, data and functions with different
pages of the Streamlit App.
- Database interactions: Select, Insert, Update, Delete
- REST API interactions, get, post, put, delete
- Pandas transformations
"""
import logging
import pathlib
import urllib.request
from typing import Optiona... | [
"logging.Formatter",
"pathlib.Path.cwd",
"logging.getLogger"
] | [((1852, 1888), 'logging.Formatter', 'logging.Formatter', (['logging_formatter'], {}), '(logging_formatter)\n', (1869, 1888), False, 'import logging\n'), ((1931, 1954), 'logging.getLogger', 'logging.getLogger', (['name'], {}), '(name)\n', (1948, 1954), False, 'import logging\n'), ((701, 719), 'pathlib.Path.cwd', 'pathl... |
# Foremast - Pipeline Tooling
#
# Copyright 2018 Gogo, 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
#
# Unless required... | [
"json.dump",
"pprint.pformat",
"foremastutils.Parser",
"json.dumps",
"logging.getLogger"
] | [((836, 863), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (853, 863), False, 'import logging\n'), ((4290, 4311), 'pprint.pformat', 'pformat', (['json_configs'], {}), '(json_configs)\n', (4297, 4311), False, 'from pprint import pformat\n'), ((4918, 4954), 'json.dump', 'json.dump', (['js... |
from __future__ import absolute_import, division, print_function
import sys, os
def run():
if sys.hexversion < 0x02070000:
print()
print("*" * 78)
print("FATAL: Python 2.7 or higher is required.")
print("Version currently in use:", sys.version)
print("*" * 78)
print()
return False
# tes... | [
"os.path.dirname",
"sys.exit"
] | [((748, 776), 'os.path.dirname', 'os.path.dirname', (['sys.path[0]'], {}), '(sys.path[0])\n', (763, 776), False, 'import sys, os\n'), ((924, 935), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (932, 935), False, 'import sys, os\n')] |
"""Controller for withdrawal requests."""
from http import HTTPStatus as status
from typing import Tuple, Dict, Any, Optional
from flask import url_for, Markup
from werkzeug.datastructures import MultiDict
from werkzeug.exceptions import InternalServerError, NotFound, BadRequest
from wtforms.fields import TextField, ... | [
"werkzeug.exceptions.InternalServerError",
"arxiv.submission.domain.event.RequestWithdrawal",
"wtforms.fields.BooleanField",
"flask.Markup",
"arxiv.submission.save",
"werkzeug.datastructures.MultiDict",
"flask.url_for",
"arxiv.base.alerts.flash_success",
"arxiv.base.logging.getLogger",
"wtforms.va... | [((784, 811), 'arxiv.base.logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (801, 811), False, 'from arxiv.base import logging, alerts\n'), ((1210, 1278), 'wtforms.fields.BooleanField', 'BooleanField', (['"""Confirmed"""'], {'false_values': "('false', False, 0, '0', '')"}), "('Confirmed', fal... |
from copy import deepcopy
from random import shuffle
import GameData
import logging
class Card(object):
def __init__(self, id, value, color) -> None:
super().__init__()
self.id = id
self.value = value
self.color = color
def toString(self):
return ("Card " + str(self.id... | [
"copy.deepcopy",
"logging.warning",
"random.shuffle",
"GameData.ServerInvalidDataReceived",
"logging.info",
"GameData.ServerGameStateData",
"GameData.ServerActionInvalid"
] | [((4666, 4688), 'copy.deepcopy', 'deepcopy', (['self.__cards'], {}), '(self.__cards)\n', (4674, 4688), False, 'from copy import deepcopy\n'), ((8459, 8506), 'logging.info', 'logging.info', (["('Showing hand to: ' + data.sender)"], {}), "('Showing hand to: ' + data.sender)\n", (8471, 8506), False, 'import logging\n'), (... |
#!/usr/bin/env python3
import re, sys, json, getpass, mysql.connector, argparse
from Bio import SeqIO, AlignIO
from subprocess import Popen, PIPE
from os import error, remove, path, mkdir
from urllib.request import urlopen
from io import StringIO
import ssl
ssl._create_default_https_context = ssl._create_unve... | [
"os.mkdir",
"io.StringIO",
"subprocess.Popen",
"Bio.SeqIO.parse",
"argparse.ArgumentParser",
"json.loads",
"Bio.SeqIO.write",
"os.path.isdir",
"getpass.getpass",
"os.path.dirname",
"urllib.request.urlopen",
"Bio.SeqIO.to_dict",
"Bio.AlignIO.read",
"upload_aln.main",
"os.path.split",
"r... | [((451, 690), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Upload data to alignment related tables in DESIRE from a fasta sequence file. \nMake sure upload_accession has updated the tables with Residue data."""'}), '(description=\n """Upload da... |
# -*- coding: utf-8 -*-
from pyramid.events import subscriber
from openregistry.assets.core.events import AssetInitializeEvent
from openregistry.assets.core.utils import get_now
@subscriber(AssetInitializeEvent, _internal_type="compound")
def tender_init_handler(event):
""" initialization handler for compound ass... | [
"openregistry.assets.core.utils.get_now",
"pyramid.events.subscriber"
] | [((181, 240), 'pyramid.events.subscriber', 'subscriber', (['AssetInitializeEvent'], {'_internal_type': '"""compound"""'}), "(AssetInitializeEvent, _internal_type='compound')\n", (191, 240), False, 'from pyramid.events import subscriber\n'), ((351, 360), 'openregistry.assets.core.utils.get_now', 'get_now', ([], {}), '()... |
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 28 13:23:09 2013
Author: <NAME>
"""
import collections
class Holder(object):
pass
#def __repr__(self):
# numbers from R package `pwr` pwr.chisq.test
pwr_chisquare = collections.defaultdict(Holder)
pwr_chisquare[0].w = 1e-04
pwr_chisquare[0].N = 5
pwr_chisquar... | [
"collections.defaultdict"
] | [((226, 257), 'collections.defaultdict', 'collections.defaultdict', (['Holder'], {}), '(Holder)\n', (249, 257), False, 'import collections\n')] |
# Copyright 2022 The HuggingFace Team. 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 by app... | [
"unittest.main",
"tempfile.NamedTemporaryFile",
"transformers.models.albert.AlbertOnnxConfig.from_model_config",
"transformers.AutoModel.from_pretrained",
"transformers.AutoTokenizer.from_pretrained",
"optimum.onnx.graph_transformations.remove_duplicate_weights",
"pathlib.Path",
"torch.no_grad",
"on... | [((2586, 2601), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2599, 2601), False, 'import unittest\n'), ((1154, 1169), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (1167, 1169), False, 'import torch\n'), ((1262, 1298), 'transformers.AutoTokenizer.from_pretrained', 'AutoTokenizer.from_pretrained', (['model... |
#!/usr/local/bin/python
import argparse
import base64
import collections
import filecmp
import json
import logging
import ntpath
import numpy
import os
import re
import shutil
from io import BytesIO
from PIL import Image
from pxr import Usd, UsdGeom, Sdf, UsdShade, Gf, UsdSkel, Vt, Ar, UsdUtils
from _gltf2usd.gltf2... | [
"pxr.UsdSkel.DecomposeTransform",
"pxr.Vt.FloatArray",
"pxr.Ar.GetResolver",
"base64.b64decode",
"pxr.Vt.QuatfArray",
"os.path.isfile",
"numpy.arange",
"filecmp.cmp",
"os.path.join",
"pxr.UsdGeom.Xform.Define",
"pxr.Usd.ZipFile.Open",
"os.path.abspath",
"_gltf2usd.version.Version.get_version... | [((539, 573), '_gltf2usd.version.Version.get_version_name', 'version.Version.get_version_name', ([], {}), '()\n', (571, 573), False, 'from _gltf2usd import version\n'), ((1414, 1443), 'logging.getLogger', 'logging.getLogger', (['"""gltf2usd"""'], {}), "('gltf2usd')\n", (1431, 1443), False, 'import logging\n'), ((1539, ... |
from _pytest.python import Instance
from tests.helper import executa_comando
from pytest import fixture
from src.tabelas import alunos, cursos, inscricao_aluno_curso
class TestIncricaoAlunosCursos:
@fixture
def setup(self, cria_banco_real):
bd = cria_banco_real
bd.deleta_tabela(alunos)
... | [
"tests.helper.executa_comando"
] | [((723, 756), 'tests.helper.executa_comando', 'executa_comando', (['parametros_aluno'], {}), '(parametros_aluno)\n', (738, 756), False, 'from tests.helper import executa_comando\n'), ((765, 798), 'tests.helper.executa_comando', 'executa_comando', (['parametros_curso'], {}), '(parametros_curso)\n', (780, 798), False, 'f... |
import json
import urllib
import pytest
from . import create_app
from config import config
@pytest.fixture(scope='module')
def app():
return create_app(config['test'])
@pytest.fixture(scope='module')
def client(app):
return app.test_client()
def test_warmup(client):
response = client.get('/_ah/warmu... | [
"pytest.fixture",
"json.loads",
"urllib.quote"
] | [((96, 126), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (110, 126), False, 'import pytest\n'), ((179, 209), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (193, 209), False, 'import pytest\n'), ((1441, 1466), 'json.loads', 'json... |
from FORMAT import Config
class Strategies:
def __init__(self):
print("Start Algo")
#self.Liquid(1.5,0.25,10)
self.Liquid_Mean(1,0.015,3)
def Liquid(self,Price,Deviation,set,count=0):
if count == 0:
Current_Price = Price
Config.Config_file()
... | [
"FORMAT.Config.Config_file"
] | [((287, 307), 'FORMAT.Config.Config_file', 'Config.Config_file', ([], {}), '()\n', (305, 307), False, 'from FORMAT import Config\n')] |
import json
#parameters:
width = 1000
height = 1000
pixelWidth = 5
pixelHeight = 5
#these are the real-life corner coordinates of the map
latitudeMin = 55.5
latitudeMax = 57.9
longitudeMin = 20.0
longitudeMax = 25.0
latitudeNames = ["latitude", "latitude"]
longitudeNames = ["longitude", "longitude"]
nameNames = ["lab... | [
"json.dump",
"json.loads"
] | [((736, 755), 'json.loads', 'json.loads', (['content'], {}), '(content)\n', (746, 755), False, 'import json\n'), ((1480, 1531), 'json.dump', 'json.dump', (['newdata', 'f'], {'indent': '(2)', 'ensure_ascii': '(False)'}), '(newdata, f, indent=2, ensure_ascii=False)\n', (1489, 1531), False, 'import json\n')] |
from unittest.mock import patch
import numpy as np
import pytest
from PySide2.QtCore import Qt
from PySide2.QtWidgets import QListWidget
from nexus_constructor.field_attrs import FieldAttrFrame, FieldAttrsDialog
from nexus_constructor.model.module import Dataset
from nexus_constructor.model.value_type import ValueTyp... | [
"nexus_constructor.field_attrs.FieldAttrsDialog",
"pytest.fixture",
"unittest.mock.patch",
"tests.ui_tests.ui_test_utils.show_and_close_window",
"numpy.ushort",
"numpy.arange",
"nexus_constructor.model.module.Dataset",
"numpy.array_equal"
] | [((931, 963), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (945, 963), False, 'import pytest\n'), ((1040, 1066), 'nexus_constructor.field_attrs.FieldAttrsDialog', 'FieldAttrsDialog', (['template'], {}), '(template)\n', (1056, 1066), False, 'from nexus_constructor.field_... |
from collections import Counter
from itertools import count
from ..library.base import number_to_list
def solve(max_multiplier: int=6) -> int:
for n in count():
if n == 0:
continue
counter = Counter(number_to_list(n))
for multiplier in range(2, max_multiplier + 1):
... | [
"itertools.count"
] | [((159, 166), 'itertools.count', 'count', ([], {}), '()\n', (164, 166), False, 'from itertools import count\n')] |
from google.appengine.datastore.datastore_query import Cursor
from auth_core.internal.entities import AuthUserEntity
from auth_core.appengine_tools import get_key_from_resource_id, get_resource_id_from_key
from auth_core.internal.entities import AuthUserMethodEntity
from auth_core.models import AuthUser
from auth_core... | [
"auth_core.internal.entities.AuthUserMethodEntity.generate_key",
"auth_core.internal.entities.AuthUserMethodEntity",
"auth_core.appengine_tools.get_resource_id_from_key",
"auth_core.appengine_tools.get_key_from_resource_id",
"auth_core.providers.basic.get_login_properties",
"auth_core.internal.entities.Au... | [((1292, 1386), 'auth_core.internal.entities.AuthUserEntity', 'AuthUserEntity', ([], {'username': 'username', 'email': 'email', 'first_name': 'first_name', 'last_name': 'last_name'}), '(username=username, email=email, first_name=first_name,\n last_name=last_name)\n', (1306, 1386), False, 'from auth_core.internal.ent... |
import copy
from .. import create_experiment
from .constants import (
DEFAULT_CLASSIFICATION_METRIC,
DEFAULT_EVALS_NAME,
DEFAULT_ITERS_PER_DIM,
DEFAULT_NUM_BOOST_ROUND,
DEFAULT_REGRESSION_METRIC,
DEFAULT_SEARCH_PARAMS,
MAX_BO_ITERATIONS,
METRICS_OPTIMIZATION_STRATEGY,
PARAMETER_INFORMATION,
SUPPORT... | [
"copy.deepcopy"
] | [((648, 680), 'copy.deepcopy', 'copy.deepcopy', (['experiment_config'], {}), '(experiment_config)\n', (661, 680), False, 'import copy\n')] |
# Copyright (c) <NAME> and its affiliates. All Rights Reserved
import torch
import torch.nn as nn
import torch.nn.functional as F
from scipy.optimize import linear_sum_assignment
from fvcore.nn import sigmoid_focal_loss_jit
from detectron2.utils.registry import Registry
from .utils import nested_masks_from_list, is_... | [
"torch.distributed.all_reduce",
"torch.full_like",
"torch.zeros_like",
"fvcore.nn.sigmoid_focal_loss_jit",
"torch.nonzero",
"torch.cat",
"torch.full",
"torch.nn.functional.binary_cross_entropy_with_logits",
"detectron2.utils.registry.Registry",
"torch.as_tensor",
"torch.nn.functional.interpolate... | [((395, 426), 'detectron2.utils.registry.Registry', 'Registry', (['"""SPARSE_INST_MATCHER"""'], {}), "('SPARSE_INST_MATCHER')\n", (403, 426), False, 'from detectron2.utils.registry import Registry\n'), ((524, 557), 'detectron2.utils.registry.Registry', 'Registry', (['"""SPARSE_INST_CRITERION"""'], {}), "('SPARSE_INST_C... |
from flask import Flask,request,jsonify,send_file
import requests
import os
import subprocess
import pudb
import shutil
from Act_detection import load_model
import zipfile
import requests
app = Flask(__name__)
@app.route("/spacy",methods=["POST"])
def spacy():
html_text = request.form["key"]
detected_text=loa... | [
"subprocess.run",
"os.remove",
"zipfile.ZipFile",
"os.makedirs",
"flask.Flask",
"os.path.exists",
"Act_detection.load_model",
"subprocess.call",
"requests.get",
"shutil.move",
"shutil.rmtree",
"os.listdir"
] | [((195, 210), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (200, 210), False, 'from flask import Flask, request, jsonify, send_file\n'), ((317, 338), 'Act_detection.load_model', 'load_model', (['html_text'], {}), '(html_text)\n', (327, 338), False, 'from Act_detection import load_model\n'), ((814, 1038),... |
__DEBUG__=False
import os
import sys, traceback
import argparse
import json
import pprint
if not __DEBUG__:
#WEB SERVER: FLASK
from flask import Flask, jsonify, abort, make_response, request, render_template, flash, redirect
from flask_cors import CORS, cross_origin
#WEB SERVER: TORNADO
from tornado... | [
"core.predict",
"flask.request.args.get",
"flask_cors.CORS",
"flask.Flask",
"gevent.monkey.patch_all",
"flask.jsonify",
"flask.request.get_json",
"pprint.pprint",
"core.load_instances",
"gevent.pywsgi.WSGIServer",
"flask.make_response",
"core.batch_predict"
] | [((699, 717), 'gevent.monkey.patch_all', 'monkey.patch_all', ([], {}), '()\n', (715, 717), False, 'from gevent import monkey\n'), ((843, 858), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (848, 858), False, 'from flask import Flask, jsonify, abort, make_response, request, render_template, flash, redirect... |
import torch
import torch.nn as nn
robust_model_urls = {
'resnet50': 'http://alisec-competition.oss-cn-shanghai.aliyuncs.com/xiaofeng/imagenet_pretrained_models/advtrain_models/advtrain_resnet50_ep4.pth',
'resnet101': 'http://alisec-competition.oss-cn-shanghai.aliyuncs.com/xiaofeng/imagenet_pretrained_models/a... | [
"torch.mean",
"torch.nn.CrossEntropyLoss",
"torch.sign",
"torch.rand_like",
"torch.clamp",
"torch.no_grad",
"torch.tensor"
] | [((7172, 7215), 'torch.nn.CrossEntropyLoss', 'torch.nn.CrossEntropyLoss', ([], {'reduction': '"""none"""'}), "(reduction='none')\n", (7197, 7215), False, 'import torch\n'), ((6500, 6538), 'torch.clamp', 'torch.clamp', (['diff', '(-self.eps)', 'self.eps'], {}), '(diff, -self.eps, self.eps)\n', (6511, 6538), False, 'impo... |
from unittest import TestCase, main, mock
from typing import Any, List, Dict
from print_latest_commits import isGreen, WorkflowCheck
workflowNames = [
"pull",
"trunk",
"Lint",
"linux-binary-libtorch-pre-cxx11",
"android-tests",
"windows-binary-wheel",
"periodic",
"docker-release-builds"... | [
"unittest.main",
"print_latest_commits.WorkflowCheck",
"print_latest_commits.isGreen"
] | [((4626, 4632), 'unittest.main', 'main', ([], {}), '()\n', (4630, 4632), False, 'from unittest import TestCase, main, mock\n'), ((2698, 2729), 'print_latest_commits.isGreen', 'isGreen', (['"""sha"""', 'workflow_checks'], {}), "('sha', workflow_checks)\n", (2705, 2729), False, 'from print_latest_commits import isGreen, ... |
"""removed not null restriction from remote_post original_id
Revision ID: 975a199df79a
Revises: <PASSWORD>
Create Date: 2021-06-25 01:46:41.271979
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '975a<PASSWORD>df79a'
down_revision = '<PASSWORD>'
branch_labels =... | [
"alembic.op.alter_column"
] | [((365, 425), 'alembic.op.alter_column', 'op.alter_column', (['"""remote_post"""', '"""original_id"""'], {'nullable': '(True)'}), "('remote_post', 'original_id', nullable=True)\n", (380, 425), False, 'from alembic import op\n'), ((449, 510), 'alembic.op.alter_column', 'op.alter_column', (['"""remote_post"""', '"""origi... |
import tkinter
from tkinter import filedialog
from tkinter import simpledialog
def open_file(filename, path=None, title=None):
"""
Open choose file dialog
:param filename - name of file
:param path - path to file
:param title - title of dialog
:return: path to file
"""
if title is No... | [
"tkinter.filedialog.asksaveasfilename",
"tkinter.simpledialog.askinteger",
"tkinter.Tk",
"tkinter.filedialog.askopenfilename"
] | [((418, 430), 'tkinter.Tk', 'tkinter.Tk', ([], {}), '()\n', (428, 430), False, 'import tkinter\n'), ((467, 593), 'tkinter.filedialog.askopenfilename', 'filedialog.askopenfilename', ([], {'initialfile': 'filename', 'initialdir': 'path', 'title': 'title', 'filetypes': "(('Robot map files', '*.map'),)"}), "(initialfile=fi... |
import numpy as np
from samplers import *
from utils import *
from joblib import Parallel, delayed
'''
Attacks for the ARA approach to Adversarial Classification
'''
def compute_probability(x, params):
l = params["l"]
prb = np.zeros(l)
for c in range(l):
# Sample from p^*(x|x')
sample = pa... | [
"numpy.random.uniform",
"numpy.abs",
"numpy.argmax",
"numpy.zeros",
"numpy.expand_dims",
"numpy.ones",
"numpy.mean",
"numpy.array",
"joblib.Parallel",
"numpy.dot",
"joblib.delayed"
] | [((234, 245), 'numpy.zeros', 'np.zeros', (['l'], {}), '(l)\n', (242, 245), True, 'import numpy as np\n'), ((1625, 1639), 'numpy.array', 'np.array', (['atts'], {}), '(atts)\n', (1633, 1639), True, 'import numpy as np\n'), ((2817, 2831), 'numpy.array', 'np.array', (['atts'], {}), '(atts)\n', (2825, 2831), True, 'import n... |
import tensorflow as tf
from models.transformer_masking.decoder import Decoder
from models.transformer_masking.encoder import Encoder
class Transformer(tf.keras.Model):
def __init__(self,
num_layers,
d_model,
num_heads,
dff,
input_vocab_size,... | [
"models.transformer_masking.encoder.Encoder",
"models.transformer_masking.decoder.Decoder"
] | [((533, 611), 'models.transformer_masking.encoder.Encoder', 'Encoder', (['num_layers', 'd_model', 'num_heads', 'dff', 'input_vocab_size', 'pe_input', 'rate'], {}), '(num_layers, d_model, num_heads, dff, input_vocab_size, pe_input, rate)\n', (540, 611), False, 'from models.transformer_masking.encoder import Encoder\n'),... |
import sys
from functools import partial
from typing import Any, Callable, List, Optional, Tuple, cast
import numpy as np
from numpy.core.numerictypes import ScalarType
from sklearn import feature_selection as fs
from . import _utils
def _get_mi_func(discrete: bool) -> Callable:
"""
Get mutual information ... | [
"functools.partial",
"typing.cast",
"numpy.zeros",
"numpy.argsort",
"numpy.sort",
"numpy.delete"
] | [((651, 756), 'functools.partial', 'partial', (['(fs.mutual_info_classif if discrete else fs.mutual_info_regression)'], {'random_state': 'RANDOM_STATE'}), '(fs.mutual_info_classif if discrete else fs.mutual_info_regression,\n random_state=RANDOM_STATE)\n', (658, 756), False, 'from functools import partial\n'), ((408... |
#!/usr/bin/env python2
'''
greps inside hccapx/pmkid structs by essid, mac_ap or mac_sta
This software is Copyright (c) 2019-2020, <NAME> <alex at stanev.org> and it is
hereby released to the general public under the following terms:
Redistribution and use in source and binary forms, with or without
modification, are... | [
"sys.stdout.write",
"argparse.ArgumentParser",
"binascii.hexlify",
"struct.unpack",
"os.path.isfile",
"sys.setdefaultencoding",
"sys.stderr.write",
"argparse.FileType",
"re.compile"
] | [((2790, 2915), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Extract records from wpa combined hashline/hccapx/pmkid file based on regexp"""'}), "(description=\n 'Extract records from wpa combined hashline/hccapx/pmkid file based on regexp'\n )\n", (2813, 2915), False, 'import ar... |
# Copyright (c) 2017 OpenStack Foundation
#
# 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 ... | [
"mock.Mock"
] | [((1067, 1078), 'mock.Mock', 'mock.Mock', ([], {}), '()\n', (1076, 1078), False, 'import mock\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright(c) 2021 The MITRE Corporation. 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/lice... | [
"argparse.ArgumentParser",
"logging.basicConfig",
"os.path.basename",
"binascii.hexlify",
"logging.getLogger",
"struct.pack",
"datetime.datetime.utcfromtimestamp",
"os.path.isfile",
"tabulate.tabulate",
"pefile.PE",
"operator.itemgetter",
"sys.exit"
] | [((880, 907), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (897, 907), False, 'import logging\n'), ((4888, 5021), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Take a series of provided files and print the extracted PDB CodeView info from them."""'}), "(... |
# coding: utf-8
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import absolute_import
import sys
import unittest
im... | [
"unittest.main"
] | [((1240, 1255), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1253, 1255), False, 'import unittest\n')] |
'''
Convenience wrapper for email functionality. Setup with alerts in mind
heavily copied from : https://docs.python.org/3/library/email-examples.html
'''
# Import smtplib for the actual sending function
import smtplib ... | [
"logging.error",
"smtplib.SMTP",
"email.mime.text.MIMEText",
"email.mime.multipart.MIMEMultipart",
"logging.getLogger"
] | [((746, 773), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (763, 773), False, 'import logging\n'), ((2748, 2792), 'smtplib.SMTP', 'smtplib.SMTP', (['self.host', 'settings.EMAIL_PORT'], {}), '(self.host, settings.EMAIL_PORT)\n', (2760, 2792), False, 'import smtplib\n'), ((3305, 3320), 'e... |
import win32gui as wg
import win32con as wc
import win32api as wa
import keyboard
from time import sleep as slp
import threading
def throws(f,args:tuple=tuple())->None:
if not f:
f=args
if isinstance(f,(list,tuple)):
if len(f)==1:
args=tuple()
elif len(f)==2:
args=f[1]
else:
args=f... | [
"threading.Thread",
"keyboard.wait",
"win32api.mouse_event",
"time.sleep"
] | [((395, 445), 'threading.Thread', 'threading.Thread', ([], {'target': 'f', 'args': 'args', 'daemon': '(True)'}), '(target=f, args=args, daemon=True)\n', (411, 445), False, 'import threading\n'), ((1049, 1076), 'keyboard.wait', 'keyboard.wait', (['"""ctrl+alt+m"""'], {}), "('ctrl+alt+m')\n", (1062, 1076), False, 'import... |
from typing import Text, Any, Dict, List, Union
from sagas.nlu.inspector_common import Context, Inspector
from blinker import NamedSignal, signal
import logging
from sagas.nlu.pipes import flat_table, pred_cond
from sagas.util.collection_util import wrap
# from sagas.nlu.pipes import *
logger = logging.getLogger(__... | [
"blinker.signal",
"sagas.nlu.pipes.pred_cond",
"sagas.nlu.pipes.flat_table",
"sagas.conf.conf.cf.engine",
"logging.getLogger"
] | [((300, 327), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (317, 327), False, 'import logging\n'), ((1228, 1247), 'sagas.conf.conf.cf.engine', 'cf.engine', (['ctx.lang'], {}), '(ctx.lang)\n', (1237, 1247), False, 'from sagas.conf.conf import cf\n'), ((2444, 2472), 'sagas.nlu.pipes.flat_... |
"""mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | [
"django.conf.urls.static.static",
"django.urls.path",
"django.urls.include"
] | [((1324, 1385), 'django.conf.urls.static.static', 'static', (['settings.MEDIA_URL'], {'document_root': 'settings.MEDIA_ROOT'}), '(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)\n', (1330, 1385), False, 'from django.conf.urls.static import static\n'), ((826, 857), 'django.urls.path', 'path', (['"""admin/"""', 'a... |
from maya import cmds
import pyblish.api
import pype.api
import pype.hosts.maya.action
from pype.hosts.maya import lib
class ValidateMeshSingleUVSet(pyblish.api.InstancePlugin):
"""Warn on multiple UV sets existing for each polygon mesh.
On versions prior to Maya 2017 this will force no multiple uv sets bec... | [
"pype.hosts.maya.lib.remove_other_uv_sets",
"maya.cmds.about",
"maya.cmds.polyUVSet",
"maya.cmds.ls"
] | [((786, 827), 'maya.cmds.ls', 'cmds.ls', (['instance'], {'type': '"""mesh"""', 'long': '(True)'}), "(instance, type='mesh', long=True)\n", (793, 827), False, 'from maya import cmds\n'), ((1950, 1980), 'pype.hosts.maya.lib.remove_other_uv_sets', 'lib.remove_other_uv_sets', (['mesh'], {}), '(mesh)\n', (1974, 1980), False... |
#!/bin/python3
import sys
import os
import subprocess
import copy
import shutil
is_windows = os.name == 'nt'
cls = lambda: os.system('cls' if is_windows else 'clear')
tool_build_folder = "build_tool"
tool_build_install_path = tool_build_folder + "/install"
class BuildSystem:
def __init__( self, description, cmak... | [
"subprocess.run",
"copy.deepcopy",
"os.mkdir",
"os.getcwd",
"os.path.exists",
"os.system",
"os.chdir"
] | [((125, 168), 'os.system', 'os.system', (["('cls' if is_windows else 'clear')"], {}), "('cls' if is_windows else 'clear')\n", (134, 168), False, 'import os\n'), ((4363, 4391), 'copy.deepcopy', 'copy.deepcopy', (['build_systems'], {}), '(build_systems)\n', (4376, 4391), False, 'import copy\n'), ((5519, 5547), 'copy.deep... |
"""
Contains code to generate the <image-path> vs <image-label> list for a set of
images and write it to disk.
"""
import sys
import logging
import os
from common.config import get_config
logging_format = '[%(asctime)s||%(name)s||%(levelname)s]::%(message)s'
logging.basicConfig(level=os.environ.get("LOGLEVEL", "INFO... | [
"os.path.basename",
"os.path.dirname",
"os.walk",
"os.environ.get",
"os.path.join",
"logging.getLogger"
] | [((426, 453), 'logging.getLogger', 'logging.getLogger', (['__file__'], {}), '(__file__)\n', (443, 453), False, 'import logging\n'), ((871, 895), 'os.walk', 'os.walk', (['images_dir_path'], {}), '(images_dir_path)\n', (878, 895), False, 'import os\n'), ((288, 322), 'os.environ.get', 'os.environ.get', (['"""LOGLEVEL"""',... |
"""Unit tests for the Config class to ensure the environment variables are loaded."""
from backend.config import Config
from env_tools import apply_env
def test_config():
# Apply environment variables
apply_env()
# AWS credentials
assert Config.AWS_ACCOUNT_ID is not None
assert Config.AWS_ACCESS_... | [
"env_tools.apply_env"
] | [((211, 222), 'env_tools.apply_env', 'apply_env', ([], {}), '()\n', (220, 222), False, 'from env_tools import apply_env\n')] |
import numpy as np
import autodisc as ad
from autodisc.systems.lenia import LeniaStatistics
from goalrepresent.datasets import LENIADataset
from goalrepresent.helper.randomhelper import set_seed
from goalrepresent.models import PCAModel
EPS = 0.0001
def calc_static_statistics(final_obs):
'''Calculates the final... | [
"numpy.sum",
"goalrepresent.datasets.LENIADataset",
"autodisc.helper.statistics.calc_image_moments",
"numpy.zeros",
"numpy.percentile",
"autodisc.systems.lenia.LeniaStatistics.calc_distance_matrix",
"goalrepresent.helper.randomhelper.set_seed",
"numpy.array",
"numpy.savez",
"goalrepresent.datasets... | [((384, 396), 'numpy.zeros', 'np.zeros', (['(17)'], {}), '(17)\n', (392, 396), True, 'import numpy as np\n'), ((680, 704), 'numpy.array', 'np.array', (['[mid_y, mid_x]'], {}), '([mid_y, mid_x])\n', (688, 704), True, 'import numpy as np\n'), ((1038, 1098), 'autodisc.helper.statistics.calc_image_moments', 'ad.helper.stat... |
"""
Provides commands for the bot users
"""
import logging
from settings import LOG_NAME
from telegram import InlineKeyboardButton, InlineKeyboardMarkup
logger = logging.getLogger(LOG_NAME)
class Commands:
"""
Provides commands for the bot users
"""
def resident(update, context):
"""
D... | [
"telegram.InlineKeyboardMarkup",
"telegram.InlineKeyboardButton",
"logging.getLogger"
] | [((163, 190), 'logging.getLogger', 'logging.getLogger', (['LOG_NAME'], {}), '(LOG_NAME)\n', (180, 190), False, 'import logging\n'), ((1829, 1859), 'telegram.InlineKeyboardMarkup', 'InlineKeyboardMarkup', (['keyboard'], {}), '(keyboard)\n', (1849, 1859), False, 'from telegram import InlineKeyboardButton, InlineKeyboardM... |
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 10 11:31:48 2019
@author: <NAME>
"""
import numpy as np
from .stagData import StagData, StagCartesianGeometry, StagYinYangGeometry
from .stagData import SliceData, CartesianSliceData, YinYangSliceData
from .stagData import InterpolatedSliceData
from .stagError import Gr... | [
"numpy.meshgrid",
"scipy.interpolate.griddata",
"time.time",
"numpy.sin",
"numpy.array",
"numpy.cos",
"numpy.linspace"
] | [((1801, 1840), 'numpy.meshgrid', 'np.meshgrid', (['lon', 'lat', 'r'], {'indexing': '"""ij"""'}), "(lon, lat, r, indexing='ij')\n", (1812, 1840), True, 'import numpy as np\n'), ((2853, 2859), 'time.time', 'time', ([], {}), '()\n', (2857, 2859), False, 'from time import time\n'), ((1904, 1915), 'numpy.cos', 'np.cos', ([... |
from setuptools import setup, find_packages
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setup(
name="mkdocs-confluence",
version="0.2.3.dev3",
description="MkDocs plugin for uploading markdown documentation to Confluence via Confluence REST API",
long_descript... | [
"setuptools.find_packages"
] | [((680, 695), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (693, 695), False, 'from setuptools import setup, find_packages\n')] |
"""
Created on Mon Mar 14 09:30:44 2016
@author: rmc84
<NAME>
Purpose: calcualtes the GMPE values for a given IM & earthquake
Based on CompareGMPEs_.m (version 1.0 8 March 2010, Brendon Bradley)
All variable and function names have been retained wherever possible
All the redundant parts of the code to plot the GMP... | [
"numpy.max",
"numpy.log",
"geoNet.gmpe.Bradley_2010_Sa.Bradley_2010_Sa"
] | [((3754, 3798), 'numpy.max', 'np.max', (['(0, Rrup ** 2 - faultprop.Ztor ** 2)'], {}), '((0, Rrup ** 2 - faultprop.Ztor ** 2))\n', (3760, 3798), True, 'import numpy as np\n'), ((5427, 5457), 'numpy.log', 'np.log', (['parms.plotGMPE.DistMin'], {}), '(parms.plotGMPE.DistMin)\n', (5433, 5457), True, 'import numpy as np\n'... |
import json
import decimal
from os.path import abspath, dirname, isfile, join
CURRENT_DIR = dirname(abspath(__file__))
TEST_DATA_DIR = join(dirname(dirname(dirname(CURRENT_DIR))), 'test_data')
from opendp_apps.analysis.testing.base_stat_spec_test import StatSpecTestCase
from opendp_apps.analysis.tools.dp_histogram_s... | [
"os.path.abspath",
"opendp_apps.analysis.tools.dp_histogram_spec.DPHistogramSpec",
"opendp_apps.model_helpers.msg_util.msgt",
"decimal.Decimal",
"os.path.dirname",
"os.path.isfile",
"os.path.join"
] | [((102, 119), 'os.path.abspath', 'abspath', (['__file__'], {}), '(__file__)\n', (109, 119), False, 'from os.path import abspath, dirname, isfile, join\n'), ((620, 652), 'opendp_apps.model_helpers.msg_util.msgt', 'msgt', (['self.test_10_debug.__doc__'], {}), '(self.test_10_debug.__doc__)\n', (624, 652), False, 'from ope... |
import sys
import os
command = sys.argv[1]
if command == 'generate':
os.system('gpg --full-generate-key')
if command == 'list':
# Copy bit after sec rsa4096
os.system('gpg --list-secret-keys --keyid-format=long')
if command == 'export':
# Copy this and add to GitHub settings page
os.system('gpg -... | [
"os.system"
] | [((74, 110), 'os.system', 'os.system', (['"""gpg --full-generate-key"""'], {}), "('gpg --full-generate-key')\n", (83, 110), False, 'import os\n'), ((171, 226), 'os.system', 'os.system', (['"""gpg --list-secret-keys --keyid-format=long"""'], {}), "('gpg --list-secret-keys --keyid-format=long')\n", (180, 226), False, 'im... |
import os
import torch
from torch import optim
from torch.fft import fftshift, fftn
import time
from utils.kernel import create_kernel
from config import last_model, best_model, check_folder
from network.net_loss import NetLoss
from network.net_model import LFDQSM
def phase2in(phase, ori, thd):
b, _, w, h, d = p... | [
"torch.imag",
"config.last_model",
"torch.load",
"utils.kernel.create_kernel",
"torch.empty",
"os.path.exists",
"config.best_model",
"time.sleep",
"torch.save",
"torch.sign",
"network.net_model.LFDQSM",
"torch.real",
"torch.unsqueeze",
"torch.fft.fftn",
"network.net_loss.NetLoss"
] | [((344, 393), 'torch.empty', 'torch.empty', (['[b, 3, w, h, d]'], {'device': 'phase.device'}), '([b, 3, w, h, d], device=phase.device)\n', (355, 393), False, 'import torch\n'), ((1446, 1455), 'network.net_loss.NetLoss', 'NetLoss', ([], {}), '()\n', (1453, 1455), False, 'from network.net_loss import NetLoss\n'), ((1469,... |
from waitress import serve
from result_linker.logger import logger
from result_linker.app import create_app
serve(create_app(config_filename="config.py"), host='0.0.0.0', port=2323, threads = 10) | [
"result_linker.app.create_app"
] | [((115, 154), 'result_linker.app.create_app', 'create_app', ([], {'config_filename': '"""config.py"""'}), "(config_filename='config.py')\n", (125, 154), False, 'from result_linker.app import create_app\n')] |
import os
from common.constants import *
from common.logger_utility import *
from aws_requests_auth.aws_auth import AWSRequestsAuth
from elasticsearch import Elasticsearch, RequestsHttpConnection, ElasticsearchException
class ElasticsearchClient:
@staticmethod
def getClient(elasticsearch_endpoint):
L... | [
"aws_requests_auth.aws_auth.AWSRequestsAuth"
] | [((379, 721), 'aws_requests_auth.aws_auth.AWSRequestsAuth', 'AWSRequestsAuth', ([], {'aws_access_key': 'os.environ[Constants.ACCESS_KEY_ENV_VAR]', 'aws_secret_access_key': 'os.environ[Constants.SECRET_KEY_ENV_VAR]', 'aws_token': 'os.environ[Constants.SESSION_TOKEN_ENV_VAR]', 'aws_host': 'elasticsearch_endpoint', 'aws_r... |
"""
PTC
---
Data handling for turn-by-turn measurement files from the ``PTC`` code, which can be obtained by performing
particle tracking of your machine through the ``MAD-X PTC`` interface. The files are very close in
structure to **TFS** files, with the difference that the data part is split into "segments" relating... | [
"pandas.DataFrame",
"copy.deepcopy",
"datetime.datetime.today",
"numpy.zeros",
"dateutil.tz.tzutc",
"pathlib.Path",
"turn_by_turn.structures.TbtData",
"datetime.datetime.strptime",
"collections.namedtuple",
"logging.getLogger"
] | [((936, 955), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (953, 955), False, 'import logging\n'), ((966, 1040), 'collections.namedtuple', 'namedtuple', (['"""Segment"""', "['number', 'turns', 'particles', 'element', 'name']"], {}), "('Segment', ['number', 'turns', 'particles', 'element', 'name'])\n", (9... |
# -*- coding: utf-8 -*-
import struct
import datetime
import json
import os
from . import Error
_arg_type = {
'string': 0,
'vint': 1,
'int': 2,
'uint': 3,
'int8': 4,
'uint8': 5,
'int16': 6,
'uint16': 7,
'description': 1000,
}
class Reader():
def __init__(self, filename=None, userA_tbl=None, userB... | [
"os.path.dirname",
"struct.unpack",
"struct.pack",
"datetime.datetime"
] | [((9085, 9142), 'datetime.datetime', 'datetime.datetime', (['year', 'month', 'day', 'hour', 'minute', 'second'], {}), '(year, month, day, hour, minute, second)\n', (9102, 9142), False, 'import datetime\n'), ((3533, 3558), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (3548, 3558), False, 'im... |
"""
The main module to support finding embedded tweets and mentions of tweets in online news.
"""
from bs4 import BeautifulSoup
import readability
import re
import requests
import logging
import pycld2 as cld2
from typing import List, Dict
from . import mentions
logger = logging.getLogger(__name__)
... | [
"pycld2.detect",
"readability.Document",
"requests.get",
"bs4.BeautifulSoup",
"logging.getLogger",
"re.compile"
] | [((289, 316), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (306, 316), False, 'import logging\n'), ((650, 759), 're.compile', 're.compile', (['"""^https?:\\\\/\\\\/twitter\\\\.com\\\\/(?:#!\\\\/)?(\\\\w+)\\\\/status(es)?\\\\/(\\\\d+).*"""', 're.IGNORECASE'], {}), "(\n '^https?:\\\\/\... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from utility import *
from subword_embedding import Subword_Embedding
from match_func import Match
# The main function
if __name__ == '__main__':
########################--LOAD standard-DEFINED DICT--##################################################
# Get the st... | [
"subword_embedding.Subword_Embedding",
"match_func.Match"
] | [((956, 1060), 'subword_embedding.Subword_Embedding', 'Subword_Embedding', ([], {'sub_list': 'subword_list', 'pre_trained': 'pre_trained', 'standard_synonym': 'standard_synonym'}), '(sub_list=subword_list, pre_trained=pre_trained,\n standard_synonym=standard_synonym)\n', (973, 1060), False, 'from subword_embedding i... |
import re
from flask import Flask, redirect, request, render_template, session, send_from_directory
from linode_api4 import (LinodeClient, LinodeLoginClient, StackScript, Image, Region,
Type, OAuthScopes)
import config
# define our flask app
app=Flask(__name__)
app.config['SECRET_KEY'] = confi... | [
"linode_api4.StackScript",
"flask.request.args.get",
"linode_api4.LinodeClient",
"linode_api4.LinodeLoginClient",
"flask.Flask",
"flask.render_template",
"linode_api4.Type.label.contains"
] | [((272, 287), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (277, 287), False, 'from flask import Flask, redirect, request, render_template, session, send_from_directory\n'), ((483, 540), 'linode_api4.LinodeLoginClient', 'LinodeLoginClient', (['config.client_id', 'config.client_secret'], {}), '(config.cli... |
import os
import re
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']
).get_hosts('all')
def test_index(host):
f = host.file("/etc/hosts-molecule")
assert re.search(
r'^# Group all\n^\d+\.\d+\.\d+\.\d+ hosts... | [
"re.search"
] | [((260, 367), 're.search', 're.search', (['"""^# Group all\\\\n^\\\\d+\\\\.\\\\d+\\\\.\\\\d+\\\\.\\\\d+ hosts-populate$"""', 'f.content_string', 're.MULTILINE'], {}), "('^# Group all\\\\n^\\\\d+\\\\.\\\\d+\\\\.\\\\d+\\\\.\\\\d+ hosts-populate$', f.\n content_string, re.MULTILINE)\n", (269, 367), False, 'import re\n'... |
import os
import wandb
import torch
import numpy as np
from tqdm import tqdm
from .utils import plot_samples
from metrics import compute_cd, compute_metrics
class Trainer:
def __init__(
self,
net,
device,
batch_size,
loss=None,
sample=None,
opt=None,
... | [
"wandb.log",
"tqdm.tqdm",
"torch.load",
"metrics.compute_metrics",
"torch.cat",
"torch.rand_like",
"torch.no_grad",
"os.path.join",
"os.listdir"
] | [((4243, 4258), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (4256, 4258), False, 'import torch\n'), ((1772, 1820), 'os.path.join', 'os.path.join', (['self.ckpt_dir', 'f"""{self.epoch}.pth"""'], {}), "(self.ckpt_dir, f'{self.epoch}.pth')\n", (1784, 1820), False, 'import os\n'), ((4374, 4391), 'tqdm.tqdm', 'tqdm'... |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\postures\stand.py
# Compiled at: 2020-04-22 23:16:07
# Size of source mod 2**32: 1307 bytes
from int... | [
"services.posture_manager"
] | [((534, 560), 'services.posture_manager', 'services.posture_manager', ([], {}), '()\n', (558, 560), False, 'import services\n')] |
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from django.conf.urls import url
from django.urls import path, re_path
from src.web.views import *
app_name = 'web'
urlpatterns = [
path('',index,name="index_view"),
path('get-key/', ge... | [
"django.urls.path"
] | [((263, 297), 'django.urls.path', 'path', (['""""""', 'index'], {'name': '"""index_view"""'}), "('', index, name='index_view')\n", (267, 297), False, 'from django.urls import path, re_path\n'), ((301, 349), 'django.urls.path', 'path', (['"""get-key/"""', 'get_guid'], {'name': '"""get_guid_view"""'}), "('get-key/', get_... |
import torchvision
import skimage
import torch
from torchvision import transforms
import numpy as np
from PIL import Image
IMG_MEAN = (0.4914, 0.4822, 0.4465)
IMG_STD = (0.2023, 0.1994, 0.2010)
NORM = [transforms.ToTensor(),
transforms.Normalize(IMG_MEAN, IMG_STD)]
class MapTransform(object):
def __i... | [
"torchvision.transforms.ColorJitter",
"numpy.random.uniform",
"torchvision.transforms.RandomHorizontalFlip",
"torchvision.transforms.Resize",
"skimage.util.view_as_windows",
"torchvision.transforms.ToPILImage",
"torch.cat",
"torchvision.transforms.RandomResizedCrop",
"torchvision.transforms.Compose"... | [((206, 227), 'torchvision.transforms.ToTensor', 'transforms.ToTensor', ([], {}), '()\n', (225, 227), False, 'from torchvision import transforms\n'), ((238, 277), 'torchvision.transforms.Normalize', 'transforms.Normalize', (['IMG_MEAN', 'IMG_STD'], {}), '(IMG_MEAN, IMG_STD)\n', (258, 277), False, 'from torchvision impo... |
# Generated by Django 3.0.6 on 2020-05-20 15:44
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Channel',
fiel... | [
"django.db.models.CharField",
"django.db.models.UUIDField",
"django.db.models.ManyToManyField",
"django.db.models.ForeignKey"
] | [((2629, 2675), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'to': '"""entities.Receiver"""'}), "(to='entities.Receiver')\n", (2651, 2675), False, 'from django.db import migrations, models\n'), ((348, 439), 'django.db.models.UUIDField', 'models.UUIDField', ([], {'default': 'uuid.uuid4', 'editable... |
'''
@Author: your name
@Date: 2020-05-27 13:33:49
@LastEditTime: 2020-06-09 12:51:11
@LastEditors: Please set LastEditors
@Description: In User Settings Edit
@FilePath: /model-building/recommend/xdeepfm/inputs.py
'''
import tensorflow as tf
from collections import namedtuple
import copy
SparseFeature = namedtuple('Spa... | [
"copy.deepcopy",
"tensorflow.nn.embedding_lookup",
"tensorflow.placeholder",
"tensorflow.random_normal_initializer",
"collections.namedtuple"
] | [((305, 411), 'collections.namedtuple', 'namedtuple', (['"""SparseFeature"""', "['feature_name', 'vocab_size', 'embedding_dim', 'field_id', 'num_fields']"], {}), "('SparseFeature', ['feature_name', 'vocab_size', 'embedding_dim',\n 'field_id', 'num_fields'])\n", (315, 411), False, 'from collections import namedtuple\... |
import logging
import pytest
import uuid
from pygame.math import Vector2
import pygame
import random
import numpy as np
import cv2
import time
from .base_render import BaseRender
from gobigger.utils import Colors, BLACK, YELLOW, GREEN
from gobigger.utils import PLAYER_COLORS, FOOD_COLOR, THORNS_COLOR, SPORE_COLOR
from... | [
"pygame.quit",
"pygame.draw.circle",
"pygame.Surface",
"pygame.font.SysFont",
"cv2.cvtColor",
"numpy.fliplr",
"numpy.rot90",
"pygame.surfarray.array3d"
] | [((1177, 1215), 'pygame.font.SysFont', 'pygame.font.SysFont', (['"""Menlo"""', '(12)', '(True)'], {}), "('Menlo', 12, True)\n", (1196, 1215), False, 'import pygame\n'), ((1800, 1832), 'pygame.surfarray.array3d', 'pygame.surfarray.array3d', (['screen'], {}), '(screen)\n', (1824, 1832), False, 'import pygame\n'), ((6726,... |
# -*- coding: utf-8 -*-
"""
@author: <NAME>
"""
# A script to produce a finishing ability metric based on the *concept* of post-shot xG based on the phyiscal properties of
# a shot once taken
# see https://www.opengoalapp.com/finishing-ability for full write-up of the method
import pandas as pd
from pandas.io.json... | [
"matplotlib.pyplot.title",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.figure",
"GetMatchDates.GetMatchDates",
"pandas.DataFrame",
"sklearn.metrics.log_loss",
"xgboost.XGBClassifier",
"pandas.concat",
"sklearn.calibration.calibration_curve",
"matplotlib.pyplot.show",
"matplotl... | [((1194, 1231), 'pandas.read_pickle', 'pd.read_pickle', (['"""data\\\\shot_data.pkl"""'], {}), "('data\\\\shot_data.pkl')\n", (1208, 1231), True, 'import pandas as pd\n'), ((1573, 1602), 'pandas.io.json.json_normalize', 'json_normalize', (["shots['shot']"], {}), "(shots['shot'])\n", (1587, 1602), False, 'from pandas.io... |
import pandas as pd
import numpy as np
def get_weighted_gini(df, predCol, actCol, weightCol):
df['meanAct'] = sum(df[actCol]*df[weightCol])/sum(df[weightCol])
df['invPred'] = -df[predCol]
df = df.sort_values(['invPred', actCol])
df['diff'] = df[actCol]-df['meanAct']
df['gap'] = (df['diff']*df[weightCol]).cumsum()... | [
"pandas.DataFrame"
] | [((952, 1073), 'pandas.DataFrame', 'pd.DataFrame', (["{'P': [1, 2, 3, 4, 5, 7, 6, 8, 9], 'A': [1, 2, 3, 4, 5, 6, 8, 7, 9], 'W': [\n 1, 2, 3, 4, 5, 6, 7, 8, 9]}"], {}), "({'P': [1, 2, 3, 4, 5, 7, 6, 8, 9], 'A': [1, 2, 3, 4, 5, 6, 8, \n 7, 9], 'W': [1, 2, 3, 4, 5, 6, 7, 8, 9]})\n", (964, 1073), True, 'import pandas... |
# Copyright 2019, OpenCensus 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 w... | [
"opencensus.stats.measure.MeasureFloat",
"opencensus.tags.tag_map.TagMap",
"opencensus.stats.aggregation.SumAggregation",
"opencensus.ext.azure.metrics_exporter.new_metrics_exporter",
"time.sleep"
] | [((1038, 1111), 'opencensus.stats.measure.MeasureFloat', 'measure_module.MeasureFloat', (['"""Requests"""', '"""number of requests"""', '"""requests"""'], {}), "('Requests', 'number of requests', 'requests')\n", (1065, 1111), True, 'from opencensus.stats import measure as measure_module\n'), ((1459, 1494), 'opencensus.... |
import numpy as np
from .dt import DecisionTree
from .losses import MSELoss, CrossEntropyLoss
def to_one_hot(labels, n_classes=None):
if labels.ndim > 1:
raise ValueError("labels must have dimension 1, but got {}".format(labels.ndim))
N = labels.size
n_cols = np.max(labels) + 1 if n_classes is N... | [
"numpy.empty",
"numpy.zeros",
"numpy.ones",
"numpy.max",
"numpy.arange"
] | [((353, 374), 'numpy.zeros', 'np.zeros', (['(N, n_cols)'], {}), '((N, n_cols))\n', (361, 374), True, 'import numpy as np\n'), ((4220, 4272), 'numpy.empty', 'np.empty', (['(self.n_iter, self.out_dims)'], {'dtype': 'object'}), '((self.n_iter, self.out_dims), dtype=object)\n', (4228, 4272), True, 'import numpy as np\n'), ... |
#
# _ __ ,---. .-._ _,.---._ ,---.
# .-`.' ,`..--.' \ /==/ \ .-._ _,..---._ ,-.' , - `. .-.,.---. .--.' \
# /==/, - \==\-/\ \ |==|, \/ /, /==/, - \ /==/_, , - \ /==/ ` \ \==\-/\ \
# |==| _ .=. /==/-|_\ | |==|-... | [
"socket.socket",
"io.BytesIO",
"ssl.SSLContext",
"socketserver.TCPServer"
] | [((2078, 2112), 'ssl.SSLContext', 'ssl.SSLContext', (['ssl.PROTOCOL_TLSv1'], {}), '(ssl.PROTOCOL_TLSv1)\n', (2092, 2112), False, 'import ssl\n'), ((2190, 2205), 'socket.socket', 'socket.socket', ([], {}), '()\n', (2203, 2205), False, 'import socket\n'), ((2841, 2850), 'io.BytesIO', 'BytesIO', ([], {}), '()\n', (2848, 2... |
import bcrypt
import hijackingprevention.rec as rec
from tornado import gen
import logging
logger = logging.getLogger(__name__)
@gen.coroutine
def hasher(data, headers, salt):
"""This function provides a hasher for received IP adresses that hashes with an intial sitewide salt."""
ip = headers.get('X-Real-IP')
retu... | [
"bcrypt.gensalt",
"hijackingprevention.rec.rec.add_comparer",
"hijackingprevention.rec.rec.add_translator",
"bcrypt.hashpw",
"hijackingprevention.rec.mods.add",
"hijackingprevention.rec.rec.add_hasher",
"logging.getLogger"
] | [((101, 128), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (118, 128), False, 'import logging\n'), ((365, 406), 'hijackingprevention.rec.rec.add_hasher', 'rec.rec.add_hasher', (['"""michardy:ip"""', 'hasher'], {}), "('michardy:ip', hasher)\n", (383, 406), True, 'import hijackingpreventi... |
"""
pygame-menu
https://github.com/ppizarror/pygame-menu
EXAMPLE - IMAGE BACKGROUND
Menu using background image + BaseImage object.
"""
__all__ = ['main']
import pygame
import pygame_menu
from pygame_menu.examples import create_example_window
from typing import Optional
# Constants and global variables
FPS = 60
WI... | [
"pygame_menu.BaseImage",
"pygame_menu.Menu",
"pygame_menu.examples.create_example_window",
"pygame.display.flip",
"pygame.time.Clock",
"pygame_menu.themes.THEME_ORANGE.copy"
] | [((517, 596), 'pygame_menu.BaseImage', 'pygame_menu.BaseImage', ([], {'image_path': 'pygame_menu.baseimage.IMAGE_EXAMPLE_WALLPAPER'}), '(image_path=pygame_menu.baseimage.IMAGE_EXAMPLE_WALLPAPER)\n', (538, 596), False, 'import pygame_menu\n'), ((1042, 1106), 'pygame_menu.examples.create_example_window', 'create_example_... |
# SPDX-FileCopyrightText: <NAME> <<EMAIL>>
# SPDX-License-Identifier: Apache-2.0
import os
from typing import Optional
from aliens4friends.commons.settings import Settings
from aliens4friends.commons.pool import Pool
from aliens4friends.commons.cve_check import CveChecker
from aliens4friends.commons.utils import get... | [
"aliens4friends.commons.pool.Pool",
"aliens4friends.commons.cve_check.CveChecker",
"os.path.realpath",
"aliens4friends.commons.utils.get_prefix_formatted",
"os.path.isfile"
] | [((616, 639), 'aliens4friends.commons.pool.Pool', 'Pool', (['Settings.POOLPATH'], {}), '(Settings.POOLPATH)\n', (620, 639), False, 'from aliens4friends.commons.pool import Pool\n'), ((1216, 1234), 'aliens4friends.commons.cve_check.CveChecker', 'CveChecker', (['config'], {}), '(config)\n', (1226, 1234), False, 'from ali... |
import yaml
import json
import os
from omegaconf import OmegaConf
from pathlib import Path
import pickle
from typing import Union, Any, List
from natsort import natsorted
def read_pickle(file_path: str) -> Any:
"""Return data from pickle file"""
with open(file_path, "rb") as f:
try:
file_d... | [
"json.dump",
"yaml.load",
"json.load",
"os.path.isdir",
"yaml.dump",
"pathlib.Path",
"pickle.load",
"omegaconf.OmegaConf.create",
"os.path.join",
"os.listdir",
"natsort.natsorted"
] | [((3838, 3848), 'pathlib.Path', 'Path', (['path'], {}), '(path)\n', (3842, 3848), False, 'from pathlib import Path\n'), ((4111, 4126), 'pathlib.Path', 'Path', (['file_path'], {}), '(file_path)\n', (4115, 4126), False, 'from pathlib import Path\n'), ((1700, 1739), 'yaml.dump', 'yaml.dump', (['data', 'f'], {'sort_keys': ... |
"""This utility is used for downloading or converting to TRAF2000 invoices from a CCSR .xlsx, .csv or .xml report file"""
import os
import sys
import getopt
import subprocess
import atexit
import wx
import wx.adv
import requests
import requests_ntlm
import downloader
import traf2000_converter
LOGIN_ACTION = 0
LOGOUT... | [
"wx.Dialog.__init__",
"atexit.register",
"os.remove",
"getopt.getopt",
"wx.Font",
"requests.Session",
"wx.Panel",
"traf2000_converter.convert",
"wx.TextCtrl",
"wx.DateTime.Today",
"os.startfile",
"wx.Locale",
"wx.BoxSizer",
"downloader.download_invoices",
"wx.StaticText",
"subprocess.c... | [((914, 948), 'atexit.register', 'atexit.register', (['self.exit_handler'], {}), '(self.exit_handler)\n', (929, 948), False, 'import atexit\n'), ((1075, 1113), 'wx.Frame.__init__', 'wx.Frame.__init__', (['self', '*args'], {}), '(self, *args, **kwds)\n', (1092, 1113), False, 'import wx\n'), ((1183, 1237), 'wx.Locale', '... |
import argparse
import os
import yaml
from utils.os_utils import remove_file
global_print_hparams = True
hparams = {}
class Args:
def __init__(self, **kwargs):
for k, v in kwargs.items():
self.__setattr__(k, v)
def override_config(old_config: dict, new_config: dict):
for k, v in new_co... | [
"os.makedirs",
"argparse.ArgumentParser",
"utils.os_utils.remove_file",
"yaml.safe_dump",
"os.path.dirname",
"os.path.exists",
"yaml.safe_load",
"os.path.normpath"
] | [((645, 684), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '""""""'}), "(description='')\n", (668, 684), False, 'import argparse\n'), ((1802, 1829), 'os.path.exists', 'os.path.exists', (['args.config'], {}), '(args.config)\n', (1816, 1829), False, 'import os\n'), ((3021, 3053), 'os.path.ex... |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from . import operations_pb2 as operations__pb2
class OperationServiceStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc... | [
"grpc.stream_unary_rpc_method_handler",
"grpc.method_handlers_generic_handler",
"grpc.stream_stream_rpc_method_handler",
"grpc.unary_unary_rpc_method_handler"
] | [((10413, 10501), 'grpc.method_handlers_generic_handler', 'grpc.method_handlers_generic_handler', (['"""gitaly.OperationService"""', 'rpc_method_handlers'], {}), "('gitaly.OperationService',\n rpc_method_handlers)\n", (10449, 10501), False, 'import grpc\n'), ((7156, 7384), 'grpc.unary_unary_rpc_method_handler', 'grp... |
#coding: utf-8
### Imports ### ------------------------------------------------------------
from itertools import count
import kor.value_type as v
import kor.errors as e
### Class ### ------------------------------------------------------------
class Kor:
"""
The main class that will represent your .kor file
list... | [
"kor.errors.NotKorFile",
"kor.value_type.List",
"kor.value_type.Var",
"itertools.count"
] | [((793, 801), 'itertools.count', 'count', (['(0)'], {}), '(0)\n', (798, 801), False, 'from itertools import count\n'), ((971, 1016), 'kor.errors.NotKorFile', 'e.NotKorFile', (['"""The file is not a \'.kor\' file"""'], {}), '("The file is not a \'.kor\' file")\n', (983, 1016), True, 'import kor.errors as e\n'), ((5676, ... |
from re import findall
from pandas import Series
from omics import get_ome_regexp, get_omics_regexp
ome_re = get_ome_regexp()
omics_re = get_omics_regexp()
def test_ome_re():
assert findall(ome_re, 'genome') == ['genome']
assert findall(ome_re, '(genome') == ['genome']
assert findall(ome_re, 'genome pro... | [
"omics.get_omics_regexp",
"omics.get_ome_regexp",
"re.findall",
"pandas.Series"
] | [((111, 127), 'omics.get_ome_regexp', 'get_ome_regexp', ([], {}), '()\n', (125, 127), False, 'from omics import get_ome_regexp, get_omics_regexp\n'), ((139, 157), 'omics.get_omics_regexp', 'get_omics_regexp', ([], {}), '()\n', (155, 157), False, 'from omics import get_ome_regexp, get_omics_regexp\n'), ((190, 215), 're.... |
import src.utils.general_utils as utils
import src.utils.validations as validations
from src.utils.enumerators import BBType, CoordinatesType, FileFormat
def test_validation_formats():
# Validate COCO format
folder_annotations = 'data/database/dets/coco_format'
assert validations.is_valid_coco_dir(folder_... | [
"src.utils.validations.is_pascal_format",
"src.utils.general_utils.get_files_recursively",
"src.utils.validations.is_valid_cvat_dir",
"src.utils.validations.verify_format",
"src.utils.validations.is_specific_text_format",
"src.utils.validations.is_valid_coco_dir"
] | [((283, 332), 'src.utils.validations.is_valid_coco_dir', 'validations.is_valid_coco_dir', (['folder_annotations'], {}), '(folder_annotations)\n', (312, 332), True, 'import src.utils.validations as validations\n'), ((405, 454), 'src.utils.validations.is_valid_coco_dir', 'validations.is_valid_coco_dir', (['folder_annotat... |
# Import modules
import matplotlib.pyplot as plt
import numpy as np
from scripts.dwt_windowed import do_transform
def py_closest(data, value):
return np.argmin(np.abs(data - value))
def py_cumvar_n(data):
return np.cumsum(data**2) / np.sum(data**2)
## RANDOM INPUT
# Generate test signal
sig = np.random.r... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.show",
"numpy.abs",
"matplotlib.pyplot.plot",
"numpy.sum",
"matplotlib.pyplot.legend",
"numpy.zeros",
"scripts.dwt_windowed.do_transform",
"matplotlib.pyplot.text",
"matplotlib.pyplot.figure",
"numpy.random.random",
"num... | [((309, 336), 'numpy.random.random', 'np.random.random', (['[2 ** 16]'], {}), '([2 ** 16])\n', (325, 336), True, 'import numpy as np\n'), ((335, 347), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (345, 347), True, 'import matplotlib.pyplot as plt\n'), ((349, 362), 'matplotlib.pyplot.plot', 'plt.plot', ([... |
# ------------------------------------------------------------------------
# MIT License
#
# Copyright (c) [2021] [<NAME>]
#
# This code is part of the library PyDL <https://github.com/nash911/PyDL>
# This code is licensed under MIT license (see LICENSE.txt for details)
# -----------------------------------------------... | [
"pydl.nn.nn.NN",
"numpy.random.seed",
"pydl.nn.rnn.RNN",
"pydl.training.sgd.SGD",
"numpy.zeros",
"pydl.nn.layers.FC"
] | [((508, 532), 'numpy.random.seed', 'np.random.seed', (['(11421111)'], {}), '(11421111)\n', (522, 532), True, 'import numpy as np\n'), ((677, 711), 'numpy.zeros', 'np.zeros', (['(1, K)'], {'dtype': 'conf.dtype'}), '((1, K), dtype=conf.dtype)\n', (685, 711), True, 'import numpy as np\n'), ((919, 1085), 'pydl.nn.rnn.RNN',... |
"""Deep Residual Learning for Image Recognition.
Paper: https://arxiv.org/abs/1512.03385
Created on Tue Oct 12 20:09:50 2021
@author: gonzo
"""
import torch
import torch.nn as nn
class ConvBlock(nn.Module):
def __init__(self, in_channels, out_channels, **kwargs):
super(ConvBlock, self).__init__()
... | [
"torch.nn.ReLU",
"torch.nn.Sequential",
"torch.nn.MaxPool2d",
"torch.nn.Conv2d",
"torch.randn",
"torch.nn.BatchNorm2d",
"torch.cuda.is_available",
"torch.cuda.empty_cache",
"torch.nn.Linear",
"torch.Size",
"torch.nn.AvgPool2d"
] | [((3858, 3882), 'torch.cuda.empty_cache', 'torch.cuda.empty_cache', ([], {}), '()\n', (3880, 3882), False, 'import torch\n'), ((3976, 4042), 'torch.randn', 'torch.randn', (['(num_samples, in_channels, size, size)'], {'device': 'device'}), '((num_samples, in_channels, size, size), device=device)\n', (3987, 4042), False,... |
"""
FinetuneTransformer
===================
"""
from ..utils.misc import suppress_stdout, get_file_md5
from .base_model import BaseModel
from ..utils.transformers_helpers import mask_tokens, rotate_checkpoints, set_seed, download_vocab_files_for_tokenizer
from torch.utils.data import DataLoader, IterableDataset
from t... | [
"pandas.read_csv",
"logging.getLogger",
"torch.cuda.device_count",
"os.path.isfile",
"numpy.random.randint",
"torch.distributed.get_world_size",
"torch.device",
"torch.no_grad",
"os.path.join",
"torch.utils.data.DataLoader",
"os.path.dirname",
"os.path.exists",
"apex.optimizers.FusedAdam",
... | [((812, 839), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (829, 839), False, 'import logging\n'), ((1389, 1435), 'os.path.join', 'os.path.join', (['self.other_path', 'self.model_name'], {}), '(self.other_path, self.model_name)\n', (1401, 1435), False, 'import os\n'), ((4304, 4377), 'tr... |
#!/usr/bin/env python
# coding: utf-8
#
# Author: <NAME>
# Email: yanpx (at) mail2.sysu.edu.cn
from collections import OrderedDict
import torch
import torch.nn as nn
import torch.nn.functional as F
from .resnet_dilation import resnet50, Bottleneck, conv1x1
class _ConvBatchNormReLU(nn.Sequential):... | [
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.Dropout2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.cat",
"torch.nn.BatchNorm2d",
"torch.nn.functional.interpolate",
"torch.nn.Module"
] | [((1526, 1537), 'torch.nn.Module', 'nn.Module', ([], {}), '()\n', (1535, 1537), True, 'import torch.nn as nn\n'), ((2703, 2722), 'torch.cat', 'torch.cat', (['h'], {'dim': '(1)'}), '(h, dim=1)\n', (2712, 2722), False, 'import torch\n'), ((3617, 3643), 'torch.cat', 'torch.cat', (['(bu, td)'], {'dim': '(1)'}), '((bu, td),... |
"""
Deploying en Elasticsearch server for collecting logs from ripsaw benchmarks
"""
import os
import logging
import tempfile
import urllib
import urllib.error
import base64
import signal
import subprocess
import time
from elasticsearch import Elasticsearch, exceptions as esexp
from ocs_ci.ocs import constants
from ... | [
"subprocess.run",
"subprocess.Popen",
"logging.getLogger",
"time.sleep",
"os.kill",
"urllib.request.urlretrieve",
"tempfile.mkdtemp",
"ocs_ci.ocs.ocp.OCP",
"ocs_ci.utility.utils.TimeoutSampler"
] | [((454, 481), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (471, 481), False, 'import logging\n'), ((1085, 1162), 'ocs_ci.ocs.ocp.OCP', 'OCP', ([], {'kind': '"""pod"""', 'resource_name': '"""elastic-operator-0"""', 'namespace': 'self.namespace'}), "(kind='pod', resource_name='elastic-op... |