code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from __future__ import absolute_import, division, print_function, unicode_literals
import json
import pickle
import argparse
import torch
from kobert.pytorch_kobert import get_pytorch_kobert_model
from kobert.utils import get_tokenizer
from model.net import KobertSequenceFeatureExtractor, KobertCRF, KobertBiLSTMCRF, Ko... | [
"json.load",
"argparse.ArgumentParser",
"data_utils.vocab_tokenizer.Tokenizer",
"pathlib.Path",
"pickle.load",
"torch.cuda.is_available",
"torch.device",
"gluonnlp.data.SentencepieceTokenizer",
"data_utils.utils.Config",
"torch.tensor"
] | [((608, 628), 'pathlib.Path', 'Path', (['args.model_dir'], {}), '(args.model_dir)\n', (612, 628), False, 'from pathlib import Path\n'), ((648, 691), 'data_utils.utils.Config', 'Config', ([], {'json_path': "(model_dir / 'config.json')"}), "(json_path=model_dir / 'config.json')\n", (654, 691), False, 'from data_utils.uti... |
'''
Model definition
'''
import numpy as np
import tensorflow as tf
import tensorflow.contrib.slim as slim
from settings import *
from data_prep import calc_iou
def SSDHook(feature_map, hook_id):
"""
Takes input feature map, output the predictions tensor
hook_id is for variable_scope unqie string ID
"""
with tf.... | [
"tensorflow.reduce_sum",
"tensorflow.contrib.layers.flatten",
"tensorflow.reshape",
"tensorflow.contrib.slim.l2_regularizer",
"tensorflow.nn.softmax",
"tensorflow.contrib.slim.conv2d",
"tensorflow.abs",
"tensorflow.nn.top_k",
"tensorflow.concat",
"tensorflow.variable_scope",
"tensorflow.minimum"... | [((1706, 1775), 'tensorflow.placeholder', 'tf.placeholder', (['tf.int32', '[None, num_total_preds]'], {'name': '"""y_true_conf"""'}), "(tf.int32, [None, num_total_preds], name='y_true_conf')\n", (1720, 1775), True, 'import tensorflow as tf\n'), ((1829, 1903), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32', ... |
"""
MIT License
Copyright (c) 2021 GamingGeek
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, dis... | [
"datetime.datetime.now",
"asyncio.sleep",
"discord.ext.commands.Cog.listener"
] | [((1247, 1270), 'discord.ext.commands.Cog.listener', 'commands.Cog.listener', ([], {}), '()\n', (1268, 1270), False, 'from discord.ext import commands\n'), ((1841, 1885), 'datetime.datetime.now', 'datetime.datetime.now', (['datetime.timezone.utc'], {}), '(datetime.timezone.utc)\n', (1862, 1885), False, 'import datetime... |
"""
====================================================================
ConvSCCS cross validation on simulated longitudinal features example
====================================================================
In this example we simulate longitudinal data with preset relative incidence
for each feature. We then perfo... | [
"numpy.sum",
"numpy.sin",
"matplotlib.pylab.suptitle",
"numpy.arange",
"numpy.exp",
"matplotlib.pylab.title",
"matplotlib.pylab.subplots",
"matplotlib.pylab.figure",
"matplotlib.pylab.show",
"tick.survival.SimuSCCS",
"numpy.repeat",
"numpy.ceil",
"numpy.hstack",
"scipy.sparse.csr_matrix",
... | [((903, 926), 'tick.survival.simu_sccs.CustomEffects', 'CustomEffects', (['(lags + 1)'], {}), '(lags + 1)\n', (916, 926), False, 'from tick.survival.simu_sccs import CustomEffects\n'), ((1422, 1565), 'tick.survival.SimuSCCS', 'SimuSCCS', (['n_samples', 'n_intervals', 'n_features', 'n_lags'], {'time_drift': 'time_drift'... |
"""Test the search API."""
from functools import partial
import os
import unittest
import jax
import jax.numpy as jnp
from jax.interpreters.pxla import Chunked, NoSharding, Replicated, ShardedAxis
import numpy as np
from flax import linen as nn
from flax import optim
import ray
import alpa
from alpa import paralleli... | [
"ray.init",
"os.remove",
"alpa.set_parallelize_options",
"unittest.TextTestRunner",
"unittest.TestSuite",
"flax.linen.Dense",
"alpa.DeviceCluster",
"os.path.exists",
"flax.optim.GradientDescent",
"unittest.skip",
"jax.random.PRNGKey",
"ray.shutdown",
"jax.grad",
"jax.numpy.ones",
"jax.nu... | [((2048, 2121), 'unittest.skip', 'unittest.skip', (['"""This test is broken due to unhandled cuda error in nccl."""'], {}), "('This test is broken due to unhandled cuda error in nccl.')\n", (2061, 2121), False, 'import unittest\n'), ((2498, 2573), 'unittest.skip', 'unittest.skip', (['"""This test is broken due to unsup... |
import os
import json
import argparse
import csv
import time
import pandas as pd
from werkzeug.utils import secure_filename
from flask import render_template, jsonify, flash
from flask import Flask, request, redirect, send_from_directory
import sys
import pathlib
path = pathlib.Path(__file__)
sys.path.append(os.path.... | [
"flask.flash",
"csv.reader",
"argparse.ArgumentParser",
"sentiment.Sentiment",
"flask.redirect",
"flask.Flask",
"werkzeug.utils.secure_filename",
"pathlib.Path",
"os.path.isfile",
"flask.jsonify",
"process.batch_process",
"flask.render_template",
"flask.send_from_directory",
"os.path.join"... | [((273, 295), 'pathlib.Path', 'pathlib.Path', (['__file__'], {}), '(__file__)\n', (285, 295), False, 'import pathlib\n'), ((483, 498), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (488, 498), False, 'from flask import Flask, request, redirect, send_from_directory\n'), ((690, 701), 'sentiment.Sentiment', ... |
"""
This examples loads a pre-trained model and evaluates it on the STSbenchmark dataset
Usage:
python evaluation_stsbenchmark.py
OR
python evaluation_stsbenchmark.py model_name
"""
from torch.utils.data import DataLoader
from sentence_transformers import SentenceTransformer, SentencesDataset, LoggingHandler
from sen... | [
"os.path.realpath",
"sentence_transformers.LoggingHandler",
"torch.set_num_threads",
"os.path.join",
"sentence_transformers.SentenceTransformer"
] | [((593, 617), 'torch.set_num_threads', 'torch.set_num_threads', (['(4)'], {}), '(4)\n', (614, 617), False, 'import torch\n'), ((1163, 1194), 'sentence_transformers.SentenceTransformer', 'SentenceTransformer', (['model_name'], {}), '(model_name)\n', (1182, 1194), False, 'from sentence_transformers import SentenceTransfo... |
import numpy, math
from params_geo import *
import nanopores.py4gmsh.basic
import nanopores.py4gmsh.extra
from nanopores.py4gmsh import *
from warnings import warn
def get_geo(x0 = None, crosssections = True, exit_i = None, **params):
"""
writes a 3d geo file for an extruded axissymmetric geometry
for Howo... | [
"numpy.asarray",
"dolfin.plot",
"numpy.array",
"nanopores.geo2xml.geofile2geo",
"warnings.warn"
] | [((678, 2705), 'numpy.array', 'numpy.array', (['[[2.16, 0.0, 0.0], [2.77, 0.0, -0.19], [3.24, 0.0, -0.1], [3.59, 0.0, -0.1],\n [3.83, 0.0, -0.35], [3.84, 0.0, -0.8], [3.67, 0.0, -1.34], [3.73, 0.0, \n -1.96], [3.93, 0.0, -2.31], [4.23, 0.0, -2.67], [4.44, 0.0, -2.81], [\n 4.33, 0.0, -3.25], [4.01, 0.0, -3.5], ... |
#!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | [
"ansible_collections.amazon.aws.plugins.module_utils.ec2.camel_dict_to_snake_dict",
"ansible_collections.amazon.aws.plugins.module_utils.ec2._camel_to_snake",
"ansible_collections.amazon.aws.plugins.module_utils.aws.core.AnsibleAWSModule"
] | [((21763, 21834), 'ansible_collections.amazon.aws.plugins.module_utils.aws.core.AnsibleAWSModule', 'AnsibleAWSModule', ([], {'argument_spec': 'argument_spec', 'supports_check_mode': '(True)'}), '(argument_spec=argument_spec, supports_check_mode=True)\n', (21779, 21834), False, 'from ansible_collections.amazon.aws.plugi... |
import numpy as np
from multiagent.core import World, Agent, Landmark
from multiagent.agents import VIP, Bodyguard, StreetBystander
from multiagent.scenario import VIPScenario
import copy
class Scenario(VIPScenario):
def __init__(self, num_bodyguards=4, num_bystanders=10, communication=True, env_range=1.0, comm_di... | [
"numpy.random.uniform",
"copy.deepcopy",
"numpy.random.choice",
"numpy.random.seed",
"multiagent.agents.StreetBystander",
"numpy.zeros",
"multiagent.core.Landmark",
"multiagent.agents.VIP",
"multiagent.agents.Bodyguard",
"numpy.random.randint",
"numpy.array",
"numpy.arange",
"numpy.cos",
"... | [((628, 635), 'multiagent.core.World', 'World', ([], {}), '()\n', (633, 635), False, 'from multiagent.core import World, Agent, Landmark\n'), ((1945, 1979), 'copy.deepcopy', 'copy.deepcopy', (['world.landmarks[:2]'], {}), '(world.landmarks[:2])\n', (1958, 1979), False, 'import copy\n'), ((2546, 2571), 'numpy.random.see... |
from datetime import datetime
import static
import database
def process_message(reddit, message):
print(message.id)
print(message.author)
print(message.body)
def finish_task(conn, reddit, task_id, trigger_price):
sources = database.get_sources(conn, task_id)
for source in sources:
so... | [
"database.get_subscribers",
"database.remove_task",
"database.get_task_details",
"database.get_sources"
] | [((246, 281), 'database.get_sources', 'database.get_sources', (['conn', 'task_id'], {}), '(conn, task_id)\n', (266, 281), False, 'import database\n'), ((1929, 1964), 'database.remove_task', 'database.remove_task', (['conn', 'task_id'], {}), '(conn, task_id)\n', (1949, 1964), False, 'import database\n'), ((401, 442), 'd... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
#
# Imports =====================================================================
import sys
import os.path
import argparse
from string import Template
dirname = os.path.dirname(__file__)
imported_files = os.path.join(dirname, "../src/"... | [
"sys.stderr.write",
"argparse.ArgumentParser",
"sys.exit",
"string.Template"
] | [((1392, 1522), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""This program will create the default ZEO XML\n configuration files."""'}), '(description=\n """This program will create the default ZEO XML\n configuration files."""\n )\n', (1415, 1522), False, 'i... |
import unittest
import os
import sys
sys.path.append(os.getcwd())
sys.path.append(os.path.dirname(os.getcwd()))
from src import SimpleAttribute
from src import InternalHelperUtilities as Utils
class SimpleAttributeTestCase(unittest.TestCase):
def setUp(self):
pass
def test_sa_parsing(self):
... | [
"unittest.main",
"os.getcwd",
"os.path.isdir",
"src.InternalHelperUtilities.readLibertyFile",
"src.SimpleAttribute",
"src.InternalHelperUtilities.moveToNextStatement"
] | [((54, 65), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (63, 65), False, 'import os\n'), ((2552, 2567), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2565, 2567), False, 'import unittest\n'), ((99, 110), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (108, 110), False, 'import os\n'), ((359, 384), 'os.path.isdir', ... |
# VEML6070 Driver Example Code
import time
import busio
import board
import adafruit_veml6070
with busio.I2C(board.SCL, board.SDA) as i2c:
uv = adafruit_veml6070.VEML6070(i2c)
# Alternative constructors with parameters
# uv = adafruit_veml6070.VEML6070(i2c, 'VEML6070_1_T')
# uv = adafruit_v... | [
"busio.I2C",
"adafruit_veml6070.VEML6070",
"time.sleep"
] | [((108, 139), 'busio.I2C', 'busio.I2C', (['board.SCL', 'board.SDA'], {}), '(board.SCL, board.SDA)\n', (117, 139), False, 'import busio\n'), ((158, 189), 'adafruit_veml6070.VEML6070', 'adafruit_veml6070.VEML6070', (['i2c'], {}), '(i2c)\n', (184, 189), False, 'import adafruit_veml6070\n'), ((574, 587), 'time.sleep', 'tim... |
#!/usr/bin/env python
# coding: utf-8
# In[4]:
#importing regular expression to parse through the inpus
special=['$','@','#']
import re
#defining the function using validation()
def validation():
#setting while loop to always be true
while True:
#taking input from the user and storing it to a value called passw... | [
"re.search",
"re.match"
] | [((480, 511), 're.search', 're.search', (['"""[A-Za-z]"""', 'password'], {}), "('[A-Za-z]', password)\n", (489, 511), False, 'import re\n'), ((703, 731), 're.search', 're.search', (['"""[0-9]"""', 'password'], {}), "('[0-9]', password)\n", (712, 731), False, 'import re\n'), ((793, 826), 're.match', 're.match', (['"""[0... |
# Generated by Django 2.0.4 on 2018-09-03 10:00
import clinic.utils.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('clinic', '0016_auto_20180828_0034'),
]
operations = [
migrations.AlterField(
model_name='doctor',... | [
"django.db.models.CharField",
"django.db.models.IntegerField",
"django.db.models.BigIntegerField"
] | [((370, 706), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[('ped', 'Pediatrics'), ('crl', 'Cardiologist'), ('gyl', 'Gynaecolgist'), (\n 'nrl', 'Neurologist'), ('ocl', 'Oncologist'), ('phy', 'Physician'), (\n 'nes', 'Neuro Surgeon'), ('ges', 'General Surgeon'), ('gep',\n 'General Practit... |
# Copyright (c) 2020, NVIDIA CORPORATION.
#
# 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... | [
"cuml.dask.naive_bayes.naive_bayes.MultinomialNB",
"cuml.test.dask.utils.load_text_corpus",
"cuml.dask.cluster.KMeans",
"cuml.dask.datasets.make_blobs"
] | [((876, 897), 'cuml.dask.cluster.KMeans', 'KMeans', ([], {'client': 'client'}), '(client=client)\n', (882, 897), False, 'from cuml.dask.cluster import KMeans\n'), ((1024, 1123), 'cuml.dask.datasets.make_blobs', 'make_blobs', ([], {'n_samples': '(5)', 'n_features': '(5)', 'centers': '(2)', 'n_parts': '(2)', 'cluster_std... |
# Generated by Django 2.1.4 on 2018-12-08 16:45
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('quiz', '0005_auto_20181208_2329'),
]
operations = [
migrations.CreateModel(
name='AttemptAnswer... | [
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.AutoField"
] | [((367, 460), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (383, 460), False, 'from django.db import migrations, models\... |
## TODO: define the convolutional neural network architecture
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
# can use the below import should you choose to initialize the weights of your Net
import torch.nn.init as I
class Net1(nn.Module):
def __init__(se... | [
"torch.nn.Dropout",
"torch.nn.Dropout2d",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.MaxPool2d"
] | [((966, 985), 'torch.nn.Conv2d', 'nn.Conv2d', (['(1)', '(32)', '(3)'], {}), '(1, 32, 3)\n', (975, 985), True, 'import torch.nn as nn\n'), ((1101, 1119), 'torch.nn.MaxPool2d', 'nn.MaxPool2d', (['(2)', '(2)'], {}), '(2, 2)\n', (1113, 1119), True, 'import torch.nn as nn\n'), ((1289, 1309), 'torch.nn.Conv2d', 'nn.Conv2d', ... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | [
"unittest.main",
"qiskit.algorithms.Grover",
"qiskit.QuantumCircuit",
"qiskit.BasicAer.get_backend",
"qiskit.circuit.library.GroverOperator",
"qiskit.quantum_info.Operator",
"qiskit.quantum_info.Statevector.from_label",
"qiskit.utils.QuantumInstance"
] | [((7790, 7805), 'unittest.main', 'unittest.main', ([], {}), '()\n', (7803, 7805), False, 'import unittest\n'), ((973, 990), 'qiskit.QuantumCircuit', 'QuantumCircuit', (['(2)'], {}), '(2)\n', (987, 990), False, 'from qiskit import BasicAer, QuantumCircuit\n'), ((1050, 1079), 'qiskit.circuit.library.GroverOperator', 'Gro... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 17 15:42:13 2018
amortization_table.py
@author: david
# source for most of Mortgage class' basic functions
# https://github.com/jbmohler/mortgage/blob/master/mortgage.py
"""
import argparse
import decimal
import os
import pandas as pd
import numpy ... | [
"numpy.divide",
"datetime.datetime.today",
"argparse.ArgumentParser",
"decimal.Decimal",
"numpy.array"
] | [((12232, 12285), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Mortgage Tools"""'}), "(description='Mortgage Tools')\n", (12255, 12285), False, 'import argparse\n'), ((1697, 1719), 'decimal.Decimal', 'decimal.Decimal', (['""".01"""'], {}), "('.01')\n", (1712, 1719), False, 'import deci... |
from requests.utils import requote_uri
from base64 import b64decode
from hashlib import md5
from Crypto.Cipher import AES
class TwistSourceDecryptor:
BLOCK_SIZE = 16
SECRET_KEY = b'<KEY>'
def __init__(self, enc_src):
self.enc_src = enc_src.encode('utf-8')
def __pad(self, data):
lengt... | [
"hashlib.md5",
"Crypto.Cipher.AES.new",
"base64.b64decode",
"requests.utils.requote_uri"
] | [((928, 951), 'base64.b64decode', 'b64decode', (['self.enc_src'], {}), '(self.enc_src)\n', (937, 951), False, 'from base64 import b64decode\n'), ((1318, 1348), 'Crypto.Cipher.AES.new', 'AES.new', (['key', 'AES.MODE_CBC', 'iv'], {}), '(key, AES.MODE_CBC, iv)\n', (1325, 1348), False, 'from Crypto.Cipher import AES\n'), (... |
import uuid
from sqlalchemy import Column, INTEGER, BIGINT, VARCHAR, ForeignKey
from sqlalchemy.orm import composite, relation
from .person import PersonType
# change of the __doc__ string as getting error in sphinx ==> should be reported to SA project
composite.__doc__ = None # composite.__doc__.replace(":ref:`ma... | [
"uuid.uuid4",
"sqlalchemy.BIGINT",
"sqlalchemy.INTEGER",
"sqlalchemy.VARCHAR",
"sqlalchemy.ForeignKey",
"sqlalchemy.orm.relation"
] | [((1498, 1608), 'sqlalchemy.orm.relation', 'relation', (['"""Billterm"""'], {'back_populates': '"""parent"""', 'cascade': '"""all, delete-orphan"""', 'collection_class': 'CallableList'}), "('Billterm', back_populates='parent', cascade='all, delete-orphan',\n collection_class=CallableList)\n", (1506, 1608), False, 'f... |
#! /usr/bin/python3
# coding: utf-8
# Generate a markdown file from Bibtex entries for "academicpages"
import os
import bibtexparser as bp
from bibtexparser.bwriter import BibTexWriter
from bibtexparser.bibdatabase import BibDatabase
bibfile = open("/home/cwatson/texmf/bib/bib/personal.bib")
bibdb = bp.load(bibfile)
... | [
"bibtexparser.load",
"os.path.basename"
] | [((302, 318), 'bibtexparser.load', 'bp.load', (['bibfile'], {}), '(bibfile)\n', (309, 318), True, 'import bibtexparser as bp\n'), ((2637, 2666), 'os.path.basename', 'os.path.basename', (['md_filename'], {}), '(md_filename)\n', (2653, 2666), False, 'import os\n')] |
""" This document defines the UserManager class"""
# django
from django.contrib.auth.models import BaseUserManager
from django.db import models
from django.db.models import Count
from django.db.models import F
from django.db.models import Q
from django.utils import timezone
# other
from base.managers import BaseManag... | [
"django.utils.timezone.now",
"django.db.models.F",
"django.db.models.Count",
"django.db.models.Q"
] | [((1917, 1931), 'django.utils.timezone.now', 'timezone.now', ([], {}), '()\n', (1929, 1931), False, 'from django.utils import timezone\n'), ((1132, 1156), 'django.db.models.Q', 'Q', ([], {'comment__isnull': '(False)'}), '(comment__isnull=False)\n', (1133, 1156), False, 'from django.db.models import Q\n'), ((1159, 1188)... |
import miniproxypool
import logging
import sys
import time
from time import gmtime, strftime
import requests
logging.basicConfig(stream=sys.stdout, level=logging.INFO, format='[%(name)20.20s] [%(asctime)s] [%(levelname)7.7s] [%(threadName)10s] %(message)s', datefmt='%Y-%m-%d %H:%M:%S',)
logging.getLogger('requests').s... | [
"logging.basicConfig",
"time.gmtime",
"time.sleep",
"miniproxypool.get_all_proxies",
"miniproxypool.run_as_daemon",
"logging.getLogger"
] | [((110, 297), 'logging.basicConfig', 'logging.basicConfig', ([], {'stream': 'sys.stdout', 'level': 'logging.INFO', 'format': '"""[%(name)20.20s] [%(asctime)s] [%(levelname)7.7s] [%(threadName)10s] %(message)s"""', 'datefmt': '"""%Y-%m-%d %H:%M:%S"""'}), "(stream=sys.stdout, level=logging.INFO, format=\n '[%(name)20.... |
# !/Library/Frameworks/Python.framework/Versions/3.7/bin/python3
# -*- coding:utf-8 -*-
# @Author : Jiazhixiang
# ็ฌๅๅ4ไธชๅธธ่ง้ฃ็ฉๅ็ฑป็ๅ4้กต็ไบ้ฃ็ฉๆฐๆฎไฟกๆฏ
from gevent import monkey
# ่ฎฉ็จๅบๅๆๅผๆญฅๆจกๅผ
# ไปgeventๅบ้ๅฏผๅ
ฅmonkeyๆจกๅ
# monkey.patch_all()่ฝๆ็จๅบๅๆๅไฝๅผ่ฟ่ก๏ผๅฐฑๆฏๅฏไปฅๅธฎๅฉ็จๅบๅฎ็ฐๅผๆญฅใ
monkey.patch_all()
from gevent.queue import Queue
import requests, gevent
... | [
"gevent.spawn",
"gevent.monkey.patch_all",
"requests.get",
"bs4.BeautifulSoup",
"gevent.queue.Queue",
"gevent.joinall"
] | [((246, 264), 'gevent.monkey.patch_all', 'monkey.patch_all', ([], {}), '()\n', (262, 264), False, 'from gevent import monkey\n'), ((706, 713), 'gevent.queue.Queue', 'Queue', ([], {}), '()\n', (711, 713), False, 'from gevent.queue import Queue\n'), ((1962, 1987), 'gevent.joinall', 'gevent.joinall', (['task_list'], {}), ... |
from __future__ import absolute_import
from hls4ml.templates.templates import Backend, register_backend, get_backend
from hls4ml.templates.vivado_template import VivadoBackend
from hls4ml.templates.oneapi_template import OneAPI
register_backend('Vivado', VivadoBackend)
register_backend('oneAPI', OneAPI) | [
"hls4ml.templates.templates.register_backend"
] | [((230, 271), 'hls4ml.templates.templates.register_backend', 'register_backend', (['"""Vivado"""', 'VivadoBackend'], {}), "('Vivado', VivadoBackend)\n", (246, 271), False, 'from hls4ml.templates.templates import Backend, register_backend, get_backend\n'), ((272, 306), 'hls4ml.templates.templates.register_backend', 'reg... |
import py, weakref
from rpython.rlib import rgc
from rpython.rtyper.lltypesystem import lltype, llmemory
from rpython.rtyper.test.tool import BaseRtypingTest
class TestRweakref(BaseRtypingTest):
def test_weakref_simple(self):
class A:
pass
class B(A):
pass
class C(A... | [
"rpython.rtyper.lltypesystem.lltype.nullptr",
"rpython.rlib.rgc.collect",
"rpython.rtyper.lltypesystem.lltype.GcStruct",
"rpython.rtyper.lltypesystem.lltype.Ptr",
"rpython.rtyper.lltypesystem.lltype.malloc",
"rpython.rtyper.lltypesystem.llmemory.weakref_create",
"weakref.ref"
] | [((903, 918), 'weakref.ref', 'weakref.ref', (['a1'], {}), '(a1)\n', (914, 918), False, 'import py, weakref\n'), ((970, 985), 'weakref.ref', 'weakref.ref', (['a2'], {}), '(a2)\n', (981, 985), False, 'import py, weakref\n'), ((1345, 1360), 'weakref.ref', 'weakref.ref', (['a1'], {}), '(a1)\n', (1356, 1360), False, 'import... |
"""
Descriptors
============
The descriptors module offers all kinds of acoustics related descriptors.
.. toctree::
:maxdepth: 2
Descriptors from ISO/TR 25417:2007
**********************************
Descriptors from :mod:`acoustics.standards.iso_tr_25417_2007`.
.. autoattribute:: acoustics.descriptors.REFERENC... | [
"numpy.log10",
"numpy.array",
"numpy.sum"
] | [((3138, 3154), 'numpy.array', 'np.array', (['levels'], {}), '(levels)\n', (3146, 3154), True, 'import numpy as np\n'), ((3545, 3561), 'numpy.array', 'np.array', (['levels'], {}), '(levels)\n', (3553, 3561), True, 'import numpy as np\n'), ((3763, 3779), 'numpy.array', 'np.array', (['levels'], {}), '(levels)\n', (3771, ... |
# SPOC lab CAMยฒ: hetcam-webcam
# How to make the script run on startup:
# sudo nano /etc/rc.local
# insert:
# sudo python3 /home/pi/sample.py & > /home/pi/Desktop/log.txt 2>&1
# icons from:
# https://fontawesome.com/v4.7.0/examples/
# how to schedule:
# https://stackoverflow.com/questions/21214270/how-to-schedule-a-f... | [
"camera.VideoCamera",
"flask_apscheduler.APScheduler",
"os.path.abspath",
"os.mkdir",
"datetime.datetime.today",
"flask.request.args.get",
"flask.request.files.getlist",
"os.path.isdir",
"cv2.imwrite",
"os.stat",
"flask.Flask",
"datetime.datetime.now",
"datetime.timedelta",
"flask.render_t... | [((1211, 1226), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (1216, 1226), False, 'from flask import Flask, render_template, Response, request\n'), ((1340, 1353), 'flask_apscheduler.APScheduler', 'APScheduler', ([], {}), '()\n', (1351, 1353), False, 'from flask_apscheduler import APScheduler\n'), ((3906,... |
"""playground music_beats
"""
import numpy as np
import matplotlib.pylab as plt
# v1: 2 patterns
# v2: 16 probs for event
t = np.linspace(0, 16-1, 16)
print("t", t)
p1 = np.zeros((16, 1))
p2 = np.zeros((16, 1))
p1[[0, 4, 8, 12],0] = 1.
p2[[0, 6, 8, 14],0] = 1.
plt.subplot(211)
plt.bar(t, p1) # , "ko")
plt.subpl... | [
"matplotlib.pylab.subplot",
"numpy.zeros",
"matplotlib.pylab.bar",
"numpy.linspace",
"matplotlib.pylab.show"
] | [((129, 155), 'numpy.linspace', 'np.linspace', (['(0)', '(16 - 1)', '(16)'], {}), '(0, 16 - 1, 16)\n', (140, 155), True, 'import numpy as np\n'), ((175, 192), 'numpy.zeros', 'np.zeros', (['(16, 1)'], {}), '((16, 1))\n', (183, 192), True, 'import numpy as np\n'), ((198, 215), 'numpy.zeros', 'np.zeros', (['(16, 1)'], {})... |
from datetime import datetime
import pymongo
from aiohttp.web_request import Request
from aiohttp.web_response import (Response,
json_response)
from collector.services.persistence import (find,
save,
... | [
"collector.services.persistence.save",
"aiohttp.web_response.json_response",
"collector.utils.bad_request_json",
"datetime.datetime.strptime",
"collector.services.persistence.documents.escape_dots",
"collector.services.persistence.find"
] | [((609, 646), 'collector.services.persistence.save', 'save', (['document'], {'collection': 'collection'}), '(document, collection=collection)\n', (613, 646), False, 'from collector.services.persistence import find, save, documents\n'), ((815, 846), 'aiohttp.web_response.json_response', 'json_response', (["{'status': 'O... |
from multiprocessing import Pool
from functools import partial
from pathlib import Path
import pandas as pd
import numpy as np
from numpy import array
import matplotlib.pyplot as plt
import tqdm
from fire import Fire
from bifacial_radiance.main import RadianceObj,AnalysisObj, _popen
Path.ls = lambda x: sorted(list(x.... | [
"functools.partial",
"fire.Fire",
"pathlib.Path.home",
"numpy.deg2rad",
"pandas.read_hdf",
"bifacial_radiance.main._popen",
"pathlib.Path",
"numpy.sin",
"numpy.array",
"numpy.cos",
"multiprocessing.Pool",
"numpy.arctan",
"numpy.sqrt"
] | [((10446, 10477), 'numpy.array', 'array', (['[-15.965, -1.45, height]'], {}), '([-15.965, -1.45, height])\n', (10451, 10477), False, 'from numpy import array\n'), ((10493, 10533), 'numpy.array', 'array', (['[-15.965, -1.45 + length, height]'], {}), '([-15.965, -1.45 + length, height])\n', (10498, 10533), False, 'from n... |
# -*- coding: utf-8 -*-
from flask_wtf import FlaskForm
from wtforms.validators import DataRequired, Length
from wtforms import StringField, SubmitField, SelectField, TextAreaField, ValidationError, HiddenField, \
BooleanField, PasswordField
class LoginForm(FlaskForm):
username = StringField('็จๆทๅ', validators... | [
"wtforms.BooleanField",
"wtforms.SubmitField",
"wtforms.validators.Length",
"wtforms.validators.DataRequired"
] | [((448, 468), 'wtforms.BooleanField', 'BooleanField', (['"""่ฎฐไฝๅฏ็ """'], {}), "('่ฎฐไฝๅฏ็ ')\n", (460, 468), False, 'from wtforms import StringField, SubmitField, SelectField, TextAreaField, ValidationError, HiddenField, BooleanField, PasswordField\n'), ((482, 499), 'wtforms.SubmitField', 'SubmitField', (['"""็ป้"""'], {}), "(... |
from json.decoder import JSONDecoder
import serial
import json
import time
class open_motor:
def __init__(self):
self.ser = serial.Serial()
self.pos_pid_msg = {}
self.vel_pid_msg = {}
self.pid_config_msg = {}
self.msg_data = {}
self._port = None
self._baudra... | [
"serial.Serial",
"json.loads",
"json.dumps"
] | [((138, 153), 'serial.Serial', 'serial.Serial', ([], {}), '()\n', (151, 153), False, 'import serial\n'), ((528, 592), 'serial.Serial', 'serial.Serial', (['self._port', 'self._baudrate'], {'timeout': 'self._timeout'}), '(self._port, self._baudrate, timeout=self._timeout)\n', (541, 592), False, 'import serial\n'), ((1805... |
"""Handling of skew surge data.
Two skew surge datasets are implemented: the dataset for Brest created
by Reinert et al. (2021), which can be received from the authors upon
request, and the GESLA-2 surge dataset of Marcos & Woodworth (2017).
See the file โtools_GESLAโ for further information on the latter.
Written by... | [
"numpy.load",
"calendar.timegm",
"tools_GESLA.get_GESLA_surge_filename",
"numpy.array",
"tools_GESLA.read_GESLA_surge_file"
] | [((3139, 3163), 'numpy.load', 'np.load', (['SKEW_SURGE_FILE'], {}), '(SKEW_SURGE_FILE)\n', (3146, 3163), True, 'import numpy as np\n'), ((3185, 3217), 'numpy.array', 'np.array', (['high_tides'], {'dtype': 'bool'}), '(high_tides, dtype=bool)\n', (3193, 3217), True, 'import numpy as np\n'), ((4331, 4375), 'calendar.timeg... |
import os
import sys
import datetime
from pathlib import Path
from logging import getLogger, Formatter, StreamHandler, INFO, WARNING
from logging import FileHandler
import importlib
import pandas as pd
import numpy as np
from easydict import EasyDict as edict
def is_devmode():
return True if os.uname().nodename... | [
"logging.FileHandler",
"pandas.read_csv",
"logging.StreamHandler",
"os.uname",
"logging.Formatter",
"pathlib.Path",
"numpy.array",
"easydict.EasyDict",
"datetime.datetime.now",
"logging.getLogger"
] | [((627, 644), 'easydict.EasyDict', 'edict', (['mod.CONFIG'], {}), '(mod.CONFIG)\n', (632, 644), True, 'from easydict import EasyDict as edict\n'), ((1018, 1043), 'logging.FileHandler', 'FileHandler', (['logfile_path'], {}), '(logfile_path)\n', (1029, 1043), False, 'from logging import FileHandler\n'), ((1105, 1120), 'l... |
#!/usr/bin/python
#
# Copyright 2018-2022 Polyaxon, 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 ... | [
"polyaxon.utils.path_utils.check_or_create_path",
"polyaxon.logger.logger.info",
"polyaxon.utils.list_utils.to_list"
] | [((1016, 1065), 'polyaxon.utils.path_utils.check_or_create_path', 'check_or_create_path', (['path_to'], {'is_dir': '(not is_file)'}), '(path_to, is_dir=not is_file)\n', (1036, 1065), False, 'from polyaxon.utils.path_utils import check_or_create_path\n'), ((1271, 1304), 'polyaxon.utils.list_utils.to_list', 'to_list', ([... |
"""Elasticsearch store plugin."""
import json
import logging
from elasticsearch import Elasticsearch, ElasticsearchException
_log = logging.getLogger(__name__)
class EsStore:
"""Elasticsearch adapter to index cloud data in Elasticsearch."""
def __init__(self, host='localhost', port=9200, index='cloudmark... | [
"elasticsearch.Elasticsearch",
"logging.getLogger",
"json.dumps"
] | [((136, 163), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (153, 163), False, 'import logging\n'), ((967, 1012), 'elasticsearch.Elasticsearch', 'Elasticsearch', (["[{'host': host, 'port': port}]"], {}), "([{'host': host, 'port': port}])\n", (980, 1012), False, 'from elasticsearch import... |
import pathlib
from setuptools import setup, find_packages
base_packages = [
"scikit-learn>=1.0.0",
"cleanlab>=1.0",
"pandas>=1.3.3",
]
docs_packages = [
"mkdocs==1.1",
"mkdocs-material==4.6.3",
"mkdocstrings==0.8.0",
"mktestdocs==0.1.2",
]
test_packages = [
"interrogate>=1.5.0",
... | [
"pathlib.Path",
"setuptools.find_packages"
] | [((605, 649), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['notebooks', 'docs']"}), "(exclude=['notebooks', 'docs'])\n", (618, 649), False, 'from setuptools import setup, find_packages\n'), ((723, 748), 'pathlib.Path', 'pathlib.Path', (['"""README.md"""'], {}), "('README.md')\n", (735, 748), False, '... |
import yaml
from trial_dispatcher import TrialDispatcher as Dispatcher
EMAIL_DRYRUN = True
subscriptions = """\
---
trial_abc: "ABC National Trial"
trial_def: "DEF International Trial"
site_xxx: "XXX Regional Site"
site_yyy: "YYY City Site"
---
- name: "<NAME>"
affiliation: "site_xxx"
email: "<EMAIL>"
... | [
"trial_dispatcher.TrialDispatcher",
"yaml.safe_load_all"
] | [((1884, 1917), 'yaml.safe_load_all', 'yaml.safe_load_all', (['subscriptions'], {}), '(subscriptions)\n', (1902, 1917), False, 'import yaml\n'), ((1935, 1972), 'trial_dispatcher.TrialDispatcher', 'Dispatcher', ([], {'channel_tags': 'channel_tags'}), '(channel_tags=channel_tags)\n', (1945, 1972), True, 'from trial_dispa... |
import asyncio
import json
import time
from collections import namedtuple
from quickspy.color import *
from quickspy.util import get_uuid
from quickspy import jsmsg
from qss.urlmanager import UrlManager
CONN_TIMEOUT = 60000
Temp = namedtuple('Temp', ['comefrom', 'msg'])
class NoAPIError(Exception):
def __in... | [
"asyncio.start_server",
"quickspy.util.get_uuid",
"quickspy.jsmsg",
"json.dumps",
"time.time",
"collections.namedtuple",
"qss.urlmanager.UrlManager"
] | [((235, 274), 'collections.namedtuple', 'namedtuple', (['"""Temp"""', "['comefrom', 'msg']"], {}), "('Temp', ['comefrom', 'msg'])\n", (245, 274), False, 'from collections import namedtuple\n'), ((1418, 1455), 'collections.namedtuple', 'namedtuple', (['"""RegedNE"""', "['uuid', 'NE']"], {}), "('RegedNE', ['uuid', 'NE'])... |
from django.shortcuts import redirect, render
def homepage(request):
return render(request, 'study/home.html') | [
"django.shortcuts.render"
] | [((81, 115), 'django.shortcuts.render', 'render', (['request', '"""study/home.html"""'], {}), "(request, 'study/home.html')\n", (87, 115), False, 'from django.shortcuts import redirect, render\n')] |
import sys
import pele_platform.Errors.custom_errors as ce
def check_limit_number_atoms(sdf:str, limit_atoms: int):
from rdkit import Chem
""" Function to check input file does not excit
certin number of atoms """
mols = Chem.SDMolSupplier(sdf)
for mol in mols:
atoms = mol.GetAtoms()
n... | [
"rdkit.Chem.SDMolSupplier",
"pele_platform.Errors.custom_errors.LigandSizeExceed",
"rdkit.Chem.GetSSSR",
"rdkit.Chem.rdMolAlign.GetO3A"
] | [((238, 261), 'rdkit.Chem.SDMolSupplier', 'Chem.SDMolSupplier', (['sdf'], {}), '(sdf)\n', (256, 261), False, 'from rdkit import Chem\n'), ((707, 727), 'rdkit.Chem.GetSSSR', 'Chem.GetSSSR', (['ligand'], {}), '(ligand)\n', (719, 727), False, 'from rdkit import Chem\n'), ((729, 754), 'rdkit.Chem.GetSSSR', 'Chem.GetSSSR', ... |
import os
import sys
from bead.exceptions import InvalidArchive
from bead.workspace import Workspace
from bead import spec as bead_spec
from bead.archive import Archive
from bead import box as bead_box
from bead.tech.fs import Path
from bead.tech.timestamp import time_from_user, parse_iso8601
from . import arg_help
fr... | [
"os.makedirs",
"bead.workspace.Workspace.for_current_working_directory",
"os.path.isdir",
"bead.tech.timestamp.parse_iso8601",
"bead.archive.Archive",
"os.path.isfile",
"bead.tech.fs.Path",
"sys.stderr.write",
"sys.exit"
] | [((397, 424), 'bead.tech.timestamp.parse_iso8601', 'parse_iso8601', (['"""9999-12-31"""'], {}), "('9999-12-31')\n", (410, 424), False, 'from bead.tech.timestamp import time_from_user, parse_iso8601\n'), ((461, 488), 'sys.stderr.write', 'sys.stderr.write', (['"""ERROR: """'], {}), "('ERROR: ')\n", (477, 488), False, 'im... |
from fuzzconfig import FuzzConfig
import nonrouting
import pytrellis
import fuzzloops
import interconnect
cfg = FuzzConfig(job="USRMCLK", family="ECP5", device="LFE5U-45F", ncl="empty.ncl",
tiles=["MIB_R71C4:EFB0_PICB0", "MIB_R71C5:EFB1_PICB1", "MIB_R71C6:EFB2_PICB0",
"MIB_R71C... | [
"pytrellis.load_database",
"fuzzconfig.FuzzConfig"
] | [((113, 325), 'fuzzconfig.FuzzConfig', 'FuzzConfig', ([], {'job': '"""USRMCLK"""', 'family': '"""ECP5"""', 'device': '"""LFE5U-45F"""', 'ncl': '"""empty.ncl"""', 'tiles': "['MIB_R71C4:EFB0_PICB0', 'MIB_R71C5:EFB1_PICB1', 'MIB_R71C6:EFB2_PICB0',\n 'MIB_R71C7:EFB3_PICB1', 'MIB_R71C3:BANKREF8']"}), "(job='USRMCLK', fam... |
import matplotlib.pyplot as plt
import math
import re
import sys
import glob
import os
import os.path
import numpy as np
import matplotlib.colors as mcolors
molecules = open('type_1_gephi.csv','r')
lines = molecules.readlines()
counter = 0
#print('lines'+str(lines))
with open('imagen.csv', 'a') as the_file:
the_file... | [
"os.system"
] | [((565, 580), 'os.system', 'os.system', (['code'], {}), '(code)\n', (574, 580), False, 'import os\n')] |
from keystonev3.common import send
from keystonev3.arg_converter import get_by_name_or_uuid_multiple
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
@get_by_name_or_uuid_multiple([('user', 'user_id')])
@send('get')
def user_get_details(user_id, **kwargs):
url = '/u... | [
"keystonev3.common.send",
"urllib.urlencode",
"keystonev3.arg_converter.get_by_name_or_uuid_multiple"
] | [((201, 252), 'keystonev3.arg_converter.get_by_name_or_uuid_multiple', 'get_by_name_or_uuid_multiple', (["[('user', 'user_id')]"], {}), "([('user', 'user_id')])\n", (229, 252), False, 'from keystonev3.arg_converter import get_by_name_or_uuid_multiple\n'), ((254, 265), 'keystonev3.common.send', 'send', (['"""get"""'], {... |
import os
DEBUG = True
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
#not used right now.
CSRF_ENABLED = True
#Same here for session cookies.
SECRET_KEY = os.getenv("SECRET_KEY")
SESSION_TYPE="filesystem"
SECRET=os.getenv("SECRET")
MONGO_URI="mongodb+srv://{0}:{1}@mlh-summer-hacks-dqi2z.gcp.mongodb.net/geo_i... | [
"os.path.dirname",
"os.getenv"
] | [((166, 189), 'os.getenv', 'os.getenv', (['"""SECRET_KEY"""'], {}), "('SECRET_KEY')\n", (175, 189), False, 'import os\n'), ((223, 242), 'os.getenv', 'os.getenv', (['"""SECRET"""'], {}), "('SECRET')\n", (232, 242), False, 'import os\n'), ((50, 75), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n'... |
# -*- coding: utf-8 -*-
from pythonosc import udp_client
from gpiozero import CPUTemperature
import time
# Network config of the companion instance that should display the CPU Temp
targetIP = "127.0.0.1"
targetPort = 12321
targetPage = 99 # page in companion that will display the CPU Temp
targetButton =... | [
"pythonosc.udp_client.SimpleUDPClient",
"gpiozero.CPUTemperature",
"time.sleep"
] | [((797, 845), 'pythonosc.udp_client.SimpleUDPClient', 'udp_client.SimpleUDPClient', (['targetIP', 'targetPort'], {}), '(targetIP, targetPort)\n', (823, 845), False, 'from pythonosc import udp_client\n'), ((1433, 1446), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (1443, 1446), False, 'import time\n'), ((1038, 10... |
"""
clean.py
author(s): khuynh
description: this is a helper script to clean a set of facebook messages.
it outputs the facebook messages into a single .txt file with each message
on its own line
link to download your facebook messages:
https://www.facebook.com/dyi/?referrer=yfi_settings
"""
import json
import string
... | [
"pathlib.Path",
"json.load"
] | [((367, 389), 'pathlib.Path', 'Path', (['"""messages/inbox"""'], {}), "('messages/inbox')\n", (371, 389), False, 'from pathlib import Path\n'), ((805, 828), 'json.load', 'json.load', (['message_json'], {}), '(message_json)\n', (814, 828), False, 'import json\n')] |
import os
import glob
import logging
from conans import ConanFile, tools, Meson
_meson_feature = ["disabled", "enabled", "auto"]
_features = []
class GStPluginsBadConan(ConanFile):
python_requires = "aac-sdk-tools/1.0"
python_requires_extend = "aac-sdk-tools.BaseSdkDependency"
name = "gst-plugins-bad"
... | [
"conans.tools.get",
"conans.Meson",
"os.getcwd",
"os.rename",
"conans.tools.patch",
"logging.info",
"glob.glob",
"os.path.join",
"os.getenv",
"conans.tools.cross_building",
"conans.tools.collect_libs"
] | [((1781, 1834), 'conans.tools.get', 'tools.get', ([], {}), "(**self.conan_data['sources'][self.version])\n", (1790, 1834), False, 'from conans import ConanFile, tools, Meson\n'), ((1843, 1907), 'os.rename', 'os.rename', (['f"""{self.name}-{self.version}"""', 'self._source_subfolder'], {}), "(f'{self.name}-{self.version... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Product.browser'
db.add_column(u'feedback_product', 'brow... | [
"south.db.db.delete_column"
] | [((559, 607), 'south.db.db.delete_column', 'db.delete_column', (['u"""feedback_product"""', '"""browser"""'], {}), "(u'feedback_product', 'browser')\n", (575, 607), False, 'from south.db import db\n')] |
from solid_toolbox.extrusion import (
remove_adjacent_duplicates,
force_3d,
extrude_with_offsets,
)
from solid_toolbox.units import Vec, Vec2d, Point2d
def test_remove_adjacent_duplicates():
test_cases = [
([], []),
([1], [1]),
([1, 2, 1], [1, 2, 1]),
([1, 2, 2, 1], [1,... | [
"solid_toolbox.units.Vec",
"solid_toolbox.units.Vec2d",
"solid_toolbox.units.Point2d",
"solid_toolbox.extrusion.remove_adjacent_duplicates"
] | [((639, 651), 'solid_toolbox.units.Vec', 'Vec', (['(1)', '(2)', '(0)'], {}), '(1, 2, 0)\n', (642, 651), False, 'from solid_toolbox.units import Vec, Vec2d, Point2d\n'), ((689, 701), 'solid_toolbox.units.Vec', 'Vec', (['(1)', '(2)', '(3)'], {}), '(1, 2, 3)\n', (692, 701), False, 'from solid_toolbox.units import Vec, Vec... |
from flask import current_app as app
from flask import Blueprint, render_template
from flask_login import login_required
from .viewmodels.DashboardViewModel import DashboardViewModel
from ...services.QuizService import QuizService
from ...repositories.SubjectRepository import SubjectRepository
home_controller = Bl... | [
"flask.Blueprint",
"flask.current_app.config.get",
"flask.render_template"
] | [((318, 396), 'flask.Blueprint', 'Blueprint', (['"""home_controller"""', '__name__'], {'template_folder': '"""views"""', 'url_prefix': '""""""'}), "('home_controller', __name__, template_folder='views', url_prefix='')\n", (327, 396), False, 'from flask import Blueprint, render_template\n'), ((979, 1031), 'flask.render_... |
"""
Tests for the :func:`dicom_parser.utils.mime_generator.generate_by_mime`
utility function.
"""
import importlib.util
import platform
from typing import Generator
from unittest import TestCase
import pytest
from dicom_parser.utils.mime_generator import check_magic, generate_by_mime
from tests.fixtures import TEST_... | [
"platform.system",
"dicom_parser.utils.mime_generator.generate_by_mime",
"pytest.mark.skipif",
"dicom_parser.utils.mime_generator.check_magic"
] | [((873, 937), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(not RUNNING_ON_WINDOWS)'], {'reason': 'WINDOWS_TESTS'}), '(not RUNNING_ON_WINDOWS, reason=WINDOWS_TESTS)\n', (891, 937), False, 'import pytest\n'), ((1543, 1614), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(MAGIC or RUNNING_ON_WINDOWS)'], {'reason': '"""... |
from fabric.api import local, settings
def bump_patch():
with open('angular_scaffold/_version.py', 'r') as f:
original = f.read()
version = original.split('=')[1].strip('\" \n\'')
major, minor, patch = version.split('.')
patch = int(patch) + 1
with open('angular_scaffold/_versi... | [
"fabric.api.local",
"fabric.api.settings"
] | [((411, 456), 'fabric.api.local', 'local', (['"""git add angular_scaffold/_version.py"""'], {}), "('git add angular_scaffold/_version.py')\n", (416, 456), False, 'from fabric.api import local, settings\n'), ((461, 537), 'fabric.api.local', 'local', (['(\'git commit -m "updated version to %s.%s.%s"\' % (major, minor, pa... |
import os
import shutil
import subprocess
import pytest
def _assert_eq(left, right):
assert left == right, '{} != {}'.format(left, right)
N_STEPS = 100
N_TRIALS = 2
N_JOBS = 1
ALGOS = ('ppo2', 'a2c', 'trpo', 'acktr')
# Not yet supported:
# ALGOS = ('acer', 'dqn')
ENV_IDS = ('CartPole-v1',)
LOG_FOLDER = 'logs/... | [
"os.path.isdir",
"pytest.mark.parametrize",
"subprocess.call",
"shutil.rmtree"
] | [((727, 752), 'os.path.isdir', 'os.path.isdir', (['LOG_FOLDER'], {}), '(LOG_FOLDER)\n', (740, 752), False, 'import os\n'), ((787, 840), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""sampler"""', "['random', 'tpe']"], {}), "('sampler', ['random', 'tpe'])\n", (810, 840), False, 'import pytest\n'), ((842, 90... |
import digi
if __name__ == '__main__':
digi.run()
| [
"digi.run"
] | [((44, 54), 'digi.run', 'digi.run', ([], {}), '()\n', (52, 54), False, 'import digi\n')] |
""" Functions and Operations for analysing a cluster's tidal tails
"""
__author__ = "<NAME>"
__all__ = [
"to_tail",
"tail_path",
"tail_path_match",
]
try:
from galpy.util import conversion
except:
import galpy.util.bovy_conversion as conversion
from galpy.util import _rotate_to_arbitrary_vector
f... | [
"numpy.sum",
"numpy.append",
"numpy.fabs",
"numpy.array",
"numpy.mean",
"numpy.tan",
"numpy.arctan",
"numpy.sqrt",
"matplotlib.pyplot.savefig",
"numpy.atleast_2d"
] | [((1386, 1438), 'numpy.array', 'np.array', (['[cluster.vxgc, cluster.vygc, cluster.vzgc]'], {}), '([cluster.vxgc, cluster.vygc, cluster.vzgc])\n', (1394, 1438), True, 'import numpy as np\n'), ((1455, 1480), 'numpy.array', 'np.array', (['[1.0, 0.0, 0.0]'], {}), '([1.0, 0.0, 0.0])\n', (1463, 1480), True, 'import numpy as... |
# coding: utf-8
import math
print(math.atanh(math.tanh(2)))
| [
"math.tanh"
] | [((47, 59), 'math.tanh', 'math.tanh', (['(2)'], {}), '(2)\n', (56, 59), False, 'import math\n')] |
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import optuna
import mlflow
import os
import numpy as np
from numpyencoder import NumpyEncoder
from argparse import Namespace
from typing import List, Dict, Tuple, Optional
from pathlib import Path
import tempfile
import j... | [
"torch.nn.MSELoss",
"recsys.utils.get_data",
"recsys.models.initialize_model",
"recsys.data.RCDataloader",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"optuna.TrialPruned",
"pathlib.Path",
"recsys.utils.load_dict",
"torch.cuda.is_available",
"torch.no_grad",
"numpy.vstack"
] | [((4369, 4407), 'pathlib.Path', 'Path', (['config.config_dir', '"""params.json"""'], {}), "(config.config_dir, 'params.json')\n", (4373, 4407), False, 'from pathlib import Path\n'), ((4724, 4740), 'recsys.utils.get_data', 'utils.get_data', ([], {}), '()\n', (4738, 4740), False, 'from recsys import utils, config, data, ... |
import json
from datetime import datetime
from decimal import Decimal
from dateparser import parse
from mt4.constants import get_mt4_symbol
class SignalAction(object):
OPEN = 'OPEN'
CLOSE = 'CLOSE'
UPDATE = 'UPDATE'
class MarketAction(object):
OPEN = 'OPEN'
CLOSE = 'CLOSE'
class EventType(ob... | [
"dateparser.parse",
"datetime.datetime.utcnow",
"mt4.constants.get_mt4_symbol"
] | [((779, 796), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (794, 796), False, 'from datetime import datetime\n'), ((6577, 6603), 'mt4.constants.get_mt4_symbol', 'get_mt4_symbol', (['instrument'], {}), '(instrument)\n', (6591, 6603), False, 'from mt4.constants import get_mt4_symbol\n'), ((7687, 7713)... |
import pandas
from sklearn.preprocessing import StandardScaler
import torch
import torch.nn.functional as F
import torch.optim as optim
# data preprocessing
data = pandas.read_csv('data/linear_800bytes_500_iterations.csv')
data = data.sort_values(by=['time_stamp'])
data = data.reset_index(drop=True)
X = data... | [
"torch.ones",
"sklearn.preprocessing.StandardScaler",
"pandas.read_csv",
"torch.nn.functional.mse_loss",
"torch.mm",
"torch.rand",
"torch.tensor",
"torch.optim.SGD"
] | [((172, 230), 'pandas.read_csv', 'pandas.read_csv', (['"""data/linear_800bytes_500_iterations.csv"""'], {}), "('data/linear_800bytes_500_iterations.csv')\n", (187, 230), False, 'import pandas\n'), ((436, 452), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', ([], {}), '()\n', (450, 452), False, 'from sklearn.p... |
import sublime
import urllib2
import json
import colt
import calendar, time
import os
import threading
from colt import ColtPreferences
runAfterAuthorization = None
statusToSet = "Disconnected from COLT"
class ColtConnection(object):
port = -1
messageId = 1
activeSessions = 0
def setStatus(status):
... | [
"threading.Timer",
"sublime.save_settings",
"time.gmtime",
"colt.getProjectWorkingDir",
"urllib2.Request",
"os.path.exists",
"json.dumps",
"time.sleep",
"sublime.active_window",
"sublime.status_message",
"sublime.load_settings",
"os.path.getmtime",
"sublime.error_message",
"colt.runCOLT",
... | [((1268, 1316), 'sublime.status_message', 'sublime.status_message', (['"""Disconnected from COLT"""'], {}), "('Disconnected from COLT')\n", (1290, 1316), False, 'import sublime\n'), ((1694, 1737), 'sublime.load_settings', 'sublime.load_settings', (['ColtPreferences.NAME'], {}), '(ColtPreferences.NAME)\n', (1715, 1737),... |
import os
import re
from typing import Dict
from typing import Union, List
import toml
from stnm.constants import HOME_PATH
from stnm.response import error_response, success_response
def get_config_path() -> str:
return os.path.abspath(os.path.join(HOME_PATH, "stnm.conf"))
def get_config() -> str:
with op... | [
"toml.dumps",
"stnm.response.success_response",
"toml.loads",
"os.path.join",
"re.compile"
] | [((578, 605), 'toml.loads', 'toml.loads', (['config_contents'], {}), '(config_contents)\n', (588, 605), False, 'import toml\n'), ((3550, 3569), 'stnm.response.success_response', 'success_response', (['(4)'], {}), '(4)\n', (3566, 3569), False, 'from stnm.response import error_response, success_response\n'), ((244, 280),... |
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import cv2
from PIL import Image
import os
def label_to_name(labels, names):
"""
Utility function to map label to corresponding name
"""
arr_map = []
for i in range(0, labels.shape[0]):
label = labels[i]
name = names[names["ClassId"] ... | [
"pandas.DataFrame",
"matplotlib.pyplot.show",
"pandas.pivot_table",
"os.path.join",
"cv2.cvtColor",
"numpy.std",
"matplotlib.pyplot.suptitle",
"PIL.Image.open",
"numpy.mean",
"numpy.random.randint",
"numpy.reshape",
"numpy.linspace",
"numpy.array",
"matplotlib.pyplot.subplots",
"os.listd... | [((416, 437), 'pandas.DataFrame', 'pd.DataFrame', (['arr_map'], {}), '(arr_map)\n', (428, 437), True, 'import pandas as pd\n'), ((540, 626), 'pandas.pivot_table', 'pd.pivot_table', (['mappings'], {'index': "['label', 'name']", 'values': "['id']", 'aggfunc': '"""count"""'}), "(mappings, index=['label', 'name'], values=[... |
import textmining
import numpy
import sklearn
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
m=[]
p=0
with open ("ess1.txt", "r") as myfile:
doc1=myfile.read()
#doc1=myfile.read().replace('\n', '')
with open ("ess2.txt", "r"... | [
"textmining.TermDocumentMatrix",
"numpy.savetxt",
"sklearn.feature_extraction.text.TfidfTransformer",
"numpy.vstack"
] | [((460, 491), 'textmining.TermDocumentMatrix', 'textmining.TermDocumentMatrix', ([], {}), '()\n', (489, 491), False, 'import textmining\n'), ((1803, 1821), 'sklearn.feature_extraction.text.TfidfTransformer', 'TfidfTransformer', ([], {}), '()\n', (1819, 1821), False, 'from sklearn.feature_extraction.text import TfidfTra... |
import asyncio
import logging
from dataclasses import dataclass
from time import time
from typing import Any, Awaitable, Dict, Optional, Sequence
from aioprometheus import Gauge
from aioprometheus.collectors import Registry
from bleak import BleakClient, BleakScanner
from bleak.backends.device import BLEDevice
from bl... | [
"bleak.exc.BleakError",
"aioprometheus.Gauge",
"bleak.BleakScanner",
"asyncio.sleep",
"logging.getLogger",
"time.time",
"bleak.BleakClient",
"dataclasses.dataclass"
] | [((354, 381), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (371, 381), False, 'import logging\n'), ((426, 448), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (435, 448), False, 'from dataclasses import dataclass\n'), ((6604, 6645), 'bleak.BleakScan... |
from PyQt5 import QtWidgets
from concertista.AboutDialog import AboutDialog
def test_about_dialog(main_window):
about_dlg = AboutDialog(main_window)
assert isinstance(about_dlg, AboutDialog)
assert about_dlg.windowTitle() == 'About'
assert isinstance(about_dlg._layout, QtWidgets.QVBoxLayout)
| [
"concertista.AboutDialog.AboutDialog"
] | [((130, 154), 'concertista.AboutDialog.AboutDialog', 'AboutDialog', (['main_window'], {}), '(main_window)\n', (141, 154), False, 'from concertista.AboutDialog import AboutDialog\n')] |
from replace_expression import main
def replace_lexical_cast(line, file_dir, iteration):
if iteration == 0:
if "lexical_cast" in line and ("std::string" in line or "std::wstring" in line):
line = line.replace("< ", "<").replace(" >", ">")
line = line.replace("lexical_cast<st... | [
"replace_expression.main"
] | [((866, 910), 'replace_expression.main', 'main', (['replace_lexical_cast'], {'num_iterations': '(2)'}), '(replace_lexical_cast, num_iterations=2)\n', (870, 910), False, 'from replace_expression import main\n')] |
import logging
import numpy as np
from typing import List, Tuple, Union
from autoarray import exc
from autoarray.mask import abstract_mask, mask_2d
from autoarray.structures.grids.one_d import grid_1d
from autoarray.structures.grids.one_d import grid_1d_util
from autoarray.structures.arrays.one_d import arra... | [
"numpy.full",
"numpy.size",
"numpy.sum",
"logging.basicConfig",
"numpy.invert",
"autoarray.structures.arrays.one_d.array_1d_util.numpy_array_1d_from_fits",
"autoarray.mask.abstract_mask.AbstractMask.__new__",
"autoarray.mask.mask_2d.Mask2D.manual",
"numpy.asarray",
"autoarray.structures.grids.one_... | [((333, 354), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (352, 354), False, 'import logging\n'), ((365, 392), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (382, 392), False, 'import logging\n'), ((1685, 1805), 'autoarray.mask.abstract_mask.AbstractMask.__new__', 'ab... |
"""Simulates Fanout-of-4 delay for a given technology.
Parameters
----------
tech : int
Node designator (16, 7, 5, 4, 3).
vdd : Optional[float], default = nominal
Supply voltage.
Returns
-------
float
Delay in picoseconds.
"""
import os
import math
import argparse
import sys
sys.path.insert(0,'..')
impo... | [
"os.path.abspath",
"device_geometry.node_names.index",
"argparse.ArgumentParser",
"os.system",
"sys.path.insert"
] | [((291, 315), 'sys.path.insert', 'sys.path.insert', (['(0)', '""".."""'], {}), "(0, '..')\n", (306, 315), False, 'import sys\n'), ((364, 389), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (387, 389), False, 'import argparse\n'), ((517, 560), 'device_geometry.node_names.index', 'device_geometr... |
import sys
import os
import unittest
import shutil
from io import StringIO
sys.path.append(".")
from mock_helper import gen_file
from annogesiclib.circrna import CircRNADetection
from mock_args_container import MockClass
class Mock_segemehl(object):
def mock_fasta_index(self, segemehl_path, fasta_path,
... | [
"sys.path.append",
"unittest.main",
"os.mkdir",
"os.remove",
"os.path.isdir",
"annogesiclib.circrna.CircRNADetection",
"mock_args_container.MockClass",
"os.path.exists",
"os.system",
"os.path.isfile",
"shutil.rmtree",
"os.path.join",
"mock_helper.gen_file"
] | [((75, 95), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (90, 95), False, 'import sys\n'), ((12529, 12544), 'unittest.main', 'unittest.main', ([], {}), '()\n', (12542, 12544), False, 'import unittest\n'), ((888, 899), 'mock_args_container.MockClass', 'MockClass', ([], {}), '()\n', (897, 899), Fal... |
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from openapi_server.models.base_model_ import Model
from openapi_server import util
class Names(Model):
"""NOTE: This class is auto generated by OpenAPI Generator... | [
"openapi_server.util.deserialize_model"
] | [((1582, 1615), 'openapi_server.util.deserialize_model', 'util.deserialize_model', (['dikt', 'cls'], {}), '(dikt, cls)\n', (1604, 1615), False, 'from openapi_server import util\n')] |
# Lint as: python3
# Copyright 2020 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | [
"unittest.main",
"tfrecorder.beam_pipeline._get_setup_py_filepath",
"os.path.isabs",
"tfrecorder.beam_pipeline._get_write_to_tfrecord",
"tensorflow.constant",
"unittest.mock.patch",
"tfrecorder.beam_pipeline._partition_fn",
"os.path.isfile",
"tfrecorder.beam_pipeline._preprocessing_fn"
] | [((1203, 1245), 'unittest.mock.patch', 'mock.patch', (['"""tfrecorder.beam_pipeline.tft"""'], {}), "('tfrecorder.beam_pipeline.tft')\n", (1213, 1245), False, 'from unittest import mock\n'), ((2793, 2808), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2806, 2808), False, 'import unittest\n'), ((1100, 1160), 'tfre... |
"""Forms for the learning_log app."""
from django import forms
from django.utils.translation import gettext_lazy as _
from .models import Entry, Topic
class TopicForm(forms.ModelForm):
"""Form for add a new topic."""
class Meta:
model = Topic
fields = ('topic_text', 'public')
labels... | [
"django.forms.Textarea",
"django.utils.translation.gettext_lazy"
] | [((351, 366), 'django.utils.translation.gettext_lazy', '_', (['"""Topic name"""'], {}), "('Topic name')\n", (352, 366), True, 'from django.utils.translation import gettext_lazy as _\n'), ((390, 430), 'django.utils.translation.gettext_lazy', '_', (['"""Do you want make this topic public?"""'], {}), "('Do you want make t... |
import numpy as np
import random
class Tensor (object):
def __init__(self, data, autograd=False, creators=None, creation_op=None, id=None):
self.data = np.array(data)
self.creation_op = creation_op
self.creators = creators
self.grad = None
self.autograd = autograd
s... | [
"numpy.array",
"random.randint"
] | [((166, 180), 'numpy.array', 'np.array', (['data'], {}), '(data)\n', (174, 180), True, 'import numpy as np\n'), ((380, 405), 'random.randint', 'random.randint', (['(0)', '(100000)'], {}), '(0, 100000)\n', (394, 405), False, 'import random\n')] |
# THIS IS A PROGRAM FOR CLUSTERING.
from clustering import clustering # ่ชไฝใขใธใฅใผใซ (clustering.py) ใจ clusteringใฏใฉใน ใฎ import
import pandas as pd
import matplotlib.pyplot as plt
import tkinter as tk
from tkinter import filedialog, image_names, ttk, messagebox
import os
from matplotlib.backends.backend_tkagg import Figure... | [
"os.path.abspath",
"clustering.clustering.balance",
"os.path.basename",
"tkinter.Button",
"pandas.read_csv",
"tkinter.Entry",
"matplotlib.pyplot.Figure",
"clustering.clustering.shortest",
"tkinter.filedialog.askopenfilename",
"tkinter.Scale",
"numpy.array",
"clustering.clustering.longest",
"... | [((9495, 9502), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (9500, 9502), True, 'import tkinter as tk\n'), ((9768, 9794), 'tkinter.Label', 'tk.Label', ([], {'text': '"""1. ใใกใคใซ้ธๆ"""'}), "(text='1. ใใกใคใซ้ธๆ')\n", (9776, 9794), True, 'import tkinter as tk\n'), ((9962, 9980), 'tkinter.Entry', 'tk.Entry', ([], {'width': '(30)'}... |
from urlparse import urlparse, urlunparse
import re
from bs4 import BeautifulSoup
import requests
from .base import BaseCrawler
from ...models import Entity, Author, AuthorType
class StandardMediaCrawler(BaseCrawler):
SM_RE = re.compile('(www\.)?standardmedia.co.ke')
def offer(self, url):
""" Can th... | [
"bs4.BeautifulSoup",
"urlparse.urlparse",
"re.compile"
] | [((233, 275), 're.compile', 're.compile', (['"""(www\\\\.)?standardmedia.co.ke"""'], {}), "('(www\\\\.)?standardmedia.co.ke')\n", (243, 275), False, 'import re\n'), ((369, 382), 'urlparse.urlparse', 'urlparse', (['url'], {}), '(url)\n', (377, 382), False, 'from urlparse import urlparse, urlunparse\n'), ((638, 661), 'bs... |
import torch
import argparse
from os import path
from sys import version_info
from collections import OrderedDict
from torch.utils.model_zoo import load_url
if version_info[0] < 3:
import urllib
else:
import urllib.request
options_list = ['all', 'caffe-vgg16', 'caffe-vgg19', 'caffe-nin', 'caffe-googlenet-pla... | [
"urllib.URLopener",
"os.path.join",
"argparse.ArgumentParser",
"torch.utils.model_zoo.load_url"
] | [((6906, 6931), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (6929, 6931), False, 'import argparse\n'), ((1254, 1328), 'torch.utils.model_zoo.load_url', 'load_url', (['"""https://web.eecs.umich.edu/~justincj/models/vgg19-d01eb7cb.pth"""'], {}), "('https://web.eecs.umich.edu/~justincj/models/v... |
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.test.client import Client
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse
class AdminTestCase(TestCase):
@classmethod
def setUpTestData(cls):
super... | [
"django.contrib.auth.get_user_model"
] | [((396, 412), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (410, 412), False, 'from django.contrib.auth import get_user_model\n')] |
import pytest
from tests.functional.services.utils.http_utils import http_get, APIResponse, http_put, http_del, \
RequestFailedError
def ensure_second_feed_enabled(api_conf: callable):
feed_list_resp = http_get(['system', 'feeds'], config=api_conf)
if feed_list_resp.code != 200:
raise RequestFail... | [
"tests.functional.services.utils.http_utils.APIResponse",
"tests.functional.services.utils.http_utils.http_get",
"tests.functional.services.utils.http_utils.http_put",
"tests.functional.services.utils.http_utils.http_del",
"pytest.mark.skip",
"tests.functional.services.utils.http_utils.RequestFailedError"... | [((213, 259), 'tests.functional.services.utils.http_utils.http_get', 'http_get', (["['system', 'feeds']"], {'config': 'api_conf'}), "(['system', 'feeds'], config=api_conf)\n", (221, 259), False, 'from tests.functional.services.utils.http_utils import http_get, APIResponse, http_put, http_del, RequestFailedError\n'), ((... |
import re
from typing import Any, Iterable, List, Mapping, Optional, cast
from ..language import (
BooleanValueNode, EnumValueNode, FloatValueNode, IntValueNode,
ListValueNode, NameNode, NullValueNode, ObjectFieldNode,
ObjectValueNode, StringValueNode, ValueNode)
from ..pyutils import is_nullish, is_invali... | [
"typing.cast",
"re.compile"
] | [((577, 610), 're.compile', 're.compile', (['"""^-?(0|[1-9][0-9]*)$"""'], {}), "('^-?(0|[1-9][0-9]*)$')\n", (587, 610), False, 'import re\n'), ((1312, 1339), 'typing.cast', 'cast', (['GraphQLNonNull', 'type_'], {}), '(GraphQLNonNull, type_)\n', (1316, 1339), False, 'from typing import Any, Iterable, List, Mapping, Opti... |
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='presets'),
path('search', views.search, name='search'),
path('preset/<slug:slug>', views.preset, name='viewpreset')
] | [
"django.urls.path"
] | [((71, 108), 'django.urls.path', 'path', (['""""""', 'views.index'], {'name': '"""presets"""'}), "('', views.index, name='presets')\n", (75, 108), False, 'from django.urls import path\n'), ((114, 157), 'django.urls.path', 'path', (['"""search"""', 'views.search'], {'name': '"""search"""'}), "('search', views.search, na... |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 <NAME>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License... | [
"brick.openstack.common.importutils.import_class",
"brick.wsgi.Loader",
"brick.wsgi.Server",
"brick.openstack.common.service.launch",
"brick.openstack.common.processutils.get_worker_count",
"brick.openstack.common.service.ProcessLauncher",
"oslo.config.cfg.IntOpt",
"brick.i18n._",
"oslo.config.cfg.S... | [((1107, 1134), 'brick.openstack.common.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1124, 1134), True, 'from brick.openstack.common import log as logging\n'), ((1157, 1276), 'oslo.config.cfg.IntOpt', 'cfg.IntOpt', (['"""report_interval"""'], {'default': '(10)', 'help': '"""Interval, in sec... |
import torch
import tensorflow as tf
from setuptools import setup
from torch.utils.cpp_extension import CppExtension, CUDA_HOME, CUDAExtension, BuildExtension
sources = ['csrc/hough_voting_binds.cpp']
source_cuda = ['csrc/hough_voting_cuda.cu']
include_dirs = ['csrc', tf.sysconfig.get_include()] # custom include dir ... | [
"tensorflow.sysconfig.get_include",
"torch.cuda.is_available",
"setuptools.setup"
] | [((998, 1090), 'setuptools.setup', 'setup', ([], {'name': '"""hough_voting"""', 'ext_modules': '[module]', 'cmdclass': "{'build_ext': BuildExtension}"}), "(name='hough_voting', ext_modules=[module], cmdclass={'build_ext':\n BuildExtension})\n", (1003, 1090), False, 'from setuptools import setup\n'), ((270, 296), 'te... |
import logging
from init import config
logger = logging.getLogger(__name__)
handler = logging.FileHandler(config['DEFAULT']['log_file'])
formatter = logging.Formatter('%(asctime)s %(name)s %(levelname)s %(message)')
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)
class Order... | [
"logging.Formatter",
"logging.FileHandler",
"logging.getLogger"
] | [((50, 77), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (67, 77), False, 'import logging\n'), ((88, 138), 'logging.FileHandler', 'logging.FileHandler', (["config['DEFAULT']['log_file']"], {}), "(config['DEFAULT']['log_file'])\n", (107, 138), False, 'import logging\n'), ((151, 217), 'lo... |
# ===============================================================================
# Copyright 2015 <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/LI... | [
"pyface.qt.QtGui.QColor",
"pychron.envisage.resources.icon"
] | [((1881, 1897), 'pyface.qt.QtGui.QColor', 'QColor', (['Qt.white'], {}), '(Qt.white)\n', (1887, 1897), False, 'from pyface.qt.QtGui import QColor\n'), ((1338, 1354), 'pyface.qt.QtGui.QColor', 'QColor', (['Qt.white'], {}), '(Qt.white)\n', (1344, 1354), False, 'from pyface.qt.QtGui import QColor\n'), ((1956, 1976), 'pyfac... |
"""
.. module:: foreground
:platform: Unix
:synopsis: functions describing behaviour of foreground spectra.
.. moduleauthor: <NAME> <<EMAIL>>
"""
import numpy as np
def BB_scaling(nu, nu_0, T):
"""Blackbody scaling factor from frequency nu, to frequency nu_0.
Parameters
----------
nu : `float`... | [
"numpy.exp"
] | [((626, 668), 'numpy.exp', 'np.exp', (['(h * nu_0 * 1000000000.0 / (kb * T))'], {}), '(h * nu_0 * 1000000000.0 / (kb * T))\n', (632, 668), True, 'import numpy as np\n'), ((674, 714), 'numpy.exp', 'np.exp', (['(h * nu * 1000000000.0 / (kb * T))'], {}), '(h * nu * 1000000000.0 / (kb * T))\n', (680, 714), True, 'import nu... |
from datetime import datetime
from typing import Dict
from sqlalchemy import Column
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import String
from sqlalchemy import Boolean
from sqlalchemy import DateTime
from sqlalchemy import ARRAY
from sqlalchemy import Enum
from sqlalchemy.orm... | [
"sqlalchemy.Enum",
"sqlalchemy.ForeignKey",
"sqlalchemy.orm.relationship",
"sqlalchemy.Column",
"sqlalchemy.String"
] | [((528, 581), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)', 'autoincrement': '(True)'}), '(Integer, primary_key=True, autoincrement=True)\n', (534, 581), False, 'from sqlalchemy import Column\n'), ((631, 674), 'sqlalchemy.Column', 'Column', (['String'], {'unique': '(True)', 'nullable': '(False)... |
"""
Copyright (c) 2022 ZOOMi Technologies Inc.
all rights reserved.
This source code is licensed under the license found in the
LICENSE file in the root directory of this source tree.
maintainers : <EMAIL>
auto annotation process for AI tool.
"""
import cv2
import colorsys
import numpy as np
import time
import os
... | [
"cv2.dnn_DetectionModel",
"random.shuffle",
"cv2.rectangle",
"cv2.cuda.getCudaEnabledDeviceCount",
"cv2.cuda.setDevice",
"cv2.cvtColor",
"random.seed",
"configparser.ConfigParser",
"cv2.resize",
"tensorflow.config.experimental.set_memory_growth",
"tensorflow.constant",
"tensorflow.compat.v1.Co... | [((492, 529), 'configparser.ConfigParser', 'configparser.ConfigParser', (['os.environ'], {}), '(os.environ)\n', (517, 529), False, 'import configparser\n'), ((1286, 1337), 'tensorflow.config.experimental.list_physical_devices', 'tf.config.experimental.list_physical_devices', (['"""GPU"""'], {}), "('GPU')\n", (1330, 133... |
#################################################################
# Code written by <NAME> (<EMAIL>)
# For bug report, please contact author using the email address
#################################################################
import sys, random, time, argparse
from collections import OrderedDict
import pickle
imp... | [
"numpy.load",
"theano.tensor.tensor3",
"numpy.random.seed",
"argparse.ArgumentParser",
"theano.sandbox.rng_mrg.MRG_RandomStreams",
"numpy.mean",
"theano.tensor.sqrt",
"theano.tensor.log",
"theano.tensor.concatenate",
"theano.tensor.mean",
"theano.tensor.nnet.softmax",
"numpy.max",
"theano.sh... | [((554, 567), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (565, 567), False, 'from collections import OrderedDict\n'), ((708, 745), 'numpy.asarray', 'np.asarray', (['data'], {'dtype': 'config.floatX'}), '(data, dtype=config.floatX)\n', (718, 745), True, 'import numpy as np\n'), ((920, 947), 'numpy.load'... |
# Wrapper class around hnswlib
import hnswlib
import numpy as np
import threading
import pickle
from .typings import VectorList
class Hnswlib():
def __init__(self, space, dim):
self.index = hnswlib.Index(space, dim)
self.lock = threading.Lock()
self.dict_labels = {}
self.cur_ind = 0... | [
"pickle.dump",
"numpy.asarray",
"threading.Lock",
"pickle.load",
"hnswlib.Index"
] | [((203, 228), 'hnswlib.Index', 'hnswlib.Index', (['space', 'dim'], {}), '(space, dim)\n', (216, 228), False, 'import hnswlib\n'), ((249, 265), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (263, 265), False, 'import threading\n'), ((1604, 1618), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (1615, 1618), ... |
from __future__ import annotations
import typing
import robopom.component_loader as pom_loader
import os
import pathlib
import robopom.RobopomPage as robopom_page
import robopom.constants as constants
import robot.parsing.model as robot_model
import robot.parsing.settings as robot_settings
class ComponentVariables:
... | [
"os.path.abspath",
"os.path.isabs",
"robopom.component_loader.ComponentLoader.load_component_from_file",
"os.path.dirname",
"robopom.RobopomPage.RobopomPage.get_yaml_file",
"os.path.isfile",
"pathlib.Path",
"os.path.splitext",
"robot.parsing.model.ResourceFile",
"os.path.join"
] | [((798, 818), 'os.path.abspath', 'os.path.abspath', (['"""."""'], {}), "('.')\n", (813, 818), False, 'import os\n'), ((897, 922), 'os.path.isabs', 'os.path.isabs', (['pages_file'], {}), '(pages_file)\n', (910, 922), False, 'import os\n'), ((1171, 1197), 'os.path.isfile', 'os.path.isfile', (['pages_file'], {}), '(pages_... |
import argparse
import os
import yaml
import sys
import numpy as np
import time
import json
from .eval_np import PanopticEval
from .config import global_cfg
need_nuscenes_remap = False
if global_cfg.DATA_CONFIG.DATASET_NAME == 'SemanticKitti':
DATA = yaml.safe_load(open('semantic-kitti.yaml', 'r'))
# get numbe... | [
"numpy.zeros"
] | [((729, 767), 'numpy.zeros', 'np.zeros', (['(maxkey + 100)'], {'dtype': 'np.int32'}), '(maxkey + 100, dtype=np.int32)\n', (737, 767), True, 'import numpy as np\n'), ((935, 963), 'numpy.zeros', 'np.zeros', (['(20)'], {'dtype': 'np.int32'}), '(20, dtype=np.int32)\n', (943, 963), True, 'import numpy as np\n')] |
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
"""Base configuration."""
SECRET_KEY = os.environ.get("SECRET_KEY") or "secret_key"
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_DATABASE_URI = None # added to supress warning during testing.
SQLAFIXTURES_... | [
"os.environ.get",
"os.path.dirname",
"os.path.join"
] | [((37, 62), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (52, 62), False, 'import os\n'), ((332, 369), 'os.path.join', 'os.path.join', (['basedir', '"""sqlafixtures"""'], {}), "(basedir, 'sqlafixtures')\n", (344, 369), False, 'import os\n'), ((136, 164), 'os.environ.get', 'os.environ.get', ... |
# ---------------------------------------------------------------------
# fm.totaloutage
# ---------------------------------------------------------------------
# Copyright (C) 2007-2016 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# NOC modules
from... | [
"noc.core.translation.ugettext"
] | [((507, 525), 'noc.core.translation.ugettext', '_', (['"""Total Outages"""'], {}), "('Total Outages')\n", (508, 525), True, 'from noc.core.translation import ugettext as _\n'), ((537, 555), 'noc.core.translation.ugettext', '_', (['"""Total Outages"""'], {}), "('Total Outages')\n", (538, 555), True, 'from noc.core.trans... |
import logging
import os
import sys
from pathlib import Path
from typing import Union, Optional, Any, Dict
from pydantic import BaseSettings
from sqlalchemy.engine import Engine
from sqlalchemy.ext.asyncio import AsyncEngine
from sqlalchemy.orm import sessionmaker
_log = logging.getLogger(__name__)
env_file_sentinel... | [
"os.environ.get",
"sys.exit",
"pathlib.Path",
"logging.getLogger"
] | [((274, 301), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (291, 301), False, 'import logging\n'), ((348, 379), 'os.environ.get', 'os.environ.get', (['"""RUN_ENV"""', 'None'], {}), "('RUN_ENV', None)\n", (362, 379), False, 'import os\n'), ((444, 454), 'sys.exit', 'sys.exit', ([], {}), '... |