code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import sys
from PyQt5 import QtCore, QtGui, QtWidgets, uic
import controller
from datetime import date, datetime, timezone
qt_tela_inicial = "telas/gerenciar_meta.ui"
Ui_MainWindow, QtBaseClass = uic.loadUiType(qt_tela_inicial)
class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
switch_tela_gerenciar_meta =... | [
"PyQt5.QtCore.pyqtSignal",
"PyQt5.QtCore.QDate.fromString",
"PyQt5.QtWidgets.QMainWindow.__init__",
"PyQt5.uic.loadUiType",
"datetime.date.today",
"controller.editar_meta_to_divisao",
"controller.listar_meta_para_editar",
"datetime.date.toordinal",
"controller.select_meta_completa"
] | [((197, 228), 'PyQt5.uic.loadUiType', 'uic.loadUiType', (['qt_tela_inicial'], {}), '(qt_tela_inicial)\n', (211, 228), False, 'from PyQt5 import QtCore, QtGui, QtWidgets, uic\n'), ((321, 340), 'PyQt5.QtCore.pyqtSignal', 'QtCore.pyqtSignal', ([], {}), '()\n', (338, 340), False, 'from PyQt5 import QtCore, QtGui, QtWidgets... |
import unittest
from unittest.mock import call, patch
from nestor_api.errors.config.aggregated_configuration_error import AggregatedConfigurationError
from nestor_api.errors.config.app_configuration_not_found_error import AppConfigurationNotFoundError
import nestor_api.lib.config as config
@patch("nestor_api.lib.con... | [
"nestor_api.lib.config.get_cronjobs",
"unittest.mock.patch.dict",
"nestor_api.lib.config.get_project_config",
"nestor_api.lib.config.get_app_config",
"nestor_api.lib.config.change_environment",
"nestor_api.lib.config.list_apps_config",
"unittest.mock.call",
"nestor_api.lib.config._resolve_variables_de... | [((295, 343), 'unittest.mock.patch', 'patch', (['"""nestor_api.lib.config.io"""'], {'autospec': '(True)'}), "('nestor_api.lib.config.io', autospec=True)\n", (300, 343), False, 'from unittest.mock import call, patch\n'), ((850, 909), 'unittest.mock.patch', 'patch', (['"""nestor_api.lib.config.Configuration"""'], {'autos... |
"""
Epsagon's init.
"""
from __future__ import absolute_import
import os
from .utils import init
from .patcher import patch_all
from .constants import __version__
from .trace import tracer
def dummy_wrapper(func):
"""
A dummy wrapper for when Epsagon is disabled
:param func: The function to wrap
:ret... | [
"os.environ.get"
] | [((383, 416), 'os.environ.get', 'os.environ.get', (['"""DISABLE_EPSAGON"""'], {}), "('DISABLE_EPSAGON')\n", (397, 416), False, 'import os\n'), ((1414, 1453), 'os.environ.get', 'os.environ.get', (['"""DISABLE_EPSAGON_PATCH"""'], {}), "('DISABLE_EPSAGON_PATCH')\n", (1428, 1453), False, 'import os\n')] |
import unittest
import numpy as np
from mlscratch.models import losses
class TestBinaryCrossEntropy(unittest.TestCase):
def setUp(self):
self.y_true = np.array([0, 1, 0.5])
self.y_pred = np.array([0, 1, 0.5])
def test_return(self):
bce = losses.binary_cross_entropy(self.y_true, sel... | [
"mlscratch.models.losses.binary_cross_entropy",
"numpy.array",
"mlscratch.models.losses.mean_squared_error"
] | [((168, 189), 'numpy.array', 'np.array', (['[0, 1, 0.5]'], {}), '([0, 1, 0.5])\n', (176, 189), True, 'import numpy as np\n'), ((212, 233), 'numpy.array', 'np.array', (['[0, 1, 0.5]'], {}), '([0, 1, 0.5])\n', (220, 233), True, 'import numpy as np\n'), ((276, 329), 'mlscratch.models.losses.binary_cross_entropy', 'losses.... |
import argparse
import base64
import datetime
import hashlib
import os
import random
import sqlite3
import ssl
import subprocess
import sys
import tempfile
import threading
try:
import secrets
except ImportError:
import string
class secrets:
def token_urlsafe(size):
return (''.join(rand... | [
"sys.exit",
"OpenSSL.crypto.load_certificate",
"os.remove",
"os.path.exists",
"argparse.ArgumentParser",
"secrets.token_urlsafe",
"threading.RLock",
"random.randint",
"string.printable.strip",
"subprocess.check_call",
"os.close",
"ssl.SSLContext",
"datetime.date.today",
"tempfile.mkstemp",... | [((26638, 26703), 'sqlite3.register_adapter', 'sqlite3.register_adapter', (['"""bool"""', '(lambda x: 1 if x is True else 0)'], {}), "('bool', lambda x: 1 if x is True else 0)\n", (26662, 26703), False, 'import sqlite3\n'), ((2136, 2165), 'os.path.exists', 'os.path.exists', (['database_file'], {}), '(database_file)\n',... |
import typing
from fiepipedesktoplib.locallymanagedtypes.shells.AbstractLocalManagedTypeCommand import LocalManagedTypeCommand
from fiepipedesktoplib.shells.AbstractShell import AbstractShell
from fiepipehoudini.data.installs import HoudiniInstall
from fiepipehoudini.routines.installs import HoudiniInstallsInteractive... | [
"fiepipedesktoplib.shells.ui.subpath_input_ui.SubpathInputDefaultUI",
"fiepipedesktoplib.shells.ui.abspath_input_ui.AbspathInputDefaultUI"
] | [((700, 727), 'fiepipedesktoplib.shells.ui.abspath_input_ui.AbspathInputDefaultUI', 'AbspathInputDefaultUI', (['self'], {}), '(self)\n', (721, 727), False, 'from fiepipedesktoplib.shells.ui.abspath_input_ui import AbspathInputDefaultUI\n'), ((729, 756), 'fiepipedesktoplib.shells.ui.subpath_input_ui.SubpathInputDefaultU... |
#!/usr/bin/env python
# coding=utf-8
# vim:ts=4:sts=4:sw=4:et
#
# Author: <NAME>
# Date: 2017-11-26 18:55:00 +0100 (Sun, 26 Nov 2017)
#
# https://github.com/harisekhon/nagios-plugins
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn
#... | [
"harisekhon.utils.support_msg_api",
"traceback.format_exc",
"os.path.join",
"os.path.dirname",
"harisekhon.utils.isDict",
"harisekhon.utils.isList",
"sys.exit",
"sys.path.append"
] | [((1457, 1486), 'os.path.join', 'os.path.join', (['srcdir', '"""pylib"""'], {}), "(srcdir, 'pylib')\n", (1469, 1486), False, 'import os\n'), ((1487, 1510), 'sys.path.append', 'sys.path.append', (['libdir'], {}), '(libdir)\n', (1502, 1510), False, 'import sys\n'), ((1421, 1446), 'os.path.dirname', 'os.path.dirname', (['... |
import os
import sys
from dataclasses import asdict, dataclass
from pprint import pprint
from typing import Iterator, Optional, Tuple, List
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# import torch
from fastai.vision.all import (
CategoryBlock,
ClassificationInterpretation,
Col... | [
"utils.test_split.TestSplitter",
"fastai.vision.all.SaveModelCallback",
"fastai.vision.all.ClassificationInterpretation.from_learner",
"matplotlib.pyplot.savefig",
"dataclasses.asdict",
"utils.fastai_utils.MLFlowTracking",
"utils.metrics.Metrics",
"utils.common.load_dz_data",
"os.path.join",
"util... | [((914, 964), 'os.path.join', 'os.path.join', (['output_path', '"""train_val_indices.csv"""'], {}), "(output_path, 'train_val_indices.csv')\n", (926, 964), False, 'import os\n'), ((1255, 1300), 'os.path.join', 'os.path.join', (['output_path', '"""test_indices.csv"""'], {}), "(output_path, 'test_indices.csv')\n", (1267,... |
import torch
import numpy as np
class ToTensorGjz(object):
def __call__(self, pic):
img = torch.from_numpy(pic.transpose((2, 0, 1)))
return img.float()
def __repr__(self):
return self.__class__.__name__ + '()'
class NormalizeGjz(object):
def __init__(self, mean, std):
self... | [
"numpy.zeros"
] | [((638, 675), 'numpy.zeros', 'np.zeros', (['(dh, dw, 3)'], {'dtype': 'np.uint8'}), '((dh, dw, 3), dtype=np.uint8)\n', (646, 675), True, 'import numpy as np\n'), ((700, 734), 'numpy.zeros', 'np.zeros', (['(dh, dw)'], {'dtype': 'np.uint8'}), '((dh, dw), dtype=np.uint8)\n', (708, 734), True, 'import numpy as np\n')] |
import unittest
from flexmock import flexmock
import swiftclient
import swiftclient.utils
from ansible.modules.network.fabric import swift_fileutil
from test_fabric_base import TestFabricModule
from test_fabric_base import set_module_args
from ansible.module_utils import fabric_utils
class TestSwiftFileUtilModule(Tes... | [
"test_fabric_base.set_module_args",
"flexmock.flexmock"
] | [((898, 908), 'flexmock.flexmock', 'flexmock', ([], {}), '()\n', (906, 908), False, 'from flexmock import flexmock\n'), ((1739, 1770), 'test_fabric_base.set_module_args', 'set_module_args', (['self.args_dict'], {}), '(self.args_dict)\n', (1754, 1770), False, 'from test_fabric_base import set_module_args\n'), ((2087, 21... |
from glob import glob
import cv2
import os
# we'll run it manually like this:
# $ python
# Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:21:23) [MSC v.1916 32 bit (Intel)] on win32
# Type "help", "copyright", "credits" or "license" for more information.
... | [
"cv2.imwrite",
"os.listdir",
"os.path.join",
"cv2.imread",
"glob.glob"
] | [((470, 492), 'glob.glob', 'glob', (["(mydir + '/*.png')"], {}), "(mydir + '/*.png')\n", (474, 492), False, 'from glob import glob\n'), ((524, 537), 'cv2.imread', 'cv2.imread', (['j'], {}), '(j)\n', (534, 537), False, 'import cv2\n'), ((546, 578), 'cv2.imwrite', 'cv2.imwrite', (["(j[:-3] + 'jpg')", 'img'], {}), "(j[:-3... |
"""Random Forest classification and computation of assessment metrics."""
import numpy as np
from imblearn.over_sampling import RandomOverSampler
from imblearn.under_sampling import RandomUnderSampler
from sklearn import metrics
from sklearn.ensemble import RandomForestClassifier
from raster import is_raster
def tr... | [
"sklearn.metrics.f1_score",
"sklearn.metrics.average_precision_score",
"sklearn.metrics.precision_recall_curve",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.metrics.precision_score",
"numpy.count_nonzero",
"sklearn.metrics.recall_score",
"numpy.zeros",
"imblearn.over_sampling.RandomOverSampl... | [((713, 768), 'numpy.zeros', 'np.zeros', ([], {'shape': '(n_samples, n_features)', 'dtype': 'np.float'}), '(shape=(n_samples, n_features), dtype=np.float)\n', (721, 768), True, 'import numpy as np\n'), ((1924, 1950), 'numpy.count_nonzero', 'np.count_nonzero', (['training'], {}), '(training)\n', (1940, 1950), True, 'imp... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | [
"ecl.identity.identity_service.IdentityService",
"ecl.resource.prop"
] | [((751, 785), 'ecl.identity.identity_service.IdentityService', 'identity_service.IdentityService', ([], {}), '()\n', (783, 785), False, 'from ecl.identity import identity_service\n'), ((1040, 1068), 'ecl.resource.prop', 'resource.prop', (['"""description"""'], {}), "('description')\n", (1053, 1068), False, 'from ecl im... |
from collections import deque
import pickle
import cv2
import numpy as np
import time
import ast
from utils import *
import tensorflow_hub as hub
import concurrent.futures
from tensorflow.keras import layers
import tensorflow as tf
# Load Yolo
net = cv2.dnn.readNet("./data/yolov4-tiny.weights", "./data/yolov4-tiny.... | [
"cv2.rectangle",
"numpy.sqrt",
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"cv2.imshow",
"numpy.array",
"tensorflow.keras.models.load_model",
"cv2.destroyAllWindows",
"cv2.dnn.NMSBoxes",
"cv2.setMouseCallback",
"collections.deque",
"cv2.perspectiveTransform",
"cv2.waitKey",
"c... | [((254, 325), 'cv2.dnn.readNet', 'cv2.dnn.readNet', (['"""./data/yolov4-tiny.weights"""', '"""./data/yolov4-tiny.cfg"""'], {}), "('./data/yolov4-tiny.weights', './data/yolov4-tiny.cfg')\n", (269, 325), False, 'import cv2\n'), ((741, 774), 'cv2.VideoCapture', 'cv2.VideoCapture', (['"""vid_short.mp4"""'], {}), "('vid_sho... |
from bling.helpscout.client import HelpScoutClient
from bling.mc.client import MobileCommonsClient
from twilio.rest import Client as TwilioClient
from bling.incoming import IncomingHandler
from bling.outgoing import OutgoingHandler
from bling.config import config
from bling.transport import (
Transport,
Twil... | [
"bling.helpscout.client.HelpScoutClient",
"twilio.rest.Client",
"bling.mc.client.MobileCommonsClient"
] | [((480, 585), 'bling.helpscout.client.HelpScoutClient', 'HelpScoutClient', ([], {'client_id': 'config.helpscout_api_client_id', 'secret': 'config.helpscout_api_client_secret'}), '(client_id=config.helpscout_api_client_id, secret=config.\n helpscout_api_client_secret)\n', (495, 585), False, 'from bling.helpscout.clie... |
# -*- coding: utf-8 -*-
import MySQLdb
class Connection(object):
def __init__(self):
self.db = MySQLdb.connect(host="localhost", # your host, usually localhost
user="root", # your username
passwd="<PASSWORD>", # your password
... | [
"MySQLdb.connect"
] | [((112, 197), 'MySQLdb.connect', 'MySQLdb.connect', ([], {'host': '"""localhost"""', 'user': '"""root"""', 'passwd': '"""<PASSWORD>"""', 'db': '"""gigapy"""'}), "(host='localhost', user='root', passwd='<PASSWORD>', db='gigapy'\n )\n", (127, 197), False, 'import MySQLdb\n')] |
import requests
from anytree import Node, RenderTree
import argparse
import json
ROR_API_ENDPOINT = "https://api.ror.org/organizations/"
# construct organizational tree recursively starting at given ROR
def construct(ror, parent=None):
organization = get_data(ror)
current_node = Node(organization["name"], pa... | [
"json.loads",
"argparse.ArgumentParser",
"requests.get",
"anytree.RenderTree",
"anytree.Node"
] | [((291, 332), 'anytree.Node', 'Node', (["organization['name']"], {'parent': 'parent'}), "(organization['name'], parent=parent)\n", (295, 332), False, 'from anytree import Node, RenderTree\n'), ((560, 596), 'requests.get', 'requests.get', (['(ROR_API_ENDPOINT + ror)'], {}), '(ROR_API_ENDPOINT + ror)\n', (572, 596), Fals... |
import RPi.GPIO as GPIO
import time
channel = 21
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(channel, GPIO.OUT)
GPIO.output(channel, GPIO.HIGH)
#time.sleep(5)
#GPIO.output(channel, GPIO.LOW)
| [
"RPi.GPIO.setup",
"RPi.GPIO.setwarnings",
"RPi.GPIO.output",
"RPi.GPIO.setmode"
] | [((51, 73), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BCM'], {}), '(GPIO.BCM)\n', (63, 73), True, 'import RPi.GPIO as GPIO\n'), ((74, 97), 'RPi.GPIO.setwarnings', 'GPIO.setwarnings', (['(False)'], {}), '(False)\n', (90, 97), True, 'import RPi.GPIO as GPIO\n'), ((98, 127), 'RPi.GPIO.setup', 'GPIO.setup', (['channel', ... |
# -*- coding: utf-8 -*-
# @COPYRIGHT_begin
#
# Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland
#
# 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.apac... | [
"django.conf.urls.include",
"django.conf.urls.url",
"wi.utils.decorators.user_permission"
] | [((1284, 1387), 'django.conf.urls.url', 'url', (['"""^account_data/ajax/get_user_data/$"""', '"""acc_ajax_get_user_data"""'], {'name': '"""acc_ajax_get_user_data"""'}), "('^account_data/ajax/get_user_data/$', 'acc_ajax_get_user_data', name=\n 'acc_ajax_get_user_data')\n", (1287, 1387), False, 'from django.conf.urls ... |
"""
Train Fashion MNIST CNN
Code borrowed from http://danialk.github.io/blog/2017/09/29/range-of-
convolutional-neural-networks-on-fashion-mnist-dataset/
"""
# Specify visible cuda device
import os
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "7"
import numpy as np
from keras.pre... | [
"lib.utils.load_dataset_fmnist",
"keras.preprocessing.image.ImageDataGenerator",
"lib.keras_utils.build_vgg_fmnist"
] | [((538, 559), 'lib.utils.load_dataset_fmnist', 'load_dataset_fmnist', ([], {}), '()\n', (557, 559), False, 'from lib.utils import load_dataset_fmnist\n'), ((667, 694), 'lib.keras_utils.build_vgg_fmnist', 'build_vgg_fmnist', (['mean', 'std'], {}), '(mean, std)\n', (683, 694), False, 'from lib.keras_utils import build_vg... |
import hmac
import hashlib
from django.conf import settings
from django.contrib.auth.models import User
from .models import TurnusersLt
def sync_new_user_to_coturn(sender, instance, **kwargs):
##
# NOTE: Do not use this for REST API. You do not need to sync users if you are using the REST API.
#
#
... | [
"django.contrib.auth.models.User.objects.make_random_password",
"django.conf.settings.SECRET_KEY.encode",
"django.conf.settings.COTURN_USERNAME_FIELD.split"
] | [((1787, 1822), 'django.contrib.auth.models.User.objects.make_random_password', 'User.objects.make_random_password', ([], {}), '()\n', (1820, 1822), False, 'from django.contrib.auth.models import User\n'), ((1847, 1882), 'django.conf.settings.SECRET_KEY.encode', 'settings.SECRET_KEY.encode', (['"""utf-8"""'], {}), "('u... |
import secrets
from typing import FrozenSet
class AuthorizationTokens:
def __init__(self, filename: str):
self._filename = filename
def get_tokens(self) -> FrozenSet[str]:
return self._read_tokens()
def generate_token(self) -> str:
token = secrets.token_urlsafe(32)
self.... | [
"secrets.token_urlsafe"
] | [((281, 306), 'secrets.token_urlsafe', 'secrets.token_urlsafe', (['(32)'], {}), '(32)\n', (302, 306), False, 'import secrets\n')] |
# Code made for <NAME>
# 12 Abril 2021
# License MIT
# Transport Phenomena: Python Program-Assessment 4.3
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from scipy.optimize import minimize
sns.set()
# Solve for Temperature of Steam at given Pressure
class enviroment_convective:
def tem... | [
"numpy.log",
"seaborn.set",
"scipy.optimize.minimize"
] | [((217, 226), 'seaborn.set', 'sns.set', ([], {}), '()\n', (224, 226), True, 'import seaborn as sns\n'), ((4244, 4358), 'scipy.optimize.minimize', 'minimize', (['Opt.objective_T', 'x0'], {'method': '"""SLSQP"""', 'args': 'arguments', 'constraints': 'constraint', 'options': "{'maxiter': 5}"}), "(Opt.objective_T, x0, meth... |
from __future__ import (
absolute_import, division, print_function, unicode_literals)
import collections
import copy
import functools
import itertools
import json
import jsonschema
import logging
import os
import random
from ruamel.yaml import YAML
import six
from six import iteritems
from six.moves import range
... | [
"os.path.exists",
"collections.OrderedDict",
"os.path.isabs",
"os.path.join",
"ruamel.yaml.YAML",
"random.seed",
"os.path.realpath",
"os.path.dirname",
"logging.FileHandler",
"random.getrandbits",
"functools.partial",
"copy.deepcopy",
"json.load",
"six.iteritems"
] | [((497, 551), 'os.path.join', 'os.path.join', (["local_dirs['output']", 'job_name', 'exp_name'], {}), "(local_dirs['output'], job_name, exp_name)\n", (509, 551), False, 'import os\n'), ((1771, 1796), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (1794, 1796), False, 'import collections\n'), ((... |
from mmcv.runner import checkpoint
from mmdet.apis.inference import init_detector,LoadImage, inference_detector
import easymd
config = 'config.py'
#checkpoints = './checkpoints/pseg_r101_r50_latest.pth'
checkpoints = "path/to/pth"
img = '000000322864.jpg'
results = {
'img': './datasets/coco/val2017/'+i... | [
"mmdet.apis.inference.init_detector",
"mmdet.apis.inference.inference_detector"
] | [((333, 378), 'mmdet.apis.inference.init_detector', 'init_detector', (['config'], {'checkpoint': 'checkpoints'}), '(config, checkpoint=checkpoints)\n', (346, 378), False, 'from mmdet.apis.inference import init_detector, LoadImage, inference_detector\n'), ((389, 448), 'mmdet.apis.inference.inference_detector', 'inferenc... |
from anydeck import AnyDeck
# Create a default deck
# A default deck consists of a standard deck of poker cards with four suits with cards numbered 2 through 10, as well
# as a Jack, Queen, King, and Ace for each suit. The standard deck gives a value to the card equal to their
# face value further Jack, Queen, and Kin... | [
"anydeck.AnyDeck"
] | [((376, 385), 'anydeck.AnyDeck', 'AnyDeck', ([], {}), '()\n', (383, 385), False, 'from anydeck import AnyDeck\n'), ((698, 720), 'anydeck.AnyDeck', 'AnyDeck', ([], {'shuffled': '(True)'}), '(shuffled=True)\n', (705, 720), False, 'from anydeck import AnyDeck\n')] |
from django.contrib import admin
from django.conf import settings
# Register your models here.
from .models import Treatment
admin.site.register(Treatment)
| [
"django.contrib.admin.site.register"
] | [((126, 156), 'django.contrib.admin.site.register', 'admin.site.register', (['Treatment'], {}), '(Treatment)\n', (145, 156), False, 'from django.contrib import admin\n')] |
Environment(loader=templateLoader, autoescape=fake_func())
from flask import Flask, request, make_response, escape
from jinja2 import Environment, select_autoescape, FileSystemLoader, Template
app = Flask(__name__)
loader = FileSystemLoader( searchpath="templates/" )
unsafe_env = Environment(loader=loader)
safe1_env... | [
"flask.request.args.get",
"jinja2.Environment",
"flask.Flask",
"jinja2.Template",
"jinja2.select_autoescape",
"jinja2.FileSystemLoader"
] | [((201, 216), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (206, 216), False, 'from flask import Flask, request, make_response, escape\n'), ((226, 267), 'jinja2.FileSystemLoader', 'FileSystemLoader', ([], {'searchpath': '"""templates/"""'}), "(searchpath='templates/')\n", (242, 267), False, 'from jinja2 ... |
import pandas as pd
import pytest
from cascade.executor.model_results_main import _get_model_results
def test_get_model_results_inputs_ok(ihme):
"""at_mvid=265844 has 5850 rows, ode_mvid=102680 has 238836 rows
"""
results_columns = ['model_version_id', 'year_id', 'location_id', 'sex_id',
... | [
"pandas.Series",
"cascade.executor.model_results_main._get_model_results",
"pytest.raises",
"pandas.testing.assert_series_equal"
] | [((469, 520), 'cascade.executor.model_results_main._get_model_results', '_get_model_results', (['ode_model_version_id', 'db', 'table'], {}), '(ode_model_version_id, db, table)\n', (487, 520), False, 'from cascade.executor.model_results_main import _get_model_results\n'), ((676, 726), 'cascade.executor.model_results_mai... |
# -*- coding: utf-8 -*-
"""Morphology_embed.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1uZUe-O4GgKuMK1FfbAV7xztgtD4lWEEC
"""
import stanza
import argparse
parser = argparse.ArgumentParser(description='A tutorial of argparse!')
parser.add_arg... | [
"stanza.Pipeline",
"argparse.ArgumentParser"
] | [((243, 305), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""A tutorial of argparse!"""'}), "(description='A tutorial of argparse!')\n", (266, 305), False, 'import argparse\n'), ((544, 636), 'stanza.Pipeline', 'stanza.Pipeline', ([], {'lang': 'lang', 'processors': '"""tokenize,pos"""', '... |
from .FHIR_Generator import Generator
from .genomics_test_generator.fhir_genomics_test_gene import *
import os
spec_basepath = os.path.join(os.getcwd(), 'task_runner/resources/spec/')
def get_resource_correct_cases(version, resource_type):
'''
get correct resource objects for a certain resource type
'''
... | [
"os.getcwd"
] | [((141, 152), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (150, 152), False, 'import os\n')] |
from django.utils.safestring import mark_safe
from django.template.loader import render_to_string
class BasicRenderModelBackend(object):
def get_layout_template_name(self, model, name):
ret = []
for a in model.__class__.mro():
if not hasattr(a, "_meta"):
continue
... | [
"django.template.loader.render_to_string"
] | [((710, 804), 'django.template.loader.render_to_string', 'render_to_string', (['template_name'], {'dictionary': 'dictionary', 'context_instance': 'context_instance'}), '(template_name, dictionary=dictionary, context_instance=\n context_instance)\n', (726, 804), False, 'from django.template.loader import render_to_st... |
import os, gzip
INPUT_FILES=['kr_codepoints.json','ja_codepoints.json','zh_codepoints.json','vn_codepoints.json','yue_codepoints.json','unicodepoints.json']
for f in INPUT_FILES:
source = os.path.join('result', f)
input = open(source, 'rb')
s = input.read()
input.close()
dest =... | [
"gzip.GzipFile",
"os.path.join"
] | [((198, 223), 'os.path.join', 'os.path.join', (['"""result"""', 'f'], {}), "('result', f)\n", (210, 223), False, 'import os, gzip\n'), ((321, 371), 'os.path.join', 'os.path.join', (['"""../src/Unihandecode/_gz"""', "(f + '.gz')"], {}), "('../src/Unihandecode/_gz', f + '.gz')\n", (333, 371), False, 'import os, gzip\n'),... |
import cv2
import numpy as np
from shapes import Myinit
class Triangle(Myinit):
def __init__(self):
super(Triangle, self).__init__()
self.vertices = np.array([[100,50], [150,150], [50,150]],np.int32)
self.vertices = self.vertices.reshape((-1, 1, 2))
self.color=(255,0,255)
... | [
"cv2.fillPoly",
"cv2.polylines",
"cv2.imshow",
"numpy.array",
"cv2.destroyAllWindows",
"cv2.waitKey"
] | [((177, 231), 'numpy.array', 'np.array', (['[[100, 50], [150, 150], [50, 150]]', 'np.int32'], {}), '([[100, 50], [150, 150], [50, 150]], np.int32)\n', (185, 231), True, 'import numpy as np\n'), ((368, 426), 'cv2.polylines', 'cv2.polylines', (['self.img', '[self.vertices]', '(True)', 'self.color'], {}), '(self.img, [sel... |
import sys
import os
import timeit
from global_vars import *
def common_process(file, fnc, isFile):
try:
if file != None and os.path.exists(file):
select = input("FILE is already exist. Press 'Y' if you want to rewrite. ")
if select != 'Y':
print("Execution aborted..")
... | [
"timeit.default_timer",
"sys.exc_info",
"os.path.exists"
] | [((347, 369), 'timeit.default_timer', 'timeit.default_timer', ([], {}), '()\n', (367, 369), False, 'import timeit\n'), ((145, 165), 'os.path.exists', 'os.path.exists', (['file'], {}), '(file)\n', (159, 165), False, 'import os\n'), ((1021, 1035), 'sys.exc_info', 'sys.exc_info', ([], {}), '()\n', (1033, 1035), False, 'im... |
import numpy as np
class vents:
def __init__(self, segments):
self.segments = segments
(self.maxx, self.maxy) = self._getmaxxy()
self.board = np.zeros((self.maxx+1, self.maxy+1), dtype=int)
def _getmaxxy(self):
allxs = [x[0] for x in self.segments]
allxs.extend([x[2] ... | [
"numpy.count_nonzero",
"numpy.zeros",
"numpy.transpose"
] | [((172, 223), 'numpy.zeros', 'np.zeros', (['(self.maxx + 1, self.maxy + 1)'], {'dtype': 'int'}), '((self.maxx + 1, self.maxy + 1), dtype=int)\n', (180, 223), True, 'import numpy as np\n'), ((1697, 1729), 'numpy.count_nonzero', 'np.count_nonzero', (['(self.board > 1)'], {}), '(self.board > 1)\n', (1713, 1729), True, 'im... |
from tkinter import *
from PIL import Image, ImageTk
import sql
import mysql.connector as msq
# Ouverture de la connexion
# --------------------------------------------------------
config = {
"user": "root",
"password": "<PASSWORD>",
"host": "127.0.0.1",
"port": "8081",
"database": "trombinoscope"... | [
"mysql.connector.connect",
"PIL.Image.open"
] | [((329, 350), 'mysql.connector.connect', 'msq.connect', ([], {}), '(**config)\n', (340, 350), True, 'import mysql.connector as msq\n'), ((2300, 2316), 'PIL.Image.open', 'Image.open', (['path'], {}), '(path)\n', (2310, 2316), False, 'from PIL import Image, ImageTk\n')] |
# This is used for testing Fine Tune Hyper-Parameters
from datetime import datetime
import itertools
import json
import matplotlib.pyplot as plt
import numpy as np
from keras.callbacks import ModelCheckpoint
from keras.wrappers.scikit_learn import KerasClassifier
from keras_preprocessing.sequence import pad_sequences
... | [
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"keras.layers.GlobalMaxPooling1D",
"keras.utils.to_categorical",
"keras.layers.Dense",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.yticks",
"joblib.dump",
"mat... | [((670, 701), 'pandas.read_csv', 'pd.read_csv', (['"""../data/test.csv"""'], {}), "('../data/test.csv')\n", (681, 701), True, 'import pandas as pd\n'), ((713, 755), 'pandas.read_csv', 'pd.read_csv', (['"""../data/kata_dasar_kbbi.csv"""'], {}), "('../data/kata_dasar_kbbi.csv')\n", (724, 755), True, 'import pandas as pd\... |
import os
from torchaudio.datasets import SPEECHCOMMANDS
import torch
class SubsetSC(SPEECHCOMMANDS):
def __init__(self, subset, data_path):
super().__init__(root=data_path, download=True)
def load_list(filename):
filepath = os.path.join(self._path, filename)
with open(f... | [
"torch.stack",
"os.path.join",
"torch.nn.utils.rnn.pad_sequence"
] | [((1334, 1409), 'torch.nn.utils.rnn.pad_sequence', 'torch.nn.utils.rnn.pad_sequence', (['batch'], {'batch_first': '(True)', 'padding_value': '(0.0)'}), '(batch, batch_first=True, padding_value=0.0)\n', (1365, 1409), False, 'import torch\n'), ((1867, 1887), 'torch.stack', 'torch.stack', (['targets'], {}), '(targets)\n',... |
from setuptools import setup
with open('README.rst') as readme:
r = str(readme.read())
setup(
name='clpb',
version='1.0.0',
url='https://github.com/dmitriiweb/clpb',
license='MIT',
author='<NAME>',
author_email='<EMAIL>',
description=' Command line progress bar for Python 3',
long_... | [
"setuptools.setup"
] | [((93, 677), 'setuptools.setup', 'setup', ([], {'name': '"""clpb"""', 'version': '"""1.0.0"""', 'url': '"""https://github.com/dmitriiweb/clpb"""', 'license': '"""MIT"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'description': '""" Command line progress bar for Python 3"""', 'long_description': 'r', '... |
def wandb_log( # noqa: C901
func=None,
# /, # py38 only
log_component_file=True,
):
"""Wrap a standard python function and log to W&B"""
import json
import os
from functools import wraps
from inspect import Parameter, signature
from kfp import components
from kfp.components im... | [
"wandb.Artifact",
"os.getenv",
"json.dump",
"kfp.components._python_op.func_to_component_file",
"inspect.signature",
"functools.wraps",
"wandb.init",
"wandb.termlog",
"wandb.sdk.lib.telemetry.context",
"kfp.components.OutputPath"
] | [((2754, 2769), 'inspect.signature', 'signature', (['func'], {}), '(func)\n', (2763, 2769), False, 'from inspect import Parameter, signature\n'), ((1280, 1311), 'os.getenv', 'os.getenv', (['"""WANDB_KUBEFLOW_URL"""'], {}), "('WANDB_KUBEFLOW_URL')\n", (1289, 1311), False, 'import os\n'), ((1472, 1522), 'wandb.termlog', ... |
# -*- coding: utf-8 -*-
# Copyright 2017 Interstellar Technologies Inc. All Rights Reserved.
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from OpenGoddard.optimize import Problem, Guess, Condition, Dynamics
class Rocket:
g0 = 1.0 # Gravity at surface [-]
def __in... | [
"OpenGoddard.optimize.Guess.cubic",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.savefig",
"OpenGoddard.optimize.Problem",
"numpy.sqrt",
"OpenGoddard.optimize.Guess.linear",
"matplotlib.pyplot.ylabel",
"OpenGoddard.optimize.Dynamics",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplo... | [((2361, 2377), 'matplotlib.pyplot.close', 'plt.close', (['"""all"""'], {}), "('all')\n", (2370, 2377), True, 'import matplotlib.pyplot as plt\n'), ((2636, 2698), 'OpenGoddard.optimize.Problem', 'Problem', (['time_init', 'n', 'num_states', 'num_controls', 'max_iteration'], {}), '(time_init, n, num_states, num_controls,... |
import argparse
from pathlib import Path
import tarfile
from zipfile import ZipFile
from scanf import scanf
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('tarball_output')
parser.add_argument('tex_files',nargs='*')
args = parser.parse_args()
files = []
... | [
"tarfile.open",
"zipfile.ZipFile",
"argparse.ArgumentParser",
"pathlib.Path",
"scanf.scanf"
] | [((150, 175), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (173, 175), False, 'import argparse\n'), ((2203, 2228), 'pathlib.Path', 'Path', (['args.tarball_output'], {}), '(args.tarball_output)\n', (2207, 2228), False, 'from pathlib import Path\n'), ((376, 390), 'pathlib.Path', 'Path', (['tex_... |
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# โ InstaBot - Python Selenium Bot โ
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
# โ Copyright ยฉ 2019 <NAME> |
# | (https://github.com... | [
"selenium.webdriver.find_element_by_css_selector",
"selenium.webdriver.Chrome",
"time.strftime",
"time.sleep",
"selenium.webdriver.find_element_by_name",
"selenium.webdriver.find_element_by_xpath",
"selenium.webdriver.get",
"pandas.DataFrame",
"selenium.webdriver.find_element_by_link_text",
"selen... | [((939, 990), 'selenium.webdriver.Chrome', 'webdriver.Chrome', ([], {'executable_path': 'chromedriver_path'}), '(executable_path=chromedriver_path)\n', (955, 990), False, 'from selenium import webdriver\n'), ((991, 999), 'time.sleep', 'sleep', (['(2)'], {}), '(2)\n', (996, 999), False, 'from time import sleep, strftime... |
# -*- coding: utf-8 -*-
"""
MagicTelecomAPILib.Models.Account
This file was automatically generated by APIMATIC v2.0 on 06/22/2016
"""
from MagicTelecomAPILib.APIHelper import APIHelper
class Account(object):
"""Implementation of the 'Account' model.
TODO: type model description here.
... | [
"MagicTelecomAPILib.APIHelper.APIHelper.resolve_names"
] | [((3317, 3369), 'MagicTelecomAPILib.APIHelper.APIHelper.resolve_names', 'APIHelper.resolve_names', (['self', 'replace_names', 'retval'], {}), '(self, replace_names, retval)\n', (3340, 3369), False, 'from MagicTelecomAPILib.APIHelper import APIHelper\n')] |
import os
import re
import json
from os.path import expanduser
import zipfile
import datetime
import tensorflow as tf
import numpy as np
from utils import mkdir_p
from inoutdoor_dataset_download import InoutdoorDatasetDownload
from inoutdoor_versions import *
from tf_features import *
from PIL import Image
class In... | [
"zipfile.ZipFile",
"re.compile",
"utils.mkdir_p",
"tensorflow.compat.as_bytes",
"os.remove",
"re.search",
"os.path.exists",
"os.listdir",
"tensorflow.train.Example",
"tensorflow.Session",
"numpy.asarray",
"os.path.isdir",
"tensorflow.python_io.TFRecordWriter",
"os.path.expanduser",
"tens... | [((1270, 1312), 'os.listdir', 'os.listdir', (['self.image_set_definition_path'], {}), '(self.image_set_definition_path)\n', (1280, 1312), False, 'import os\n'), ((1958, 1989), 'os.path.exists', 'os.path.exists', (['self.input_path'], {}), '(self.input_path)\n', (1972, 1989), False, 'import os\n'), ((2372, 2416), 'os.pa... |
from __future__ import print_function, division, absolute_import
import logging
import io
from warnings import warn
from dask import bytes as dbytes
from s3fs import S3FileSystem
from .executor import default_executor, ensure_default_get
logger = logging.getLogger(__name__)
def read_text(fn, keyname=None, encodi... | [
"logging.getLogger",
"warnings.warn",
"dask.dataframe.read_csv",
"dask.bag.read_text"
] | [((252, 279), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (269, 279), False, 'import logging\n'), ((499, 576), 'warnings.warn', 'warn', (['"""distributed.s3.read_text(...) Moved to dask.bag.read_text(\'s3://...\')"""'], {}), '("distributed.s3.read_text(...) Moved to dask.bag.read_text(... |
import numpy as np
from arbol import aprint
from dexp.processing.utils.scatter_gather_i2v import scatter_gather_i2v
from dexp.utils.backends import Backend
from dexp.utils.testing.testing import execute_both_backends
from dexp.utils.timeit import timeit
@execute_both_backends
def test_scatter_gather_i2v(ndim=3, leng... | [
"dexp.utils.backends.Backend.get_xp_module",
"numpy.random.default_rng",
"dexp.utils.backends.Backend.to_numpy",
"arbol.aprint",
"dexp.processing.utils.scatter_gather_i2v.scatter_gather_i2v",
"dexp.utils.timeit.timeit"
] | [((351, 374), 'dexp.utils.backends.Backend.get_xp_module', 'Backend.get_xp_module', ([], {}), '()\n', (372, 374), False, 'from dexp.utils.backends import Backend\n'), ((385, 408), 'numpy.random.default_rng', 'np.random.default_rng', ([], {}), '()\n', (406, 408), True, 'import numpy as np\n'), ((1079, 1104), 'dexp.utils... |
import multiprocessing
import traceback
from multiprocessing.pool import Pool
class Color():
_RED = "\033[1;31m"
_BLUE = "\033[1;34m"
_YELLOW = "\033[1;93m"
_CYAN = "\033[1;36xm"
_GREEN = "\033[0;32m"
_RESET = "\033[0;0m"
_BOLD = "\033[;1m"
_REVERSE = "\033[;7m"
@staticmethod
... | [
"traceback.format_exc",
"multiprocessing.get_logger"
] | [((723, 751), 'multiprocessing.get_logger', 'multiprocessing.get_logger', ([], {}), '()\n', (749, 751), False, 'import multiprocessing\n'), ((1163, 1185), 'traceback.format_exc', 'traceback.format_exc', ([], {}), '()\n', (1183, 1185), False, 'import traceback\n')] |
from my_mathematics.simple_math import MyMath
import math
import pytest
@pytest.mark.parametrize('x', [0, 1, 2, 3, 4, 5, 0.01, 3e-7, 232, 213123, 392, 921])
def test_check_sine(x):
assert math.sin(x) == MyMath.sin(x)
def test_check_pi():
assert round(math.pi, 2) == MyMath.pi
@pytest.mark.parametrize('x', ... | [
"math.sqrt",
"my_mathematics.simple_math.MyMath.sin",
"pytest.mark.parametrize",
"my_mathematics.simple_math.MyMath.sqrt",
"math.sin"
] | [((75, 164), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""x"""', '[0, 1, 2, 3, 4, 5, 0.01, 3e-07, 232, 213123, 392, 921]'], {}), "('x', [0, 1, 2, 3, 4, 5, 0.01, 3e-07, 232, 213123, \n 392, 921])\n", (98, 164), False, 'import pytest\n'), ((291, 380), 'pytest.mark.parametrize', 'pytest.mark.parametrize'... |
#
# This file is part of CasADi.
#
# CasADi -- A symbolic framework for dynamic optimization.
# Copyright (C) 2010-2014 <NAME>, <NAME>, <NAME>,
# <NAME>. All rights reserved.
# Copyright (C) 2011-2014 <NAME>
#
# CasADi is free software; you can redistribute it and/or
# ... | [
"pickle.dumps",
"pickle.loads",
"unittest.skipIf",
"copy.deepcopy",
"unittest.main",
"operator.itemgetter",
"copy.copy"
] | [((4795, 4861), 'unittest.skipIf', 'unittest.skipIf', (['(sys.version_info >= (3, 0))', '"""too lazy to fix now"""'], {}), "(sys.version_info >= (3, 0), 'too lazy to fix now')\n", (4810, 4861), False, 'import unittest\n'), ((9116, 9131), 'unittest.main', 'unittest.main', ([], {}), '()\n', (9129, 9131), False, 'import u... |
import argparse
import copy
import datetime
import gym
import numpy as np
import itertools
import torch
import csv
import os
import json
from plane_env import Plane
from sac import SAC
from verify import verify_models, generate_agent_simulator
from torch.utils.tensorboard import SummaryWriter
from replay_memory import ... | [
"torch.manual_seed",
"verify.generate_agent_simulator",
"argparse.ArgumentParser",
"verify.verify_models",
"plane_env.Plane",
"datetime.datetime.now",
"itertools.count",
"numpy.random.seed",
"os.mkdir",
"sac.SAC",
"replay_memory.ReplayMemory"
] | [((343, 412), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch Soft Actor-Critic Args"""'}), "(description='PyTorch Soft Actor-Critic Args')\n", (366, 412), False, 'import argparse\n'), ((3258, 3265), 'plane_env.Plane', 'Plane', ([], {}), '()\n', (3263, 3265), False, 'from plane_en... |
from pystac.validation.stac_validator import STACValidator, STACValidationError
from pystac.validation.schema_uri_map import DefaultSchemaUriMap
from pystac import STAC_IO
import json
try:
import jsonschema
except ImportError:
jsonschema = None
class CMIP5SchemaSTACValidator(STACValidator):
"""Validate ... | [
"pystac.validation.schema_uri_map.DefaultSchemaUriMap",
"jsonschema.validators.RefResolver",
"pystac.STAC_IO.read_text",
"jsonschema.validate",
"pystac.validation.stac_validator.STACValidationError"
] | [((1489, 1589), 'jsonschema.validators.RefResolver', 'jsonschema.validators.RefResolver', ([], {'base_uri': 'schema_uri', 'referrer': 'schema', 'store': 'self.schema_cache'}), '(base_uri=schema_uri, referrer=schema,\n store=self.schema_cache)\n', (1522, 1589), False, 'import jsonschema\n'), ((1857, 1930), 'jsonschem... |
import matplotlib.pyplot as plt
import networkx as nx
import random
class Graph:
def __init__(self,vertex):
self.v = vertex
self.graph = []
def add_edge(self, source, destination, weight):
self.graph.append([source, destination, weight])
def algo(self):
parent... | [
"matplotlib.pyplot.gca",
"networkx.spring_layout",
"networkx.Graph",
"networkx.draw_networkx_nodes",
"networkx.draw_networkx_labels",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.axis",
"networkx.draw_networkx_edges",
"random.randint",
"matplotlib.pyplot.show"
] | [((1256, 1283), 'networkx.spring_layout', 'nx.spring_layout', (['G'], {'seed': '(7)'}), '(G, seed=7)\n', (1272, 1283), True, 'import networkx as nx\n'), ((1289, 1334), 'networkx.draw_networkx_nodes', 'nx.draw_networkx_nodes', (['G', 'pos'], {'node_size': '(700)'}), '(G, pos, node_size=700)\n', (1311, 1334), True, 'impo... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | [
"fuxi.i18n._",
"fuxi.utils.get_novaclient",
"oslo_concurrency.lockutils.synchronized",
"fuxi.utils.get_cinderclient",
"fuxi.exceptions.NotFound",
"fuxi.common.state_monitor.StateMonitor",
"os.path.join",
"time.sleep",
"fuxi.exceptions.FuxiException",
"fuxi.common.blockdevice.BlockerDeviceManager",... | [((1083, 1110), 'oslo_log.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1100, 1110), True, 'from oslo_log import log as logging\n'), ((1337, 1386), 'oslo_concurrency.lockutils.synchronized', 'lockutils.synchronized', (['"""openstack-attach-volume"""'], {}), "('openstack-attach-volume')\n", (... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
#The MIT License (MIT)
#
#Copyright (c) 2015 <NAME>
# 2021 <NAME> <EMAIL>
#
#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 restr... | [
"logging.getLogger",
"json.loads",
"os.getenv",
"datetime.datetime.utcnow",
"time.strftime",
"logging.error"
] | [((3427, 3473), 'os.getenv', 'os.getenv', (['"""ELASTICSEARCH_SERVER"""', '"""localhost"""'], {}), "('ELASTICSEARCH_SERVER', 'localhost')\n", (3436, 3473), False, 'import os\n'), ((3507, 3544), 'os.getenv', 'os.getenv', (['"""ELASTICSEARCH_PORT"""', '(9200)'], {}), "('ELASTICSEARCH_PORT', 9200)\n", (3516, 3544), False,... |
from flask import (
Blueprint, flash, g, redirect, render_template, request, url_for
)
from werkzeug.exceptions import abort
from flaskr.blueprints.auth import login_required
from flaskr.schema import DB
from flaskr.schema.post import Post
from flaskr.schema.user import User
# Como nรฃo hรก url_prefix definido, a v... | [
"flask.render_template",
"flask.flash",
"flaskr.schema.DB.session.query",
"flaskr.schema.post.Post.created.desc",
"flaskr.schema.post.Post",
"flask.url_for",
"flaskr.schema.DB.session.add",
"werkzeug.exceptions.abort",
"flaskr.schema.DB.session.delete",
"flask.Blueprint",
"flaskr.schema.DB.sessi... | [((409, 436), 'flask.Blueprint', 'Blueprint', (['"""blog"""', '__name__'], {}), "('blog', __name__)\n", (418, 436), False, 'from flask import Blueprint, flash, g, redirect, render_template, request, url_for\n'), ((617, 664), 'flask.render_template', 'render_template', (['"""blog/index.html"""'], {'posts': 'posts'}), "(... |
#!/opt/homebrew/bin/python3
import sys, argparse, pickle, os
sys.dont_write_bytecode = True
from http import client
from box import do_Box_OAuth
from boxsdk import Client
from boxsdk.exception import BoxAPIException
folder_ids = []
RANSOMWARE_KEY= '.deadbolt'
def get_files():
"""get all the files in the specified... | [
"http.client.folder",
"argparse.ArgumentParser",
"boxsdk.Client",
"http.client.user",
"box.do_Box_OAuth",
"http.client.file",
"sys.exit"
] | [((1225, 1321), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Get details on files in folders hit with ransomware."""'}), "(description=\n 'Get details on files in folders hit with ransomware.')\n", (1248, 1321), False, 'import sys, argparse, pickle, os\n'), ((2014, 2028), 'box.do_Bo... |
from subscenery.scrapper import SubSceneScrapper
from tkinter import Tk, filedialog, Label, Listbox, ACTIVE
from tkinter import ttk
import os
win = Tk()
class Application(Tk):
def __init__(self):
ttk.Button(win, text='Choose a media file', command=self.choose_location_btn).grid(column=0, row=0)
s... | [
"tkinter.ttk.Button",
"tkinter.Tk",
"tkinter.Label",
"tkinter.filedialog.askopenfile",
"tkinter.Listbox",
"subscenery.scrapper.SubSceneScrapper"
] | [((149, 153), 'tkinter.Tk', 'Tk', ([], {}), '()\n', (151, 153), False, 'from tkinter import Tk, filedialog, Label, Listbox, ACTIVE\n'), ((332, 351), 'tkinter.Label', 'Label', (['win'], {'text': '""""""'}), "(win, text='')\n", (337, 351), False, 'from tkinter import Tk, filedialog, Label, Listbox, ACTIVE\n'), ((375, 387... |
"""
Fixed policies to test our sim integration with. These are intended to take
Brain states and return Brain actions.
"""
import random
from typing import Dict
def random_policy(state: Dict = None):
"""
Ignore the state, move randomly.
"""
action = {"hvacON": random.randint(0, 1)}
return action
... | [
"random.randint"
] | [((280, 300), 'random.randint', 'random.randint', (['(0)', '(1)'], {}), '(0, 1)\n', (294, 300), False, 'import random\n')] |
from __future__ import print_function
import sys, codecs, optparse, os
import heapq as heapq
import numpy as np
from heap import *
# pdb.set_trace()
optparser = optparse.OptionParser()
optparser.add_option("-c", "--unigramcounts", dest='counts1w', default=os.path.join('data', 'count_1w.txt'), help="unigram counts")
op... | [
"os.path.join",
"optparse.OptionParser"
] | [((162, 185), 'optparse.OptionParser', 'optparse.OptionParser', ([], {}), '()\n', (183, 185), False, 'import sys, codecs, optparse, os\n'), ((257, 293), 'os.path.join', 'os.path.join', (['"""data"""', '"""count_1w.txt"""'], {}), "('data', 'count_1w.txt')\n", (269, 293), False, 'import sys, codecs, optparse, os\n'), ((3... |
from google.cloud import automl
client = automl.AutoMlClient()
def get_operation_details(operation_id: str):
response = client._transport.operations_client.get_operation(operation_id)
if response.done:
if response.error.code != 0:
operation_status = "Failed"
error_message = re... | [
"google.cloud.automl.AutoMlClient"
] | [((42, 63), 'google.cloud.automl.AutoMlClient', 'automl.AutoMlClient', ([], {}), '()\n', (61, 63), False, 'from google.cloud import automl\n')] |
import pygame
import time
import sys
from pygame.locals import *
pygame.init()
screenWidth,screenHeight = 1600, 900
screen = pygame.display.set_mode((screenWidth, screenHeight))
pygame.display.set_caption("Turing Machine")
tape = [""]
if len(sys.argv) > 2:
tape = list(sys.argv[2])
for i in range(len(tape))... | [
"sys.exit",
"pygame.init",
"pygame.quit",
"pygame.event.get",
"pygame.display.set_mode",
"pygame.draw.rect",
"pygame.display.set_caption",
"pygame.display.update",
"time.time",
"pygame.font.SysFont"
] | [((67, 80), 'pygame.init', 'pygame.init', ([], {}), '()\n', (78, 80), False, 'import pygame\n'), ((129, 181), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(screenWidth, screenHeight)'], {}), '((screenWidth, screenHeight))\n', (152, 181), False, 'import pygame\n'), ((182, 226), 'pygame.display.set_caption', ... |
from functools import wraps
from contextlib import contextmanager
from threading import local
thread_local = local()
from surround.django.logging import setupModuleLogger
setupModuleLogger(globals())
class LocalCacheBackend(object):
def __init__(self):
self.backend = {}
def get(self, key):
r... | [
"threading.local",
"functools.wraps"
] | [((110, 117), 'threading.local', 'local', ([], {}), '()\n', (115, 117), False, 'from threading import local\n'), ((650, 661), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (655, 661), False, 'from functools import wraps\n'), ((1723, 1734), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (1728, 1734), ... |
# encoding: utf-8
from django.forms.models import model_to_dict
from django.db.models import Model
from django.core.files import File
from django.db.models.fields.files import FieldFile
from rest_framework import serializers, relations, fields as rest_fields
from datetime import datetime
from enum import Enum
from core... | [
"collections.OrderedDict",
"json.loads",
"yaml.safe_dump",
"json.dumps",
"django.forms.models.model_to_dict"
] | [((623, 636), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (634, 636), False, 'from collections import OrderedDict\n'), ((1769, 1782), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (1780, 1782), False, 'from collections import OrderedDict\n'), ((3570, 3611), 'json.dumps', 'json.dumps', (['o... |
import classad
import collections
import concurrent
import datetime
import htcondor
import logging
import os
import sys
import time
from configparser import NoSectionError, NoOptionError
from . import Executor
logger = logging.getLogger(__name__)
# context in strategy pattern
class HTCondor(Executor):
def __in... | [
"logging.getLogger",
"os.path.exists",
"os.path.join",
"logging.warning",
"time.sleep",
"htcondor.Schedd",
"sys.exit"
] | [((223, 250), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (240, 250), False, 'import logging\n'), ((729, 746), 'htcondor.Schedd', 'htcondor.Schedd', ([], {}), '()\n', (744, 746), False, 'import htcondor\n'), ((852, 892), 'os.path.join', 'os.path.join', (['handler.optdir', 'executable']... |
#!/usr/bin/env python3
import os
import sys
import argparse
import logging
from typing import List, Optional, Union, Dict, Tuple
from datetime import datetime, timedelta
from sqlalchemy import create_engine
import rx
import rx.operators as ops
from rx.subject import AsyncSubject, Subject, BehaviorSubject, ReplaySubje... | [
"rx.subject.BehaviorSubject",
"logging.debug",
"ibapi.wrapper.EWrapper.__init__",
"rx.subject.Subject",
"ibapi.client.EClient.__init__",
"ibapi.contract.Contract",
"logging.info",
"logging.error"
] | [((5431, 5441), 'ibapi.contract.Contract', 'Contract', ([], {}), '()\n', (5439, 5441), False, 'from ibapi.contract import Contract\n'), ((1238, 1274), 'ibapi.client.EClient.__init__', 'EClient.__init__', (['self'], {'wrapper': 'self'}), '(self, wrapper=self)\n', (1254, 1274), False, 'from ibapi.client import EClient\n'... |
import squareseqdigit
def test_squareseqdigit_1():
assert squareseqdigit.square_sequence_digit(1) == 1, " square_sequence_digit(1) == 1 "
def test_squareseqdigit_2():
assert squareseqdigit.square_sequence_digit(2) == 4, " square_sequence_digit(2) == 4 "
def test_squareseqdigit_3():
assert squareseqdig... | [
"squareseqdigit.square_sequence_digit"
] | [((64, 103), 'squareseqdigit.square_sequence_digit', 'squareseqdigit.square_sequence_digit', (['(1)'], {}), '(1)\n', (100, 103), False, 'import squareseqdigit\n'), ((186, 225), 'squareseqdigit.square_sequence_digit', 'squareseqdigit.square_sequence_digit', (['(2)'], {}), '(2)\n', (222, 225), False, 'import squareseqdig... |
"""
This node is the communication layer betweeen the USR Ros subsystem and the stepper motor controllers.
"""
#TODO: add recieving info from the stepper controller
import rclpy
from rclpy.node import Node
import yaml
import serial, time
from enum import Enum
from motion_controller_msgs.msg import Mobility
class Co... | [
"rclpy.spin",
"yaml.load",
"time.sleep",
"serial.Serial",
"rclpy.init",
"rclpy.shutdown"
] | [((4590, 4611), 'rclpy.init', 'rclpy.init', ([], {'args': 'args'}), '(args=args)\n', (4600, 4611), False, 'import rclpy\n'), ((4693, 4713), 'rclpy.spin', 'rclpy.spin', (['sub_node'], {}), '(sub_node)\n', (4703, 4713), False, 'import rclpy\n'), ((4781, 4797), 'rclpy.shutdown', 'rclpy.shutdown', ([], {}), '()\n', (4795, ... |
#!/usr/bin/env python2.7
# Run as:
# python setup.py install --user
# -- Standard boilerplate header - begin
import unittest as ut
import sys, os
from os.path import abspath, dirname
from os.path import join as osjoin
cdir = dirname(abspath(__file__)) # sys.argv[0])) = # testdir
pdir = dirname(cdir) ... | [
"pandas.Series",
"sys.path.insert",
"numpy.random.rand",
"pandas.DataFrame",
"os.path.join",
"pandas.DataFrame.from_dict",
"os.path.dirname",
"numpy.array",
"pandas.to_numeric",
"testutils.run_tests",
"os.path.abspath",
"numpy.matrix"
] | [((291, 304), 'os.path.dirname', 'dirname', (['cdir'], {}), '(cdir)\n', (298, 304), False, 'from os.path import abspath, dirname\n'), ((331, 351), 'os.path.join', 'osjoin', (['pdir', '"""mhut"""'], {}), "(pdir, 'mhut')\n", (337, 351), True, 'from os.path import join as osjoin\n'), ((352, 378), 'sys.path.insert', 'sys.p... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import sqrt
from policies.base import Net
class Actor(Net):
def __init__(self):
super(Actor, self).__init__()
def forward(self):
raise NotImplementedError
def get_action(self):
raise NotImplementedError
class Linear_Ac... | [
"torch.tanh",
"torch.distributions.Normal",
"torch.nn.ModuleList",
"torch.nn.LSTMCell",
"torch.stack",
"torch.nn.Linear",
"torch.zeros"
] | [((449, 482), 'torch.nn.Linear', 'nn.Linear', (['state_dim', 'hidden_size'], {}), '(state_dim, hidden_size)\n', (458, 482), True, 'import torch.nn as nn\n'), ((497, 531), 'torch.nn.Linear', 'nn.Linear', (['hidden_size', 'action_dim'], {}), '(hidden_size, action_dim)\n', (506, 531), True, 'import torch.nn as nn\n'), ((1... |
import datetime
import urllib.request, urllib.parse, urllib.error
import logging
import threading
import subprocess
# Common packages
from typing import Dict
from modules.common.TqdmUpTo import TqdmUpTo
# Decorator for the threading parameter.
def threaded(fn):
def wrapper(*args, **kwargs):
thread = thr... | [
"logging.getLogger",
"threading.Thread",
"datetime.datetime.today",
"subprocess.Popen"
] | [((447, 474), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (464, 474), False, 'import logging\n'), ((317, 370), 'threading.Thread', 'threading.Thread', ([], {'target': 'fn', 'args': 'args', 'kwargs': 'kwargs'}), '(target=fn, args=args, kwargs=kwargs)\n', (333, 370), False, 'import threa... |
import argparse
import os
import ScanInPlexCommon as Common
from ScanInPlexConfiguration import Configure
from ScanInPlexUninstaller import Uninstall
from ScanInPlexScanner import Scanner
class ScanInPlexRouter:
def __init__(self):
self.valid = True
if os.name.lower() != 'nt':
self.vali... | [
"os.name.lower",
"argparse.ArgumentParser",
"ScanInPlexScanner.Scanner",
"ScanInPlexConfiguration.Configure",
"os.system",
"ScanInPlexUninstaller.Uninstall"
] | [((534, 660), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'usage': '"""ScanInPlex.py [-h] [-c [-p HOST] [-t TOKEN] [-w] [-v | -q]] | [-s -d DIR] | -u [-q]"""'}), "(usage=\n 'ScanInPlex.py [-h] [-c [-p HOST] [-t TOKEN] [-w] [-v | -q]] | [-s -d DIR] | -u [-q]'\n )\n", (557, 660), False, 'import argp... |
import json
import logging
from rabbitmq_client import RMQProducer, QueueParams
from util import get_arg
from defs import CLI_HUME_UUID, HINTCommand
LOGGER = logging.getLogger(__name__)
HINT_MASTER_COMMAND_QUEUE = "hint_master"
_producer: RMQProducer
_hint_queue_params = QueueParams(HINT_MASTER_COMMAND_QUEUE, durab... | [
"logging.getLogger",
"util.get_arg",
"json.dumps",
"rabbitmq_client.QueueParams"
] | [((161, 188), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (178, 188), False, 'import logging\n'), ((276, 328), 'rabbitmq_client.QueueParams', 'QueueParams', (['HINT_MASTER_COMMAND_QUEUE'], {'durable': '(True)'}), '(HINT_MASTER_COMMAND_QUEUE, durable=True)\n', (287, 328), False, 'from r... |
import pygame
from pygame.locals import *
import cv2
import numpy as np
import sys
import os
from time import sleep
import random
import tensorflow as tf
from utils import visualization_utils as viz_utils
class RockPaperScissors():
def __init__(self):
pygame.init()
# TENSORFLOW MODEL
self.detect_fn = tf.sav... | [
"pygame.init",
"pygame.quit",
"numpy.array",
"cv2.destroyAllWindows",
"numpy.rot90",
"sys.exit",
"pygame.font.Font",
"pygame.surfarray.make_surface",
"pygame.transform.scale",
"tensorflow.saved_model.load",
"pygame.time.get_ticks",
"pygame.display.set_mode",
"pygame.image.load",
"pygame.di... | [((257, 270), 'pygame.init', 'pygame.init', ([], {}), '()\n', (268, 270), False, 'import pygame\n'), ((314, 404), 'tensorflow.saved_model.load', 'tf.saved_model.load', (['"""../tensorflow_object_detection_api/inference_graph/saved_model"""'], {}), "(\n '../tensorflow_object_detection_api/inference_graph/saved_model'... |
# -*- coding: utf-8 -*-
###########################################################################
## Python code generated with wxFormBuilder (version 3.10.0-35-gd79d7781)
## http://www.wxformbuilder.org/
##
## PLEASE DO *NOT* EDIT THIS FILE!
##########################################################################... | [
"part_select_panel.PartSelectPanel",
"wx.Button",
"wx.BitmapToggleButton",
"wx.Colour",
"wx.MenuBar",
"wx.BoxSizer",
"wx.Size",
"wx.StaticText",
"bitmap_panel.BitmapPanel",
"wx.MenuItem",
"wx.SystemSettings.GetColour",
"wx.Menu",
"wx.stc.StyledTextCtrl",
"wx.Panel",
"wx.ListCtrl",
"wx.... | [((1039, 1065), 'wx.BoxSizer', 'wx.BoxSizer', (['wx.HORIZONTAL'], {}), '(wx.HORIZONTAL)\n', (1050, 1065), False, 'import wx\n'), ((1087, 1111), 'wx.BoxSizer', 'wx.BoxSizer', (['wx.VERTICAL'], {}), '(wx.VERTICAL)\n', (1098, 1111), False, 'import wx\n'), ((1152, 1258), 'bitmap_panel.BitmapPanel', 'BitmapPanel', (['self',... |
""" This module contains the World class. """
from copy import deepcopy
import numpy as np
from models.object import Window
class World:
"""
Contains all objects that are supposed to be drawn in the viewport.
In this class comments, the actual slice of the world that is being
shown, is r... | [
"numpy.negative",
"models.object.Window",
"copy.deepcopy"
] | [((1017, 1040), 'copy.deepcopy', 'deepcopy', (['self._objects'], {}), '(self._objects)\n', (1025, 1040), False, 'from copy import deepcopy\n'), ((618, 638), 'models.object.Window', 'Window', (['*window_size'], {}), '(*window_size)\n', (624, 638), False, 'from models.object import Window\n'), ((1267, 1301), 'numpy.negat... |
import os
from keras.layers import Input, Dense, Conv2D, MaxPooling2D, UpSampling2D
from keras.models import Model
from keras import backend as K
def model():
input_img = Input(shape=(6, 20, 20))
x = Conv2D(filters = 32, kernel_size = (3, 3), strides = (1,1), padding = 'same', activation='relu')(input_i... | [
"keras.layers.Conv2D",
"keras.layers.UpSampling2D",
"keras.layers.MaxPooling2D",
"keras.layers.Input",
"keras.models.Model"
] | [((182, 206), 'keras.layers.Input', 'Input', ([], {'shape': '(6, 20, 20)'}), '(shape=(6, 20, 20))\n', (187, 206), False, 'from keras.layers import Input, Dense, Conv2D, MaxPooling2D, UpSampling2D\n'), ((1067, 1092), 'keras.models.Model', 'Model', (['input_img', 'decoded'], {}), '(input_img, decoded)\n', (1072, 1092), F... |
import math
l, a, p, r = map(int, input().split())
dia = math.sqrt((l*l)+(a*a)+(p*p))
if dia <= 2*r:
print("S")
else:
print("N") | [
"math.sqrt"
] | [((59, 91), 'math.sqrt', 'math.sqrt', (['(l * l + a * a + p * p)'], {}), '(l * l + a * a + p * p)\n', (68, 91), False, 'import math\n')] |
import praw
import prawcore
import requests
import pprint
import json
import time
from crawler_lib import send_message, keyword_match
import ConfigParser
config = ConfigParser.ConfigParser()
config.read('/etc/reddit-crawler/config.ini')
reddit = praw.Reddit(user_agent=config.get('reddit','user_agent'),
... | [
"crawler_lib.keyword_match",
"time.time",
"time.sleep",
"ConfigParser.ConfigParser"
] | [((164, 191), 'ConfigParser.ConfigParser', 'ConfigParser.ConfigParser', ([], {}), '()\n', (189, 191), False, 'import ConfigParser\n'), ((857, 884), 'crawler_lib.keyword_match', 'keyword_match', (['comment.body'], {}), '(comment.body)\n', (870, 884), False, 'from crawler_lib import send_message, keyword_match\n'), ((136... |
import time
Q1 = input("Who do you like: ")
Q2 = input("Who do you hate: ")
Answer = f"I love {Q2} but hate {Q1}"
print(Answer)
time.sleep(3) | [
"time.sleep"
] | [((130, 143), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (140, 143), False, 'import time\n')] |
# -*- coding: utf-8 -*-
#
# Unless explicitly stated otherwise all files in this repository are licensed
# under the Apache 2 License.
#
# This product includes software developed at Datadog
# (https://www.datadoghq.com/).
#
# Copyright 2018 Datadog, Inc.
#
"""EnvironmentVariableService"""
from os import environ
fro... | [
"os.environ.get"
] | [((1701, 1715), 'os.environ.get', 'environ.get', (['e'], {}), '(e)\n', (1712, 1715), False, 'from os import environ\n'), ((1775, 1789), 'os.environ.get', 'environ.get', (['e'], {}), '(e)\n', (1786, 1789), False, 'from os import environ\n')] |
"""Initialise and run the bot."""
import logging
from discord import Activity
from discord import ActivityType
from discord import AllowedMentions
from discord import Intents
from discord_slash import SlashCommand
from obsidion import _update_event_loop_policy
from obsidion.core import get_settings
from obsidion.core.... | [
"logging.getLogger",
"discord.AllowedMentions",
"obsidion.core.get_settings",
"obsidion.core.bot.Obsidion",
"discord.Intents.none",
"obsidion._update_event_loop_policy",
"discord_slash.SlashCommand"
] | [((341, 368), 'obsidion._update_event_loop_policy', '_update_event_loop_policy', ([], {}), '()\n', (366, 368), False, 'from obsidion import _update_event_loop_policy\n'), ((376, 405), 'logging.getLogger', 'logging.getLogger', (['"""obsidion"""'], {}), "('obsidion')\n", (393, 405), False, 'import logging\n'), ((539, 595... |
from datetime import datetime, timezone, timedelta
from io import StringIO
from pytest import mark, raises
from preacher.core.value import ValueContext, RelativeDatetime
from preacher.compilation.yaml import YamlError, load
def test_given_datetime_that_is_offset_naive():
stream = StringIO('2020-04-01 01:23:45')... | [
"datetime.datetime",
"preacher.compilation.yaml.load",
"datetime.timedelta",
"pytest.mark.parametrize",
"datetime.datetime.now",
"pytest.raises",
"io.StringIO",
"preacher.core.value.ValueContext"
] | [((783, 1088), 'pytest.mark.parametrize', 'mark.parametrize', (["('content', 'expected_message')", '[(\'!relative_datetime []\', \'", line 1, column 1\'), (\n """\n- !relative_datetime invalid""", \'", line 2, column 3\'), (\n \'!relative_datetime {delta: invalid}\', \'", line 1, column 28\'), (\n \'!relative_... |
import os
from datetime import datetime
from .proxmoxbalancer import ProxmoxBalancer
def balance():
print("Started at %s" % datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
if "https_proxy" in os.environ:
del os.environ["https_proxy"]
balancer = ProxmoxBalancer()
balancer.balance()
print("... | [
"datetime.datetime.now"
] | [((130, 144), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (142, 144), False, 'from datetime import datetime\n'), ((338, 352), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (350, 352), False, 'from datetime import datetime\n')] |
# -*- coding: UTF-8 -*-
import openpyxl
import shutil
import os
import const_define
# active sheet name
# print(workbook.active)
# load excel file
workbook = openpyxl.load_workbook(const_define.DETAILED_LEDGER_FULL_PATH, data_only=True)
# get all sheet name
# worksheets = workbook.get_sheet_names()
worksheets = tupl... | [
"openpyxl.load_workbook"
] | [((161, 239), 'openpyxl.load_workbook', 'openpyxl.load_workbook', (['const_define.DETAILED_LEDGER_FULL_PATH'], {'data_only': '(True)'}), '(const_define.DETAILED_LEDGER_FULL_PATH, data_only=True)\n', (183, 239), False, 'import openpyxl\n')] |
import numpy as np
'''
!! ๊ธฐ๋ณธ์ ์ธ ๊ฐ๋
1์ฐจ์ = ๋ฒกํฐ
2์ฐจ์ = ํ๋ ฌ
3์ฐจ์ = ํ
์
4์ฐจ์ ๋ถํฐ๋ ์ฐ๋ฆฌ๋ 3์ฐจ์์ ์ธ์์์ ์ด๊ณ ์๊ธฐ ๋๋ฌธ์ 4์ฐจ์ ์ด์๋ถํฐ๋ ๋จธ๋ฆฌ๋ก ์๊ฐํ๊ธฐ ์ด๋ ต๋ค.
2์ฐจ์ ํ
์
2์ฐจ์ ํ
์๋ฅผ ํ๋ ฌ์ด๋ผ๊ณ ๋งํ๋ค.
|t| = (batch size, dim)
batch size = "ํ" / dim = "์ด"
3์ฐจ์ ํ
์
3์ฐจ์ ํ
์๋ ๊ทธ๋ฅ ํ
์๋ผ๊ณ ๋ถ๋ฅธ๋ค.
|t| = (batch size, width, height)
batch size = "์ธ๋ก" / width = "๊ฐ๋ก" / height = "๋์ด" (์
์ฒด์ ์ธ ๋ถ๋ถ)
... | [
"torch.ones_like",
"torch.stack",
"numpy.array",
"torch.zeros_like",
"torch.FloatTensor",
"torch.cat"
] | [((342, 387), 'numpy.array', 'np.array', (['[0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0]'], {}), '([0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0])\n', (350, 387), True, 'import numpy as np\n'), ((641, 700), 'numpy.array', 'np.array', (['[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 9]]'], {}), '([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.... |
# -*- coding: utf-8 -*-
from django.conf.urls import url
from progressbarupload.views import upload_progress
urlpatterns = [
url(r'^upload_progress$', upload_progress, name="upload_progress"),
]
| [
"django.conf.urls.url"
] | [((130, 195), 'django.conf.urls.url', 'url', (['"""^upload_progress$"""', 'upload_progress'], {'name': '"""upload_progress"""'}), "('^upload_progress$', upload_progress, name='upload_progress')\n", (133, 195), False, 'from django.conf.urls import url\n')] |
import time
from celery import chain
from celery_app import app
@app.task
def add(x, y):
return x + y
'''
ref. http://docs.celeryq.org/en/latest/userguide/tasks.html#avoid-launching-synchronous-subtasks
'''
def chain_demo(x, y):
# add_demo -> mul_demo -> insert_db_demo
chain(add_demo.s(x, y), mul_d... | [
"celery_app.app.task",
"time.sleep"
] | [((490, 518), 'celery_app.app.task', 'app.task', ([], {'ignore_result': '(True)'}), '(ignore_result=True)\n', (498, 518), False, 'from celery_app import app\n'), ((389, 402), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (399, 402), False, 'import time\n'), ((456, 469), 'time.sleep', 'time.sleep', (['(3)'], {}), ... |
# Time: O(n)
# Space: O(n)
# Given a string, find the first non-repeating character in it and
# return it's index. If it doesn't exist, return -1.
#
# Examples:
#
# s = "leetcode"
# return 0.
#
# s = "loveleetcode",
# return 2.
# Note: You may assume the string contain only lowercase letters.
from collections impor... | [
"collections.defaultdict"
] | [((473, 489), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (484, 489), False, 'from collections import defaultdict\n')] |
import listexpscanner
import listexpparser
import sys
def main():
if (len(sys.argv)) != 2:
print("usage: listexp filename")
print(" listexp will interpret/compile the expression in the file named")
print(" filename and print its result to standard output")
return
... | [
"listexpparser.listexpParser",
"listexpscanner.listexpScanner"
] | [((366, 401), 'listexpscanner.listexpScanner', 'listexpscanner.listexpScanner', (['strm'], {}), '(strm)\n', (395, 401), False, 'import listexpscanner\n'), ((418, 447), 'listexpparser.listexpParser', 'listexpparser.listexpParser', ([], {}), '()\n', (445, 447), False, 'import listexpparser\n')] |
import numpy as np
X = 2 * np.random.randn(100, 5)
y = 2.5382 * np.cos(X[:, 3]) + X[:, 0] ** 2 - 0.5
from pysr import PySRRegressor
model = PySRRegressor(
niterations=40,
binary_operators=["+", "*"],
unary_operators=[
"cos",
"exp",
"sin",
"inv(x) = 1/x", # Custom operator... | [
"pysr.PySRRegressor",
"numpy.random.randn",
"numpy.cos"
] | [((143, 321), 'pysr.PySRRegressor', 'PySRRegressor', ([], {'niterations': '(40)', 'binary_operators': "['+', '*']", 'unary_operators': "['cos', 'exp', 'sin', 'inv(x) = 1/x']", 'model_selection': '"""best"""', 'loss': '"""loss(x, y) = (x - y)^2"""'}), "(niterations=40, binary_operators=['+', '*'], unary_operators=\n ... |
#!/usr/bin/env python3
""" Perform some operations on Android method CFGs to output a more
comprehensive global app graph. """
import argparse
import os.path
import logging
from acfg_tools.builder.cfg_analyser import CfgAnalyser
DESCRIPTION = "Create a global app graph from CFGs"
log = logging.getLogger("branchexp"... | [
"logging.getLogger",
"acfg_tools.builder.cfg_analyser.CfgAnalyser",
"argparse.ArgumentParser"
] | [((291, 321), 'logging.getLogger', 'logging.getLogger', (['"""branchexp"""'], {}), "('branchexp')\n", (308, 321), False, 'import logging\n'), ((352, 400), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'DESCRIPTION'}), '(description=DESCRIPTION)\n', (375, 400), False, 'import argparse\n'), (... |
import json
import os
import cv2
import numpy as np
from dgp.datasets.synchronized_dataset import SynchronizedScene
from dgp.utils.visualization_engine import visualize_dataset_3d, visualize_dataset_2d, visualize_dataset_sample_3d, visualize_dataset_sample_2d
from tests import TEST_DATA_DIR
def dummy_caption(datase... | [
"os.path.exists",
"numpy.allclose",
"dgp.utils.visualization_engine.visualize_dataset_sample_3d",
"dgp.utils.visualization_engine.visualize_dataset_2d",
"os.path.join",
"dgp.utils.visualization_engine.visualize_dataset_3d",
"dgp.datasets.synchronized_dataset.SynchronizedScene",
"cv2.imread",
"os.rem... | [((498, 611), 'os.path.join', 'os.path.join', (['TEST_DATA_DIR', '"""dgp"""', '"""test_scene/scene_01/scene_a8dc5ed1da0923563f85ea129f0e0a83e7fe1867.json"""'], {}), "(TEST_DATA_DIR, 'dgp',\n 'test_scene/scene_01/scene_a8dc5ed1da0923563f85ea129f0e0a83e7fe1867.json')\n", (510, 611), False, 'import os\n'), ((671, 871),... |
#T# the following code shows how to draw a point of concurrency
#T# to draw a point of concurrency, the pyplot module of the matplotlib package is used
import matplotlib.pyplot as plt
#T# create the figure and axes
fig1, ax1 = plt.subplots(1, 1)
#T# set the aspect of the axes
ax1.set_aspect('equal', adjustable = 'bo... | [
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((229, 247), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(1)'], {}), '(1, 1)\n', (241, 247), True, 'import matplotlib.pyplot as plt\n'), ((1103, 1113), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1111, 1113), True, 'import matplotlib.pyplot as plt\n')] |
import numpy as np
import serial
import struct
import threading
import time
from array import array
from datetime import datetime
class ImuData:
def __init__(self, t=0.0, freq=0, ypr=np.zeros(3), a=np.zeros(3), \
W=np.zeros(3)):
self.t = t
self.freq = freq
self.ypr = ypr
... | [
"threading.Thread.__init__",
"array.array",
"threading.Lock",
"time.sleep",
"numpy.array",
"numpy.zeros",
"struct.unpack",
"serial.Serial",
"datetime.datetime.now"
] | [((191, 202), 'numpy.zeros', 'np.zeros', (['(3)'], {}), '(3)\n', (199, 202), True, 'import numpy as np\n'), ((206, 217), 'numpy.zeros', 'np.zeros', (['(3)'], {}), '(3)\n', (214, 217), True, 'import numpy as np\n'), ((235, 246), 'numpy.zeros', 'np.zeros', (['(3)'], {}), '(3)\n', (243, 246), True, 'import numpy as np\n')... |
import unittest
import os
import warnings
from ml4ir.base.data import ranklib_helper
import pandas as pd
warnings.filterwarnings("ignore")
INPUT_FILE = "ml4ir/applications/ranking/tests/data/ranklib/train/sample.txt"
OUTPUT_FILE = "ml4ir/applications/ranking/tests/data/ranklib/train/sample_ml4ir.csv"
QUERY_ID_NAME =... | [
"pandas.read_csv",
"ml4ir.base.data.ranklib_helper.ranklib_to_csv",
"unittest.main",
"warnings.filterwarnings",
"os.remove"
] | [((107, 140), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (130, 140), False, 'import warnings\n'), ((1297, 1312), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1310, 1312), False, 'import unittest\n'), ((596, 744), 'ml4ir.base.data.ranklib_helper.ranklib_to_csv',... |
from tkinter import filedialog
from tkinter import *
from PIL import Image, ImageTk
from tkinter.messagebox import showinfo
class InfoWindow(object):
def __init__(self,master):
top=self.top=Toplevel(master)
self.infoLabel=Label(top,text="Please Enter file resoltuion with ; to separate values")
... | [
"tkinter.filedialog.askopenfilename"
] | [((2702, 2730), 'tkinter.filedialog.askopenfilename', 'filedialog.askopenfilename', ([], {}), '()\n', (2728, 2730), False, 'from tkinter import filedialog\n')] |
#!/usr/bin/env python
import sys
import os
import subprocess
import functools
import collections
# Parameters
lbann_dir = subprocess.check_output(["git", "rev-parse", "--show-toplevel"]).strip()
lbann_proto_dir = lbann_dir + "/src/proto/"
work_dir = lbann_dir + "/model_zoo/models/vram"
template_proto = l... | [
"subprocess.check_output",
"lbann_pb2.LbannPB",
"os.putenv",
"subprocess.call",
"google.protobuf.text_format.MessageToString",
"sys.path.append"
] | [((16506, 16533), 'os.putenv', 'os.putenv', (['"""PROTOC"""', 'protoc'], {}), "('PROTOC', protoc)\n", (16515, 16533), False, 'import os\n'), ((16538, 16664), 'subprocess.call', 'subprocess.call', (["('cd ' + proto_python_dir + '; ' + sys.executable + ' ' + proto_python_dir +\n '/setup.py build')"], {'shell': '(True)... |
"""
WSGI config for lncRNAediting project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from os.path import join,dirname,abspath
PROJECT_DIR = dirname(dirname(abspath(__... | [
"os.path.abspath",
"django.core.wsgi.get_wsgi_application",
"sys.path.insert"
] | [((342, 373), 'sys.path.insert', 'sys.path.insert', (['(0)', 'PROJECT_DIR'], {}), '(0, PROJECT_DIR)\n', (357, 373), False, 'import sys\n'), ((582, 604), 'django.core.wsgi.get_wsgi_application', 'get_wsgi_application', ([], {}), '()\n', (602, 604), False, 'from django.core.wsgi import get_wsgi_application\n'), ((310, 32... |