code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import sqlite3
X = sqlite3.connect('NeDB.db')
Y = X.cursor()
Y.execute('''CREATE TABLE IF NOT EXISTS EMPLOYEE (
ID integer,
Name text NOT NULL,
Date_Join text,
Place text,
Age integer,
Salary real);''')
Y.execute('''INSERT INT... | [
"sqlite3.connect"
] | [((25, 51), 'sqlite3.connect', 'sqlite3.connect', (['"""NeDB.db"""'], {}), "('NeDB.db')\n", (40, 51), False, 'import sqlite3\n')] |
import os
import sys
from gensim.scripts.glove2word2vec import glove2word2vec
from kge.misc import kge_base_dir
def _convert_to_word2vec(
filename: str
):
"""
Convert file of pretrained embeddings in GloVe format to word2vec format.
"""
folder = os.path.join(kge_base_dir(), "pretrained")
... | [
"os.path.join",
"gensim.scripts.glove2word2vec.glove2word2vec",
"kge.misc.kge_base_dir"
] | [((334, 364), 'os.path.join', 'os.path.join', (['folder', 'filename'], {}), '(folder, filename)\n', (346, 364), False, 'import os\n'), ((498, 531), 'os.path.join', 'os.path.join', (['folder', 'output_file'], {}), '(folder, output_file)\n', (510, 531), False, 'import os\n'), ((536, 575), 'gensim.scripts.glove2word2vec.g... |
# Generated by Django 2.1.7 on 2019-02-14 13:07
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | [
"django.db.models.IntegerField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.migrations.swappable_dependency"
] | [((247, 304), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (278, 304), False, 'from django.db import migrations, models\n'), ((435, 528), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)... |
# -*- coding: utf-8 -*-
#
# Copyright © 2009-2010 <NAME>
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)
"""Debug utilities"""
import inspect
import traceback
import time
def log_time(fd):
timestr = "Logging time: %s" % time.ctime(time.time())
print >>f... | [
"inspect.getmodule",
"traceback.print_exc",
"time.time",
"inspect.stack"
] | [((837, 865), 'traceback.print_exc', 'traceback.print_exc', ([], {'file': 'fd'}), '(file=fd)\n', (856, 865), False, 'import traceback\n'), ((1459, 1474), 'inspect.stack', 'inspect.stack', ([], {}), '()\n', (1472, 1474), False, 'import inspect\n'), ((1620, 1650), 'inspect.getmodule', 'inspect.getmodule', (['parentframe'... |
import smtplib
import sys
import time
from datetime import datetime
# variable
trigger = 0
myName = "<NAME>"
myEmail = "<EMAIL>"
myPass = "<PASSWORD>"
myEmailSMTP = "smtp.yourEmailProvider.com" #for gmail: smtp.gmail.com for outlook: smtp.office365.com
mySMTPPort = 587
receivers = {"receiver name": "<EMAIL>"}
emailS... | [
"datetime.datetime.now",
"smtplib.SMTP",
"time.sleep",
"sys.exit"
] | [((855, 869), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (867, 869), False, 'from datetime import datetime\n'), ((552, 589), 'smtplib.SMTP', 'smtplib.SMTP', (['myEmailSMTP', 'mySMTPPort'], {}), '(myEmailSMTP, mySMTPPort)\n', (564, 589), False, 'import smtplib\n'), ((753, 768), 'time.sleep', 'time.sleep'... |
import Tkinter
parent_widget = Tkinter.Tk()
scale_widget = Tkinter.Scale(parent_widget, from_=0, to=100,
orient=Tkinter.HORIZONTAL)
scale_widget.set(25)
scale_widget.pack()
Tkinter.mainloop() | [
"Tkinter.Tk",
"Tkinter.mainloop",
"Tkinter.Scale"
] | [((31, 43), 'Tkinter.Tk', 'Tkinter.Tk', ([], {}), '()\n', (41, 43), False, 'import Tkinter\n'), ((59, 131), 'Tkinter.Scale', 'Tkinter.Scale', (['parent_widget'], {'from_': '(0)', 'to': '(100)', 'orient': 'Tkinter.HORIZONTAL'}), '(parent_widget, from_=0, to=100, orient=Tkinter.HORIZONTAL)\n', (72, 131), False, 'import T... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 24 14:12:38 2022
@author: j64280
"""
import alluvial
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.cm
list_2017 = pd.read_csv('parrainagestotal_2017.csv',sep=';')
list_2022 = pd.read_csv('parrainagestot... | [
"matplotlib.pyplot.text",
"matplotlib.pyplot.savefig",
"pandas.read_csv"
] | [((232, 281), 'pandas.read_csv', 'pd.read_csv', (['"""parrainagestotal_2017.csv"""'], {'sep': '""";"""'}), "('parrainagestotal_2017.csv', sep=';')\n", (243, 281), True, 'import pandas as pd\n'), ((293, 342), 'pandas.read_csv', 'pd.read_csv', (['"""parrainagestotal_2022.csv"""'], {'sep': '""";"""'}), "('parrainagestotal... |
"""
Icegrams: A trigrams library for Icelandic
CFFI builder for _trie module
Copyright (C) 2020 <NAME>.
Original author: <NAME>
This software is licensed under the MIT License:
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and asso... | [
"os.path.dirname",
"platform.system",
"cffi.FFI"
] | [((1749, 1759), 'cffi.FFI', 'cffi.FFI', ([], {}), '()\n', (1757, 1759), False, 'import cffi\n'), ((1769, 1794), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1784, 1794), False, 'import os\n'), ((1812, 1829), 'platform.system', 'platform.system', ([], {}), '()\n', (1827, 1829), False, 'impo... |
import json
import platform
import gym
import six.moves.urllib as urlparse
from six import iteritems
from environments.mujoco.rand_param_envs.gym import error, version
from environments.mujoco.rand_param_envs.gym.scoreboard.client import http_client
verify_ssl_certs = True # [SECURITY CRITICAL] only turn this off w... | [
"json.loads",
"six.moves.urllib.urlsplit",
"environments.mujoco.rand_param_envs.gym.scoreboard.client.http_client.RequestsClient",
"json.dumps",
"environments.mujoco.rand_param_envs.gym.error.APIConnectionError",
"environments.mujoco.rand_param_envs.gym.error.APIError",
"environments.mujoco.rand_param_e... | [((349, 410), 'environments.mujoco.rand_param_envs.gym.scoreboard.client.http_client.RequestsClient', 'http_client.RequestsClient', ([], {'verify_ssl_certs': 'verify_ssl_certs'}), '(verify_ssl_certs=verify_ssl_certs)\n', (375, 410), False, 'from environments.mujoco.rand_param_envs.gym.scoreboard.client import http_clie... |
# -*- coding: UTF-8 -*-
from pyhanlp import *
from DataBaseOperator import DBConnector
class DicBuilder:
def __init__(self, id=-1):
"""
构建金融行业字典
:param id: 从数据库中通过index选择文本,默认-1即全选
"""
self.id = id
self.stopWords_path = r'EmotionBasedDic/stopwords.txt'
self... | [
"DataBaseOperator.DBConnector.DBConnector"
] | [((670, 695), 'DataBaseOperator.DBConnector.DBConnector', 'DBConnector.DBConnector', ([], {}), '()\n', (693, 695), False, 'from DataBaseOperator import DBConnector\n')] |
from .utils import draw_first_k_couples, batch_2x2_inv, batch_2x2_ellipse, arange_sequence, piecewise_arange
import torch
def stable_sort_residuals(residuals, ransidx):
logres = torch.log(residuals + 1e-10)
minlogres = torch.min(logres)
maxlogres = torch.max(logres)
sorting_score = ransidx.unsqueeze(... | [
"torch.log",
"torch.eye",
"torch.max",
"torch.min",
"torch.transpose",
"torch.tensor",
"torch.argsort",
"torch.norm",
"torch.zeros",
"torch.cumsum",
"torch.arange"
] | [((184, 212), 'torch.log', 'torch.log', (['(residuals + 1e-10)'], {}), '(residuals + 1e-10)\n', (193, 212), False, 'import torch\n'), ((229, 246), 'torch.min', 'torch.min', (['logres'], {}), '(logres)\n', (238, 246), False, 'import torch\n'), ((263, 280), 'torch.max', 'torch.max', (['logres'], {}), '(logres)\n', (272, ... |
import os
import datetime
import h5py
import numpy as np
DEFAULT_DTYPE = np.dtype([
('datetime', np.int64),
('open', np.float),
('close', np.float),
('high', np.float),
('low', np.float),
('limit_up', np.float),
('limit_down', np.float),
('volume', np.float),
('total_turnover', np.f... | [
"numpy.dtype",
"numpy.asarray",
"os.path.basename",
"h5py.File"
] | [((74, 361), 'numpy.dtype', 'np.dtype', (["[('datetime', np.int64), ('open', np.float), ('close', np.float), ('high',\n np.float), ('low', np.float), ('limit_up', np.float), ('limit_down', np\n .float), ('volume', np.float), ('total_turnover', np.float), (\n 'settlement', np.float), ('prev_settlement', np.floa... |
""" StackedMail management command tests """
from django.test import TestCase
from django.test import Client
from django.conf import settings
from django.core import mail
from django.core.management import call_command
from django.utils.six import StringIO
from app.logic.mailing.models.StackedMailModel import StackedM... | [
"os.path.exists",
"os.makedirs",
"django.core.management.call_command",
"app.logic.mailing.models.StackedMailModel.StackedMailEntry.objects.create",
"os.path.join",
"shutil.rmtree",
"django.core.mail.outbox.sort",
"django.utils.six.StringIO",
"app.logic.mailing.models.StackedMailModel.StackedMailEnt... | [((483, 491), 'django.test.Client', 'Client', ([], {}), '()\n', (489, 491), False, 'from django.test import Client\n'), ((518, 549), 'os.path.join', 'os.path.join', (['settings.TMP_ROOT'], {}), '(settings.TMP_ROOT)\n', (530, 549), False, 'import os\n'), ((676, 707), 'os.path.exists', 'os.path.exists', (['self.tmp_folde... |
# coding: utf-8
"""
Trend Micro Deep Security API
Copyright 2018 - 2020 Trend Micro Incorporated.<br/>Get protected, stay secured, and keep informed with Trend Micro Deep Security's new RESTful API. Access system data and manage security configurations to automate your security workflows and integrate De... | [
"six.iteritems",
"deepsecurity.api_client.ApiClient"
] | [((3929, 3960), 'six.iteritems', 'six.iteritems', (["params['kwargs']"], {}), "(params['kwargs'])\n", (3942, 3960), False, 'import six\n'), ((10063, 10094), 'six.iteritems', 'six.iteritems', (["params['kwargs']"], {}), "(params['kwargs'])\n", (10076, 10094), False, 'import six\n'), ((16156, 16187), 'six.iteritems', 'si... |
"""
Log requests middleware
"""
import time
from fastapi import Request
import geoip2.database
from geoip2.errors import AddressNotFoundError
from starlette.middleware.base import BaseHTTPMiddleware, RequestResponseEndpoint
from server.config import app_logger
from server.config import CITY_DB
logger = app_logger(__n... | [
"server.config.app_logger",
"time.time"
] | [((306, 342), 'server.config.app_logger', 'app_logger', (['__name__', '"""requests.log"""'], {}), "(__name__, 'requests.log')\n", (316, 342), False, 'from server.config import app_logger\n'), ((607, 618), 'time.time', 'time.time', ([], {}), '()\n', (616, 618), False, 'import time\n'), ((688, 699), 'time.time', 'time.ti... |
import argparse
def parse_args():
parser = argparse.ArgumentParser(description="Search Products on Supported Platforms")
parser.add_argument(
"--platform", "-p", required=True, help="Online Retail Platform", type=str
)
parser.add_argument(
"--keyword", "-k", required=True, help="Produc... | [
"product_scrapper.amazon.amazon_search.AmazonSearch",
"argparse.ArgumentParser"
] | [((49, 126), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Search Products on Supported Platforms"""'}), "(description='Search Products on Supported Platforms')\n", (72, 126), False, 'import argparse\n'), ((629, 657), 'product_scrapper.amazon.amazon_search.AmazonSearch', 'Search', ([], ... |
import sys, os
import time
import getopt
import pprint
try:
# doesn't exist on macos
from shmem import PyShmemClient
except:
pass
from psana import dgram
from psana.event import Event
from psana.detector import detectors
from psana.psexp.event_manager import TransitionId
import numpy as np
def dumpDict(di... | [
"getopt.getopt",
"shmem.PyShmemClient",
"psana.dgram.Dgram",
"os.close",
"os.open",
"numpy.asarray",
"os.getppid",
"numpy.array",
"os.popen",
"os.path.basename",
"os.getpid",
"sys.exit",
"psana.event.Event",
"sys.stdout.write"
] | [((9560, 9597), 'getopt.getopt', 'getopt.getopt', (['sys.argv[1:]', '"""hvd:f:"""'], {}), "(sys.argv[1:], 'hvd:f:')\n", (9573, 9597), False, 'import getopt\n'), ((9898, 9909), 'os.getpid', 'os.getpid', ([], {}), '()\n', (9907, 9909), False, 'import sys, os\n'), ((9919, 9931), 'os.getppid', 'os.getppid', ([], {}), '()\n... |
from flair.models import TARSTagger
from flair.data import Sentence
# 1. Load zero-shot NER tagger
tars = TARSTagger.load('tars-ner')
# 2. Prepare some test sentences
sentences = [
Sentence("kill la kill is an anime"),
Sentence("The Humboldt University of Berlin is situated near the Spree in Berlin, Germany")... | [
"flair.models.TARSTagger.load",
"flair.data.Sentence"
] | [((107, 134), 'flair.models.TARSTagger.load', 'TARSTagger.load', (['"""tars-ner"""'], {}), "('tars-ner')\n", (122, 134), False, 'from flair.models import TARSTagger\n'), ((187, 223), 'flair.data.Sentence', 'Sentence', (['"""kill la kill is an anime"""'], {}), "('kill la kill is an anime')\n", (195, 223), False, 'from f... |
def _init():
from som.vm.universe import create_universe
return create_universe()
current_universe = _init()
| [
"som.vm.universe.create_universe"
] | [((73, 90), 'som.vm.universe.create_universe', 'create_universe', ([], {}), '()\n', (88, 90), False, 'from som.vm.universe import create_universe\n')] |
# author: <<NAME>>
# Client side CLI
# Necessary imports.
import os
import json
from pathlib import Path
import requests
import click
from server import run
# Click package is used to turn the python script into CLI.
@click.command()
@click.option('--path',prompt="Enter the path", help='Specify the path, that you wan... | [
"os.path.exists",
"requests.post",
"pathlib.Path",
"click.option",
"json.dumps",
"os.path.join",
"os.path.basename",
"os.stat",
"click.command",
"os.walk"
] | [((220, 235), 'click.command', 'click.command', ([], {}), '()\n', (233, 235), False, 'import click\n'), ((237, 355), 'click.option', 'click.option', (['"""--path"""'], {'prompt': '"""Enter the path"""', 'help': '"""Specify the path, that you want to display"""', 'required': '(True)'}), "('--path', prompt='Enter the pat... |
import numpy as np
from scipy.integrate.odepack import odeint
import matplotlib.pyplot as plt
import functions
from chondrocyte import Voltage_clamp
from params import params_dict
import matplotlib as mpl
"""
The code is used to create Figure 4B for submitted paper
"Probing the putative role of KATP channels and biol... | [
"scipy.integrate.odepack.odeint",
"params.params_dict.update",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((529, 560), 'params.params_dict.update', 'params_dict.update', ([], {'t_final': '(180)'}), '(t_final=180)\n', (547, 560), False, 'from params import params_dict\n'), ((663, 689), 'params.params_dict.update', 'params_dict.update', ([], {'Mg_i': '(1)'}), '(Mg_i=1)\n', (681, 689), False, 'from params import params_dict\... |
import enum
import pdb
import functools
import pathlib
from typing import Any, Dict, List, Optional, Tuple, BinaryIO, cast, Union
from xml.etree import ElementTree
from torchdata.datapipes.iter import (
IterDataPipe,
Mapper,
Filter,
Demultiplexer,
IterKeyZipper,
LineReader,
)
from torchvision.d... | [
"torchdata.datapipes.iter.Mapper",
"Dataset4EO.datasets.utils._internal.getitem",
"xml.etree.ElementTree.parse",
"pathlib.Path",
"pathlib.PosixPath",
"Dataset4EO.datasets.utils._internal.read_categories_file",
"torchdata.datapipes.iter.LineReader",
"Dataset4EO.datasets.utils._internal.path_comparator"... | [((3711, 3818), 'Dataset4EO.datasets.utils.HttpResource', 'HttpResource', (['f"""http://host.robots.ox.ac.uk/pascal/VOC/voc{self._year}/{file_name}"""'], {'sha256': 'sha256'}), "(\n f'http://host.robots.ox.ac.uk/pascal/VOC/voc{self._year}/{file_name}',\n sha256=sha256)\n", (3723, 3818), False, 'from Dataset4EO.da... |
# Generated by Django 2.2.9 on 2020-01-29 16:31
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('cart', '0008_cartitem_user'),
]
operations = [
migrations.RemoveField(
model_name='cartitem',
name='user',
),
]
| [
"django.db.migrations.RemoveField"
] | [((219, 277), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""cartitem"""', 'name': '"""user"""'}), "(model_name='cartitem', name='user')\n", (241, 277), False, 'from django.db import migrations\n')] |
from django.db import models
class Health(models.Model):
MALE = 'M'
FEMALE = 'F'
ALL = 'A'
GENDER_CHOICES = (
(MALE, 'Male'),
(FEMALE, 'Female'),
(ALL, 'All')
)
class Meta:
abstract = True
class HealthActivity(models.Model):
MALE = 'M'
FEMALE = 'F'
... | [
"django.db.models.FloatField",
"django.db.models.CharField",
"django.db.models.IntegerField"
] | [((1245, 1266), 'django.db.models.IntegerField', 'models.IntegerField', ([], {}), '()\n', (1264, 1266), False, 'from django.db import models\n'), ((1280, 1348), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(1)', 'choices': 'GENDER_CHOICES', 'default': 'MALE'}), '(max_length=1, choices=GENDER_C... |
# Copyright (c) 2020, <NAME>, University of Washington
# This file is part of rcwa_tf
# Written by <NAME> (Email: <EMAIL>)
import tensorflow as tf
import numpy as np
def convmat(A, P, Q):
'''
This function computes a convolution matrix for a real space matrix `A` that
represents either a relative per... | [
"tensorflow.eye",
"tensorflow.tile",
"numpy.floor",
"tensorflow.concat",
"numpy.linspace",
"tensorflow.reshape",
"tensorflow.linalg.matmul",
"tensorflow.signal.fft2d"
] | [((1189, 1206), 'numpy.floor', 'np.floor', (['(P / 2.0)'], {}), '(P / 2.0)\n', (1197, 1206), True, 'import numpy as np\n'), ((1219, 1236), 'numpy.floor', 'np.floor', (['(P / 2.0)'], {}), '(P / 2.0)\n', (1227, 1236), True, 'import numpy as np\n'), ((1277, 1306), 'numpy.linspace', 'np.linspace', (['(-p_max)', 'p_max', 'P... |
__author__ = "<NAME>"
__status__ = "prototype"
import tarfile
import json
import re
import subprocess
import os
import nltk
import time
year = 2019
month = 9
day = 16
keyword_list = ["netflix", "amazon", "apple", "microsoft", "google", "tesla", "facebook"]
date = "{0}-{1}-{2}".format(year, str(month).zfill(2), str(da... | [
"subprocess.run",
"time.time"
] | [((333, 391), 'subprocess.run', 'subprocess.run', (['"""rm ./keyword_search_time.log"""'], {'shell': '(True)'}), "('rm ./keyword_search_time.log', shell=True)\n", (347, 391), False, 'import subprocess\n'), ((557, 568), 'time.time', 'time.time', ([], {}), '()\n', (566, 568), False, 'import time\n'), ((1432, 1443), 'time... |
#!/usr/bin/env python
# Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice... | [
"os.listdir",
"argparse.ArgumentParser",
"os.path.join",
"builtins.range",
"os.path.isdir"
] | [((3426, 3451), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (3449, 3451), False, 'import argparse\n'), ((4664, 4699), 'os.path.isdir', 'os.path.isdir', (['FLAGS.image_filename'], {}), '(FLAGS.image_filename)\n', (4677, 4699), False, 'import os\n'), ((5456, 5473), 'builtins.range', 'range', (... |
# Copyright (c) 2021 <NAME>. All Rights Reserved.
import pymel.core as pm
import piper_config as pcfg
import piper.mayapy.util as myu
import piper.mayapy.convert as convert
import piper.mayapy.attribute as attribute
from .rig import curve # must do relative import in python 2
def get(node_type, ignore=None, search... | [
"piper.mayapy.convert.toBind",
"pymel.core.ls",
"piper.mayapy.attribute.lockAndHideCompound",
"piper.mayapy.util.getFirstTypeParent",
"piper.mayapy.attribute.getSourcePlug",
"piper.mayapy.attribute.nonKeyable",
"pymel.core.selected",
"pymel.core.listConnections",
"piper.mayapy.util.getSkinnedMeshes"... | [((834, 847), 'pymel.core.selected', 'pm.selected', ([], {}), '()\n', (845, 847), True, 'import pymel.core as pm\n'), ((3144, 3176), 'pymel.core.createNode', 'pm.createNode', (['"""piperSafeDivide"""'], {}), "('piperSafeDivide')\n", (3157, 3176), True, 'import pymel.core as pm\n'), ((4393, 4437), 'pymel.core.createNode... |
import pandas as pd
import json
import os
import os.path as osp
import numpy as np
"""
python -m spinup.run hyper_search <files> -ae <start from which epoch>
make a file that can order the experiments in terms of their performance
use this to easily find good hyperparameters when doing hyperparameter search
upload thi... | [
"os.listdir",
"numpy.convolve",
"numpy.ones",
"argparse.ArgumentParser",
"numpy.asarray",
"os.path.join",
"numpy.argsort",
"os.path.dirname",
"numpy.zeros",
"os.path.isdir",
"numpy.isnan",
"json.load",
"pandas.concat",
"os.walk"
] | [((1541, 1561), 'numpy.zeros', 'np.zeros', (['n_settings'], {}), '(n_settings)\n', (1549, 1561), True, 'import numpy as np\n'), ((1577, 1597), 'numpy.zeros', 'np.zeros', (['n_settings'], {}), '(n_settings)\n', (1585, 1597), True, 'import numpy as np\n'), ((3264, 3279), 'os.walk', 'os.walk', (['logdir'], {}), '(logdir)\... |
from piecrust.serving.server import WsgiServer
def get_app(root_dir, cache_key='prod', enable_debug_info=False):
app = WsgiServer(root_dir,
cache_key=cache_key,
enable_debug_info=enable_debug_info)
return app
| [
"piecrust.serving.server.WsgiServer"
] | [((125, 203), 'piecrust.serving.server.WsgiServer', 'WsgiServer', (['root_dir'], {'cache_key': 'cache_key', 'enable_debug_info': 'enable_debug_info'}), '(root_dir, cache_key=cache_key, enable_debug_info=enable_debug_info)\n', (135, 203), False, 'from piecrust.serving.server import WsgiServer\n')] |
from Interfaces.CommandLineInterface import CLI
if __name__ == '__main__':
CLI().initiate()
| [
"Interfaces.CommandLineInterface.CLI"
] | [((81, 86), 'Interfaces.CommandLineInterface.CLI', 'CLI', ([], {}), '()\n', (84, 86), False, 'from Interfaces.CommandLineInterface import CLI\n')] |
# -*- coding: utf-8 -*-
u"""Concurrency testing
This test does not always fail when there is a problem (false
positive), because it depends on a specific sequence of events
that can't be controlled by the test.
:copyright: Copyright (c) 2020 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/license... | [
"pykern.pkunit.pkeq",
"pykern.pkunit.pkok",
"pykern.pkunit.pkfail",
"time.sleep",
"pykern.pkdebug.pkdlog",
"threading.Thread"
] | [((1550, 1567), 'pykern.pkdebug.pkdlog', 'pkdlog', (['"""start 1"""'], {}), "('start 1')\n", (1556, 1567), False, 'from pykern.pkdebug import pkdlog\n'), ((2164, 2192), 'threading.Thread', 'threading.Thread', ([], {'target': '_t2'}), '(target=_t2)\n', (2180, 2192), False, 'import threading\n'), ((2212, 2227), 'time.sle... |
"""Subscription manager for Graph QL websocket."""
import asyncio
import json
import logging
import socket
import sys
from time import time
import pkg_resources
import websockets
_LOGGER = logging.getLogger(__name__)
STATE_STARTING = "starting"
STATE_RUNNING = "running"
STATE_STOPPED = "stopped"
try:
VERSION =... | [
"logging.getLogger",
"json.loads",
"pkg_resources.require",
"json.dumps",
"websockets.connect",
"asyncio.wait_for",
"asyncio.sleep",
"asyncio.get_event_loop",
"time.time",
"asyncio.get_running_loop"
] | [((192, 219), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (209, 219), False, 'import logging\n'), ((6228, 6234), 'time.time', 'time', ([], {}), '()\n', (6232, 6234), False, 'from time import time\n'), ((8065, 8089), 'json.dumps', 'json.dumps', (['subscription'], {}), '(subscription)\n'... |
import copy
import json
import numpy as np
import pandas as pd
import basicDeltaOperations as op
import calcIsotopologues as ci
import fragmentAndSimulate as fas
import solveSystem as ss
'''
This is a set of functions to quickly initalize methionine molecules based on input delta values and to simulate its fragmenta... | [
"numpy.array",
"fragmentAndSimulate.predictMNFragmentExpt",
"copy.deepcopy",
"solveSystem.processM1MCResults",
"calcIsotopologues.inputToAtomDict",
"solveSystem.OValueCorrectTheoretical",
"solveSystem.updateSiteSpecificDfM1MC",
"json.dumps",
"solveSystem.M1MonteCarlo",
"pandas.DataFrame",
"basic... | [((3681, 3712), 'pandas.DataFrame', 'pd.DataFrame', (['l'], {'columns': 'IDList'}), '(l, columns=IDList)\n', (3693, 3712), True, 'import pandas as pd\n'), ((8014, 8092), 'calcIsotopologues.inputToAtomDict', 'ci.inputToAtomDict', (['molecularDataFrame'], {'disable': 'disableProgress', 'M1Only': 'M1Only'}), '(molecularDa... |
import time
from typing import Any, List
import pytest
from yarl import URL
from neuro_sdk import Action, FileStatus, FileStatusType
from neuro_sdk.storage import DiskUsageInfo
from neuro_cli.formatters.storage import (
BaseFilesFormatter,
BSDAttributes,
BSDPainter,
DiskUsageFormatter,
FilesSorte... | [
"neuro_cli.formatters.storage.GnuPainter",
"neuro_sdk.storage.DiskUsageInfo",
"time.strptime",
"neuro_cli.formatters.storage.DiskUsageFormatter",
"neuro_cli.formatters.storage.VerticalColumnsFilesFormatter",
"pytest.mark.parametrize",
"neuro_cli.formatters.storage.LongFilesFormatter",
"pytest.raises",... | [((5151, 5281), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""ls_colors"""', "['di=32;41:fi=0;44:no=0;46', 'di=32;41:no=0;46', 'no=0;46', '*.text=0;46',\n '*.txt=0;46']"], {}), "('ls_colors', ['di=32;41:fi=0;44:no=0;46',\n 'di=32;41:no=0;46', 'no=0;46', '*.text=0;46', '*.txt=0;46'])\n", (5174, 5281)... |
"""
Demonstrate the type 1 NUFFT using cuFINUFFT
"""
import numpy as np
import pycuda.autoinit
from pycuda.gpuarray import GPUArray, to_gpu
from cufinufft import cufinufft
# Set up parameters for problem.
N1, N2 = 59, 61 # Size of uniform grid
M = 100 # Number of nonuniform p... | [
"numpy.random.standard_normal",
"numpy.abs",
"pycuda.gpuarray.GPUArray",
"numpy.exp",
"cufinufft.cufinufft",
"numpy.random.uniform",
"pycuda.gpuarray.to_gpu"
] | [((592, 632), 'numpy.random.uniform', 'np.random.uniform', (['(-np.pi)', 'np.pi'], {'size': 'M'}), '(-np.pi, np.pi, size=M)\n', (609, 632), True, 'import numpy as np\n'), ((638, 678), 'numpy.random.uniform', 'np.random.uniform', (['(-np.pi)', 'np.pi'], {'size': 'M'}), '(-np.pi, np.pi, size=M)\n', (655, 678), True, 'imp... |
#!/usr/bin/python3
import sys
import cut
from box import Box
from reactor import Reactor
from termcolor import colored
# -- assert helper
def check(what,output,f=None):
try:
assert(what)
except:
print("Assert failed, debug output: ",end="")
print(output)
if f is not None:
... | [
"box.Box",
"termcolor.colored",
"reactor.Reactor",
"sys.exit"
] | [((485, 494), 'reactor.Reactor', 'Reactor', ([], {}), '()\n', (492, 494), False, 'from reactor import Reactor\n'), ((500, 530), 'box.Box', 'Box', (['"""on x=1..3,y=1..3,z=1..3"""'], {}), "('on x=1..3,y=1..3,z=1..3')\n", (503, 530), False, 'from box import Box\n'), ((536, 566), 'box.Box', 'Box', (['"""on x=1..3,y=1..3,z... |
import os
import sys
import pytest
from prefect import Flow
from prefect.tasks.dbt import DbtShellTask
pytestmark = pytest.mark.skipif(
sys.platform == "win32", reason="DbtShellTask currently not supported on Windows"
)
def test_shell_result_from_stdout(tmpdir):
dbt_dir = tmpdir.mkdir("dbt")
task = D... | [
"os.path.exists",
"prefect.Flow",
"pytest.mark.skipif"
] | [((120, 226), 'pytest.mark.skipif', 'pytest.mark.skipif', (["(sys.platform == 'win32')"], {'reason': '"""DbtShellTask currently not supported on Windows"""'}), "(sys.platform == 'win32', reason=\n 'DbtShellTask currently not supported on Windows')\n", (138, 226), False, 'import pytest\n'), ((2874, 2903), 'os.path.ex... |
from django.conf.urls import url
from django.urls import path
from captcha import views
# urlpatterns = [
# url(r'image/(?P<key>\w+)/$', views.captcha_image, name='captcha-image', kwargs={'scale': 1}),
# url(r'image/(?P<key>\w+)@2/$', views.captcha_image, name='captcha-image-2x', kwargs={'scale': 2}),
# ur... | [
"django.urls.path"
] | [((490, 584), 'django.urls.path', 'path', (['"""image/<slug:key>/"""', 'views.captcha_image'], {'name': '"""captcha-image"""', 'kwargs': "{'scale': 1}"}), "('image/<slug:key>/', views.captcha_image, name='captcha-image', kwargs\n ={'scale': 1})\n", (494, 584), False, 'from django.urls import path\n'), ((585, 683), '... |
# Copyright (C) 2020 NTT DATA
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | [
"tacker.common.exceptions.ValidationError",
"tacker.api.common.attribute_filter.parse_filter_rule"
] | [((880, 954), 'tacker.api.common.attribute_filter.parse_filter_rule', 'attribute_filter.parse_filter_rule', (['filters'], {'target': 'cls.FLATTEN_ATTRIBUTES'}), '(filters, target=cls.FLATTEN_ATTRIBUTES)\n', (914, 954), False, 'from tacker.api.common import attribute_filter\n'), ((1392, 1422), 'tacker.common.exceptions.... |
# Generated by Django 2.2.1 on 2019-05-29 15:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='gender',
fi... | [
"django.db.models.CharField"
] | [((324, 413), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[('M', 'Male'), ('F', 'Female')]", 'default': '"""Ч"""', 'max_length': '(1)'}), "(choices=[('M', 'Male'), ('F', 'Female')], default='Ч',\n max_length=1)\n", (340, 413), False, 'from django.db import migrations, models\n')] |
""""
名称:064 童芯派 面向对象 体感小飞机
硬件: 童芯派
功能介绍:
使用童芯派的精灵功能在屏幕上编写了一个基于陀螺仪控制的体感小游戏,控制角色飞机躲避空中的子弹。
难度:⭐⭐⭐
支持的模式:上传模式
无
"""
# ---------程序分割线----------------程序分割线----------------程序分割线----------
import cyberpi
import random
import math
import time
class Enemy:
def __init__(self):
self.x = random.randint(0, 128)
... | [
"cyberpi.audio.play",
"cyberpi.console.println",
"cyberpi.led.on",
"cyberpi.get_pitch",
"math.floor",
"cyberpi.display.clear",
"time.sleep",
"cyberpi.sprite",
"cyberpi.controller.is_press",
"cyberpi.get_roll",
"cyberpi.display.label",
"cyberpi.screen.render",
"random.randint",
"cyberpi.led... | [((8419, 8467), 'cyberpi.console.println', 'cyberpi.console.println', (['"""体感小飞机 上键加速 下键减速 灯光为血条"""'], {}), "('体感小飞机 上键加速 下键减速 灯光为血条')\n", (8442, 8467), False, 'import cyberpi\n'), ((8468, 8501), 'cyberpi.console.println', 'cyberpi.console.println', (['"""A键重新开始"""'], {}), "('A键重新开始')\n", (8491, 8501), False, 'import ... |
import time
import asyncio
import random
import pyee
import logging
from plugins.input_fsx import fsx_pb2
from hexi.service import event
_logger = logging.getLogger(__name__)
class UDPServer(asyncio.DatagramProtocol):
def __init__(self, manager, token):
super().__init__()
self.manager = manager
self... | [
"logging.getLogger",
"pyee.EventEmitter",
"asyncio.sleep",
"plugins.input_fsx.fsx_pb2.TcpRequestMessage",
"plugins.input_fsx.fsx_pb2.TcpResponseMessage",
"asyncio.open_connection",
"asyncio.wait_for",
"plugins.input_fsx.fsx_pb2.UdpResponseMessage",
"asyncio.get_event_loop",
"time.time",
"random.... | [((150, 177), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (167, 177), False, 'import logging\n'), ((5506, 5530), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (5528, 5530), False, 'import asyncio\n'), ((6189, 6208), 'pyee.EventEmitter', 'pyee.EventEmitter', ([],... |
from openff.toolkit.typing.engines.smirnoff.forcefield import ForceField
from simtk import openmm, unit
from scipy.stats import distributions
import copy
import numpy as np
import os
from smt.sampling_methods import LHS
def vary_parameters_lhc(filename, num_samples, output_directory):
forcefield = ForceField(file... | [
"smt.sampling_methods.LHS",
"numpy.asarray",
"os.makedirs",
"openff.toolkit.typing.engines.smirnoff.forcefield.ForceField"
] | [((305, 357), 'openff.toolkit.typing.engines.smirnoff.forcefield.ForceField', 'ForceField', (['filename'], {'allow_cosmetic_attributes': '(True)'}), '(filename, allow_cosmetic_attributes=True)\n', (315, 357), False, 'from openff.toolkit.typing.engines.smirnoff.forcefield import ForceField\n'), ((556, 580), 'numpy.asarr... |
import argparse
from collections import defaultdict
import pickle
import re
import lightgbm as lgb
import pandas as pd
import numpy as np
import xgboost as xgb
from ..data_utils import SEG_FP, get_encoded_classes
from ..utils import print_metrics
from ..metric import get_metrics
from .blend import (
score_predict... | [
"numpy.mean",
"pickle.dump",
"argparse.ArgumentParser",
"re.compile",
"xgboost.train",
"pandas.read_csv",
"lightgbm.train",
"lightgbm.Booster",
"pickle.load",
"lightgbm.Dataset",
"collections.defaultdict",
"xgboost.DMatrix"
] | [((406, 431), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (429, 431), False, 'import argparse\n'), ((2124, 2151), 're.compile', 're.compile', (['"""^top_\\\\d+_cls"""'], {}), "('^top_\\\\d+_cls')\n", (2134, 2151), False, 'import re\n'), ((6836, 6872), 'lightgbm.Dataset', 'lgb.Dataset', (['tr... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-04-06 16:37
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migratio... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.migrations.swappable_dependency",
"django.db.models.CharField"
] | [((312, 369), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (343, 369), False, 'from django.db import migrations, models\n'), ((535, 628), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)... |
import requests
from bs4 import BeautifulSoup
# 聽說要空兩行,註解要空一格
# 搜尋
def search_title(html):
key = input("請輸入關鍵字:") # input key words
starttag = html.find(key) # the index of word user wants
# I got it!
if starttag != -1:
# 找到關鍵字之後把往後到下一個標籤之前的字抓起來
for j in range(starttag, len(html)):
... | [
"requests.get"
] | [((1055, 1098), 'requests.get', 'requests.get', (['"""https://www.pcstore.com.tw/"""'], {}), "('https://www.pcstore.com.tw/')\n", (1067, 1098), False, 'import requests\n')] |
# Generated by Django 3.0.8 on 2020-07-19 17:34
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import phone_field.models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_U... | [
"django.db.models.EmailField",
"django.db.models.OneToOneField",
"django.db.models.DateField",
"django.db.models.ForeignKey",
"django.db.models.DateTimeField",
"django.db.models.AutoField",
"django.db.models.PositiveIntegerField",
"django.db.models.ImageField",
"django.db.migrations.swappable_depend... | [((273, 330), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (304, 330), False, 'from django.db import migrations, models\n'), ((467, 560), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)... |
# -*- coding: utf-8 -*-
"""
pip_services3_container.build.DefaultContainerFactory
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Default container factory implementation
:copyright: Conceptual Vision Consulting LLC 2018-2019, see AUTHORS for more details.
:license: MIT, see LICENSE f... | [
"pip_services3_components.log.DefaultLoggerFactory",
"pip_services3_components.connect.DefaultDiscoveryFactory",
"pip_services3_components.count.DefaultCountersFactory",
"pip_services3_components.info._DefaultInfoFactory.DefaultInfoFactory",
"pip_services3_components.cache.DefaultCacheFactory",
"pip_servi... | [((1147, 1215), 'pip_services3_commons.refer.Descriptor', 'Descriptor', (['"""pip-services"""', '"""factory"""', '"""container"""', '"""default"""', '"""1.0"""'], {}), "('pip-services', 'factory', 'container', 'default', '1.0')\n", (1157, 1215), False, 'from pip_services3_commons.refer import Descriptor\n'), ((1499, 15... |
"""
Msg based protocol handler
"""
__author__ = 'VMware, Inc.'
__copyright__ = 'Copyright 2015, 2017 VMware, Inc. All rights reserved. -- VMware Confidential' # pylint: disable=line-too-long
from collections import deque
from vmware.vapi.lib.log import get_vapi_logger
from vmware.vapi.protocol.server.api_handler i... | [
"collections.deque",
"vmware.vapi.lib.log.get_vapi_logger",
"vmware.vapi.lib.workers_pool.get_workers_pool",
"vmware.vapi.protocol.server.async_api_handler_adapter.PooledAsyncApiHandlerAdapter",
"vmware.vapi.protocol.server.transport.async_protocol_handler.AsyncProtocolHandler.__init__",
"vmware.vapi.prot... | [((458, 483), 'vmware.vapi.lib.log.get_vapi_logger', 'get_vapi_logger', (['__name__'], {}), '(__name__)\n', (473, 483), False, 'from vmware.vapi.lib.log import get_vapi_logger\n'), ((1079, 1110), 'vmware.vapi.lib.workers_pool.get_workers_pool', 'get_workers_pool', (['"""api_handler"""'], {}), "('api_handler')\n", (1095... |
# Copyright 2018 Google Inc. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agre... | [
"openhtf.plugs.user_input.prompt_for_test_start",
"openhtf.util.console_output.cli_print",
"openhtf.Test",
"openhtf.plug"
] | [((1788, 1823), 'openhtf.plug', 'htf.plug', ([], {'user': 'user_input.UserInput'}), '(user=user_input.UserInput)\n', (1796, 1823), True, 'import openhtf as htf\n'), ((2017, 2042), 'openhtf.Test', 'htf.Test', (['HelloWorldPhase'], {}), '(HelloWorldPhase)\n', (2025, 2042), True, 'import openhtf as htf\n'), ((1558, 1647),... |
from rest_framework import viewsets, filters, mixins
from rest_framework.response import Response
from products import models
from products import serializers
class CategoryApiView(viewsets.ReadOnlyModelViewSet):
"""API View for Category"""
serializer_class = serializers.CategorySerializer
queryset... | [
"products.models.SubCategory.objects.filter",
"products.models.Product.objects.filter",
"products.models.Category.objects.all",
"rest_framework.response.Response",
"products.models.Category.objects.filter",
"products.models.SubCategory.objects.all",
"products.models.Product.objects.all"
] | [((323, 352), 'products.models.Category.objects.all', 'models.Category.objects.all', ([], {}), '()\n', (350, 352), False, 'from products import models\n'), ((1313, 1341), 'products.models.Product.objects.all', 'models.Product.objects.all', ([], {}), '()\n', (1339, 1341), False, 'from products import models\n'), ((1903,... |
"""Controller for the health endpoints."""
from fastapi import APIRouter
from pydantic import BaseModel
router = APIRouter()
class HealthCheckResponse(BaseModel):
"""Model for health check responses."""
online: bool
@router.get("", response_model=HealthCheckResponse, description="Health check endpoint")
d... | [
"fastapi.APIRouter"
] | [((114, 125), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (123, 125), False, 'from fastapi import APIRouter\n')] |
# Generated by Django 3.2.5 on 2021-07-14 15:07
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('account', '0007_alter_childlist_child'),
]
operations = [
migrations.Alter... | [
"django.db.models.OneToOneField"
] | [((409, 600), 'django.db.models.OneToOneField', 'models.OneToOneField', ([], {'on_delete': 'django.db.models.deletion.CASCADE', 'primary_key': '(True)', 'related_name': '"""user_child"""', 'serialize': '(False)', 'to': 'settings.AUTH_USER_MODEL', 'verbose_name': '"""Kullanıcı"""'}), "(on_delete=django.db.models.deletio... |
##
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions, and the following disclaimer.
# * Redistributions in binar... | [
"supybot.conf.supybot.networks.test.channels.setValue",
"supybot.conf.supybot.networks.test.channels.joins",
"supybot.conf.supybot.networks.test.channels",
"supybot.ircutils.IrcSet"
] | [((1738, 1775), 'supybot.conf.supybot.networks.test.channels', 'conf.supybot.networks.test.channels', ([], {}), '()\n', (1773, 1775), True, 'import supybot.conf as conf\n'), ((1795, 1812), 'supybot.ircutils.IrcSet', 'ircutils.IrcSet', ([], {}), '()\n', (1810, 1812), True, 'import supybot.ircutils as ircutils\n'), ((185... |
# -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
"""
Imported from StreamBank.bas
"""
import logging
from .Input.LandUse.AreaTotal import AreaTotal_f
from .Input.LandUse.Ag.AGSTRM import AGSTRM_f
from .Input.LandUse.Ag.TileDrain impo... | [
"logging.getLogger"
] | [((575, 602), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (592, 602), False, 'import logging\n')] |
from django.urls import include, path
from feedzero.users.views import LogoutView
app_name = "users"
urlpatterns = [
path("logout/", LogoutView.as_view(), name="logout"),
path("integrations/pocket/", include("feedzero.users.integrations.pocket.urls")),
]
| [
"feedzero.users.views.LogoutView.as_view",
"django.urls.include"
] | [((140, 160), 'feedzero.users.views.LogoutView.as_view', 'LogoutView.as_view', ([], {}), '()\n', (158, 160), False, 'from feedzero.users.views import LogoutView\n'), ((211, 261), 'django.urls.include', 'include', (['"""feedzero.users.integrations.pocket.urls"""'], {}), "('feedzero.users.integrations.pocket.urls')\n", (... |
# -*- coding: utf-8 -*-
"""Example 1: Load and plot airfoil coordinates
"""
import os
import matplotlib.pyplot as plt
from mypack.utils.io import read_selig
from mypack.utils.plotting import plot_airfoil
def example_1():
"""Run example 1"""
# script inputs
mod_path = os.path.dirname(os.path.abspath(__fi... | [
"matplotlib.pyplot.gcf",
"os.path.join",
"mypack.utils.io.read_selig",
"os.path.basename",
"mypack.utils.plotting.plot_airfoil",
"os.path.abspath"
] | [((360, 438), 'os.path.join', 'os.path.join', (['mod_path', '""".."""', '"""tests"""', '"""test_utils"""', '"""files"""', '"""demo_selig.dat"""'], {}), "(mod_path, '..', 'tests', 'test_utils', 'files', 'demo_selig.dat')\n", (372, 438), False, 'import os\n'), ((538, 558), 'mypack.utils.io.read_selig', 'read_selig', (['a... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from pyramid.view import view_config
from pyweaving.generators.twill import twill
@view_config(route_name='index', renderer='index.html')
def index_view(request):
draft = twill(2, warp_color=(200, 0, 0), ... | [
"pyweaving.generators.twill.twill",
"pyramid.view.view_config"
] | [((195, 249), 'pyramid.view.view_config', 'view_config', ([], {'route_name': '"""index"""', 'renderer': '"""index.html"""'}), "(route_name='index', renderer='index.html')\n", (206, 249), False, 'from pyramid.view import view_config\n'), ((287, 344), 'pyweaving.generators.twill.twill', 'twill', (['(2)'], {'warp_color': ... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import contextlib
import os
import pathlib
from fbpcp.service.storage_s3 import S3StorageService
from fbpmp.utils.buff... | [
"fbpcp.service.storage_s3.S3StorageService",
"pathlib.Path",
"os.environ.get",
"fbpmp.utils.buffered_s3_file_handler.BufferedS3Writer",
"fbpmp.utils.buffered_s3_file_handler.BufferedS3Reader"
] | [((543, 574), 'os.environ.get', 'os.environ.get', (['"""PL_AWS_REGION"""'], {}), "('PL_AWS_REGION')\n", (557, 574), False, 'import os\n'), ((592, 623), 'os.environ.get', 'os.environ.get', (['"""PL_AWS_KEY_ID"""'], {}), "('PL_AWS_KEY_ID')\n", (606, 623), False, 'import os\n'), ((643, 676), 'os.environ.get', 'os.environ.... |
import time
from typing import Callable
from functools import wraps
def timeit(metric_callback: Callable, **labels):
def wrapper(func):
@wraps(func)
def func_wrapper(*args, **kwargs):
start = time.time()
result = func(*args, **kwargs)
metric_callback(time.time()... | [
"time.time",
"functools.wraps"
] | [((151, 162), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (156, 162), False, 'from functools import wraps\n'), ((226, 237), 'time.time', 'time.time', ([], {}), '()\n', (235, 237), False, 'import time\n'), ((309, 320), 'time.time', 'time.time', ([], {}), '()\n', (318, 320), False, 'import time\n')] |
# Start Imports.
import scapy.all as scapy
import time , sys
def Banner():
# One Line Banner
Ban = "\t\t\t\t\t[+] << ARP-SP00F (MITM) >> [+]"
print(Ban)
Banner()
Address = input("\nTarget IP >> ")
MainIP = input("Network IP >> ")
Packets = 0
def MAC_SCAN(ip):
arp = scapy.ARP(pdst=ip)
broadcast =... | [
"time.sleep",
"scapy.all.send",
"scapy.all.ARP",
"sys.exit",
"scapy.all.srp",
"sys.stdout.flush",
"scapy.all.Ether"
] | [((288, 306), 'scapy.all.ARP', 'scapy.ARP', ([], {'pdst': 'ip'}), '(pdst=ip)\n', (297, 306), True, 'import scapy.all as scapy\n'), ((321, 357), 'scapy.all.Ether', 'scapy.Ether', ([], {'dst': '"""ff:ff:ff:ff:ff:ff"""'}), "(dst='ff:ff:ff:ff:ff:ff')\n", (332, 357), True, 'import scapy.all as scapy\n'), ((593, 653), 'scapy... |
from urllib.parse import urlencode
from ebrains_drive.files import SeafDir, SeafFile
from ebrains_drive.utils import raise_does_not_exist
class Repo(object):
"""
A seafile library
"""
def __init__(self, client, **kwargs):
self.client = client
allowed_keys = ['encrypted', 'group_name', ... | [
"ebrains_drive.files.SeafFile",
"ebrains_drive.utils.raise_does_not_exist",
"ebrains_drive.files.SeafDir"
] | [((1460, 1517), 'ebrains_drive.utils.raise_does_not_exist', 'raise_does_not_exist', (['"""The requested file does not exist"""'], {}), "('The requested file does not exist')\n", (1480, 1517), False, 'from ebrains_drive.utils import raise_does_not_exist\n'), ((1945, 2001), 'ebrains_drive.utils.raise_does_not_exist', 'ra... |
from django.conf.urls import url
import referrals
urlpatterns = [
url(r'^referrals/$', referrals.ReferralsView.as_view()),
url(r'^referral/(?P<referral_id>[-&\w]+)/$', referrals.ReferralView.as_view()),
]
| [
"referrals.ReferralsView.as_view",
"referrals.ReferralView.as_view"
] | [((92, 125), 'referrals.ReferralsView.as_view', 'referrals.ReferralsView.as_view', ([], {}), '()\n', (123, 125), False, 'import referrals\n'), ((177, 209), 'referrals.ReferralView.as_view', 'referrals.ReferralView.as_view', ([], {}), '()\n', (207, 209), False, 'import referrals\n')] |
from typing import Optional
import pytest
from testoot.base import TestootContext, Comparator, TestootSerializer, \
FileType, TestootTestResult
from testoot.ext.pytest import PytestContext
from testoot.testoot import Testoot
from tests.conftest import AbcDiffResult
@pytest.fixture(scope='module')
def base_testo... | [
"pytest.fixture",
"testoot.ext.pytest.PytestContext",
"tests.conftest.AbcDiffResult"
] | [((275, 305), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (289, 305), False, 'import pytest\n'), ((515, 547), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (529, 547), False, 'import pytest\n'), ((620, 642), 'testoot.ext.pyt... |
# -*- coding: utf-8 -*-
import json
from random import shuffle
def serialize_stream(stream):
items = stream.youtube_links.split("\n")
if stream.play_random:
shuffle(items)
return {
"id": stream.pk,
"name": stream.name,
"slug": stream.slug,
"keywords": stream.keywords... | [
"random.shuffle"
] | [((174, 188), 'random.shuffle', 'shuffle', (['items'], {}), '(items)\n', (181, 188), False, 'from random import shuffle\n')] |
# -*- coding: utf-8 -*-
import warnings
import six
def encode_if_unicode(value, encoding='utf-8'): # pragma: no cover
"""
Encode and return a ``value`` using specified ``encoding``.
Encoding is done only if ``value`` is a ``unicode`` instance
(utf-8 encoding is used as default).
.. deprecated:... | [
"warnings.warn"
] | [((396, 568), 'warnings.warn', 'warnings.warn', (['"""laterpay.compat.encode_if_unicode is deprecated and will be removed in future versions. Use laterpay.compat.stringify instead"""', 'DeprecationWarning'], {}), "(\n 'laterpay.compat.encode_if_unicode is deprecated and will be removed in future versions. Use laterp... |
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 2 21:55:56 2015
@author: aidanrocke
"""
import numpy as np
def compressSequenceNFast(posture_seq, newStart, nMax):
"""
# COMPRESSSEQUENCE Recursively finds the most compressive subsequence in
# posture_seq and creates and replaces it with a new number. Thi... | [
"numpy.shape"
] | [((1731, 1752), 'numpy.shape', 'np.shape', (['posture_seq'], {}), '(posture_seq)\n', (1739, 1752), True, 'import numpy as np\n')] |
from myhdl import Signal, intbv, always, always_comb, block, instances
from hdmi.cores.primitives import dram16xn
@block
def convert_30_to_15(reset, clock, clockx2, data_in, tmds_data2, tmds_data1, tmds_data0):
"""
The block converts the 30-bit data into 15-bit data.
Args:
reset: The reset sig... | [
"myhdl.always",
"myhdl.instances",
"myhdl.intbv",
"myhdl.Signal"
] | [((881, 899), 'myhdl.always', 'always', (['write_addr'], {}), '(write_addr)\n', (887, 899), False, 'from myhdl import Signal, intbv, always, always_comb, block, instances\n'), ((1047, 1083), 'myhdl.always', 'always', (['clock.posedge', 'reset.posedge'], {}), '(clock.posedge, reset.posedge)\n', (1053, 1083), False, 'fro... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.GoodsCategoryResult import GoodsCategoryResult
class AlipayPcreditHuabeiGoodsCategoryQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayPcred... | [
"alipay.aop.api.domain.GoodsCategoryResult.GoodsCategoryResult.from_alipay_dict"
] | [((826, 865), 'alipay.aop.api.domain.GoodsCategoryResult.GoodsCategoryResult.from_alipay_dict', 'GoodsCategoryResult.from_alipay_dict', (['i'], {}), '(i)\n', (862, 865), False, 'from alipay.aop.api.domain.GoodsCategoryResult import GoodsCategoryResult\n')] |
import re
from typing import Tuple
BINANCE_SYMBOL_SPLITTER = re.compile(r"^(\w+)(BTC|ETH|BNB|XRP|USDT|USDC|TUSD|PAX)$")
class SymbolSplitter:
def __init__(self, market: str, symbol: str):
self._symbol: Tuple[str, str] = self.split(market, symbol)
@property
def base_asset(self):
return s... | [
"re.compile"
] | [((63, 121), 're.compile', 're.compile', (['"""^(\\\\w+)(BTC|ETH|BNB|XRP|USDT|USDC|TUSD|PAX)$"""'], {}), "('^(\\\\w+)(BTC|ETH|BNB|XRP|USDT|USDC|TUSD|PAX)$')\n", (73, 121), False, 'import re\n')] |
from urllib.parse import urlparse
from bs4 import BeautifulSoup
import urllib3
from socket import timeout
import tldextract
import re
import traceback
import sys
import logging
import socket
import threading
from time import sleep
from collector import Collector
from checker import Checker
http = urllib3.PoolManager(... | [
"urllib3.PoolManager"
] | [((300, 321), 'urllib3.PoolManager', 'urllib3.PoolManager', ([], {}), '()\n', (319, 321), False, 'import urllib3\n')] |
# Generated by Django 3.0.1 on 2020-01-08 08:47
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blog_entries', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='article',
name='for_adult',
),
... | [
"django.db.migrations.RemoveField"
] | [((221, 283), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""article"""', 'name': '"""for_adult"""'}), "(model_name='article', name='for_adult')\n", (243, 283), False, 'from django.db import migrations\n')] |
import os
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('config_path')
parser.add_argument('sh_path',default='train_10.24.sh')
args = parser.parse_args()
config_path = args.config_path
sh_path = args.sh_path
with open(f'/home/mist/SegformerDistillation/local_configs/{sh_path}','w') as f:
f... | [
"os.listdir",
"argparse.ArgumentParser"
] | [((35, 60), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (58, 60), False, 'import argparse\n'), ((328, 351), 'os.listdir', 'os.listdir', (['config_path'], {}), '(config_path)\n', (338, 351), False, 'import os\n')] |
import json
frecuencias = [
{
"tag": "company",
"count": 44
},
{
"tag": "team",
"count": 44
},
{
"tag": "experience",
"count": 43
},
{
"tag": "global",
"count": 42
},
{
"tag": "local",
"count": 41
},
{
"tag": "we",
"count": 40
},
{
"tag": "ex... | [
"json.dumps"
] | [((23918, 23961), 'json.dumps', 'json.dumps', (['frecuencias'], {'ensure_ascii': '(False)'}), '(frecuencias, ensure_ascii=False)\n', (23928, 23961), False, 'import json\n')] |
# Copyright (c) 2013, 9T9IT and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import fmt_money
from toolz.curried import compose, groupby, valmap, first, reduce, unique, pluck, count, partial
def execute(fil... | [
"frappe.db.get_single_value",
"toolz.curried.pluck",
"toolz.curried.groupby",
"frappe._",
"toolz.curried.valmap",
"frappe.get_all"
] | [((1889, 1948), 'frappe.db.get_single_value', 'frappe.db.get_single_value', (['"""Vetcare Settings"""', '"""enable_pb"""'], {}), "('Vetcare Settings', 'enable_pb')\n", (1915, 1948), False, 'import frappe\n'), ((4319, 4411), 'frappe.get_all', 'frappe.get_all', (['"""Sales Taxes and Charges"""'], {'filters': "{'parent': ... |
# -*- encoding: utf-8 -*-
from . import FixtureTest
class HideEarlyNursingHomeTest(FixtureTest):
def test_nursing_home_area(self):
import dsl
z, x, y = (15, 5237, 12667)
self.generate_fixtures(
# https://www.openstreetmap.org/way/267296981
dsl.way(267296981, dsl.... | [
"dsl.tile_box"
] | [((316, 337), 'dsl.tile_box', 'dsl.tile_box', (['z', 'x', 'y'], {}), '(z, x, y)\n', (328, 337), False, 'import dsl\n')] |
"""
MIDI file reader and writer for Mido built on top of rawmidifile.
There is no official API in Mido for encoding and decoding meta
messages so I've had to use some internal functions.
"""
from rawmidifile import read_rawmidifile, write_rawmidifile
import mido
from mido.midifiles.meta import (build_meta_message,
... | [
"mido.Message.from_bytes",
"rawmidifile.write_rawmidifile",
"mido.midifiles.meta.build_meta_message",
"rawmidifile.read_rawmidifile"
] | [((1193, 1217), 'rawmidifile.read_rawmidifile', 'read_rawmidifile', (['infile'], {}), '(infile)\n', (1209, 1217), False, 'from rawmidifile import read_rawmidifile, write_rawmidifile\n'), ((1534, 1566), 'rawmidifile.write_rawmidifile', 'write_rawmidifile', (['infile'], {}), '(infile, **mid)\n', (1551, 1566), False, 'fro... |
# ----------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License
# ----------------------------------------------------------------------
"""Contains the scalar type info objects"""
import os
import textwrap
... | [
"CommonEnvironment.Interface.DerivedProperty",
"CommonEnvironment.ThisFullpath",
"os.path.split"
] | [((579, 611), 'CommonEnvironment.ThisFullpath', 'CommonEnvironment.ThisFullpath', ([], {}), '()\n', (609, 611), False, 'import CommonEnvironment\n'), ((659, 690), 'os.path.split', 'os.path.split', (['_script_fullpath'], {}), '(_script_fullpath)\n', (672, 690), False, 'import os\n'), ((4137, 4170), 'CommonEnvironment.In... |
#!/usr/bin/env python3
### block that grows in fiber direction triggered by fiber stretch and remodels to softer material
# TODO: Somehow, this does not converge quadratically at the end (seems irrespective of remodeling,
# but likely to be attributed to the growth in fiber direction) ---> check linearization terms!
... | [
"traceback.format_exc",
"pathlib.Path",
"results_check.results_check_node",
"numpy.array",
"sys.exit",
"results_check.success_check"
] | [((4321, 4442), 'results_check.results_check_node', 'results_check.results_check_node', (['problem.mp.u', 'check_node', 'u_corr', 'problem.mp.V_u', 'problem.mp.comm'], {'tol': 'tol', 'nm': '"""u"""'}), "(problem.mp.u, check_node, u_corr, problem.\n mp.V_u, problem.mp.comm, tol=tol, nm='u')\n", (4353, 4442), False, '... |
import math
x = int(input())
sinn = math.sin(math.radians(15))
son = math.exp(x)-5*x
mon = math.pow((x**2+1),0.5)
lnn = math.log(3*x)
print("%.10f"%(sinn+son/mon-lnn))
| [
"math.pow",
"math.exp",
"math.radians",
"math.log"
] | [((93, 118), 'math.pow', 'math.pow', (['(x ** 2 + 1)', '(0.5)'], {}), '(x ** 2 + 1, 0.5)\n', (101, 118), False, 'import math\n'), ((122, 137), 'math.log', 'math.log', (['(3 * x)'], {}), '(3 * x)\n', (130, 137), False, 'import math\n'), ((47, 63), 'math.radians', 'math.radians', (['(15)'], {}), '(15)\n', (59, 63), False... |
import mne
import numpy as np
import pandas as pd
from mne.beamformer import make_dics, apply_dics_csd
from config import dics_settings, fname, args
from megset.config import fname as megset_fname
from megset.config import freq_range
subject = args.subject
print(f'Running analsis for subject {subject}')
mne.set_log_... | [
"numpy.arccos",
"mne.set_log_level",
"numpy.arange",
"megset.config.fname.fwd",
"megset.config.fname.ecd",
"mne.beamformer.apply_dics_csd",
"numpy.log",
"mne.channels.equalize_channels",
"numpy.linalg.norm",
"mne.time_frequency.csd_morlet",
"config.fname.dics_megset_results",
"pandas.DataFrame... | [((308, 332), 'mne.set_log_level', 'mne.set_log_level', (['(False)'], {}), '(False)\n', (325, 332), False, 'import mne\n'), ((1091, 1122), 'numpy.arange', 'np.arange', (['*freq_range[subject]'], {}), '(*freq_range[subject])\n', (1100, 1122), True, 'import numpy as np\n'), ((1129, 1203), 'mne.time_frequency.csd_morlet',... |
import csv
from sklearn.cluster import MiniBatchKMeans
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
import pickle
import numpy as np
import sklearn.metrics as metrics
from yellowbrick.cluster import InterclusterDistance
from scipy.optimize import curve_fit
import umap.umap_ as umap
from col... | [
"csv.field_size_limit",
"csv.DictWriter",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylabel",
"yellowbrick.cluster.InterclusterDistance",
"sklearn.metrics.silhouette_samples",
"scipy.stats.sem",
"numpy.arange",
"numpy.mean",
"argparse.ArgumentParser",
"matplotlib.pyplot.xlabel",
"numpy.exp",... | [((73, 96), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (87, 96), False, 'import matplotlib\n'), ((2181, 2273), 'sklearn.cluster.MiniBatchKMeans', 'MiniBatchKMeans', ([], {'n_clusters': 'selected_k', 'init': 'centers', 'verbose': '(0)', 'max_no_improvement': 'None'}), '(n_clusters=selected... |
from day12 import Moon, simulate_moons, get_steps_to_find_same_state, get_total_energy
def test_init_handles_string_input():
line = "<x=15, y=-2, z=-6>"
expected_x = 15
expected_y = -2
expected_z = -6
result = Moon(line)
assert result.x == expected_x
assert result.y == expected_y
ass... | [
"day12.get_total_energy",
"day12.get_steps_to_find_same_state",
"day12.Moon"
] | [((233, 243), 'day12.Moon', 'Moon', (['line'], {}), '(line)\n', (237, 243), False, 'from day12 import Moon, simulate_moons, get_steps_to_find_same_state, get_total_energy\n'), ((486, 509), 'day12.Moon', 'Moon', (['"""<x=1, y=2, z=3>"""'], {}), "('<x=1, y=2, z=3>')\n", (490, 509), False, 'from day12 import Moon, simulat... |
import gym
import gym_tensegrity
import numpy as np
import os
from time import sleep
# Discrete action space functions testing
def main(port_num=10042):
def print_observation(obs):
print("Observations {:}".format(obs))
env = gym.make('gym_tensegrity:jumper-v0')
# action = randint(0,15)
action =... | [
"os.fork",
"threading.Thread",
"gym.make"
] | [((242, 278), 'gym.make', 'gym.make', (['"""gym_tensegrity:jumper-v0"""'], {}), "('gym_tensegrity:jumper-v0')\n", (250, 278), False, 'import gym\n'), ((2982, 3018), 'gym.make', 'gym.make', (['"""gym_tensegrity:jumper-v0"""'], {}), "('gym_tensegrity:jumper-v0')\n", (2990, 3018), False, 'import gym\n'), ((3762, 3813), 'g... |
import numpy as np
import matplotlib.pyplot as plt
import cv2
class LaneIdentifier:
def __init__(self, smooth_factor, filter):
self.left_lane_inds = []
self.right_lane_inds = []
self.lane_gap = []
self.binary_warped = None
self.window_height = None
self.leftx_current... | [
"numpy.polyfit",
"numpy.hstack",
"numpy.array",
"numpy.mean",
"numpy.delete",
"matplotlib.pyplot.plot",
"cv2.addWeighted",
"numpy.linspace",
"numpy.vstack",
"numpy.concatenate",
"matplotlib.pyplot.ylim",
"numpy.argmax",
"numpy.int_",
"matplotlib.pyplot.xlim",
"numpy.int",
"numpy.dstack... | [((841, 893), 'numpy.int', 'np.int', (['(self.binary_warped.shape[0] // self.nwindows)'], {}), '(self.binary_warped.shape[0] // self.nwindows)\n', (847, 893), True, 'import numpy as np\n'), ((954, 974), 'numpy.array', 'np.array', (['nonzero[0]'], {}), '(nonzero[0])\n', (962, 974), True, 'import numpy as np\n'), ((999, ... |
import pytest
from Tree import Tree
class TestClass:
def setup_class(self):
pass
def test_tree(self):
tree = Tree()
tree.add(3)
tree.add(4)
tree.add(0)
tree.add(8)
tree.add(2)
tree.print_tree()
assert True
def test_compare_trees(se... | [
"Tree.Tree"
] | [((137, 143), 'Tree.Tree', 'Tree', ([], {}), '()\n', (141, 143), False, 'from Tree import Tree\n'), ((341, 347), 'Tree.Tree', 'Tree', ([], {}), '()\n', (345, 347), False, 'from Tree import Tree\n'), ((364, 370), 'Tree.Tree', 'Tree', ([], {}), '()\n', (368, 370), False, 'from Tree import Tree\n')] |
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | [
"ansible.module_utils.urls.fetch_url",
"json.loads",
"ansible.module_utils._text.to_native"
] | [((9123, 9211), 'ansible.module_utils.urls.fetch_url', 'fetch_url', (['module', 'request_url'], {'method': '"""GET"""', 'headers': "{'Accept': 'application/json'}"}), "(module, request_url, method='GET', headers={'Accept':\n 'application/json'})\n", (9132, 9211), False, 'from ansible.module_utils.urls import fetch_u... |
# Generated by Django 3.1 on 2020-09-01 17:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('application', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='client',
name='link',
f... | [
"django.db.models.URLField",
"django.db.models.DateTimeField"
] | [((325, 363), 'django.db.models.URLField', 'models.URLField', ([], {'blank': '(True)', 'null': '(True)'}), '(blank=True, null=True)\n', (340, 363), False, 'from django.db import migrations, models\n'), ((483, 541), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'blank': '(True)', 'max_length': '(50)', ... |
import sys
import time
import subprocess
import re
_setMessage = None
class Bootstrap:
def __init__( self, identifier, contractor ):
self.identifier = identifier
self.request = contractor.request
self.request( 'call', '/api/v1/Survey/Cartographer(register)', { 'identifier': identifier } )
def look... | [
"re.sub",
"subprocess.run",
"time.sleep",
"sys.exit"
] | [((4630, 4733), 'subprocess.run', 'subprocess.run', (["['/sbin/ip', 'addr', 'show', 'dev', interface]"], {'shell': '(False)', 'stdout': 'subprocess.PIPE'}), "(['/sbin/ip', 'addr', 'show', 'dev', interface], shell=False,\n stdout=subprocess.PIPE)\n", (4644, 4733), False, 'import subprocess\n'), ((1879, 1992), 'subpro... |
# Copyright 2017 Neural Networks and Deep Learning lab, MIPT
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"tensorflow.tile",
"tensorflow.NotDifferentiable",
"tensorflow.shape",
"tensorflow.get_variable",
"tensorflow.boolean_mask",
"tensorflow.transpose",
"tensorflow.reduce_sum",
"tensorflow.gradients",
"numpy.array",
"tensorflow.nn.dropout",
"tensorflow.reverse_sequence",
"copy.deepcopy",
"tenso... | [((741, 770), 'tensorflow.NotDifferentiable', 'tf.NotDifferentiable', (['"""Spans"""'], {}), "('Spans')\n", (761, 770), True, 'import tensorflow as tf\n'), ((771, 806), 'tensorflow.NotDifferentiable', 'tf.NotDifferentiable', (['"""Antecedents"""'], {}), "('Antecedents')\n", (791, 806), True, 'import tensorflow as tf\n'... |
#!/usr/bin/env python
#_*_coding:utf-8_*_
import sys, os, re
pPath = os.path.split(os.path.realpath(__file__))[0]
sys.path.append(pPath)
import checkFasta
def TA(fastas, **kw):
if checkFasta.checkFasta(fastas) == False:
print('Error: for "TA" encoding, the input fasta sequences should be with equal length. \n\n')
... | [
"os.path.realpath",
"os.path.exists",
"sys.path.append",
"checkFasta.checkFasta"
] | [((115, 137), 'sys.path.append', 'sys.path.append', (['pPath'], {}), '(pPath)\n', (130, 137), False, 'import sys, os, re\n'), ((84, 110), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (100, 110), False, 'import sys, os, re\n'), ((183, 212), 'checkFasta.checkFasta', 'checkFasta.checkFasta',... |
# Generated by Django 2.0 on 2018-02-24 11:21
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('sky', '0007_auto_20180224_1120'),
]
operations = [
migrations.RemoveField(
model_name='news',
name='label',
),
]
| [
"django.db.migrations.RemoveField"
] | [((221, 276), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""news"""', 'name': '"""label"""'}), "(model_name='news', name='label')\n", (243, 276), False, 'from django.db import migrations\n')] |
#!/usr/bin/env python
# ------------------------------------------------------------------------------------------------------%
# Created by "Thieu" at 17:12, 09/07/2021 %
# ... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylabel",
"numpy.arange",
"pathlib.Path",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"platform.system",
"re.sub",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.legend",
"matplot... | [((1732, 1769), 're.sub', 're.sub', (['regular_expression', '""""""', 'fname'], {}), "(regular_expression, '', fname)\n", (1738, 1769), False, 'import re\n'), ((2541, 2557), 'matplotlib.pyplot.title', 'plt.title', (['title'], {}), '(title)\n', (2550, 2557), True, 'from matplotlib import pyplot as plt\n'), ((2562, 2581)... |
import json
from interactions.models import (
SelfAnswerGroup,
)
def update_dict_with_score(valid_dict: list) -> list:
""" Updates the dict (from single and multiple_result_view) with
the scores of each user present in the list, by calculating their
``answer_choice`` and multiplying them with corresp... | [
"interactions.models.SelfAnswerGroup.objects.get"
] | [((411, 472), 'interactions.models.SelfAnswerGroup.objects.get', 'SelfAnswerGroup.objects.get', ([], {'pk': "dictionary['answer_group_pk']"}), "(pk=dictionary['answer_group_pk'])\n", (438, 472), False, 'from interactions.models import SelfAnswerGroup\n')] |
#
# This file is part of snmpsim software.
#
# Copyright (c) 2010-2017, <NAME> <<EMAIL>>
# License: http://snmpsim.sf.net/license.html
#
# Managed value variation module: simulate a live Agent using
# a series of snapshots.
#
import os, time, bisect
from pyasn1.compat.octets import str2octs
from pysnmp.proto import rfc... | [
"os.path.exists",
"snmpsim.record.search.file.getRecord",
"snmpsim.log.msg",
"pysnmp.proto.rfc1902.ObjectName",
"snmpsim.mltsplit.split",
"os.makedirs",
"snmpsim.error.MoreDataNotification",
"snmpsim.error.NoDataNotification",
"os.listdir",
"os.path.join",
"pysnmp.proto.rfc1902.Integer32",
"sn... | [((6845, 6860), 'snmpsim.record.search.file.getRecord', 'getRecord', (['text'], {}), '(text)\n', (6854, 6860), False, 'from snmpsim.record.search.file import searchRecordByOid, getRecord\n'), ((1045, 1056), 'time.time', 'time.time', ([], {}), '()\n', (1054, 1056), False, 'import os, time, bisect\n'), ((6253, 6345), 'sn... |
"""empty message
Revision ID: <KEY>
Revises: 3b042c12d85e
Create Date: 2018-12-12 22:47:40.070151
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<KEY>'
branch_labels = None
depends_on = None
def u... | [
"sqlalchemy.ForeignKeyConstraint",
"alembic.op.drop_table",
"sqlalchemy.dialects.mysql.INTEGER",
"sqlalchemy.dialects.mysql.VARCHAR",
"sqlalchemy.PrimaryKeyConstraint",
"sqlalchemy.Integer",
"sqlalchemy.String",
"sqlalchemy.dialects.mysql.TINYINT"
] | [((1118, 1144), 'alembic.op.drop_table', 'op.drop_table', (['"""sysconfig"""'], {}), "('sysconfig')\n", (1131, 1144), False, 'from alembic import op\n'), ((2107, 2135), 'alembic.op.drop_table', 'op.drop_table', (['"""users_roles"""'], {}), "('users_roles')\n", (2120, 2135), False, 'from alembic import op\n'), ((2140, 2... |
from tkinter import Tk, Button, Label
from threading import Thread
from queue import Queue
import configparser
import sys
import os
def init_config(path):
config.optionxform = str
config.read(path)
def maingui():
for name in tt['modules'].keys():
tt[name]['label'].config(text=str(tt[name].get('c... | [
"os.path.exists",
"configparser.ConfigParser",
"tkinter.Tk",
"tkinter.Label",
"sys.exit",
"queue.Queue"
] | [((912, 916), 'tkinter.Tk', 'Tk', ([], {}), '()\n', (914, 916), False, 'from tkinter import Tk, Button, Label\n'), ((1306, 1333), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (1331, 1333), False, 'import configparser\n'), ((1199, 1219), 'os.path.exists', 'os.path.exists', (['path'], {}), ... |
'''OpenGL extension ARB.map_buffer_range
This module customises the behaviour of the
OpenGL.raw.GL.ARB.map_buffer_range to provide a more
Python-friendly API
Overview (from the spec)
ARB_map_buffer_range expands the buffer object API to allow greater
performance when a client application only needs to ... | [
"OpenGL.extensions.hasGLExtension"
] | [((2070, 2112), 'OpenGL.extensions.hasGLExtension', 'extensions.hasGLExtension', (['_EXTENSION_NAME'], {}), '(_EXTENSION_NAME)\n', (2095, 2112), False, 'from OpenGL import extensions\n')] |
from __future__ import division
import torch
import torch.nn as nn
from mmdet import ops
from ..registry import ROI_EXTRACTORS
import pdb
@ROI_EXTRACTORS.register_module
class ARboxMultiRoIExtractor(nn.Module):
"""Extract RoI features from a single level feature map.
If there are mulitple input feature leve... | [
"torch.max"
] | [((2792, 2829), 'torch.max', 'torch.max', (['roi_feats[0]', 'roi_feats[i]'], {}), '(roi_feats[0], roi_feats[i])\n', (2801, 2829), False, 'import torch\n')] |