code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
#!/usr/bin/env python # -*- coding:utf-8 -*- import pandas as pd metadata = pd.read_csv('pcawg_download/WGS.metadata.tsv', sep='\t') histo_data = pd.read_excel('pcawg_download/pcawg_specimen_histology_August2016_v9.xlsx') match_cohort = pd.read_excel('pcawg_download/tumour_subtype_consolidation_map.tsv.xlsx', sheet_na...
[ "pandas.read_csv", "pandas.merge", "pandas.melt", "pandas.read_excel", "pandas.DataFrame", "pandas.concat" ]
[((77, 133), 'pandas.read_csv', 'pd.read_csv', (['"""pcawg_download/WGS.metadata.tsv"""'], {'sep': '"""\t"""'}), "('pcawg_download/WGS.metadata.tsv', sep='\\t')\n", (88, 133), True, 'import pandas as pd\n'), ((147, 222), 'pandas.read_excel', 'pd.read_excel', (['"""pcawg_download/pcawg_specimen_histology_August2016_v9.x...
from typing import Optional from lxml import etree import os import glob from app.pubmed.extract_xml import extract_mesh_headings from app.pubmed.source_files import DTDResolver from app.pubmed.sink_db import PubmedCacheConn def create_mesh_parser(directory: str) -> etree.XMLParser: parser = etree.XMLParser( ...
[ "lxml.etree.parse", "os.path.join", "app.pubmed.extract_xml.extract_mesh_headings", "lxml.etree.XMLParser", "os.path.basename", "app.pubmed.source_files.DTDResolver" ]
[((301, 471), 'lxml.etree.XMLParser', 'etree.XMLParser', ([], {'remove_blank_text': '(True)', 'remove_comments': '(True)', 'remove_pis': '(True)', 'collect_ids': '(False)', 'load_dtd': '(False)', 'dtd_validation': '(False)', 'attribute_defaults': '(False)'}), '(remove_blank_text=True, remove_comments=True, remove_pis=\...
#!/usr/bin/env python3 import tensorflow as tf import numpy as np import os import math import foolbox import scipy import matplotlib.pyplot as plt from PIL import Image #Utilizes the FoolBox Python library (https://github.com/bethgelab/foolbox) to implement a variety #of adversarial attacks against deep-learning mo...
[ "numpy.clip", "foolbox.criteria.Misclassification", "scipy.spatial.distance.hamming", "foolbox.models.ModelWithEstimatedGradients", "os.path.exists", "tensorflow.Session", "numpy.asarray", "os.mkdir", "numpy.concatenate", "numpy.argmax", "numpy.any", "numpy.squeeze", "numpy.isnan", "scipy....
[((450, 486), 'foolbox.criteria.Misclassification', 'foolbox.criteria.Misclassification', ([], {}), '()\n', (484, 486), False, 'import foolbox\n'), ((7022, 7077), 'numpy.asarray', 'np.asarray', (['[a.adversarial_class for a in adversarials]'], {}), '([a.adversarial_class for a in adversarials])\n', (7032, 7077), True, ...
from enum import Enum import pygame from pygame.font import Font from pygame.math import Vector2 from game import uuids from game.components import AnimationGroups, ScriptComponent, Sprite, Transform from game.components.ui import Element from game.loaders import TextLoader from game.scripts.script import Script TEX...
[ "game.loaders.TextLoader.load", "game.uuids.get", "game.components.Transform", "pygame.math.Vector2", "pygame.font.Font" ]
[((416, 458), 'pygame.font.Font', 'Font', (['"""assets/fonts/normal.ttf"""', 'TEXT_SIZE'], {}), "('assets/fonts/normal.ttf', TEXT_SIZE)\n", (420, 458), False, 'from pygame.font import Font\n'), ((580, 623), 'game.loaders.TextLoader.load', 'TextLoader.load', (['text_path[0]', 'text_path[1]'], {}), '(text_path[0], text_p...
import logging _logger = logging.getLogger('polyaxon.repos.git') def set_git_repo(repo: 'Repo') -> str: from libs.repos.git import ensure_repo_paths, get_git_repo # Ensure paths ensure_repo_paths(repo=repo) # Create a new repo get_git_repo(repo_path=repo.path, init=True) return repo.path
[ "logging.getLogger", "libs.repos.git.get_git_repo", "libs.repos.git.ensure_repo_paths" ]
[((26, 65), 'logging.getLogger', 'logging.getLogger', (['"""polyaxon.repos.git"""'], {}), "('polyaxon.repos.git')\n", (43, 65), False, 'import logging\n'), ((194, 222), 'libs.repos.git.ensure_repo_paths', 'ensure_repo_paths', ([], {'repo': 'repo'}), '(repo=repo)\n', (211, 222), False, 'from libs.repos.git import ensure...
from services.recommendation import Recommendation import logging import sys logging.basicConfig(stream=sys.stdout, level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s") log = logging.getLogger(__name__) def start_recommendation(elk_rec=False, **kwargs): """This f...
[ "logging.basicConfig", "services.recommendation.Recommendation", "logging.getLogger" ]
[((78, 204), 'logging.basicConfig', 'logging.basicConfig', ([], {'stream': 'sys.stdout', 'level': 'logging.INFO', 'format': '"""%(asctime)s - %(name)s - %(levelname)s - %(message)s"""'}), "(stream=sys.stdout, level=logging.INFO, format=\n '%(asctime)s - %(name)s - %(levelname)s - %(message)s')\n", (97, 204), False, ...
# -*- coding: utf-8 -*- ### # © 2018 The Board of Trustees of the Leland Stanford Junior University # <NAME> # <EMAIL> ### """ The official Python client for Pulsar LIMS. Required Environment Variables: 1) PULSAR_API_URL 2) PULSAR_TOKEN """ import logging import os import sys from urllib.parse import urlpar...
[ "logging.getLogger", "logging.StreamHandler", "urllib.parse.urlparse", "logging.Formatter", "os.environ.get" ]
[((404, 440), 'os.environ.get', 'os.environ.get', (['"""MAILGUN_DOMAIN"""', '""""""'], {}), "('MAILGUN_DOMAIN', '')\n", (418, 440), False, 'import os\n'), ((1021, 1057), 'os.environ.get', 'os.environ.get', (['"""PULSAR_API_URL"""', '""""""'], {}), "('PULSAR_API_URL', '')\n", (1035, 1057), False, 'import os\n'), ((1122,...
# -*- coding: utf-8 -*- """ :author: Zhazh :copyright: © 2020 Zhazh <<EMAIL>> :license: MIT, see LICENSE for more details. """ import os from flask import ( render_template, redirect, url_for, request, jsonify, abort, Blueprint, current_app, send_from_directory, make_response ) from flask_login import ...
[ "flask.render_template", "flask.request.args.get", "os.path.exists", "flask.send_from_directory", "pubdisk.utils.Node", "pubdisk.blueprints.user_required", "os.path.split", "flask.url_for", "os.path.isfile", "flask.current_app.logger.info", "flask.abort", "flask.Blueprint", "os.walk", "fla...
[((524, 552), 'flask.Blueprint', 'Blueprint', (['"""users"""', '__name__'], {}), "('users', __name__)\n", (533, 552), False, 'from flask import render_template, redirect, url_for, request, jsonify, abort, Blueprint, current_app, send_from_directory, make_response\n'), ((866, 887), 'pubdisk.blueprints.user_required', 'u...
from django.contrib.auth import models as auth_models from django.db import models from django.utils import timezone from django.utils.translation import gettext_lazy as _ class BaseUserManager(auth_models.BaseUserManager): def create_user(self, email, password=None): if not email: raise Value...
[ "django.utils.translation.gettext_lazy" ]
[((903, 913), 'django.utils.translation.gettext_lazy', '_', (['"""email"""'], {}), "('email')\n", (904, 913), True, 'from django.utils.translation import gettext_lazy as _\n'), ((980, 994), 'django.utils.translation.gettext_lazy', '_', (['"""is active"""'], {}), "('is active')\n", (981, 994), True, 'from django.utils.t...
import os import pytest from meds.bounds import Bounds from .._se_image import SEImageSlice @pytest.mark.skipif( os.environ.get('TEST_DESDATA', None) is None, reason=( 'SEImageSlice can only be tested if ' 'test data is at TEST_DESDATA')) def test_se_image_ccd_bnds_in(se_image_data): se_...
[ "pytest.mark.parametrize", "meds.bounds.Bounds", "os.environ.get" ]
[((3056, 3101), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""buffer"""', '[0, 5, 10]'], {}), "('buffer', [0, 5, 10])\n", (3079, 3101), False, 'import pytest\n'), ((605, 627), 'meds.bounds.Bounds', 'Bounds', (['(10)', '(20)', '(50)', '(60)'], {}), '(10, 20, 50, 60)\n', (611, 627), False, 'from meds.bounds...
import FWCore.ParameterSet.Config as cms from Configuration.StandardSequences.RawToDigi_cff import * scalersRawToDigi.scalersInputTag = 'rawDataRepacker' csctfDigis.producer = 'rawDataRepacker' dttfDigis.DTTF_FED_Source = 'rawDataRepacker' gctDigis.inputLabel = 'rawDataRepacker' gtDigis.DaqGtInputTag = 'rawDataRepack...
[ "FWCore.ParameterSet.Config.Sequence" ]
[((826, 1060), 'FWCore.ParameterSet.Config.Sequence', 'cms.Sequence', (['(csctfDigis + dttfDigis + gctDigis + gtDigis + gtEvmDigis + siPixelDigis +\n siStripDigis + ecalDigis + ecalPreshowerDigis + hcalDigis +\n muonCSCDigis + muonDTDigis + muonRPCDigis + castorDigis + scalersRawToDigi)'], {}), '(csctfDigis + dtt...
#!/usr/bin/env python3 # coding: utf-8 """Entrypoint for GUI.""" from fit import generate_fit, A0 from dash import html from lsqfitgui import run_server def get_additional_content(fit): """Generate aditional dash html elements based on a fit object.""" return html.Div( [ html.H2("Compari...
[ "dash.html.H2", "lsqfitgui.run_server", "dash.html.P" ]
[((567, 828), 'lsqfitgui.run_server', 'run_server', ([], {'name': '"""Poly fit"""', 'fit_setup_function': 'generate_fit', 'fit_setup_kwargs': "{'n_poly': 4}", 'meta_config': "[{'name': 'n_poly', 'type': 'number', 'min': 1, 'max': 10, 'step': 1}]", 'use_default_content': '(True)', 'get_additional_content': 'get_addition...
import glob import os import sys from argparse import ArgumentParser from datetime import datetime import numpy as np import torch import torch.utils.data as Data from Functions import generate_grid, Dataset_epoch, Predict_dataset, transform_unit_flow_to_flow_cuda, \ generate_grid_unit from miccai2021_model impor...
[ "numpy.save", "miccai2021_model.Miccai2021_LDR_conditional_laplacian_unit_disp_add_lvl1", "numpy.reshape", "argparse.ArgumentParser", "os.path.isdir", "os.mkdir", "miccai2021_model.NCC", "sys.stdout.flush", "glob.glob", "miccai2021_model.SpatialTransformNearest_unit", "Functions.Dataset_epoch", ...
[((627, 643), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (641, 643), False, 'from argparse import ArgumentParser\n'), ((16340, 16354), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (16352, 16354), False, 'from datetime import datetime\n'), ((16409, 16423), 'datetime.datetime.now', 'date...
import numpy as np import cv2 from PIL import ImageGrab from ScreenRead import * from Utils import * # VERY IMPORTANT: Without it, the entire screen will not be captured from ctypes import windll user32 = windll.user32 user32.SetProcessDPIAware() fourcc = cv2.VideoWriter_fourcc(*'XVID') out = cv2.VideoWriter('output....
[ "PIL.ImageGrab.grab", "cv2.putText", "cv2.VideoWriter", "cv2.VideoWriter_fourcc", "cv2.waitKey" ]
[((258, 289), 'cv2.VideoWriter_fourcc', 'cv2.VideoWriter_fourcc', (["*'XVID'"], {}), "(*'XVID')\n", (280, 289), False, 'import cv2\n'), ((296, 351), 'cv2.VideoWriter', 'cv2.VideoWriter', (['"""output.avi"""', 'fourcc', '(10)', '(1920, 1080)'], {}), "('output.avi', fourcc, 10, (1920, 1080))\n", (311, 351), False, 'impor...
# -*- coding: utf-8 -*- import pandas as pd from zvt.api import get_kdata_schema from zvt.contract import IntervalLevel from zvt.contract.api import df_to_db from zvt.contract.recorder import FixedCycleDataRecorder from zvt.utils import to_time_str, to_pd_timestamp from zvt.utils.time_utils import TIME_FORMAT_DAY, TI...
[ "pandas.DataFrame.from_records", "zvt.contract.IntervalLevel", "zvt_coin.domain.Coin.code.contains", "zvt.utils.to_time_str", "zvt.contract.api.df_to_db", "zvt_coin.api.get_exchange_config", "zvt_coin.api.get_coin_exchange", "zvt.api.get_kdata_schema", "zvt.utils.to_pd_timestamp" ]
[((1206, 1226), 'zvt.contract.IntervalLevel', 'IntervalLevel', (['level'], {}), '(level)\n', (1219, 1226), False, 'from zvt.contract import IntervalLevel\n'), ((1255, 1327), 'zvt.api.get_kdata_schema', 'get_kdata_schema', ([], {'entity_type': 'entity_type', 'level': 'level', 'adjust_type': 'None'}), '(entity_type=entit...
# Generated by Django 3.1.7 on 2021-03-10 18:07 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('api', '0004_book_length'), ] operations = [ migrations.AlterField( model_name='author', name='biography', ...
[ "django.db.models.TextField", "django.db.models.CharField" ]
[((328, 356), 'django.db.models.TextField', 'models.TextField', ([], {'blank': '(True)'}), '(blank=True)\n', (344, 356), False, 'from django.db import migrations, models\n'), ((479, 522), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(50)'}), '(blank=True, max_length=50)\n', ...
# -*- coding: utf-8 -*- """ Created on Fri Oct 9 13:55:54 2020 @author: lenovouser """ import matplotlib.pyplot as plt import numpy as np def f(x,y): # the height function return (1 - x / 2 + x**5 + y**3) * np.exp(-x**2 -y**2) n = 256 x = np.linspace(-3, 3, n) y = np.linspace(-3, 3, n) X,Y = np.meshgrid(x,...
[ "matplotlib.pyplot.xticks", "matplotlib.pyplot.colorbar", "numpy.exp", "numpy.linspace", "matplotlib.pyplot.yticks", "matplotlib.pyplot.clabel", "numpy.meshgrid", "matplotlib.pyplot.show" ]
[((252, 273), 'numpy.linspace', 'np.linspace', (['(-3)', '(3)', 'n'], {}), '(-3, 3, n)\n', (263, 273), True, 'import numpy as np\n'), ((278, 299), 'numpy.linspace', 'np.linspace', (['(-3)', '(3)', 'n'], {}), '(-3, 3, n)\n', (289, 299), True, 'import numpy as np\n'), ((306, 323), 'numpy.meshgrid', 'np.meshgrid', (['x', ...
#!/usr/bin/python3 #openimage.py import cv2 # Load a color image in grayscale img = cv2.imread('testimage.jpg',0) cv2.imshow('image',img) cv2.waitKey(0) cv2.destroyAllWindows()
[ "cv2.waitKey", "cv2.imread", "cv2.destroyAllWindows", "cv2.imshow" ]
[((85, 115), 'cv2.imread', 'cv2.imread', (['"""testimage.jpg"""', '(0)'], {}), "('testimage.jpg', 0)\n", (95, 115), False, 'import cv2\n'), ((115, 139), 'cv2.imshow', 'cv2.imshow', (['"""image"""', 'img'], {}), "('image', img)\n", (125, 139), False, 'import cv2\n'), ((139, 153), 'cv2.waitKey', 'cv2.waitKey', (['(0)'], ...
from Bio.PDB.PDBParser import PDBParser from Bio.PDB.MMCIFParser import MMCIFParser, FastMMCIFParser from Bio.PDB.StructureBuilder import StructureBuilder from Bio.PDB.PDBIO import PDBIO from Bio.PDB.MMCIF2Dict import MMCIF2Dict from Bio.PDB.mmcifio import MMCIFIO from Bio.PDB.Polypeptide import PPBuilder import sys im...
[ "os.path.exists", "os.listdir", "sys.exit", "argparse.ArgumentParser", "os.makedirs", "Bio.PDB.MMCIF2Dict.MMCIF2Dict", "subprocess.Popen", "os.path.join", "Bio.PDB.PDBIO.PDBIO", "Bio.PDB.MMCIFParser.MMCIFParser", "copy.deepcopy", "sys.stdout.flush", "Bio.PDB.PDBParser.PDBParser", "Bio.PDB....
[((4647, 4721), 'subprocess.Popen', 'subprocess.Popen', (['command'], {'universal_newlines': '(True)', 'stdout': 'log', 'shell': '(True)'}), '(command, universal_newlines=True, stdout=log, shell=True)\n', (4663, 4721), False, 'import subprocess\n'), ((4754, 4772), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n...
import tensorflow as tf import numpy as np from keras import backend as K from keras.models import Sequential, model_from_json from keras.layers import Lambda from tensorflow.python.framework import ops from scipy.ndimage.interpolation import zoom import keras import tempfile import os def loss_calculation(x, categor...
[ "tensorflow.python.framework.ops.RegisterGradient", "keras.backend.sum", "keras.backend.learning_phase", "keras.backend.gradients", "keras.backend.floatx", "scipy.ndimage.interpolation.zoom", "tensorflow.cast", "numpy.mean", "keras.backend.image_data_format", "keras.backend.square", "numpy.max",...
[((947, 977), 'keras.backend.sum', 'K.sum', (['model.layers[-1].output'], {}), '(model.layers[-1].output)\n', (952, 977), True, 'from keras import backend as K\n'), ((2211, 2233), 'tensorflow.get_default_graph', 'tf.get_default_graph', ([], {}), '()\n', (2231, 2233), True, 'import tensorflow as tf\n'), ((3258, 3292), '...
import os import torch from torch.utils.data import DataLoader from . import tokenizer as token_util import configparser config = configparser.ConfigParser() max_history, max_contexts_length, max_candidate_length, device = None, \ None, None, None # inference parameters setup def config_setup(): global max_h...
[ "configparser.ConfigParser", "torch.max", "os.path.join", "os.path.dirname", "torch.utils.data.DataLoader", "torch.no_grad", "torch.device" ]
[((130, 157), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (155, 157), False, 'import configparser\n'), ((392, 417), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (407, 417), False, 'import os\n'), ((437, 472), 'os.path.join', 'os.path.join', (['dirname', '"""c...
# Copyright (c) 2020 <NAME> <<EMAIL>> # See the COPYRIGHT file for more information import getopt import re from cowrie.shell.command import HoneyPotCommand commands = {} CHMOD_HELP = """Usage: chmod [OPTION]... MODE[,MODE]... FILE... or: chmod [OPTION]... OCTAL-MODE FILE... or: chmod [OPTION]... --referenc...
[ "re.fullmatch", "getopt.gnu_getopt" ]
[((2635, 2665), 're.fullmatch', 're.fullmatch', (['MODE_REGEX', 'mode'], {}), '(MODE_REGEX, mode)\n', (2647, 2665), False, 'import re\n'), ((3932, 4101), 'getopt.gnu_getopt', 'getopt.gnu_getopt', (['args_new', '"""cfvR"""', "['changes', 'silent', 'quiet', 'verbose', 'no-preserve-root',\n 'preserve-root', 'reference=...
import tensorflow as tf import numpy as np import pandas as pd import pickle import sys sys.path.append('/Users/slade/Documents/Code/machine-learning/Python/ffm/tools.py') from tools import transfer_data, get_batch class Args(object): # number of latent factors k = 6 # num of fields f = 24 # num ...
[ "tensorflow.local_variables_initializer", "pandas.read_csv", "tensorflow.contrib.layers.l2_regularizer", "tensorflow.multiply", "tensorflow.truncated_normal_initializer", "tensorflow.gradients", "numpy.array", "tensorflow.zeros_initializer", "sys.path.append", "tensorflow.clip_by_global_norm", "...
[((89, 177), 'sys.path.append', 'sys.path.append', (['"""/Users/slade/Documents/Code/machine-learning/Python/ffm/tools.py"""'], {}), "(\n '/Users/slade/Documents/Code/machine-learning/Python/ffm/tools.py')\n", (104, 177), False, 'import sys\n'), ((4709, 4737), 'pandas.read_csv', 'pd.read_csv', (['train_data_path'], ...
# -*- coding: utf-8 -*- """ 根据手工标注的标签生成npy文件,每个npy文件保存了一个二维数组(width, height, 8+1), 前8个通道是图像数据,最后一个通道是标签 """ import os import sys import glob import json import tqdm import skimage.io import numpy as np import matplotlib.pyplot as plt def find_bnd(img): """ 从标签图像中找到标注的区域(矩形),标签图像是与卫星图大小一致的RGBA图像,未标注的 ...
[ "matplotlib.pyplot.imshow", "os.path.exists", "os.makedirs", "matplotlib.pyplot.show", "tqdm.tqdm", "os.path.join", "os.path.splitext", "json.dumps", "os.path.split", "numpy.expand_dims", "numpy.concatenate", "matplotlib.pyplot.title", "numpy.load", "matplotlib.pyplot.subplot", "matplotl...
[((1677, 1693), 'tqdm.tqdm', 'tqdm.tqdm', (['masks'], {}), '(masks)\n', (1686, 1693), False, 'import tqdm\n'), ((2822, 2848), 'numpy.random.shuffle', 'np.random.shuffle', (['dat_all'], {}), '(dat_all)\n', (2839, 2848), True, 'import numpy as np\n'), ((1342, 1368), 'os.path.exists', 'os.path.exists', (['output_dir'], {}...
from mylabs import pytest def test_1000_lazy_object(): from mylabs.lib.lang import LazyObject obj = LazyObject() import logging assert isinstance(obj.logger, logging.Logger) if obj.ipython is None: try: ipy = get_ipython() except NameError: ipy = None...
[ "mylabs.pytest.raises", "mylabs.lib.lang.LazyObject" ]
[((115, 127), 'mylabs.lib.lang.LazyObject', 'LazyObject', ([], {}), '()\n', (125, 127), False, 'from mylabs.lib.lang import LazyObject\n'), ((524, 553), 'mylabs.pytest.raises', 'pytest.raises', (['AttributeError'], {}), '(AttributeError)\n', (537, 553), False, 'from mylabs import pytest\n')]
# Author: <NAME> # Date: 5 Feb 2019 # # 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 wr...
[ "tensorflow.random.uniform", "tensorflow.slice", "tensorflow.image.resize_images", "tensorflow.shape", "tensorflow.pad", "tensorflow.transpose", "numpy.random.rand", "tensorflow.placeholder", "tensorflow.Session", "numpy.random.randint", "tensorflow.image.crop_and_resize", "tensorflow.get_defa...
[((2660, 2718), 'tensorflow.pad', 'tf.pad', (['tensor_3d', '((0, 0), (0, pad_size), (0, 0), (0, 0))'], {}), '(tensor_3d, ((0, 0), (0, pad_size), (0, 0), (0, 0)))\n', (2666, 2718), True, 'import tensorflow as tf\n'), ((2829, 2857), 'numpy.random.randint', 'np.random.randint', (['(0)', 'maxval'], {}), '(0, maxval)\n', (2...
import operator import scipy from sklearn.feature_extraction.text import TfidfTransformer from sklearn.feature_extraction.text import CountVectorizer def dict2list_of_all_occurrences(a_dict): return [label for label, freq in a_dict.items() for _ in range(freq)] assert dict2list_of_all_oc...
[ "sklearn.feature_extraction.text.TfidfTransformer", "operator.itemgetter", "scipy.sparse.coo_matrix" ]
[((1509, 1527), 'sklearn.feature_extraction.text.TfidfTransformer', 'TfidfTransformer', ([], {}), '()\n', (1525, 1527), False, 'from sklearn.feature_extraction.text import TfidfTransformer\n'), ((2005, 2041), 'scipy.sparse.coo_matrix', 'scipy.sparse.coo_matrix', (['sents_tfidf'], {}), '(sents_tfidf)\n', (2028, 2041), F...
import os import torch import torch.nn as nn from torch.autograd import Variable from torchvision.datasets import MNIST import torchvision.transforms as transforms import torch.nn.functional as F import torch.optim as optim import pdb from model import * import argparse #task = "CLearn" task = "CLearn_Ben" ## load m...
[ "torch.nn.CrossEntropyLoss", "torch.softmax", "torch.cuda.is_available", "os.path.exists", "pdb.post_mortem", "torch.randint", "os.mkdir", "torchvision.transforms.ToTensor", "torch.autograd.Variable", "torch.zeros_like", "torch.argmax", "torch.ones_like", "torch.nn.functional.one_hot", "to...
[((344, 369), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (367, 369), False, 'import torch\n'), ((379, 424), 'torch.device', 'torch.device', (["('cuda:0' if use_cuda else 'cpu')"], {}), "('cuda:0' if use_cuda else 'cpu')\n", (391, 424), False, 'import torch\n'), ((679, 739), 'torchvision.dat...
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.chrome.service import Service from selenium.webdriver.chrome.options import Options from selenium.common.exceptions import WebDriverException import time import pandas as pd from datetime import datetime import platform i...
[ "selenium.webdriver.chrome.options.Options", "sqlalchemy.types.VARCHAR", "sqlalchemy.types.TEXT", "selenium.webdriver.Chrome", "selenium.webdriver.chrome.service.Service", "pandas.DataFrame.from_dict", "time.sleep", "datetime.datetime.now", "platform.system", "pandas.DataFrame", "sqlalchemy.engi...
[((461, 478), 'platform.system', 'platform.system', ([], {}), '()\n', (476, 478), False, 'import platform\n'), ((1256, 1295), 'sqlalchemy.engine.create_engine', 'engine.create_engine', (['connection_string'], {}), '(connection_string)\n', (1276, 1295), False, 'from sqlalchemy import engine, types\n'), ((1401, 1410), 's...
import os import sys from Crypto.Cipher import AES def aes_encrypt(data, key): block_size = AES.block_size missing_padding = len(data) % block_size padding_bytes = block_size - missing_padding data += (padding_bytes * chr(padding_bytes)).encode() iv = os.urandom(block_size) cipher = AES.new(ke...
[ "os.urandom", "Crypto.Cipher.AES.new" ]
[((274, 296), 'os.urandom', 'os.urandom', (['block_size'], {}), '(block_size)\n', (284, 296), False, 'import os\n'), ((310, 340), 'Crypto.Cipher.AES.new', 'AES.new', (['key', 'AES.MODE_CBC', 'iv'], {}), '(key, AES.MODE_CBC, iv)\n', (317, 340), False, 'from Crypto.Cipher import AES\n'), ((534, 564), 'Crypto.Cipher.AES.n...
from pyunicorn.timeseries import RecurrencePlot import numpy as np from statistics import median import time # Measure the times (in ms) of evaluating an expression n times def measuretime(f, n, *args): t = [0]*n res = f(*args) for n in range(n): t0 = time.time() f(*args) t[n] = tim...
[ "statistics.median", "numpy.array", "pyunicorn.timeseries.RecurrencePlot", "numpy.loadtxt", "time.time" ]
[((522, 611), 'pyunicorn.timeseries.RecurrencePlot', 'RecurrencePlot', (['v'], {'metric': 'metric', 'sparse_rqa': 'metric_sup', 'threshold': '(1.2)', 'dim': '(3)', 'tau': '(6)'}), '(v, metric=metric, sparse_rqa=metric_sup, threshold=1.2, dim=\n 3, tau=6)\n', (536, 611), False, 'from pyunicorn.timeseries import Recur...
from db.db import Base, engine, Session from models import Category def init_db(): # noinspection PyUnresolvedReferences import models Base.metadata.create_all(engine) def populate_db(): session = Session() categories = [ 'gold', 'toman', ] session.add_all([Category(name...
[ "db.db.Base.metadata.create_all", "models.Category", "db.db.Session" ]
[((149, 181), 'db.db.Base.metadata.create_all', 'Base.metadata.create_all', (['engine'], {}), '(engine)\n', (173, 181), False, 'from db.db import Base, engine, Session\n'), ((217, 226), 'db.db.Session', 'Session', ([], {}), '()\n', (224, 226), False, 'from db.db import Base, engine, Session\n'), ((307, 326), 'models.Ca...
from pygame import time,event,MOUSEBUTTONDOWN,MOUSEBUTTONUP _Clic = [0,0,0,0,0,0] _Ticks = [0,0,0,0,0,0] LAPS = 200 time.Clock() def wait(): ev=event.wait() _foo(ev) return ev def poll(): ev=event.poll() _foo(ev) return ev def get(): ev=event.get() for e in ev: _foo(e) return ev ...
[ "pygame.event.poll", "pygame.time.get_ticks", "pygame.event.get", "pygame.event.wait", "pygame.time.Clock" ]
[((117, 129), 'pygame.time.Clock', 'time.Clock', ([], {}), '()\n', (127, 129), False, 'from pygame import time, event, MOUSEBUTTONDOWN, MOUSEBUTTONUP\n'), ((150, 162), 'pygame.event.wait', 'event.wait', ([], {}), '()\n', (160, 162), False, 'from pygame import time, event, MOUSEBUTTONDOWN, MOUSEBUTTONUP\n'), ((210, 222)...
# -*- coding: utf-8 -*- """ Created on Thu Jun 23 13:37:10 2016 @author: kroboth """ import collections import numpy.linalg as linalg # TODO: # * Catch actual exceptions instead of all of them class EventLibrary(object): """ EventLibrary Maintain a list of events. The class is used by the Sequence...
[ "collections.namedtuple", "numpy.linalg.norm" ]
[((2132, 2179), 'collections.namedtuple', 'collections.namedtuple', (['"""find"""', "['id', 'found']"], {}), "('find', ['id', 'found'])\n", (2154, 2179), False, 'import collections\n'), ((1874, 1908), 'numpy.linalg.norm', 'linalg.norm', (['(self.data[ind] - data)'], {}), '(self.data[ind] - data)\n', (1885, 1908), True,...
import time import sys import vlc #sudo pip3 install python-vlc from tkinter import Tk, StringVar,Frame,Label,Button,Scrollbar,Listbox,Entry,Text from tkinter import Y,END,TOP,BOTH,LEFT,RIGHT,VERTICAL,SINGLE,NONE,NORMAL,DISABLED class VideoPlayer(object): # used first time and for every other instance def...
[ "tkinter.Tk", "time.time", "vlc.MediaPlayer", "vlc.Instance" ]
[((1765, 1785), 'vlc.Instance', 'vlc.Instance', (['i_opts'], {}), '(i_opts)\n', (1777, 1785), False, 'import vlc\n'), ((2204, 2250), 'vlc.MediaPlayer', 'vlc.MediaPlayer', (['self.vlc_instance', '""""""', 'p_opts'], {}), "(self.vlc_instance, '', p_opts)\n", (2219, 2250), False, 'import vlc\n'), ((8858, 8869), 'time.time...
# -*- coding: utf-8 -*- import yaml from setuptools import setup, find_packages config = yaml.load(open('config.yaml', 'r')) readme = open('README.md', 'r') license = open('LICENSE', 'r') setup( name=config['app']['name'].replace(" ","-"), version=config['app']['version'], description=config['app']['des...
[ "setuptools.find_packages" ]
[((528, 568), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "('tests', 'docs')"}), "(exclude=('tests', 'docs'))\n", (541, 568), False, 'from setuptools import setup, find_packages\n')]
import tempfile from typing import Any, Dict import pandas as pd from feast import FileSource from feast.data_format import ParquetFormat from feast.data_source import DataSource from feast.infra.offline_stores.file import FileOfflineStoreConfig from feast.repo_config import FeastConfigBaseModel from tests.integratio...
[ "feast.infra.offline_stores.file.FileOfflineStoreConfig", "feast.data_format.ParquetFormat", "tempfile.NamedTemporaryFile" ]
[((771, 831), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', ([], {'suffix': '""".parquet"""', 'delete': '(False)'}), "(suffix='.parquet', delete=False)\n", (798, 831), False, 'import tempfile\n'), ((1394, 1418), 'feast.infra.offline_stores.file.FileOfflineStoreConfig', 'FileOfflineStoreConfig', ([], {})...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.db import models, migrations def create_lastseen(apps, schema_editor): NomCom = apps.get_model('nomcom','NomCom') FeedbackLastSeen = apps.get_model('nomcom','FeedbackLastSeen') now = datetime.datetime.now() fo...
[ "django.db.models.ForeignKey", "datetime.datetime.now", "django.db.migrations.RunPython", "django.db.models.AutoField", "django.db.models.DateTimeField" ]
[((290, 313), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (311, 313), False, 'import datetime\n'), ((1511, 1565), 'django.db.migrations.RunPython', 'migrations.RunPython', (['create_lastseen', 'remove_lastseen'], {}), '(create_lastseen, remove_lastseen)\n', (1531, 1565), False, 'from django.db i...
from scapy.all import * import random conf.verb = 0 class NetSU: def __init__(self, src_ip, dst_ips, dst_ports): self._src_ip = src_ip self._dst_ips = dst_ips self._dst_ports = dst_ports self._open_ports = {} self._filtered_codes = [0, 1, 2, 9, 10, 13] def discover(s...
[ "random.randint" ]
[((435, 462), 'random.randint', 'random.randint', (['(1024)', '(65535)'], {}), '(1024, 65535)\n', (449, 462), False, 'import random\n')]
# Generated by Django 2.2.2 on 2019-07-12 13:01 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('event_registrations', '0009_soloeventregistration_is_reserved'), ] operations = [ migrations.RemoveField( model_name='teammember', ...
[ "django.db.migrations.RemoveField" ]
[((254, 329), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""teammember"""', 'name': '"""invitation_rejected"""'}), "(model_name='teammember', name='invitation_rejected')\n", (276, 329), False, 'from django.db import migrations\n')]
import sys young = int(sys.stdin.readline().rstrip("\n")) middle = int(sys.stdin.readline().rstrip("\n")) print(middle*2 - young)
[ "sys.stdin.readline" ]
[((24, 44), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n', (42, 44), False, 'import sys\n'), ((72, 92), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n', (90, 92), False, 'import sys\n')]
import numpy as np import pandas as pd from scipy import ndimage from scipy.cluster import hierarchy from scipy.spatial import distance_matrix from matplotlib import pyplot as plt from sklearn import manifold, datasets from sklearn.cluster import AgglomerativeClustering from sklearn.datasets.samples_generator import ma...
[ "pandas.read_csv", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.cm.nipy_spectral", "scipy.cluster.hierarchy.fcluster", "sklearn.cluster.AgglomerativeClustering", "matplotlib.pyplot.xlabel", "numpy.max", "numpy.linspace", "matplotlib.pyplot.yticks", "scipy.cluster.hierarchy.linkage", "matplotli...
[((339, 429), 'sklearn.datasets.samples_generator.make_blobs', 'make_blobs', ([], {'n_samples': '(50)', 'centers': '[[4, 4], [-2, -1], [1, 1], [10, 4]]', 'cluster_std': '(0.9)'}), '(n_samples=50, centers=[[4, 4], [-2, -1], [1, 1], [10, 4]],\n cluster_std=0.9)\n', (349, 429), False, 'from sklearn.datasets.samples_gen...
# This class creates a Maze object of size (totalRows, totalCols). Each node in the maze should # be thought of as an open space surrounded by four walls with the position (rowPosition, colPosition). from MazeNode import MazeNode from random import shuffle, randrange import sys class Maze: # defines co...
[ "sys.setrecursionlimit", "random.shuffle", "random.randrange", "sys.getrecursionlimit", "MazeNode.MazeNode" ]
[((4377, 4402), 'random.randrange', 'randrange', (['self.totalCols'], {}), '(self.totalCols)\n', (4386, 4402), False, 'from random import shuffle, randrange\n'), ((723, 746), 'sys.getrecursionlimit', 'sys.getrecursionlimit', ([], {}), '()\n', (744, 746), False, 'import sys\n'), ((761, 819), 'sys.setrecursionlimit', 'sy...
import asyncio import time import aio_pika QUEUE_NAME = 'task_queue' async def main(loop): conn = await aio_pika.connect(host='localhost', loop=loop) channel: aio_pika.Channel = await conn.channel() await channel.set_qos(prefetch_count=1) queue: aio_pika.Queue = await channel.declare_queue(QUEUE_NAM...
[ "asyncio.get_event_loop", "aio_pika.connect" ]
[((644, 668), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (666, 668), False, 'import asyncio\n'), ((112, 157), 'aio_pika.connect', 'aio_pika.connect', ([], {'host': '"""localhost"""', 'loop': 'loop'}), "(host='localhost', loop=loop)\n", (128, 157), False, 'import aio_pika\n')]
# # Python GUI - Text Editor - Win32 # from __future__ import division import win32con as wc, win32ui as ui from GUI import export from GUI.GTextEditors import TextEditor as GTextEditor from GUI.WinUtils import win_none from GUI.StdFonts import application_font PFM_TABSTOPS = 0x10 MAX_TAB_STOPS = 32 LOGPIXELSX = 88...
[ "win32ui.InitRichEdit", "GUI.GTextEditors.TextEditor.__init__", "GUI.export", "win32ui.CreateRichEditView" ]
[((322, 339), 'win32ui.InitRichEdit', 'ui.InitRichEdit', ([], {}), '()\n', (337, 339), True, 'import win32con as wc, win32ui as ui\n'), ((2272, 2290), 'GUI.export', 'export', (['TextEditor'], {}), '(TextEditor)\n', (2278, 2290), False, 'from GUI import export\n'), ((536, 559), 'win32ui.CreateRichEditView', 'ui.CreateRi...
import unittest # from test.cases.case2 import LoginTest # from test.cases.case3 import Regist_New_User from testcases.cases.case2_login import LoginTest from testcases.cases.case3_regist import Regist_New_User from testcases.cases.case4_create_topic import Create_Topic import HTMLReport def get_suite(): testsuit...
[ "unittest.TestSuite", "unittest.TestLoader", "HTMLReport.TestRunner" ]
[((324, 344), 'unittest.TestSuite', 'unittest.TestSuite', ([], {}), '()\n', (342, 344), False, 'import unittest\n'), ((906, 1100), 'HTMLReport.TestRunner', 'HTMLReport.TestRunner', ([], {'report_file_name': '"""test"""', 'output_path': '"""report/report"""', 'title': '"""测试报告"""', 'description': '"""无测试描述"""', 'thread_...
""" This test need a set of pins which can be set as inputs and have no external pull up or pull down connected. THIS TEST ONLY PASSES USING EXPANSION BOARD 2.1 ON EXPANSION BOARD 3.0 THE TEST FAILS ON LOPY4 AND WIPY DUE TO DIFFERENT REASONS """ from machine import Pin from machine import UART import os mch = os.uname...
[ "machine.Pin", "os.uname" ]
[((1508, 1525), 'machine.Pin', 'Pin', (['"""P9"""', 'Pin.IN'], {}), "('P9', Pin.IN)\n", (1511, 1525), False, 'from machine import Pin\n'), ((1532, 1560), 'machine.Pin', 'Pin', (['"""P23"""', 'Pin.OUT'], {'value': '(1)'}), "('P23', Pin.OUT, value=1)\n", (1535, 1560), False, 'from machine import Pin\n'), ((2172, 2186), '...
""" Adding ability to run package as an executable """ from barcap.main import main if __name__ == '__main__': main()
[ "barcap.main.main" ]
[((119, 125), 'barcap.main.main', 'main', ([], {}), '()\n', (123, 125), False, 'from barcap.main import main\n')]
# 给出任意一个列表,请查找出x元素是否在列表里面,如果存在返回1,不存在返回0 import random,string string.octdigits words=string.octdigits+string.ascii_letters n=int(input("输入一个数字n在0到100内生成n个随机数的列表:")) Random_nums=[] for i in range(n): Random_nums.append("".join(random.choices(words,k=6))) print("\n{}".format(Random_nums)) m=input("\n输入x,找出x元...
[ "random.choices" ]
[((233, 259), 'random.choices', 'random.choices', (['words'], {'k': '(6)'}), '(words, k=6)\n', (247, 259), False, 'import random, string\n')]
import json import pprint def parse(line): return line[4:12] def convert(file_path): font = json.load(open(file_path)) res = [[]] * 256 for i in range(0, 256): glyph = font.get(str(i), None) if glyph is None: res[i] = [0] * 8 else: res[i] = parse(glyph)...
[ "pprint.pformat" ]
[((375, 395), 'pprint.pformat', 'pprint.pformat', (['data'], {}), '(data)\n', (389, 395), False, 'import pprint\n')]
#!/usr/bin/env python3 """Simple plugin to allow testing while closing of HTLC is delayed. """ from pyln.client import Plugin import time plugin = Plugin() @plugin.hook('invoice_payment') def on_payment(payment, plugin, **kwargs): time.sleep(float(plugin.get_option('holdtime'))) return {'result': 'continue'...
[ "pyln.client.Plugin" ]
[((149, 157), 'pyln.client.Plugin', 'Plugin', ([], {}), '()\n', (155, 157), False, 'from pyln.client import Plugin\n')]
import configparser NOTFOUND = 404 def r(f_props,cfg=configparser.ConfigParser()): def add_header(props_file): yield '[{}]\n'.format('#') for line in props_file: yield line with open(f_props) as file: file = file.readlines() cfg.read_file(add_header(file), source=f_props) return cfg['#'] ...
[ "configparser.ConfigParser" ]
[((59, 86), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (84, 86), False, 'import configparser\n'), ((349, 376), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (374, 376), False, 'import configparser\n')]
# The MIT License (MIT) # # Copyright (c) 2014 <NAME> <<EMAIL>> # Copyright (c) 2015 <NAME> <<EMAIL>> # # 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 withou...
[ "bpy.context.scene.objects.link", "bpy.props.StringProperty", "bpy.utils.unregister_module", "bpy.data.objects.new", "bpy.data.images.load", "bpy.data.materials.new", "bmesh.new", "bpy.utils.register_module", "bpy.data.materials.get", "bpy.types.INFO_MT_file_import.remove", "bpy.types.INFO_MT_fi...
[((2037, 2048), 'bmesh.new', 'bmesh.new', ([], {}), '()\n', (2046, 2048), False, 'import bpy, bmesh\n'), ((5413, 5452), 'bpy.data.objects.new', 'bpy.data.objects.new', (['tmxLayer.name', 'me'], {}), '(tmxLayer.name, me)\n', (5433, 5452), False, 'import bpy, bmesh\n'), ((6736, 6787), 'bpy.props.StringProperty', 'StringP...
import cv2 import numpy as np def main(): #window_name="Cam feed" #cv2.namedWindow(window_name) cap=cv2.VideoCapture(0) #filename = 'F:\sample.avi' #codec=cv2.VideoWriter_fourcc('X','V','I','D') #framerate=30 #resolution = (500,500) # VideoFileOutput = cv2.VideoWriter(filename,codec...
[ "cv2.drawContours", "numpy.ones", "cv2.threshold", "cv2.imshow", "cv2.destroyAllWindows", "cv2.VideoCapture", "cv2.cvtColor", "cv2.findContours", "cv2.GaussianBlur", "cv2.waitKey", "cv2.absdiff" ]
[((114, 133), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (130, 133), False, 'import cv2\n'), ((1162, 1185), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (1183, 1185), False, 'import cv2\n'), ((594, 621), 'cv2.absdiff', 'cv2.absdiff', (['frame1', 'frame2'], {}), '(frame1, fram...
# -*- coding: utf-8 -*- # @Author: Clarence # @Date: 2018-08-11 17:24:59 # @Last Modified by: Clarence # @Last Modified time: 2018-08-12 01:32:56 import redis class TestList(object): """ lpush/rpush --从左/右插入数据 lrange --获取指定长度的数据 ltrim --截取一定长度的数据 lpop/rpop --移除最左/右的元素并返回 lpushx/rpushx --key存在的时候才插入数据,不存在时不做...
[ "redis.StrictRedis" ]
[((462, 514), 'redis.StrictRedis', 'redis.StrictRedis', ([], {'host': '"""localhost"""', 'port': '(6379)', 'db': '(0)'}), "(host='localhost', port=6379, db=0)\n", (479, 514), False, 'import redis\n')]
from django.shortcuts import render, redirect from django.http import HttpResponse from django.template import loader from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required from .forms import EmployeeCreationForm # Create your views here. def index_view...
[ "django.shortcuts.render", "django.shortcuts.redirect", "django.contrib.auth.decorators.login_required" ]
[((513, 542), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {'login_url': '"""/"""'}), "(login_url='/')\n", (527, 542), False, 'from django.contrib.auth.decorators import login_required\n'), ((1179, 1208), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {'login_url': '"...
import sys import pytest import asyncio import inspect import flask from flask import Blueprint from schematics.models import Model from schematics import types from collections import defaultdict from mock import patch, Mock, MagicMock from rest_helpers.flask import binding, routes, handle_async_route, responses fr...
[ "rest_helpers.flask.routes.route", "flask.Flask", "inspect.currentframe", "rest_helpers.flask.responses.ok", "rest_helpers.flask.binding.from_json_body", "rest_helpers.flask.binding.from_query_string", "collections.defaultdict", "flask.Blueprint" ]
[((405, 421), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (416, 421), False, 'from collections import defaultdict\n'), ((504, 535), 'flask.Blueprint', 'Blueprint', (['"""test_bp"""', '"""test_bp"""'], {}), "('test_bp', 'test_bp')\n", (513, 535), False, 'from flask import Blueprint\n'), ((542, 61...
# Generated by Django 2.2.6 on 2019-10-24 15:23 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('data_core', '0006_file_m...
[ "django.db.models.DateField", "django.db.models.ForeignKey", "django.db.models.AutoField", "django.db.models.DateTimeField", "django.db.migrations.swappable_dependency", "django.db.models.CharField" ]
[((227, 284), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (258, 284), False, 'from django.db import migrations, models\n'), ((485, 578), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)...
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- from __future__ import absolute_import import re import copy import json import hashlib from urllib.parse import urljoin, urlparse, parse_qs from operator import itemgetter from svtplay_dl.log import log from svtplay_dl.service im...
[ "svtplay_dl.utils.text.filenamify", "urllib.parse.urlparse", "svtplay_dl.error.ServiceError", "svtplay_dl.log.log.error", "urllib.parse.parse_qs", "urllib.parse.urljoin", "operator.itemgetter", "copy.copy", "re.search" ]
[((839, 857), 'urllib.parse.urlparse', 'urlparse', (['self.url'], {}), '(self.url)\n', (847, 857), False, 'from urllib.parse import urljoin, urlparse, parse_qs\n'), ((1185, 1206), 'urllib.parse.parse_qs', 'parse_qs', (['parse.query'], {}), '(parse.query)\n', (1193, 1206), False, 'from urllib.parse import urljoin, urlpa...
#!/usr/bin/env python from flask import Flask, jsonify, request, _app_ctx_stack from flask_restful import Resource, Api, reqparse from PIL import Image import argparse import io import os import sys import time import torch import torch.backends.cudnn as cudnn import torch.nn as nn from copper.model import Model fro...
[ "os.path.exists", "copper.model.Model.get_predictions", "argparse.ArgumentParser", "flask.Flask", "torch.nn.Sequential", "flask_restful.Api", "flask.jsonify", "io.BytesIO", "torch.cuda.set_device", "copper.model.Model.load", "torch.cuda.is_available", "torch.set_grad_enabled", "time.time", ...
[((2144, 2169), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2167, 2169), False, 'import argparse\n'), ((3477, 3500), 'copper.model.Model.load', 'Model.load', (['_args.model'], {}), '(_args.model)\n', (3487, 3500), False, 'from copper.model import Model\n'), ((3605, 3634), 'torch.set_grad_en...
"""Initial models. Revision ID: a2e0f8f4b344 Revises: Create Date: 2016-11-20 23:02:51.424015 """ # revision identifiers, used by Alembic. revision = '<KEY>' down_revision = None branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated b...
[ "sqlalchemy.ForeignKeyConstraint", "sqlalchemy.DateTime", "alembic.op.drop_table", "alembic.op.f", "sqlalchemy.LargeBinary", "sqlalchemy.PrimaryKeyConstraint", "sqlalchemy.Text", "sqlalchemy.Integer", "sqlalchemy.Boolean", "sqlalchemy.UniqueConstraint", "sqlalchemy.String", "sqlalchemy.Enum" ]
[((31276, 31312), 'alembic.op.drop_table', 'op.drop_table', (['"""diffissueoccurrence"""'], {}), "('diffissueoccurrence')\n", (31289, 31312), False, 'from alembic import op\n'), ((31926, 31959), 'alembic.op.drop_table', 'op.drop_table', (['"""difffilerevision"""'], {}), "('difffilerevision')\n", (31939, 31959), False, ...
# -*- coding: utf-8 -*- from collections import OrderedDict from threading import Lock from typing import Any, Callable, Dict, List, Optional, Set, Tuple class PyeeException(Exception): """An exception internal to pyee.""" class EventEmitter: """The base event emitter class. All other event emitters inheri...
[ "threading.Lock", "collections.OrderedDict" ]
[((1361, 1367), 'threading.Lock', 'Lock', ([], {}), '()\n', (1365, 1367), False, 'from threading import Lock\n'), ((3909, 3922), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (3920, 3922), False, 'from collections import OrderedDict\n'), ((7353, 7366), 'collections.OrderedDict', 'OrderedDict', ([], {}), '...
#!python3 """ A demo program for finding the fractional maximin (aka egalitarian) allocation. Author: <NAME> Since: 2021-05 """ import numpy as np from fairpy.items.leximin import leximin_optimal_allocation_for_families def leximin_utilities(v, families): z = leximin_optimal_allocation_for_families(v, families)...
[ "fairpy.items.leximin.leximin_optimal_allocation_for_families" ]
[((268, 320), 'fairpy.items.leximin.leximin_optimal_allocation_for_families', 'leximin_optimal_allocation_for_families', (['v', 'families'], {}), '(v, families)\n', (307, 320), False, 'from fairpy.items.leximin import leximin_optimal_allocation_for_families\n')]
import threading from unittest import TestCase from retry import retry from iexdata.stream import WebSocketClient, Channel class TestDeepStream(TestCase): def test_client(self): event1 = threading.Event() event2 = threading.Event() connected = threading.Event() disconnected = th...
[ "threading.Event", "retry.retry", "iexdata.stream.WebSocketClient" ]
[((203, 220), 'threading.Event', 'threading.Event', ([], {}), '()\n', (218, 220), False, 'import threading\n'), ((238, 255), 'threading.Event', 'threading.Event', ([], {}), '()\n', (253, 255), False, 'import threading\n'), ((277, 294), 'threading.Event', 'threading.Event', ([], {}), '()\n', (292, 294), False, 'import t...
from __future__ import annotations import os import textwrap import typing as t from dagos.platform.command_runner import CommandRunner class PackageManagerRegistry(type): """A metaclass responsible for registering supported package managers.""" managers: t.List[PackageManager] = [] def __call__(cls, ...
[ "textwrap.dedent", "os.getpid" ]
[((3897, 4019), 'textwrap.dedent', 'textwrap.dedent', (['f""" #!/bin/bash\n source $HOME/.sdkman/bin/sdkman-init.sh\n """'], {}), '(\n f""" #!/bin/bash\n source $HOME/.sdkman/bin/sdkman-init.sh\n """\n )\n', (3912, 4019), False, 'import textwrap\n'...
""" Run script to parse a vietnamese text - set variables DEBUG, PLOT, TEST based on your use case. - set variable file to the filename you want to analyze - Run: - Will create a report of distribution of sounds - Will plot if you set PLOT=True """ import numpy as np import time import os import ma...
[ "os.path.exists", "os.path.getsize", "matplotlib.pyplot.grid", "matplotlib.pyplot.xticks", "matplotlib.pyplot.ylabel", "numpy.arange", "matplotlib.pyplot.gca", "matplotlib.pyplot.xlabel", "numpy.sum", "matplotlib.pyplot.figure", "matplotlib.pyplot.bar", "numpy.array", "matplotlib.pyplot.titl...
[((1564, 1589), 'numpy.sum', 'np.sum', (['vowel_cnt'], {'axis': '(1)'}), '(vowel_cnt, axis=1)\n', (1570, 1589), True, 'import numpy as np\n'), ((1843, 1863), 'os.path.exists', 'os.path.exists', (['file'], {}), '(file)\n', (1857, 1863), False, 'import os\n'), ((1878, 1899), 'os.path.getsize', 'os.path.getsize', (['file'...
import os import numpy import cv2 import random import colorsys from Controller.nuclick.nuclick import gen_mask nuclei_annotation_data_root = "static/data/nuclei_annotation_data/" color = [[0, 128, 0, 0], [255, 0, 209, 128], [0, 255, 255, 128], [0, 0, 255, 128], [0, 0, 255, 128], [255, 191, 0, 128], [0, 0, 0...
[ "cv2.imwrite", "os.path.exists", "numpy.mean", "cv2.drawContours", "cv2.convertScaleAbs", "cv2.threshold", "colorsys.hls_to_rgb", "numpy.max", "numpy.array", "numpy.zeros", "numpy.argwhere", "random.random", "Controller.nuclick.nuclick.gen_mask", "numpy.savetxt", "numpy.loadtxt", "cv2....
[((2055, 2089), 'cv2.imread', 'cv2.imread', (['region_image_file_name'], {}), '(region_image_file_name)\n', (2065, 2089), False, 'import cv2\n'), ((2790, 2856), 'numpy.savetxt', 'numpy.savetxt', (['boundary_file_name', 'result'], {'fmt': '"""%d"""', 'delimiter': '""","""'}), "(boundary_file_name, result, fmt='%d', deli...
#Sources: #https://www.geeksforgeeks.org/reading-excel-file-using-python/ #https://developers.google.com/calendar/v3/reference from __future__ import print_function import sys import logging import os.path from os import path import gspread import tkinter as tk from tkinter import * from tkinter.filedialog import askop...
[ "logging.basicConfig", "os.path.exists", "tkinter.Entry", "gspread.authorize", "pickle.dump", "google.auth.transport.requests.Request", "datetime.datetime.strptime", "pickle.load", "tkinter.simpledialog.askstring", "tkinter.Radiobutton", "googleapiclient.discovery.build", "tkinter.Tk", "goog...
[((718, 781), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': 'LOG_FILENAME', 'level': 'logging.DEBUG'}), '(filename=LOG_FILENAME, level=logging.DEBUG)\n', (737, 781), False, 'import logging\n'), ((1174, 1181), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (1179, 1181), True, 'import tkinter as tk\n'), ((316...
import logging from functools import singledispatch import colorcet import numpy as np from matplotlib.lines import Line2D from mot.common.state import Gaussian from mot.simulator import MeasurementData, ObjectData from mot.utils.visualizer.common.plot_primitives import BasicPlotter CLUTTER_COLOR = colorcet.glasbey...
[ "logging.getLogger", "matplotlib.lines.Line2D", "mot.utils.visualizer.common.plot_primitives.BasicPlotter.plot_state", "mot.utils.visualizer.common.plot_primitives.BasicPlotter.plot_point" ]
[((495, 526), 'logging.getLogger', 'logging.getLogger', (['"""matplotlib"""'], {}), "('matplotlib')\n", (512, 526), False, 'import logging\n'), ((2988, 3065), 'matplotlib.lines.Line2D', 'Line2D', (['[0]', '[0]'], {'marker': 'CLUTTER_MARKER', 'color': 'CLUTTER_COLOR', 'label': '"""clutter"""'}), "([0], [0], marker=CLUTT...
import re result = 0 target = "" subs = {} flag = False with open("input.txt", "r") as input: for line in input: line = line.strip() if line == "": flag = True elif flag: target = line else: (a,b) = line.split(" => ") subs[b] = a min...
[ "re.sub", "re.findall", "re.compile" ]
[((414, 439), 're.compile', 're.compile', (['(molec + endre)'], {}), '(molec + endre)\n', (424, 439), False, 'import re\n'), ((510, 543), 're.findall', 're.findall', (['"""[A-Z][a-z]*"""', 'target'], {}), "('[A-Z][a-z]*', target)\n", (520, 543), False, 'import re\n'), ((992, 1018), 're.sub', 're.sub', (['"""#"""', 'mol...
# coding = utf-8 from __future__ import absolute_import import json import octoprint.plugin import requests # this will probably go away from .ServerLogic import ServerLogic class PrintFarmer(octoprint.plugin.AssetPlugin, octoprint.plugin.EventHandlerPlugin, octoprint.plugin.ProgressPlugin, ...
[ "json.dumps" ]
[((1384, 1406), 'json.dumps', 'json.dumps', (['completion'], {}), '(completion)\n', (1394, 1406), False, 'import json\n')]
import re from flask import abort from .validation import get_validation_errors def validate_framework_agreement_details_data(framework_agreement_details, enforce_required=True, required_fields=None): errs = get_validation_errors( 'framework-agreement-details', framework_agreement_details, ...
[ "flask.abort" ]
[((425, 441), 'flask.abort', 'abort', (['(400)', 'errs'], {}), '(400, errs)\n', (430, 441), False, 'from flask import abort\n')]
import numpy as np import matplotlib.pyplot as plt import os import trimesh from mpl_toolkits.mplot3d import axes3d import time, warnings from skimage import measure import random from sympy import sympify warnings.filterwarnings("ignore") class SingleFormulaBasedMaterial: def __gyroid(self): ...
[ "trimesh.smoothing.filter_humphrey", "matplotlib.pyplot.imshow", "argparse.ArgumentParser", "sympy.sympify", "numpy.meshgrid", "matplotlib.pyplot.axis", "sympy.utilities.lambdify.lambdify", "random.choice", "trimesh.base.Trimesh", "trimesh.voxel.ops.matrix_to_marching_cubes", "numpy.logical_xor"...
[((209, 242), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (232, 242), False, 'import time, warnings\n'), ((996, 1019), 'sympy.sympify', 'sympify', (['self.__formula'], {}), '(self.__formula)\n', (1003, 1019), False, 'from sympy import sympify\n'), ((1124, 1155), 'sympy....
import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt; plt def simplify_borders(ax): ax.yaxis.set_ticks_position('left') ax.xaxis.set_ticks_position('bottom') ax.spines['right'].set_visible(False) ax.spines['top'].set_visible(False) ax.tick_params(direction='out')
[ "matplotlib.use" ]
[((25, 39), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (32, 39), True, 'import matplotlib as mpl\n')]
#!/usr/bin/env python3 import os, sys, glob, time import subprocess import argparse import pathlib parser = argparse.ArgumentParser() parser.add_argument("--optimize") # i.e. "-O3" parser.add_argument("--flags", default="") parser.add_argument("input") parser.add_argument("output") args = parser.parse_args() #pri...
[ "subprocess.check_output", "argparse.ArgumentParser", "pathlib.Path", "os.path.join", "os.path.splitext", "os.path.basename" ]
[((110, 135), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (133, 135), False, 'import argparse\n'), ((475, 541), 'subprocess.check_output', 'subprocess.check_output', (['cmd'], {'stderr': 'subprocess.STDOUT', 'shell': '(True)'}), '(cmd, stderr=subprocess.STDOUT, shell=True)\n', (498, 541), Fa...
""" create_sample ------------- Samples a set of entities from the (raw) DBpedia collection. Usage: nordlys.data.dbpedia.create_sample <path_to_dbpedia> <entities_file> <output_dir> - path_to_dbpedia_dump: path to DBpedia dump (e.g., .../dbpedia-2015-10) - entities_file: file with the set of entities to be incl...
[ "os.path.exists", "argparse.ArgumentParser", "os.makedirs", "os.path.join", "nordlys.core.utils.file_utils.FileUtils.read_file_as_list", "nordlys.core.utils.file_utils.FileUtils.open_file_by_type", "rdflib.plugins.parsers.ntriples.NTriplesParser", "nordlys.core.storage.nt2mongo.Triple", "nordlys.cor...
[((3509, 3534), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (3532, 3534), False, 'import argparse\n'), ((1085, 1096), 'nordlys.core.storage.parser.uri_prefix.URIPrefix', 'URIPrefix', ([], {}), '()\n', (1094, 1096), False, 'from nordlys.core.storage.parser.uri_prefix import URIPrefix\n'), ((1...
import requests from fake_useragent import UserAgent jar = requests.cookies.RequestsCookieJar() def get_HTML(url): global jar try: result = requests.get(url , headers={'User-Agent': UserAgent().chrome}, cookies=jar) result.raise_for_status() result.encoding = "utf8" jar = resul...
[ "requests.cookies.RequestsCookieJar", "fake_useragent.UserAgent" ]
[((60, 96), 'requests.cookies.RequestsCookieJar', 'requests.cookies.RequestsCookieJar', ([], {}), '()\n', (94, 96), False, 'import requests\n'), ((200, 211), 'fake_useragent.UserAgent', 'UserAgent', ([], {}), '()\n', (209, 211), False, 'from fake_useragent import UserAgent\n')]
import sys from datetime import datetime from jinja2.loaders import FileSystemLoader from typing import Dict, Any, List from pdb import set_trace import toml from jinja2 import Environment def usage(): print("""python render.py FILENAME""") quit() def content_or_blank(local_config:Dict[str, Any], keys:List...
[ "datetime.datetime.now", "jinja2.loaders.FileSystemLoader", "toml.load" ]
[((943, 965), 'toml.load', 'toml.load', (['config_file'], {}), '(config_file)\n', (952, 965), False, 'import toml\n'), ((1058, 1087), 'jinja2.loaders.FileSystemLoader', 'FileSystemLoader', (['"""templates"""'], {}), "('templates')\n", (1074, 1087), False, 'from jinja2.loaders import FileSystemLoader\n'), ((992, 1006), ...
#!/usr/bin/env python3 # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
[ "subprocess.run" ]
[((1978, 2069), 'subprocess.run', 'subprocess.run', (["('doveadm', 'user', '*')"], {'check': '(True)', 'stdout': 'subprocess.PIPE', 'text': '(True)'}), "(('doveadm', 'user', '*'), check=True, stdout=subprocess.PIPE,\n text=True)\n", (1992, 2069), False, 'import subprocess\n'), ((2427, 2564), 'subprocess.run', 'subpr...
import os DEBUG = int(os.environ.get("DEBUG", 1)) PROJECT_ROOT = os.path.dirname(os.path.realpath(__file__)) GRAYLOG_LOGGING = int(os.environ.get("GRAYLOG_LOGGING", 0)) # ================================= # SCHEDULER SETTINGS # ================================= SCHEDULER_MINUTES = os.environ.get("SCHEDULER_MINUTES", ...
[ "os.path.realpath", "os.environ.get" ]
[((284, 323), 'os.environ.get', 'os.environ.get', (['"""SCHEDULER_MINUTES"""', '(30)'], {}), "('SCHEDULER_MINUTES', 30)\n", (298, 323), False, 'import os\n'), ((1390, 1431), 'os.environ.get', 'os.environ.get', (['"""OSM_IP"""', '"""192.168.1.175"""'], {}), "('OSM_IP', '192.168.1.175')\n", (1404, 1431), False, 'import o...
#!/usr/bin/env python3 from distutils.core import setup setup(name='flask-mediabrowser', version='0.0.1', description='HTTP media browsing and streaming/transcoding', author='<NAME>', author_email='<EMAIL>', url='https://www.xapek.org/git/yvesf/flask-mediabrowser', packages=['media...
[ "distutils.core.setup" ]
[((58, 413), 'distutils.core.setup', 'setup', ([], {'name': '"""flask-mediabrowser"""', 'version': '"""0.0.1"""', 'description': '"""HTTP media browsing and streaming/transcoding"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https://www.xapek.org/git/yvesf/flask-mediabrowser"""', 'packages'...
#!/usr/bin/env python # # Generated Sun Mar 20 18:06:44 2011 by parse_xsd.py version 0.4. # import saml2_tophat from saml2_tophat import SamlBase from saml2_tophat import xmldsig as ds NAMESPACE = 'urn:mace:shibboleth:metadata:1.0' class Scope(SamlBase): """The urn:mace:shibboleth:metadata:1.0:Scope element ""...
[ "saml2_tophat.SamlBase.c_children.copy", "saml2_tophat.SamlBase.c_cardinality.copy", "saml2_tophat.create_class_from_xml_string", "saml2_tophat.SamlBase.c_attributes.copy", "saml2_tophat.SamlBase.__init__" ]
[((426, 452), 'saml2_tophat.SamlBase.c_children.copy', 'SamlBase.c_children.copy', ([], {}), '()\n', (450, 452), False, 'from saml2_tophat import SamlBase\n'), ((472, 500), 'saml2_tophat.SamlBase.c_attributes.copy', 'SamlBase.c_attributes.copy', ([], {}), '()\n', (498, 500), False, 'from saml2_tophat import SamlBase\n'...
# Generated by Django 2.2.1 on 2020-07-27 14:21 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tracker', '0004_keyvaluestore'), ] operations = [ migrations.AddField( model_name='taskentry', name='sw_version', ...
[ "django.db.models.CharField" ]
[((336, 391), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(100)', 'null': '(True)'}), '(blank=True, max_length=100, null=True)\n', (352, 391), False, 'from django.db import migrations, models\n')]
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import json import frappe from frappe.utils import cint, flt, nowdate, add_days, getdate, fmt_money from frappe import _ from ...
[ "frappe.defaults.get_global_default", "frappe._dict", "dateutil.relativedelta.relativedelta", "frappe.get_doc", "frappe.db.get_value", "frappe.db.sql", "frappe.utils.cint", "frappe.utils.flt", "frappe.new_doc", "json.loads", "frappe.get_value", "frappe.whitelist", "frappe.msgprint", "frapp...
[((553, 587), 'frappe.whitelist', 'frappe.whitelist', ([], {'allow_guest': '(True)'}), '(allow_guest=True)\n', (569, 587), False, 'import frappe\n'), ((1089, 1123), 'frappe.whitelist', 'frappe.whitelist', ([], {'allow_guest': '(True)'}), '(allow_guest=True)\n', (1105, 1123), False, 'import frappe\n'), ((16841, 16859), ...
import torch # tempo imports from . import compute_cell_posterior from . import utils from . import cell_posterior from . import objective_functions class ClockGenePosterior(torch.nn.Module): def __init__(self,gene_param_dict,gene_prior_dict,num_grid_points,clock_indices,use_nb=False,log_mean_log_disp_coef=No...
[ "torch.mean", "torch.atan2", "torch.sum" ]
[((1511, 1580), 'torch.atan2', 'torch.atan2', (['phi_euclid_sampled[:, :, 1]', 'phi_euclid_sampled[:, :, 0]'], {}), '(phi_euclid_sampled[:, :, 1], phi_euclid_sampled[:, :, 0])\n', (1522, 1580), False, 'import torch\n'), ((4799, 4824), 'torch.mean', 'torch.mean', (['cycler_mc_lls'], {}), '(cycler_mc_lls)\n', (4809, 4824...
import glob import os import time from random import randint from PIL import Image def getNewRandomIndex(max, currentIndices): if max < len(currentIndices): num = 0 else: num = randint(0, max) while currentIndices.count(num): num = randint(0, max) return num def gen...
[ "os.path.exists", "PIL.Image.open", "os.makedirs", "PIL.Image.new", "time.strftime", "os.path.dirname", "random.randint", "glob.glob" ]
[((2453, 2478), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (2468, 2478), False, 'import os\n'), ((2673, 2705), 'glob.glob', 'glob.glob', (["(srcBackgrounds + '/*')"], {}), "(srcBackgrounds + '/*')\n", (2682, 2705), False, 'import glob\n'), ((2723, 2750), 'glob.glob', 'glob.glob', (["(srcI...
# -*- coding: utf-8 -*- """ Created on Tue Jun 15 18:53:22 2021 @author: <NAME> """ import argparse import numpy as np from zdm import zdm #import pcosmic import matplotlib.pyplot as plt import matplotlib.colors as colors import matplotlib.cm as cm from scipy import interpolate import matplotlib from pkg_resources im...
[ "numpy.log10", "matplotlib.pyplot.ylabel", "zdm.misc_functions.get_zdm_grid", "numpy.array", "time.process_time", "zdm.iteration.calc_likelihoods_2D", "numpy.arange", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.close", "numpy.linspace", "scipy.interpolate.splev", ...
[((621, 647), 'numpy.seterr', 'np.seterr', ([], {'divide': '"""ignore"""'}), "(divide='ignore')\n", (630, 647), True, 'import numpy as np\n'), ((723, 750), 'zdm.cosmology.set_cosmology', 'cos.set_cosmology', ([], {'H0': 'setH0'}), '(H0=setH0)\n', (740, 750), True, 'from zdm import cosmology as cos\n'), ((810, 888), 'zd...
""" Linux traits implementations """ from __future__ import absolute_import, unicode_literals import os import sugar.utils.files def get_machine_id(): """ Get machine ID :return: string of the machine ID """ ret = None for loc in [loc for loc in ['/etc/machine-id', '/var/lib/dbus/machine-id']...
[ "os.path.exists" ]
[((324, 343), 'os.path.exists', 'os.path.exists', (['loc'], {}), '(loc)\n', (338, 343), False, 'import os\n')]
import torch import ipdb from copy import deepcopy import random def modify_sentence(ids, min_change=2, prob=0.1, k=2): def _random_deletion(rids): num_deletion = max(min_change, int(prob*len(rids))) delete_idx = random.sample(range(len(rids)), num_deletion) n_ids = [rids[i] for i in range...
[ "random.sample", "random.choice", "random.shuffle", "random.random", "torch.cuda.is_available", "copy.deepcopy", "torch.zeros_like" ]
[((3446, 3467), 'torch.zeros_like', 'torch.zeros_like', (['ids'], {}), '(ids)\n', (3462, 3467), False, 'import torch\n'), ((4256, 4289), 'random.sample', 'random.sample', (['mask_pos', 'num_mask'], {}), '(mask_pos, num_mask)\n', (4269, 4289), False, 'import random\n'), ((5455, 5492), 'random.sample', 'random.sample', (...
import numpy as np def point_dist(a, b): return np.sqrt(np.sum(np.square(a-b))) def point_center(a, b): return (a+b)/2 def face_sz(l_eye, r_eye, mouse): return point_dist(mouse, point_center(l_eye, r_eye)) def face_bbox(l_eye, r_eye, mouse): sz = face_sz(l_eye, r_eye, mouse) center = poi...
[ "numpy.square" ]
[((68, 84), 'numpy.square', 'np.square', (['(a - b)'], {}), '(a - b)\n', (77, 84), True, 'import numpy as np\n')]
""" Created on May 4 2020 @author: <NAME> """ from argparse import ArgumentParser from retropath2_wrapper._version import __version__ def build_args_parser(): parser = ArgumentParser(prog='retropath2_wrapper', description='Python wrapper to parse RP2 to generate rpSBML collection of unique and complete (cofact...
[ "argparse.ArgumentParser" ]
[((177, 345), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'prog': '"""retropath2_wrapper"""', 'description': '"""Python wrapper to parse RP2 to generate rpSBML collection of unique and complete (cofactors) pathways"""'}), "(prog='retropath2_wrapper', description=\n 'Python wrapper to parse RP2 to generate rpS...
import numpy as np import tflearn import sys # Load CSV file # For some reason, the CSV must have a single label column. So the dataset has a last dummy column. from tflearn.data_utils import load_csv input_data, dummy = load_csv("data.csv", columns_to_ignore=[5, 6, 7, 8]) input_labels, dummy = load_csv("data.csv", co...
[ "tflearn.DNN", "sys.stdin.readline", "numpy.array", "tflearn.data_utils.load_csv", "tflearn.regression", "tflearn.fully_connected", "tflearn.input_data" ]
[((222, 274), 'tflearn.data_utils.load_csv', 'load_csv', (['"""data.csv"""'], {'columns_to_ignore': '[5, 6, 7, 8]'}), "('data.csv', columns_to_ignore=[5, 6, 7, 8])\n", (230, 274), False, 'from tflearn.data_utils import load_csv\n'), ((297, 349), 'tflearn.data_utils.load_csv', 'load_csv', (['"""data.csv"""'], {'columns_...
# Copyright (c) 2021 Massachusetts Institute of Technology # SPDX-License-Identifier: MIT from pathlib import Path from typing import Any, Callable, List, Mapping, Optional, Union from hydra._internal.callbacks import Callbacks from hydra._internal.hydra import Hydra from hydra._internal.utils import create_config_sea...
[ "hydra.types.HydraContext", "pathlib.Path", "hydra._internal.utils.create_config_search_path", "omegaconf.OmegaConf.to_container", "hydra.core.config_store.ConfigStore", "hydra._internal.hydra.Hydra.create_main_hydra2", "hydra._internal.callbacks.Callbacks", "hydra.core.global_hydra.GlobalHydra.instan...
[((5549, 5586), 'hydra._internal.utils.create_config_search_path', 'create_config_search_path', (['config_dir'], {}), '(config_dir)\n', (5574, 5586), False, 'from hydra._internal.utils import create_config_search_path\n'), ((5600, 5676), 'hydra._internal.hydra.Hydra.create_main_hydra2', 'Hydra.create_main_hydra2', ([],...
from pyxdsm.XDSM import XDSM # opt = 'Optimization' solver = 'MDA' comp = 'ImplicitAnalysis' group = 'Metamodel' func = 'Function' x = XDSM() x.add_system('dv', func, (r'x=1', r'\text{Design Variable}')) x.add_system('d1', func, (r'y_1=y_2^2', r'\text{Discipline 1}')) x.add_system('d2', comp, (r'\exp(-y_1 y_2) - x y...
[ "pyxdsm.XDSM.XDSM" ]
[((137, 143), 'pyxdsm.XDSM.XDSM', 'XDSM', ([], {}), '()\n', (141, 143), False, 'from pyxdsm.XDSM import XDSM\n')]
from ..help import add_help_item from userbot.events import register @register(outgoing=True, pattern=r"^\.sd ([0-9]+) ([\S\s]+)") async def selfdestruct(destroy): """ For .sd command, make self-destructable messages. """ seconds = int(destroy.pattern_match.group(1)) text = str(destroy.pattern_match.group...
[ "userbot.events.register" ]
[((72, 134), 'userbot.events.register', 'register', ([], {'outgoing': '(True)', 'pattern': '"""^\\\\.sd ([0-9]+) ([\\\\S\\\\s]+)"""'}), "(outgoing=True, pattern='^\\\\.sd ([0-9]+) ([\\\\S\\\\s]+)')\n", (80, 134), False, 'from userbot.events import register\n')]
import os def prepare_videos( videos, extension, start, duration, kinect_mask=True, width=1920, height=1080 ): video_start_secs = start % 60 video_start_mins = start // 60 print(f"Dumping frames and segmenting {len(videos)} input videos") for i, video in enumerate(videos): try: ...
[ "os.system", "os.makedirs" ]
[((585, 819), 'os.system', 'os.system', (['f"""ffmpeg -y -ss 00:{video_start_mins:02}:{video_start_secs:02}.000 -vsync 0 -i {video}{extension} -vf scale={width}:{height} -map 0:0 {ffmpeg_duration} {video}/%04d_img.png -hide_banner > bg_matting_logs.txt 2>&1"""'], {}), "(\n f'ffmpeg -y -ss 00:{video_start_mins:02}:{v...
import numpy as np import os import subprocess import trimesh import src.utils.geometry as geometry import src.utils.scannet_helper as scannet_helper with open("/home/kejie/Datasets/ScanNet/server/Data/ScanNet/ScanNet/Tasks/Benchmark/scannetv2_val.txt", "r") as f: sequences = f.read().splitlines() sequences = so...
[ "subprocess.run", "pdb.set_trace" ]
[((1421, 1457), 'subprocess.run', 'subprocess.run', (['commands'], {'check': '(True)'}), '(commands, check=True)\n', (1435, 1457), False, 'import subprocess\n'), ((2935, 2971), 'subprocess.run', 'subprocess.run', (['commands'], {'check': '(True)'}), '(commands, check=True)\n', (2949, 2971), False, 'import subprocess\n'...
#!/usr/bin/env python import os import sys from twit.wsgi import application WSGI_APPLICATION = 'twit.wsgi.application' if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "twit.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys...
[ "os.environ.setdefault", "django.core.management.execute_from_command_line" ]
[((155, 219), 'os.environ.setdefault', 'os.environ.setdefault', (['"""DJANGO_SETTINGS_MODULE"""', '"""twit.settings"""'], {}), "('DJANGO_SETTINGS_MODULE', 'twit.settings')\n", (176, 219), False, 'import os\n'), ((291, 326), 'django.core.management.execute_from_command_line', 'execute_from_command_line', (['sys.argv'], ...
from collections import defaultdict class Graph: def __init__(self,V,directed=False): self.V = V self.directed = directed self.graph = defaultdict(list) def add_edge(self,a,b): self.graph[a].append(b) if not self.directed: self.graph[b].append(a) def color_greedy(self): result = [-1]*self.V ...
[ "collections.defaultdict" ]
[((145, 162), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (156, 162), False, 'from collections import defaultdict\n')]
import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output import dash_katex import numpy as np import plotly.express as px from scipy import stats from app import app layout = html.Div([ dash_katex.DashKatex( expression=r'f_X(x) = \frac{1}{b - a}'...
[ "dash.dependencies.Output", "dash.dependencies.Input", "plotly.express.line", "numpy.linspace", "scipy.stats.uniform.pdf", "dash_katex.DashKatex", "dash_core_components.Graph" ]
[((853, 876), 'numpy.linspace', 'np.linspace', (['a', 'b', '(1000)'], {}), '(a, b, 1000)\n', (864, 876), True, 'import numpy as np\n'), ((885, 915), 'scipy.stats.uniform.pdf', 'stats.uniform.pdf', (['x', 'a', '(b - a)'], {}), '(x, a, b - a)\n', (902, 915), False, 'from scipy import stats\n'), ((994, 1045), 'plotly.expr...