code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import os
from pyscf.pbc.gto import Cell
from pyscf.pbc.scf import KRHF
from pyscf.pbc.tdscf import KTDHF
from pyscf.pbc.tdscf import krhf_slow_gamma as ktd
import unittest
from numpy import testing
import numpy
from test_common import retrieve_m, retrieve_m_hf, assert_vectors_close, tdhf_frozen_mask
class DiamondT... | [
"test_common.tdhf_frozen_mask",
"test_common.retrieve_m_hf",
"numpy.testing.assert_allclose",
"pyscf.pbc.tdscf.krhf_slow_gamma.TDRHF",
"os.path.join",
"pyscf.pbc.tdscf.KTDHF",
"numpy.array",
"pyscf.pbc.scf.KRHF",
"test_common.retrieve_m",
"pyscf.pbc.gto.Cell"
] | [((517, 523), 'pyscf.pbc.gto.Cell', 'Cell', ([], {}), '()\n', (521, 523), False, 'from pyscf.pbc.gto import Cell\n'), ((1296, 1313), 'pyscf.pbc.tdscf.KTDHF', 'KTDHF', (['model_krhf'], {}), '(model_krhf)\n', (1301, 1313), False, 'from pyscf.pbc.tdscf import KTDHF\n'), ((1366, 1391), 'test_common.retrieve_m', 'retrieve_m... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '../src/rightClickHelper/view/management/menuItemCard.ui'
#
# Created by: PyQt5 UI code generator 5.15.2
#
# 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 yo... | [
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtGui.QFont",
"PyQt5.QtCore.QMetaObject.connectSlotsByName",
"PyQt5.QtWidgets.QHBoxLayout",
"PyQt5.QtGui.QCursor",
"PyQt5.QtCore.QRect",
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QGraphicsView",
"PyQt5.QtWidgets.QPushButton",
"PyQt5.QtCore.QSize"
] | [((1529, 1552), 'PyQt5.QtWidgets.QWidget', 'QtWidgets.QWidget', (['item'], {}), '(item)\n', (1546, 1552), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((1801, 1828), 'PyQt5.QtWidgets.QLabel', 'QtWidgets.QLabel', (['self.main'], {}), '(self.main)\n', (1817, 1828), False, 'from PyQt5 import QtCore, QtGui, QtWi... |
# -*- coding: utf-8 -*-
import math
from copy import deepcopy
# from pprint import pprint
#### overview
# - all angles in degrees unless stated otherwise.
# - all dimensions in cm (even for line width).
# cs = [x, y], vec = [start_cs, end_cs]
# nice constants:
golden_ratio = 1.61803398875
#### auxiliary functions f... | [
"math.cos",
"math.sin",
"copy.deepcopy",
"math.floor"
] | [((703, 728), 'math.floor', 'math.floor', (['(angle / 360.0)'], {}), '(angle / 360.0)\n', (713, 728), False, 'import math\n'), ((5902, 5925), 'math.cos', 'math.cos', (['angle_in_rads'], {}), '(angle_in_rads)\n', (5910, 5925), False, 'import math\n'), ((5934, 5957), 'math.sin', 'math.sin', (['angle_in_rads'], {}), '(ang... |
import os
import cv2
import numpy as np
import torch
import imageio
from torchvision import transforms
from .colmap_utils import *
import pdb
def load_img_list(datadir, load_test=False):
with open(os.path.join(datadir, 'train.txt'), 'r') as f:
lines = f.readlines()
image_list = [line.strip() for l... | [
"numpy.uint8",
"cv2.applyColorMap",
"os.path.exists",
"PIL.Image.open",
"imageio.imread",
"cv2.resize",
"torch.stack",
"os.path.join",
"numpy.logical_not",
"numpy.stack",
"numpy.isnan",
"numpy.isfinite",
"torchvision.transforms.Resize",
"torchvision.transforms.ToTensor",
"numpy.load",
... | [((642, 685), 'os.path.join', 'os.path.join', (['datadir', '"""dense"""', '"""fused.ply"""'], {}), "(datadir, 'dense', 'fused.ply')\n", (654, 685), False, 'import os\n'), ((2702, 2718), 'numpy.stack', 'np.stack', (['depths'], {}), '(depths)\n', (2710, 2718), True, 'import numpy as np\n'), ((3090, 3111), 'torchvision.tr... |
import socket
def send_message(ip, port):
connection = socket.socket()
try:
connection.connect((ip, port))
connection.send(b'I love you')
finally:
connection.close()
def main():
send_message('127.0.0.1', 1984)
if __name__ == '__main__':
main()
| [
"socket.socket"
] | [((61, 76), 'socket.socket', 'socket.socket', ([], {}), '()\n', (74, 76), False, 'import socket\n')] |
from textkit.coerce import coerce_types
def test_coerce_types():
content = [
["happy", "9"],
["day", "8"],
["4", "7"],
["YOU!", "6"]
]
tokens = coerce_types(content)
assert len(tokens) == 4
assert tokens[0][0] == "happy"
assert tokens[0][1] == 9
assert tok... | [
"textkit.coerce.coerce_types"
] | [((192, 213), 'textkit.coerce.coerce_types', 'coerce_types', (['content'], {}), '(content)\n', (204, 213), False, 'from textkit.coerce import coerce_types\n'), ((513, 534), 'textkit.coerce.coerce_types', 'coerce_types', (['content'], {}), '(content)\n', (525, 534), False, 'from textkit.coerce import coerce_types\n')] |
"""List Autoscale groups."""
# :license: MIT, see LICENSE for more details.
import click
from SoftLayer.CLI.command import SLCommand as SLCommand
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
from SoftLayer.managers.autoscale import AutoScaleManager
from SoftLayer import utils
@click.co... | [
"SoftLayer.managers.autoscale.AutoScaleManager",
"SoftLayer.CLI.formatting.Table",
"click.command",
"SoftLayer.utils.lookup"
] | [((312, 340), 'click.command', 'click.command', ([], {'cls': 'SLCommand'}), '(cls=SLCommand)\n', (325, 340), False, 'import click\n'), ((427, 455), 'SoftLayer.managers.autoscale.AutoScaleManager', 'AutoScaleManager', (['env.client'], {}), '(env.client)\n', (443, 455), False, 'from SoftLayer.managers.autoscale import Au... |
import datetime
def eightDigits():
now = datetime.datetime.now()
return f'{now.year}{now.month:0>2}{now.day:0>2}'
def ft(timestamp):
'''
Here is especially for the timestamp contains in NetEase Json
which looks like `1543766400000`
'''
if len(str(timestamp)) == 13:
timestamp = in... | [
"datetime.datetime.now",
"datetime.datetime.fromtimestamp"
] | [((47, 70), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (68, 70), False, 'import datetime\n'), ((538, 580), 'datetime.datetime.fromtimestamp', 'datetime.datetime.fromtimestamp', (['timestamp'], {}), '(timestamp)\n', (569, 580), False, 'import datetime\n'), ((1005, 1028), 'datetime.datetime.now',... |
import numpy as np
import pandas as pd
import pymongo
from sklearn.preprocessing import StandardScaler
from tensorflow.keras.models import load_model
import os
import glob
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
mo... | [
"pandas.Series",
"selenium.webdriver.chrome.options.Options",
"pandas.read_csv",
"numpy.average",
"selenium.webdriver.Chrome",
"os.rename",
"numpy.floor",
"time.sleep",
"sklearn.preprocessing.StandardScaler",
"os.path.realpath",
"numpy.random.randint",
"numpy.array",
"tensorflow.keras.models... | [((328, 352), 'tensorflow.keras.models.load_model', 'load_model', (['"""model_2249"""'], {}), "('model_2249')\n", (338, 352), False, 'from tensorflow.keras.models import load_model\n'), ((363, 387), 'tensorflow.keras.models.load_model', 'load_model', (['"""model_5699"""'], {}), "('model_5699')\n", (373, 387), False, 'f... |
import numpy as np
from collections import namedtuple
from itertools import product
import pybullet as p
from pybullet_planning.utils import CLIENT, BASE_LINK, UNKNOWN_FILE, OBJ_MESH_CACHE
from pybullet_planning.utils import implies
#####################################
# Bounding box
AABB = namedtuple('AABB', ['lo... | [
"collections.namedtuple",
"pybullet.getAABB",
"numpy.less_equal",
"pybullet_planning.interfaces.robots.link.get_all_links",
"numpy.max",
"pybullet.getOverlappingObjects",
"numpy.array",
"numpy.vstack",
"numpy.min",
"pybullet_planning.interfaces.robots.link.get_link_subtree"
] | [((297, 335), 'collections.namedtuple', 'namedtuple', (['"""AABB"""', "['lower', 'upper']"], {}), "('AABB', ['lower', 'upper'])\n", (307, 335), False, 'from collections import namedtuple\n'), ((3897, 3958), 'pybullet.getOverlappingObjects', 'p.getOverlappingObjects', (['lower', 'upper'], {'physicsClientId': 'CLIENT'}),... |
"""Contains the Evaluate object, which has methods to load data from Cavecalc
.pkl output files, display data and write it to other file formats.
Classes defined here:
Evaluate
"""
import pickle
import os
import copy
import matplotlib
from sys import platform
if platform != 'win32':
matplotlib.use('TkAgg') # ... | [
"scipy.io.savemat",
"matplotlib.use",
"os.path.join",
"pickle.load",
"os.getcwd",
"seaborn.set_style",
"os.chdir",
"cavecalc.util.numpify",
"copy.deepcopy",
"matplotlib.pyplot.subplots"
] | [((294, 317), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (308, 317), False, 'import matplotlib\n'), ((4036, 4047), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (4045, 4047), False, 'import os\n'), ((6603, 6623), 'scipy.io.savemat', 'sio.savemat', (['file', 's'], {}), '(file, s)\n', (6614, ... |
"""
Multivariate loc_scale priors for convolutional layers
"""
from numbers import Number
import torch.distributions as td
import torch
import math
from .base import Prior
from . import distributions
__all__ = ('ConvCovariance', 'FixedCovNormal', 'FixedCovLaplace', 'FixedCovDoubleGamma', 'FixedCovGenNorm')
class P... | [
"torch.get_default_dtype",
"torch.distributions.Normal",
"torch.lgamma",
"torch.eye",
"math.sqrt",
"torch.tensor",
"torch.zeros"
] | [((1432, 1457), 'torch.get_default_dtype', 'torch.get_default_dtype', ([], {}), '()\n', (1455, 1457), False, 'import torch\n'), ((2751, 2767), 'math.sqrt', 'math.sqrt', (['(1 / 2)'], {}), '(1 / 2)\n', (2760, 2767), False, 'import math\n'), ((2568, 2595), 'torch.distributions.Normal', 'td.Normal', (['zeros', '(zeros + 1... |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import control_pb2 as control__pb2
class ControlStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
... | [
"grpc.method_handlers_generic_handler",
"grpc.unary_unary_rpc_method_handler"
] | [((3777, 3845), 'grpc.method_handlers_generic_handler', 'grpc.method_handlers_generic_handler', (['"""Control"""', 'rpc_method_handlers'], {}), "('Control', rpc_method_handlers)\n", (3813, 3845), False, 'import grpc\n'), ((2693, 2898), 'grpc.unary_unary_rpc_method_handler', 'grpc.unary_unary_rpc_method_handler', (['ser... |
# Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
import unittest
from vespa.query import Query, OR, AND, WeakAnd, ANN, Union, RankProfile, VespaResult
class TestMatchFilter(unittest.TestCase):
def setUp(self) -> None:
self.query = "this is ... | [
"vespa.query.ANN",
"vespa.query.VespaResult",
"vespa.query.WeakAnd",
"vespa.query.Query",
"vespa.query.AND",
"vespa.query.OR",
"vespa.query.RankProfile"
] | [((376, 381), 'vespa.query.AND', 'AND', ([], {}), '()\n', (379, 381), False, 'from vespa.query import Query, OR, AND, WeakAnd, ANN, Union, RankProfile, VespaResult\n'), ((661, 665), 'vespa.query.OR', 'OR', ([], {}), '()\n', (663, 665), False, 'from vespa.query import Query, OR, AND, WeakAnd, ANN, Union, RankProfile, Ve... |
import json
from itertools import chain
from pathlib import Path
TEXTURES_PATH = Path("RP/textures")
def list_textures():
textures = []
for texture in chain(
TEXTURES_PATH.glob("**/*.png"), TEXTURES_PATH.glob("**/*.tga")):
textures.append(texture.relative_to("RP").with_suffix("").as_posix... | [
"pathlib.Path"
] | [((83, 102), 'pathlib.Path', 'Path', (['"""RP/textures"""'], {}), "('RP/textures')\n", (87, 102), False, 'from pathlib import Path\n')] |
import tensorflow as tf
import argparse
import tensorflow as tf
import environments
from agent import PPOAgent
from policy import *
def print_summary(ep_count, rew):
print("Episode: %s. Reward: %s" % (ep_count, rew))
def start(env):
MASTER_NAME = "master-0"
tf.reset_default_graph()
with tf.Sessi... | [
"tensorflow.reset_default_graph",
"tensorflow.variable_scope",
"argparse.ArgumentParser",
"agent.PPOAgent",
"tensorflow.Session",
"tensorflow.train.Saver",
"environments.EnvironmentProducer",
"environments.get_env_options",
"tensorflow.global_variables_initializer",
"tensorflow.train.latest_checkp... | [((277, 301), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ([], {}), '()\n', (299, 301), True, 'import tensorflow as tf\n'), ((1786, 1837), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Parallel PPO"""'}), "(description='Parallel PPO')\n", (1809, 1837), False, 'import arg... |
import unittest
from core import app,agent,simulation
from core.common import get_conn
class ServicesTestCase(unittest.TestCase):
def test_consume_f(self):
"""consume friend services test"""
agent.deleteAll()
simulation.clear_all_messages()
simulation.reset_ts()
a = agent.random_agen... | [
"core.agent.new_agent",
"core.agent.random_agent",
"core.simulation.clear_all_messages",
"core.simulation.reset_ts",
"core.simulation.start",
"core.agent.deleteAll",
"core.common.get_conn"
] | [((208, 225), 'core.agent.deleteAll', 'agent.deleteAll', ([], {}), '()\n', (223, 225), False, 'from core import app, agent, simulation\n'), ((232, 263), 'core.simulation.clear_all_messages', 'simulation.clear_all_messages', ([], {}), '()\n', (261, 263), False, 'from core import app, agent, simulation\n'), ((270, 291), ... |
from flask import request
from app.models import Menu
from flask_restful import Resource
from app.requests.menu import PostRequest, PutRequest
from app.middlewares.auth import user_auth, admin_auth
from app.middlewares.validation import validate
from app.utils import decoded_qs
class MenuResource(Resource):
@use... | [
"app.models.Menu.query.get",
"app.utils.decoded_qs",
"app.models.Menu.create",
"app.middlewares.validation.validate",
"app.models.Menu.query.filter_by",
"flask.request.json.get"
] | [((879, 899), 'app.middlewares.validation.validate', 'validate', (['PutRequest'], {}), '(PutRequest)\n', (887, 899), False, 'from app.middlewares.validation import validate\n'), ((2573, 2594), 'app.middlewares.validation.validate', 'validate', (['PostRequest'], {}), '(PostRequest)\n', (2581, 2594), False, 'from app.mid... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-03-06 02:46
from __future__ import unicode_literals
import ckeditor.fields
from django.db import migrations, models
import django.db.models.deletion
from newsroomFramework.settings import PROJECT_ROOT
import os
import ontospy
def forwards_func(apps, schema... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"os.path.join",
"django.db.migrations.RunPython",
"django.db.models.AutoField",
"django.db.models.URLField",
"django.db.models.CharField"
] | [((511, 558), 'os.path.join', 'os.path.join', (['PROJECT_ROOT', '"""root-ontology.owl"""'], {}), "(PROJECT_ROOT, 'root-ontology.owl')\n", (523, 558), False, 'import os\n'), ((589, 638), 'os.path.join', 'os.path.join', (['PROJECT_ROOT', '"""annotation-core.owl"""'], {}), "(PROJECT_ROOT, 'annotation-core.owl')\n", (601, ... |
import requests
GITHUB_OAUTH_URL = 'https://github.com/login/oauth/access_token'
def request_token(client_id, client_secret, code, redirect_uri, state):
url = GITHUB_OAUTH_URL
data = {
'client_id': client_id,
'client_secret': client_secret,
'code': code,
'state': state,
}... | [
"requests.post"
] | [((397, 443), 'requests.post', 'requests.post', (['url'], {'data': 'data', 'headers': 'headers'}), '(url, data=data, headers=headers)\n', (410, 443), False, 'import requests\n')] |
"""Generate publication-quality data acquisition methods section from BIDS dataset."""
import json
import os.path as op
from collections import Counter
from bids.reports import parsing, utils
class BIDSReport(object):
"""Generate publication-quality data acquisition section from BIDS dataset.
Parameters
... | [
"bids.reports.parsing.final_paragraph",
"bids.reports.utils.reminder",
"collections.Counter",
"bids.reports.parsing.parse_files",
"json.load",
"os.path.abspath"
] | [((5222, 5243), 'collections.Counter', 'Counter', (['descriptions'], {}), '(descriptions)\n', (5229, 5243), False, 'from collections import Counter\n'), ((7006, 7027), 'collections.Counter', 'Counter', (['descriptions'], {}), '(descriptions)\n', (7013, 7027), False, 'from collections import Counter\n'), ((5336, 5352), ... |
#
# Copyright 2018-2021 <NAME>
# 2019 <NAME>
# 2015-2016 <NAME>
#
# ### MIT license
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including withou... | [
"numpy.append",
"numpy.array"
] | [((5676, 5700), 'numpy.array', 'np.array', (['magnifications'], {}), '(magnifications)\n', (5684, 5700), True, 'import numpy as np\n'), ((5702, 5722), 'numpy.array', 'np.array', (['bandwidths'], {}), '(bandwidths)\n', (5710, 5722), True, 'import numpy as np\n'), ((5724, 5745), 'numpy.array', 'np.array', (['rms_heights'... |
import re
import urllib.request
import urllib.error
from django.utils.datastructures import OrderedSet
def getPlaylistUrls(youtubeUrl):
if 'http' not in youtubeUrl:
url = 'https://' + youtubeUrl
else:
url = youtubeUrl
sTUBE = ''
cPL = ''
urls = OrderedSet()
if 'list=' in url... | [
"re.findall",
"django.utils.datastructures.OrderedSet",
"re.compile"
] | [((285, 297), 'django.utils.datastructures.OrderedSet', 'OrderedSet', ([], {}), '()\n', (295, 297), False, 'from django.utils.datastructures import OrderedSet\n'), ((757, 797), 're.compile', 're.compile', (["('watch\\\\?v=\\\\S+?list=' + cPL)"], {}), "('watch\\\\?v=\\\\S+?list=' + cPL)\n", (767, 797), False, 'import re... |
"""
kpcasub
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 t... | [
"sklearn.decomposition.KernelPCA"
] | [((997, 1047), 'sklearn.decomposition.KernelPCA', 'KernelPCA', ([], {'n_components': 'p', 'kernel': '"""rbf"""', 'n_jobs': '(-1)'}), "(n_components=p, kernel='rbf', n_jobs=-1)\n", (1006, 1047), False, 'from sklearn.decomposition import KernelPCA\n')] |
"""authentik e2e testing utilities"""
import json
import os
from functools import lru_cache, wraps
from os import environ, makedirs
from time import sleep, time
from typing import Any, Callable, Optional
from django.apps import apps
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.db... | [
"json.loads",
"selenium.webdriver.support.ui.WebDriverWait",
"selenium.webdriver.ChromeOptions",
"os.makedirs",
"authentik.core.tests.utils.create_test_admin_user",
"structlog.stdlib.get_logger",
"os.environ.get",
"functools.wraps",
"django.db.migrations.loader.MigrationLoader",
"time.sleep",
"a... | [((1332, 1359), 'os.environ.get', 'environ.get', (['"""RETRIES"""', '"""3"""'], {}), "('RETRIES', '3')\n", (1343, 1359), False, 'from os import environ, makedirs\n'), ((1533, 1571), 'os.environ.get', 'os.environ.get', (['default_branch', '"""main"""'], {}), "(default_branch, 'main')\n", (1547, 1571), False, 'import os\... |
from apispec import APISpec
from starlette.applications import Starlette
from starlette.exceptions import HTTPException
from starlette.requests import Request
from apispec_starlette import StarlettePlugin, document_endpoint_oauth2_authentication
def test_without_exception_handlers_in_app():
app = Starlette()
... | [
"apispec_starlette.StarlettePlugin",
"apispec.APISpec",
"starlette.applications.Starlette",
"apispec_starlette.document_endpoint_oauth2_authentication"
] | [((305, 316), 'starlette.applications.Starlette', 'Starlette', ([], {}), '()\n', (314, 316), False, 'from starlette.applications import Starlette\n'), ((1077, 1140), 'starlette.applications.Starlette', 'Starlette', ([], {'exception_handlers': '{HTTPException: handle_exception}'}), '(exception_handlers={HTTPException: h... |
# Feb 9, 2019
# <NAME>, <NAME>, <NAME>, <NAME>
#
# This script tests the distance function for kmedians.py
import pytest
import numpy as np
from KMediansPy.distance import distance
## Helper Functions
def toy_data():
"""
Generates simple data set and parameters to test
"""
X = np.array([[1, 2],[5,... | [
"numpy.array",
"KMediansPy.distance.distance",
"numpy.all"
] | [((300, 326), 'numpy.array', 'np.array', (['[[1, 2], [5, 4]]'], {}), '([[1, 2], [5, 4]])\n', (308, 326), True, 'import numpy as np\n'), ((340, 366), 'numpy.array', 'np.array', (['[[1, 2], [5, 4]]'], {}), '([[1, 2], [5, 4]])\n', (348, 366), True, 'import numpy as np\n'), ((377, 397), 'KMediansPy.distance.distance', 'dis... |
from collections import namedtuple
from utils import lerp
class RGB(namedtuple('RGB', 'r g b')):
""" stores color as a integer triple from range [0, 255] """
class Color(namedtuple('Color', 'r g b')):
""" stores color as a float triple from range [0.0, 1.0] """
def rgb12(self):
r = int(self.r *... | [
"collections.namedtuple",
"utils.lerp"
] | [((70, 96), 'collections.namedtuple', 'namedtuple', (['"""RGB"""', '"""r g b"""'], {}), "('RGB', 'r g b')\n", (80, 96), False, 'from collections import namedtuple\n'), ((178, 206), 'collections.namedtuple', 'namedtuple', (['"""Color"""', '"""r g b"""'], {}), "('Color', 'r g b')\n", (188, 206), False, 'from collections ... |
from datasets.ucf101_decoder import UCF101
def get_training_set(opt,
common_temporal_transform,
common_spatial_transform,
target_spatial_transform,
input_spatial_transform,
target_label_transform
... | [
"datasets.ucf101_decoder.UCF101"
] | [((436, 800), 'datasets.ucf101_decoder.UCF101', 'UCF101', (['opt.video_path', 'opt.annotation_path', '"""training"""'], {'common_temporal_transform': 'common_temporal_transform', 'common_spatial_transform': 'common_spatial_transform', 'target_spatial_transform': 'target_spatial_transform', 'input_spatial_transform': 'i... |
from typing import List, Literal, Optional
from pydantic import BaseModel, validator
class Jwk(BaseModel):
kid: str # Base64url-encoded thumbprint string
kty: Literal["EC", "RSA"]
# TODO: verify if is optional
alg: Optional[
Literal[
"RS256",
"RS384",
"RS5... | [
"pydantic.validator"
] | [((943, 957), 'pydantic.validator', 'validator', (['"""n"""'], {}), "('n')\n", (952, 957), False, 'from pydantic import BaseModel, validator\n'), ((1060, 1074), 'pydantic.validator', 'validator', (['"""e"""'], {}), "('e')\n", (1069, 1074), False, 'from pydantic import BaseModel, validator\n'), ((1306, 1320), 'pydantic.... |
"""
PyMC4 base random variable class.
Implements the RandomVariable base class and the necessary BackendArithmetic.
Also stores the type hints used in child classes.
- TensorLike is for float-like tensors (scalars, vectors, matrices, tensors)
- IntTensorLike like TensorLike, just for ints.
"""
from .. import _templa... | [
"tensorflow_probability.bijectors.Identity",
"tensorflow_probability.bijectors.Sigmoid",
"typing.NewType",
"tensorflow_probability.bijectors.Exp",
"tensorflow_probability.bijectors.Invert"
] | [((5313, 5385), 'typing.NewType', 'NewType', (['"""TensorLike"""', 'Union[Sequence[int], Sequence[float], int, float]'], {}), "('TensorLike', Union[Sequence[int], Sequence[float], int, float])\n", (5320, 5385), False, 'from typing import NewType, Union, Sequence\n'), ((5402, 5453), 'typing.NewType', 'NewType', (['"""In... |
# Generated by Django 2.0.8 on 2019-01-19 14:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='lazylet_term',
options={'ordering': ['i... | [
"django.db.migrations.AlterModelOptions",
"django.db.models.CharField"
] | [((221, 300), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""lazylet_term"""', 'options': "{'ordering': ['id']}"}), "(name='lazylet_term', options={'ordering': ['id']})\n", (249, 300), False, 'from django.db import migrations, models\n'), ((441, 488), 'django.db.models.CharF... |
import logging
import os
from ftplib import FTP
import time
class SPSConnectionException(Exception):
def __init__(self):
pass
class SPSLib:
## The Constructor
# @param client {FTP} An FTP client to be used as the connection
# @param default_destination {string} Path to where the files are aut... | [
"os.path.exists",
"os.listdir",
"ftplib.FTP",
"logging.debug",
"os.makedirs",
"logging.warning",
"os.path.join",
"time.sleep",
"logging.error"
] | [((4407, 4449), 'logging.debug', 'logging.debug', (['"""Closing Connection To SPS"""'], {}), "('Closing Connection To SPS')\n", (4420, 4449), False, 'import logging\n'), ((4764, 4785), 'os.listdir', 'os.listdir', (['directory'], {}), '(directory)\n', (4774, 4785), False, 'import os\n'), ((6181, 6204), 'os.listdir', 'os... |
import pyos
def onStart(s, a):
global state, app, editor
state = s
app = a
editor = Editor()
def save():
editor.save()
class Editor(object):
def __init__(self):
self.path = ""
self.fobj = None
self.saved = False
self.textField = pyos.G... | [
"pyos.GUI.Text",
"pyos.GUI.MultiLineTextEntryField",
"pyos.GUI.ErrorDialog"
] | [((314, 416), 'pyos.GUI.MultiLineTextEntryField', 'pyos.GUI.MultiLineTextEntryField', (['(0, 0)'], {'width': 'app.ui.width', 'height': '(app.ui.height - 40)', 'border': '(0)'}), '((0, 0), width=app.ui.width, height=app.ui.\n height - 40, border=0)\n', (346, 416), False, 'import pyos\n'), ((432, 500), 'pyos.GUI.Text'... |
from bs4 import BeautifulSoup
import requests
import re
import pysqlite3 as lite
import sys
connect = None
try:
connect = lite.connect('site_parser.db')
cur = connect.cursor()
except lite.Error as e:
print(f'Error {e.args[0]}:')
sys.exit(1)
def parsing_for_sql():
max_page = 20
pages = ... | [
"re.split",
"pysqlite3.connect",
"bs4.BeautifulSoup",
"sys.exit",
"re.sub"
] | [((130, 160), 'pysqlite3.connect', 'lite.connect', (['"""site_parser.db"""'], {}), "('site_parser.db')\n", (142, 160), True, 'import pysqlite3 as lite\n'), ((252, 263), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (260, 263), False, 'import sys\n'), ((488, 524), 'bs4.BeautifulSoup', 'BeautifulSoup', (['n.text', '"""... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "<NAME>"
__doc__ = r"""
Created on 29/07/2020
"""
__all__ = ["plot_kernels"]
from matplotlib import pyplot
def plot_kernels(tensor, number_cols=5, m_interpolation="bilinear"):
"""
Function to visualize the kernels.
Arguments:
... | [
"matplotlib.pyplot.figure"
] | [((639, 688), 'matplotlib.pyplot.figure', 'pyplot.figure', ([], {'figsize': '(number_cols, number_rows)'}), '(figsize=(number_cols, number_rows))\n', (652, 688), False, 'from matplotlib import pyplot\n')] |
# -*- coding: utf-8 -*-
import six
import boto3
import json
iot = boto3.client('iot-data', region_name='us-east-1')
IOT_TOPIC = "iot_arduino_demos_actuators"
def iot_command(command):
response = iot.publish(
topic=IOT_TOPIC,
qos=1,
payload=jso... | [
"json.dumps",
"six.iteritems",
"boto3.client"
] | [((69, 118), 'boto3.client', 'boto3.client', (['"""iot-data"""'], {'region_name': '"""us-east-1"""'}), "('iot-data', region_name='us-east-1')\n", (81, 118), False, 'import boto3\n'), ((439, 459), 'six.iteritems', 'six.iteritems', (['slots'], {}), '(slots)\n', (452, 459), False, 'import six\n'), ((317, 349), 'json.dumps... |
import time
import argparse
import numpy as np
from sklearn.metrics import confusion_matrix
import cv2
from models import TSN
from transforms import *
import pycuda.driver as cuda
from PIL import Image
from streaming import streaming
import os
def make_ucf():
index_dir = '/cmsdata/hdd2/cmslab/haabibi/UCF101CL... | [
"models.TSN",
"PIL.Image.fromarray",
"argparse.ArgumentParser",
"cv2.VideoCapture",
"cv2.cvtColor"
] | [((2649, 2716), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Standard video-level testing"""'}), "(description='Standard video-level testing')\n", (2672, 2716), False, 'import argparse\n'), ((4288, 4399), 'models.TSN', 'TSN', (['num_class', '(1)', '"""RGB"""'], {'base_model': 'args.arc... |
from multiprocessing import Pool
import numpy as np
import pandas as pd
from cgms_data_seg import CGMSDataSeg
from sklearn.model_selection import KFold
def hyperglycemia(x, threshold=1.8):
return np.hstack((x >= threshold, x < threshold)).astype(np.float32)
def hypoglycemia(x, threshold=0.7):
# threshold c... | [
"pandas.Series",
"numpy.ceil",
"pandas.read_csv",
"numpy.hstack",
"numpy.argmax",
"numpy.apply_along_axis",
"multiprocessing.Pool",
"pandas.DataFrame",
"cgms_data_seg.CGMSDataSeg",
"pandas.ExcelWriter"
] | [((1171, 1211), 'pandas.read_csv', 'pd.read_csv', (['"""../data/tblAScreening.csv"""'], {}), "('../data/tblAScreening.csv')\n", (1182, 1211), True, 'import pandas as pd\n'), ((1222, 1256), 'pandas.read_csv', 'pd.read_csv', (['"""../data/tblALab.csv"""'], {}), "('../data/tblALab.csv')\n", (1233, 1256), True, 'import pan... |
import numpy as np
import glob
cannon_teff = np.array([])
cannon_logg = np.array([])
cannon_feh = np.array([])
cannon_alpha = np.array([])
tr_teff = np.array([])
tr_logg = np.array([])
tr_feh = np.array([])
tr_alpha = np.array([])
a = glob.glob("./*tr_label.npz")
a.sort()
for filename in a:
labels = np.load(fil... | [
"numpy.savez",
"numpy.append",
"numpy.array",
"numpy.vstack",
"numpy.load",
"glob.glob"
] | [((46, 58), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (54, 58), True, 'import numpy as np\n'), ((73, 85), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (81, 85), True, 'import numpy as np\n'), ((99, 111), 'numpy.array', 'np.array', (['[]'], {}), '([])\n', (107, 111), True, 'import numpy as np\n'), ((127, ... |
"""
MSX SDK
MSX SDK client. # noqa: E501
The version of the OpenAPI document: 1.0.9
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import python_msx_sdk
from python_msx_sdk.model.service_now_configuration import ServiceNowConfiguration
globals()['ServiceNowConfiguratio... | [
"unittest.main"
] | [((956, 971), 'unittest.main', 'unittest.main', ([], {}), '()\n', (969, 971), False, 'import unittest\n')] |
'''
Copyright (c) 2018 <NAME>/HiFiBerry
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, distribut... | [
"hifiberrydsp.parser.xmlprofile.XmlProfile",
"sys.exit"
] | [((7015, 7034), 'hifiberrydsp.parser.xmlprofile.XmlProfile', 'XmlProfile', (['xmlfile'], {}), '(xmlfile)\n', (7025, 7034), False, 'from hifiberrydsp.parser.xmlprofile import ATTRIBUTE_BALANCE, ATTRIBUTE_FIR_FILTER_LEFT, ATTRIBUTE_FIR_FILTER_RIGHT, ATTRIBUTE_CUSTOM_FILTER_LEFT, ATTRIBUTE_CUSTOM_FILTER_RIGHT, ATTRIBUTE_T... |
# coding=utf-8
"""
"""
__author__ = '<NAME> <<EMAIL>>'
__date__ = '3/13' # DD/MM/YY
from corefgraph.resources.lambdas import list_checker, equality_checker, matcher, fail
# Extracted from CoreNLP
indefinite_articles = list_checker(("a", "an"))
quantifiers = list_checker(("not", "every", "any", "none", "everything... | [
"corefgraph.resources.lambdas.equality_checker",
"corefgraph.resources.lambdas.list_checker"
] | [((223, 248), 'corefgraph.resources.lambdas.list_checker', 'list_checker', (["('a', 'an')"], {}), "(('a', 'an'))\n", (235, 248), False, 'from corefgraph.resources.lambdas import list_checker, equality_checker, matcher, fail\n'), ((264, 367), 'corefgraph.resources.lambdas.list_checker', 'list_checker', (["('not', 'every... |
from rest_framework.generics import ListAPIView, CreateAPIView
from meiduo_admin.mypagination import Mypage
from users.models import User
from meiduo_admin.serislizers.userserializer import UserModelSerializer
class UserView(ListAPIView,CreateAPIView):
queryset = User.objects.all()
serializer_class = UserM... | [
"users.models.User.objects.all"
] | [((273, 291), 'users.models.User.objects.all', 'User.objects.all', ([], {}), '()\n', (289, 291), False, 'from users.models import User\n')] |
import unittest
import numpy as np
from algorithms.genetic.nsgaii.nsgaii_algorithm import NSGAIIAlgorithm as tested_algorithm_class
class NSGAIITestCase(unittest.TestCase):
def setUp(self):
"""
Set up algorithm and random seed
"""
seed = 0
self.algorithm = tested_algorith... | [
"numpy.testing.assert_array_equal",
"numpy.around",
"algorithms.genetic.nsgaii.nsgaii_algorithm.NSGAIIAlgorithm"
] | [((305, 329), 'algorithms.genetic.nsgaii.nsgaii_algorithm.NSGAIIAlgorithm', 'tested_algorithm_class', ([], {}), '()\n', (327, 329), True, 'from algorithms.genetic.nsgaii.nsgaii_algorithm import NSGAIIAlgorithm as tested_algorithm_class\n'), ((8993, 9031), 'numpy.around', 'np.around', (['actual_crowding_distance', '(2)'... |
# camera-ready
import torch
import torch.nn as nn
import torch.nn.functional as F
import os
class ToyPredictorNet(nn.Module):
def __init__(self, input_dim=1, hidden_dim=10):
super().__init__()
self.fc1_y = nn.Linear(input_dim, hidden_dim)
self.fc1_xy = nn.Linear(2*hidden_dim, hidden_dim... | [
"os.makedirs",
"torch.cat",
"os.path.exists",
"torch.nn.Linear"
] | [((230, 262), 'torch.nn.Linear', 'nn.Linear', (['input_dim', 'hidden_dim'], {}), '(input_dim, hidden_dim)\n', (239, 262), True, 'import torch.nn as nn\n'), ((286, 323), 'torch.nn.Linear', 'nn.Linear', (['(2 * hidden_dim)', 'hidden_dim'], {}), '(2 * hidden_dim, hidden_dim)\n', (295, 323), True, 'import torch.nn as nn\n'... |
import pygame
pygame.init()
windowSurface = pygame.display.set_mode([500,400])
music = pygame.mixer.Sound("/Users/chenchaoyang/Desktop/python/Python/Music/Music2.wav")
music.play()
Running = True
while Running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
Running = False
... | [
"pygame.init",
"pygame.quit",
"pygame.event.get",
"pygame.display.set_mode",
"pygame.mixer.Sound",
"pygame.display.update"
] | [((14, 27), 'pygame.init', 'pygame.init', ([], {}), '()\n', (25, 27), False, 'import pygame\n'), ((44, 79), 'pygame.display.set_mode', 'pygame.display.set_mode', (['[500, 400]'], {}), '([500, 400])\n', (67, 79), False, 'import pygame\n'), ((87, 172), 'pygame.mixer.Sound', 'pygame.mixer.Sound', (['"""/Users/chenchaoyang... |
"""Training procedure for real NVP.
"""
import argparse
import torch, torchvision
import torch.distributions as distributions
import torch.optim as optim
import torchvision.utils as utils
import numpy as np
import realnvp, data_utils
class Hyperparameters():
def __init__(self, base_dim, res_blocks, bottleneck, ... | [
"torchvision.utils.make_grid",
"argparse.ArgumentParser",
"numpy.log",
"torch.no_grad",
"torch.tensor",
"torch.save",
"torch.utils.data.DataLoader",
"data_utils.load",
"realnvp.RealNVP",
"data_utils.logit_transform",
"torch.device"
] | [((1247, 1269), 'torch.device', 'torch.device', (['"""cuda:0"""'], {}), "('cuda:0')\n", (1259, 1269), False, 'import torch, torchvision\n'), ((2245, 2269), 'data_utils.load', 'data_utils.load', (['dataset'], {}), '(dataset)\n', (2260, 2269), False, 'import realnvp, data_utils\n'), ((2289, 2386), 'torch.utils.data.DataL... |
import numpy as np
from copy import deepcopy
import config
class Node:
'''
Attribute
----------
board : Board
This node's board Class.
cpuct : floar
c puct constance.
w : float
Value this node ever got.
n : int
How many times this node ever simulated.
c... | [
"numpy.log",
"numpy.sqrt",
"numpy.argmax",
"copy.deepcopy"
] | [((1910, 1920), 'numpy.sqrt', 'np.sqrt', (['t'], {}), '(t)\n', (1917, 1920), True, 'import numpy as np\n'), ((3617, 3632), 'copy.deepcopy', 'deepcopy', (['board'], {}), '(board)\n', (3625, 3632), False, 'from copy import deepcopy\n'), ((2258, 2275), 'numpy.argmax', 'np.argmax', (['values'], {}), '(values)\n', (2267, 22... |
""" small general purpose helpers """
import datetime
import time
import logging
import os
import threading
def bytes_to_int(data,endian='>'):
"""Convert a bytearray into an integer, considering the first bit sign."""
if endian=='<':
data=bytearray(data)
data.reverse()
negative = data[0] & 0x80 > 0
if negativ... | [
"datetime.datetime.utcfromtimestamp",
"logging.getLogger",
"logging.basicConfig",
"logging.StreamHandler",
"datetime.datetime.utcnow",
"logging.Formatter",
"threading.Timer",
"os.getcwd",
"os.getlogin",
"logging.shutdown",
"logging.FileHandler",
"logging.info"
] | [((1445, 1482), 'datetime.datetime.utcfromtimestamp', 'datetime.datetime.utcfromtimestamp', (['(0)'], {}), '(0)\n', (1479, 1482), False, 'import datetime\n'), ((1491, 1517), 'datetime.datetime.utcnow', 'datetime.datetime.utcnow', ([], {}), '()\n', (1515, 1517), False, 'import datetime\n'), ((2477, 2502), 'logging.Forma... |
# Generated by Django 2.0.1 on 2019-01-09 15:54
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('app01', '0011_auto_20190109_2351'),
]
operations = [
migrations.RemoveField(
model_name='getdatacss',
name='Co... | [
"django.db.migrations.RemoveField"
] | [((237, 301), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""getdatacss"""', 'name': '"""CopyBook"""'}), "(model_name='getdatacss', name='CopyBook')\n", (259, 301), False, 'from django.db import migrations\n')] |
from requests import request
from json import loads
from itertools import combinations
from random import sample
# from IPython.core.debugger import Tracer; debug_here = Tracer()
# https://www.predictit.org/api/marketdata/markets/3633
all_markets = request('GET', 'https://www.predictit.org/api/marketdata/all/')
all_... | [
"itertools.combinations",
"json.loads",
"requests.request"
] | [((252, 315), 'requests.request', 'request', (['"""GET"""', '"""https://www.predictit.org/api/marketdata/all/"""'], {}), "('GET', 'https://www.predictit.org/api/marketdata/all/')\n", (259, 315), False, 'from requests import request\n'), ((330, 356), 'json.loads', 'loads', (['all_markets.content'], {}), '(all_markets.co... |
import os
for path in os.listdir():
parts = path.split()
date = parts[0]
if (len(date) != 10):
print('Date Warning: ' + path)
| [
"os.listdir"
] | [((23, 35), 'os.listdir', 'os.listdir', ([], {}), '()\n', (33, 35), False, 'import os\n')] |
# RT TTS - Voiceroid
from aiofiles import open as async_open
from aiohttp import ClientSession
import asyncio
HEADERS = {
'authority': 'cloud.ai-j.jp',
'accept': 'text/javascript, application/javascript, */*; q=0.01',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, lik... | [
"aiohttp.ClientSession",
"aiofiles.open"
] | [((4310, 4325), 'aiohttp.ClientSession', 'ClientSession', ([], {}), '()\n', (4323, 4325), False, 'from aiohttp import ClientSession\n'), ((3947, 3973), 'aiofiles.open', 'async_open', (['filename', '"""wb"""'], {}), "(filename, 'wb')\n", (3957, 3973), True, 'from aiofiles import open as async_open\n'), ((4031, 4057), 'a... |
import os
import sys
import numpy as np
import torch
import argparse
import _pickle as pkl
import matplotlib.pylab as plt
import seaborn as sea
sea.set_style("whitegrid")
from matplotlib.offsetbox import OffsetImage, AnnotationBbox
from random import uniform
from .Protein import Protein
from .Complex import Complex
f... | [
"numpy.abs",
"matplotlib.pylab.figure",
"torch.exp",
"torch.min",
"seaborn.set_style",
"torch.tensor",
"matplotlib.pylab.show",
"matplotlib.pylab.subplot",
"torch.logical_and"
] | [((145, 171), 'seaborn.set_style', 'sea.set_style', (['"""whitegrid"""'], {}), "('whitegrid')\n", (158, 171), True, 'import seaborn as sea\n'), ((4156, 4183), 'matplotlib.pylab.figure', 'plt.figure', ([], {'figsize': '(12, 6)'}), '(figsize=(12, 6))\n', (4166, 4183), True, 'import matplotlib.pylab as plt\n'), ((4267, 42... |
from osim.env import L2M2019Env
from osim.control.osim_loco_reflex_song2019 import OsimReflexCtrl
"""
imported package dir: E:\\miniconda3_64\\envs\\osim_onn\\lib\\site-packages\\osim'
"""
from onn_torch_gd import Neural_Network
print ('onn imported')
from sklearn.datasets import make_classificatio... | [
"torch.utils.tensorboard.SummaryWriter",
"argparse.ArgumentParser",
"statsmodels.tsa.stattools.adfuller",
"statsmodels.tsa.stattools.kpss",
"torch.load",
"osim.control.osim_loco_reflex_song2019.OsimReflexCtrl",
"osim.env.L2M2019Env",
"argparse.ArgumentTypeError",
"numpy.array",
"torch.nn.MSELoss",... | [((731, 756), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (754, 756), False, 'import argparse\n'), ((1504, 1523), 'torch.utils.tensorboard.SummaryWriter', 'SummaryWriter', (['PATH'], {}), '(PATH)\n', (1517, 1523), False, 'from torch.utils.tensorboard import SummaryWriter\n'), ((1676, 1912), ... |
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from smart_settings import Namespace
from .literals import DEFAULT_MAXIMUM_TITLE_LENGTH
namespace = Namespace(name='appearance', label=_('Appearance'))
setting_max_title_length = namespace.add_setting(
global_name='A... | [
"django.utils.translation.ugettext_lazy"
] | [((235, 250), 'django.utils.translation.ugettext_lazy', '_', (['"""Appearance"""'], {}), "('Appearance')\n", (236, 250), True, 'from django.utils.translation import ugettext_lazy as _\n')] |
import sys
def FPrint(*args, **kwargs):
print(*args, **kwargs)
sys.stdout.flush()
def TableToText(Table): #TODO: Add title and header row
if type(Table) == dict:
return _TableToTextDict(Table)
elif type(Table) == list:
return _TableToTextList(Table)
else:
FPrint('ERROR: Tab... | [
"sys.stdout.flush"
] | [((72, 90), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (88, 90), False, 'import sys\n')] |
import logging
RPC_SERVER_URI = 'http://localhost:8000/'
RPC_SERVER_ADDR = ('localhost', 8000)
def logger_factory(name: str, filename: str, stream_level: int = logging.INFO):
logger = logging.getLogger(name)
logger.setLevel(logging.INFO)
file_handler = logging.FileHandler(f'log/{filename}')
file_han... | [
"logging.getLogger",
"logging.Formatter",
"logging.StreamHandler",
"logging.FileHandler"
] | [((192, 215), 'logging.getLogger', 'logging.getLogger', (['name'], {}), '(name)\n', (209, 215), False, 'import logging\n'), ((269, 307), 'logging.FileHandler', 'logging.FileHandler', (['f"""log/{filename}"""'], {}), "(f'log/{filename}')\n", (288, 307), False, 'import logging\n'), ((370, 393), 'logging.StreamHandler', '... |
from acres.rater import full
def test__contain_acronym():
# Baseline
assert not full._contain_acronym("Elektrokardiogramm")
assert full._contain_acronym("VSM Bypass")
assert full._contain_acronym("Gamma GT")
# Only acronym
assert full._contain_acronym("EKG")
def test__compute_full_valid():
... | [
"acres.rater.full._contain_acronym",
"acres.rater.full._compute_full_valid"
] | [((145, 180), 'acres.rater.full._contain_acronym', 'full._contain_acronym', (['"""VSM Bypass"""'], {}), "('VSM Bypass')\n", (166, 180), False, 'from acres.rater import full\n'), ((192, 225), 'acres.rater.full._contain_acronym', 'full._contain_acronym', (['"""Gamma GT"""'], {}), "('Gamma GT')\n", (213, 225), False, 'fro... |
from collections import OrderedDict
import torch
from torch import nn
import torch.nn.functional as F
from exp import ex
from utils import jsonl_to_json, mean
from data.batcher import make_feature_lm_batch_with_keywords, ConvertToken
from .modules import Attention, GRU
from .scn_rnn import SCNLSTM
from .transformer_... | [
"torch.nn.Dropout",
"data.batcher.make_feature_lm_batch_with_keywords",
"torch.nn.Embedding",
"data.batcher.ConvertToken",
"utils.jsonl_to_json",
"torch.LongTensor",
"torch.stack",
"torch.Tensor",
"utils.mean",
"torch.nn.Linear",
"torch.zeros",
"torch.cat",
"torch.ones"
] | [((2859, 2902), 'torch.nn.Embedding', 'nn.Embedding', (['self.vocab_size', 'self.wte_dim'], {}), '(self.vocab_size, self.wte_dim)\n', (2871, 2902), False, 'from torch import nn\n'), ((3409, 3439), 'torch.nn.Dropout', 'nn.Dropout', (['self.dropout_ratio'], {}), '(self.dropout_ratio)\n', (3419, 3439), False, 'from torch ... |
from HSTB.kluster.gui.backends._qt import QtGui, QtCore, QtWidgets, Signal
from HSTB.kluster.gui.common_widgets import SaveStateDialog
from HSTB.kluster import kluster_variables
class PatchTestDialog(SaveStateDialog):
patch_query = Signal(str) # submit new query to main for data
def __init__(self, parent=No... | [
"HSTB.kluster.gui.backends._qt.QtWidgets.QTextEdit",
"HSTB.kluster.gui.backends._qt.QtWidgets.QRadioButton",
"HSTB.kluster.gui.backends._qt.QtWidgets.QLabel",
"HSTB.kluster.gui.backends._qt.Signal",
"HSTB.kluster.gui.backends._qt.QtWidgets.QComboBox",
"HSTB.kluster.gui.backends._qt.QtWidgets.QApplication"... | [((238, 249), 'HSTB.kluster.gui.backends._qt.Signal', 'Signal', (['str'], {}), '(str)\n', (244, 249), False, 'from HSTB.kluster.gui.backends._qt import QtGui, QtCore, QtWidgets, Signal\n'), ((563, 586), 'HSTB.kluster.gui.backends._qt.QtWidgets.QVBoxLayout', 'QtWidgets.QVBoxLayout', ([], {}), '()\n', (584, 586), False, ... |
from django.views.generic import RedirectView
from django.urls import path
from . import views
urlpatterns = [
path('', RedirectView.as_view(url='home/', permanent=True)),
path('home/', views.HomeView.as_view(), name='home'),
path('recipe/<int:pk>', views.RecipeDetailView.as_view(), name='re... | [
"django.views.generic.RedirectView.as_view"
] | [((132, 181), 'django.views.generic.RedirectView.as_view', 'RedirectView.as_view', ([], {'url': '"""home/"""', 'permanent': '(True)'}), "(url='home/', permanent=True)\n", (152, 181), False, 'from django.views.generic import RedirectView\n')] |
from django.contrib.auth.models import User, Group
from django.http.response import Http404
from django.shortcuts import get_object_or_404
from rest_framework.parsers import MultiPartParser, FormParser, FileUploadParser, JSONParser
from rest_framework import generics, permissions, status, views
from rest_framework.res... | [
"accounts.api.serializers.FollowStoriesSerializer",
"accounts.models.FollowUser.objects.get",
"accounts.models.FollowStories.objects.get",
"django.contrib.auth.models.Group.objects.all",
"accounts.models.Social.objects.all",
"fanfics.api.serializers.UserSerializer",
"django.contrib.auth.models.User.obje... | [((950, 968), 'django.contrib.auth.models.User.objects.all', 'User.objects.all', ([], {}), '()\n', (966, 968), False, 'from django.contrib.auth.models import User, Group\n'), ((1221, 1239), 'django.contrib.auth.models.User.objects.all', 'User.objects.all', ([], {}), '()\n', (1237, 1239), False, 'from django.contrib.aut... |
# -*- Python -*-
# This file is licensed under a pytorch-style license
# See frontends/pytorch/LICENSE for license information.
import torch
import npcomp.frontends.pytorch as torch_mlir
import npcomp.frontends.pytorch.test as test
# RUN: %PYTHON %s | FileCheck %s
dev = torch_mlir.mlir_device()
t0 = torch.randn((3,... | [
"torch.mm",
"npcomp.frontends.pytorch.mlir_device",
"npcomp.frontends.pytorch.test.compare",
"torch.randn"
] | [((274, 298), 'npcomp.frontends.pytorch.mlir_device', 'torch_mlir.mlir_device', ([], {}), '()\n', (296, 298), True, 'import npcomp.frontends.pytorch as torch_mlir\n'), ((305, 337), 'torch.randn', 'torch.randn', (['(3, 13)'], {'device': 'dev'}), '((3, 13), device=dev)\n', (316, 337), False, 'import torch\n'), ((342, 374... |
import json
from rest_framework.test import APIClient, APITestCase
from rest_framework.authtoken.models import Token
from ats.companies.models import CompanyAdmin, CompanyStaff, Company
from ats.users.models import User
from .factories import CompanyFactory
class TestCompanyAPIViewSet(APITestCase):
def setUp(s... | [
"ats.users.models.User.objects.create_user",
"ats.companies.models.Company.objects.count",
"ats.companies.models.CompanyStaff.objects.create_user",
"json.dumps",
"rest_framework.test.APIClient",
"ats.companies.models.Company.objects.last",
"rest_framework.authtoken.models.Token.objects.get_or_create"
] | [((347, 419), 'ats.companies.models.CompanyStaff.objects.create_user', 'CompanyStaff.objects.create_user', ([], {'email': '"""<EMAIL>"""', 'password': '"""<PASSWORD>"""'}), "(email='<EMAIL>', password='<PASSWORD>')\n", (379, 419), False, 'from ats.companies.models import CompanyAdmin, CompanyStaff, Company\n'), ((448, ... |
#!/usr/bin/env python
'''
pysomtsdatalogger.py
Python-based network/serial raw data consumer and logger via a
RabbitMQ AMQP producer/consumer model.
https://github.com/somts/pysomtsdatalogger
Package installation:
CentOS: requires EPEL and pip to work. Commands:
install base packages with: yum -y install... | [
"logging.getLogger",
"multiprocessing.Process",
"yaml.load",
"time.sleep",
"sys.exc_info",
"sys.exit",
"os.path.exists",
"argparse.ArgumentParser",
"logging.handlers.TimedRotatingFileHandler",
"os.getpid",
"yaml.dump",
"pika.ConnectionParameters",
"os.path.dirname",
"socket.inet_aton",
"... | [((1076, 1174), 'voluptuous.Schema', 'Schema', (["{'basedirectory': str, 'logfile': str, 'perdaylogfiles': bool,\n 'prefixlogfiles': bool}"], {}), "({'basedirectory': str, 'logfile': str, 'perdaylogfiles': bool,\n 'prefixlogfiles': bool})\n", (1082, 1174), False, 'from voluptuous import Schema\n'), ((1420, 1520),... |
"""
pyaud_plugins._plugins.action
=============================
"""
import shutil
import typing as t
from pathlib import Path
import pyaud
from pyaud_plugins._abc import SphinxBuild
from pyaud_plugins._environ import environ as e
from pyaud_plugins._parsers import LineSwitch, Md2Rst
from pyaud_plugins._utils import c... | [
"pyaud_plugins._environ.environ.README_RST.is_file",
"pyaud.plugins.register",
"pathlib.Path.cwd",
"pyaud_plugins._parsers.Md2Rst",
"shutil.rmtree",
"pyaud_plugins._environ.environ.DOCS_CONF.is_file",
"pyaud.plugins.get",
"pyaud.files.reduce"
] | [((329, 353), 'pyaud.plugins.register', 'pyaud.plugins.register', ([], {}), '()\n', (351, 353), False, 'import pyaud\n'), ((1129, 1153), 'pyaud.plugins.register', 'pyaud.plugins.register', ([], {}), '()\n', (1151, 1153), False, 'import pyaud\n'), ((1768, 1792), 'pyaud.plugins.register', 'pyaud.plugins.register', ([], {... |
#!/usr/bin/env python
"""
Created on 2014-11-10T15:05:21
"""
from __future__ import division, print_function
import sys
try:
import numpy as np
except ImportError:
print('You need numpy installed')
sys.exit(1)
try:
import matplotlib.pyplot as plt
got_mpl = True
except ImportError:
print('You... | [
"numpy.polyfit",
"numpy.where",
"matplotlib.pyplot.plot",
"sys.exit",
"numpy.poly1d"
] | [((1737, 1769), 'numpy.polyfit', 'np.polyfit', (['wavcent', 'normspec', '(7)'], {}), '(wavcent, normspec, 7)\n', (1747, 1769), True, 'import numpy as np\n'), ((1843, 1855), 'numpy.poly1d', 'np.poly1d', (['z'], {}), '(z)\n', (1852, 1855), True, 'import numpy as np\n'), ((213, 224), 'sys.exit', 'sys.exit', (['(1)'], {}),... |
# This file is part of Moksha.
# Copyright (C) 2008-2010 Red Hat, 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 b... | [
"logging.getLogger",
"moksha.exc.CacheBackendException",
"memcache.Client"
] | [((639, 666), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (656, 666), False, 'import logging\n'), ((1146, 1168), 'memcache.Client', 'memcache.Client', (['[url]'], {}), '([url])\n', (1161, 1168), False, 'import memcache\n'), ((1295, 1347), 'moksha.exc.CacheBackendException', 'CacheBacke... |
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.optim.lr_scheduler import StepLR
from mnist_demo.models.model import Net
from mnist_demo.models.dataset import MyMN... | [
"mnist_demo.models.model.Net",
"sagemaker_inference.decoder.decode",
"torch.from_numpy",
"torch.cuda.is_available",
"sagemaker_inference.utils.parse_accept",
"sagemaker_inference.encoder.encode",
"argparse.ArgumentParser",
"torch.nn.functional.nll_loss",
"torchvision.transforms.ToTensor",
"torchvi... | [((2127, 2132), 'mnist_demo.models.model.Net', 'Net', ([], {}), '()\n', (2130, 2132), False, 'from mnist_demo.models.model import Net\n'), ((3030, 3080), 'sagemaker_inference.decoder.decode', 'decoder.decode', (['request_body', 'request_content_type'], {}), '(request_body, request_content_type)\n', (3044, 3080), False,... |
from dataclasses import dataclass
from typing import Optional
@dataclass(frozen=True)
class RequestInformation:
client_ip: str
client_user_agent: Optional[str]
client_country: Optional[str]
| [
"dataclasses.dataclass"
] | [((65, 87), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (74, 87), False, 'from dataclasses import dataclass\n')] |
import hashlib
import os
import warnings
from dataclasses import dataclass, asdict, field
from pathlib import Path
import torch
import torchaudio
from fastai.core import ifnone
from fastai.data_block import get_files
from fastprogress.fastprogress import progress_bar
from torchaudio.transforms import Spectrogram, MelSc... | [
"torchaudio.transforms.InverseMelScale",
"pathlib.Path.home",
"dataclasses.dataclass",
"torchaudio.transforms.MFCC",
"os.walk",
"os.remove",
"os.path.exists",
"pathlib.Path",
"fastai.data_block.get_files",
"torchaudio.transforms.Spectrogram",
"dataclasses.field",
"os.path.relpath",
"os.path.... | [((431, 453), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (440, 453), False, 'from dataclasses import dataclass, asdict, field\n'), ((3801, 3847), 'dataclasses.field', 'field', ([], {'repr': '(False)', 'compare': '(False)', 'default': 'None'}), '(repr=False, compare=False, defau... |
'''Sample (shrink training corpus) and consolidate CoNLL-2012.
Usage:
consolidate_and_sample.py <input_dir> <output_dir> <sample_size>
'''
from collections import defaultdict
from consolidate_copora import copy_subfolder, copy_files
import random
import os
import shutil
from glob import glob
from docopt import do... | [
"os.path.exists",
"random.sample",
"os.listdir",
"os.makedirs",
"consolidate_copora.copy_subfolder",
"consolidate_copora.copy_files",
"os.path.join",
"os.path.isdir",
"collections.defaultdict",
"os.path.basename",
"shutil.rmtree",
"docopt.docopt"
] | [((513, 529), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (524, 529), False, 'from collections import defaultdict\n'), ((1042, 1059), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (1053, 1059), False, 'from collections import defaultdict\n'), ((1234, 1251), 'collections.d... |
###############################################################################
# Copyright (c) 2016 <NAME> <<EMAIL>>
#
# File: example_iteration.py
#
# Author: <NAME> <<EMAIL>>
# Date: 14 Dec 2016
# Purpose: How to get to every photo in every collection
#
# Revision: 2
# Comment: What's new in rev... | [
"logging.getLogger",
"pyunsplash.PyUnsplash",
"os.environ.get",
"logging.basicConfig"
] | [((833, 852), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (850, 852), False, 'import logging\n'), ((853, 913), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""app.log"""', 'level': 'logging.DEBUG'}), "(filename='app.log', level=logging.DEBUG)\n", (872, 913), False, 'import logging\n'... |
# pylint: disable=missing-docstring
import unittest
from pathlib import Path
import pypopquiz as ppq
import pypopquiz.io
class TestIO(unittest.TestCase):
SAMPLE_FILES = [Path("samples/round01.json")]
def test_read_input(self) -> None:
for sample_file in self.SAMPLE_FILES:
result = ppq.i... | [
"pypopquiz.io.verify_input",
"pypopquiz.io.read_input",
"pathlib.Path"
] | [((178, 206), 'pathlib.Path', 'Path', (['"""samples/round01.json"""'], {}), "('samples/round01.json')\n", (182, 206), False, 'from pathlib import Path\n'), ((315, 345), 'pypopquiz.io.read_input', 'ppq.io.read_input', (['sample_file'], {}), '(sample_file)\n', (332, 345), True, 'import pypopquiz as ppq\n'), ((509, 539), ... |
import os
import typing
from contextlib import suppress
from pathlib import Path
from qtpy.QtWidgets import QDialog, QFileDialog, QGridLayout, QPushButton, QStackedWidget
from PartSegCore.io_utils import SaveBase
from .algorithms_description import FormWidget
from .custom_load_dialog import IORegister, LoadRegisterF... | [
"qtpy.QtWidgets.QGridLayout",
"pathlib.Path.home",
"qtpy.QtWidgets.QStackedWidget",
"contextlib.suppress",
"qtpy.QtWidgets.QPushButton"
] | [((1099, 1118), 'qtpy.QtWidgets.QPushButton', 'QPushButton', (['"""Save"""'], {}), "('Save')\n", (1110, 1118), False, 'from qtpy.QtWidgets import QDialog, QFileDialog, QGridLayout, QPushButton, QStackedWidget\n'), ((1198, 1219), 'qtpy.QtWidgets.QPushButton', 'QPushButton', (['"""Reject"""'], {}), "('Reject')\n", (1209,... |
from matplotlib import pyplot as plt
import pickle
import numpy as np
def plot_1d_pointGoals(_file , num_goals = 100):
fobj = open(_file+ '.pkl', 'wb')
goals = np.random.normal(0,1, size = (num_goals))
import ipdb ; ipdb.set_trace()
pickle.dump(goals , fobj)
plt.scatter( np.arange(num_goals) , goals)
plt... | [
"numpy.random.normal",
"matplotlib.pyplot.savefig",
"pickle.dump",
"ipdb.set_trace",
"matplotlib.pyplot.scatter",
"numpy.arange"
] | [((168, 206), 'numpy.random.normal', 'np.random.normal', (['(0)', '(1)'], {'size': 'num_goals'}), '(0, 1, size=num_goals)\n', (184, 206), True, 'import numpy as np\n'), ((225, 241), 'ipdb.set_trace', 'ipdb.set_trace', ([], {}), '()\n', (239, 241), False, 'import ipdb\n'), ((245, 269), 'pickle.dump', 'pickle.dump', (['g... |
#
# firehrose
# By <NAME> & <NAME>, Aleph Research
#
import target
target.add_target(name="oneplus3t",
arch=64,
programmer_path=r"target/oneplus3t/prog_ufs_firehose_8996_ddr.elf",
peekpoke_style=1,
rawprogram_xml="target/oneplus3t/rawp... | [
"target.add_target"
] | [((76, 274), 'target.add_target', 'target.add_target', ([], {'name': '"""oneplus3t"""', 'arch': '(64)', 'programmer_path': '"""target/oneplus3t/prog_ufs_firehose_8996_ddr.elf"""', 'peekpoke_style': '(1)', 'rawprogram_xml': '"""target/oneplus3t/rawprogram.xml"""', 'ufs': '(True)'}), "(name='oneplus3t', arch=64, programm... |
from scipy.stats import beta
from matplotlib import pyplot as plt
import numpy as np
def samples(a, b, success, trials, num_episodes=100):
'''
:param a: the shape param for prior dist
:param b: the shape param for prior dist
:param success: num success in the experiments
:param trials: num trails... | [
"matplotlib.pyplot.hist",
"scipy.stats.beta",
"matplotlib.pyplot.subplot",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((432, 471), 'scipy.stats.beta', 'beta', (['(a + success)', '(b + trials - success)'], {}), '(a + success, b + trials - success)\n', (436, 471), False, 'from scipy.stats import beta\n'), ((732, 757), 'numpy.arange', 'np.arange', (['(0)', 'bin_size', '(1)'], {}), '(0, bin_size, 1)\n', (741, 757), True, 'import numpy as... |
from django.test import TestCase
from battle.businesslogic.recorder.effects_impacts.DeckOrderChangedEffectImpact import DeckOrderChangedEffectImpact
from battle.businesslogic.tests.factories import create_player_with_deck
class DeckOrderChangedEffectImpactTestCase(TestCase):
def test_deck_has_proper_order(self):... | [
"battle.businesslogic.recorder.effects_impacts.DeckOrderChangedEffectImpact.DeckOrderChangedEffectImpact",
"battle.businesslogic.tests.factories.create_player_with_deck"
] | [((570, 595), 'battle.businesslogic.tests.factories.create_player_with_deck', 'create_player_with_deck', ([], {}), '()\n', (593, 595), False, 'from battle.businesslogic.tests.factories import create_player_with_deck\n'), ((666, 706), 'battle.businesslogic.recorder.effects_impacts.DeckOrderChangedEffectImpact.DeckOrderC... |
#!/usr/bin/python
#
# Copyright 2021 DeepMind Technologies Limited
#
# 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 a... | [
"numpy.array",
"mpmath.power",
"haiku.next_rng_key",
"jax.numpy.matmul",
"jax.random.split",
"jax.random.normal",
"haiku.initializers.Constant",
"numpy.linspace",
"jax.random.choice",
"jax.random.uniform",
"functools.reduce",
"jax.numpy.atleast_2d",
"jax.lax.stop_gradient",
"jax.numpy.eins... | [((1451, 1480), 'jax.numpy.einsum', 'jnp.einsum', (['"""ik,jk->ij"""', 'x', 'y'], {}), "('ik,jk->ij', x, y)\n", (1461, 1480), True, 'import jax.numpy as jnp\n'), ((1759, 1778), 'jax.numpy.atleast_2d', 'jnp.atleast_2d', (['(1.0)'], {}), '(1.0)\n', (1773, 1778), True, 'import jax.numpy as jnp\n'), ((1794, 1813), 'jax.num... |
from hypothesis import strategies
from tests.integration_tests.utils import to_bound_with_ported_vertices_pair
from tests.strategies import doubles
coordinates = doubles
vertices_pairs = strategies.builds(to_bound_with_ported_vertices_pair,
coordinates, coordinates)
| [
"hypothesis.strategies.builds"
] | [((189, 268), 'hypothesis.strategies.builds', 'strategies.builds', (['to_bound_with_ported_vertices_pair', 'coordinates', 'coordinates'], {}), '(to_bound_with_ported_vertices_pair, coordinates, coordinates)\n', (206, 268), False, 'from hypothesis import strategies\n')] |
#!/usr/bin/env python3
import collections
from .symbols import SymbolScope
from .ast import ASTVisitor, ASTScopedVisitorMixin
from .mtypes import MethodType
from .opcodes import Opcodes
from . import asm
# Function activation block:
# arguments...
# retval
# retaddr
# locals
class StackSize(ASTScopedVisitorMixin, ... | [
"collections.namedtuple"
] | [((2951, 3014), 'collections.namedtuple', 'collections.namedtuple', (['"""RegoffAddr"""', "['reg', 'offset', 'type']"], {}), "('RegoffAddr', ['reg', 'offset', 'type'])\n", (2973, 3014), False, 'import collections\n'), ((3221, 3263), 'collections.namedtuple', 'collections.namedtuple', (['"""RegAddr"""', "['reg']"], {}),... |
import logging
try:
print('try.....')
r = 10 / 0
print('result:', r)
except ZeroDivisionError as e:
# logging.exception(e)
print('except:', e)
finally:
print('finally....')
print('End')
from functools import reduce
def str2num(s):
return int(s)
def calc(exp):
ss = exp.split('+')
... | [
"functools.reduce",
"logging.debug"
] | [((557, 584), 'logging.debug', 'logging.debug', (["('n = %d' % n)"], {}), "('n = %d' % n)\n", (570, 584), False, 'import logging\n'), ((354, 388), 'functools.reduce', 'reduce', (['(lambda acc, x: acc + x)', 'ns'], {}), '(lambda acc, x: acc + x, ns)\n', (360, 388), False, 'from functools import reduce\n')] |
from bravado_core.spec import Spec
from bravado_types.config import Config
from bravado_types.data_model import (ModelInfo, OperationInfo, ParameterInfo,
PropertyInfo, ResourceInfo, ResponseInfo,
SpecInfo)
from bravado_types.extract import get... | [
"bravado_core.spec.Spec.from_dict",
"bravado_types.config.Config",
"bravado_types.data_model.ResourceInfo",
"bravado_types.data_model.ResponseInfo",
"bravado_types.data_model.ModelInfo",
"bravado_types.data_model.ParameterInfo",
"bravado_types.data_model.PropertyInfo"
] | [((372, 478), 'bravado_core.spec.Spec.from_dict', 'Spec.from_dict', (["{'swagger': '2.0', 'info': {'title': 'Minimal schema', 'version': '1.0'},\n 'paths': {}}"], {}), "({'swagger': '2.0', 'info': {'title': 'Minimal schema',\n 'version': '1.0'}, 'paths': {}})\n", (386, 478), False, 'from bravado_core.spec import ... |
# Description: Sample script for reading excel file using Pandas and saving to a SQL database - SQLite, Postgres, SQL Server, MySQL
# Date: 05-01-2020
# Author: <NAME>
# Usage: $python3 19_excel_to_sql.py
# Requirements: pandas ($pip3 install pandas)
'''
Structure of sheet Number 1 in Excel file (although not used in ... | [
"psycopg2.connect",
"optparse.OptionParser",
"sqlalchemy.create_engine",
"sqlite3.connect"
] | [((1892, 1921), 'sqlalchemy.create_engine', 'create_engine', (['sa_conn_string'], {}), '(sa_conn_string)\n', (1905, 1921), False, 'from sqlalchemy import create_engine\n'), ((2160, 2279), 'psycopg2.connect', 'psycopg2.connect', ([], {'database': '"""mydatabase"""', 'user': '"""yourusername"""', 'password': '"""<PASSWOR... |
from security_monkey.tests import SecurityMonkeyTestCase
from security_monkey.auditor import Entity
from security_monkey.auditors.resource_policy_auditor import ResourcePolicyAuditor
from security_monkey import db
from security_monkey.watcher import ChangeItem
from security_monkey.datastore import Datastore
from securi... | [
"collections.namedtuple",
"security_monkey.auditors.resource_policy_auditor.ResourcePolicyAuditor",
"security_monkey.datastore.Datastore",
"security_monkey.auditor.Entity.from_tuple",
"security_monkey.db.session.add",
"policyuniverse.policy.Policy",
"security_monkey.watcher.ChangeItem",
"copy.deepcopy... | [((490, 526), 'collections.namedtuple', 'namedtuple', (['"""Item"""', '"""config account"""'], {}), "('Item', 'config account')\n", (500, 526), False, 'from collections import namedtuple\n'), ((1498, 1521), 'security_monkey.datastore.AccountType', 'AccountType', ([], {'name': '"""AWS"""'}), "(name='AWS')\n", (1509, 152... |
# toImpr remove import?
from Skill import the_skill
class Hero:
def __init__(self, name, type_):
self.name = name
self.type_ = type_
self.level = 1
self.EXP = 0
self.__HP = 5
# self.__STR = 2
# self.__AGI = 1
# self.__INT = 1
... | [
"Skill.the_skill"
] | [((4325, 4344), 'Skill.the_skill', 'the_skill', (['skill_id'], {}), '(skill_id)\n', (4334, 4344), False, 'from Skill import the_skill\n'), ((4597, 4616), 'Skill.the_skill', 'the_skill', (['skill_id'], {}), '(skill_id)\n', (4606, 4616), False, 'from Skill import the_skill\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2019 yech <<EMAIL>>
# Distributed under terms of the MIT license.
#
# Created: 2019-07-25 22:18
"""find common mutation profile clone."""
import pandas as pd
df1 = (
pd.read_csv("./R1_scarclones.txt", sep="\t")
.drop(columns=["oclust", "hclust"])... | [
"pandas.concat",
"pandas.read_csv"
] | [((941, 962), 'pandas.concat', 'pd.concat', (['[df1, df2]'], {}), '([df1, df2])\n', (950, 962), True, 'import pandas as pd\n'), ((236, 280), 'pandas.read_csv', 'pd.read_csv', (['"""./R1_scarclones.txt"""'], {'sep': '"""\t"""'}), "('./R1_scarclones.txt', sep='\\t')\n", (247, 280), True, 'import pandas as pd\n'), ((542, ... |
import cv2
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
from skimage.restoration import (denoise_tv_chambolle, denoise_bilateral,
denoise_wavelet, estimate_sigma)
from pathlib import Path
def process_img_and_save(img_path: Path, denoise_h=20,
... | [
"PIL.Image.fromarray",
"cv2.Laplacian",
"numpy.sqrt",
"cv2.fastNlMeansDenoising",
"pathlib.Path",
"numpy.where",
"cv2.equalizeHist",
"cv2.circle",
"cv2.resize",
"cv2.Canny",
"numpy.zeros_like",
"cv2.Sobel"
] | [((427, 484), 'cv2.resize', 'cv2.resize', (['img', '(350, 350)'], {'interpolation': 'cv2.INTER_AREA'}), '(img, (350, 350), interpolation=cv2.INTER_AREA)\n', (437, 484), False, 'import cv2\n'), ((521, 577), 'cv2.fastNlMeansDenoising', 'cv2.fastNlMeansDenoising', ([], {'src': 'img', 'dst': 'None', 'h': 'denoise_h'}), '(s... |
#! /usr/bin/env python3
# coding: UTF-8
"""
Script: outil.py
Auteur: remy
Date: 14/03/2018
"""
import outil
import copy
# Fonctions
def gagne(entrepot):
"""
Vérifie si le puzzle décrit par l”entrepot est résolu ou non (c’est à dire que toutes les caisses ont été placées
sur des cibles) et renvoie la répon... | [
"outil.BLOCS.values",
"outil.coords",
"outil.coords_deplacees",
"copy.deepcopy"
] | [((3392, 3414), 'outil.coords', 'outil.coords', (['entrepot'], {}), '(entrepot)\n', (3404, 3414), False, 'import outil\n'), ((3428, 3472), 'outil.coords_deplacees', 'outil.coords_deplacees', (['joueur[:]', 'direction'], {}), '(joueur[:], direction)\n', (3450, 3472), False, 'import outil\n'), ((3486, 3530), 'outil.coord... |
#! /usr/bin/env python
# Copyright 2014 TangoMe 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 applicabl... | [
"json.loads",
"time.sleep",
"httplib2.Http",
"xml.etree.ElementTree.fromstring",
"time.time",
"unittest.TextTestRunner",
"unittest.TestLoader"
] | [((1663, 1734), 'httplib2.Http', 'httplib2.Http', ([], {'disable_ssl_certificate_validation': '(True)', 'timeout': 'timeout'}), '(disable_ssl_certificate_validation=True, timeout=timeout)\n', (1676, 1734), False, 'import httplib2\n'), ((1579, 1590), 'time.time', 'time.time', ([], {}), '()\n', (1588, 1590), False, 'impo... |
"""disable_user
Revision ID: 5088a7fdf2
Revises: <PASSWORD>
Create Date: 2016-02-13 14:28:37.929236
"""
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<PASSWORD>'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust!... | [
"sqlalchemy.Boolean",
"alembic.op.drop_column"
] | [((523, 557), 'alembic.op.drop_column', 'op.drop_column', (['"""user"""', '"""disabled"""'], {}), "('user', 'disabled')\n", (537, 557), False, 'from alembic import op\n'), ((373, 385), 'sqlalchemy.Boolean', 'sa.Boolean', ([], {}), '()\n', (383, 385), True, 'import sqlalchemy as sa\n')] |
import cv2 as cv
# Read the image
img = cv.imread('Photes/Cat03.jpg')
# display the image in New window
cv.imshow('Cat',img)
# Keyword binding Key you weant Press
# 0 mean it is inf
# 1 Mean amount of time it will wait
cv.waitKey(0)
| [
"cv2.waitKey",
"cv2.imread",
"cv2.imshow"
] | [((44, 73), 'cv2.imread', 'cv.imread', (['"""Photes/Cat03.jpg"""'], {}), "('Photes/Cat03.jpg')\n", (53, 73), True, 'import cv2 as cv\n'), ((112, 133), 'cv2.imshow', 'cv.imshow', (['"""Cat"""', 'img'], {}), "('Cat', img)\n", (121, 133), True, 'import cv2 as cv\n'), ((233, 246), 'cv2.waitKey', 'cv.waitKey', (['(0)'], {})... |
# -*- coding: utf-8 -*-
from metalmetrics.config.config import Config
from metalmetrics.metrics.abstract import MetricsAbstract
from metalmetrics.proto.proto import Format
def test_metricsabstract():
class MetricsTest(MetricsAbstract):
def __init__(self, config):
super().__init__(config)
... | [
"metalmetrics.config.config.Config"
] | [((405, 413), 'metalmetrics.config.config.Config', 'Config', ([], {}), '()\n', (411, 413), False, 'from metalmetrics.config.config import Config\n')] |
import numpy as np
import warnings
from time import time
import pandas as pd
# SeldonianML imports
from utils import argsweep, experiment, keyboard
from datasets import tutoring_bandit as TutoringSystem
import core.srl_fairness as SRL
import baselines.naive_full as NSRL
# Supress sklearn FutureWarnings for SGD
warni... | [
"utils.experiment.prepare_paths",
"numpy.mean",
"utils.experiment.run",
"numpy.random.random",
"numpy.log",
"baselines.POEM.DatasetReader.BanditDataset",
"sklearn.linear_model.LogisticRegression",
"numpy.exp",
"utils.experiment.make_parameters",
"baselines.POEM.Skylines.PRMWrapper",
"utils.argsw... | [((315, 377), 'warnings.simplefilter', 'warnings.simplefilter', ([], {'action': '"""ignore"""', 'category': 'FutureWarning'}), "(action='ignore', category=FutureWarning)\n", (336, 377), False, 'import warnings\n'), ((2637, 2643), 'time.time', 'time', ([], {}), '()\n', (2641, 2643), False, 'from time import time\n'), ((... |
"""
Principal module of the application, redirect to all road of the app
"""
import csv
from flask import Flask, request, render_template, redirect, url_for
APP = Flask(__name__)
@APP.route('/')
def home():
"""
home : return home view
Parameters
----------
none
Return
-------
html page... | [
"flask.render_template",
"flask.Flask",
"csv.writer",
"flask.url_for",
"csv.reader"
] | [((164, 179), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (169, 179), False, 'from flask import Flask, request, render_template, redirect, url_for\n'), ((367, 404), 'flask.render_template', 'render_template', (['"""home.html"""'], {'gaz': 'gaz'}), "('home.html', gaz=gaz)\n", (382, 404), False, 'from fla... |
import pytest
from botx import SystemEvents
pytest_plugins = ("tests.test_collecting.fixtures",)
def test_registration_handler_for_several_system_events(
handler_as_function,
extract_collector,
collector_cls,
):
system_events = {
SystemEvents.chat_created,
SystemEvents.file_transfer,... | [
"pytest.mark.parametrize",
"botx.SystemEvents",
"pytest.raises"
] | [((793, 1034), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""event"""', '[SystemEvents.added_to_chat, SystemEvents.deleted_from_chat, SystemEvents.\n chat_created, SystemEvents.file_transfer, SystemEvents.left_from_chat,\n SystemEvents.cts_login, SystemEvents.cts_logout]'], {}), "('event', [SystemEv... |
import argparse
from pathlib import Path
if __name__=="__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--input', type=str, required=True,
help='input corpus to split into words')
parser.add_argument('--output', type=str, required=True,
help... | [
"argparse.ArgumentParser",
"pathlib.Path"
] | [((80, 105), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (103, 105), False, 'import argparse\n'), ((526, 550), 'pathlib.Path', 'Path', (['args.output_corpus'], {}), '(args.output_corpus)\n', (530, 550), False, 'from pathlib import Path\n'), ((587, 604), 'pathlib.Path', 'Path', (['args.corpus... |