code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""
Created on Tuesday Dec 26 11:00 2018
@author: <EMAIL>
"""
import jsonpickle
jsonpickle.set_encoder_options('simplejson', sort_keys=True, indent=4)
jsonpickle.set_encoder_options('demjson', compactly=False)
def json_dump_model(model, file_path):
with open(file_path + '.json', 'w') as outfile:
outfil... | [
"jsonpickle.set_encoder_options",
"jsonpickle.encode"
] | [((83, 153), 'jsonpickle.set_encoder_options', 'jsonpickle.set_encoder_options', (['"""simplejson"""'], {'sort_keys': '(True)', 'indent': '(4)'}), "('simplejson', sort_keys=True, indent=4)\n", (113, 153), False, 'import jsonpickle\n'), ((154, 212), 'jsonpickle.set_encoder_options', 'jsonpickle.set_encoder_options', (['... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from hwt.code import connect
from hwt.interfaces.std import VectSignal
from hwt.synthesizer.unit import Unit
from hwtLib.examples.base_serialization_TC import BaseSerializationTC
class TmpVarExample(Unit):
def _declr(self):
self.a = VectSignal(32)
se... | [
"unittest.TestSuite",
"unittest.makeSuite",
"hwt.interfaces.std.VectSignal",
"hwt.code.connect",
"unittest.TextTestRunner"
] | [((690, 710), 'unittest.TestSuite', 'unittest.TestSuite', ([], {}), '()\n', (708, 710), False, 'import unittest\n'), ((842, 878), 'unittest.TextTestRunner', 'unittest.TextTestRunner', ([], {'verbosity': '(3)'}), '(verbosity=3)\n', (865, 878), False, 'import unittest\n'), ((295, 309), 'hwt.interfaces.std.VectSignal', 'V... |
from django.test import TestCase
from accounts.models import User
class UserTestCase(TestCase):
"""
Some simple tests to augment login/logout with test_api
"""
def test_create_user(self):
user = User.objects.create_superuser('<EMAIL>', 'bugsy')
self.assertEqual(user.get_full_name(), ... | [
"accounts.models.User.objects.create_superuser"
] | [((223, 272), 'accounts.models.User.objects.create_superuser', 'User.objects.create_superuser', (['"""<EMAIL>"""', '"""bugsy"""'], {}), "('<EMAIL>', 'bugsy')\n", (252, 272), False, 'from accounts.models import User\n'), ((443, 492), 'accounts.models.User.objects.create_superuser', 'User.objects.create_superuser', (['""... |
import logging
class StorageAdapter(object):
"""
所有存储数据都要实现的基类
"""
def __init__(self, base_query=None, *args, **kwargs):
"""
初始化公共属性
"""
self.kwargs = kwargs
self.logger = kwargs.get('logger', logging.getLogger(__name__))
self.adapter_supp... | [
"logging.getLogger"
] | [((265, 292), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (282, 292), False, 'import logging\n')] |
import pygame
# Initialize the game engine
pygame.init()
size = (700, 500)
screen = pygame.display.set_mode(size)
# Define some colors
BLACK = ( 0, 0, 0)
WHITE = ( 255, 255, 255)
GREEN = ( 0, 255, 0)
RED = ( 255, 0, 0)
BLUE = ( 0, 0, 255)
# Loop until the user clicks the close but... | [
"pygame.init",
"pygame.event.get",
"pygame.display.set_mode",
"pygame.display.flip",
"pygame.time.Clock"
] | [((43, 56), 'pygame.init', 'pygame.init', ([], {}), '()\n', (54, 56), False, 'import pygame\n'), ((85, 114), 'pygame.display.set_mode', 'pygame.display.set_mode', (['size'], {}), '(size)\n', (108, 114), False, 'import pygame\n'), ((393, 412), 'pygame.time.Clock', 'pygame.time.Clock', ([], {}), '()\n', (410, 412), False... |
import logging
import sys
from . import shell
from .args import get_parsed_args, get_sample_config, get_version
from .options import Options
def main():
options = Options(get_parsed_args())
setup_logging(options.log_level)
if options.version:
print(get_version())
return 0
if options.sample_config:
... | [
"logging.basicConfig",
"sys.exit"
] | [((495, 589), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'level', 'format': '"""%(asctime)s:%(levelname)s:%(name)s:%(message)s"""'}), "(level=level, format=\n '%(asctime)s:%(levelname)s:%(name)s:%(message)s')\n", (514, 589), False, 'import logging\n'), ((749, 768), 'sys.exit', 'sys.exit', (['exit_c... |
from pylagrit import PyLaGriT
import numpy
x = numpy.arange(0,10.1,1)
y = x
z = [0,1]
lg = PyLaGriT()
mqua = lg.gridder(x,y,z,elem_type='hex',connect=True)
mqua.rotateln([mqua.xmin-0.1,0,0],[mqua.xmax+0.1,0,0],25)
mqua.dump_exo('rotated.exo')
mqua.dump_ats_xml('rotated.xml','rotated.exo')
mqua.paraview()
| [
"pylagrit.PyLaGriT",
"numpy.arange"
] | [((48, 72), 'numpy.arange', 'numpy.arange', (['(0)', '(10.1)', '(1)'], {}), '(0, 10.1, 1)\n', (60, 72), False, 'import numpy\n'), ((93, 103), 'pylagrit.PyLaGriT', 'PyLaGriT', ([], {}), '()\n', (101, 103), False, 'from pylagrit import PyLaGriT\n')] |
with open("data.input") as source_file:
import pickle
a_list = pickle.load(source_file)
def insertion_sort(seq):
for n in range(1, len(seq)):
item = seq[n]
hole = n
while hole > 0 and seq[hole - 1] > item:
seq[hole] = seq[hole - 1]
hole = hole - 1
seq... | [
"pickle.load"
] | [((71, 95), 'pickle.load', 'pickle.load', (['source_file'], {}), '(source_file)\n', (82, 95), False, 'import pickle\n')] |
## interaction / scripts / create_translation_repository.py
'''
This script will pre-calculate the translation operators for a given bounding
box, max level, and frequency steps for a multi-level fast multipole algorithm.
This can take hours to days depending on the number of threads available, size
of bounding box, n... | [
"interaction3.bem.core.db_functions.get_order",
"multiprocessing.cpu_count",
"numpy.array",
"numpy.arange",
"itertools.repeat",
"os.remove",
"os.path.exists",
"argparse.ArgumentParser",
"pandas.DataFrame",
"numpy.meshgrid",
"interaction3.bem.core.fma_functions.fft_quadrule",
"interaction3.bem.... | [((907, 946), 'sqlite3.register_adapter', 'sql.register_adapter', (['np.float64', 'float'], {}), '(np.float64, float)\n', (927, 946), True, 'import sqlite3 as sql\n'), ((947, 986), 'sqlite3.register_adapter', 'sql.register_adapter', (['np.float32', 'float'], {}), '(np.float32, float)\n', (967, 986), True, 'import sqlit... |
import os
import datetime
from typing import Dict, Optional, Any, List
from markdown_subtemplate import caching as __caching
from markdown_subtemplate.infrastructure import markdown_transformer
from markdown_subtemplate.exceptions import ArgumentExpectedException, TemplateNotFoundException
from markdown_subtemplate im... | [
"markdown_subtemplate.caching.get_cache",
"markdown_subtemplate.exceptions.TemplateNotFoundException",
"datetime.datetime.now",
"markdown_subtemplate.logging.get_log",
"markdown_subtemplate.storage.get_storage",
"markdown_subtemplate.infrastructure.markdown_transformer.transform",
"markdown_subtemplate.... | [((785, 806), 'markdown_subtemplate.caching.get_cache', '__caching.get_cache', ([], {}), '()\n', (804, 806), True, 'from markdown_subtemplate import caching as __caching\n'), ((817, 836), 'markdown_subtemplate.logging.get_log', '__logging.get_log', ([], {}), '()\n', (834, 836), True, 'from markdown_subtemplate import l... |
import httplib2
import json
import random
import requests
import string
from flask import Flask, render_template, request, redirect, url_for, \
flash, jsonify, session as login_session, make_response
from oauth2client.client import flow_from_clientsecrets, FlowExchangeError
from sqlalchemy import create_engine
fro... | [
"flask.render_template",
"flask.request.args.get",
"sqlalchemy.orm.sessionmaker",
"random.choice",
"flask.session.get",
"flask.flash",
"flask.Flask",
"sqlalchemy.create_engine",
"database_setup.MenuItem",
"json.dumps",
"oauth2client.client.flow_from_clientsecrets",
"requests.get",
"flask.url... | [((419, 434), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (424, 434), False, 'from flask import Flask, render_template, request, redirect, url_for, flash, jsonify, session as login_session, make_response\n'), ((445, 537), 'sqlalchemy.create_engine', 'create_engine', (['"""sqlite:///restaurantmenu.db"""'... |
'''
Copyright (c) 2019 Katana Cryptographic Ltd. All Rights Reserved.
A class allowing to download the latest snapshots of Whirpool's transaction graph.
'''
import sys
import getopt
import requests
from random import randint
from whirlpool_stats.utils.constants import *
class Downloader(object):
def __init__(self... | [
"getopt.getopt",
"requests.session",
"sys.exit",
"sys.stdout.flush",
"random.randint",
"sys.stdout.write"
] | [((2297, 2427), 'sys.stdout.write', 'sys.stdout.write', (['"""python download_snapshot.py [--target_dir=/tmp] [--denoms=05,005,001] [--socks5=localhost:9050]\n"""'], {}), '(\n """python download_snapshot.py [--target_dir=/tmp] [--denoms=05,005,001] [--socks5=localhost:9050]\n"""\n )\n', (2313, 2427), False, 'impo... |
import util.logger as logger
class Authentication(object):
@staticmethod
def read_password_file(password_file, username, password):
authenticated = False
users = dict()
try:
with open(password_file) as f:
for l in f:
line = l.strip()
... | [
"util.logger.logging.debug"
] | [((914, 980), 'util.logger.logging.debug', 'logger.logging.debug', (["('Password file %s not found' % password_file)"], {}), "('Password file %s not found' % password_file)\n", (934, 980), True, 'import util.logger as logger\n'), ((802, 867), 'util.logger.logging.debug', 'logger.logging.debug', (['"""username is not co... |
from concurrent.futures import ProcessPoolExecutor
from functools import partial
from .funcs import process_csv_line, process_raw_speech_text
def process_line(this_line, do_stemming=False, remove_stopwords=False):
"""
Given a line from the CSV file, gets the stemmed tokens.
"""
speech = process_csv_li... | [
"functools.partial",
"concurrent.futures.ProcessPoolExecutor"
] | [((1398, 1432), 'concurrent.futures.ProcessPoolExecutor', 'ProcessPoolExecutor', ([], {'max_workers': '(4)'}), '(max_workers=4)\n', (1417, 1432), False, 'from concurrent.futures import ProcessPoolExecutor\n'), ((1821, 1907), 'functools.partial', 'partial', (['process_line'], {'do_stemming': 'do_stemming', 'remove_stopw... |
import pandas as pd
import numpy as np
import umap
import sklearn.cluster as cluster
from sklearn.cluster import KMeans
from sklearn.cluster import DBSCAN
import spacy
import unicodedata
import matplotlib.pyplot as plt
import logging
logging.basicConfig(format='%(asctime)s %(message)s', level=logging.INFO)
logging.getL... | [
"logging.basicConfig",
"logging.getLogger",
"sklearn.cluster.KMeans",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"spacy.load",
"numpy.arange",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.asarray",
"sklearn.cluster.DBSCAN",
"matplotlib.pyplot.figure",
"numpy.sign",
"uma... | [((234, 307), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s %(message)s"""', 'level': 'logging.INFO'}), "(format='%(asctime)s %(message)s', level=logging.INFO)\n", (253, 307), False, 'import logging\n'), ((784, 812), 'spacy.load', 'spacy.load', (['"""en_core_web_md"""'], {}), "('en_core_... |
"""Add xref reference to current concepts and update ICD-O namespace."""
import sys
from pathlib import Path
from timeit import default_timer as timer
import click
from boto3.dynamodb.conditions import Attr
PROJECT_ROOT = Path(__file__).resolve().parents[1]
sys.path.append(f"{PROJECT_ROOT}")
from disease.database imp... | [
"pathlib.Path",
"timeit.default_timer",
"click.echo",
"boto3.dynamodb.conditions.Attr",
"disease.database.Database",
"sys.path.append"
] | [((259, 293), 'sys.path.append', 'sys.path.append', (['f"""{PROJECT_ROOT}"""'], {}), "(f'{PROJECT_ROOT}')\n", (274, 293), False, 'import sys\n'), ((460, 470), 'disease.database.Database', 'Database', ([], {}), '()\n', (468, 470), False, 'from disease.database import Database\n'), ((1910, 1920), 'disease.database.Databa... |
# Copyright 2019 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"PIL.Image.fromarray",
"tensorflow.shape",
"tensorflow.saved_model.loader.load",
"numpy.array",
"delf.feature_extractor.DelfFeaturePostProcessing"
] | [((2438, 2460), 'PIL.Image.fromarray', 'Image.fromarray', (['image'], {}), '(image)\n', (2453, 2460), False, 'from PIL import Image\n'), ((2933, 3055), 'tensorflow.saved_model.loader.load', 'tf.saved_model.loader.load', (['sess', '[tf.saved_model.tag_constants.SERVING]', 'config.model_path'], {'import_scope': 'import_s... |
"""
Integrations Repository
"""
import logging
from .. import entities, exceptions, services, miscellaneous
logger = logging.getLogger(name=__name__)
class Integrations:
"""
Datasets repository
"""
def __init__(self, client_api: services.ApiClient, org: entities.Organization = None,
... | [
"logging.getLogger"
] | [((119, 151), 'logging.getLogger', 'logging.getLogger', ([], {'name': '__name__'}), '(name=__name__)\n', (136, 151), False, 'import logging\n')] |
"""This module contains functions that visualise solar agent control."""
from __future__ import annotations
from typing import Tuple, Dict, List
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
import seaborn as sns
from solara.plot.constants import COLORS, LABELS, MARKERS
def default_setup(figs... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.xlabel",
"seaborn.set_context",
"seaborn.set_style",
"matplotlib.pyplot.figure",
"matplotlib.rc",
"matplotlib.patches.Patch",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.subplots",
"numpy.ara... | [((439, 494), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': 'figsize', 'dpi': '(100)', 'tight_layout': '(True)'}), '(figsize=figsize, dpi=100, tight_layout=True)\n', (449, 494), True, 'import matplotlib.pyplot as plt\n'), ((499, 540), 'seaborn.set_style', 'sns.set_style', (['"""ticks"""', "{'dashes': False... |
"""Tests for plotting."""
import contextlib
import io
import warnings
import matplotlib.axes
import matplotlib.collections
import matplotlib.figure
import matplotlib.legend
import matplotlib.lines
import matplotlib.pyplot as plt
import numpy as np
import os
import unittest
import aspecd.exceptions
from aspecd import ... | [
"numpy.random.rand",
"aspecd.plotting.MultiPlotter",
"aspecd.plotting.Caption",
"aspecd.plotting.SinglePlotProperties",
"aspecd.plotting.SinglePlotter1D",
"aspecd.dataset.Dataset",
"os.remove",
"os.path.exists",
"aspecd.plotting.GridProperties",
"aspecd.plotting.Plotter",
"aspecd.plotting.Compos... | [((429, 447), 'aspecd.plotting.Plotter', 'plotting.Plotter', ([], {}), '()\n', (445, 447), False, 'from aspecd import plotting, utils, dataset\n'), ((523, 552), 'os.path.isfile', 'os.path.isfile', (['self.filename'], {}), '(self.filename)\n', (537, 552), False, 'import os\n'), ((941, 976), 'aspecd.utils.full_class_name... |
import cv2
import numpy as np
import socket
# Define IP Address for Arduinos and PORT Number
Arduino_1 = '192.168.100.16'
Arduino_2 = '192.168.100.17'
Server_Result = '192.168.100.13'
PORT_1 = 8888
MONITORING_PORT = 4500
class Connection:
def __init__(self, HOST, PORT):
self.HOST = HOST
... | [
"cv2.rectangle",
"socket.socket",
"cv2.imshow",
"numpy.array",
"cv2.dnn_DetectionModel",
"cv2.VideoCapture",
"cv2.dnn.NMSBoxes",
"cv2.waitKey"
] | [((2136, 2183), 'cv2.dnn_DetectionModel', 'cv2.dnn_DetectionModel', (['weightsPath', 'configPath'], {}), '(weightsPath, configPath)\n', (2158, 2183), False, 'import cv2\n'), ((3073, 3124), 'cv2.dnn.NMSBoxes', 'cv2.dnn.NMSBoxes', (['bbox', 'confs', 'thres', 'nms_threshold'], {}), '(bbox, confs, thres, nms_threshold)\n',... |
from .database import db_session
from .models import User
from flask import Flask
from flask_login import LoginManager
import os
app = Flask(__name__)
app.config.from_object(__name__)
login_manager = LoginManager()
login_manager.init_app(app)
login_manager.login_view = 'login'
app.jinja_env.lstrip_blocks = True
app... | [
"flask_login.LoginManager",
"os.path.join",
"flask.Flask"
] | [((137, 152), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (142, 152), False, 'from flask import Flask\n'), ((203, 217), 'flask_login.LoginManager', 'LoginManager', ([], {}), '()\n', (215, 217), False, 'from flask_login import LoginManager\n'), ((388, 428), 'os.path.join', 'os.path.join', (['app.root_pat... |
import numpy as np
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import
import xml.etree.ElementTree as ET
from os.path import isfile, join
from os import getcwd
from scipy.spatial import distance
##############################
# MACROS
############################... | [
"numpy.radians",
"numpy.sqrt",
"numpy.polyfit",
"numpy.argsort",
"numpy.array",
"numpy.linalg.norm",
"numpy.poly1d",
"numpy.sin",
"scipy.spatial.distance",
"numpy.max",
"numpy.linspace",
"numpy.dot",
"numpy.matmul",
"numpy.vstack",
"numpy.min",
"numpy.degrees",
"numpy.reciprocal",
... | [((1825, 1841), 'numpy.array', 'np.array', (['center'], {}), '(center)\n', (1833, 1841), True, 'import numpy as np\n'), ((2123, 2146), 'numpy.polyfit', 'np.polyfit', (['xs', 'ys', 'deg'], {}), '(xs, ys, deg)\n', (2133, 2146), True, 'import numpy as np\n'), ((2472, 2489), 'numpy.poly1d', 'np.poly1d', (['coeffs'], {}), '... |
#!/usr/bin/env python
import rospy
import math
import tf
from tf.transformations import *
from moveit_python import (MoveGroupInterface,
PlanningSceneInterface,
PickPlaceInterface)
import sys
import copy
import moveit_commander
import moveit_msgs.msg
from geomet... | [
"moveit_commander.RobotCommander",
"rospy.is_shutdown",
"moveit_python.MoveGroupInterface",
"rospy.init_node",
"geometry_msgs.msg.Quaternion",
"geometry_msgs.msg.PoseStamped",
"tf.TransformListener",
"rospy.Time",
"moveit_commander.roscpp_initialize"
] | [((2709, 2753), 'moveit_commander.roscpp_initialize', 'moveit_commander.roscpp_initialize', (['sys.argv'], {}), '(sys.argv)\n', (2743, 2753), False, 'import moveit_commander\n'), ((2758, 2788), 'rospy.init_node', 'rospy.init_node', (['"""xbox_teleop"""'], {}), "('xbox_teleop')\n", (2773, 2788), False, 'import rospy\n')... |
#!/usr/bin/env python3
# -*- coding: future_fstrings -*-
from db_sync_tool.utility import output
from file_sync_tool import info
def print_header(mute):
"""
Printing console header
:param mute: Boolean
:return:
"""
if mute is False:
print(output.CliFormat.BLACK + '####################... | [
"db_sync_tool.utility.output.message"
] | [((1258, 1315), 'db_sync_tool.utility.output.message', 'output.message', (['output.Subject.INFO', '_message', '(True)', '(True)'], {}), '(output.Subject.INFO, _message, True, True)\n', (1272, 1315), False, 'from db_sync_tool.utility import output\n')] |
from django.contrib.auth import get_user_model
from django.shortcuts import render
def about_us(request):
context = {
'members': get_user_model().objects.all()
}
return render(request, 'about_us.html', context)
| [
"django.shortcuts.render",
"django.contrib.auth.get_user_model"
] | [((191, 232), 'django.shortcuts.render', 'render', (['request', '"""about_us.html"""', 'context'], {}), "(request, 'about_us.html', context)\n", (197, 232), False, 'from django.shortcuts import render\n'), ((143, 159), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (157, 159), False, 'from dj... |
############################################################################
#
# Copyright (c) Mamba Developers. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
############################################################################
""" TCP In... | [
"xmlrpc.client.ServerProxy",
"mamba.core.exceptions.ComponentConfigException"
] | [((1109, 1177), 'mamba.core.exceptions.ComponentConfigException', 'ComponentConfigException', (['"""Missing port in Instrument Configuration"""'], {}), "('Missing port in Instrument Configuration')\n", (1133, 1177), False, 'from mamba.core.exceptions import ComponentConfigException\n'), ((1466, 1504), 'xmlrpc.client.Se... |
from CHECLabPy.plotting.setup import Plotter
from sstcam_sandbox import get_plot
from CHECLabPy.core.io import HDF5Reader
from os.path import join
import numpy as np
from matplotlib.colors import LogNorm
from IPython import embed
class Hist2D(Plotter):
def __init__(self, xlabel, ylabel):
super().__init__(... | [
"sstcam_sandbox.get_plot",
"numpy.logical_and",
"os.path.join",
"CHECLabPy.core.io.HDF5Reader",
"matplotlib.colors.LogNorm"
] | [((584, 635), 'sstcam_sandbox.get_plot', 'get_plot', (['"""d190524_time_gradient/correlations/data"""'], {}), "('d190524_time_gradient/correlations/data')\n", (592, 635), False, 'from sstcam_sandbox import get_plot\n'), ((646, 662), 'CHECLabPy.core.io.HDF5Reader', 'HDF5Reader', (['path'], {}), '(path)\n', (656, 662), F... |
"""Helper functinos for pgesmd."""
import json
import os
import requests
import logging
import time
from datetime import datetime
from operator import itemgetter
from xml.etree import cElementTree as ET
from io import StringIO
_LOGGER = logging.getLogger(__name__)
def get_auth_file(auth_path=f"{os.getcwd()}/auth/au... | [
"logging.getLogger",
"time.localtime",
"json.loads",
"requests.post",
"xml.etree.cElementTree.fromstring",
"os.getcwd",
"operator.itemgetter",
"io.StringIO",
"xml.etree.cElementTree.iterparse"
] | [((239, 266), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (256, 266), False, 'import logging\n'), ((1813, 1831), 'xml.etree.cElementTree.fromstring', 'ET.fromstring', (['xml'], {}), '(xml)\n', (1826, 1831), True, 'from xml.etree import cElementTree as ET\n'), ((2786, 2804), 'xml.etree.... |
# <NAME> <<EMAIL>>
import argparse
import logging
import torch
from torch.utils.data import TensorDataset, DataLoader, SequentialSampler
from transformers import BertTokenizer, BertForSequenceClassification
import numpy as np
import pandas as pd
from tqdm.auto import tqdm
class Example:
def __init__(self, sent0, ... | [
"logging.basicConfig",
"torch.manual_seed",
"argparse.ArgumentParser",
"pandas.read_csv",
"transformers.BertTokenizer.from_pretrained",
"torch.utils.data.SequentialSampler",
"torch.utils.data.TensorDataset",
"pandas.DataFrame.from_dict",
"torch.tensor",
"transformers.BertForSequenceClassification.... | [((881, 944), 'torch.tensor', 'torch.tensor', (['[x.input_ids for x in features]'], {'dtype': 'torch.long'}), '([x.input_ids for x in features], dtype=torch.long)\n', (893, 944), False, 'import torch\n'), ((963, 1027), 'torch.tensor', 'torch.tensor', (['[x.input_mask for x in features]'], {'dtype': 'torch.bool'}), '([x... |
# A Simple Alarm clock for a practise project
import datetime
import time
import random
import os
def set_time():
print(" What time would you like to set your alarm?:")
hour = int(input(" HOUR (1-24):"))
minute = int(input(" MINUTE (0-59):"))
while hour not in range(1, 25) ... | [
"datetime.datetime.now",
"time.sleep"
] | [((655, 678), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (676, 678), False, 'import datetime\n'), ((1795, 1808), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (1805, 1808), False, 'import time\n')] |
# Borrowed from
# https://pythonhosted.org/an_example_pypi_project/setuptools.html
import os
from setuptools import setup, find_packages
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README f... | [
"os.path.dirname",
"setuptools.find_packages"
] | [((715, 730), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (728, 730), False, 'from setuptools import setup, find_packages\n'), ((410, 435), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (425, 435), False, 'import os\n')] |
import argparse, logging, subprocess, time, multiprocessing
from pathlib import Path
if __name__=="__main__":
# Initialize the logger
logging.basicConfig(format='%(asctime)s - %(name)-8s - %(levelname)-8s - %(message)s',
datefmt='%d-%b-%y %H:%M:%S')
logger = logging.getLogger("main"... | [
"logging.basicConfig",
"logging.getLogger",
"argparse.ArgumentParser",
"pathlib.Path",
"multiprocessing.cpu_count",
"time.sleep"
] | [((143, 268), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s - %(name)-8s - %(levelname)-8s - %(message)s"""', 'datefmt': '"""%d-%b-%y %H:%M:%S"""'}), "(format=\n '%(asctime)s - %(name)-8s - %(levelname)-8s - %(message)s', datefmt=\n '%d-%b-%y %H:%M:%S')\n", (162, 268), False, 'impo... |
# -*- coding: utf-8 -*-
import os
import pandas as pd
from fooltrader.api.technical import to_security_item
from fooltrader.contract.files_contract import get_event_path
from fooltrader.utils import pd_utils
from fooltrader.utils.pd_utils import df_for_date_range
def get_event(security_item, event_type='finance_fo... | [
"os.path.exists",
"fooltrader.utils.pd_utils.df_for_date_range",
"fooltrader.utils.pd_utils.pd_read_csv",
"pandas.DataFrame",
"fooltrader.api.technical.to_security_item",
"fooltrader.contract.files_contract.get_event_path"
] | [((815, 846), 'fooltrader.api.technical.to_security_item', 'to_security_item', (['security_item'], {}), '(security_item)\n', (831, 846), False, 'from fooltrader.api.technical import to_security_item\n'), ((858, 899), 'fooltrader.contract.files_contract.get_event_path', 'get_event_path', (['security_item', 'event_type']... |
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import functools
import logging
from pathlib import Path
from pants.backend.codegen.grpcio.python.grpcio_prep import GrpcioPrep
from pants.backend.codegen.grpcio.python.python_grpcio_libr... | [
"logging.debug",
"pathlib.Path",
"pants.base.exceptions.TaskError",
"pants.python.pex_build_util.identify_missing_init_files",
"functools.partial",
"logging.info",
"pants.base.build_environment.get_buildroot"
] | [((1446, 1516), 'logging.debug', 'logging.debug', (['f"""Executing grpcio code generation with args: [{args}]"""'], {}), "(f'Executing grpcio code generation with args: [{args}]')\n", (1459, 1516), False, 'import logging\n'), ((1586, 1703), 'functools.partial', 'functools.partial', (['self.context.new_workunit'], {'nam... |
from sqlalchemy import (
CheckConstraint, Column, Float, ForeignKey,
Numeric, Integer, Table, Text
)
from sqlalchemy.orm import relationship
from column import DateTime
from db import Base
class Account(Base):
__tablename__ = 'account'
PSEUDONYM_MIN = 800000
PSEUDONYM_MAX = 899999
id = Colu... | [
"sqlalchemy.orm.relationship",
"sqlalchemy.Numeric",
"sqlalchemy.ForeignKey",
"sqlalchemy.CheckConstraint",
"sqlalchemy.Column"
] | [((316, 361), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)', 'index': '(True)'}), '(Integer, primary_key=True, index=True)\n', (322, 361), False, 'from sqlalchemy import CheckConstraint, Column, Float, ForeignKey, Numeric, Integer, Table, Text\n'), ((656, 688), 'sqlalchemy.Column', 'Column', (['... |
#!/usr/bin/env python
# coding: utf-8
import pickle
import argparse
import spacy
from pyfiglet import Figlet
def custom_tokenizer(text):
"""
converts a string into a text of tokens using spacy
"""
tokens = []
for t in nlp(text):
if not(len(t) < 2 or t.is_stop or t.like_num or
... | [
"spacy.load",
"pyfiglet.Figlet",
"pickle.load",
"argparse.ArgumentParser"
] | [((789, 876), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Classifies lyric string and predicts artist"""'}), "(description=\n 'Classifies lyric string and predicts artist')\n", (812, 876), False, 'import argparse\n'), ((885, 908), 'pyfiglet.Figlet', 'Figlet', ([], {'font': '"""graf... |
import argparse
import numpy as np
from matplotlib import pyplot as plt
def main(FLAGS):
some_data = np.random.rand(256, 256)
print(FLAGS.data_dir)
plt.matshow(some_data)
plt.show()
if __name__ == '__main__':
# Instantiates an arg parser
parser = argparse.ArgumentParser()
# Estab... | [
"matplotlib.pyplot.matshow",
"numpy.random.rand",
"argparse.ArgumentParser",
"matplotlib.pyplot.show"
] | [((110, 134), 'numpy.random.rand', 'np.random.rand', (['(256)', '(256)'], {}), '(256, 256)\n', (124, 134), True, 'import numpy as np\n'), ((167, 189), 'matplotlib.pyplot.matshow', 'plt.matshow', (['some_data'], {}), '(some_data)\n', (178, 189), True, 'from matplotlib import pyplot as plt\n'), ((195, 205), 'matplotlib.p... |
from flask import Flask, request
from flask_cors import CORS
import json
import os
from myLogisticRegression import getPredictions
app = Flask(__name__)
CORS(app)
@app.route("/")
def index():
return "Welcome to safe streets machine learning flask server"
@app.route("/predict", methods=["POST"])
de... | [
"flask_cors.CORS",
"flask.Flask",
"json.dumps",
"os.environ.get",
"flask.request.get_json",
"myLogisticRegression.getPredictions"
] | [((145, 160), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (150, 160), False, 'from flask import Flask, request\n'), ((162, 171), 'flask_cors.CORS', 'CORS', (['app'], {}), '(app)\n', (166, 171), False, 'from flask_cors import CORS\n'), ((356, 385), 'flask.request.get_json', 'request.get_json', ([], {'sil... |
from __future__ import annotations
import os
import re
from collections.abc import Iterator
from dataclasses import dataclass, field
INSTR_RE = re.compile(r'(?P<name>\w+) (?P<arg>[-+]\d+)')
def main():
this_dir = os.path.dirname(os.path.abspath(__file__))
input_file = os.path.join(this_dir, 'input.txt')
... | [
"os.path.abspath",
"os.path.join",
"dataclasses.field",
"re.compile"
] | [((146, 192), 're.compile', 're.compile', (['"""(?P<name>\\\\w+) (?P<arg>[-+]\\\\d+)"""'], {}), "('(?P<name>\\\\w+) (?P<arg>[-+]\\\\d+)')\n", (156, 192), False, 'import re\n'), ((281, 316), 'os.path.join', 'os.path.join', (['this_dir', '"""input.txt"""'], {}), "(this_dir, 'input.txt')\n", (293, 316), False, 'import os\... |
import numpy as np
_dtype = np.dtype([("x", np.uint16), ("y", np.uint16), ("p", np.bool_), ("ts", np.uint64)])
class DVSSpikeTrain(np.recarray):
"""Common type for event based vision datasets"""
__name__ = "SparseVisionSpikeTrain"
def __new__(cls, nb_of_spikes, *args, width=-1, height=-1, duration=-1, ... | [
"numpy.dtype"
] | [((29, 116), 'numpy.dtype', 'np.dtype', (["[('x', np.uint16), ('y', np.uint16), ('p', np.bool_), ('ts', np.uint64)]"], {}), "([('x', np.uint16), ('y', np.uint16), ('p', np.bool_), ('ts', np.\n uint64)])\n", (37, 116), True, 'import numpy as np\n')] |
from pathlib import Path
import responses # type: ignore
import json
import gzip
import os
from launchable.utils.session import read_session
from tests.cli_test_case import CliTestCase
from unittest import mock
class CTestTest(CliTestCase):
test_files_dir = Path(__file__).parent.joinpath(
'../data/ctest/... | [
"launchable.utils.session.read_session",
"unittest.mock.patch.dict",
"pathlib.Path",
"gzip.decompress"
] | [((363, 442), 'unittest.mock.patch.dict', 'mock.patch.dict', (['os.environ', "{'LAUNCHABLE_TOKEN': CliTestCase.launchable_token}"], {}), "(os.environ, {'LAUNCHABLE_TOKEN': CliTestCase.launchable_token})\n", (378, 442), False, 'from unittest import mock\n'), ((1005, 1084), 'unittest.mock.patch.dict', 'mock.patch.dict', ... |
#!/usr/bin/env python
#
# Copyright 2016-present <NAME>.
#
# Licensed under the MIT License.
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://opensource.org/licenses/mit-license.html
#
# Unless required by applicable law or agreed to in writing, sof... | [
"npcore.layer.objectives.MAELoss",
"numpy.random.rand",
"npcore.layer.gates.ReLU",
"numpy.array",
"numpy.random.seed",
"unittest.main",
"npcore.layer.link.Link",
"npcore.layer.objectives.SoftmaxCrossentropyLoss",
"npcore.layer.gates.Linear"
] | [((1256, 1273), 'numpy.random.seed', 'np.random.seed', (['(2)'], {}), '(2)\n', (1270, 1273), True, 'import numpy as np\n'), ((3483, 3498), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3496, 3498), False, 'import unittest\n'), ((1582, 1602), 'numpy.random.rand', 'np.random.rand', (['(3)', '(3)'], {}), '(3, 3)\n'... |
import argparse
from unittest import TestCase
import pytest
from pytorch_lightning import Trainer
from pl_bolts.models.rl.double_dqn_model import DoubleDQN
from pl_bolts.models.rl.dqn_model import DQN
from pl_bolts.models.rl.dueling_dqn_model import DuelingDQN
from pl_bolts.models.rl.noisy_dqn_model import NoisyDQN
f... | [
"pytorch_lightning.Trainer.add_argparse_args",
"argparse.ArgumentParser",
"pytest.mark.skip",
"pl_bolts.models.rl.noisy_dqn_model.NoisyDQN",
"pl_bolts.models.rl.dqn_model.DQN.add_model_specific_args",
"pl_bolts.models.rl.dqn_model.DQN",
"pl_bolts.models.rl.double_dqn_model.DoubleDQN",
"pytorch_lightni... | [((1867, 1917), 'pytest.mark.skip', 'pytest.mark.skip', ([], {'reason': '"""CI is killing this test"""'}), "(reason='CI is killing this test')\n", (1883, 1917), False, 'import pytest\n'), ((459, 498), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'add_help': '(False)'}), '(add_help=False)\n', (482, 498), ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2018-09-11 01:24
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import taggit.managers
class Migration(migrations.Migration):
dependencies = [
('taggit', '0002_auto_20150616_2121'),... | [
"django.db.models.AutoField",
"django.db.models.CharField",
"django.db.models.ForeignKey"
] | [((830, 872), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(2)'}), '(blank=True, max_length=2)\n', (846, 872), False, 'from django.db import migrations, models\n'), ((1004, 1047), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(20)'... |
import fuzzy
import Levenshtein
from STT_DeepSpeech.DataProcessingComponents.data_processing_result import DataProcessingResult
class Validator:
soundex = fuzzy.Soundex(4)
def __init__(self, key_sentences : dict):
self.key_sentences = key_sentences
def validate_phonetic_similarities(self, in... | [
"fuzzy.Soundex",
"STT_DeepSpeech.DataProcessingComponents.data_processing_result.DataProcessingResult",
"Levenshtein.distance"
] | [((162, 178), 'fuzzy.Soundex', 'fuzzy.Soundex', (['(4)'], {}), '(4)\n', (175, 178), False, 'import fuzzy\n'), ((1601, 1703), 'STT_DeepSpeech.DataProcessingComponents.data_processing_result.DataProcessingResult', 'DataProcessingResult', ([], {'success': '(False)', 'is_wake_up_word': '(False)', 'sentence': 'input_text', ... |
from django.conf import settings
from rest_framework.authentication import TokenAuthentication
from rest_framework.authtoken.models import Token
from rest_framework.exceptions import AuthenticationFailed
from datetime import timedelta
from django.utils import timezone
# this return left time
def expires_at(token):
... | [
"django.utils.timezone.now",
"rest_framework.exceptions.AuthenticationFailed",
"datetime.timedelta",
"rest_framework.authtoken.models.Token.objects.create"
] | [((338, 352), 'django.utils.timezone.now', 'timezone.now', ([], {}), '()\n', (350, 352), False, 'from django.utils import timezone\n'), ((566, 586), 'datetime.timedelta', 'timedelta', ([], {'seconds': '(0)'}), '(seconds=0)\n', (575, 586), False, 'from datetime import timedelta\n'), ((868, 905), 'rest_framework.authtoke... |
"""
Contains possible interactions with the Chado Features
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import csv
import hashlib
import operator
import re
import time
from functools import reduce
from BCBio im... | [
"hashlib.md5",
"functools.reduce",
"Bio.Seq.Seq",
"Bio.SeqFeature.FeatureLocation",
"time.time",
"future.standard_library.install_aliases",
"chakin.io.warn",
"Bio.SeqIO.parse",
"chado.client.Client.__init__",
"BCBio.GFF.GFFExaminer",
"re.sub",
"BCBio.GFF.parse",
"re.search"
] | [((524, 558), 'future.standard_library.install_aliases', 'standard_library.install_aliases', ([], {}), '()\n', (556, 558), False, 'from future import standard_library\n'), ((733, 785), 'chado.client.Client.__init__', 'Client.__init__', (['self', 'engine', 'metadata', 'session', 'ci'], {}), '(self, engine, metadata, ses... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Codec wrapper for the zfp lossless image coder
"""
import os
import enb
from enb.config import options
class Zfp(enb.icompression.LosslessCodec, enb.icompression.NearLosslessCodec, enb.icompression.WrapperCodec):
"""Wrapper for the zfp codec
"""
def __ini... | [
"os.path.abspath",
"os.path.dirname",
"enb.aanalysis.TwoColumnScatterAnalyzer",
"enb.aanalysis.ScalarDistributionAnalyzer"
] | [((366, 391), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (381, 391), False, 'import os\n'), ((1636, 1661), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (1651, 1661), False, 'import os\n'), ((1911, 1953), 'enb.aanalysis.ScalarDistributionAnalyzer', 'enb.aanalys... |
# %% Do LDA Topic Modeling
# Imports
from sklearn.decomposition import LatentDirichletAllocation as LDA
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.model_selection import GridSearchCV
import pandas as pd
# %% Import Cleaned Documents
events = ['2020_Nov_Post', '2020_Nov', '2020_Nov_Pre', '... | [
"matplotlib.colors.TABLEAU_COLORS.items",
"gensim.models.LdaModel",
"gensim.corpora.Dictionary",
"pandas.read_csv",
"nrclex.NRCLex",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.margins",
"wordcloud.WordCloud",
"gensim.models.CoherenceModel",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.a... | [((2999, 3035), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(3)', '(2)'], {'figsize': '(10, 10)'}), '(3, 2, figsize=(10, 10))\n', (3011, 3035), True, 'import matplotlib.pyplot as plt\n'), ((3312, 3330), 'matplotlib.pyplot.tight_layout', 'plt.tight_layout', ([], {}), '()\n', (3328, 3330), True, 'import matplotlib.p... |
import sys
import numpy as np
sys.path.append('..')
from Game import Game
from .QubicLogic import Board
import itertools
class QubicGame(Game):
"""
Connect4 Game class implementing the alpha-zero-general Game interface.
"""
def __init__(self, depth = None, height=None, width=None, win_length=None, n... | [
"numpy.copy",
"numpy.unique",
"Game.Game.__init__",
"numpy.zeros",
"numpy.transpose",
"sys.path.append"
] | [((31, 52), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (46, 52), False, 'import sys\n'), ((344, 363), 'Game.Game.__init__', 'Game.__init__', (['self'], {}), '(self)\n', (357, 363), False, 'from Game import Game\n'), ((2164, 2211), 'numpy.zeros', 'np.zeros', (['((6, 2, 2, 2) + a.shape)'], {'dt... |
from torchvision import datasets, transforms
import torch
from base import BaseDataLoader
from utils.database import ModelReader
import numpy as np
class MnistDataLoader(BaseDataLoader):
"""MNIST data loading demo using BaseDataLoader"""
def __init__(self, data_dir, batch_size, shuffle, validation_split, num_... | [
"utils.database.ModelReader",
"torchvision.datasets.MNIST",
"torchvision.datasets.CIFAR10",
"torchvision.transforms.Normalize",
"torchvision.transforms.ToTensor",
"torch.FloatTensor"
] | [((543, 620), 'torchvision.datasets.MNIST', 'datasets.MNIST', (['self.data_dir'], {'train': 'training', 'download': '(True)', 'transform': 'trsfm'}), '(self.data_dir, train=training, download=True, transform=trsfm)\n', (557, 620), False, 'from torchvision import datasets, transforms\n'), ((1131, 1210), 'torchvision.dat... |
import imageio
# imageio.plugins.ffmpeg.download()
import numpy as np
import os
import argparse
import process_anno
from tqdm import tqdm
import torch
import torchvision.transforms as trn
from spatial_transforms import (
Compose,ToTensor)
import json
def extract_frames(output, dirname, filenames, frame_num, anno):
tr... | [
"os.path.exists",
"os.listdir",
"numpy.repeat",
"torchvision.transforms.ToPILImage",
"argparse.ArgumentParser",
"os.makedirs",
"numpy.round",
"os.path.join",
"numpy.linspace",
"spatial_transforms.ToTensor",
"json.load",
"torch.cat"
] | [((2076, 2101), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2099, 2101), False, 'import argparse\n'), ((2534, 2546), 'json.load', 'json.load', (['f'], {}), '(f)\n', (2543, 2546), False, 'import json\n'), ((2624, 2669), 'os.path.join', 'os.path.join', (['opt.file_path', 'opt.dataset_name'], ... |
import yaml
from k8s.models.common import ObjectMeta
from requests.exceptions import MissingSchema, InvalidURL
from .common import dict_merge, generate_random_uuid_string, ClientError
class MetadataGenerator:
def __init__(self, http_client, create_deployment_id=generate_random_uuid_string):
self.http_cli... | [
"yaml.safe_load",
"k8s.models.common.ObjectMeta"
] | [((2161, 2259), 'k8s.models.common.ObjectMeta', 'ObjectMeta', ([], {'name': 'application_name', 'namespace': 'namespace', 'labels': 'labels', 'annotations': 'annotations'}), '(name=application_name, namespace=namespace, labels=labels,\n annotations=annotations)\n', (2171, 2259), False, 'from k8s.models.common import... |
"""
tSNE analysis for glbase expression objects.
This should really be merged with MDS and inherited...
"""
from operator import itemgetter
import numpy, random
import matplotlib.pyplot as plot
import matplotlib.patches
from mpl_toolkits.mplot3d import Axes3D, art3d
import scipy.cluster.vq
from sklearn.decompositi... | [
"sklearn.cluster.AgglomerativeClustering",
"scipy.cluster.hierarchy.dendrogram",
"sklearn.cluster.MiniBatchKMeans",
"numpy.column_stack",
"random.seed",
"sklearn.neighbors.NearestCentroid",
"sklearn.neighbors.kneighbors_graph",
"numpy.zeros"
] | [((2912, 2942), 'random.seed', 'random.seed', (['self.random_state'], {}), '(self.random_state)\n', (2923, 2942), False, 'import numpy, random\n'), ((9775, 9827), 'numpy.zeros', 'numpy.zeros', (['self.__full_model_fp.children_.shape[0]'], {}), '(self.__full_model_fp.children_.shape[0])\n', (9786, 9827), False, 'import ... |
from setuptools import find_packages, setup
VERSION = "1.5.0"
with open("requirements/common.in") as f:
REQUIREMENTS = list(
filter(
lambda req: not req.startswith("#") and not req.startswith("http") and req,
f.read().splitlines(),
)
)
with open("README.md", encoding="... | [
"setuptools.find_packages"
] | [((728, 795), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['*.tests', '*.tests.*', 'tests.*', 'tests']"}), "(exclude=['*.tests', '*.tests.*', 'tests.*', 'tests'])\n", (741, 795), False, 'from setuptools import find_packages, setup\n')] |
"""
Run main.
"""
from behave_graph import main
main()
| [
"behave_graph.main"
] | [((49, 55), 'behave_graph.main', 'main', ([], {}), '()\n', (53, 55), False, 'from behave_graph import main\n')] |
import win32con
import win32gui
import win32process
def get_hwnds_for_pid(pid):
def callback(hwnd, hwnds):
if win32gui.IsWindowVisible(hwnd) and win32gui.IsWindowEnabled(hwnd):
_, found_pid = win32process.GetWindowThreadProcessId(hwnd)
if found_pid == pid:
hwnds.app... | [
"win32gui.GetWindowRect",
"win32gui.EnumWindows",
"subprocess.Popen",
"time.sleep",
"win32gui.GetWindowText",
"win32gui.IsWindowEnabled",
"win32gui.IsWindowVisible",
"win32process.GetWindowThreadProcessId"
] | [((370, 407), 'win32gui.EnumWindows', 'win32gui.EnumWindows', (['callback', 'hwnds'], {}), '(callback, hwnds)\n', (390, 407), False, 'import win32gui\n'), ((536, 569), 'subprocess.Popen', 'subprocess.Popen', (["['notepad.exe']"], {}), "(['notepad.exe'])\n", (552, 569), False, 'import subprocess\n'), ((633, 648), 'time.... |
import numpy as np
class RunningScore(object):
def __init__(self, n_classes):
self.n_classes = n_classes
self.confusion_matrix = np.zeros((n_classes, n_classes))
@staticmethod
def _fast_hist(label_true, label_pred, n_class):
mask = (label_true >= 0) & (label_true < n_class)
... | [
"numpy.diag",
"numpy.array",
"numpy.zeros",
"numpy.nanmean",
"numpy.finfo"
] | [((1789, 1829), 'numpy.array', 'np.array', (['[1, 0, 0, 1, 1, 0, 1, 0, 1, 0]'], {}), '([1, 0, 0, 1, 1, 0, 1, 0, 1, 0])\n', (1797, 1829), True, 'import numpy as np\n'), ((1847, 1887), 'numpy.array', 'np.array', (['[1, 1, 0, 1, 0, 0, 1, 1, 0, 0]'], {}), '([1, 1, 0, 1, 0, 0, 1, 1, 0, 0])\n', (1855, 1887), True, 'import nu... |
# Copyright (c) 2013-2016 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software
# and associated documentation files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use, copy, modify, merge, publish,
# distrib... | [
"plugins.util.admin"
] | [((1119, 1126), 'plugins.util.admin', 'admin', ([], {}), '()\n', (1124, 1126), False, 'from plugins.util import admin\n'), ((1587, 1601), 'plugins.util.admin', 'admin', (['"""leave"""'], {}), "('leave')\n", (1592, 1601), False, 'from plugins.util import admin\n'), ((2849, 2866), 'plugins.util.admin', 'admin', (['"""shu... |
from pyquil.api import WavefunctionSimulator
from pyquil import Program
from pyquil.gates import *
prog = Program(
H(0),
CNOT(0, 1),
)
print(prog)
wavefunction = WavefunctionSimulator().wavefunction(prog)
print(wavefunction) | [
"pyquil.api.WavefunctionSimulator"
] | [((170, 193), 'pyquil.api.WavefunctionSimulator', 'WavefunctionSimulator', ([], {}), '()\n', (191, 193), False, 'from pyquil.api import WavefunctionSimulator\n')] |
import h2o
from h2o.exceptions import H2OResponseError
from tests import pyunit_utils
import tempfile
from collections import OrderedDict
from h2o.grid.grid_search import H2OGridSearch
from h2o.estimators.gbm import H2OGradientBoostingEstimator
def test_frame_reload():
work_dir = tempfile.mkdtemp()
iris = h2o... | [
"collections.OrderedDict",
"h2o.load_frame",
"tests.pyunit_utils.locate",
"h2o.remove",
"h2o.remove_all",
"tempfile.mkdtemp",
"h2o.grid.grid_search.H2OGridSearch",
"tests.pyunit_utils.standalone_test"
] | [((287, 305), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (303, 305), False, 'import tempfile\n'), ((907, 939), 'h2o.load_frame', 'h2o.load_frame', (['df_key', 'work_dir'], {}), '(df_key, work_dir)\n', (921, 939), False, 'import h2o\n'), ((945, 961), 'h2o.remove', 'h2o.remove', (['iris'], {}), '(iris)\n',... |
from django.shortcuts import render
from django.core import serializers
from . models import Sensor, Devices, Online, Speedtest
import json
from django.http import HttpResponse
from django.views.decorators.http import require_GET
# Create your views here.
def index(request):
template='temprature/index.html'
result... | [
"django.shortcuts.render"
] | [((386, 420), 'django.shortcuts.render', 'render', (['request', 'template', 'context'], {}), '(request, template, context)\n', (392, 420), False, 'from django.shortcuts import render\n'), ((552, 586), 'django.shortcuts.render', 'render', (['request', 'template', 'context'], {}), '(request, template, context)\n', (558, ... |
from tkinter import *
from FaceSetBuilder.myTkinter import myButton
class Front(Frame):
def __init__(self, master, w, h):
super().__init__(master, bg='#295a75', width=w, height=h)
self.info = None
self.bar = None
self.entry = None
self.confirm = None
self.set_layo... | [
"FaceSetBuilder.myTkinter.myButton"
] | [((953, 983), 'FaceSetBuilder.myTkinter.myButton', 'myButton', (['self'], {'text': '"""Confirm"""'}), "(self, text='Confirm')\n", (961, 983), False, 'from FaceSetBuilder.myTkinter import myButton\n')] |
import sys
import util
from node import Node
from state import State
def applicable(state, actions):
''' Return a list of applicable actions in a given `state`. '''
app = list()
for act in actions:
if State(state).intersect(act.precond) == act.precond:
app.append(act)
return app
de... | [
"state.State"
] | [((688, 699), 'state.State', 'State', (['goal'], {}), '(goal)\n', (693, 699), False, 'from state import State\n'), ((448, 472), 'state.State', 'State', (['action.pos_effect'], {}), '(action.pos_effect)\n', (453, 472), False, 'from state import State\n'), ((533, 545), 'state.State', 'State', (['state'], {}), '(state)\n'... |
#coding=utf-8
#coding=utf-8
'''
Created on 2014-12-16
@author: Devuser
'''
import os
from gatesidelib.filehelper import FileHelper
from gatesidelib.common.simplelogger import SimpleLogger
class GitHelper(object):
'''
git command helper
'''
git_clonecommand="git clone -b {BRANCHNAME} {REPERTORY} {PROJ... | [
"os.path.exists",
"gatesidelib.filehelper.FileHelper.delete_file",
"gatesidelib.filehelper.FileHelper.get_linecounts",
"gatesidelib.filehelper.FileHelper.read_lines",
"gatesidelib.filehelper.FileHelper.delete_dir_all",
"os.popen",
"gatesidelib.common.simplelogger.SimpleLogger.info"
] | [((1031, 1055), 'os.popen', 'os.popen', (['gitcommandtext'], {}), '(gitcommandtext)\n', (1039, 1055), False, 'import os\n'), ((1192, 1220), 'os.path.exists', 'os.path.exists', (['self.project'], {}), '(self.project)\n', (1206, 1220), False, 'import os\n'), ((1373, 1406), 'gatesidelib.common.simplelogger.SimpleLogger.in... |
import sublime
import time
from . import log
def trace(func):
def tracer(*args, **kwargs):
start = now()
name = nameof(func)
if log.TRACE:
print('(go trace) {}'.format(name))
resp = func(*args, **kwargs)
if log.TRACE:
print('(go trace) {} ({}ms)'.format(
name,
now() -... | [
"time.time"
] | [((399, 410), 'time.time', 'time.time', ([], {}), '()\n', (408, 410), False, 'import time\n')] |
#!/usr/bin/env python
from __future__ import print_function
import rospy
import yaml
import numpy as np #np.dot
import os.path
from math import cos, sin
from sensor_msgs.msg import JointState
from integ_gkd_models.srv import Dynamic_inverse,Dynamic_inverseResponse
path=os.path.dirname(__file__)
with open(os.path.jo... | [
"integ_gkd_models.srv.Dynamic_inverseResponse",
"rospy.init_node",
"sensor_msgs.msg.JointState",
"rospy.Service",
"math.cos",
"yaml.safe_load",
"numpy.dot",
"numpy.linalg.inv",
"rospy.spin",
"math.sin"
] | [((367, 384), 'yaml.safe_load', 'yaml.safe_load', (['f'], {}), '(f)\n', (381, 384), False, 'import yaml\n'), ((1142, 1154), 'sensor_msgs.msg.JointState', 'JointState', ([], {}), '()\n', (1152, 1154), False, 'from sensor_msgs.msg import JointState\n'), ((1244, 1275), 'integ_gkd_models.srv.Dynamic_inverseResponse', 'Dyna... |
'''OpenGL extension NV.vdpau_interop
This module customises the behaviour of the
OpenGL.raw.GL.NV.vdpau_interop to provide a more
Python-friendly API
Overview (from the spec)
This extension allows VDPAU video and output surfaces to be used
for texturing and rendering.
This allows the GL to process... | [
"OpenGL.wrapper.wrapper",
"OpenGL.extensions.hasGLExtension"
] | [((1202, 1244), 'OpenGL.extensions.hasGLExtension', 'extensions.hasGLExtension', (['_EXTENSION_NAME'], {}), '(_EXTENSION_NAME)\n', (1227, 1244), False, 'from OpenGL import extensions\n'), ((1373, 1419), 'OpenGL.wrapper.wrapper', 'wrapper.wrapper', (['glVDPAURegisterVideoSurfaceNV'], {}), '(glVDPAURegisterVideoSurfaceNV... |
"""
Class to hold challenge information df & relevant methods.
Loads & stores from csv.
"""
##########
# Imports
##########
import os
import sys
import pandas as pd
from logger.scrape_info import logging
import constants
##########
# Challenge Info
##########
class SavedInfo(object):
## Constants
CSV_F... | [
"logger.scrape_info.logging.debug",
"os.path.exists",
"pandas.DataFrame",
"pandas.read_csv"
] | [((839, 872), 'os.path.exists', 'os.path.exists', (['self.CSV_FILENAME'], {}), '(self.CSV_FILENAME)\n', (853, 872), False, 'import os\n'), ((1855, 1903), 'logger.scrape_info.logging.debug', 'logging.debug', (['f"""- Locating... {challenge_name}"""'], {}), "(f'- Locating... {challenge_name}')\n", (1868, 1903), False, 'f... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat May 29 18:13:24 2021
@author: tae-jun_yoon
"""
import numpy as np
from scipy.signal import savgol_filter
from scipy.optimize import newton
from PyOECP import References
def ListReferences():
AvailableReferences = dir(References)
for EachRefer... | [
"numpy.copy",
"numpy.log10",
"numpy.ones",
"numpy.imag",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"scipy.optimize.newton",
"numpy.array",
"matplotlib.pyplot.figure",
"numpy.real",
"matplotlib.pyplot.title",
"pprint.pprint",
"matplotlib.pyplot.show"
] | [((688, 723), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(5, 5)', 'dpi': '(250)'}), '(figsize=(5, 5), dpi=250)\n', (698, 723), True, 'import matplotlib.pyplot as plt\n'), ((738, 762), 'numpy.array', 'np.array', (['[1000000000.0]'], {}), '([1000000000.0])\n', (746, 762), True, 'import numpy as np\n'), (... |
""" Slicelet for SBN Project """
import logging #pylint: disable=unused-import
import time
import datetime
import json
import os
import ctk
import qt
import slicer
from slicer.ScriptedLoadableModule import *
from sbn.config import Config
from sbn import functions, workflow
#pylint: disable=useless-object-inheritanc... | [
"sbn.functions.remove_all_transforms",
"slicer.mrmlScene.GetNodeByID",
"slicer.util.findChild",
"qt.QLineEdit",
"sbn.workflow.create_models",
"slicer.modules.plusremote.widgetRepresentation",
"sbn.workflow.setup_ultrasound_live",
"qt.QGroupBox",
"sbn.workflow.setup_neurostim_view",
"time.sleep",
... | [((33322, 33373), 'slicer.mrmlScene.GetNodeByID', 'slicer.mrmlScene.GetNodeByID', (['"""vtkMRMLSliceNodeRed"""'], {}), "('vtkMRMLSliceNodeRed')\n", (33350, 33373), False, 'import slicer\n'), ((33394, 33436), 'slicer.modules.volumereslicedriver.logic', 'slicer.modules.volumereslicedriver.logic', ([], {}), '()\n', (33434... |
# NOTE: You can only use Tensor API of PyTorch
import math
import torch
class FullyConnected:
"""Constructs the Neural Network architecture.
Args:
N_in (int): input size
N_h1 (int): hidden layer 1 size
N_h2 (int): hidden layer 2 size
N_out (int): output size
... | [
"nnet.optimizer.mbgd",
"torch.mean",
"torch.max",
"nnet.loss.cross_entropy_loss",
"torch.argmax",
"nnet.loss.delta_cross_entropy_softmax",
"nnet.activation.delta_sigmoid",
"torch.matmul",
"torch.t",
"torch.rand",
"torch.device"
] | [((1606, 1626), 'torch.device', 'torch.device', (['device'], {}), '(device)\n', (1618, 1626), False, 'import torch\n'), ((1643, 1665), 'torch.rand', 'torch.rand', (['N_h1', 'N_in'], {}), '(N_h1, N_in)\n', (1653, 1665), False, 'import torch\n'), ((1680, 1702), 'torch.rand', 'torch.rand', (['N_h2', 'N_h1'], {}), '(N_h2, ... |
from tests.util import match_object_snapshot
from tests.analyzer.util import analyze
input = """
list:
- value
- value
- value
- value
- value
""".strip()
def test_list_item_analysis():
analysis = analyze(input)
assert match_object_snapshot(analysis, 'tests/analyzer/snapshots/list_item_analysis... | [
"tests.util.match_object_snapshot",
"tests.analyzer.util.analyze"
] | [((217, 231), 'tests.analyzer.util.analyze', 'analyze', (['input'], {}), '(input)\n', (224, 231), False, 'from tests.analyzer.util import analyze\n'), ((244, 336), 'tests.util.match_object_snapshot', 'match_object_snapshot', (['analysis', '"""tests/analyzer/snapshots/list_item_analysis.snap.yaml"""'], {}), "(analysis,\... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
##
## mds.py
##
## Created on: Dec 3, 2017
## Author: <NAME>
## E-mail: <EMAIL>
##
# print function as in Python3
#==============================================================================
from __future__ import print_function
from minds.check import Consiste... | [
"minds.satls.SATLitsSep",
"minds.mxsatl.MaxSATLits",
"sys.exit",
"minds.minds1.MinDS1Rules",
"minds.mxsatsp.MaxSATSparse",
"minds.twostage.TwoStageApproach",
"resource.getrusage",
"six.itervalues",
"minds.satr.SATRules",
"minds.check.ConsistencyChecker",
"minds.satl.SATLits",
"minds.data.Data"... | [((1211, 1242), 'minds.twostage.TwoStageApproach', 'TwoStageApproach', (['data', 'options'], {}), '(data, options)\n', (1227, 1242), False, 'from minds.twostage import TwoStageApproach\n'), ((3897, 3914), 'minds.options.Options', 'Options', (['sys.argv'], {}), '(sys.argv)\n', (3904, 3914), False, 'from minds.options im... |
from contextlib import contextmanager
import logging
from pkg_resources import parse_version
import sys
import time
from pykafka.exceptions import RdKafkaStoppedException, ConsumerStoppedException
from pykafka.simpleconsumer import SimpleConsumer, OffsetType
from pykafka.utils.compat import get_bytes
from pykafka.util... | [
"logging.getLogger",
"sys.exc_info",
"pkg_resources.parse_version",
"time.time",
"pykafka.utils.error_handlers.valid_int"
] | [((407, 434), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (424, 434), False, 'import logging\n'), ((2643, 2676), 'pykafka.utils.error_handlers.valid_int', 'valid_int', (['fetch_error_backoff_ms'], {}), '(fetch_error_backoff_ms)\n', (2652, 2676), False, 'from pykafka.utils.error_handler... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | [
"pytest.raises"
] | [((1328, 1353), 'pytest.raises', 'pytest.raises', (['ValueError'], {}), '(ValueError)\n', (1341, 1353), False, 'import pytest\n'), ((1558, 1583), 'pytest.raises', 'pytest.raises', (['ValueError'], {}), '(ValueError)\n', (1571, 1583), False, 'import pytest\n')] |
# -*- coding: utf-8 -*-
import pandas as pd
import os
import numpy as np
from datetime import datetime
import time
start = time.time()
df1 = pd.read_csv('C:/CODE/RAW FILES/try2.csv', delimiter=",", encoding = "utf-8")
df2 = pd.read_csv('C:/CODE/RAW FILES/try3.csv', delimiter=",", encoding = "utf-8")
df1_col = df1.col... | [
"pandas.merge",
"time.time",
"pandas.read_csv",
"pandas.melt"
] | [((124, 135), 'time.time', 'time.time', ([], {}), '()\n', (133, 135), False, 'import time\n'), ((143, 217), 'pandas.read_csv', 'pd.read_csv', (['"""C:/CODE/RAW FILES/try2.csv"""'], {'delimiter': '""","""', 'encoding': '"""utf-8"""'}), "('C:/CODE/RAW FILES/try2.csv', delimiter=',', encoding='utf-8')\n", (154, 217), True... |
#!/usr/bin/env python
# encoding: utf-8
import sys
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('input', type=str, help='input file')
parser.add_argument('--output', default='rom.v', help='output file (default: rom.v)')
parser.add_argument('--raw', action="store_true")
class Converter(object... | [
"argparse.ArgumentParser",
"sys.exit"
] | [((77, 102), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (100, 102), False, 'import argparse\n'), ((3249, 3260), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (3257, 3260), False, 'import sys\n')] |
import inspect
from concurrent.futures import ThreadPoolExecutor
import grpc
from koapy.backend.kiwoom_open_api_plus.grpc import KiwoomOpenApiPlusService_pb2_grpc
from koapy.backend.kiwoom_open_api_plus.grpc.KiwoomOpenApiPlusServiceClientStubWrapper import (
KiwoomOpenApiPlusServiceClientStubWrapper,
)
from koap... | [
"koapy.backend.kiwoom_open_api_plus.grpc.KiwoomOpenApiPlusService_pb2_grpc.KiwoomOpenApiPlusServiceStub",
"grpc.secure_channel",
"concurrent.futures.ThreadPoolExecutor",
"inspect.signature",
"grpc.insecure_channel",
"koapy.config.config.get_string",
"koapy.backend.kiwoom_open_api_plus.grpc.KiwoomOpenApi... | [((3787, 3864), 'koapy.backend.kiwoom_open_api_plus.grpc.KiwoomOpenApiPlusService_pb2_grpc.KiwoomOpenApiPlusServiceStub', 'KiwoomOpenApiPlusService_pb2_grpc.KiwoomOpenApiPlusServiceStub', (['self._channel'], {}), '(self._channel)\n', (3849, 3864), False, 'from koapy.backend.kiwoom_open_api_plus.grpc import KiwoomOpenAp... |
"""
Design a class to find the kth largest element in a stream. Note that it is the kth largest element
in the sorted order, not the kth distinct element. Your KthLargest class will have a constructor which
accepts an integer k and an integer array nums, which contains initial elements from the stream. For each
call... | [
"heapq.heappush",
"heapq.heappop"
] | [((1770, 1797), 'heapq.heappush', 'heappush', (['self.minHeap', 'val'], {}), '(self.minHeap, val)\n', (1778, 1797), False, 'from heapq import heappush, heappop\n'), ((1849, 1870), 'heapq.heappop', 'heappop', (['self.minHeap'], {}), '(self.minHeap)\n', (1856, 1870), False, 'from heapq import heappush, heappop\n')] |
# Copyright 2020 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | [
"tensorflow.round",
"tensorflow.equal",
"tensorflow.shape",
"tensorflow.reduce_sum",
"tensorflow.debugging.assert_equal",
"tensorflow.cast",
"tensorflow_compression.python.ops.gen_ops.create_range_encoder",
"tensorflow.executing_eagerly",
"tensorflow_compression.python.ops.gen_ops.entropy_decode_fin... | [((1138, 1214), 'tensorflow.keras.utils.register_keras_serializable', 'tf.keras.utils.register_keras_serializable', ([], {'package': '"""tensorflow_compression"""'}), "(package='tensorflow_compression')\n", (1180, 1214), True, 'import tensorflow as tf\n'), ((9031, 9098), 'tensorflow.TensorShape', 'tf.TensorShape', (['(... |
from copy import copy
def get_counts_from_template(template):
return {c: template.count(c) for c in template}
def get_pairs_from_template(template):
pairs_list = [i + j for i, j in zip(template, template[1:])]
pairs = {pair: pairs_list.count(pair) for pair in set(pairs_list)}
return pairs
def pro... | [
"copy.copy"
] | [((433, 444), 'copy.copy', 'copy', (['pairs'], {}), '(pairs)\n', (437, 444), False, 'from copy import copy\n')] |
#!/usr/bin/env python
import confluent_kafka
import json
import time
from pprint import pprint
def test_version():
print('Using confluent_kafka module version %s (0x%x)' % confluent_kafka.version())
sver, iver = confluent_kafka.version()
assert len(sver) > 0
assert iver > 0
print('Using librdkafk... | [
"confluent_kafka.libversion",
"json.loads",
"confluent_kafka.version",
"confluent_kafka.Consumer"
] | [((222, 247), 'confluent_kafka.version', 'confluent_kafka.version', ([], {}), '()\n', (245, 247), False, 'import confluent_kafka\n'), ((390, 418), 'confluent_kafka.libversion', 'confluent_kafka.libversion', ([], {}), '()\n', (416, 418), False, 'import confluent_kafka\n'), ((1092, 1124), 'confluent_kafka.Consumer', 'con... |
import sys
import subprocess
import commands
import os
import six
import copy
import argparse
import time
from utils.stream import stream_by_running as get_stream_m
from utils.args import ArgumentGroup, print_arguments, inv_arguments
from finetune_args import parser as finetuning_parser
from extend_pos import extend_w... | [
"time.localtime",
"utils.stream.stream_by_running",
"os.path.exists",
"utils.args.print_arguments",
"argparse.ArgumentParser",
"utils.args.ArgumentGroup",
"subprocess.Popen",
"subprocess.CalledProcessError",
"os.environ.copy",
"time.sleep",
"os.path.dirname",
"commands.getstatusoutput",
"fin... | [((389, 421), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['__doc__'], {}), '(__doc__)\n', (412, 421), False, 'import argparse\n'), ((433, 531), 'utils.args.ArgumentGroup', 'ArgumentGroup', (['parser', '"""multiprocessing"""', '"""start paddle training using multi-processing mode."""'], {}), "(parser, 'multi... |
#!/usr/bin/env python
"""Displays the WMI classes and attributes of this Windows machine."""
# This creates an RDFS ontology out of the WMI classes of a Windows machine.
# It does not depend on a Survol installation.
# However, its classes and properties will overlap Survol's if it is installed.
# Also, because they... | [
"rdflib.Graph",
"os.path.splitext",
"lib_ontology_tools.serialize_ontology_to_graph",
"lib_export_ontology.flush_or_save_rdf_graph"
] | [((905, 968), 'lib_export_ontology.flush_or_save_rdf_graph', 'lib_export_ontology.flush_or_save_rdf_graph', (['graph', 'onto_filnam'], {}), '(graph, onto_filnam)\n', (948, 968), False, 'import lib_export_ontology\n'), ((632, 646), 'rdflib.Graph', 'rdflib.Graph', ([], {}), '()\n', (644, 646), False, 'import rdflib\n'), ... |
"""
Script for training the TempDPSOM model
Tensorboard instructions:
- from command line run: tensorboard --logdir="logs/{EXPERIMENT_NAME}/train" --port 8011
- go to: http://localhost:8011/
"""
import uuid
import sys
import timeit
from datetime import date
import numpy as np
try:
import tensorflow.compat.v1 a... | [
"TempDPSOM_model.TDPSOM",
"numpy.array",
"sacred.stflow.LogFileWriter",
"sys.exit",
"sklearn.metrics.normalized_mutual_info_score",
"numpy.arange",
"numpy.mean",
"numpy.reshape",
"tensorflow.Session",
"math.isnan",
"numpy.exp",
"numpy.stack",
"utils.print_trainable_vars",
"tensorflow.get_d... | [((844, 873), 'sacred.Experiment', 'sacred.Experiment', (['"""hyperopt"""'], {}), "('hyperopt')\n", (861, 873), False, 'import sacred\n'), ((330, 354), 'tensorflow.disable_v2_behavior', 'tf.disable_v2_behavior', ([], {}), '()\n', (352, 354), True, 'import tensorflow as tf\n'), ((894, 956), 'sacred.observers.FileStorage... |
# Copyright (c) 2021 YON
# This software is released under the MIT License, see LICENSE.
# 入力1 対象はてなブログ記事のURL
# 入力2 対象はてなブログ記事のHTML編集本文(クリップボードから取得)
# 処理 キーワードリンクが張られている記事内の全単語Xを、[]X[]という形に置換する
# 出力 置換後のHTML編集本文(クリップボードに格納される)
import re, sys
import requests, pyperclip
from bs4 import BeautifulSoup
import PySimpleGUI ... | [
"re.compile",
"PySimpleGUI.popup",
"PySimpleGUI.Text",
"requests.get",
"bs4.BeautifulSoup",
"PySimpleGUI.Button",
"PySimpleGUI.Multiline",
"PySimpleGUI.Input",
"sys.exit",
"PySimpleGUI.Window"
] | [((490, 530), 'PySimpleGUI.Window', 'sg.Window', (['"""hatena_remove_links"""', 'layout'], {}), "('hatena_remove_links', layout)\n", (499, 530), True, 'import PySimpleGUI as sg\n'), ((1173, 1213), 'PySimpleGUI.Window', 'sg.Window', (['"""hatena_remove_links"""', 'layout'], {}), "('hatena_remove_links', layout)\n", (118... |
#!/usr/bin/python3
import dns.resolver
import argparse
import ipaddress
from sys import exit
# Setup parser
parser = argparse.ArgumentParser(description='Bulk DNS Resolver (PTR, A, and AAAA)')
parser.add_argument('--input', '-i', required=True, help='newline delimited file containing IP addresses or hostnames to quer... | [
"ipaddress.ip_address",
"argparse.ArgumentParser",
"sys.exit"
] | [((119, 194), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Bulk DNS Resolver (PTR, A, and AAAA)"""'}), "(description='Bulk DNS Resolver (PTR, A, and AAAA)')\n", (142, 194), False, 'import argparse\n'), ((1047, 1053), 'sys.exit', 'exit', ([], {}), '()\n', (1051, 1053), False, 'from sys ... |
import pandas as pd
import numpy as np
from sklearn.preprocessing import OneHotEncoder
from datasets.dataset import Dataset
class AdultDataset(Dataset):
def __init__(self):
super().__init__(name="Adult Census", description="The Adult Census dataset")
self.cat_mappings = {
"education... | [
"sklearn.preprocessing.OneHotEncoder",
"numpy.sort",
"numpy.array",
"numpy.zeros",
"numpy.concatenate",
"pandas.DataFrame",
"numpy.genfromtxt"
] | [((3298, 3426), 'numpy.genfromtxt', 'np.genfromtxt', (['"""https://archive.ics.uci.edu/ml/machine-learning-databases/adult/adult.data"""'], {'delimiter': '""", """', 'dtype': 'str'}), "(\n 'https://archive.ics.uci.edu/ml/machine-learning-databases/adult/adult.data'\n , delimiter=', ', dtype=str)\n", (3311, 3426),... |
import rasterio as rio
import rasterio.mask as riom
import rasterio.plot as riop
from rasterio.transform import Affine
import matplotlib.pyplot as plt
import fiona as fio
import numpy as np
import geopandas as gpd
from shapely.geometry import Polygon
import os
from IPython import embed
class DatasetManipulator:
d... | [
"matplotlib.pyplot.text",
"matplotlib.pyplot.show",
"rasterio.open",
"matplotlib.pyplot.plot",
"numpy.squeeze",
"rasterio.plot.show",
"shapely.geometry.Polygon",
"fiona.open",
"numpy.moveaxis",
"rasterio.mask.mask",
"numpy.pad",
"matplotlib.pyplot.subplots",
"numpy.arange",
"rasterio.trans... | [((538, 560), 'rasterio.open', 'rio.open', (['dataset_path'], {}), '(dataset_path)\n', (546, 560), True, 'import rasterio as rio\n'), ((4520, 4611), 'numpy.pad', 'np.pad', (['array', '((0, 0), (0, pad_ver), (0, pad_hor))'], {'mode': '"""constant"""', 'constant_values': '(0)'}), "(array, ((0, 0), (0, pad_ver), (0, pad_h... |
import json
import os
import logging.config
from logging.handlers import RotatingFileHandler
from utils.find_devices import DeviceFinder
from camera_handler import CameraHandler
import time
import sys
logPath = os.path.join(os.path.dirname(os.path.abspath(__file__)), "debug_logs.log")
file_handler = RotatingFileHandle... | [
"utils.find_devices.DeviceFinder",
"logging.handlers.RotatingFileHandler",
"camera_handler.CameraHandler",
"json.load",
"os.path.dirname",
"os.path.abspath"
] | [((302, 409), 'logging.handlers.RotatingFileHandler', 'RotatingFileHandler', (['logPath'], {'mode': '"""a"""', 'maxBytes': '(5 * 1024 * 1024)', 'backupCount': '(2)', 'encoding': 'None', 'delay': '(0)'}), "(logPath, mode='a', maxBytes=5 * 1024 * 1024,\n backupCount=2, encoding=None, delay=0)\n", (321, 409), False, 'f... |
#!/usr/bin/env
from __future__ import print_function
from pprint import pprint
import discovered
sd = discovered.ServiceDiscovery()
print('register service')
x = sd.register_service(service_name='redis', endpoint='localhost:6379', endpoint_type='keystore', backend='redis', description='redis keystore')
pprint(x)
p... | [
"discovered.ServiceDiscovery",
"pprint.pprint"
] | [((105, 134), 'discovered.ServiceDiscovery', 'discovered.ServiceDiscovery', ([], {}), '()\n', (132, 134), False, 'import discovered\n'), ((308, 317), 'pprint.pprint', 'pprint', (['x'], {}), '(x)\n', (314, 317), False, 'from pprint import pprint\n'), ((401, 410), 'pprint.pprint', 'pprint', (['y'], {}), '(y)\n', (407, 41... |
import torch
pretrained_weights = torch.load('fcos_mstrain_640_800_r101_caffe_fpn_gn_2x_4gpu_20190516-42e6f62d.pth')
num_class = 2
# store = []
# for index, name in enumerate(pretrained_weights['state_dict']):
# store.append(name)
# a = store[500:]
# b = pretrained_weights['state_dict']['bbox_head.fcos_cls.weig... | [
"torch.load",
"torch.save"
] | [((35, 122), 'torch.load', 'torch.load', (['"""fcos_mstrain_640_800_r101_caffe_fpn_gn_2x_4gpu_20190516-42e6f62d.pth"""'], {}), "(\n 'fcos_mstrain_640_800_r101_caffe_fpn_gn_2x_4gpu_20190516-42e6f62d.pth')\n", (45, 122), False, 'import torch\n'), ((875, 979), 'torch.save', 'torch.save', (['pretrained_weights', "('fcos... |
# vim: set ts=4 sw=4 sts=4 et smarttab :
import aiohttp
import hmac
import os
import re
import urllib
from functools import wraps
from hashlib import sha1
from sanic.blueprints import Blueprint
from sanic.response import json
from sanic_openapi import doc
from sanic.exceptions import abort
from sanic.log import log
... | [
"sanic_openapi.doc.summary",
"aiohttp.ClientSession",
"sanic.response.json",
"sanic.log.log.debug",
"sanic_openapi.doc.consumes",
"os.path.join",
"functools.wraps",
"sanic.log.log.error",
"sanic.blueprints.Blueprint",
"sanic_openapi.doc.description"
] | [((333, 366), 'sanic.blueprints.Blueprint', 'Blueprint', (['"""Github"""', '"""/v1/github"""'], {}), "('Github', '/v1/github')\n", (342, 366), False, 'from sanic.blueprints import Blueprint\n'), ((4122, 4158), 'sanic_openapi.doc.summary', 'doc.summary', (['"""GitHub comment parser"""'], {}), "('GitHub comment parser')\... |
# -*- coding: utf-8 -*-
"""Display the driver database as a table."""
import PySide2.QtWidgets as QtWidgets
import PySide2.QtCore as QtCore
import PySide2.QtGui as QtGui
from . import config
from ..lib.driver import Driver
class DriverDatabaseFrame(QtWidgets.QWidget):
"""Display, sort, filter, etc the database of... | [
"PySide2.QtWidgets.QDoubleSpinBox",
"PySide2.QtWidgets.QPushButton",
"PySide2.QtWidgets.QTableWidgetItem",
"PySide2.QtGui.QIcon.fromTheme",
"PySide2.QtWidgets.QHBoxLayout",
"PySide2.QtCore.Signal",
"PySide2.QtWidgets.QLineEdit",
"PySide2.QtWidgets.QFormLayout",
"PySide2.QtWidgets.QWidget.__init__",
... | [((376, 394), 'PySide2.QtCore.Signal', 'QtCore.Signal', (['set'], {}), '(set)\n', (389, 394), True, 'import PySide2.QtCore as QtCore\n'), ((469, 501), 'PySide2.QtWidgets.QWidget.__init__', 'QtWidgets.QWidget.__init__', (['self'], {}), '(self)\n', (495, 501), True, 'import PySide2.QtWidgets as QtWidgets\n'), ((531, 559)... |
"""
Copyright 2019 Akvelon Inc.
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, soft... | [
"json.load"
] | [((711, 723), 'json.load', 'json.load', (['f'], {}), '(f)\n', (720, 723), False, 'import json\n')] |
import pickle
from sklearn.decomposition import PCA
import numpy as np
class PCA_reduction:
def __init__(self, pca_path):
self.pca_reload = pickle.load(open(pca_path,'rb'))
def reduce_size(self, vector):
return self.pca_reload.transform([vector])[0]
@staticmethod
def create_new_pca_model(vectors, path_to_sa... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylabel",
"sklearn.decomposition.PCA",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.axhline",
"matplotlib.pyplot.figure",
"numpy.cumsum",
"matplotlib.pyplot.title",
"sklearn.preprocessing.MinMaxScaler"
] | [((406, 420), 'sklearn.preprocessing.MinMaxScaler', 'MinMaxScaler', ([], {}), '()\n', (418, 420), False, 'from sklearn.preprocessing import MinMaxScaler\n'), ((478, 515), 'sklearn.decomposition.PCA', 'PCA', ([], {'n_components': 'percentage_variance'}), '(n_components=percentage_variance)\n', (481, 515), False, 'from s... |
from django.db.models.signals import pre_save, pre_delete, post_save, post_delete
from django.dispatch import receiver
from .client import get_client
from .models import Stakes, UserStakes, BetTriggers
from matchbook.enums import Side
from matchbook.endpoints.betting import Betting
from matchbook.enums import Side, Sta... | [
"django.dispatch.receiver"
] | [((345, 384), 'django.dispatch.receiver', 'receiver', (['post_save'], {'sender': 'BetTriggers'}), '(post_save, sender=BetTriggers)\n', (353, 384), False, 'from django.dispatch import receiver\n')] |
import matplotlib.pyplot as pl
import anndata as ad
import pandas as pd
import numpy as np
import scanpy as sc
import scvelo as scv
from scipy.sparse import issparse
import matplotlib.gridspec as gridspec
from scipy.stats import gaussian_kde, spearmanr, pearsonr
from goatools.obo_parser import GODag
from goatools.anno.... | [
"pandas.read_csv",
"gzip.open",
"goatools.obo_parser.GODag",
"numpy.isin",
"scipy.interpolate.interp1d",
"numpy.array",
"scanpy.tl.score_genes_cell_cycle",
"csv.Sniffer",
"pandas.read_excel",
"pandas.unique",
"goatools.anno.genetogo_reader.Gene2GoReader",
"numpy.mean",
"scipy.stats.gaussian_... | [((953, 970), 'scipy.sparse.issparse', 'issparse', (['adata.X'], {}), '(adata.X)\n', (961, 970), False, 'from scipy.sparse import issparse\n'), ((2807, 2915), 'pandas.read_excel', 'pd.read_excel', (["(signatures_path + '/colonoid_cancer_uhlitz_markers_revised.xlsx')"], {'skiprows': '(1)', 'index_col': '(0)'}), "(signat... |