code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from django.contrib.auth import get_user_model
from django.shortcuts import redirect
from django.templatetags.static import static
from ...conf import settings
User = get_user_model()
def user_avatar(request, pk, size):
size = int(size)
try:
user = User.objects.get(pk=pk)
except User.DoesNotExi... | [
"django.shortcuts.redirect",
"django.templatetags.static.static",
"django.contrib.auth.get_user_model"
] | [((169, 185), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (183, 185), False, 'from django.contrib.auth import get_user_model\n'), ((509, 538), 'django.shortcuts.redirect', 'redirect', (["found_avatar['url']"], {}), "(found_avatar['url'])\n", (517, 538), False, 'from django.shortcuts import... |
import struct
import hashlib
import binascii
from datetime import datetime, timedelta
from cryptos import ecdsa_raw_sign, hash_to_int, encode_privkey, decode, encode, \
hmac, fast_multiply, G, inv, N, decode_privkey, get_privkey_format, random_key, encode_pubkey, privtopub
from base58 import b58decode, b58encode
... | [
"base58.b58encode",
"cryptos.inv",
"cryptos.hmac.new",
"cryptos.hash_to_int",
"cryptos.encode_privkey",
"binascii.hexlify",
"struct.unpack",
"hashlib.sha256",
"cryptos.fast_multiply",
"hashlib.new",
"cryptos.privtopub",
"datetime.timedelta",
"cryptos.random_key",
"cryptos.get_privkey_forma... | [((1124, 1151), 'cryptos.encode_privkey', 'encode_privkey', (['priv', '"""bin"""'], {}), "(priv, 'bin')\n", (1138, 1151), False, 'from cryptos import ecdsa_raw_sign, hash_to_int, encode_privkey, decode, encode, hmac, fast_multiply, G, inv, N, decode_privkey, get_privkey_format, random_key, encode_pubkey, privtopub\n'),... |
# coding:utf-8
import pandas as pd
import numpy as np
import math
from sklearn.tree import DecisionTreeClassifier, _tree
from sklearn.cluster import KMeans
from .utils import fillna, bin_by_splits, to_ndarray, clip
from .utils.decorator import support_dataframe
from .utils.forwardSplit import *
DEFAULT_BINS = 10
DEFA... | [
"pandas.DataFrame",
"numpy.quantile",
"sklearn.cluster.KMeans",
"numpy.empty",
"numpy.unique",
"numpy.zeros",
"numpy.nanmin",
"sklearn.tree.DecisionTreeClassifier",
"numpy.sort",
"numpy.array",
"numpy.arange",
"numpy.nanmax"
] | [((575, 589), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (587, 589), True, 'import pandas as pd\n'), ((2055, 2130), 'sklearn.tree.DecisionTreeClassifier', 'DecisionTreeClassifier', ([], {'min_samples_leaf': 'min_samples', 'max_leaf_nodes': 'n_bins'}), '(min_samples_leaf=min_samples, max_leaf_nodes=n_bins)\n'... |
import cv2
import click
import numpy as np
def main():
rgb = cv2.imread("../data/rgb.jpg")
bgrLower = np.array([10, 10, 80])
bgrUpper = np.array([100, 100, 255])
img_mask = cv2.inRange(rgb, bgrLower, bgrUpper)
img_mask = cv2.morphologyEx(img_mask, cv2.MORPH_OPEN, (15, 15))
img_mask[:100, :] =... | [
"cv2.bitwise_not",
"cv2.dilate",
"cv2.waitKey",
"cv2.morphologyEx",
"cv2.imwrite",
"cv2.imread",
"numpy.array",
"cv2.inRange"
] | [((67, 96), 'cv2.imread', 'cv2.imread', (['"""../data/rgb.jpg"""'], {}), "('../data/rgb.jpg')\n", (77, 96), False, 'import cv2\n'), ((113, 135), 'numpy.array', 'np.array', (['[10, 10, 80]'], {}), '([10, 10, 80])\n', (121, 135), True, 'import numpy as np\n'), ((151, 176), 'numpy.array', 'np.array', (['[100, 100, 255]'],... |
import datetime
from utilitiesmodule import *
def displayDetails(title, value, today = datetime.datetime.now()):
banner(length=100, message=f'{title} | {today}')
print(f"Length: {len(value)}")
print(f"Value: {value}")
def displayDetails_v2(title, value, today = None):
if(today is None):
to... | [
"datetime.datetime.now"
] | [((89, 112), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (110, 112), False, 'import datetime\n'), ((326, 349), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (347, 349), False, 'import datetime\n')] |
from Nodes.scrapper import ScraperNode
from argparse import ArgumentParser
from Nodes.chord import ChordNode
from Nodes.bd import BDNode
from Nodes.logger import *
import nest_asyncio
nest_asyncio.apply()
import Nodes.utils
import asyncio
import logging
import getopt
import aiomas
import sys
import os
... | [
"nest_asyncio.apply",
"Nodes.chord.ChordNode",
"asyncio.get_event_loop",
"argparse.ArgumentParser"
] | [((190, 210), 'nest_asyncio.apply', 'nest_asyncio.apply', ([], {}), '()\n', (208, 210), False, 'import nest_asyncio\n'), ((3719, 3735), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (3733, 3735), False, 'from argparse import ArgumentParser\n'), ((953, 977), 'asyncio.get_event_loop', 'asyncio.get_event_... |
# Databricks notebook source
#############################################
# TAG API FUNCTIONS
#############################################
# Get all tags
def getTags() -> dict:
return sc._jvm.scala.collection.JavaConversions.mapAsJavaMap(
dbutils.entry_point.getDbutils().notebook().getContext().tags()
)
#... | [
"pyspark.sql.types.Row",
"sys.version.index",
"time.sleep",
"time.time",
"uuid.uuid1",
"pyspark.sql.functions.hash",
"requests.post",
"re.sub",
"pyspark.sql.types.StructType"
] | [((4729, 4770), 're.sub', 're.sub', (['"""[^a-zA-Z0-9]"""', '"""_"""', 'databaseName'], {}), "('[^a-zA-Z0-9]', '_', databaseName)\n", (4735, 4770), False, 'import re\n'), ((23841, 23855), 'pyspark.sql.types.StructType', 'StructType', (['[]'], {}), '([])\n', (23851, 23855), False, 'from pyspark.sql.types import Row, Str... |
import pygame
import sys
from time import sleep
from pygame.locals import *
from bullet import Bullet
from alien import Alien
from decoration import Star
from cartoon import MySprite
def check_keydown_events(event, ai_settings, screen, status, sb, ship, aliens, bullets):
"""响应按键"""
if event.key == pygame.K_RI... | [
"bullet.Bullet",
"cartoon.MySprite",
"pygame.mouse.get_pressed",
"pygame.event.get",
"pygame.sprite.groupcollide",
"pygame.mouse.set_visible",
"pygame.mixer.music.play",
"sys.exit",
"pygame.display.flip",
"decoration.Star",
"pygame.mouse.get_pos",
"pygame.mixer.music.load",
"pygame.time.get_... | [((1687, 1705), 'pygame.event.get', 'pygame.event.get', ([], {}), '()\n', (1703, 1705), False, 'import pygame\n'), ((5486, 5531), 'pygame.mixer.music.load', 'pygame.mixer.music.load', (['"""sound/fighting.mp3"""'], {}), "('sound/fighting.mp3')\n", (5509, 5531), False, 'import pygame\n'), ((5536, 5563), 'pygame.mixer.mu... |
###############################################################################
#
# The MIT License (MIT)
# Copyright (c) 2019 WMO Expert Team on World Data Centres (ET-WDC)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Softw... | [
"os.path.isdir",
"os.listdir"
] | [((1375, 1394), 'os.listdir', 'os.listdir', (['basedir'], {}), '(basedir)\n', (1385, 1394), False, 'import os\n'), ((1514, 1536), 'os.path.isdir', 'os.path.isdir', (['dirname'], {}), '(dirname)\n', (1527, 1536), False, 'import os\n'), ((1574, 1593), 'os.listdir', 'os.listdir', (['dirname'], {}), '(dirname)\n', (1584, 1... |
from re import S
from typing import Dict, Mapping, Optional, Tuple
from torch import nn
import torch
import numpy as np
from ragged_buffer import RaggedBufferF32, RaggedBufferI64
import ragged_buffer
from entity_gym.environment import ObsSpace
from entity_gym.simple_trace import Tracer
from rogue_net.translate_positio... | [
"torch.nn.ReLU",
"rogue_net.translate_positions.TranslatePositions",
"torch.randn",
"torch.cat",
"torch.nn.LayerNorm",
"torch.nn.ModuleDict",
"torch.tensor"
] | [((1457, 1482), 'torch.nn.ModuleDict', 'nn.ModuleDict', (['embeddings'], {}), '(embeddings)\n', (1470, 1482), False, 'from torch import nn\n'), ((2800, 2824), 'torch.cat', 'torch.cat', (['entity_embeds'], {}), '(entity_embeds)\n', (2809, 2824), False, 'import torch\n'), ((740, 789), 'rogue_net.translate_positions.Trans... |
import base64
import json
from tilecloud import Tile, TileCoord
def encode_message(tile):
message = {
"z": tile.tilecoord.z,
"x": tile.tilecoord.x,
"y": tile.tilecoord.y,
"n": tile.tilecoord.n,
"metadata": tile.metadata,
}
if "sqs_message" in message["metadata"]:
... | [
"tilecloud.TileCoord",
"base64.b64decode",
"json.dumps"
] | [((692, 713), 'tilecloud.TileCoord', 'TileCoord', (['z', 'x', 'y', 'n'], {}), '(z, x, y, n)\n', (701, 713), False, 'from tilecloud import Tile, TileCoord\n'), ((508, 530), 'base64.b64decode', 'base64.b64decode', (['text'], {}), '(text)\n', (524, 530), False, 'import base64\n'), ((395, 414), 'json.dumps', 'json.dumps', ... |
from setproctitle import getproctitle, setproctitle
process_title_progress_pos = None
def update_title_progress(progress):
global process_title_progress_pos
title = getproctitle()
if process_title_progress_pos is None:
process_title_progress_pos = title.find('--process-title-progress')
if ... | [
"setproctitle.setproctitle",
"setproctitle.getproctitle"
] | [((177, 191), 'setproctitle.getproctitle', 'getproctitle', ([], {}), '()\n', (189, 191), False, 'from setproctitle import getproctitle, setproctitle\n'), ((524, 543), 'setproctitle.setproctitle', 'setproctitle', (['title'], {}), '(title)\n', (536, 543), False, 'from setproctitle import getproctitle, setproctitle\n')] |
import silab_collections.meas as meas
from silab_collections.meas import iv
from silab_collections.meas.data_writer import DataWriter
def iv_scan_example():
"""
In this example 3 basic IV scans are described with different parameters.
Uncomment to run different scans.
Make sure that the *smu_config* d... | [
"silab_collections.meas.iv.iv_scan"
] | [((863, 1004), 'silab_collections.meas.iv.iv_scan', 'iv.iv_scan', ([], {'outfile': '"""iv_scan_basic_example_1.csv"""', 'smu_config': 'smu_config', 'bias_voltage': '(60)', 'current_limit': '(1e-06)', 'n_meas': '(10)', 'overwrite': '(True)'}), "(outfile='iv_scan_basic_example_1.csv', smu_config=smu_config,\n bias_vol... |
"""
Distributed evaluating script for 3D shape classification with PipeWork dataset
"""
import argparse
import os
import sys
import time
import json
import random
import pickle
import numpy as np
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.dirname(BASE_DIR)
sys.path.append(ROOT_DIR)
impor... | [
"argparse.ArgumentParser",
"torch.cat",
"sklearn.metrics.classification_report",
"os.path.isfile",
"datasets.data_utils.BatchPointcloudScaleAndJitter",
"numpy.arange",
"torch.no_grad",
"utils.util.AverageMeter",
"os.path.join",
"sys.path.append",
"torch.ones",
"os.path.abspath",
"utils.util.... | [((262, 287), 'os.path.dirname', 'os.path.dirname', (['BASE_DIR'], {}), '(BASE_DIR)\n', (277, 287), False, 'import os\n'), ((288, 313), 'sys.path.append', 'sys.path.append', (['ROOT_DIR'], {}), '(ROOT_DIR)\n', (303, 313), False, 'import sys\n'), ((224, 249), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(_... |
# MIT License
#
# Copyright (c) 2020 CNRS
#
# 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... | [
"torch.nn.ModuleDict"
] | [((3185, 3200), 'torch.nn.ModuleDict', 'nn.ModuleDict', ([], {}), '()\n', (3198, 3200), True, 'import torch.nn as nn\n')] |
from .vehicle_peripheral import VehiclePeripheral
from common.config_handler import ConfigHandler
import threading
import gpiozero
class DistanceSensor(VehiclePeripheral):
def __init__(self):
super().__init__()
self._distance = 0
self._config_handler = ConfigHandler.get_instance()
... | [
"threading.Lock",
"common.config_handler.ConfigHandler.get_instance",
"gpiozero.DistanceSensor"
] | [((284, 312), 'common.config_handler.ConfigHandler.get_instance', 'ConfigHandler.get_instance', ([], {}), '()\n', (310, 312), False, 'from common.config_handler import ConfigHandler\n'), ((505, 521), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (519, 521), False, 'import threading\n'), ((608, 699), 'gpiozero.D... |
import pyqrcode
import png
from pyqrcode import QRCode
s = input("Url: ")
url = pyqrcode.create(s)
url.svg("code.svg", scale = 8)
url.png("code.png" , scale = 6)
print("images is saved as 'code.png' and 'code.svg'")
print("Thanks For uaing this tool :)")
| [
"pyqrcode.create"
] | [((81, 99), 'pyqrcode.create', 'pyqrcode.create', (['s'], {}), '(s)\n', (96, 99), False, 'import pyqrcode\n')] |
from mpi4py import MPI
from solver import Solver
import torch
import os
import time
import warnings
import datetime
import numpy as np
from tqdm import tqdm
from misc.utils import color, get_fake, get_labels, get_loss_value
from misc.utils import split, TimeNow, to_var
from misc.losses import _compute_loss_s... | [
"torch.cat",
"torch.cuda.device_count",
"misc.utils.split",
"misc.utils.color",
"misc.losses._compute_loss_smooth",
"datetime.timedelta",
"torch.mean",
"misc.utils.TimeNow",
"os.path.realpath",
"torch.max",
"misc.utils.to_var",
"misc.utils.get_fake",
"misc.utils.get_loss_value",
"misc.util... | [((413, 422), 'misc.utils.horovod', 'horovod', ([], {}), '()\n', (420, 422), False, 'from misc.utils import horovod\n'), ((447, 480), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (470, 480), False, 'import warnings\n'), ((1850, 1946), 'misc.utils.get_labels', 'get_labels... |
import pandas as pd
from bs4 import BeautifulSoup
import numpy as np
import nltk
import random
import os
from collections import Counter, defaultdict
import re
import json
import math
import matplotlib.pyplot as plt
import time
import csv
import pickle
from tqdm import tqdm
import numpy as np
import datetime
import pi... | [
"math.isnan",
"pandas.read_csv",
"numpy.std",
"os.path.dirname",
"sys.path.insert",
"utils.Insitution_Fuzzy_Mather",
"sklearn.metrics.roc_auc_score",
"collections.defaultdict",
"numpy.where",
"numpy.mean",
"scipy.stats.pointbiserialr",
"inspect.currentframe"
] | [((539, 566), 'os.path.dirname', 'os.path.dirname', (['currentdir'], {}), '(currentdir)\n', (554, 566), False, 'import os, sys, inspect\n'), ((567, 596), 'sys.path.insert', 'sys.path.insert', (['(0)', 'parentdir'], {}), '(0, parentdir)\n', (582, 596), False, 'import os, sys, inspect\n'), ((805, 852), 'pandas.read_csv',... |
import datetime
import re
import sys
import time
from collections import defaultdict
import click
import yaml
from slackclient import SlackClient
VERSION = (1, 1, 0)
__version__ = '1.1.0'
class Responder(object):
def __init__(self, config):
self.config = config
self.client = SlackClient(config[... | [
"re.finditer",
"slackclient.SlackClient",
"click.File",
"click.command",
"collections.defaultdict",
"time.sleep",
"datetime.datetime.utcnow",
"time.time",
"yaml.safe_load",
"sys.exit",
"re.compile"
] | [((4006, 4021), 'click.command', 'click.command', ([], {}), '()\n', (4019, 4021), False, 'import click\n'), ((4476, 4498), 'yaml.safe_load', 'yaml.safe_load', (['config'], {}), '(config)\n', (4490, 4498), False, 'import yaml\n'), ((301, 329), 'slackclient.SlackClient', 'SlackClient', (["config['token']"], {}), "(config... |
"""
Role reaction module.
There's tons of reaction-based role assignment bots out there, so it's
kinda pointless to try to reinvent the wheel here again; in this case,
however, we had the problem of having way too many roles to make a role
selection menu that was easy to navigate, so traditional implementations
weren'... | [
"discord.Colour",
"discord.ext.commands.command",
"ophelia.reactrole.dm_lock.DMLock",
"re.split",
"yaml.safe_dump",
"loguru.logger.warning",
"loguru.logger.trace",
"ophelia.utils.discord_utils.extract_role",
"discord.ext.commands.Cog.listener",
"ophelia.output.send_simple_embed",
"ophelia.utils.... | [((3030, 3053), 'discord.ext.commands.Cog.listener', 'commands.Cog.listener', ([], {}), '()\n', (3051, 3053), False, 'from discord.ext import commands\n'), ((3401, 3424), 'discord.ext.commands.Cog.listener', 'commands.Cog.listener', ([], {}), '()\n', (3422, 3424), False, 'from discord.ext import commands\n'), ((3836, 3... |
import nengo
import nengo.spa as spa
import numpy as np
digits = ['ONE', 'TWO', 'THREE', 'FOUR', 'FIVE', 'SIX', 'SEVEN', 'EIGHT', 'NINE']
D = 16
vocab = spa.Vocabulary(D)
model = nengo.Network()
with model:
model.config[nengo.Ensemble].neuron_type=nengo.Direct()
num1 = spa.State(D, vocab=vocab)
num2 = s... | [
"nengo.Direct",
"nengo.spa.State",
"nengo.LIF",
"numpy.hstack",
"nengo.spa.Vocabulary",
"nengo.Network",
"nengo.Connection",
"nengo.Ensemble"
] | [((156, 173), 'nengo.spa.Vocabulary', 'spa.Vocabulary', (['D'], {}), '(D)\n', (170, 173), True, 'import nengo.spa as spa\n'), ((183, 198), 'nengo.Network', 'nengo.Network', ([], {}), '()\n', (196, 198), False, 'import nengo\n'), ((256, 270), 'nengo.Direct', 'nengo.Direct', ([], {}), '()\n', (268, 270), False, 'import n... |
"""
==================
scatter(X, Y, ...)
==================
"""
import matplotlib.pyplot as plt
import numpy as np
plt.style.use('mpl_plot_gallery')
# make the data
np.random.seed(3)
X = 4 + np.random.normal(0, 2, 24)
Y = 4 + np.random.normal(0, 2, len(X))
# size and color:
S = np.random.uniform(15, 80, len(X))
# p... | [
"numpy.random.seed",
"matplotlib.pyplot.show",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.style.use",
"numpy.arange",
"numpy.random.normal",
"matplotlib.pyplot.subplots"
] | [((117, 150), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""mpl_plot_gallery"""'], {}), "('mpl_plot_gallery')\n", (130, 150), True, 'import matplotlib.pyplot as plt\n'), ((168, 185), 'numpy.random.seed', 'np.random.seed', (['(3)'], {}), '(3)\n', (182, 185), True, 'import numpy as np\n'), ((334, 348), 'matplotli... |
#Copyright (c) 2016, <NAME>
#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, this
# list of conditions and the following di... | [
"numpy.argmax",
"numpy.argmin",
"time.time",
"numpy.array",
"cv2.boundingRect"
] | [((1793, 1818), 'cv2.boundingRect', 'cv2.boundingRect', (['contour'], {}), '(contour)\n', (1809, 1818), False, 'import cv2\n'), ((1972, 1988), 'numpy.array', 'np.array', (['roiPts'], {}), '(roiPts)\n', (1980, 1988), True, 'import numpy as np\n'), ((2268, 2279), 'time.time', 'time.time', ([], {}), '()\n', (2277, 2279), ... |
import tensorflow as tf
import numpy as np
def lstm(rnn_size, keep_prob,reuse=False):
lstm_cell =tf.nn.rnn_cell.LSTMCell(rnn_size,reuse=reuse)
drop =tf.nn.rnn_cell.DropoutWrapper(lstm_cell, output_keep_prob=keep_prob)
return drop
def model_input():
input_data = tf.placeholder(tf.int32, [None, None],na... | [
"tensorflow.contrib.seq2seq.BahdanauAttention",
"tensorflow.nn.rnn_cell.LSTMStateTuple",
"tensorflow.clip_by_value",
"tensorflow.identity",
"tensorflow.nn.rnn_cell.DropoutWrapper",
"tensorflow.nn.rnn_cell.LSTMCell",
"tensorflow.nn.bidirectional_dynamic_rnn",
"tensorflow.contrib.seq2seq.BasicDecoder",
... | [((102, 148), 'tensorflow.nn.rnn_cell.LSTMCell', 'tf.nn.rnn_cell.LSTMCell', (['rnn_size'], {'reuse': 'reuse'}), '(rnn_size, reuse=reuse)\n', (125, 148), True, 'import tensorflow as tf\n'), ((158, 226), 'tensorflow.nn.rnn_cell.DropoutWrapper', 'tf.nn.rnn_cell.DropoutWrapper', (['lstm_cell'], {'output_keep_prob': 'keep_p... |
from mock import patch, Mock
from whoishistory import Requester
import unittest
import requests
import io
_user_agent = "test-user-agent"
def mocked_requests(*args, **kwargs):
class MockResponse(requests.Response):
def __init__(self, body, status_code):
super().__init__()
self.st... | [
"whoishistory.Requester",
"mock.patch"
] | [((710, 787), 'mock.patch', 'patch', (['"""whoishistory.requester.requests.request"""'], {'side_effect': 'mocked_requests'}), "('whoishistory.requester.requests.request', side_effect=mocked_requests)\n", (715, 787), False, 'from mock import patch, Mock\n'), ((1141, 1218), 'mock.patch', 'patch', (['"""whoishistory.reque... |
# Copyright 2012 Viewfinder Inc. All Rights Reserved.
# -*- coding: utf-8 -*-
__author__ = '<EMAIL> (<NAME>)'
import datetime
import logging
import mock
import time
from functools import partial
from tornado import options
from viewfinder.backend.base import otp, util
from viewfinder.backend.base.testing import asyn... | [
"mock.patch.object",
"viewfinder.backend.www.test.service_base_test.ClientLogRecord",
"time.time"
] | [((3433, 3484), 'mock.patch.object', 'mock.patch.object', (['client_log', '"""MAX_CLIENT_LOGS"""', '(1)'], {}), "(client_log, 'MAX_CLIENT_LOGS', 1)\n", (3450, 3484), False, 'import mock\n'), ((741, 752), 'time.time', 'time.time', ([], {}), '()\n', (750, 752), False, 'import time\n'), ((891, 949), 'viewfinder.backend.ww... |
from unittest.mock import MagicMock, patch
import kleat.misc.settings as S
from kleat.hexamer.xseq_plus import init_ctg_end, init_ref_end
"""
cc: ctg_clv; icb: init_clv_beg
rc: ref_clv; irb: init_ref_end
"""
def test_init_ends():
"""
AA
GT┘ <-bridge read
GACGGTTGC <-bri... | [
"kleat.hexamer.xseq_plus.init_ctg_end",
"kleat.hexamer.xseq_plus.init_ref_end"
] | [((611, 663), 'kleat.hexamer.xseq_plus.init_ref_end', 'init_ref_end', (['ref_clv', 'cigartuples', 'ctg_clv', 'ctg_seq'], {}), '(ref_clv, cigartuples, ctg_clv, ctg_seq)\n', (623, 663), False, 'from kleat.hexamer.xseq_plus import init_ctg_end, init_ref_end\n'), ((681, 702), 'kleat.hexamer.xseq_plus.init_ctg_end', 'init_c... |
#%%
import configparser
config = configparser.ConfigParser()
config.read('map_indicators.ini')
config.sections()
tables = config['Database']['tables'].split()
print(tables)
# %%
import configparser
def init(inifile : str) -> bool:
'''
check if everything is ok prior to entering the main loop
'''
c... | [
"datetime.datetime.today",
"prompt_toolkit.validation.Validator.from_callable",
"datetime.date.today",
"prompt_toolkit.prompt",
"platform.system",
"configparser.ConfigParser"
] | [((33, 60), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (58, 60), False, 'import configparser\n'), ((3950, 4055), 'prompt_toolkit.validation.Validator.from_callable', 'Validator.from_callable', (['is_ync'], {'error_message': '"""enter (y)es; (n)o, (c)ancel"""', 'move_cursor_to_end': '(Tr... |
# -*- coding: utf-8 -*-
"""
@author:XuMing(<EMAIL>)
@description: build torchtext dataset
"""
from pycorrector.deep_context.data_reader import PAD_TOKEN, UNK_TOKEN, SOS_TOKEN, EOS_TOKEN, read_vocab, save_word_dict, \
load_word_dict, one_hot, gen_examples
class Dataset(object):
def __init__(self,
... | [
"pycorrector.deep_context.data_reader.gen_examples",
"pycorrector.deep_context.data_reader.load_word_dict",
"pycorrector.deep_context.data_reader.one_hot",
"pycorrector.deep_context.data_reader.read_vocab",
"pycorrector.deep_context.data_reader.save_word_dict"
] | [((1162, 1203), 'pycorrector.deep_context.data_reader.read_vocab', 'read_vocab', (['sentences'], {'min_count': 'min_freq'}), '(sentences, min_count=min_freq)\n', (1172, 1203), False, 'from pycorrector.deep_context.data_reader import PAD_TOKEN, UNK_TOKEN, SOS_TOKEN, EOS_TOKEN, read_vocab, save_word_dict, load_word_dict,... |
# coding: utf-8
# In[1]:
import requests
import bs4
l=input("enter website name : ")
res=requests.get(l)
res.text
soup = bs4.BeautifulSoup(res.text,'lxml')
one=soup.select('title')
one[0].getText()
| [
"bs4.BeautifulSoup",
"requests.get"
] | [((94, 109), 'requests.get', 'requests.get', (['l'], {}), '(l)\n', (106, 109), False, 'import requests\n'), ((126, 161), 'bs4.BeautifulSoup', 'bs4.BeautifulSoup', (['res.text', '"""lxml"""'], {}), "(res.text, 'lxml')\n", (143, 161), False, 'import bs4\n')] |
import json
from flask import Flask, Response, request
from redis import Redis
app = Flask(__name__)
r = Redis(host='redis')
@app.route('/')
def index():
return f'''
<p>Speed: {int(speed) if (speed := r.get("speed")) else 0}</p>
<p>Distance: {int(distance) if (distance := r.get("distance")) else 0}</p>
... | [
"redis.Redis",
"flask.request.data.decode",
"flask.Flask",
"flask.Response"
] | [((87, 102), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (92, 102), False, 'from flask import Flask, Response, request\n'), ((107, 126), 'redis.Redis', 'Redis', ([], {'host': '"""redis"""'}), "(host='redis')\n", (112, 126), False, 'from redis import Redis\n'), ((647, 667), 'flask.Response', 'Response', ... |
#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()
# create a new 'Sphere'
sphere1 = Sphere()
# get active view
renderView1 = GetActiveViewOrCreate('RenderView')
# uncomment following to set a spe... | [
"os.getcwd",
"os.path.dirname"
] | [((2271, 2282), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (2280, 2282), False, 'import os\n'), ((2343, 2371), 'os.path.dirname', 'os.path.dirname', (['pngFileName'], {}), '(pngFileName)\n', (2358, 2371), False, 'import os\n'), ((2390, 2418), 'os.path.dirname', 'os.path.dirname', (['pngFileName'], {}), '(pngFileName)\... |
"""
modifications:
change from in import of fetch_env
changed distance_threshold from 0.05 to 0.001
"""
import os
from gym import utils
from CustomGymEnvs.envs.fetchreach.FetchReachBroken import fetch_env # modification here
# Ensure we get the path separator correct on windows
MODEL_XML_PATH = os.path.join('fetch',... | [
"CustomGymEnvs.envs.fetchreach.FetchReachBroken.fetch_env.FetchEnv.__init__",
"os.path.join",
"gym.utils.EzPickle.__init__"
] | [((299, 333), 'os.path.join', 'os.path.join', (['"""fetch"""', '"""reach.xml"""'], {}), "('fetch', 'reach.xml')\n", (311, 333), False, 'import os\n'), ((587, 889), 'CustomGymEnvs.envs.fetchreach.FetchReachBroken.fetch_env.FetchEnv.__init__', 'fetch_env.FetchEnv.__init__', (['self', 'MODEL_XML_PATH'], {'has_object': '(F... |
# coding: utf-8
"""
Camunda BPM REST API
OpenApi Spec for Camunda BPM REST API. # noqa: E501
The version of the OpenAPI document: 7.13.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from openapi_client.configuration import Configuration
clas... | [
"openapi_client.configuration.Configuration",
"six.iteritems"
] | [((5958, 5991), 'six.iteritems', 'six.iteritems', (['self.openapi_types'], {}), '(self.openapi_types)\n', (5971, 5991), False, 'import six\n'), ((1525, 1540), 'openapi_client.configuration.Configuration', 'Configuration', ([], {}), '()\n', (1538, 1540), False, 'from openapi_client.configuration import Configuration\n')... |
import cv2
import os
import numpy as np
import json
import glob
import datetime
from pathlib import Path
class CocoDatasetMaker:
def __init__(self, dataset_dir, img_index_offset=0, label_index_offset=0, output_dir="dataset_output"):
self.coco = {
"info": {
"year": 2020,
... | [
"json.dump",
"cv2.contourArea",
"json.load",
"os.mkdir",
"os.path.basename",
"cv2.cvtColor",
"os.path.isdir",
"cv2.approxPolyDP",
"cv2.arcLength",
"datetime.datetime.now",
"cv2.imread",
"pathlib.Path",
"numpy.array",
"glob.glob",
"cv2.drawContours",
"cv2.boundingRect",
"os.path.join"... | [((2126, 2161), 'glob.glob', 'glob.glob', (['f"""{self.dataset_dir}/*/"""'], {}), "(f'{self.dataset_dir}/*/')\n", (2135, 2161), False, 'import glob\n'), ((2243, 2293), 'os.path.join', 'os.path.join', (['self.output_dir', '"""img_with_contours"""'], {}), "(self.output_dir, 'img_with_contours')\n", (2255, 2293), False, '... |
import time
import webbrowser
from dataclasses import dataclass
from json import dump, load
from pathlib import Path
from typing import Any, Dict, Optional
from auth0.v3.authentication import GetToken
from requests.exceptions import HTTPError
from contxt.services.api import Api
from ..services.auth import AuthServic... | [
"json.dump",
"webbrowser.open",
"json.load",
"pathlib.Path.home",
"auth0.v3.authentication.GetToken",
"time.sleep"
] | [((3671, 3720), 'auth0.v3.authentication.GetToken', 'GetToken', (['environments[env].auth0_tenant_base_url'], {}), '(environments[env].auth0_tenant_base_url)\n', (3679, 3720), False, 'from auth0.v3.authentication import GetToken\n'), ((6563, 6613), 'webbrowser.open', 'webbrowser.open', (["code['verification_uri_complet... |
"""
Script to parse and call AvsB sections of valid ab_syn_finder.py run.
"""
import scipy.stats as stats
def ab_call(in_file):
region_call_tally = {}
f = open(in_file)
bed_genes = f.read().rstrip("\n").split("\n")
f.close()
for bed_gene in bed_genes:
id, call, gene = bed_gene.split("\t")
... | [
"scipy.stats.chisquare",
"argparse.ArgumentParser"
] | [((6875, 7179), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""\n takes syn_block output from ab_synfinder.py and calls A vs B for each region. If regions fall outside of cutoffs for\n regions output ambig is designated. If this occurs at the chrom/contig level, ambiguous calls can... |
import unittest
import optimize
import complexity
import typedefs
class Tests(unittest.TestCase):
def lmr1(self):
lmr = typedefs.lmr_factory(
nservers=100,
nrows=100,
ncols=100,
nvectors=100,
ndroplets=200,
wait_for=80,
st... | [
"typedefs.lmr_factory",
"optimize.set_wait_for"
] | [((134, 280), 'typedefs.lmr_factory', 'typedefs.lmr_factory', ([], {'nservers': '(100)', 'nrows': '(100)', 'ncols': '(100)', 'nvectors': '(100)', 'ndroplets': '(200)', 'wait_for': '(80)', 'straggling_factor': '(1)', 'decodingf': '(lambda x: 0)'}), '(nservers=100, nrows=100, ncols=100, nvectors=100,\n ndroplets=200, ... |
#from settings import APPS, APP_STAGES
from fabric_common.common.deploy import Deployable
from operations.core.db import Operations
from fabric_common.core.logging import logi, log
"""
# mysql
```
mysql -u root -p
CREATE USER 'prestashopdeploy'@'localhost' IDENTIFIED BY '<PASSWORD>';
GRANT ALL PRIVILEGES ON prestasho... | [
"operations.core.db.Operations",
"fabric_common.common.deploy.Deployable.__init__"
] | [((711, 723), 'operations.core.db.Operations', 'Operations', ([], {}), '()\n', (721, 723), False, 'from operations.core.db import Operations\n'), ((1462, 1564), 'fabric_common.common.deploy.Deployable.__init__', 'Deployable.__init__', (['self'], {'cluster': 'cluster', 'stage': 'stage', 'app_name': 'APPLICATION_NAME', '... |
#!/usr/bin/python
# coding=utf-8
from cmd.base.Cmd import Cmd
from script.util.Printer import Printer
class dump(Cmd):
_INIT_WORK_DIR: bool = False
_RESTORE_WORK_DIR: bool = False
_HELP_MESSAGE = (
'dump configures',
)
def on_run(self, *params) -> bool:
Printer.yellow_line('====... | [
"script.util.Printer.Printer.blue_line",
"script.util.Printer.Printer.green_line",
"script.util.Printer.Printer.yellow_line"
] | [((295, 336), 'script.util.Printer.Printer.yellow_line', 'Printer.yellow_line', (['"""======> dump begin"""'], {}), "('======> dump begin')\n", (314, 336), False, 'from script.util.Printer import Printer\n'), ((345, 368), 'script.util.Printer.Printer.blue_line', 'Printer.blue_line', (['"""EC"""'], {}), "('EC')\n", (362... |
from collections import defaultdict
from urllib import parse
from urllib.parse import urlencode, urlunparse
class URL:
BASE_PATH = "/"
def __init__(self, **components):
self._scheme = None
self._host = None
self._port = None
self._path = None
self._params = None
... | [
"collections.defaultdict",
"urllib.parse.urlencode"
] | [((3209, 3262), 'urllib.parse.urlencode', 'urlencode', ([], {'query': 'query', 'doseq': 'doseq', 'encoding': '"""utf-8"""'}), "(query=query, doseq=doseq, encoding='utf-8')\n", (3218, 3262), False, 'from urllib.parse import urlencode, urlunparse\n'), ((768, 784), 'collections.defaultdict', 'defaultdict', (['set'], {}), ... |
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 7 09:31:55 2017
@author: matthew.goodwin
"""
import datetime
import sqlite3
import pandas as pd
import numpy as np
import os
import xlwt
sqlite_file="reservations.db"
# Set path for output based on relative path and location of script
FileDir = os.path.dirname(__file... | [
"xlwt.Workbook",
"os.makedirs",
"os.path.dirname",
"os.path.exists",
"datetime.datetime.now",
"datetime.datetime",
"numpy.timedelta64",
"sqlite3.connect",
"pandas.to_datetime",
"pandas.read_sql_query",
"datetime.timedelta",
"os.path.join"
] | [((298, 323), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (313, 323), False, 'import os\n'), ((349, 380), 'os.path.join', 'os.path.join', (['FileDir', '"""output"""'], {}), "(FileDir, 'output')\n", (361, 380), False, 'import os\n'), ((1352, 1380), 'sqlite3.connect', 'sqlite3.connect', (['s... |
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright SAS Institute
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | [
"swat.CAS",
"swat.reset_option",
"swat.utils.testing.get_user_pass",
"swat.utils.testing.load_data",
"swat.utils.testing.get_cas_host_type",
"swat.utils.testing.get_host_port_proto",
"swat.utils.testing.get_casout_lib",
"swat.utils.testing.runtests"
] | [((1070, 1088), 'swat.utils.testing.get_user_pass', 'tm.get_user_pass', ([], {}), '()\n', (1086, 1088), True, 'import swat.utils.testing as tm\n'), ((1112, 1136), 'swat.utils.testing.get_host_port_proto', 'tm.get_host_port_proto', ([], {}), '()\n', (1134, 1136), True, 'import swat.utils.testing as tm\n'), ((3458, 3468)... |
"""
gF
Generates exemplar-shape pairs.
"""
from pathlib import Path
import click as click
import collections
import numpy as np
import sqlalchemy as sa
import torch
from torch.utils.data import DataLoader
from torch.utils.data.dataset import Dataset
from torch.utils.data.sampler import SequentialSampler
from tqdm impo... | [
"tqdm.tqdm.write",
"tqdm.tqdm",
"terial.models.Exemplar.id.asc",
"terial.models.Shape.id.asc",
"torch.from_numpy",
"sqlalchemy.and_",
"click.option",
"torch.utils.data.sampler.SequentialSampler",
"click.command",
"collections.defaultdict",
"pathlib.Path",
"torch.min",
"terial.database.sessio... | [((461, 476), 'click.command', 'click.command', ([], {}), '()\n', (474, 476), True, 'import click as click\n'), ((478, 519), 'click.option', 'click.option', (['"""--batch-size"""'], {'default': '(400)'}), "('--batch-size', default=400)\n", (490, 519), True, 'import click as click\n'), ((521, 561), 'click.option', 'clic... |
import time, os # Time for the delay, os to center the text
wait = 0.1 # Delay between each line
width = os.get_terminal_size().columns # Width of the console
# Clear the screen
def clear():
os.system("cls" if os.name == "nt" else "clear")
# Intro
def intro():
print(r""" _ _ _ ... | [
"os.get_terminal_size",
"os.system",
"time.sleep"
] | [((106, 128), 'os.get_terminal_size', 'os.get_terminal_size', ([], {}), '()\n', (126, 128), False, 'import time, os\n'), ((197, 245), 'os.system', 'os.system', (["('cls' if os.name == 'nt' else 'clear')"], {}), "('cls' if os.name == 'nt' else 'clear')\n", (206, 245), False, 'import time, os\n'), ((417, 433), 'time.slee... |
from cohortextractor import StudyDefinition, Measure, patients
from codelists import *
study = StudyDefinition(
index_date="2021-05-01",
# Configure the expectations framework
default_expectations={
"date": {"earliest": "2020-01-01", "latest": "today"},
"rate": "exponential_increase",
... | [
"cohortextractor.patients.registered_as_of",
"cohortextractor.patients.died_from_any_cause",
"cohortextractor.Measure",
"cohortextractor.patients.age_as_of",
"cohortextractor.patients.with_these_medications",
"cohortextractor.patients.with_these_clinical_events"
] | [((2085, 2213), 'cohortextractor.Measure', 'Measure', ([], {'id': '"""monitoring_mechanical_valve_rate"""', 'numerator': '"""self_monitoring"""', 'denominator': '"""population"""', 'group_by': '"""population"""'}), "(id='monitoring_mechanical_valve_rate', numerator='self_monitoring',\n denominator='population', grou... |
from winsandbox.utils.path import shared_folder_path_in_sandbox, WINDOWS_SANDBOX_DEFAULT_DESKTOP
def test_shared_folder_path_in_sandbox():
assert shared_folder_path_in_sandbox(r"C:\test.txt") == WINDOWS_SANDBOX_DEFAULT_DESKTOP / "test.txt"
assert shared_folder_path_in_sandbox(r"D:\test.txt") == WINDOWS_SANDBO... | [
"winsandbox.utils.path.shared_folder_path_in_sandbox"
] | [((152, 197), 'winsandbox.utils.path.shared_folder_path_in_sandbox', 'shared_folder_path_in_sandbox', (['"""C:\\\\test.txt"""'], {}), "('C:\\\\test.txt')\n", (181, 197), False, 'from winsandbox.utils.path import shared_folder_path_in_sandbox, WINDOWS_SANDBOX_DEFAULT_DESKTOP\n'), ((257, 302), 'winsandbox.utils.path.shar... |
from random import randint, choice
from .utils import Empty, Dirty, Corral, Obstacle, Children, Robot_Piece
from .utils import Up, Down, Left, Right, Stay, dx, dy, dx_complete, dy_complete
from .child import Child
from .robot import Robot
class Environment:
def __init__(self, rows, columns, n_childs, dirty, ob... | [
"random.choice",
"random.randint"
] | [((6274, 6293), 'random.randint', 'randint', (['(0)', 'max_row'], {}), '(0, max_row)\n', (6281, 6293), False, 'from random import randint, choice\n'), ((6310, 6332), 'random.randint', 'randint', (['(0)', 'max_column'], {}), '(0, max_column)\n', (6317, 6332), False, 'from random import randint, choice\n'), ((10206, 1022... |
from __future__ import absolute_import, unicode_literals
import socket
import sys
import types
from kombu import syn
from kombu.five import bytes_if_py2
from kombu.tests.case import Case, mock, patch
class test_syn(Case):
def test_compat(self):
self.assertEqual(syn.blocking(lambda: 10), 10)
sy... | [
"kombu.syn.blocking",
"kombu.tests.case.mock.module_exists",
"kombu.five.bytes_if_py2",
"kombu.syn.detect_environment",
"kombu.tests.case.patch",
"kombu.syn.select_blocking_method",
"sys.modules.pop",
"kombu.syn._detect_environment"
] | [((667, 717), 'kombu.tests.case.mock.module_exists', 'mock.module_exists', (['"""eventlet"""', '"""eventlet.patcher"""'], {}), "('eventlet', 'eventlet.patcher')\n", (685, 717), False, 'from kombu.tests.case import Case, mock, patch\n'), ((1066, 1094), 'kombu.tests.case.mock.module_exists', 'mock.module_exists', (['"""g... |
# 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.
from models.refresh_token import RefreshTokenModel
rtm = RefreshTokenModel()
rtm.removeTokensOlderThanMonth()
| [
"models.refresh_token.RefreshTokenModel"
] | [((235, 254), 'models.refresh_token.RefreshTokenModel', 'RefreshTokenModel', ([], {}), '()\n', (252, 254), False, 'from models.refresh_token import RefreshTokenModel\n')] |
import os
import random
size_kb=[]
for x in range(60):
size_kb.append(random.randint(1024,5*1024))
print(sum(size_kb)/1024)
for x in range(100):
size_kb.append(random.randint(50,150))
print(sum(size_kb)/1024)
for x in range(570):
size_kb.append(random.randint(150,1024))
print(sum(size_kb)/1024)
random.shu... | [
"random.shuffle",
"os.urandom",
"random.randint"
] | [((310, 333), 'random.shuffle', 'random.shuffle', (['size_kb'], {}), '(size_kb)\n', (324, 333), False, 'import random\n'), ((75, 105), 'random.randint', 'random.randint', (['(1024)', '(5 * 1024)'], {}), '(1024, 5 * 1024)\n', (89, 105), False, 'import random\n'), ((169, 192), 'random.randint', 'random.randint', (['(50)'... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
"paddle.fluid.initializer.Uniform",
"math.sqrt",
"paddle.fluid.initializer.XavierInitializer",
"paddle.fluid.dygraph.LayerNorm",
"paddle.fluid.layers.transpose",
"paddle.fluid.layers.dropout"
] | [((1664, 1685), 'math.sqrt', 'math.sqrt', (['(1.0 / d_in)'], {}), '(1.0 / d_in)\n', (1673, 1685), False, 'import math\n'), ((2110, 2137), 'math.sqrt', 'math.sqrt', (['(1.0 / num_hidden)'], {}), '(1.0 / num_hidden)\n', (2119, 2137), False, 'import math\n'), ((2576, 2594), 'paddle.fluid.dygraph.LayerNorm', 'dg.LayerNorm'... |
from __future__ import absolute_import
import unittest, os, sys, re, shutil, time
import forcebalance
from __init__ import ForceBalanceTestRunner
import getopt
import argparse
def getOptions():
"""Parse options passed to forcebalance testing framework"""
# set some defaults
options = {
'loglevel' :... | [
"os.mkdir",
"__init__.ForceBalanceTestRunner",
"argparse.ArgumentParser",
"smtplib.SMTP",
"email.mime.text.MIMEText",
"os.path.dirname",
"os.path.exists",
"sys.exit",
"time.strftime",
"forcebalance.output.RawStreamHandler",
"forcebalance.output.getLogger",
"email.mime.multipart.MIMEMultipart",... | [((5847, 5857), 'sys.exit', 'sys.exit', ([], {}), '()\n', (5855, 5857), False, 'import unittest, os, sys, re, shutil, time\n'), ((416, 441), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (439, 441), False, 'import argparse\n'), ((2453, 2524), 'forcebalance.output.CleanFileHandler', 'forcebalan... |
#!/usr/bin/env python
#coding=utf-8
#-------------------------------------------------------------------------------
# immcli.py
#
# Image Module Maker Command Line Interface
#
# Create a Python module of embedded images from a directory of image files.
#_________________________________________________________________... | [
"platform.python_version",
"pprint.pformat",
"imm.cli.commandline.parseCmdLine",
"imm.cli.utils.FormatArgsNamespace",
"imm.cli.codegenerator.CodeGen",
"os.path.isfile",
"imm.cli.loggingsetup.Setup",
"imm.cli.constants.HELP_TOPICS.keys",
"imm.cli.pager.page",
"os.path.join",
"imm.imagedata.make_s... | [((9547, 9590), 're.compile', 're.compile', (['"""^[^\\\\d\\\\W]\\\\w*\\\\Z"""', 're.UNICODE'], {}), "('^[^\\\\d\\\\W]\\\\w*\\\\Z', re.UNICODE)\n", (9557, 9590), False, 'import re\n'), ((9788, 9816), 'imm.cli.loggingsetup.Setup', 'loggingsetup.Setup', (['C.LOGGER'], {}), '(C.LOGGER)\n', (9806, 9816), False, 'from imm.c... |
import logging
from . import ttnd_manager as manager
logger = logging.Logger('connectivity.manager')
class ConnectivityException(Exception):
"""
General connectivity exception
"""
pass
class ConnectivityWrongArgsException(ConnectivityException):
"""
Wrong arguments
"""
pass
clas... | [
"logging.Logger"
] | [((63, 101), 'logging.Logger', 'logging.Logger', (['"""connectivity.manager"""'], {}), "('connectivity.manager')\n", (77, 101), False, 'import logging\n')] |
import unittest
from getnet.services.plans.plan_response import PlanResponse
from getnet.services.subscriptions.credit import Credit
from getnet.services.subscriptions.customer import Customer
from getnet.services.subscriptions.subscription import Subscription
from tests.getnet.services.customers.test_customer import ... | [
"unittest.main",
"getnet.services.subscriptions.customer.Customer",
"getnet.services.subscriptions.subscription.Subscription",
"getnet.services.plans.plan_response.PlanResponse",
"getnet.services.subscriptions.credit.Credit"
] | [((2319, 2334), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2332, 2334), False, 'import unittest\n'), ((1627, 1654), 'getnet.services.subscriptions.customer.Customer', 'Customer', ([], {}), '(**customer_sample)\n', (1635, 1654), False, 'from getnet.services.subscriptions.customer import Customer\n'), ((1675, 1... |
"""
Logic for evaluation procedure of saved model.
"""
import tensorflow as tf
import tensorflowjs as tfjs
import tensorflow_datasets as tfds
from densenet import densenet_model
from src.datasets import load
from sklearn.metrics import classification_report, accuracy_score
from src.engines.steps import steps
from src.... | [
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"src.datasets.load",
"src.utils.weighted_loss.weightedLoss",
"tensorflow.keras.metrics.Mean",
"tensorflow.keras.optimizers.Adam",
"densenet.densenet_model",
"src.engines.steps.steps",
"tensorflow.keras.metrics.SparseCategoricalAccuracy"
] | [((526, 758), 'src.datasets.load', 'load', ([], {'dataset_name': "config['data.dataset']", 'batch_size': "config['data.batch_size']", 'train_size': "config['data.train_size']", 'test_size': "config['data.test_size']", 'weight_classes': "config['data.weight_classes']", 'datagen_flow': '(True)'}), "(dataset_name=config['... |
# Copyright 2015 NEC Corporation
# 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 b... | [
"neutronclient.neutron.v2_0.update_dict",
"neutron_taas._i18n._",
"neutronclient.neutron.v2_0.find_resourceid_by_name_or_id"
] | [((1038, 1104), 'neutronclient.neutron.v2_0.update_dict', 'neutronv20.update_dict', (['parsed_args', 'body', "['name', 'description']"], {}), "(parsed_args, body, ['name', 'description'])\n", (1060, 1104), True, 'from neutronclient.neutron import v2_0 as neutronv20\n'), ((852, 882), 'neutron_taas._i18n._', '_', (['"""N... |
import ast
import dataclasses
import json
import re
import sys
import typing
from sbdata.repo import find_item_by_name, Item
from sbdata.task import register_task, Arguments
from sbdata.wiki import get_wiki_sources_by_title
@dataclasses.dataclass
class DungeonDrop:
item: Item
floor: int
chest: str
co... | [
"sbdata.repo.find_item_by_name",
"sbdata.task.register_task",
"sbdata.wiki.get_wiki_sources_by_title"
] | [((956, 991), 'sbdata.task.register_task', 'register_task', (['"""Fetch Dungeon Loot"""'], {}), "('Fetch Dungeon Loot')\n", (969, 991), False, 'from sbdata.task import register_task, Arguments\n'), ((1077, 1206), 'sbdata.wiki.get_wiki_sources_by_title', 'get_wiki_sources_by_title', (["*[f'Template:Catacombs Floor {f} L... |
import torch
import torch.nn as nn
# from mmdet.core import bbox2result, bbox2roi, build_assigner, build_sampler
from ..builder import DETECTORS, build_backbone, build_head, build_neck
from .base import BaseDetector
from ..utils import Scale
import numpy as np
@DETECTORS.register_module()
class TwoStageDetector(Base... | [
"torch.cat",
"torch.randn",
"torch.cuda.empty_cache"
] | [((11025, 11049), 'torch.cuda.empty_cache', 'torch.cuda.empty_cache', ([], {}), '()\n', (11047, 11049), False, 'import torch\n'), ((4581, 4601), 'torch.randn', 'torch.randn', (['(1000)', '(4)'], {}), '(1000, 4)\n', (4592, 4601), False, 'import torch\n'), ((6137, 6196), 'torch.cat', 'torch.cat', (['[img[0::2, ...], sub_... |
from struct import pack as s_pack, Struct
from py61850.utils.numbers import U48
from py61850.utils.errors import raise_type
class Ethernet:
@staticmethod
def enet_itoe(integer, max_range=0xFFFF):
# integer to ether type
if isinstance(integer, int):
if 0 <= integer <= max_range:
... | [
"struct.Struct",
"struct.pack"
] | [((341, 362), 'struct.pack', 's_pack', (['"""!H"""', 'integer'], {}), "('!H', integer)\n", (347, 362), True, 'from struct import pack as s_pack, Struct\n'), ((3369, 3390), 'struct.pack', 's_pack', (['"""!Q"""', 'integer'], {}), "('!Q', integer)\n", (3375, 3390), True, 'from struct import pack as s_pack, Struct\n'), ((3... |
from idautils import *
from idaapi import *
import idc
import os
import json
import binascii
import mmap
import time
import ida_hexrays as hexray
#
#
# This is an interface with ida it receives the parameters by ARGV it answers with the communication protocol
# using mmap. Morevoer, when specified it dumps the dat... | [
"json.dump",
"os.open",
"json.loads",
"binascii.hexlify",
"json.dumps",
"ida_hexrays.get_ctype_name",
"idc.get_operand_value",
"os.close",
"idc.Exit",
"idc.RunPlugin",
"idc.print_insn_mnem",
"mmap.mmap",
"ida_hexrays.decompile",
"idc.get_func_name"
] | [((9420, 9431), 'idc.Exit', 'idc.Exit', (['(0)'], {}), '(0)\n', (9428, 9431), False, 'import idc\n'), ((1472, 1484), 'os.close', 'os.close', (['fd'], {}), '(fd)\n', (1480, 1484), False, 'import os\n'), ((6841, 6867), 'idc.get_func_name', 'idc.get_func_name', (['address'], {}), '(address)\n', (6858, 6867), False, 'impor... |
"""Command for looking up an ESI issue."""
import re
from esi_bot import command
from esi_bot import do_request
@command(trigger=re.compile(r"^#?(?P<gh_issue>[0-9]+)$"))
def issue(match, msg):
"""Look up ESI-issue details on GitHub."""
code, details = do_request(
"https://api.github.com/repos/esi/e... | [
"re.compile"
] | [((133, 171), 're.compile', 're.compile', (['"""^#?(?P<gh_issue>[0-9]+)$"""'], {}), "('^#?(?P<gh_issue>[0-9]+)$')\n", (143, 171), False, 'import re\n')] |
import uuid
from django.db import models
from django.db.models.signals import pre_save
from django.dispatch import receiver
from core.models import IngestableModel
from core import model_utils
class Zone123bis(models.TextChoices):
Zone1 = "1", "01"
Zone2 = "2", "02"
Zone3 = "3", "03"
Zone1bis = "1bi... | [
"django.db.models.TextField",
"core.model_utils.get_field_key",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.DateTimeField",
"django.dispatch.receiver",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.IntegerField",
"django.db.mode... | [((8880, 8916), 'django.dispatch.receiver', 'receiver', (['pre_save'], {'sender': 'Programme'}), '(pre_save, sender=Programme)\n', (8888, 8916), False, 'from django.dispatch import receiver\n'), ((3448, 3482), 'django.db.models.AutoField', 'models.AutoField', ([], {'primary_key': '(True)'}), '(primary_key=True)\n', (34... |
import discord
from discord.ext import tasks, commands
import sqlite3
import time
from embedFactory import embedFactory
from events import eventObj
class waitloop(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.conn = sqlite3.connect('schedulerData.db')
self.cursor = self.conn.... | [
"time.time",
"discord.ext.tasks.loop",
"sqlite3.connect",
"events.eventObj"
] | [((423, 446), 'discord.ext.tasks.loop', 'tasks.loop', ([], {'seconds': '(9.0)'}), '(seconds=9.0)\n', (433, 446), False, 'from discord.ext import tasks, commands\n'), ((252, 287), 'sqlite3.connect', 'sqlite3.connect', (['"""schedulerData.db"""'], {}), "('schedulerData.db')\n", (267, 287), False, 'import sqlite3\n'), ((8... |
import streamlit as st
from src.blockchain_utils.credentials import get_client, get_account_credentials, get_indexer
from src.services.game_engine_service import GameEngineService
from playsound import playsound
import algosdk
import sys
import glob
import serial
import time
import serial.tools.list_ports
# methods t... | [
"streamlit.balloons",
"playsound.playsound",
"src.blockchain_utils.credentials.get_client",
"streamlit.title",
"serial.Serial",
"serial.tools.list_ports.comports",
"streamlit.session_state.game_engine.win_money_refund",
"streamlit.button",
"streamlit.session_state.local_log.append",
"streamlit.err... | [((349, 361), 'src.blockchain_utils.credentials.get_client', 'get_client', ([], {}), '()\n', (359, 361), False, 'from src.blockchain_utils.credentials import get_client, get_account_credentials, get_indexer\n'), ((372, 385), 'src.blockchain_utils.credentials.get_indexer', 'get_indexer', ([], {}), '()\n', (383, 385), Fa... |
"""test logging"""
from neutro.src.util import loggerutil
def test_logger():
loggerutil.debug("test_logging_debug")
loggerutil.info("test_logging_info")
loggerutil.warning("test_logging_warning")
loggerutil.error("test_logging_error")
| [
"neutro.src.util.loggerutil.debug",
"neutro.src.util.loggerutil.info",
"neutro.src.util.loggerutil.error",
"neutro.src.util.loggerutil.warning"
] | [((83, 121), 'neutro.src.util.loggerutil.debug', 'loggerutil.debug', (['"""test_logging_debug"""'], {}), "('test_logging_debug')\n", (99, 121), False, 'from neutro.src.util import loggerutil\n'), ((126, 162), 'neutro.src.util.loggerutil.info', 'loggerutil.info', (['"""test_logging_info"""'], {}), "('test_logging_info')... |
import unittest
from tests.lib.client import get_client
from tests.lib.funding_sources import FundingSources
from tests.lib.ach_response_model import verify_ach_response_model
from marqeta.errors import MarqetaError
class TestFundingSourcesAchCreate(unittest.TestCase):
"""Tests for the funding_sources.ach.create... | [
"tests.lib.client.get_client",
"tests.lib.ach_response_model.verify_ach_response_model",
"tests.lib.funding_sources.FundingSources.get_ach_model"
] | [((447, 459), 'tests.lib.client.get_client', 'get_client', ([], {}), '()\n', (457, 459), False, 'from tests.lib.client import get_client\n'), ((556, 586), 'tests.lib.funding_sources.FundingSources.get_ach_model', 'FundingSources.get_ach_model', ([], {}), '()\n', (584, 586), False, 'from tests.lib.funding_sources import... |
import sys
def is_even(n):
if (n % 2) == 0:
return True
else:
return False
def is_odd(n):
if is_even(n):
return False
else:
return True
def test(did_pass):
""" Print the result of a test. """
linenum = sys._getframe(1).f_lineno # Get the caller's line... | [
"sys._getframe"
] | [((269, 285), 'sys._getframe', 'sys._getframe', (['(1)'], {}), '(1)\n', (282, 285), False, 'import sys\n')] |
import random
names = []
first_names = [
'Taylor',
'Anna',
'Carla',
'Frankie',
'Roxanne',
'Tess',
'Cat',
'Michel',
'Mel',
'Allison',
'Sadie',
'Sam',
'Alex',
'Lexi'
]
last_names = [
'Love',
'Lou',
'Oslo',
'York',
'Boss',
'Kong',
'Ru... | [
"random.choice"
] | [((417, 443), 'random.choice', 'random.choice', (['first_names'], {}), '(first_names)\n', (430, 443), False, 'import random\n'), ((459, 484), 'random.choice', 'random.choice', (['last_names'], {}), '(last_names)\n', (472, 484), False, 'import random\n')] |
import csv
import os
import random
import time
import nltk
from sklearn.naive_bayes import BernoulliNB
from sklearn.svm import LinearSVC
from sklearn.tree import DecisionTreeClassifier
fold = 10
n = 1000
cv_accuracies = []
cv_times = []
with open(os.path.join(os.path.dirname(__file__), 'tweets_corpus/4095-pair-data... | [
"csv.reader",
"random.shuffle",
"os.path.dirname",
"nltk.classify.accuracy",
"sklearn.tree.DecisionTreeClassifier",
"time.time"
] | [((383, 434), 'csv.reader', 'csv.reader', (['csv_input'], {'delimiter': '""","""', 'quotechar': '"""\\""""'}), '(csv_input, delimiter=\',\', quotechar=\'"\')\n', (393, 434), False, 'import csv\n'), ((999, 1050), 'csv.reader', 'csv.reader', (['csv_input'], {'delimiter': '""","""', 'quotechar': '"""\\""""'}), '(csv_input... |
import pyodbc
import sys
sys.path.append(sys.path[0]+'/../..')
import printFunctions as pf
server = r'localhost\SQLEXPRESS'
database = 'WideWorldImporters'
connectionString = 'DRIVER={ODBC Driver 17 for SQL Server};SERVER='+server+';DATABASE='+database+';Trusted_Connection=yes;APP=Pluralsight Course;'
#Establish conn... | [
"sys.path.append",
"printFunctions.printResultsInfo",
"printFunctions.printResults",
"pyodbc.connect"
] | [((25, 64), 'sys.path.append', 'sys.path.append', (["(sys.path[0] + '/../..')"], {}), "(sys.path[0] + '/../..')\n", (40, 64), False, 'import sys\n'), ((332, 364), 'pyodbc.connect', 'pyodbc.connect', (['connectionString'], {}), '(connectionString)\n', (346, 364), False, 'import pyodbc\n'), ((1041, 1068), 'printFunctions... |
import os
import re
from .settings.common import PROJECT_ROOT
#Limit of the number of recommendations that are returned
recommendations_limit = 10
arxiv_evaluation_file_path = os.path.join(PROJECT_ROOT, 'annomathtex', 'recommendation', 'evaluation_files', 'Evaluation_list_all.rtf')
wikipedia_evaluation_file_path = os.... | [
"os.getcwd",
"os.path.join",
"re.sub"
] | [((177, 287), 'os.path.join', 'os.path.join', (['PROJECT_ROOT', '"""annomathtex"""', '"""recommendation"""', '"""evaluation_files"""', '"""Evaluation_list_all.rtf"""'], {}), "(PROJECT_ROOT, 'annomathtex', 'recommendation',\n 'evaluation_files', 'Evaluation_list_all.rtf')\n", (189, 287), False, 'import os\n'), ((317,... |
import numpy as np
import pandas
import cv2
from PIL import Image
from Detected import Image_Processor
import os
import re
class Data_Processor(object):
def __init__(self,dirname,mask_model="pose2seg_release.pkl",
keypoints_model = "COCO-Keypoints/keypoint_rcnn_R_50_FPN_3x.yaml"):
self._... | [
"pandas.DataFrame",
"Detected.Image_Processor",
"re.match",
"cv2.imread",
"os.path.join",
"os.listdir"
] | [((363, 407), 'Detected.Image_Processor', 'Image_Processor', (['mask_model', 'keypoints_model'], {}), '(mask_model, keypoints_model)\n', (378, 407), False, 'from Detected import Image_Processor\n'), ((883, 910), 'os.path.join', 'os.path.join', (['self._dirname'], {}), '(self._dirname)\n', (895, 910), False, 'import os\... |
import tempfile
import os
import shutil
import unittest
import numpy as np
from deeprankcore.tools.pssm_3dcons_to_deeprank import pssm_3dcons_to_deeprank
from deeprankcore.tools.hdf5_to_csv import hdf5_to_csv
from deeprankcore.tools.CustomizeGraph import add_target
from deeprankcore.tools.embedding import manifold_embe... | [
"unittest.main",
"os.remove",
"tempfile.mkstemp",
"deeprankcore.tools.CustomizeGraph.add_target",
"deeprankcore.tools.hdf5_to_csv.hdf5_to_csv",
"deeprankcore.tools.pssm_3dcons_to_deeprank.pssm_3dcons_to_deeprank",
"os.close",
"deeprankcore.tools.embedding.manifold_embedding",
"numpy.random.rand",
... | [((1677, 1692), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1690, 1692), False, 'import unittest\n'), ((707, 746), 'deeprankcore.tools.pssm_3dcons_to_deeprank.pssm_3dcons_to_deeprank', 'pssm_3dcons_to_deeprank', (['self.pssm_path'], {}), '(self.pssm_path)\n', (730, 746), False, 'from deeprankcore.tools.pssm_3d... |
# -*- coding: utf-8 -*-
import functools
def catch_exceptions(job_func):
@functools.wraps(job_func)
def wrapper(*args, **kwargs):
try:
job_func(*args, **kwargs)
except:
import traceback
print(traceback.format_exc())
return wrapper
| [
"traceback.format_exc",
"functools.wraps"
] | [((81, 106), 'functools.wraps', 'functools.wraps', (['job_func'], {}), '(job_func)\n', (96, 106), False, 'import functools\n'), ((255, 277), 'traceback.format_exc', 'traceback.format_exc', ([], {}), '()\n', (275, 277), False, 'import traceback\n')] |
# Copyright 2014-2020 <NAME> <<EMAIL>>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | [
"labm8.py.test.Raises",
"labm8.py.pbutil.ToFile",
"labm8.py.lockfile.AutoLockFile",
"tempfile.TemporaryDirectory",
"labm8.py.test.Parametrize",
"labm8.py.test.Main",
"labm8.py.internal.lockfile_pb2.LockFile",
"pathlib.Path",
"inspect.currentframe",
"labm8.py.lockfile.LockFile",
"labm8.py.test.Fi... | [((851, 881), 'labm8.py.test.Fixture', 'test.Fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (863, 881), False, 'from labm8.py import test\n'), ((1166, 1196), 'labm8.py.test.Fixture', 'test.Fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (1178, 1196), False, 'from labm8.py impo... |
#!/usr/bin/env python3
import argparse
import serial
from time import sleep
parser = argparse.ArgumentParser()
parser.add_argument('--port', default='COM4')
parser.add_argument('--count', default=0)
args = parser.parse_args()
def send(msg, duration=0):
print(msg.replace('Button ', '').replace('HAT ', ''), end=' '... | [
"serial.Serial",
"argparse.ArgumentParser",
"time.sleep"
] | [((86, 111), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (109, 111), False, 'import argparse\n'), ((2279, 2309), 'serial.Serial', 'serial.Serial', (['args.port', '(9600)'], {}), '(args.port, 9600)\n', (2292, 2309), False, 'import serial\n'), ((382, 397), 'time.sleep', 'sleep', (['duration'],... |
import random
from words import category, other_list_of_words, movies_list, flowers_list
# Getting Random Value(Word) From File(dist.py) and Converting(Returning) into Upper Format
def get_random_world():
print("Please select the category for your word:")
i = 1
for cat in category:
print(i,":",ca... | [
"random.choice"
] | [((420, 446), 'random.choice', 'random.choice', (['movies_list'], {}), '(movies_list)\n', (433, 446), False, 'import random\n'), ((494, 521), 'random.choice', 'random.choice', (['flowers_list'], {}), '(flowers_list)\n', (507, 521), False, 'import random\n'), ((547, 581), 'random.choice', 'random.choice', (['other_list_... |
#!/usr/bin/env python3
import fcntl
import os
import sys
import time
import subprocess
import random
import global_vars
import bam_processing
import variant_calling
import pickle
# global_max_threads = 0
# thread_file = ''
# working_files = {}
# cwd = ''
def confirm_path(file):
wait_time = random.uniform(0,1)
time.... | [
"pickle.dump",
"random.uniform",
"os.getcwd",
"fcntl.flock",
"os.path.dirname",
"time.sleep",
"pickle.load",
"sys.stdout.flush"
] | [((294, 314), 'random.uniform', 'random.uniform', (['(0)', '(1)'], {}), '(0, 1)\n', (308, 314), False, 'import random\n'), ((315, 336), 'time.sleep', 'time.sleep', (['wait_time'], {}), '(wait_time)\n', (325, 336), False, 'import time\n'), ((564, 575), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (573, 575), False, 'impo... |
from flask import Flask
from flask_cors import CORS
app = Flask(__name__)
app.debug=True
CORS(app)
from server.routes import index
| [
"flask_cors.CORS",
"flask.Flask"
] | [((59, 74), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (64, 74), False, 'from flask import Flask\n'), ((90, 99), 'flask_cors.CORS', 'CORS', (['app'], {}), '(app)\n', (94, 99), False, 'from flask_cors import CORS\n')] |
# Copyright 2008-2010 Nokia Siemens Networks Oyj
#
# 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... | [
"robot.variables.Variables.__init__",
"robot.utils.NormalizedDict",
"robot.errors.DataError",
"robot.errors.FrameworkError"
] | [((839, 870), 'robot.variables.Variables.__init__', 'Variables.__init__', (['self', "['$']"], {}), "(self, ['$'])\n", (857, 870), False, 'from robot.variables import Variables\n'), ((1102, 1161), 'robot.errors.FrameworkError', 'FrameworkError', (['"""Either \'path\' or \'template\' must be given"""'], {}), '("Either \'... |
import tensorflow as tf
import random as rn
import numpy as np
import os
os.environ['PYTHONHASHSEED'] = '0'
np.random.seed(45)
# Setting the graph-level random seed.
tf.set_random_seed(1337)
rn.seed(73)
from keras import backend as K
session_conf = tf.ConfigProto(
intra_op_parallelism_threads=1,
inter_op_p... | [
"keras.models.load_model",
"keras.regularizers.l2",
"numpy.random.seed",
"numpy.argmax",
"pandas.read_csv",
"keras.layers.merge.concatenate",
"keras.models.Model",
"sklearn.metrics.classification_report",
"skopt.space.Real",
"tensorflow.ConfigProto",
"keras.layers.Input",
"tensorflow.get_defau... | [((109, 127), 'numpy.random.seed', 'np.random.seed', (['(45)'], {}), '(45)\n', (123, 127), True, 'import numpy as np\n'), ((168, 192), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['(1337)'], {}), '(1337)\n', (186, 192), True, 'import tensorflow as tf\n'), ((194, 205), 'random.seed', 'rn.seed', (['(73)'], {}), ... |
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
df=pd.read_csv('/Users/CoraJune/Google Drive/Pozyx/Data/lab_applications/lab_redos/atwood_machine/alpha_ema_testing/alpha0.9/atwood_0.9_4diff.csv', delimiter=',', usecols=['Time', '0x6103 Range'])
df.columns = ['Time', 'Range']
x = df['Time']
y =... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"numpy.stack",
"pandas.Series.ewm",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"pandas.read_csv",
"numpy.mean",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.tight_layout"
] | [((75, 278), 'pandas.read_csv', 'pd.read_csv', (['"""/Users/CoraJune/Google Drive/Pozyx/Data/lab_applications/lab_redos/atwood_machine/alpha_ema_testing/alpha0.9/atwood_0.9_4diff.csv"""'], {'delimiter': '""","""', 'usecols': "['Time', '0x6103 Range']"}), "(\n '/Users/CoraJune/Google Drive/Pozyx/Data/lab_applications... |
# Generated by Django 2.2.13 on 2020-08-21 12:34
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('hqwebapp', '0004_apikeysettings'),
]
operations = [
migrations.DeleteModel(
name='ApiKeySettings',
),
]
| [
"django.db.migrations.DeleteModel"
] | [((225, 270), 'django.db.migrations.DeleteModel', 'migrations.DeleteModel', ([], {'name': '"""ApiKeySettings"""'}), "(name='ApiKeySettings')\n", (247, 270), False, 'from django.db import migrations\n')] |
import root_pb2
import base64
import json
from understandability import analyze
from google.protobuf.json_format import MessageToJson, MessageToDict
test_S1S3L1 = root_pb2.Expression(
raw='S{3}S{4,4}S{7,7}A{2,}',
tokens=[
root_pb2.Token(
token="S",
type=root_pb2.TokenType.Character,
... | [
"root_pb2.Expression",
"understandability.analyze",
"json.dumps",
"root_pb2.Token",
"root_pb2.Output",
"google.protobuf.json_format.MessageToDict"
] | [((5480, 5671), 'root_pb2.Expression', 'root_pb2.Expression', ([], {'raw': '"""([A-Z])\\\\w+([A-Z])\\\\w+([A-Z])\\\\w+([A-Z])\\\\w+([A-Z])\\\\w+([A-Z])\\\\w+([A-Z])\\\\w+([A-Z])\\\\w+([A-Z])\\\\w+([A-Z])\\\\w+([A-Z])\\\\w+([A-Z])\\\\w+([A-Z])\\\\w+"""', 'tokens': '[]'}), "(raw=\n '([A-Z])\\\\w+([A-Z])\\\\w+([A-Z])\\... |
from django import forms
from django.contrib.contenttypes.models import ContentType
class VoteForm(forms.Form):
content_type = forms.ModelChoiceField(widget=forms.HiddenInput, queryset=ContentType.objects.all())
object_id = forms.IntegerField(widget=forms.HiddenInput)
vote = forms.IntegerField(widget=forms.HiddenIn... | [
"django.forms.IntegerField",
"django.contrib.contenttypes.models.ContentType.objects.all"
] | [((227, 271), 'django.forms.IntegerField', 'forms.IntegerField', ([], {'widget': 'forms.HiddenInput'}), '(widget=forms.HiddenInput)\n', (245, 271), False, 'from django import forms\n'), ((280, 324), 'django.forms.IntegerField', 'forms.IntegerField', ([], {'widget': 'forms.HiddenInput'}), '(widget=forms.HiddenInput)\n',... |
#!/usr/bin/env python2.7
import re
from sklearn.ensemble import RandomForestRegressor
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
import pickle
# from imp import reload
# import sys
# reload(sys)
# sys.setdefaultencoding('utf8')
global_one_essay_set_train = None
glob... | [
"pandas.DataFrame",
"pickle.dump",
"sklearn.model_selection.train_test_split",
"pandas.merge",
"sklearn.ensemble.RandomForestRegressor",
"pandas.read_excel",
"pandas.concat"
] | [((920, 998), 'pandas.read_excel', 'pd.read_excel', (['"""./watson_readability_spelling_entities_features_data_set.xlsx"""'], {}), "('./watson_readability_spelling_entities_features_data_set.xlsx')\n", (933, 998), True, 'import pandas as pd\n'), ((1034, 1093), 'pandas.read_excel', 'pd.read_excel', (['"""./essay_basic_s... |
import subprocess
from platform import system
from version import version_info
from os import system as run
from os import path, remove
from sys import argv
from time import sleep
interpreter = 'python' if system() == 'Windows' else 'python3'
version_file = '../version'
def read_version():
"""
Reads the versi... | [
"subprocess.Popen",
"os.remove",
"os.path.exists",
"os.system",
"time.sleep",
"platform.system"
] | [((743, 792), 'subprocess.Popen', 'subprocess.Popen', (["[interpreter, 'server.py', arg]"], {}), "([interpreter, 'server.py', arg])\n", (759, 792), False, 'import subprocess\n'), ((207, 215), 'platform.system', 'system', ([], {}), '()\n', (213, 215), False, 'from platform import system\n'), ((960, 980), 'os.path.exists... |
#!/usr/bin/env python3
import json
from datetime import datetime
from datetime import timedelta
import random
import gzip
import time
import esi_calling
esi_calling.set_user_agent('Hirmuolio/high-frequency-market-tracker')
def string_to_time( time : str ):
# This format is used in normal API calls
... | [
"esi_calling.timestamped_print",
"esi_calling.set_user_agent",
"esi_calling.log_in_pkce",
"esi_calling.load_esi_config",
"esi_calling.construct_url",
"random.randint",
"json.dumps",
"time.sleep",
"esi_calling.call_many_pages",
"datetime.datetime.strptime",
"datetime.datetime.utcnow",
"gzip.Gzi... | [((169, 238), 'esi_calling.set_user_agent', 'esi_calling.set_user_agent', (['"""Hirmuolio/high-frequency-market-tracker"""'], {}), "('Hirmuolio/high-frequency-market-tracker')\n", (195, 238), False, 'import esi_calling\n'), ((6418, 6447), 'esi_calling.load_esi_config', 'esi_calling.load_esi_config', ([], {}), '()\n', (... |
# coding=utf-8
import numpy as np
import paddle
from tb_paddle import SummaryWriter
import matplotlib
matplotlib.use('TkAgg')
writer = SummaryWriter('./log')
BATCH_SIZE = 768
train_reader = paddle.batch(
paddle.reader.shuffle(paddle.dataset.mnist.train(), buf_size=5120),
batch_size=BATCH_SIZE)
mat = np.zeros(... | [
"paddle.dataset.mnist.train",
"matplotlib.use",
"numpy.zeros",
"tb_paddle.SummaryWriter"
] | [((102, 125), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (116, 125), False, 'import matplotlib\n'), ((136, 158), 'tb_paddle.SummaryWriter', 'SummaryWriter', (['"""./log"""'], {}), "('./log')\n", (149, 158), False, 'from tb_paddle import SummaryWriter\n'), ((311, 338), 'numpy.zeros', 'np.z... |
import os.path as osp
import numpy as np
import torch
import torch.nn as nn
import torch.utils.data
import torchvision.transforms as transforms
import torchvision.datasets as dset
from pdb import set_trace as bp
from operator import mul
from functools import reduce
from dlrm_s_pytorch import unpack_batch
import copy
... | [
"torch.sign",
"torch.cuda.current_device",
"dlrm_s_pytorch.unpack_batch"
] | [((471, 498), 'torch.cuda.current_device', 'torch.cuda.current_device', ([], {}), '()\n', (496, 498), False, 'import torch\n'), ((887, 911), 'dlrm_s_pytorch.unpack_batch', 'unpack_batch', (['inputBatch'], {}), '(inputBatch)\n', (899, 911), False, 'from dlrm_s_pytorch import unpack_batch\n'), ((1219, 1239), 'torch.sign'... |
from datetime import datetime, timedelta
PYBITES_BORN = datetime(year=2016, month=12, day=19)
def gen_special_pybites_dates():
date = PYBITES_BORN
birthday = PYBITES_BORN
days = 0
while True:
date += timedelta(days=100)
days += 100
if days == 400:
birthday = birthd... | [
"datetime.timedelta",
"datetime.datetime"
] | [((57, 94), 'datetime.datetime', 'datetime', ([], {'year': '(2016)', 'month': '(12)', 'day': '(19)'}), '(year=2016, month=12, day=19)\n', (65, 94), False, 'from datetime import datetime, timedelta\n'), ((227, 246), 'datetime.timedelta', 'timedelta', ([], {'days': '(100)'}), '(days=100)\n', (236, 246), False, 'from date... |
import csv
#Function to build dictionary using csv file as parameter.
def buildDictionary(f):
#Initialize summary dictionary.
summaryDict = {'Facility Amount': {}, 'Chemical': {}, 'City': {}, 'Average Release Amount': 0.0, 'Total Records': 0}
#Open file and pass it to DictReader.
with open(f) as ... | [
"csv.DictReader"
] | [((347, 367), 'csv.DictReader', 'csv.DictReader', (['file'], {}), '(file)\n', (361, 367), False, 'import csv\n')] |
#!/usr/bin/env python
"""Python inteerface to access twitter api."""
from future.standard_library import install_aliases # To clear the python2/python3 dependancy.
install_aliases()
import os
import base64
import requests
from urllib.parse import quote_plus
from api import tweetags_api
from rest import TweetagsRestA... | [
"os.environ.get",
"future.standard_library.install_aliases",
"rest.TweetagsRestAPI"
] | [((166, 183), 'future.standard_library.install_aliases', 'install_aliases', ([], {}), '()\n', (181, 183), False, 'from future.standard_library import install_aliases\n'), ((961, 992), 'os.environ.get', 'os.environ.get', (['"""API_KEY"""', 'None'], {}), "('API_KEY', None)\n", (975, 992), False, 'import os\n'), ((1061, 1... |
from baconian.envs.gym_env import make
from baconian.core.core import EnvSpec
from baconian.test.tests.set_up.setup import BaseTestCase
from baconian.common.data_pre_processing import *
import numpy as np
class TestDataPreProcessing(BaseTestCase):
def test_min_max(self):
for env in (make('Pendulum-v0'), m... | [
"baconian.envs.gym_env.make",
"numpy.zeros",
"numpy.ones",
"numpy.equal",
"numpy.max",
"numpy.mean",
"numpy.array",
"numpy.min",
"numpy.var"
] | [((298, 317), 'baconian.envs.gym_env.make', 'make', (['"""Pendulum-v0"""'], {}), "('Pendulum-v0')\n", (302, 317), False, 'from baconian.envs.gym_env import make\n'), ((319, 337), 'baconian.envs.gym_env.make', 'make', (['"""Acrobot-v1"""'], {}), "('Acrobot-v1')\n", (323, 337), False, 'from baconian.envs.gym_env import m... |
from django.shortcuts import render
from rest_framework.permissions import IsAuthenticated, IsAdminUser
from rest_framework.response import Response
from rest_framework.views import APIView
from associations.models import Associations
from associations.serializers import AssocSerializer
# Create your views here.
cla... | [
"associations.models.Associations.objects.all",
"associations.serializers.AssocSerializer",
"rest_framework.response.Response"
] | [((438, 464), 'associations.models.Associations.objects.all', 'Associations.objects.all', ([], {}), '()\n', (462, 464), False, 'from associations.models import Associations\n'), ((486, 512), 'associations.serializers.AssocSerializer', 'AssocSerializer', (['assoc_get'], {}), '(assoc_get)\n', (501, 512), False, 'from ass... |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# 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... | [
"flax.deprecated.nn.Conv",
"flax.deprecated.nn.relu"
] | [((1214, 1305), 'flax.deprecated.nn.Conv', 'nn.Conv', (['x'], {'features': '(1)', 'kernel_size': '(3, 3)', 'bias': '(False)', 'strides': '(2, 2)', 'padding': '"""VALID"""'}), "(x, features=1, kernel_size=(3, 3), bias=False, strides=(2, 2),\n padding='VALID')\n", (1221, 1305), False, 'from flax.deprecated import nn\n... |
#!/usr/bin/env python
import cv2
import numpy as np
from tensorflow.keras.models import load_model
from flask import Flask, Response, request, g
from flask_cors import CORS
from camera_opencv import Camera
import time
import os
from collections import deque
app = Flask(__name__)
CORS(app, resources={r'/*': {'origin... | [
"tensorflow.keras.models.load_model",
"cv2.putText",
"numpy.argmax",
"flask_cors.CORS",
"flask.Flask",
"collections.deque",
"numpy.expand_dims",
"time.time",
"numpy.array",
"cv2.imencode",
"camera_opencv.Camera",
"cv2.resize"
] | [((268, 283), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (273, 283), False, 'from flask import Flask, Response, request, g\n'), ((284, 329), 'flask_cors.CORS', 'CORS', (['app'], {'resources': "{'/*': {'origins': '*'}}"}), "(app, resources={'/*': {'origins': '*'}})\n", (288, 329), False, 'from flask_cor... |