code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
# -*- coding: utf-8 -*- # Copyright 2018 <NAME> & <NAME>. 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 # #...
[ "numpy.array", "numpy.log" ]
[((888, 901), 'numpy.array', 'np.array', (['out'], {}), '(out)\n', (896, 901), True, 'import numpy as np\n'), ((903, 918), 'numpy.array', 'np.array', (['label'], {}), '(label)\n', (911, 918), True, 'import numpy as np\n'), ((1551, 1564), 'numpy.array', 'np.array', (['out'], {}), '(out)\n', (1559, 1564), True, 'import n...
import unittest import prody import numpy as np import pytest import itertools from path import Path from ..mhc_peptide import BasePDB from ..sampling.generate_peptides import PeptideSampler from .. import utils from ..helpers import isolate, isolated_filesystem @pytest.fixture() def default_mhc(): return utils...
[ "pytest.fixture", "pytest.mark.parametrize", "itertools.product", "pytest.raises" ]
[((268, 284), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (282, 284), False, 'import pytest\n'), ((350, 366), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (364, 366), False, 'import pytest\n'), ((1706, 1768), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""nsamples"""', '[1, 10, 100, 1000...
#!/usr/bin/env python from __future__ import division, print_function try: range = xrange except NameError: pass import os import sys import h5py import json import time import numpy import ctypes import signal import logging import argparse import threading from functools import reduce from datetime impo...
[ "logging.getLogger", "datetime.datetime.utcfromtimestamp", "logging.StreamHandler", "numpy.sqrt", "bifrost.packet_capture.PacketCaptureCallback", "numpy.log10", "bifrost.affinity.get_core", "ctypes.create_string_buffer", "time.sleep", "numpy.isfinite", "datetime.timedelta", "mnc.mcs.Client", ...
[((1240, 1261), 'operations.FileOperationsQueue', 'FileOperationsQueue', ([], {}), '()\n', (1259, 1261), False, 'from operations import FileOperationsQueue\n'), ((1203, 1228), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (1218, 1228), False, 'import os\n'), ((30595, 30682), 'argparse.Argume...
# Copyright 2017, <NAME>, All rights reserved. import json from common import overrides, Constants, Persist, PersistError class ControllerPersist(Persist): """ Persisting state for controller """ # Keys __KEY_DOWNLOADED_FILE_NAMES = "downloaded" __KEY_EXTRACTED_FILE_NAMES = "extracted" ...
[ "json.loads", "json.dumps", "common.overrides" ]
[((449, 467), 'common.overrides', 'overrides', (['Persist'], {}), '(Persist)\n', (458, 467), False, 'from common import overrides, Constants, Persist, PersistError\n'), ((1068, 1086), 'common.overrides', 'overrides', (['Persist'], {}), '(Persist)\n', (1077, 1086), False, 'from common import overrides, Constants, Persis...
import copy import numpy as np import pandas as pd import os import contextlib from sklearn.metrics import f1_score, accuracy_score from sklearn.model_selection import StratifiedKFold from sklearn.linear_model import LogisticRegression from sklearn.pipeline import make_pipeline from sklearn.preprocessing import Standa...
[ "contextlib.redirect_stdout", "sklearn.metrics.f1_score", "numpy.where", "sklearn.linear_model.LogisticRegression", "sklearn.model_selection.StratifiedKFold", "sklearn.preprocessing.StandardScaler", "numpy.zeros", "numpy.empty", "copy.deepcopy", "pandas.DataFrame", "sklearn.metrics.accuracy_scor...
[((358, 423), 'sklearn.model_selection.StratifiedKFold', 'StratifiedKFold', ([], {'n_splits': 'NFOLDS', 'shuffle': '(True)', 'random_state': 'SEED'}), '(n_splits=NFOLDS, shuffle=True, random_state=SEED)\n', (373, 423), False, 'from sklearn.model_selection import StratifiedKFold\n'), ((559, 586), 'numpy.where', 'np.wher...
import cv2 import sys import json import numpy as np from matplotlib import pyplot as plt shape='n/aaaa' imgPath="C:\\xampp\\htdocs\\projektmunka\\python\\haromszog.png" #imgPath=sys.argv[1] img = cv2.imread(imgPath, cv2.IMREAD_GRAYSCALE) _, threshold = cv2.threshold(img, 240, 255, cv2.THRESH_BINARY) contours, _ = cv2...
[ "cv2.drawContours", "cv2.threshold", "cv2.arcLength", "cv2.findContours", "cv2.imread" ]
[((198, 239), 'cv2.imread', 'cv2.imread', (['imgPath', 'cv2.IMREAD_GRAYSCALE'], {}), '(imgPath, cv2.IMREAD_GRAYSCALE)\n', (208, 239), False, 'import cv2\n'), ((255, 302), 'cv2.threshold', 'cv2.threshold', (['img', '(240)', '(255)', 'cv2.THRESH_BINARY'], {}), '(img, 240, 255, cv2.THRESH_BINARY)\n', (268, 302), False, 'i...
import aoareader as reader import torch import time import argparse import os from preprocess import get_stories, vectorize_stories parser = argparse.ArgumentParser(description="test.py") parser.add_argument('-testdata', default='data/test.txt.pt', help='Path to the test.txt.pt, test.txt.pt will...
[ "os.path.exists", "argparse.ArgumentParser", "aoareader.Dataset", "torch.load", "preprocess.vectorize_stories", "aoareader.AoAReader", "torch.save", "preprocess.get_stories", "torch.cuda.set_device" ]
[((144, 190), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""test.py"""'}), "(description='test.py')\n", (167, 190), False, 'import argparse\n'), ((777, 809), 'os.path.exists', 'os.path.exists', (["(testfile + '.pt')"], {}), "(testfile + '.pt')\n", (791, 809), False, 'import os\n'), ((23...
from django.contrib import admin from .models import Report @admin.register(Report) class ReportAdmin(admin.ModelAdmin): list_display = ['project_name','contractor_name', 'done_on'] search_fields = ['project_name','contractor_name']
[ "django.contrib.admin.register" ]
[((62, 84), 'django.contrib.admin.register', 'admin.register', (['Report'], {}), '(Report)\n', (76, 84), False, 'from django.contrib import admin\n')]
from abc import abstractmethod from dataclasses import dataclass from typing import Any class Spec: @abstractmethod def passes(self, candidate: Any) -> bool: raise NotImplementedError() def __call__(self, candidate: Any) -> bool: return self.passes(candidate) def __and__(self, other:...
[ "dataclasses.dataclass" ]
[((509, 531), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (518, 531), False, 'from dataclasses import dataclass\n'), ((710, 732), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (719, 732), False, 'from dataclasses import dataclass\n'), ((909...
from os import getenv, \ path from time import time from datetime import timedelta class Config(object): AWS_ACCESS_KEY_ID = getenv('AWS_ACCESS_KEY_ID') AWS_REGION = getenv('AWS_REGION') AWS_S3_BUCKET = getenv('AWS_S3_BUCKET') AWS_SECRET_ACCESS_KEY = getenv('AWS_SECRET_ACCESS_KEY') C...
[ "os.path.dirname", "datetime.timedelta", "time.time", "os.getenv" ]
[((145, 172), 'os.getenv', 'getenv', (['"""AWS_ACCESS_KEY_ID"""'], {}), "('AWS_ACCESS_KEY_ID')\n", (151, 172), False, 'from os import getenv, path\n'), ((190, 210), 'os.getenv', 'getenv', (['"""AWS_REGION"""'], {}), "('AWS_REGION')\n", (196, 210), False, 'from os import getenv, path\n'), ((231, 254), 'os.getenv', 'gete...
from ConnectFour import ConnectFour import pytest def test_empty_cell(): my = ConnectFour.Game() assert not my.check_for_win(2, 2) def test_diagonal_win(): # positive slope my = ConnectFour.Game() my.move(1) # X my.move(2) # Y my.move(2) # YX my.move(3) # Y my.m...
[ "ConnectFour.ConnectFour.Game" ]
[((89, 107), 'ConnectFour.ConnectFour.Game', 'ConnectFour.Game', ([], {}), '()\n', (105, 107), False, 'from ConnectFour import ConnectFour\n'), ((207, 225), 'ConnectFour.ConnectFour.Game', 'ConnectFour.Game', ([], {}), '()\n', (223, 225), False, 'from ConnectFour import ConnectFour\n'), ((893, 911), 'ConnectFour.Connec...
#coding:UTF-8 import os import discord from discord.ext import tasks from datetime import datetime token = os.environ['DISCORD_BOT_TOKEN'] #トークン channel_id = os.environ['CHANNEL_ID'] #チャンネルID # 接続に必要なオブジェクトを生成 client = discord.Client() @tasks.loop(seconds=60) async def loop(): print(datetime.now().strftime("%Y/%...
[ "discord.Client", "datetime.datetime.now", "discord.ext.tasks.loop" ]
[((221, 237), 'discord.Client', 'discord.Client', ([], {}), '()\n', (235, 237), False, 'import discord\n'), ((240, 262), 'discord.ext.tasks.loop', 'tasks.loop', ([], {'seconds': '(60)'}), '(seconds=60)\n', (250, 262), False, 'from discord.ext import tasks\n'), ((291, 305), 'datetime.datetime.now', 'datetime.now', ([], ...
import os import sys # from lmdb.cffi import version as ver sys.path.append(os.getcwd()) import torch from iqra.models.crnn import * from iqra.modules.feature import * if __name__ == '__main__': image_data = torch.rand(3,1,224,224) text_data = torch.rand(3,512).long() # text_data = torch.LongTensor(text...
[ "torch.rand", "os.getcwd" ]
[((76, 87), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (85, 87), False, 'import os\n'), ((216, 242), 'torch.rand', 'torch.rand', (['(3)', '(1)', '(224)', '(224)'], {}), '(3, 1, 224, 224)\n', (226, 242), False, 'import torch\n'), ((256, 274), 'torch.rand', 'torch.rand', (['(3)', '(512)'], {}), '(3, 512)\n', (266, 274),...
import numpy as np import yt from matplotlib import rc fsize = 17 rc('text', usetex=False) rc('font', size=fsize)#, ftype=42) line_width = 3 point_size = 30 import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt from galaxy_analysis.particle_analysis import particle_types as pdef def plot_dtd(ds): ...
[ "matplotlib.use", "galaxy_analysis.particle_analysis.particle_types.snIa", "matplotlib.pyplot.minorticks_on", "matplotlib.pyplot.close", "numpy.array", "galaxy_analysis.particle_analysis.particle_types.white_dwarfs", "yt.load", "matplotlib.rc", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot....
[((66, 90), 'matplotlib.rc', 'rc', (['"""text"""'], {'usetex': '(False)'}), "('text', usetex=False)\n", (68, 90), False, 'from matplotlib import rc\n'), ((91, 113), 'matplotlib.rc', 'rc', (['"""font"""'], {'size': 'fsize'}), "('font', size=fsize)\n", (93, 113), False, 'from matplotlib import rc\n'), ((182, 196), 'matpl...
from flask_wtf import FlaskForm from wtforms import IntegerField from wtforms.validators import DataRequired class ClusterSetupForm(FlaskForm): clusters = IntegerField('Clusters', validators=[DataRequired()]) replicas = IntegerField('Replicas', validators=[DataRequired()])
[ "wtforms.validators.DataRequired" ]
[((198, 212), 'wtforms.validators.DataRequired', 'DataRequired', ([], {}), '()\n', (210, 212), False, 'from wtforms.validators import DataRequired\n'), ((267, 281), 'wtforms.validators.DataRequired', 'DataRequired', ([], {}), '()\n', (279, 281), False, 'from wtforms.validators import DataRequired\n')]
#!/usr/bin/env python3 # Tool that dumps all the (ids, titles, urls) of SimpleWiki articles into a pickle file. It reads this information from the output of the WikiExtraction parser [1] # [1]: https://github.com/attardi/wikiextractor import argparse import os import random import pickle from lxml import etree if __n...
[ "random.shuffle", "argparse.ArgumentParser", "os.path.join", "lxml.etree.XMLParser", "lxml.etree.fromstring", "os.walk" ]
[((351, 376), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (374, 376), False, 'import argparse\n'), ((866, 895), 'lxml.etree.XMLParser', 'etree.XMLParser', ([], {'recover': '(True)'}), '(recover=True)\n', (881, 895), False, 'from lxml import etree\n'), ((1167, 1194), 'random.shuffle', 'random...
# UNUSED from django.contrib.auth.tokens import PasswordResetTokenGenerator from six import text_type class TokenGenerator(PasswordResetTokenGenerator): def _make_hash_value(self, appointment, timestamp): return (text_type(appointment.volunteer)+text_type(appointment.pk)+text_type(timestamp)) # ret...
[ "six.text_type" ]
[((285, 305), 'six.text_type', 'text_type', (['timestamp'], {}), '(timestamp)\n', (294, 305), False, 'from six import text_type\n'), ((226, 258), 'six.text_type', 'text_type', (['appointment.volunteer'], {}), '(appointment.volunteer)\n', (235, 258), False, 'from six import text_type\n'), ((259, 284), 'six.text_type', '...
"""Tests cac.models.classification.ClassificationModel""" import os from os.path import dirname, join, exists from copy import deepcopy import torch import wandb import unittest from tqdm import tqdm import numpy as np from torch import optim from cac.config import Config from cac.utils.logger import set_logger, color ...
[ "numpy.unique", "numpy.sort", "os.path.join", "numpy.array", "torch.cuda.is_available", "copy.deepcopy", "unittest.main", "cac.models.classification.ClassificationModel", "cac.config.Config" ]
[((3251, 3266), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3264, 3266), False, 'import unittest\n'), ((587, 602), 'cac.config.Config', 'Config', (['version'], {}), '(version)\n', (593, 602), False, 'from cac.config import Config\n'), ((1202, 1220), 'copy.deepcopy', 'deepcopy', (['self.cfg'], {}), '(self.cfg)\...
import random from time import sleep from selenium import webdriver # Instancio el driver de selenium que va a controlar el navegador # A partir de este objeto voy a realizar el web scraping e interacciones driver = webdriver.Chrome(r"C:\Users\rburi\AppData\Local\Programs\Python\Python39\Proyectos\Scraping_Project\chr...
[ "selenium.webdriver.Chrome", "random.uniform" ]
[((217, 354), 'selenium.webdriver.Chrome', 'webdriver.Chrome', (['"""C:\\\\Users\\\\rburi\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python39\\\\Proyectos\\\\Scraping_Project\\\\chromedriver.exe"""'], {}), "(\n 'C:\\\\Users\\\\rburi\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python39\\\\Proyectos\\\\Scraping_Pro...
""" Scrape card info from pokemon-card.com and save as csv file author: type-null date: July 2020 """ import bs4 import sys import requests import pandas as pd def getContent(cardId): # anti-scraping user_agent = "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Firefox/68.0" url = f'https:/...
[ "requests.get", "bs4.BeautifulSoup", "pandas.DataFrame", "sys.stdout.flush", "sys.stdout.write" ]
[((396, 449), 'requests.get', 'requests.get', (['url'], {'headers': "{'User-Agent': user_agent}"}), "(url, headers={'User-Agent': user_agent})\n", (408, 449), False, 'import requests\n'), ((1509, 1550), 'bs4.BeautifulSoup', 'bs4.BeautifulSoup', (['content', '"""html.parser"""'], {}), "(content, 'html.parser')\n", (1526...
# Create your views here. import mimetypes from django.http import HttpResponse from django import shortcuts from sample import models def serve_mongo_download(request, mongo_id): obj = shortcuts.get_object_or_404(models.SampleModel, content=mongo_id) return get_mongo_response(obj.content) def get_mongo_re...
[ "mimetypes.guess_type", "django.shortcuts.get_object_or_404" ]
[((194, 259), 'django.shortcuts.get_object_or_404', 'shortcuts.get_object_or_404', (['models.SampleModel'], {'content': 'mongo_id'}), '(models.SampleModel, content=mongo_id)\n', (221, 259), False, 'from django import shortcuts\n'), ((681, 724), 'mimetypes.guess_type', 'mimetypes.guess_type', (['file_object.file_name'],...
# Copyright 2017 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
[ "logging.exception", "serial.serial_for_url", "logging.debug", "time.time" ]
[((2559, 2613), 'logging.debug', 'logging.debug', (['"""Skipping until the end of a new line."""'], {}), "('Skipping until the end of a new line.')\n", (2572, 2613), False, 'import logging\n'), ((3187, 3262), 'serial.serial_for_url', 'serial.serial_for_url', (['device_url'], {'baudrate': 'baud_rate', 'timeout': 'read_t...
import importlib import os import runpy import shutil from configparser import ConfigParser import pkg_resources import sys from clinodes.nodes import ArgNode, Switch from sqlalchemy import * from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relation, sessionmaker from gofri.lib.http...
[ "importlib.import_module", "configparser.ConfigParser", "gofri.lib.pip.pip_handler.PIPHandler", "gofri.lib.conf.local.init_local_conf_file", "os.path.dirname", "gofri.lib.conf.local.load_default_config", "sqlalchemy.ext.declarative.declarative_base" ]
[((1042, 1060), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', ([], {}), '()\n', (1058, 1060), False, 'from sqlalchemy.ext.declarative import declarative_base\n'), ((814, 828), 'configparser.ConfigParser', 'ConfigParser', ([], {}), '()\n', (826, 828), False, 'from configparser import ConfigParser\n'...
import requests, io, csv, datetime import county_report, state_report STATE_ABBR = 'OH' STATE = 'Ohio' URL = 'https://coronavirus.ohio.gov/static/COVIDSummaryData.csv' def scraper(): # make an HTTP web request to get the CA CSV file response = requests.get(URL) if response.status_code == requests.codes.o...
[ "datetime.datetime.now", "requests.get" ]
[((254, 271), 'requests.get', 'requests.get', (['URL'], {}), '(URL)\n', (266, 271), False, 'import requests, io, csv, datetime\n'), ((2154, 2177), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (2175, 2177), False, 'import requests, io, csv, datetime\n'), ((1568, 1591), 'datetime.datetime.now', 'da...
from ossConfig import ossConfig import Oss access_key = '<KEY>' secret_key = '<KEY>' endpoint_url = 'http://XXXXXXXXXXXXXXXXX.com' config = ossConfig(access_key, secret_key, endpoint_url) bucket_name = 'test1' object_name = 'mytestput' URL = Oss.PresignedURLs(config, bucket_name, object_name) print(URL)
[ "Oss.PresignedURLs", "ossConfig.ossConfig" ]
[((141, 188), 'ossConfig.ossConfig', 'ossConfig', (['access_key', 'secret_key', 'endpoint_url'], {}), '(access_key, secret_key, endpoint_url)\n', (150, 188), False, 'from ossConfig import ossConfig\n'), ((245, 296), 'Oss.PresignedURLs', 'Oss.PresignedURLs', (['config', 'bucket_name', 'object_name'], {}), '(config, buck...
import models import serializers # Third Party from rest_framework import viewsets class RoastViewSet(viewsets.ModelViewSet): """ API endpoint that allows roastss to be viewed or edited. """ filter_fields = ['coffee', ] queryset = models.Roast.objects.all() serializer_class = serializers.Roas...
[ "models.Roast.objects.all" ]
[((254, 280), 'models.Roast.objects.all', 'models.Roast.objects.all', ([], {}), '()\n', (278, 280), False, 'import models\n')]
import numpy as np from numba import jit from numba.core import types from numba.tests.support import TestCase, tag import unittest # Array overlaps involving a displacement def array_overlap1(src, dest, k=1): assert src.shape == dest.shape dest[k:] = src[:-k] def array_overlap2(src, dest, k=1): assert...
[ "unittest.main", "numba.jit", "numpy.arange" ]
[((3823, 3838), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3836, 3838), False, 'import unittest\n'), ((1959, 1977), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (1962, 1977), False, 'from numba import jit\n'), ((2113, 2136), 'numpy.arange', 'np.arange', (['(0)', '(N ** ndim)'], {}), ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import collections import csv import io import math import pathlib import re import pandas as pd class Barcode: """A TCGA barcode. TCGA barcodes can be truncated at almost any segment depending on what they represent, for example, a particiant, a sample or...
[ "collections.namedtuple", "pandas.ExcelWriter", "csv.DictReader", "pandas.read_csv", "re.compile", "pathlib.Path", "csv.writer", "io.StringIO" ]
[((6621, 6726), 'collections.namedtuple', 'collections.namedtuple', (['"""Survival"""', "['case_id', 'os_status', 'os_months', 'dfs_status', 'dfs_months']"], {}), "('Survival', ['case_id', 'os_status', 'os_months',\n 'dfs_status', 'dfs_months'])\n", (6643, 6726), False, 'import collections\n'), ((1165, 1359), 're.co...
from datetime import timedelta, datetime from typing import Optional from fastapi import HTTPException, Depends from fastapi.security import OAuth2PasswordBearer from jose import jwt, JWTError from passlib.context import CryptContext from pydantic import BaseModel from db import database as adb from usermanagement.mod...
[ "fastapi.HTTPException", "fastapi.security.OAuth2PasswordBearer", "datetime.datetime.utcnow", "jose.jwt.decode", "passlib.context.CryptContext", "db.database.fetch_all", "jose.jwt.encode", "datetime.datetime.now", "usermanagement.schema.UserCreate", "datetime.timedelta", "fastapi.Depends", "us...
[((510, 548), 'fastapi.security.OAuth2PasswordBearer', 'OAuth2PasswordBearer', ([], {'tokenUrl': '"""token"""'}), "(tokenUrl='token')\n", (530, 548), False, 'from fastapi.security import OAuth2PasswordBearer\n'), ((698, 749), 'passlib.context.CryptContext', 'CryptContext', ([], {'schemes': "['bcrypt']", 'deprecated': '...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from django.test import TestCase from ralph.discovery.tests.util import MockSSH from ralph.scan.plugins.proxmox_2_3 import ( _get_node_sn, ...
[ "ralph.scan.plugins.proxmox_2_3._get_node_sn", "ralph.scan.plugins.proxmox_2_3._get_vm_info", "ralph.discovery.tests.util.MockSSH", "ralph.scan.plugins.proxmox_2_3._get_node_mac_address", "ralph.scan.plugins.proxmox_2_3._get_device_info" ]
[((606, 676), 'ralph.discovery.tests.util.MockSSH', 'MockSSH', (["[('sudo /usr/sbin/dmidecode -t 1 | grep -i serial', NODE_SN)]"], {}), "([('sudo /usr/sbin/dmidecode -t 1 | grep -i serial', NODE_SN)])\n", (613, 676), False, 'from ralph.discovery.tests.util import MockSSH\n'), ((695, 712), 'ralph.scan.plugins.proxmox_2_...
# pylint: disable=invalid-name import sys import pytest from unittest.mock import MagicMock sys.path.append('plugins/sdm') sys.path.append('e2e') from test_common import create_config, DummyResource, get_dummy_person, DummyRole, ErrBotExtraTestSettings from lib import ShowResourcesHelper pytest_plugins = ["errbot.ba...
[ "test_common.create_config", "unittest.mock.MagicMock", "test_common.DummyResource", "test_common.DummyRole", "lib.ShowResourcesHelper", "test_common.get_dummy_person", "sys.path.append" ]
[((93, 123), 'sys.path.append', 'sys.path.append', (['"""plugins/sdm"""'], {}), "('plugins/sdm')\n", (108, 123), False, 'import sys\n'), ((124, 146), 'sys.path.append', 'sys.path.append', (['"""e2e"""'], {}), "('e2e')\n", (139, 146), False, 'import sys\n'), ((3276, 3318), 'unittest.mock.MagicMock', 'MagicMock', ([], {'...
import os from conjureup import controllers, utils from conjureup.app_config import app from conjureup.download import EndpointType, download_local from conjureup.models.addon import AddonModel from conjureup.models.step import StepModel from conjureup.ui.views.spellpicker import SpellPickerView class SpellPickerCon...
[ "conjureup.models.addon.AddonModel.load_spell_addons", "conjureup.utils.find_spells_matching", "os.path.join", "conjureup.controllers.setup_metadata_controller", "conjureup.utils.find_spells", "conjureup.app_config.app.config.get", "conjureup.utils.set_spell_metadata", "conjureup.models.step.StepModel...
[((386, 409), 'conjureup.app_config.app.config.get', 'app.config.get', (['"""spell"""'], {}), "('spell')\n", (400, 409), False, 'from conjureup.app_config import app\n'), ((849, 875), 'conjureup.utils.set_spell_metadata', 'utils.set_spell_metadata', ([], {}), '()\n', (873, 875), False, 'from conjureup import controller...
import pandas as pd import numpy as np from copy import deepcopy import warnings from sklearn.base import BaseEstimator, TransformerMixin from sklearn.model_selection import cross_val_predict from sklearn.model_selection import KFold, StratifiedKFold from sklearn.externals.joblib import Parallel, delayed from gravity_l...
[ "copy.deepcopy", "sklearn.externals.joblib.delayed", "pandas.DataFrame", "numpy.hstack", "gravity_learn.utils.force_array", "sklearn.model_selection.StratifiedKFold", "gravity_learn.utils.check_is_fitted", "sklearn.externals.joblib.Parallel", "sklearn.model_selection.cross_val_predict", "gravity_l...
[((2660, 2780), 'warnings.warn', 'warnings.warn', (['"""EnsemblerClassifier is deprecated, please use FullStackClassifier instead"""', 'DeprecationWarning'], {}), "(\n 'EnsemblerClassifier is deprecated, please use FullStackClassifier instead'\n , DeprecationWarning)\n", (2673, 2780), False, 'import warnings\n'),...
import sys from data_reader.operations import load_dataset from sklearn import metrics import adlib.learners as learner from data_reader.dataset import EmailDataset import matplotlib.pyplot as plt def main(argv): """ driver class that performs demo of the library """ # pre-process data and randomly p...
[ "matplotlib.pyplot.plot", "data_reader.operations.load_dataset", "data_reader.dataset.EmailDataset", "adlib.learners.FeatureDeletion", "sklearn.metrics.accuracy_score", "matplotlib.pyplot.show" ]
[((343, 430), 'data_reader.dataset.EmailDataset', 'EmailDataset', ([], {'path': '"""../../data_reader/data/test/100_instance_debug.csv"""', 'raw': '(False)'}), "(path='../../data_reader/data/test/100_instance_debug.csv', raw\n =False)\n", (355, 430), False, 'from data_reader.dataset import EmailDataset\n'), ((513, 5...
# -*- coding: utf-8 -*- ''' Widgets for displaying argparse arguments in a GUI ''' import argparse from qtpy import QtCore, QtWidgets from . import groupingTools, wrappedWidgets class ArgDialog(QtWidgets.QDialog): ''' A simple settings dialog containing a single ArgparseWidget and stardard ok/cancel dialog buttons...
[ "qtpy.QtWidgets.QVBoxLayout", "qtpy.QtCore.Signal", "qtpy.QtWidgets.QLabel", "qtpy.QtWidgets.QListWidget", "qtpy.QtWidgets.QStackedWidget", "qtpy.QtWidgets.QDialogButtonBox", "qtpy.QtWidgets.QFormLayout", "qtpy.QtWidgets.QWidget", "qtpy.QtWidgets.QHBoxLayout" ]
[((343, 358), 'qtpy.QtCore.Signal', 'QtCore.Signal', ([], {}), '()\n', (356, 358), False, 'from qtpy import QtCore, QtWidgets\n'), ((1572, 1587), 'qtpy.QtCore.Signal', 'QtCore.Signal', ([], {}), '()\n', (1585, 1587), False, 'from qtpy import QtCore, QtWidgets\n'), ((3808, 3823), 'qtpy.QtCore.Signal', 'QtCore.Signal', (...
import smtplib import argparse from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart def main(args): # Allow HTML-formatted emails (very simplistic atm, should be expanded if used) msg = MIMEMultipart("alternative") if args["body"].startswith("<html>", 0, 10): msg.attach(MIMEText(a...
[ "email.mime.text.MIMEText", "email.mime.multipart.MIMEMultipart", "argparse.ArgumentParser", "smtplib.SMTP" ]
[((222, 250), 'email.mime.multipart.MIMEMultipart', 'MIMEMultipart', (['"""alternative"""'], {}), "('alternative')\n", (235, 250), False, 'from email.mime.multipart import MIMEMultipart\n'), ((482, 508), 'smtplib.SMTP', 'smtplib.SMTP', (["args['smtp']"], {}), "(args['smtp'])\n", (494, 508), False, 'import smtplib\n'), ...
from copy import deepcopy from typing import List from constants import BLACK, COLS, PIECES, RED, ROWS, SQUARE_SIZE, WHITE from models.pieces import Piece import pygame class Board: def __init__(self): self.board = [] self.create_board() self.white_left = self.red_left = PIECES ...
[ "pygame.draw.rect", "models.pieces.Piece", "copy.deepcopy" ]
[((5168, 5182), 'copy.deepcopy', 'deepcopy', (['self'], {}), '(self)\n', (5176, 5182), False, 'from copy import deepcopy\n'), ((5662, 5761), 'pygame.draw.rect', 'pygame.draw.rect', (['window', 'RED', '(row * SQUARE_SIZE, col * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE)'], {}), '(window, RED, (row * SQUARE_SIZE, col * SQUAR...
#!/usr/bin/env python3 import os import sys import json import configparser import logging import logging.config import traceback # install required package if in docker if os.geteuid() == 0: import pkgutil import subprocess required_pkgs = ["pytz"] for pkg in required_pkgs: if not pkgutil.fin...
[ "logging.getLogger", "handler_basic.process_basic_measurements", "helper.eventlog.enable_local_echo", "handler_score.process_score_all", "handler_byline.process_byline_extract", "handler_lab.process_integrate", "helper.eventlog.error", "sys.exit", "handler_lab.process_split", "helper.mongo.connect...
[((846, 872), 'logging.getLogger', 'logging.getLogger', (['"""basic"""'], {}), "('basic')\n", (863, 872), False, 'import logging\n'), ((874, 896), 'helper.mongo.connect', 'helper.mongo.connect', ([], {}), '()\n', (894, 896), False, 'import helper\n'), ((3668, 3708), 'helper.eventlog.set_worker_id', 'helper.eventlog.set...
""" Indexes a dataset in Elasticsearch. The dataset consists of a dataset.json file and optional supporting files stored in the same directory. If a supporting file is found, it overrides that section of the dataset.json. Where possible dsloader attempts to enhance and complete information available in dataset.json ...
[ "logging.getLogger", "logging.basicConfig", "os.path.exists", "argparse.ArgumentParser", "json.dumps", "os.path.join", "os.environ.get", "os.path.split", "geojson.Polygon", "os.path.isfile", "json.load", "sys.exit", "slugify.UniqueSlugify", "slugify.slugify" ]
[((573, 602), 'logging.getLogger', 'logging.getLogger', (['"""dsloader"""'], {}), "('dsloader')\n", (590, 602), False, 'import logging\n'), ((6857, 6882), 'os.path.join', 'os.path.join', (['path', 'fname'], {}), '(path, fname)\n', (6869, 6882), False, 'import os\n'), ((7835, 7860), 'os.path.join', 'os.path.join', (['pa...
""" This file is subject to the terms and conditions defined in the LICENSE file, which is part of this source code package. """ from DigitalObject import DigitalObject from lxml import etree import Cfg import Utils import hashlib import logging import os # namespaces DOC_KEY = "doc" DOC_NS = "urn:isbn:1-931666-33-4...
[ "logging.getLogger", "Utils.load_from_source", "DigitalObject.DigitalObject", "lxml.etree.fromstring", "Utils.getFileName", "hashlib.sha1", "lxml.etree.tostring", "Utils.fixIncorrectDateEncoding" ]
[((1301, 1320), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (1318, 1320), False, 'import logging\n'), ((1523, 1553), 'Utils.load_from_source', 'Utils.load_from_source', (['Source'], {}), '(Source)\n', (1545, 1553), False, 'import Utils\n'), ((1573, 1595), 'lxml.etree.fromstring', 'etree.fromstring', (['...
import numpy as np from sklearn.exceptions import NotFittedError from sklearn.linear_model import SGDClassifier from sklearn.linear_model.base import LinearClassifierMixin from sklearn.utils import check_array import faiss def _default_index(d): index = faiss.index_factory(d, "IVF2048,Flat", faiss.METRIC_INNER_P...
[ "faiss.index_factory", "sklearn.utils.check_array", "numpy.ascontiguousarray" ]
[((261, 327), 'faiss.index_factory', 'faiss.index_factory', (['d', '"""IVF2048,Flat"""', 'faiss.METRIC_INNER_PRODUCT'], {}), "(d, 'IVF2048,Flat', faiss.METRIC_INNER_PRODUCT)\n", (280, 327), False, 'import faiss\n'), ((713, 748), 'sklearn.utils.check_array', 'check_array', (['X'], {'accept_sparse': '(False)'}), '(X, acc...
# Copyright 2020 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
[ "json.loads", "random.choice", "tests.system.data_sources.deploy_cloudsql.gcloud_context.GCloudContext" ]
[((2194, 2225), 'tests.system.data_sources.deploy_cloudsql.gcloud_context.GCloudContext', 'GCloudContext', (['self._project_id'], {}), '(self._project_id)\n', (2207, 2225), False, 'from tests.system.data_sources.deploy_cloudsql.gcloud_context import GCloudContext\n'), ((4366, 4397), 'tests.system.data_sources.deploy_cl...
""" Created on Thursday Mar 26 2020 <NAME> based on https://www.kaggle.com/bardor/covid-19-growing-rate https://github.com/CSSEGISandData/COVID-19 https://github.com/imdevskp https://www.kaggle.com/yamqwe/covid-19-status-israel """ import datetime import numpy as np import pandas as pd import seaborn as...
[ "matplotlib.pyplot.grid", "matplotlib.pyplot.ylabel", "numpy.log", "seaborn.scatterplot", "datetime.timedelta", "folium.CircleMarker", "numpy.arange", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.style.use", "numpy.diff", "folium.Map", "numpy.max", "numpy.linspa...
[((554, 586), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""dark_background"""'], {}), "('dark_background')\n", (567, 586), True, 'import matplotlib.pyplot as plt\n'), ((1813, 1839), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(9, 7)'}), '(figsize=(9, 7))\n', (1823, 1839), True, 'import matplotl...
import os from ..Task import Task from .UpdateImageMetadataTask import UpdateImageMetadataTask from ... import Crawler class ConvertImageTask(Task): """ Convert the source image (from the crawler) to the target one using oiio. """ def __init__(self, *args, **kwargs): """ Create a Conve...
[ "os.path.dirname", "OpenImageIO.ImageInput.open", "OpenImageIO.ImageOutput.create" ]
[((1160, 1200), 'OpenImageIO.ImageInput.open', 'oiio.ImageInput.open', (['inputImageFilePath'], {}), '(inputImageFilePath)\n', (1180, 1200), True, 'import OpenImageIO as oiio\n'), ((1384, 1423), 'OpenImageIO.ImageOutput.create', 'oiio.ImageOutput.create', (['targetFilePath'], {}), '(targetFilePath)\n', (1407, 1423), Tr...
#!/usr/bin/env python # coding: utf8 # # Copyright (c) 2021 Centre National d'Etudes Spatiales (CNES). # # This file is part of PANDORA_MCCNN # # https://github.com/CNES/Pandora_MCCNN # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Licens...
[ "argparse.ArgumentParser", "numpy.arange", "numpy.where", "rasterio.open", "numba.njit", "os.path.join", "numpy.squeeze", "numpy.stack", "numpy.sum", "numpy.random.seed", "numpy.zeros_like", "glob.glob", "numpy.random.shuffle" ]
[((987, 993), 'numba.njit', 'njit', ([], {}), '()\n', (991, 993), False, 'from numba import njit\n'), ((4961, 5011), 'glob.glob', 'glob.glob', (["(input_dir + '/*/left_epipolar_disp.tif')"], {}), "(input_dir + '/*/left_epipolar_disp.tif')\n", (4970, 5011), False, 'import glob\n'), ((5076, 5093), 'numpy.arange', 'np.ara...
import numpy as np # NOTE: these all assume a sample rate of 1000Hz and 0-centered(ish) BUTTER2_45_55_NOTCH = [[0.95654323, -1.82035157, 0.95654323, 1., -1.84458768, 0.9536256 ], [1. , -1.90305207, 1. , 1., -1.87701816, 0.95947072]] BUTTER4_45_55_NOTCH = [[0.92117099, -1.75303637, ...
[ "numpy.array" ]
[((2752, 2768), 'numpy.array', 'np.array', (['coeffs'], {}), '(coeffs)\n', (2760, 2768), True, 'import numpy as np\n'), ((2786, 2820), 'numpy.array', 'np.array', (['([[0.0] * 2] * self.order)'], {}), '([[0.0] * 2] * self.order)\n', (2794, 2820), True, 'import numpy as np\n')]
import datetime as dt from stpmex.utils import strftime, strptime def test_strftime(): assert strftime(dt.date(2020, 4, 20)) == '20200420' def test_strptime(): assert strptime('20200420') == dt.date(2020, 4, 20)
[ "stpmex.utils.strptime", "datetime.date" ]
[((180, 200), 'stpmex.utils.strptime', 'strptime', (['"""20200420"""'], {}), "('20200420')\n", (188, 200), False, 'from stpmex.utils import strftime, strptime\n'), ((204, 224), 'datetime.date', 'dt.date', (['(2020)', '(4)', '(20)'], {}), '(2020, 4, 20)\n', (211, 224), True, 'import datetime as dt\n'), ((110, 130), 'dat...
"""Describes Project class""" import os from collections import defaultdict from fama.utils.const import ENDS from fama.project.program_config import ProgramConfig from fama.project.project_options import ProjectOptions from fama.project.sample import Sample from fama.reference_library.reference_data import ReferenceD...
[ "os.path.exists", "fama.project.program_config.ProgramConfig", "fama.reference_library.taxonomy_data.TaxonomyData", "os.makedirs", "fama.project.sample.Sample", "os.path.join", "fama.project.project_options.ProjectOptions", "fama.reference_library.reference_data.ReferenceData", "os.path.isdir", "c...
[((1515, 1541), 'fama.project.program_config.ProgramConfig', 'ProgramConfig', (['config_file'], {}), '(config_file)\n', (1528, 1541), False, 'from fama.project.program_config import ProgramConfig\n'), ((1565, 1593), 'fama.project.project_options.ProjectOptions', 'ProjectOptions', (['project_file'], {}), '(project_file)...
from django.db import models from django.contrib.auth.models import User class Entry(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE, null=True) title = models.CharField(max_length=128, unique=True) slug = models.CharField(max_length=128) created = models.DateTimeField() # I...
[ "django.db.models.DateTimeField", "django.db.models.FileField", "django.db.models.CharField", "django.db.models.ForeignKey" ]
[((113, 173), 'django.db.models.ForeignKey', 'models.ForeignKey', (['User'], {'on_delete': 'models.CASCADE', 'null': '(True)'}), '(User, on_delete=models.CASCADE, null=True)\n', (130, 173), False, 'from django.db import models\n'), ((186, 231), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(128...
import pygame from settings import * from random import uniform class Ball(pygame.sprite.Sprite): def __init__(self, groups, paddle, blocks): super().__init__(groups) # Setup # image is mandatory attribute for pygame sprites. self.image = pygame.image.load(BASE_DIR / 'assets' / 'im...
[ "random.uniform", "pygame.sprite.spritecollide", "pygame.key.get_pressed", "pygame.image.load", "pygame.transform.scale" ]
[((375, 419), 'pygame.transform.scale', 'pygame.transform.scale', (['self.image', '(30, 30)'], {}), '(self.image, (30, 30))\n', (397, 419), False, 'import pygame\n'), ((794, 818), 'pygame.key.get_pressed', 'pygame.key.get_pressed', ([], {}), '()\n', (816, 818), False, 'import pygame\n'), ((1568, 1621), 'pygame.sprite.s...
# Downloads all Sentinel 1 images from PolarView which were used for the latest Antarctic coastline mapping, in .tif format. # Reference coastline: https://data.bas.ac.uk/collections/e74543c0-4c4e-4b41-aa33-5bb2f67df389/ import time import requests import csv startTime = time.time() base_URI = 'https://www.polarview...
[ "requests.get", "time.time", "csv.reader" ]
[((273, 284), 'time.time', 'time.time', ([], {}), '()\n', (282, 284), False, 'import time\n'), ((507, 526), 'csv.reader', 'csv.reader', (['csvfile'], {}), '(csvfile)\n', (517, 526), False, 'import csv\n'), ((778, 816), 'requests.get', 'requests.get', (['request_URI'], {'stream': '(True)'}), '(request_URI, stream=True)\...
import os from reportlab.pdfgen import canvas from reportlab.lib.units import cm from PyPDF2 import PdfFileWriter, PdfFileReader def create_watermark(text, path=None): if path: f_pdf = os.path.join(path, 'mark.pdf') else: f_pdf = 'mark.pdf' w_pdf = 20 * cm h_pdf = 20 * ...
[ "PyPDF2.PdfFileWriter", "PyPDF2.PdfFileReader", "os.path.join", "reportlab.pdfgen.canvas.Canvas" ]
[((334, 379), 'reportlab.pdfgen.canvas.Canvas', 'canvas.Canvas', (['f_pdf'], {'pagesize': '(w_pdf, h_pdf)'}), '(f_pdf, pagesize=(w_pdf, h_pdf))\n', (347, 379), False, 'from reportlab.pdfgen import canvas\n'), ((209, 239), 'os.path.join', 'os.path.join', (['path', '"""mark.pdf"""'], {}), "(path, 'mark.pdf')\n", (221, 23...
from os import path, remove import subprocess from glob import glob from shutil import move import MDAnalysis as mda from miscell.file_util import check_dir_exist_and_make, check_file_exist, copy_verbose from miscell.na_bp import d_n_bp, d_type_na from pdb_util.pdb import PDBReader, PDBWriter class PreliminaryAgent: ...
[ "miscell.file_util.check_file_exist", "miscell.file_util.check_dir_exist_and_make", "shutil.move", "subprocess.run", "os.path.join", "MDAnalysis.Writer", "pdb_util.pdb.PDBReader", "pdb_util.pdb.PDBWriter", "MDAnalysis.Universe", "miscell.file_util.copy_verbose", "glob.glob", "os.remove" ]
[((710, 737), 'os.path.join', 'path.join', (['rootfolder', 'host'], {}), '(rootfolder, host)\n', (719, 737), False, 'from os import path, remove\n'), ((768, 806), 'os.path.join', 'path.join', (['self.host_folder', '"""pdb_xtc"""'], {}), "(self.host_folder, 'pdb_xtc')\n", (777, 806), False, 'from os import path, remove\...
import pandas as pd import streamlit as st def get_player_data(teams_data, player_name): for team in teams_data: for player in team['players']: if player['name'] == player_name: player['win'] = team['winner'] return player return None def get_player_team(t...
[ "pandas.DataFrame", "streamlit.write" ]
[((1443, 1471), 'pandas.DataFrame', 'pd.DataFrame', (['teammates_list'], {}), '(teammates_list)\n', (1455, 1471), True, 'import pandas as pd\n'), ((1638, 1663), 'streamlit.write', 'st.write', (['"""All teammates"""'], {}), "('All teammates')\n", (1646, 1663), True, 'import streamlit as st\n'), ((1668, 1687), 'streamlit...
# Demonstrates the use of transformation matrices. from miniipe import Document, Rotate, Translate, Scale, polyline doc = Document() doc.import_stylefile() doc.add_layout( page=(640,640) ) doc.add_layer('alpha') # Iteratively tweak a transformation matrix. # (Matrix multiplication with the @ operator.) ps = [(10,0),...
[ "miniipe.Rotate", "miniipe.Scale", "miniipe.Document", "miniipe.polyline", "miniipe.Translate" ]
[((124, 134), 'miniipe.Document', 'Document', ([], {}), '()\n', (132, 134), False, 'from miniipe import Document, Rotate, Translate, Scale, polyline\n'), ((354, 375), 'miniipe.Translate', 'Translate', (['(300, 300)'], {}), '((300, 300))\n', (363, 375), False, 'from miniipe import Document, Rotate, Translate, Scale, pol...
import random import numpy as np from pybullet_planning import multiply, interval_generator from pybullet_planning import Pose, Point, Euler def get_random_direction_generator(**kwargs): lower = [-np.pi, -np.pi] upper = [+np.pi, +np.pi] for [roll, pitch] in interval_generator(lower, upper, **kwargs): ...
[ "pybullet_planning.interval_generator", "random.shuffle", "pybullet_planning.Euler" ]
[((273, 315), 'pybullet_planning.interval_generator', 'interval_generator', (['lower', 'upper'], {}), '(lower, upper, **kwargs)\n', (291, 315), False, 'from pybullet_planning import multiply, interval_generator\n'), ((481, 506), 'random.shuffle', 'random.shuffle', (['pose_list'], {}), '(pose_list)\n', (495, 506), False...
# -*- coding: utf-8 -*- """ Created on Tue May 12 08:23:58 2020 @author: sumanth """ import numpy as np import cv2 from tensorflow.keras.applications.mobilenet_v2 import preprocess_input from tensorflow.keras.preprocessing.image import img_to_array def pre_dect(frame,faceNet,model): (h, w) = frame.s...
[ "cv2.dnn.blobFromImage", "numpy.array", "tensorflow.keras.applications.mobilenet_v2.preprocess_input", "cv2.cvtColor", "numpy.expand_dims", "tensorflow.keras.preprocessing.image.img_to_array", "cv2.resize" ]
[((341, 409), 'cv2.dnn.blobFromImage', 'cv2.dnn.blobFromImage', (['frame', '(1.0)', '(300, 300)', '(104.0, 177.0, 123.0)'], {}), '(frame, 1.0, (300, 300), (104.0, 177.0, 123.0))\n', (362, 409), False, 'import cv2\n'), ((976, 1013), 'cv2.cvtColor', 'cv2.cvtColor', (['face', 'cv2.COLOR_BGR2RGB'], {}), '(face, cv2.COLOR_B...
#!/usr/bin/env python import os.path import config import experiment_lib import lightgbm as lgb class LightGBMExperimentEarlyStopping(experiment_lib.ExperimentEarlyStopping): def __init__(self, **kwargs): super(LightGBMExperimentEarlyStopping, self).__init__(**kwargs) def get_estimator(self, cat_...
[ "lightgbm.LGBMRegressor" ]
[((342, 389), 'lightgbm.LGBMRegressor', 'lgb.LGBMRegressor', ([], {'n_jobs': '(16)', 'n_estimators': '(9999)'}), '(n_jobs=16, n_estimators=9999)\n', (359, 389), True, 'import lightgbm as lgb\n')]
# # Incremental Def Writer -- Brown University # # Copyright (C) 2019 Brown University # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE S...
[ "utils.get_connected_components" ]
[((2362, 2427), 'utils.get_connected_components', 'get_connected_components', (['component', 'gate_conn', 'unplaced_nets_map'], {}), '(component, gate_conn, unplaced_nets_map)\n', (2386, 2427), False, 'from utils import get_connected_components\n')]
#! /usr/bin/env python3 import argparse from pathlib import Path import sys from scriptutil import get_nodes_to_ea, decode_file, gen_json_data, calc C0_OFF = "Task: C0, Corunner: OFF" C0_ON = "Task: C0, Corunner: ON" C0_ON_LOCAL = "Task: C0, Corunner: ON (Local)" C1_OFF = "Task: C1, Corunner: OFF" C1_ON = "Task: C1, ...
[ "argparse.ArgumentParser", "scriptutil.gen_json_data", "scriptutil.calc", "scriptutil.get_nodes_to_ea", "scriptutil.decode_file" ]
[((414, 439), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (437, 439), False, 'import argparse\n'), ((4996, 5017), 'scriptutil.get_nodes_to_ea', 'get_nodes_to_ea', (['args'], {}), '(args)\n', (5011, 5017), False, 'from scriptutil import get_nodes_to_ea, decode_file, gen_json_data, calc\n'), (...
# -*- coding: utf-8 -*- from csv import DictWriter from os import path from app_logger import app_logging from execution_error import ExecutionError class DeviceDataCsvWriter: def __init__(self): self.csv_writer = None @staticmethod def __get_merged_dict(log_date_time, dev_data, dev_names): ...
[ "os.path.isfile", "execution_error.ExecutionError", "app_logger.app_logging.debug", "app_logger.app_logging.error" ]
[((378, 440), 'execution_error.ExecutionError', 'ExecutionError', (['"""Device data and device names length mismatch"""'], {}), "('Device data and device names length mismatch')\n", (392, 440), False, 'from execution_error import ExecutionError\n'), ((1478, 1557), 'app_logger.app_logging.debug', 'app_logging.debug', ([...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'CharakterInfo.ui' # # Created by: PyQt5 UI code generator 5.15.6 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. from PyQt5 import QtCore...
[ "PyQt5.QtWidgets.QWidget", "PyQt5.QtWidgets.QListView", "PyQt5.QtWidgets.QSpinBox", "PyQt5.QtGui.QFont", "PyQt5.QtWidgets.QComboBox", "PyQt5.QtWidgets.QPlainTextEdit", "PyQt5.QtWidgets.QSpacerItem", "PyQt5.QtCore.QMetaObject.connectSlotsByName", "PyQt5.QtWidgets.QGridLayout", "PyQt5.QtWidgets.QLab...
[((25171, 25203), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (25193, 25203), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((25215, 25234), 'PyQt5.QtWidgets.QWidget', 'QtWidgets.QWidget', ([], {}), '()\n', (25232, 25234), False, 'from PyQt5 import QtCore, QtG...
#!/usr/bin/env python # encoding: utf-8 from flask import Flask from flask_sqlalchemy import SQLAlchemy from config import configs db = SQLAlchemy() def create_app(app_name, config_name): app = Flask(app_name, template_folder="app/templates") app = Flask(app_name) app.config['SQLALCHEMY_TRACK_MODIFICAT...
[ "flask_sqlalchemy.SQLAlchemy", "flask.Flask" ]
[((139, 151), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {}), '()\n', (149, 151), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((203, 251), 'flask.Flask', 'Flask', (['app_name'], {'template_folder': '"""app/templates"""'}), "(app_name, template_folder='app/templates')\n", (208, 251), False, 'from flask i...
import uproot from .BEvents import BEvents class EventBuilder(object): def __init__(self, config): self.config = config def __repr__(self): return '{}({!r})'.format( self.__class__.__name__, self.config, ) def __call__(self): if len(self.config.inp...
[ "uproot.open" ]
[((672, 710), 'uproot.open', 'uproot.open', (['self.config.inputPaths[0]'], {}), '(self.config.inputPaths[0])\n', (683, 710), False, 'import uproot\n'), ((800, 878), 'uproot.open', 'uproot.open', (['self.config.inputPaths[0]'], {'localsource': 'uproot.FileSource.defaults'}), '(self.config.inputPaths[0], localsource=upr...
# Generated by Django 2.2.6 on 2020-05-30 22:44 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('posts', '0010_auto_20200530_1531'), ] operations = [ migrations.AlterField( model_name='follow', name='created', ...
[ "django.db.models.DateTimeField" ]
[((335, 435), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)', 'db_index': '(True)', 'verbose_name': '"""beginning_following_date"""'}), "(auto_now_add=True, db_index=True, verbose_name=\n 'beginning_following_date')\n", (355, 435), False, 'from django.db import migrations, m...
import os AIRFLOW_HOME = os.environ.get('AIRFLOW_HOME') with open(f'{AIRFLOW_HOME}/dags/data.txt') as f: time_data = f.read() time_list = time_data.split() with open(f'{AIRFLOW_HOME}/dags/time.txt', 'w') as split_text: split_text.write(str(time_list[3]))
[ "os.environ.get" ]
[((27, 57), 'os.environ.get', 'os.environ.get', (['"""AIRFLOW_HOME"""'], {}), "('AIRFLOW_HOME')\n", (41, 57), False, 'import os\n')]
from sqlalchemy import DateTime, String, ForeignKey, Integer, Column, Float from sqlalchemy.orm import relationship from . import Base class AumHistory(Base): """ Map class for table AumHistory. - **aum_id**: Integer, primary_key. - **aum_datetime**: DateTime, not null. - **aum**: ...
[ "sqlalchemy.orm.relationship", "sqlalchemy.Float", "sqlalchemy.ForeignKey", "sqlalchemy.String", "sqlalchemy.Column" ]
[((557, 590), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)'}), '(Integer, primary_key=True)\n', (563, 590), False, 'from sqlalchemy import DateTime, String, ForeignKey, Integer, Column, Float\n'), ((612, 644), 'sqlalchemy.Column', 'Column', (['DateTime'], {'nullable': '(False)'}), '(DateTime, nu...
import pytest import os from corpustools.corpus.io.text_spelling import (load_discourse_spelling, load_directory_spelling, inspect_discourse_spelling, export_discourse_spelli...
[ "corpustools.corpus.io.text_transcription.export_discourse_transcription", "corpustools.corpus.io.text_transcription.load_discourse_transcription", "corpustools.corpus.io.text_transcription.inspect_discourse_transcription", "corpustools.utils.generate_discourse", "os.path.join", "corpustools.corpus.io.tex...
[((906, 949), 'corpustools.utils.generate_discourse', 'generate_discourse', (['unspecified_test_corpus'], {}), '(unspecified_test_corpus)\n', (924, 949), False, 'from corpustools.utils import generate_discourse\n'), ((968, 1025), 'os.path.join', 'os.path.join', (['export_test_dir', '"""test_export_spelling.txt"""'], {}...
"""Test for XBee Pro S3B""" from xbradio import XBRadio from pyb import SPI, Pin, delay def test_PacketBuffer(): import test_PacketBuffer test_PacketBuffer.main() def test_as(xb): #xb.verbose = True #g = xb.get_and_process_available_packets #BUG, this doesn't work: print("values: %r" % xb.values)...
[ "pyb.Pin", "test_PacketBuffer.main", "pyb.SPI", "pyb.delay" ]
[((148, 172), 'test_PacketBuffer.main', 'test_PacketBuffer.main', ([], {}), '()\n', (170, 172), False, 'import test_PacketBuffer\n'), ((758, 766), 'pyb.delay', 'delay', (['(5)'], {}), '(5)\n', (763, 766), False, 'from pyb import SPI, Pin, delay\n'), ((836, 846), 'pyb.delay', 'delay', (['(100)'], {}), '(100)\n', (841, 8...
import torch import torchaudio import configparser from torch import nn from model import KWS from prepare_big_wav import getBigWaveform use_cuda = torch.cuda.is_available() torch.manual_seed(7) device = torch.device("cuda" if use_cuda else "cpu") config = configparser.ConfigParser() config.read('config.ini') mel_...
[ "torch.manual_seed", "prepare_big_wav.getBigWaveform", "torch.log", "configparser.ConfigParser", "torchaudio.transforms.MelSpectrogram", "torch.max", "torch.cuda.is_available", "torch.nn.LogSoftmax", "torch.no_grad", "model.KWS", "torch.device" ]
[((151, 176), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (174, 176), False, 'import torch\n'), ((177, 197), 'torch.manual_seed', 'torch.manual_seed', (['(7)'], {}), '(7)\n', (194, 197), False, 'import torch\n'), ((207, 250), 'torch.device', 'torch.device', (["('cuda' if use_cuda else 'cpu')...
# -*- coding: utf-8 -*- """ Copyright [2009-2018] EMBL-European Bioinformatics Institute 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...
[ "attr.evolve", "attr.validators.instance_of", "attr.s", "operator.attrgetter" ]
[((2699, 2741), 'attr.s', 'attr.s', ([], {'frozen': '(True)', 'hash': '(True)', 'slots': '(True)'}), '(frozen=True, hash=True, slots=True)\n', (2705, 2741), False, 'import attr\n'), ((5929, 5971), 'attr.s', 'attr.s', ([], {'frozen': '(True)', 'hash': '(True)', 'slots': '(True)'}), '(frozen=True, hash=True, slots=True)\...
from loris.constants import FEATURE_ROTATION_ARBITRARY from loris.constants import FEATURE_ROTATION_BY_90S from loris.constants import FEATURE_ROTATION_MIRRORING from loris.exceptions import FeatureNotEnabledException from loris.exceptions import RequestException from loris.exceptions import SyntaxException from loris....
[ "loris.exceptions.SyntaxException", "loris.exceptions.RequestException", "loris.exceptions.FeatureNotEnabledException", "re.compile" ]
[((392, 423), 're.compile', 'compile', (['"""^!?\\\\d+(?:\\\\.\\\\d+)?$"""'], {}), "('^!?\\\\d+(?:\\\\.\\\\d+)?$')\n", (399, 423), False, 'from re import compile\n'), ((698, 718), 'loris.exceptions.SyntaxException', 'SyntaxException', (['msg'], {}), '(msg)\n', (713, 718), False, 'from loris.exceptions import SyntaxExce...
from bytewax import Dataflow, run flow = Dataflow() flow.map(lambda x: x * x) flow.capture() if __name__ == "__main__": for epoch, y in sorted(run(flow, enumerate(range(10)))): print(y)
[ "bytewax.Dataflow" ]
[((42, 52), 'bytewax.Dataflow', 'Dataflow', ([], {}), '()\n', (50, 52), False, 'from bytewax import Dataflow, run\n')]
import pytest from pyspark.sql import SparkSession from collections import defaultdict from dsgrid.project import Project from dsgrid.dataset.dataset import Dataset from dsgrid.dimension.base_models import DimensionType from dsgrid.exceptions import DSGValueNotRegistered, DSGInvalidDimensionMapping from dsgrid.tests.c...
[ "dsgrid.project.Project.load", "pyspark.sql.SparkSession.getActiveSession", "dsgrid.exceptions.DSGInvalidDimensionMapping", "collections.defaultdict", "pytest.raises" ]
[((447, 519), 'dsgrid.project.Project.load', 'Project.load', (['PROJECT_ID'], {'offline_mode': '(True)', 'registry_path': 'TEST_REGISTRY'}), '(PROJECT_ID, offline_mode=True, registry_path=TEST_REGISTRY)\n', (459, 519), False, 'from dsgrid.project import Project\n'), ((574, 668), 'dsgrid.project.Project.load', 'Project....
import discord from discord.ext import commands class Info(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command(help='Shows info about Dolphin', aliases=['link', 'l']) async def links(self, ctx): ''' Download links ''' await ctx.send(embed=discord.Embed(title='Links:', ...
[ "discord.Embed", "discord.ext.commands.command" ]
[((127, 199), 'discord.ext.commands.command', 'commands.command', ([], {'help': '"""Shows info about Dolphin"""', 'aliases': "['link', 'l']"}), "(help='Shows info about Dolphin', aliases=['link', 'l'])\n", (143, 199), False, 'from discord.ext import commands\n'), ((290, 965), 'discord.Embed', 'discord.Embed', ([], {'ti...
from functools import wraps from qtpy import QtWidgets from .histogram import HistogramWidget, HistogramModel, HistogramController from .pdsspect_image_set import PDSSpectImageSetViewBase class BasicHistogramModel(HistogramModel): """Model for the hhistograms in the Basic Widgets Attributes --------- ...
[ "qtpy.QtWidgets.QComboBox", "qtpy.QtWidgets.QVBoxLayout", "qtpy.QtWidgets.QGridLayout", "functools.wraps", "qtpy.QtWidgets.QHBoxLayout" ]
[((612, 623), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (617, 623), False, 'from functools import wraps\n'), ((4224, 4247), 'qtpy.QtWidgets.QGridLayout', 'QtWidgets.QGridLayout', ([], {}), '()\n', (4245, 4247), False, 'from qtpy import QtWidgets\n'), ((6215, 6238), 'qtpy.QtWidgets.QHBoxLayout', 'QtWidgets...
import asyncio from squall import Router, WebSocket import orjson class FanOut: def __init__(self): self.clients = set() def join(self, ws): self.clients.add(ws) def left(self, ws): self.clients.discard(ws) async def send(self, message): await asyncio.gather(*[ws.sen...
[ "squall.Router", "orjson.dumps" ]
[((390, 428), 'squall.Router', 'Router', ([], {'prefix': '"""/v1"""', 'tags': "['Gateway']"}), "(prefix='/v1', tags=['Gateway'])\n", (396, 428), False, 'from squall import Router, WebSocket\n'), ((1180, 1212), 'orjson.dumps', 'orjson.dumps', (["{'data': commands}"], {}), "({'data': commands})\n", (1192, 1212), False, '...
class Parser: def __init__(self, *args, **kwargs): import argparse self.parser = argparse.ArgumentParser( description='Request Ray-Triangle computations to the PYNQ-Z1 renderer.') client_info = 'client: runs on any machine that accesses the PYNQ-Z1 renderer' server_inf...
[ "argparse.ArgumentParser" ]
[((102, 204), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Request Ray-Triangle computations to the PYNQ-Z1 renderer."""'}), "(description=\n 'Request Ray-Triangle computations to the PYNQ-Z1 renderer.')\n", (125, 204), False, 'import argparse\n')]
import PySimpleGUI as sg import os.path import pandas as pd from call_index import get_data, process_index # Set path from computer BROWSE_PATH = os.getcwd()+"/Dataset" selected_filename = None query = None full_data = None selected_doc = None mii_index = None original_data = None def main(): global BROWSE_PATH...
[ "pandas.read_csv", "PySimpleGUI.FolderBrowse", "PySimpleGUI.Listbox", "call_index.get_data", "PySimpleGUI.In", "PySimpleGUI.Text", "PySimpleGUI.VSeparator", "PySimpleGUI.Button", "PySimpleGUI.theme", "PySimpleGUI.HorizontalSeparator", "call_index.process_index", "PySimpleGUI.Multiline", "PyS...
[((402, 420), 'PySimpleGUI.theme', 'sg.theme', (['"""Reddit"""'], {}), "('Reddit')\n", (410, 420), True, 'import PySimpleGUI as sg\n'), ((1789, 1866), 'PySimpleGUI.Window', 'sg.Window', (['"""Motor de Búsqueda"""', 'layout'], {'size': '(720, 720)', 'location': '(1000, 150)'}), "('Motor de Búsqueda', layout, size=(720, ...
import tempfile import shutil import os def _get_active_spark_session(): try: from pyspark.sql import SparkSession except ImportError: # Return None if user doesn't have PySpark installed return None try: # getActiveSession() only exists in Spark 3.0 and above retur...
[ "shutil.make_archive", "zipfile.ZipFile", "pyspark.sql.SparkSession.getActiveSession", "pyspark.files.SparkFiles.get", "os.path.basename", "tempfile.mkdtemp", "tempfile.mkstemp" ]
[((322, 353), 'pyspark.sql.SparkSession.getActiveSession', 'SparkSession.getActiveSession', ([], {}), '()\n', (351, 353), False, 'from pyspark.sql import SparkSession\n'), ((1019, 1037), 'tempfile.mkstemp', 'tempfile.mkstemp', ([], {}), '()\n', (1035, 1037), False, 'import tempfile\n'), ((1190, 1244), 'shutil.make_arch...
# -*- coding: utf-8 -*- # Example package with a console entry point """Reads and formats data from the SWMM 5 output file.""" from __future__ import absolute_import, print_function import copy import datetime import os import struct import sys import warnings from builtins import object, range, str, zip import mand...
[ "datetime.datetime", "os.path.exists", "pandas.Series", "tstoolbox.tsutils.make_list", "tstoolbox.tsutils.doc", "tstoolbox.tsutils.about", "builtins.str", "tstoolbox.tsutils.error_wrapper", "builtins.zip", "builtins.range", "mando.main", "copy.deepcopy", "pandas.DataFrame", "datetime.timed...
[((15877, 15892), 'mando.command', 'mando.command', ([], {}), '()\n', (15890, 15892), False, 'import mando\n'), ((15994, 16069), 'mando.command', 'mando.command', (['"""catalog"""'], {'formatter_class': 'RSTHelpFormatter', 'doctype': '"""numpy"""'}), "('catalog', formatter_class=RSTHelpFormatter, doctype='numpy')\n", (...
from graphviz import Digraph from Nodo import Nodo dot = Digraph(comment='AST') #dot.render('test-output/round-table.gv', view=True) # doctest: +SKIP #'test-output/round-table.gv.jpg' class AST: def __init__(self): self.count = 0 print("constructor") def defineTreeNodes(self, root): ...
[ "graphviz.Digraph", "Nodo.Nodo" ]
[((58, 80), 'graphviz.Digraph', 'Digraph', ([], {'comment': '"""AST"""'}), "(comment='AST')\n", (65, 80), False, 'from graphviz import Digraph\n'), ((830, 842), 'Nodo.Nodo', 'Nodo', (['"""raiz"""'], {}), "('raiz')\n", (834, 842), False, 'from Nodo import Nodo\n'), ((852, 866), 'Nodo.Nodo', 'Nodo', (['"""update"""'], {}...
# -*- coding: utf-8 -*- import unittest from source.tree import bst """ demo tree 7 / \ 5 8 / \ \ 2 6 9 """ demo_tree = bst.BSTree(keys=[7, 5, 2, 6, 8, 9]) class BSTTest(unittest.TestCase): """ 二叉搜索树测试 """ def test_insert_node(self): """ 插入...
[ "source.tree.bst.tree_successor", "source.tree.bst.inorder_tree_walk_stack", "source.tree.bst.inorder_tree_walk_recursive", "source.tree.bst.tree_maximum", "source.tree.bst.Node", "source.tree.bst.tree_minimum", "source.tree.bst.tree_predecessor", "source.tree.bst.BSTree", "source.tree.bst.inorder_t...
[((165, 200), 'source.tree.bst.BSTree', 'bst.BSTree', ([], {'keys': '[7, 5, 2, 6, 8, 9]'}), '(keys=[7, 5, 2, 6, 8, 9])\n', (175, 200), False, 'from source.tree import bst\n'), ((373, 388), 'source.tree.bst.Node', 'bst.Node', ([], {'key': '(3)'}), '(key=3)\n', (381, 388), False, 'from source.tree import bst\n'), ((437, ...
from datasette import hookimpl from datasette.utils.asgi import Response ROBOTS_TXT = """ Sitemap: https://cryptics.eigenfoo.xyz/sitemap.xml """.strip() SITEMAP_XML = """ <?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url><loc>https://cryptics.eigenfoo.xyz/data...
[ "datasette.utils.asgi.Response", "datasette.utils.asgi.Response.text" ]
[((909, 934), 'datasette.utils.asgi.Response.text', 'Response.text', (['ROBOTS_TXT'], {}), '(ROBOTS_TXT)\n', (922, 934), False, 'from datasette.utils.asgi import Response\n'), ((967, 1025), 'datasette.utils.asgi.Response', 'Response', (['SITEMAP_XML', '(200)'], {'content_type': '"""application/xml"""'}), "(SITEMAP_XML,...
import unittest class TestLogoMain(unittest.TestCase): def test_imports(self): try: from dreamcoder.domains.logo.main import ( animateSolutions, dreamFromGrammar, list_options, outputDreams, enumerateDreams, ...
[ "unittest.main" ]
[((557, 572), 'unittest.main', 'unittest.main', ([], {}), '()\n', (570, 572), False, 'import unittest\n')]
# Created By: <NAME> # Created On: 2010-02-06 # Copyright 2011 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "BSD" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licenses/bsd_...
[ "logging.warning", "objc.typedSelector" ]
[((845, 874), 'objc.typedSelector', 'objc.typedSelector', (['signature'], {}), '(signature)\n', (863, 874), False, 'import objc\n'), ((2813, 2880), 'logging.warning', 'logging.warning', (['"""%r doesn\'t have a node at path %r"""', 'self.py', 'path'], {}), '("%r doesn\'t have a node at path %r", self.py, path)\n', (282...
import shutil import subprocess # nosec # have to use subprocess import warnings from collections import Counter from copy import deepcopy from os import listdir, makedirs from os.path import abspath, basename, dirname, exists, isfile, join from subprocess import PIPE # nosec # have to use subprocess from tempfile im...
[ "f90nml.write", "dateutil.relativedelta.relativedelta", "f90nml.Namelist", "copy.deepcopy", "numpy.arange", "os.path.exists", "os.listdir", "subprocess.run", "pandas.DataFrame", "warnings.warn", "numpy.ones", "openscm_units.unit_registry", "os.path.isfile", "os.path.dirname", "scmdata.ru...
[((1232, 1247), 'os.listdir', 'listdir', (['source'], {}), '(source)\n', (1239, 1247), False, 'from os import listdir, makedirs\n'), ((1164, 1195), 'shutil.copytree', 'shutil.copytree', (['source', 'target'], {}), '(source, target)\n', (1179, 1195), False, 'import shutil\n'), ((1260, 1274), 'os.path.exists', 'exists', ...
import json import json import boto3 import re import json import collections import os import pandas as pd import csv from csv import writer # boto3 S3 initialization s3_client = boto3.client("s3") import numpy as np def lambda_handler(event, context): # TODO implement bucketname = 'sourcedatab00870639' ...
[ "boto3.client", "os.path.join", "numpy.zeros", "boto3.resource", "pandas.DataFrame", "csv.reader" ]
[((181, 199), 'boto3.client', 'boto3.client', (['"""s3"""'], {}), "('s3')\n", (193, 199), False, 'import boto3\n'), ((625, 666), 'os.path.join', 'os.path.join', (['sourcebucket', 'file_key_name'], {}), '(sourcebucket, file_key_name)\n', (637, 666), False, 'import os\n'), ((2414, 2440), 'numpy.zeros', 'np.zeros', (['(si...
from lib.plugins import Driver import os from paramiko import SSHClient, RSAKey, AutoAddPolicy from io import StringIO class Ssh(Driver): DEFAULT_KEY_PATH = "~/.ssh/id_rsa" def __init__(self, host, username='root', password = None, key = None, port = 22, path = "/proc"): Driver.__init__(self) self._host = host ...
[ "paramiko.AutoAddPolicy", "os.path.join", "lib.plugins.Driver.__init__", "io.StringIO", "paramiko.SSHClient", "os.path.expanduser" ]
[((278, 299), 'lib.plugins.Driver.__init__', 'Driver.__init__', (['self'], {}), '(self)\n', (293, 299), False, 'from lib.plugins import Driver\n'), ((669, 679), 'io.StringIO', 'StringIO', ([], {}), '()\n', (677, 679), False, 'from io import StringIO\n'), ((704, 734), 'os.path.join', 'os.path.join', (['self._path', 'pat...
""" Friends-of-Friends (FOF) for N-body simulations <NAME> - Oct 2016 """ from __future__ import absolute_import, print_function from lizard.periodic import pad_unitcube from scipy.spatial import Delaunay from scipy.sparse import csr_matrix, csgraph from numpy import square, flatnonzero, ones, zeros_like, cumsum, con...
[ "numpy.argsort", "numpy.random.RandomState", "pylab.ylim", "lizard.periodic.pad_unitcube", "pylab.plot", "numpy.sort", "numpy.flatnonzero", "numpy.diff", "lizard.log.VerboseTimingLog", "pylab.xlim", "numpy.concatenate", "numpy.square", "numpy.bincount", "pylab.show", "scipy.sparse.csgrap...
[((1200, 1220), 'lizard.periodic.pad_unitcube', 'pad_unitcube', (['pos', 'b'], {}), '(pos, b)\n', (1212, 1220), False, 'from lizard.periodic import pad_unitcube\n'), ((1523, 1540), 'scipy.spatial.Delaunay', 'Delaunay', (['all_pos'], {}), '(all_pos)\n', (1531, 1540), False, 'from scipy.spatial import Delaunay\n'), ((163...
from logger import logger from ...file_utils import file_exists, dir_exists from ...path_utils import get_newest_filepath from ...prompt_utils import weights_scratch_prompt, weights_newest_prompt class ResumeWeightsChecker: def __init__(self, resume: bool, resume_path: str=None, weights_save_dir: str=None, weights...
[ "logger.logger.warning" ]
[((1524, 1629), 'logger.logger.warning', 'logger.warning', (['f"""weights_save_dir hasn\'t been provided for detecting the newest weights path."""'], {}), '(\n f"weights_save_dir hasn\'t been provided for detecting the newest weights path."\n )\n', (1538, 1629), False, 'from logger import logger\n'), ((1755, 1823...
from __future__ import print_function import os import sys from pyspark import SparkContext, SQLContext import pyspark.sql.functions as sql import pyspark.sql.types as types import unicodecsv from dateutil.parser import parse sc = SparkContext(appName="BHLParquet") sqlContext = SQLContext(sc) def as_int(s): retu...
[ "dateutil.parser.parse", "pyspark.sql.types.DateType", "os.path.join", "pyspark.sql.types.IntegerType", "pyspark.sql.functions.col", "os.path.isdir", "unicodecsv.DictReader", "pyspark.SQLContext", "pyspark.sql.types.StringType", "pyspark.SparkContext" ]
[((233, 267), 'pyspark.SparkContext', 'SparkContext', ([], {'appName': '"""BHLParquet"""'}), "(appName='BHLParquet')\n", (245, 267), False, 'from pyspark import SparkContext, SQLContext\n'), ((281, 295), 'pyspark.SQLContext', 'SQLContext', (['sc'], {}), '(sc)\n', (291, 295), False, 'from pyspark import SparkContext, SQ...
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 # # 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 wit...
[ "logging.getLogger", "requests_aws4auth.AWS4Auth", "elasticsearch.Elasticsearch", "boto3.Session", "crhelper.CfnResource" ]
[((1226, 1253), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1243, 1253), False, 'import logging\n'), ((1345, 1418), 'crhelper.CfnResource', 'CfnResource', ([], {'json_logging': '(False)', 'log_level': '"""DEBUG"""', 'boto_level': '"""CRITICAL"""'}), "(json_logging=False, log_level='DE...
import numpy as np from numpy.core.fromnumeric import size class BrownionPathGen: def __init__(self, NumPaths, Maturity): self.NumPaths = NumPaths self.Maturity = Maturity # this is in days # this is not optimal lets make a matrix of the std normal and then perform the operation to # ch...
[ "numpy.random.standard_normal", "numpy.zeros" ]
[((453, 503), 'numpy.random.standard_normal', 'np.random.standard_normal', ([], {'size': '[self.NumPaths, 1]'}), '(size=[self.NumPaths, 1])\n', (478, 503), True, 'import numpy as np\n'), ((1037, 1065), 'numpy.zeros', 'np.zeros', (['[self.NumPaths, 1]'], {}), '([self.NumPaths, 1])\n', (1045, 1065), True, 'import numpy a...
""" Module defining transfer functions """ from typing import List, Optional, Dict, Any, Union from pydantic import validator, constr import numpy as np import plotly.graph_objects as go from plotly.subplots import make_subplots from resistics.common import Metadata class Component(Metadata): """ Data class ...
[ "plotly.subplots.make_subplots", "pydantic.validator", "numpy.reciprocal", "numpy.power", "pydantic.constr", "numpy.unwrap", "numpy.array", "warnings.warn", "numpy.mod", "numpy.arctan" ]
[((3479, 3500), 'pydantic.constr', 'constr', ([], {'max_length': '(16)'}), '(max_length=16)\n', (3485, 3500), False, 'from pydantic import validator, constr\n'), ((8972, 9002), 'pydantic.validator', 'validator', (['"""name"""'], {'always': '(True)'}), "('name', always=True)\n", (8981, 9002), False, 'from pydantic impor...
import codecs from setuptools import setup from setuptools import find_packages with codecs.open('README.rst', 'r', 'utf-8') as f: readme = f.read() with codecs.open('Changelog.rst', 'r', 'utf-8') as f: changes = f.read() long_description = '\n\n' + readme + '\n\n' + changes setup( name='pytaxize', versi...
[ "codecs.open", "setuptools.find_packages" ]
[((86, 125), 'codecs.open', 'codecs.open', (['"""README.rst"""', '"""r"""', '"""utf-8"""'], {}), "('README.rst', 'r', 'utf-8')\n", (97, 125), False, 'import codecs\n'), ((160, 202), 'codecs.open', 'codecs.open', (['"""Changelog.rst"""', '"""r"""', '"""utf-8"""'], {}), "('Changelog.rst', 'r', 'utf-8')\n", (171, 202), Fa...
from typing import Optional from django.contrib.auth.models import User from django.db import models from django.db.models.aggregates import Count from django.db.models.query import QuerySet from django.db.models.query_utils import Q from django.urls import reverse from django_extensions.db.models import TimeStampedMo...
[ "django.db.models.OneToOneField", "django.db.models.TextField", "django.db.models.ForeignKey", "django.db.models.ManyToManyField", "django.db.models.aggregates.Count", "django.db.models.BooleanField", "django.db.models.query_utils.Q", "django.urls.reverse", "django.db.models.CharField" ]
[((423, 472), 'django.db.models.ForeignKey', 'models.ForeignKey', (['User'], {'on_delete': 'models.PROTECT'}), '(User, on_delete=models.PROTECT)\n', (440, 472), False, 'from django.db import models\n'), ((487, 544), 'django.db.models.ManyToManyField', 'models.ManyToManyField', (['Image'], {'related_name': '"""collectio...
from tensorflow.keras.models import Model from tensorflow.keras.layers import Input, Dense, LSTM, Embedding from tensorflow.keras.optimizers import RMSprop from datagen import * # Defining the layers to be used in the model transfer_values_input = Input(shape=(2048,), name='transfer_values_input') decoder_transfer_map...
[ "tensorflow.keras.layers.Input", "tensorflow.keras.layers.Embedding", "tensorflow.keras.layers.LSTM", "tensorflow.keras.layers.Dense", "tensorflow.keras.models.Model", "tensorflow.keras.optimizers.RMSprop" ]
[((249, 299), 'tensorflow.keras.layers.Input', 'Input', ([], {'shape': '(2048,)', 'name': '"""transfer_values_input"""'}), "(shape=(2048,), name='transfer_values_input')\n", (254, 299), False, 'from tensorflow.keras.layers import Input, Dense, LSTM, Embedding\n'), ((323, 352), 'tensorflow.keras.layers.Dense', 'Dense', ...
import os appen_lexicon_file = '/data/USE_ASR001/USE_ASR001/TABLE/LEXICON.TBL' vocab_file='../data/local/lm/vocab.txt' if not os.path.exists('../data/local/lm'): os.mkdir('../data/local/lm') fid = open(appen_lexicon_file) all_lines = fid.readlines() fid.close() fid = open(vocab_file,'w') for ln in all_lines: ...
[ "os.path.exists", "os.mkdir" ]
[((127, 161), 'os.path.exists', 'os.path.exists', (['"""../data/local/lm"""'], {}), "('../data/local/lm')\n", (141, 161), False, 'import os\n'), ((167, 195), 'os.mkdir', 'os.mkdir', (['"""../data/local/lm"""'], {}), "('../data/local/lm')\n", (175, 195), False, 'import os\n')]
__author__ = '<NAME>' __website__ = 'https://www.iabdullahmughal.com' __twitter__ = '@iabdullahmughal' import os class FileSize: def __init__(self, file_path): self.__file_path__ = file_path # https://stackoverflow.com/questions/2104080/how-to-check-file-size-in-python @staticmethod def __co...
[ "os.stat" ]
[((829, 856), 'os.stat', 'os.stat', (['self.__file_path__'], {}), '(self.__file_path__)\n', (836, 856), False, 'import os\n')]