code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
from collections import Counter # Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def dfs(self, cur): if cur: self.subsum += cur.val yield...
[ "collections.Counter" ]
[((855, 864), 'collections.Counter', 'Counter', ([], {}), '()\n', (862, 864), False, 'from collections import Counter\n')]
# coding: utf-8 # In[1]: import numpy as np import cv2 import matplotlib import matplotlib.pyplot as plt import matplotlib as mpimg import numpy as np from IPython.display import HTML import os, sys import glob import moviepy from moviepy.editor import VideoFileClip from moviepy.editor import * from IPython import ...
[ "numpy.absolute", "numpy.sum", "cv2.bitwise_and", "numpy.argmax", "cv2.getPerspectiveTransform", "numpy.polyfit", "cv2.fillPoly", "numpy.mean", "glob.glob", "cv2.rectangle", "cv2.inRange", "cv2.undistort", "cv2.warpPerspective", "numpy.zeros_like", "numpy.int_", "cv2.cvtColor", "nump...
[((487, 522), 'numpy.zeros', 'np.zeros', (['img.shape'], {'dtype': 'np.uint8'}), '(img.shape, dtype=np.uint8)\n', (495, 522), True, 'import numpy as np\n'), ((553, 630), 'numpy.array', 'np.array', (['[[(200, 675), (1200, 675), (700, 430), (500, 430)]]'], {'dtype': 'np.int32'}), '([[(200, 675), (1200, 675), (700, 430), ...
from blspy import AugSchemeMPL from src.types.coin_solution import CoinSolution from src.types.spend_bundle import SpendBundle from src.wallet.puzzles import p2_delegated_puzzle from src.wallet.puzzles.puzzle_utils import make_create_coin_condition from tests.util.key_tool import KeyTool from src.util.ints import uin...
[ "src.wallet.derive_keys.master_sk_to_wallet_sk", "src.types.spend_bundle.SpendBundle", "src.types.coin_solution.CoinSolution", "src.wallet.puzzles.puzzle_utils.make_create_coin_condition", "tests.util.key_tool.KeyTool", "src.util.ints.uint32" ]
[((943, 952), 'tests.util.key_tool.KeyTool', 'KeyTool', ([], {}), '()\n', (950, 952), False, 'from tests.util.key_tool import KeyTool\n'), ((1564, 1592), 'src.types.coin_solution.CoinSolution', 'CoinSolution', (['coin', 'solution'], {}), '(coin, solution)\n', (1576, 1592), False, 'from src.types.coin_solution import Co...
import json from typing import TYPE_CHECKING, Any, Dict import hathor from hathor.conf import HathorSettings from hathor.p2p.messages import ProtocolMessages from hathor.p2p.states.base import BaseState from hathor.p2p.utils import get_genesis_short_hash, get_settings_hello_dict if TYPE_CHECKING: from hathor.p2p....
[ "json.loads", "hathor.p2p.utils.get_genesis_short_hash", "json.dumps", "hathor.p2p.utils.get_settings_hello_dict", "hathor.conf.HathorSettings" ]
[((377, 393), 'hathor.conf.HathorSettings', 'HathorSettings', ([], {}), '()\n', (391, 393), False, 'from hathor.conf import HathorSettings\n'), ((3115, 3140), 'hathor.p2p.utils.get_settings_hello_dict', 'get_settings_hello_dict', ([], {}), '()\n', (3138, 3140), False, 'from hathor.p2p.utils import get_genesis_short_has...
import pandas as pd import numpy as np import matplotlib.pyplot as plt from .instant_function import data_vars def create_categorical_onehot(df,category_columns): category_dataframe = [] for category_column in category_columns: category_dataframe.append(pd.get_dummies(df[category_column],prefix='col_'...
[ "pandas.get_dummies", "numpy.sum", "pandas.concat" ]
[((377, 414), 'pandas.concat', 'pd.concat', (['category_dataframe'], {'axis': '(1)'}), '(category_dataframe, axis=1)\n', (386, 414), True, 'import pandas as pd\n'), ((1204, 1275), 'pandas.concat', 'pd.concat', (['[norm_continuos_columns, category_dataframe_feature]'], {'axis': '(1)'}), '([norm_continuos_columns, catego...
# Generated by Django 3.0.4 on 2020-05-18 10:18 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('character', '0004_auto_20200518_1215'), ] operations = [ migrations.AlterField( model_name='character', name='notes'...
[ "django.db.models.TextField" ]
[((340, 397), 'django.db.models.TextField', 'models.TextField', ([], {'blank': '(True)', 'default': '""""""', 'max_length': '(1000)'}), "(blank=True, default='', max_length=1000)\n", (356, 397), False, 'from django.db import migrations, models\n')]
# Required modules and libraries from telegram.ext import Updater, CommandHandler, InlineQueryHandler, MessageHandler, Filters import telegram from telegram import InlineQueryResultArticle, ParseMode, \ InputTextMessageContent import requests import wikipediaapi import re from uuid import uuid4 # Varia...
[ "uuid.uuid4", "telegram.InputTextMessageContent", "telegram.ext.InlineQueryHandler", "telegram.ext.Updater", "telegram.Bot", "telegram.ext.MessageHandler", "wikipediaapi.Wikipedia", "telegram.ext.CommandHandler", "re.search" ]
[((343, 371), 'wikipediaapi.Wikipedia', 'wikipediaapi.Wikipedia', (['"""fa"""'], {}), "('fa')\n", (365, 371), False, 'import wikipediaapi\n'), ((2332, 2372), 'telegram.ext.Updater', 'Updater', ([], {'token': '"""TOKEN"""', 'use_context': '(True)'}), "(token='TOKEN', use_context=True)\n", (2339, 2372), False, 'from tele...
from data import DataSeq from bubblesort import BubbleSort from bucketsort import BucketSort from combsort import CombSort from cyclesort import CycleSort from heapsort import HeapSort from insertionsort import InsertionSort from mergesort import MergeSort from monkeysort import MonkeySort from quicksort import QuickSo...
[ "data.DataSeq", "argparse.ArgumentParser" ]
[((451, 507), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Sort Visulization"""'}), "(description='Sort Visulization')\n", (474, 507), False, 'import argparse\n'), ((1654, 1784), 'data.DataSeq', 'DataSeq', (['Length'], {'time_interval': 'Interval', 'sort_title': 'SortType', 'is_resampl...
# -*- coding:utf-8 -*- # @Time : 2019-12-27 16:11 # @Author : liuqiuxi # @Email : <EMAIL> # @File : stockfeedswinddatabase.py # @Project : datafeeds # @Software: PyCharm # @Remark : This is class of stock market import datetime import copy import pandas as pd import numpy as np from datafeeds.ut...
[ "pandas.DataFrame", "copy.deepcopy", "datafeeds.utils.BarFeedConfig.get_wind_database_items", "datafeeds.utils.BarFeedConfig.get_wind", "pandas.merge", "datafeeds.logger.get_logger", "pandas.isnull", "datetime.datetime.strptime", "numpy.where", "pandas.concat" ]
[((1741, 1797), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': "{'dateTime': data.loc[:, 'dateTime']}"}), "(data={'dateTime': data.loc[:, 'dateTime']})\n", (1753, 1797), True, 'import pandas as pd\n'), ((5383, 5423), 'datafeeds.logger.get_logger', 'logger.get_logger', ([], {'name': 'self.LOGGER_NAME'}), '(name=self....
#! /usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2011 Butiá Team <EMAIL> # Butia is a free open plataform for robotics projects # www.fing.edu.uy/inco/proyectos/butia # Universidad de la República del Uruguay # # This program is free software; you can redistribute it and/or modify # it under the terms ...
[ "plugins.plugin.Plugin.__init__", "math.atan2", "TurtleArt.taprimitive.ArgSlot", "TurtleArt.taprimitive.Primitive", "apiSumoUY.apiSumoUY", "gettext.gettext" ]
[((1186, 1207), 'plugins.plugin.Plugin.__init__', 'Plugin.__init__', (['self'], {}), '(self)\n', (1201, 1207), False, 'from plugins.plugin import Plugin\n'), ((1303, 1324), 'apiSumoUY.apiSumoUY', 'apiSumoUY.apiSumoUY', ([], {}), '()\n', (1322, 1324), False, 'import apiSumoUY\n'), ((1412, 1423), 'gettext.gettext', '_', ...
import sys import os class SrtFormatter(): def _secs_to_minutes_hours(self , time): add_formatting = lambda a: '0' + a if len(a) == 1 else a milli_secs = time - int(time) secs = add_formatting(str(int(time)%60)) mins = add_formatting((int(time)//60).__str__()) h...
[ "os.getcwd", "os.sep.join" ]
[((971, 982), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (980, 982), False, 'import os\n'), ((1108, 1130), 'os.sep.join', 'os.sep.join', (['path_list'], {}), '(path_list)\n', (1119, 1130), False, 'import os\n')]
import cv2 import tensorflow as tf import numpy as np from keras.models import Model from keras.models import load_model from numpy import asarray from PIL import Image, ImageOps import azure_get_unet as azure_predict # Since we are using the Azure API, there is not need to save the model to the local filesystem # mod...
[ "cv2.VideoWriter_fourcc", "tensorflow.argmax", "cv2.cvtColor", "numpy.asarray", "numpy.expand_dims", "PIL.ImageOps.grayscale", "cv2.addWeighted", "PIL.Image.fromarray", "cv2.VideoCapture", "numpy.array", "numpy.squeeze" ]
[((474, 498), 'numpy.expand_dims', 'np.expand_dims', (['image', '(0)'], {}), '(image, 0)\n', (488, 498), True, 'import numpy as np\n'), ((556, 577), 'numpy.squeeze', 'np.squeeze', (['result', '(0)'], {}), '(result, 0)\n', (566, 577), True, 'import numpy as np\n'), ((589, 610), 'tensorflow.argmax', 'tf.argmax', (['resul...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Mar 20 15:55:46 2019 @author: dweckler """ import numpy as np, matplotlib.pyplot as plt from keras import backend as T import time import os from .utilities import flat_avg from dtmil.configuration.config_dtmil import get_json_config_data from .predic...
[ "numpy.abs", "matplotlib.pyplot.figure", "numpy.mean", "numpy.arange", "os.path.join", "matplotlib.pyplot.tight_layout", "numpy.full", "numpy.copy", "numpy.std", "numpy.transpose", "os.path.exists", "numpy.append", "matplotlib.pyplot.subplots", "dtmil.configuration.config_dtmil.get_json_co...
[((22688, 22699), 'time.time', 'time.time', ([], {}), '()\n', (22697, 22699), False, 'import time\n'), ((23198, 23244), 'os.path.join', 'os.path.join', (['model_output_directory', 'filename'], {}), '(model_output_directory, filename)\n', (23210, 23244), False, 'import os\n'), ((1321, 1371), 'numpy.arange', 'np.arange',...
import threading def DisconnectAfterTimeout(timeout): def Decorator(function): def decorated_function(*s, **d): def disconnect(): disconnectable = s[0] disconnectable.disconnect() timer = threading.Timer(timeout, disconnect) timer.start()...
[ "threading.Timer" ]
[((258, 294), 'threading.Timer', 'threading.Timer', (['timeout', 'disconnect'], {}), '(timeout, disconnect)\n', (273, 294), False, 'import threading\n')]
from decimal import Decimal import unittest, sys import pandas as pd import numpy as np from datetime import datetime, timedelta from unittest.mock import patch from forex_predictor.data_extraction.process_raw_data import create_relevant_data_row, create_row, find_start_date_index, get_dataframe_from_dates, get_dates, ...
[ "forex_predictor.data_extraction.process_raw_data.apply_category_label_binary", "pandas.read_csv", "forex_predictor.data_extraction.process_raw_data.get_dataframe_from_dates", "forex_predictor.data_extraction.process_raw_data.set_const_intervals", "sys.exc_info", "forex_predictor.data_extraction.process_r...
[((2459, 2519), 'unittest.mock.patch', 'patch', (['"""forex_predictor.data_extraction.process_raw_data.pd"""'], {}), "('forex_predictor.data_extraction.process_raw_data.pd')\n", (2464, 2519), False, 'from unittest.mock import patch\n'), ((3954, 4046), 'unittest.mock.patch', 'patch', (['"""forex_predictor.data_extractio...
""" Copyright (c) Facebook, Inc. and its affiliates. """ import os import unittest import logging from base_agent.nsp_dialogue_manager import NSPDialogueManager from base_agent.loco_mc_agent import LocoMCAgent from base_agent.test.all_test_commands import * from fake_agent import MockOpt class AttributeDict(dict): ...
[ "unittest.main", "os.path.dirname", "fake_agent.MockOpt", "base_agent.nsp_dialogue_manager.NSPDialogueManager" ]
[((1275, 1300), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1290, 1300), False, 'import os\n'), ((1372, 1397), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1387, 1397), False, 'import os\n'), ((1473, 1498), 'os.path.dirname', 'os.path.dirname', (['__file__'],...
# -*- coding: utf-8 -*- import uuid import hashlib from datetime import datetime from flask import current_app, request from flask.ext.login import UserMixin, AnonymousUserMixin from werkzeug.security import generate_password_hash, check_password_hash from itsdangerous import TimedJSONWebSignatureSerializer as Serial...
[ "uuid.uuid4", "datetime.datetime.utcnow", "werkzeug.security.check_password_hash", "itsdangerous.TimedJSONWebSignatureSerializer", "werkzeug.security.generate_password_hash" ]
[((1649, 1681), 'werkzeug.security.generate_password_hash', 'generate_password_hash', (['password'], {}), '(password)\n', (1671, 1681), False, 'from werkzeug.security import generate_password_hash, check_password_hash\n'), ((1739, 1788), 'werkzeug.security.check_password_hash', 'check_password_hash', (['self.password_h...
# data predicting import pickle import numpy as np from sklearn.metrics import mean_squared_error import matplotlib.pyplot as plt from MLEK.main.optimizer import Minimizer from MLEK.tools.plot_tools import plot_prediction with open('/Users/hongbinren/Documents/program/MLEK/example_demo/demo_best_estimator', 'rb') ...
[ "MLEK.tools.plot_tools.plot_prediction", "MLEK.main.optimizer.Minimizer", "pickle.load" ]
[((1221, 1241), 'MLEK.main.optimizer.Minimizer', 'Minimizer', (['estimator'], {}), '(estimator)\n', (1230, 1241), False, 'from MLEK.main.optimizer import Minimizer\n'), ((1347, 1422), 'MLEK.tools.plot_tools.plot_prediction', 'plot_prediction', (['Ek_test', 'Ek_predict', 'densx_true', 'densx_predict', 'densx_init'], {})...
from django.urls import path from . import views app_name = "charts" urlpatterns = [ path("", views.home, name="dashboard"), ]
[ "django.urls.path" ]
[((92, 130), 'django.urls.path', 'path', (['""""""', 'views.home'], {'name': '"""dashboard"""'}), "('', views.home, name='dashboard')\n", (96, 130), False, 'from django.urls import path\n')]
__author__ = '<NAME>' __date__ = '2019-05-11' __license__ = 'MIT License' import logging log = logging.getLogger(__name__) def log_call(fn): def inner(*args, **kwargs): log.debug('Function %s called with %s and %s', fn.__name__, args, kwargs) return fn(*args, **kwargs) return inner
[ "logging.getLogger" ]
[((97, 124), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (114, 124), False, 'import logging\n')]
import argparse def get_args(): """ Utility for getting the arguments from the user for running the experiment :return: parsed arguments """ # Env parser = argparse.ArgumentParser(description='collect arguments') parser.add_argument('--save_dir', type=str, default="results/grid/sarsa/")...
[ "argparse.ArgumentParser" ]
[((184, 240), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""collect arguments"""'}), "(description='collect arguments')\n", (207, 240), False, 'import argparse\n')]
import sensor_msgs.msg from sensor_msgs.msg import * from . import point_cloud2 import importlib msg = importlib.import_module('sensor_msgs.msg') point_cloud2 = importlib.import_module('sensor_msgs.point_cloud2') __all__ = ['msg', 'point_cloud2']
[ "importlib.import_module" ]
[((104, 146), 'importlib.import_module', 'importlib.import_module', (['"""sensor_msgs.msg"""'], {}), "('sensor_msgs.msg')\n", (127, 146), False, 'import importlib\n'), ((162, 213), 'importlib.import_module', 'importlib.import_module', (['"""sensor_msgs.point_cloud2"""'], {}), "('sensor_msgs.point_cloud2')\n", (185, 213...
"""Basic facade for the exiftool executable""" # Public import os.path import shlex import subprocess import sys # Internal import exiftoolinst class ExiftoolWrap: _path = None _path_to_binary = None def __init__(self, path=""): self._path = path self._detect_installation() # ...
[ "subprocess.Popen" ]
[((4857, 4946), 'subprocess.Popen', 'subprocess.Popen', (['command'], {'stdout': 'subprocess.PIPE', 'stderr': 'subprocess.PIPE', 'shell': '(True)'}), '(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE,\n shell=True)\n', (4873, 4946), False, 'import subprocess\n')]
#!/usr/bin/env python import numpy as np np.random.seed(42) import emcee def lnprior(params): return 0.0 def lnlike(params, x, y): model = params[0] * x + params[1] residuals = y - model return -np.sum(residuals ** 2) def lnprob(params, x, y): lnp = lnprior(params) if np.isfinite(lnp): ...
[ "numpy.random.uniform", "numpy.sum", "numpy.random.seed", "numpy.random.randn", "numpy.isfinite", "numpy.array", "numpy.random.normal" ]
[((43, 61), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (57, 61), True, 'import numpy as np\n'), ((299, 315), 'numpy.isfinite', 'np.isfinite', (['lnp'], {}), '(lnp)\n', (310, 315), True, 'import numpy as np\n'), ((534, 570), 'numpy.random.normal', 'np.random.normal', (['(0)', '(3)', 'real_x.shape']...
import a0 import time def callback(pkt): print(f'Recieved reply: {pkt.payload.decode("utf-8")}') print("Waiting 1ms for response") client = a0.RpcClient("topic") client.send("client msg", callback) time.sleep(0.001) print("Done!")
[ "a0.RpcClient", "time.sleep" ]
[((148, 169), 'a0.RpcClient', 'a0.RpcClient', (['"""topic"""'], {}), "('topic')\n", (160, 169), False, 'import a0\n'), ((206, 223), 'time.sleep', 'time.sleep', (['(0.001)'], {}), '(0.001)\n', (216, 223), False, 'import time\n')]
def main(trainer, args, myargs): config = myargs.config from template_lib.utils import seed_utils seed_utils.set_random_seed(config.seed) if args.evaluate: trainer.evaluate() return if args.resume: trainer.resume() elif args.finetune: trainer.finetune() # Load dataset trainer.datas...
[ "template_lib.utils.seed_utils.set_random_seed" ]
[((107, 146), 'template_lib.utils.seed_utils.set_random_seed', 'seed_utils.set_random_seed', (['config.seed'], {}), '(config.seed)\n', (133, 146), False, 'from template_lib.utils import seed_utils\n')]
import collections import unittest from snmpagent_unity import agent, enums from snmpagent_unity import exceptions as snmp_ex from snmpagent_unity.tests import patches from pysnmp.smi import error as smi_ex SERVICE_ID_MD5 = (1, 3, 6, 1, 6, 3, 10, 1, 1, 2) SERVICE_ID_SHA = (1, 3, 6, 1, 6, 3, 10, 1, 1, 3) SERVICE_ID_D...
[ "collections.OrderedDict", "snmpagent_unity.agent.SNMPEngine" ]
[((2387, 2412), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (2410, 2412), False, 'import collections\n'), ((2590, 2635), 'snmpagent_unity.agent.SNMPEngine', 'agent.SNMPEngine', (['array_config', 'access_config'], {}), '(array_config, access_config)\n', (2606, 2635), False, 'from snmpagent_un...
import re import sre_constants from functools import wraps from html import unescape import requests import redis import lxml from bs4 import BeautifulSoup from flask import request class RedisDict: def __init__(self, **redis_kwargs): self.__db = redis.Redis(**redis_kwargs) def __len__(self): ...
[ "redis.Redis", "flask.request.args.get", "functools.wraps", "requests.get", "bs4.BeautifulSoup", "flask.request.get_json", "re.compile" ]
[((1059, 1151), 'requests.get', 'requests.get', (['"""http://rick.measham.id.au/paste/explain.pl"""'], {'params': "{'regex': expression}"}), "('http://rick.measham.id.au/paste/explain.pl', params={'regex':\n expression})\n", (1071, 1151), False, 'import requests\n'), ((1200, 1229), 'bs4.BeautifulSoup', 'BeautifulSou...
import os import unittest import tempfile from testfixtures import compare, Replacer, replace from testfixtures.popen import MockPopen from testfixtures.mock import call from popper.config import ConfigLoader from popper.runner import WorkflowRunner from popper.parser import WorkflowParser from popper.runner_slurm im...
[ "box.Box", "popper.runner_slurm.SlurmRunner", "popper.runner_slurm.SingularityRunner", "testfixtures.Replacer", "testfixtures.popen.MockPopen", "os.getcwd", "testfixtures.replace", "popper.runner.WorkflowRunner", "popper.config.ConfigLoader.load", "popper.parser.WorkflowParser.parse", "popper.cl...
[((1750, 1799), 'testfixtures.replace', 'replace', (['"""popper.runner_slurm.os.kill"""', 'mock_kill'], {}), "('popper.runner_slurm.os.kill', mock_kill)\n", (1757, 1799), False, 'from testfixtures import compare, Replacer, replace\n'), ((3749, 3798), 'testfixtures.replace', 'replace', (['"""popper.runner_slurm.os.kill"...
# Copyright 2019 The TensorNetwork 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 applicable law or agreed ...
[ "tensornetwork.backends.backend_factory.get_backend" ]
[((2874, 2919), 'tensornetwork.backends.backend_factory.get_backend', 'backends.backend_factory.get_backend', (['backend'], {}), '(backend)\n', (2910, 2919), False, 'from tensornetwork import backends\n')]
from dataclasses import dataclass from functools import cached_property from pyramid.request import Request from h.models import Organization from h.traversal.root import Root, RootFactory class OrganizationRoot(RootFactory): """Root factory for routes which deal with organizations.""" def __getitem__(self...
[ "h.traversal.root.Root" ]
[((804, 822), 'h.traversal.root.Root', 'Root', (['self.request'], {}), '(self.request)\n', (808, 822), False, 'from h.traversal.root import Root, RootFactory\n')]
import random import sc2 from sc2.player import Bot, Computer import protoss_agent if __name__ == '__main__': enemy_race = random.choice([sc2.Race.Protoss, sc2.Race.Terran, sc2.Race.Zerg, sc2.Race.Random]) sc2.run_game(sc2.maps.get("Simple128"), [Bot(sc2.Race.Protoss, protoss_agent.ProtossRu...
[ "sc2.player.Computer", "protoss_agent.ProtossRushBot", "random.choice", "sc2.maps.get" ]
[((130, 217), 'random.choice', 'random.choice', (['[sc2.Race.Protoss, sc2.Race.Terran, sc2.Race.Zerg, sc2.Race.Random]'], {}), '([sc2.Race.Protoss, sc2.Race.Terran, sc2.Race.Zerg, sc2.Race.\n Random])\n', (143, 217), False, 'import random\n'), ((230, 255), 'sc2.maps.get', 'sc2.maps.get', (['"""Simple128"""'], {}), "...
import random if __name__ == '__main__': sentences = [] with open('../data/crowded_300k.txt', encoding='utf-8') as f: for line in f: line = line.strip().split('\t') sentences.append(line[1]) sentences.append(line[2]) random.shuffle(sentences) sentences = sen...
[ "random.shuffle" ]
[((275, 300), 'random.shuffle', 'random.shuffle', (['sentences'], {}), '(sentences)\n', (289, 300), False, 'import random\n')]
#!/usr/bin/env python # # ---------------------------------------------------------------------- # # <NAME>, U.S. Geological Survey # <NAME>, GNS Science # <NAME>, University of Chicago # # This code was developed as part of the Computational Infrastructure # for Geodynamics (http://geodynamics.org). # # Copyright (c) ...
[ "numpy.dot", "pyre.components.Component.Component.__init__" ]
[((1128, 1182), 'pyre.components.Component.Component.__init__', 'Component.__init__', (['self', 'name'], {'facility': '"""formulation"""'}), "(self, name, facility='formulation')\n", (1146, 1182), False, 'from pyre.components.Component import Component\n'), ((1485, 1540), 'numpy.dot', 'numpy.dot', (['K', '(integrator.f...
import numpy as np from pprint import pprint def cal_eigenvalues_and_eigenvectors(A): """ :param A: n x n Hermitian matrix :return: """ eigenvalues, normed_eigenvectors = np.linalg.eig(A) # Below two steps are redounding for readability lmd = eigenvalues v = normed_eigenvectors re...
[ "numpy.abs", "numpy.linalg.eig", "numpy.random.randint", "pprint.pprint", "numpy.random.rand", "numpy.linalg.det", "numpy.delete" ]
[((194, 210), 'numpy.linalg.eig', 'np.linalg.eig', (['A'], {}), '(A)\n', (207, 210), True, 'import numpy as np\n'), ((369, 385), 'numpy.linalg.det', 'np.linalg.det', (['M'], {}), '(M)\n', (382, 385), True, 'import numpy as np\n'), ((590, 623), 'numpy.random.randint', 'np.random.randint', ([], {'low': '(3)', 'high': '(1...
import unittest from sparkel.nlp.words import word_count class WordsTestCase(unittest.TestCase): def setUp(self): self.text = u"This is an simple test case for Spark and Bazel!" # <prefix>_<function_name> def test_word_count(self): expectation = 10 actual = word_count(self.text)...
[ "unittest.main", "sparkel.nlp.words.word_count" ]
[((354, 369), 'unittest.main', 'unittest.main', ([], {}), '()\n', (367, 369), False, 'import unittest\n'), ((299, 320), 'sparkel.nlp.words.word_count', 'word_count', (['self.text'], {}), '(self.text)\n', (309, 320), False, 'from sparkel.nlp.words import word_count\n')]
# Copyright 2016-2020 Blue Marble Analytics LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
[ "unittest.main", "importlib.import_module", "tests.common_functions.add_components_and_load_data", "tests.project.operations.common_functions.get_project_operational_timepoints", "sys.exit", "tests.common_functions.create_abstract_model" ]
[((1842, 1910), 'importlib.import_module', 'import_module', (["('.' + NAME_OF_MODULE_BEING_TESTED)"], {'package': '"""gridpath"""'}), "('.' + NAME_OF_MODULE_BEING_TESTED, package='gridpath')\n", (1855, 1910), False, 'from importlib import import_module\n'), ((9899, 9914), 'unittest.main', 'unittest.main', ([], {}), '()...
import logging from logging.handlers import TimedRotatingFileHandler import os def configure_logging(name): logging.getLogger().setLevel(logging.DEBUG) console_handler = logging.StreamHandler() console_handler.setLevel(logging.INFO) logging.getLogger().addHandler(console_handler) log_filename = ...
[ "os.path.abspath", "os.path.dirname", "logging.StreamHandler", "logging.Formatter", "os.environ.get", "logging.getLogger" ]
[((181, 204), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (202, 204), False, 'import logging\n'), ((460, 489), 'os.path.dirname', 'os.path.dirname', (['log_filename'], {}), '(log_filename)\n', (475, 489), False, 'import os\n'), ((756, 829), 'logging.Formatter', 'logging.Formatter', (['"""%(ascti...
#!usr/bin/python3 # -*- coding: utf-8 -*- # Included modules import html import codecs import imghdr import os import shutil import tempfile from urllib.request import urlretrieve from urllib.parse import urljoin from hashlib import md5 # Third party modules import requests import bs4 from bs4 import...
[ "os.remove", "urllib.parse.urljoin", "codecs.open", "tempfile.mkstemp", "os.path.getsize", "os.path.exists", "imghdr.what", "urllib.request.urlretrieve", "requests.get", "bs4.BeautifulSoup", "os.path.join", "html.escape", "shutil.copy" ]
[((2548, 2594), 'os.path.join', 'os.path.join', (['css_directory', "(css_name + '.css')"], {}), "(css_directory, css_name + '.css')\n", (2560, 2594), False, 'import os\n'), ((2621, 2650), 'os.path.exists', 'os.path.exists', (['full_css_path'], {}), '(full_css_path)\n', (2635, 2650), False, 'import os\n'), ((3231, 3291)...
from datetime import date from . import GenericCalendarTest from ..africa.mozambique import Mozambique class MozambiqueTest(GenericCalendarTest): cal_class = Mozambique def test_year_new_year_shift(self): holidays = self.cal.holidays_set(2019) self.assertIn(date(2019, 1, 1), holidays) ...
[ "datetime.date" ]
[((286, 302), 'datetime.date', 'date', (['(2019)', '(1)', '(1)'], {}), '(2019, 1, 1)\n', (290, 302), False, 'from datetime import date\n'), ((339, 355), 'datetime.date', 'date', (['(2019)', '(1)', '(2)'], {}), '(2019, 1, 2)\n', (343, 355), False, 'from datetime import date\n'), ((436, 452), 'datetime.date', 'date', (['...
# yellowbrick.utils.helpers # Helper functions and generic utilities for use in Yellowbrick code. # # Author: <NAME> <<EMAIL>> # Created: Fri May 19 10:39:30 2017 -0700 # # Copyright (C) 2017 District Data Labs # For license information, see LICENSE.txt # # ID: helpers.py [79cd8cf] <EMAIL> $ """ Helper functions an...
[ "numpy.true_divide", "numpy.isscalar", "numpy.asarray", "numpy.isfinite", "numpy.errstate", "numpy.arange", "re.sub", "numpy.all", "numpy.in1d" ]
[((1986, 2005), 'numpy.arange', 'np.arange', (['(0)', 'ncols'], {}), '(0, ncols)\n', (1995, 2005), True, 'import numpy as np\n'), ((2589, 2602), 'numpy.asarray', 'np.asarray', (['a'], {}), '(a)\n', (2599, 2602), True, 'import numpy as np\n'), ((2838, 2869), 'numpy.all', 'np.all', (['(a[1:] <= a[:-1])'], {'axis': '(0)'}...
import os def str2bool(v): if v is None or isinstance(v, bool): return v return v.lower() in ("yes", "true", "t", "1") def str2int(v): if v is None: return v if v == "": return None return int(v) def str2float(v): if v is None: return v return int(v) c...
[ "os.getenv" ]
[((416, 502), 'os.getenv', 'os.getenv', (['"""DATABASE_MYSQL_URL"""', '"""root:dSSALHwSsCiXzPr@192.168.0.126:3306/fastapi"""'], {}), "('DATABASE_MYSQL_URL',\n 'root:dSSALHwSsCiXzPr@192.168.0.126:3306/fastapi')\n", (425, 502), False, 'import os\n'), ((599, 648), 'os.getenv', 'os.getenv', (['"""SERVICE_NAME"""', '"""f...
from cryptojwt.utils import as_bytes def get_session_status_page(service_context, looked_for_state): """ Constructs the session status check page :param service_context: The relying party's service context :param looked_for_state: Expecting state to be ? (changed/unchanged) """ _msg = open(se...
[ "cryptojwt.utils.as_bytes" ]
[((880, 898), 'cryptojwt.utils.as_bytes', 'as_bytes', (['_mod_msg'], {}), '(_mod_msg)\n', (888, 898), False, 'from cryptojwt.utils import as_bytes\n')]
from rlxp.envs import GridWorld from rlxp.rendering import render_env2d env = GridWorld(7, 10, walls=((2,2), (3,3))) env.enable_rendering() for tt in range(50): env.step(env.action_space.sample()) render_env2d(env)
[ "rlxp.envs.GridWorld", "rlxp.rendering.render_env2d" ]
[((80, 120), 'rlxp.envs.GridWorld', 'GridWorld', (['(7)', '(10)'], {'walls': '((2, 2), (3, 3))'}), '(7, 10, walls=((2, 2), (3, 3)))\n', (89, 120), False, 'from rlxp.envs import GridWorld\n'), ((203, 220), 'rlxp.rendering.render_env2d', 'render_env2d', (['env'], {}), '(env)\n', (215, 220), False, 'from rlxp.rendering im...
import random, pylab random.seed(1) def getMeanAndStd(X): mean = sum(X)/float(len(X)) tot = 0.0 for x in X: tot += (x - mean)**2 std = (tot/len(X))**0.5 return mean, std # GENERATING NORMALLY DISTRIBUTED DATA #============================================================================== ...
[ "pylab.title", "random.randint", "pylab.ylabel", "random.random", "random.seed", "pylab.xlabel", "pylab.legend" ]
[((21, 35), 'random.seed', 'random.seed', (['(1)'], {}), '(1)\n', (32, 35), False, 'import random, pylab\n'), ((2776, 2814), 'pylab.title', 'pylab.title', (['"""Rolling Continuous Dice"""'], {}), "('Rolling Continuous Dice')\n", (2787, 2814), False, 'import random, pylab\n'), ((2815, 2836), 'pylab.xlabel', 'pylab.xlabe...
import discord import youtube_dl import os from discord.ext import commands from discord.utils import get from discord import FFmpegPCMAudio bot = commands.Bot(command_prefix='.') vol = 100 @bot.event async def on_ready(): print("Logged in as: " + bot.user.name + "\n") game = discord.Game("поиск дома") a...
[ "discord.utils.get", "os.remove", "os.rename", "os.system", "os.environ.get", "os.path.isfile", "discord.Game", "youtube_dl.YoutubeDL", "discord.FFmpegPCMAudio", "discord.ext.commands.Bot", "os.listdir" ]
[((148, 180), 'discord.ext.commands.Bot', 'commands.Bot', ([], {'command_prefix': '"""."""'}), "(command_prefix='.')\n", (160, 180), False, 'from discord.ext import commands\n'), ((3829, 3852), 'os.environ.get', 'os.environ.get', (['"""TOKEN"""'], {}), "('TOKEN')\n", (3843, 3852), False, 'import os\n'), ((288, 314), 'd...
# Copyright (c) 2016, MD2K Center of Excellence # 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 conditio...
[ "cerebralcortex.data_processor.signalprocessing.rip.correct_valley_position", "cerebralcortex.data_processor.signalprocessing.rip.filter_intercept_outlier", "cerebralcortex.data_processor.signalprocessing.rip.remove_close_valley_peak_pair", "cerebralcortex.data_processor.signalprocessing.rip.filter_small_amp_...
[((28847, 28862), 'unittest.main', 'unittest.main', ([], {}), '()\n', (28860, 28862), False, 'import unittest\n'), ((2307, 2334), 'pytz.timezone', 'pytz.timezone', (['"""US/Eastern"""'], {}), "('US/Eastern')\n", (2320, 2334), False, 'import pytz\n'), ((3283, 3305), 'cerebralcortex.kernel.datatypes.datastream.DataStream...
''' Notice how this file does not import syshub or know about it in any way. ''' import sys def say_something(): print('hello') def input_something(): print('prompt: ', end='') print(sys.stdin.readline()) def raise_something(): raise ValueError
[ "sys.stdin.readline" ]
[((196, 216), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n', (214, 216), False, 'import sys\n')]
import logging import flask from flask_wtf import FlaskForm as Form from pydantic import SecretStr from werkzeug import Response from wtforms import PasswordField, StringField, validators from overhave.authorization import IAdminAuthorizationManager from overhave.entities import SystemUserModel logger = logging.getL...
[ "wtforms.validators.input_required", "flask.flash", "pydantic.SecretStr", "flask.url_for", "wtforms.PasswordField", "logging.getLogger" ]
[((308, 335), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (325, 335), False, 'import logging\n'), ((733, 834), 'wtforms.PasswordField', 'PasswordField', (['"""Password"""'], {'render_kw': "{'placeholder': 'Password', 'icon': 'glyphicon-certificate'}"}), "('Password', render_kw={'placeh...
import unittest import random from skiplist import SkipList class SkipListTest(unittest.TestCase): def setUp(self): self.sl = SkipList() def test_insert(self): key, data = random.randint(0, 1 << 20), 'SkipList' self.sl[key] = data self.assertEqual(self.sl[key], data) de...
[ "unittest.main", "skiplist.SkipList", "random.randint" ]
[((2141, 2156), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2154, 2156), False, 'import unittest\n'), ((141, 151), 'skiplist.SkipList', 'SkipList', ([], {}), '()\n', (149, 151), False, 'from skiplist import SkipList\n'), ((200, 226), 'random.randint', 'random.randint', (['(0)', '(1 << 20)'], {}), '(0, 1 << 20)...
# evaluate a decision tree on the entire small dataset from numpy import mean from numpy import std from sklearn.datasets import make_classification from sklearn.model_selection import cross_val_score from sklearn.model_selection import RepeatedStratifiedKFold from sklearn.tree import DecisionTreeClassifier # define da...
[ "numpy.std", "sklearn.model_selection.cross_val_score", "sklearn.model_selection.RepeatedStratifiedKFold", "sklearn.datasets.make_classification", "sklearn.tree.DecisionTreeClassifier", "numpy.mean" ]
[((333, 434), 'sklearn.datasets.make_classification', 'make_classification', ([], {'n_samples': '(1000)', 'n_features': '(3)', 'n_informative': '(2)', 'n_redundant': '(1)', 'random_state': '(1)'}), '(n_samples=1000, n_features=3, n_informative=2,\n n_redundant=1, random_state=1)\n', (352, 434), False, 'from sklearn....
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
[ "aiida.backends.sqlalchemy.models.computer.DbComputer.query.filter_by", "aiida.backends.sqlalchemy.models.base.Base.metadata.create_all", "aiida.backends.sqlalchemy.get_scoped_session", "aiida.backends.sqlalchemy.models.computer.DbComputer.delete", "aiida.backends.sqlalchemy.utils.install_tc", "aiida.back...
[((1297, 1344), 'sqlalchemy.orm.sessionmaker', 'sessionmaker', ([], {'expire_on_commit': 'expire_on_commit'}), '(expire_on_commit=expire_on_commit)\n', (1309, 1344), False, 'from sqlalchemy.orm import sessionmaker\n'), ((2694, 2707), 'aiida.orm.implementation.sqlalchemy.backend.SqlaBackend', 'SqlaBackend', ([], {}), '(...
import os import tensorflow as tf import os from PIL import Image import numpy as np import cv2 from preprocessing import preprocessing_factory from google.protobuf import text_format def main(_): labels = [] ''' # Let's read our pbtxt file into a Graph protobuf f = open("C:/Users/turnt/OneDrive/Des...
[ "numpy.argmax", "tensorflow.Session", "PIL.Image.open", "preprocessing.preprocessing_factory.get_preprocessing", "numpy.round", "tensorflow.import_graph_def", "tensorflow.compat.v1.GraphDef", "tensorflow.app.run", "tensorflow.io.gfile.GFile" ]
[((707, 730), 'tensorflow.compat.v1.GraphDef', 'tf.compat.v1.GraphDef', ([], {}), '()\n', (728, 730), True, 'import tensorflow as tf\n'), ((1159, 1268), 'PIL.Image.open', 'Image.open', (['"""C:/Users/turnt/OneDrive/Desktop/Rob0Workspace/Scene_labeler/input_images/test/001.jpg"""'], {}), "(\n 'C:/Users/turnt/OneDrive...
# <NAME> <<EMAIL>> import math from .Round import Round ##__________________________________________________________________|| class RoundLog(object): """Binning with equal width in log scale Parameters ---------- width : float or int, default 1 The common logarithm (log10) of the width. ...
[ "math.log10", "math.isinf" ]
[((3688, 3703), 'math.isinf', 'math.isinf', (['val'], {}), '(val)\n', (3698, 3703), False, 'import math\n'), ((3980, 3995), 'math.log10', 'math.log10', (['val'], {}), '(val)\n', (3990, 3995), False, 'import math\n'), ((4453, 4468), 'math.log10', 'math.log10', (['bin'], {}), '(bin)\n', (4463, 4468), False, 'import math\...
import numpy as np import pyqtgraph as pg from PyQt5.QtCore import Qt from PyQt5.QtGui import QFont, QColor from PyQt5.QtWidgets import QFrame, QWidget, QLabel, QGridLayout, QGroupBox, QDoubleSpinBox, QPushButton,\ QTabWidget, QComboBox, QRadioButton, QHBoxLayout, QVBoxLayout, QTreeWidget, QTreeWidgetItem from EG...
[ "EGGS_labrad.clients.Widgets.QCustomGroupBox", "PyQt5.QtGui.QColor", "PyQt5.QtWidgets.QGridLayout", "PyQt5.QtWidgets.QPushButton", "PyQt5.QtWidgets.QVBoxLayout", "PyQt5.QtWidgets.QTabWidget", "PyQt5.QtWidgets.QLabel", "PyQt5.QtWidgets.QWidget", "PyQt5.QtWidgets.QRadioButton", "numpy.power", "PyQ...
[((15426, 15447), 'EGGS_labrad.clients.runGUI', 'runGUI', (['stability_gui'], {}), '(stability_gui)\n', (15432, 15447), False, 'from EGGS_labrad.clients import runGUI\n'), ((533, 563), 'PyQt5.QtWidgets.QWidget.__init__', 'QWidget.__init__', (['self', 'parent'], {}), '(self, parent)\n', (549, 563), False, 'from PyQt5.Qt...
""" Dev: <NAME> Date: 11/17/19 Program: Cpu vs Cpu War game """ import random def victoryScreen(player, hands): """Prints a personalized victory screen to the terminal""" print('~~~~~~~~~~~~~~~~~~~~~~~~~~') print(f'~~~~~ {player} wins!! ~~~~~') print(f'~~~~~~ In {hands} hands ~~~~~~~...
[ "random.randint" ]
[((485, 506), 'random.randint', 'random.randint', (['(0)', '(14)'], {}), '(0, 14)\n', (499, 506), False, 'import random\n')]
# -- coding: utf-8 -- # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
[ "django.urls.re_path" ]
[((888, 937), 'django.urls.re_path', 're_path', (['"""^types/?$"""', 'api.get_types'], {'name': '"""types"""'}), "('^types/?$', api.get_types, name='types')\n", (895, 937), False, 'from django.urls import re_path\n'), ((944, 1005), 'django.urls.re_path', 're_path', (['"""^instances/?$"""', 'api.get_instances'], {'name'...
from django.shortcuts import render from assignment.forms import CalculationForm from assignment.logic import calculate def calculator(request): ctx = {} if request.method == 'POST': form = CalculationForm(request.POST) if form.is_valid(): ctx.update(calculate(**form.cleaned_data...
[ "django.shortcuts.render", "assignment.logic.calculate", "assignment.forms.CalculationForm" ]
[((401, 435), 'django.shortcuts.render', 'render', (['request', '"""index.html"""', 'ctx'], {}), "(request, 'index.html', ctx)\n", (407, 435), False, 'from django.shortcuts import render\n'), ((210, 239), 'assignment.forms.CalculationForm', 'CalculationForm', (['request.POST'], {}), '(request.POST)\n', (225, 239), Fals...
"""Views for imager_images.""" from django.urls import reverse_lazy from django.views.generic import CreateView, DetailView, ListView, TemplateView, UpdateView from imager_images.forms import AlbumForm, PhotoForm from imager_images.models import Album, Photo class LibraryView(TemplateView): """View for library...
[ "django.urls.reverse_lazy" ]
[((1818, 1841), 'django.urls.reverse_lazy', 'reverse_lazy', (['"""library"""'], {}), "('library')\n", (1830, 1841), False, 'from django.urls import reverse_lazy\n'), ((2222, 2245), 'django.urls.reverse_lazy', 'reverse_lazy', (['"""library"""'], {}), "('library')\n", (2234, 2245), False, 'from django.urls import reverse...
from setuptools import setup, find_packages import os import uwsgiit CLASSIFIERS = [ 'Environment :: Console', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :...
[ "os.path.dirname", "setuptools.find_packages" ]
[((880, 932), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['test_project', 'example.*']"}), "(exclude=['test_project', 'example.*'])\n", (893, 932), False, 'from setuptools import setup, find_packages\n'), ((597, 622), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (612, 62...
import torch import tensorflow as tf import tensorboard as tb # fix a bug with tensorboard tf.io.gfile = tb.compat.tensorflow_stub.io.gfile def log_representation(net, inputs, metadata, writer, step, tag='representation', metadata_header=None, inputs_are_images=False): r""" Computes re...
[ "torch.no_grad" ]
[((963, 978), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (976, 978), False, 'import torch\n')]
import unittest import paramak class TestPortCutterRectangular(unittest.TestCase): def test_creation(self): """Checks a PortCutterRectangular creation.""" test_component = paramak.PortCutterRectangular( distance=3, z_pos=0, height=0.2, width=0.4,...
[ "paramak.PortCutterRectangular" ]
[((198, 337), 'paramak.PortCutterRectangular', 'paramak.PortCutterRectangular', ([], {'distance': '(3)', 'z_pos': '(0)', 'height': '(0.2)', 'width': '(0.4)', 'fillet_radius': '(0.02)', 'azimuth_placement_angle': '[0, 45, 90, 180]'}), '(distance=3, z_pos=0, height=0.2, width=0.4,\n fillet_radius=0.02, azimuth_placeme...
# This Python file uses the following encoding: utf-8 import os, sys import traceback from PyQt5.QtWidgets import * import PyQt5.QtCore import PyQt5.QtGui import PyQt5.uic from PyQt5.uic import * from xml.dom import minidom sys.path.insert(0, os.path.dirname(os.path.realpath(__file__))) from common import lang import ...
[ "os.path.realpath", "traceback.print_exc", "common.lang.Lang" ]
[((260, 286), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (276, 286), False, 'import os, sys\n'), ((2033, 2044), 'common.lang.Lang', 'lang.Lang', ([], {}), '()\n', (2042, 2044), False, 'from common import lang\n'), ((1563, 1584), 'traceback.print_exc', 'traceback.print_exc', ([], {}), '(...
from django.contrib import admin from . models import employees admin.site.register(employees)
[ "django.contrib.admin.site.register" ]
[((65, 95), 'django.contrib.admin.site.register', 'admin.site.register', (['employees'], {}), '(employees)\n', (84, 95), False, 'from django.contrib import admin\n')]
import json from django.http import HttpResponse from admin.decorators import superuser_only from instances.models import Instance from logs.models import Logs def addlogmsg(user, instance, message): """ :param user: :param instance: :param message: :return: """ add_log_msg = Logs(user=u...
[ "logs.models.Logs.objects.filter", "json.dumps", "instances.models.Instance.objects.get", "logs.models.Logs" ]
[((309, 360), 'logs.models.Logs', 'Logs', ([], {'user': 'user', 'instance': 'instance', 'message': 'message'}), '(user=user, instance=instance, message=message)\n', (313, 360), False, 'from logs.models import Logs\n'), ((508, 540), 'instances.models.Instance.objects.get', 'Instance.objects.get', ([], {'name': 'vname'})...
# Copyright (c) 2021 MobileCoin. All rights reserved. from decimal import Decimal import factory import pytz from django.utils import timezone from datetime import timedelta from faker.factory import Factory from faker.providers import date_time, internet, phone_number, lorem Faker = Factory.create fake = Faker() fa...
[ "factory.Faker", "django.utils.timezone.now", "factory.SubFactory", "factory.Sequence", "factory.Iterator", "datetime.timedelta" ]
[((876, 898), 'factory.Faker', 'factory.Faker', (['"""pyint"""'], {}), "('pyint')\n", (889, 898), False, 'import factory\n'), ((910, 957), 'factory.Sequence', 'factory.Sequence', (["(lambda n: f'Mobot Store #{n}')"], {}), "(lambda n: f'Mobot Store #{n}')\n", (926, 957), False, 'import factory\n'), ((977, 1038), 'factor...
import torch import torch.nn as nn import torch.nn.functional as F from ..dct2d import Dct2d EPS = 1e-10 def softmax(a, b, factor=1): concat = torch.cat([a.unsqueeze(-1), b.unsqueeze(-1)], dim=-1) softmax_factors = F.softmax(concat * factor, dim=-1) return a * softmax_factors[:,:,:,:,0] + b * softmax_fact...
[ "torch.nn.Parameter", "torch.nn.Dropout", "torch.mean", "torch.nn.functional.softmax", "torch.exp", "torch.sigmoid", "torch.zeros", "torch.as_tensor", "torch.sum", "torch.log", "torch.tensor" ]
[((225, 259), 'torch.nn.functional.softmax', 'F.softmax', (['(concat * factor)'], {'dim': '(-1)'}), '(concat * factor, dim=-1)\n', (234, 259), True, 'import torch.nn.functional as F\n'), ((893, 919), 'torch.as_tensor', 'torch.as_tensor', (['blocksize'], {}), '(blocksize)\n', (908, 919), False, 'import torch\n'), ((1154...
import os, platform import dapt config = dapt.Config(path='config.json') db = dapt.db.Delimited_file('parameters.csv', delimiter=',') params = dapt.Param(db, config=config) p = params.next_parameters() while p is not None: dapt.tools.create_XML(p, default_settings="PhysiCell_settings_default.xml", save_settings=...
[ "dapt.db.Delimited_file", "dapt.Param", "os.system", "platform.system", "dapt.Config", "dapt.tools.create_XML" ]
[((42, 73), 'dapt.Config', 'dapt.Config', ([], {'path': '"""config.json"""'}), "(path='config.json')\n", (53, 73), False, 'import dapt\n'), ((79, 134), 'dapt.db.Delimited_file', 'dapt.db.Delimited_file', (['"""parameters.csv"""'], {'delimiter': '""","""'}), "('parameters.csv', delimiter=',')\n", (101, 134), False, 'imp...
from django.template import Library from django.forms.models import model_to_dict from django.contrib.auth.models import User from books.models import Book from libraries.models import BookCopy, Lending, Reading register = Library() @register.inclusion_tag('books/tags/book_tag.html') def render_book(book: Book): ...
[ "django.forms.models.model_to_dict", "django.template.Library", "libraries.models.Reading.objects.filter" ]
[((225, 234), 'django.template.Library', 'Library', ([], {}), '()\n', (232, 234), False, 'from django.template import Library\n'), ((329, 348), 'django.forms.models.model_to_dict', 'model_to_dict', (['book'], {}), '(book)\n', (342, 348), False, 'from django.forms.models import model_to_dict\n'), ((1132, 1165), 'librari...
# -*- coding: utf-8 -*- import cPickle from common import json try: import yaml has_yaml = True except ImportError: has_yaml = False from py2xml import PythonToXML from sajson import SimpleAPIEncoder, SimpleAPIDecoder __all__ = ('formatters', 'Formatter') class FormattersSingleton(object): """This...
[ "cPickle.loads", "yaml.safe_dump", "py2xml.PythonToXML", "common.json.dumps", "cPickle.dumps", "yaml.safe_load", "common.json.loads" ]
[((2781, 2820), 'common.json.dumps', 'json.dumps', (['value'], {'cls': 'SimpleAPIEncoder'}), '(value, cls=SimpleAPIEncoder)\n', (2791, 2820), False, 'from common import json\n'), ((3047, 3086), 'common.json.loads', 'json.loads', (['value'], {'cls': 'SimpleAPIDecoder'}), '(value, cls=SimpleAPIDecoder)\n', (3057, 3086), ...
from collections import defaultdict class Fishes(object): def __init__(self, ages): self.ages = defaultdict(int) for age in ages: self.ages[age] += 1 def next_generation(self): new_born = self.ages[0] for i in range(8): self.ages[i] = self.ages[i + 1] ...
[ "collections.defaultdict" ]
[((111, 127), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (122, 127), False, 'from collections import defaultdict\n')]
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Core\native\animation\__init__.py # Compiled at: 2019-04-24 01:24:31 # Size of source mod 2**32: 13189 byte...
[ "_animation.get_joint_name_for_hash_from_rig", "_animation.update_post_condition_arb", "_math.Vector3", "_animation.get_joint_transform_from_rig", "_math.Quaternion", "_animation.get_mirrored_joint_name_hash", "_animation.enable_native_reaction_event_handling", "collections.namedtuple", "native.anim...
[((519, 556), 'sims4.log.Logger', 'sims4.log.Logger', (['"""Animation(Native)"""'], {}), "('Animation(Native)')\n", (535, 556), False, 'import api_config, sims4\n'), ((3234, 3382), 'collections.namedtuple', 'collections.namedtuple', (['"""_ActorDescription"""', "('actor_name', 'actor_name_hash', 'actor_type', 'is_maste...
import colorpennester print ("------------------我是分割线-------------------") movies = ["The Holy Grail", 1975, "<NAME> & <NAME>", 91, ["<NAME>", ["<NAME>", "<NAME>", "<NAME>", "<NAME>", "<NAME>"]]] # 调用函数 # 函数前面需要加上命名空间 -> 名字与包同名 colorpennester.printListMethod(movies,True,0)
[ "colorpennester.printListMethod" ]
[((231, 278), 'colorpennester.printListMethod', 'colorpennester.printListMethod', (['movies', '(True)', '(0)'], {}), '(movies, True, 0)\n', (261, 278), False, 'import colorpennester\n')]
import abc import copy import os from typing import List import torch import wandb from hive.utils.registry import Registrable, registry from hive.utils.schedule import ConstantSchedule, Schedule, get_schedule from hive.utils.utils import Chomp, create_folder class Logger(abc.ABC, Registrable): """Abstract clas...
[ "wandb.log", "hive.utils.registry.registry.register_all", "copy.deepcopy", "wandb.config.update", "wandb.Settings", "hive.utils.utils.Chomp", "wandb.init", "hive.utils.utils.create_folder", "hive.utils.schedule.get_schedule", "hive.utils.schedule.ConstantSchedule", "os.path.join" ]
[((15569, 15726), 'hive.utils.registry.registry.register_all', 'registry.register_all', (['Logger', "{'NullLogger': NullLogger, 'WandbLogger': WandbLogger, 'ChompLogger':\n ChompLogger, 'CompositeLogger': CompositeLogger}"], {}), "(Logger, {'NullLogger': NullLogger, 'WandbLogger':\n WandbLogger, 'ChompLogger': Ch...
import tensorflow as tf from functools import reduce from operator import mul def assert_rank(tensor, expected_rank, name=None): """Raises an exception if the tensor rank is not of the expected rank. Args: tensor: A tf.Tensor to check the rank of. expected_rank: Python integer or list of integ...
[ "tensorflow.nn.elu", "tensorflow.constant_initializer", "tensorflow.reshape", "tensorflow.get_variable_scope", "tensorflow.variable_scope", "tensorflow.concat", "tensorflow.nn.sigmoid", "tensorflow.contrib.layers.batch_norm", "tensorflow.matmul", "tensorflow.shape", "tensorflow.add_to_collection...
[((3106, 3122), 'tensorflow.shape', 'tf.shape', (['tensor'], {}), '(tensor)\n', (3114, 3122), True, 'import tensorflow as tf\n'), ((1714, 1746), 'tensorflow.name_scope', 'tf.name_scope', (["(name or 'dropout')"], {}), "(name or 'dropout')\n", (1727, 1746), True, 'import tensorflow as tf\n'), ((3240, 3260), 'tensorflow....
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-11-18 00:15 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('beers', '0021_auto_20171117_1846'), ] operations = [ migrations.AddField( ...
[ "django.db.models.CharField" ]
[((408, 462), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(10)', 'null': '(True)'}), '(blank=True, max_length=10, null=True)\n', (424, 462), False, 'from django.db import migrations, models\n'), ((592, 763), 'django.db.models.CharField', 'models.CharField', ([], {'choices':...
import struct import sys import time import json import os from PyQt5.QtCore import QDir, Qt from PyQt5.QtGui import QBrush, QPen from PyQt5.QtWidgets import (QAction, QApplication, QFileDialog, QLabel, QToolButton, QFileDialog, QMainWindow, QMenu, QMessageBox, QScrollArea, QSizePolicy, QGridLayout, QLayout, QL...
[ "time.strptime", "PyQt5.QtWidgets.QWidget", "PyQt5.QtWidgets.QGridLayout", "struct.unpack", "PyQt5.QtWidgets.QCheckBox", "PyQt5.QtWidgets.QListWidget", "PyQt5.QtWidgets.QGraphicsView", "PyQt5.QtGui.QPen", "PyQt5.QtGui.QBrush", "PyQt5.QtWidgets.QFileDialog.getOpenFileNames", "time.mktime", "os....
[((11795, 11817), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['sys.argv'], {}), '(sys.argv)\n', (11807, 11817), False, 'from PyQt5.QtWidgets import QAction, QApplication, QFileDialog, QLabel, QToolButton, QFileDialog, QMainWindow, QMenu, QMessageBox, QScrollArea, QSizePolicy, QGridLayout, QLayout, QListWidget, QW...
# # styleopt.py # Artistic Style Transfer # Optimisation method # as defined in Gatys et. al # import os import api import numpy as np import tensorflow as tf import keras.backend as K import matplotlib.pyplot as plt import stylefn from PIL import Image from keras.models import Model, Sequential from util import app...
[ "tensorflow.clip_by_value", "matplotlib.pyplot.clf", "keras.backend.placeholder", "matplotlib.pyplot.draw", "stylefn.build_loss", "datetime.datetime.now", "matplotlib.pyplot.pause", "tensorflow.summary.merge_all", "keras.backend.clear_session", "tensorflow.contrib.opt.ScipyOptimizerInterface", "...
[((3469, 3524), 'stylefn.deprocess_image', 'stylefn.deprocess_image', (['pastiche', 'graph.pastiche_shape'], {}), '(pastiche, graph.pastiche_shape)\n', (3492, 3524), False, 'import stylefn\n'), ((3607, 3617), 'matplotlib.pyplot.draw', 'plt.draw', ([], {}), '()\n', (3615, 3617), True, 'import matplotlib.pyplot as plt\n'...
from random import randint a = input('Nome do 1° aluno: ') b = input('Nome do 2° aluno: ') c = input('Nome do 3° aluno: ') d = input('Nome do 4° aluno: ') esc = randint(1, 4) print('=' * 12) print(f'Aluno 1: {a}') print(f'Aluno 2: {b}') print(f'Aludo 3: {c}') print(f'Aludo 4: {d}') print(f'Escolhido: aluno {esc}')
[ "random.randint" ]
[((161, 174), 'random.randint', 'randint', (['(1)', '(4)'], {}), '(1, 4)\n', (168, 174), False, 'from random import randint\n')]
# A simple python script to plot the GW # signals over time, for a chosen mode import numpy as np; import matplotlib.pyplot as plt; # output data for setup M = 1.0 mu = 0.05 r = 300 symmetry = 4 # make the plot fig = plt.figure() # volume integral dataset out data1 = np.loadtxt("VolumeIntegrals.dat") timedata = data...
[ "numpy.zeros_like", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "numpy.loadtxt", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.savefig" ]
[((219, 231), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (229, 231), True, 'import matplotlib.pyplot as plt\n'), ((271, 304), 'numpy.loadtxt', 'np.loadtxt', (['"""VolumeIntegrals.dat"""'], {}), "('VolumeIntegrals.dat')\n", (281, 304), True, 'import numpy as np\n'), ((431, 465), 'numpy.loadtxt', 'np.loa...
import os import csv import datetime import jinja2 import webapp2 from webapp2_extras import json from google.appengine.api import urlfetch from google.appengine.api import memcache JINJA_ENVIRONMENT = jinja2.Environment( loader=jinja2.FileSystemLoader(os.path.dirname(__file__)), extensions=['jinja2.ext.auto...
[ "google.appengine.api.urlfetch.fetch", "os.path.dirname", "webapp2_extras.json.encode", "webapp2.WSGIApplication", "datetime.datetime.now", "google.appengine.api.memcache.set", "google.appengine.api.memcache.get" ]
[((2374, 2470), 'webapp2.WSGIApplication', 'webapp2.WSGIApplication', (["[('/board', BoardHandler), ('/nojs.html', NoJsHandler)]"], {'debug': '(True)'}), "([('/board', BoardHandler), ('/nojs.html',\n NoJsHandler)], debug=True)\n", (2397, 2470), False, 'import webapp2\n'), ((386, 412), 'google.appengine.api.memcache....
import os import matplotlib.pyplot as plt import numpy as np import json import seaborn as sns; from collections import deque sns.set() import glob2 import argparse from cycler import cycler from mpl_toolkits.mplot3d import Axes3D import matplotlib import matplotlib.pyplot as plt from matplotlib.font_manager import Fon...
[ "numpy.nanpercentile", "argparse.ArgumentParser", "matplotlib.pyplot.clf", "matplotlib.pyplot.figure", "numpy.mean", "matplotlib.pyplot.gca", "os.path.join", "numpy.std", "os.path.exists", "numpy.genfromtxt", "seaborn.set", "numpy.median", "matplotlib.pyplot.legend", "numpy.argwhere", "j...
[((126, 135), 'seaborn.set', 'sns.set', ([], {}), '()\n', (133, 135), True, 'import seaborn as sns\n'), ((2994, 3003), 'matplotlib.pyplot.clf', 'plt.clf', ([], {}), '()\n', (3001, 3003), True, 'import matplotlib.pyplot as plt\n'), ((3048, 3076), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(9, 4.5)'}), '...
""" Tests of neo.io.elphyo """ import unittest from neo.io import ElphyIO from neo.test.iotest.common_io_test import BaseTestIO class TestElphyIO(BaseTestIO, unittest.TestCase): ioclass = ElphyIO entities_to_download = [ 'elphy' ] entities_to_test = ['elphy/DATA1.DAT', ...
[ "unittest.main" ]
[((914, 929), 'unittest.main', 'unittest.main', ([], {}), '()\n', (927, 929), False, 'import unittest\n')]
# -*- encoding: UTF-8 -*- from __future__ import absolute_import, unicode_literals from os import environ from mongorest.settings import settings from mongorest.testcase import TestCase class TestSettings(TestCase): def test_settings_default_values(self): environ.pop('MONGOREST_SETTINGS_MODULE', None) ...
[ "os.environ.pop" ]
[((273, 319), 'os.environ.pop', 'environ.pop', (['"""MONGOREST_SETTINGS_MODULE"""', 'None'], {}), "('MONGOREST_SETTINGS_MODULE', None)\n", (284, 319), False, 'from os import environ\n'), ((1930, 1976), 'os.environ.pop', 'environ.pop', (['"""MONGOREST_SETTINGS_MODULE"""', 'None'], {}), "('MONGOREST_SETTINGS_MODULE', Non...
# give the base class a short, readable nickname from SimpleXMLRPCServer import SimpleXMLRPCServer as BaseServer class Server(BaseServer): def __init__(self, host, port): # accept separate hostname and portnumber and group them BaseServer.__init__(self, (host, port)) def server_bind(self): ...
[ "SimpleXMLRPCServer.SimpleXMLRPCServer.__init__", "SimpleXMLRPCServer.SimpleXMLRPCServer.server_bind" ]
[((248, 287), 'SimpleXMLRPCServer.SimpleXMLRPCServer.__init__', 'BaseServer.__init__', (['self', '(host, port)'], {}), '(self, (host, port))\n', (267, 287), True, 'from SimpleXMLRPCServer import SimpleXMLRPCServer as BaseServer\n'), ((480, 508), 'SimpleXMLRPCServer.SimpleXMLRPCServer.server_bind', 'BaseServer.server_bi...
# Copyright 2019 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file ac...
[ "sklearn.preprocessing.label._encode_check_unknown", "math.ceil", "numpy.asarray", "numpy.setdiff1d", "sklearn.preprocessing.label._encode", "sklearn.utils.validation._num_samples", "sklearn.utils.validation.check_is_fitted", "numpy.searchsorted", "sklearn.utils.validation.column_or_1d", "sagemake...
[((10817, 10843), 'sklearn.utils.validation.column_or_1d', 'column_or_1d', (['y'], {'warn': '(True)'}), '(y, warn=True)\n', (10829, 10843), False, 'from sklearn.utils.validation import check_is_fitted, column_or_1d, _num_samples\n'), ((11103, 11182), 'warnings.warn', 'warnings.warn', (['"""`labels` parameter is expecte...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import xija import sys from os.path import expanduser home = expanduser("~") addthispath = home + '/AXAFLIB/xijafit/' sys.path.insert(0, addthispath) import xijafit stars = '*'*80 n = 0 newmodel = xijafit.XijaFit('aca_model_spec.json', start='2014:001'...
[ "xijafit.XijaFit", "os.path.expanduser", "sys.path.insert" ]
[((127, 142), 'os.path.expanduser', 'expanduser', (['"""~"""'], {}), "('~')\n", (137, 142), False, 'from os.path import expanduser\n'), ((184, 215), 'sys.path.insert', 'sys.path.insert', (['(0)', 'addthispath'], {}), '(0, addthispath)\n', (199, 215), False, 'import sys\n'), ((265, 404), 'xijafit.XijaFit', 'xijafit.Xija...
import torch from typing import Callable, TypeVar from functools import wraps from . import debug class ScopedDebugTensorList: def __init__(self) -> None: self._hidden_states = [] @property def hidden_states(self): return self._hidden_states def _set_hidden_states(self, hidden_sta...
[ "torch.cuda.set_rng_state", "torch.is_grad_enabled", "torch.cuda.get_rng_state", "torch.autograd.backward", "torch.autograd._is_checkpoint_valid", "functools.wraps", "torch.enable_grad", "typing.TypeVar", "torch.is_tensor", "torch.no_grad", "torch.cuda.current_device" ]
[((4473, 4485), 'typing.TypeVar', 'TypeVar', (['"""R"""'], {}), "('R')\n", (4480, 4485), False, 'from typing import Callable, TypeVar\n'), ((4552, 4563), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (4557, 4563), False, 'from functools import wraps\n'), ((4112, 4170), 'torch.autograd.backward', 'torch.autogr...
# -*- coding: utf-8 -*- u"""Common module for SecureTea. Project: ╔═╗┌─┐┌─┐┬ ┬┬─┐┌─┐╔╦╗┌─┐┌─┐ ╚═╗├┤ │ │ │├┬┘├┤ ║ ├┤ ├─┤ ╚═╝└─┘└─┘└─┘┴└─└─┘ ╩ └─┘┴ ┴ Author: <NAME> <<EMAIL>> , Jan 30 2019 Version: 1.1 Module: SecureTea """ import time def getdatetime(): """Date and time. Returns: ...
[ "time.strftime" ]
[((395, 429), 'time.strftime', 'time.strftime', (['"""%Y-%m-%d %H:%M:%S"""'], {}), "('%Y-%m-%d %H:%M:%S')\n", (408, 429), False, 'import time\n')]
import netCDF4 import numpy import vtk from reader_base import ReaderBase class LatLonReader(ReaderBase): def __init__(self, filename, padding=0): """ Constructor @param filename UM netCDF file @param padding number of extra cells to add on the high end of longitudes @note...
[ "netCDF4.Dataset", "numpy.zeros", "argparse.ArgumentParser", "vtk.vtkIdList" ]
[((3437, 3491), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Read ugrid file"""'}), "(description='Read ugrid file')\n", (3460, 3491), False, 'import argparse\n'), ((475, 505), 'netCDF4.Dataset', 'netCDF4.Dataset', (['filename', '"""r"""'], {}), "(filename, 'r')\n", (490, 505), False, ...
import os, glob, tempfile, warnings import numpy as np from traitlets import (HasTraits, Integer, Unicode, Float, Integer, Instance, Dict, Bool, ...
[ "rpy2.robjects.numpy2ri.activate", "traitlets.Float", "tempfile.mkstemp", "rpy2.robjects.r", "traitlets.Unicode", "numpy.nonzero", "rpy2.robjects.r.assign", "numpy.linalg.inv", "rpy2.robjects.numpy2ri.deactivate", "warnings.warn" ]
[((433, 476), 'rpy2.robjects.r', 'rpy.r', (['"""library(knockoff); library(glmnet)"""'], {}), "('library(knockoff); library(glmnet)')\n", (438, 476), True, 'import rpy2.robjects as rpy\n'), ((799, 809), 'traitlets.Float', 'Float', (['(0.2)'], {}), '(0.2)\n', (804, 809), False, 'from traitlets import HasTraits, Integer,...
import numpy as np import warnings from copy import deepcopy from scipy.signal import fftconvolve, medfilt import astropy.units as u import astropy.constants as cst from astropy.io import fits, registry from astropy.wcs import WCS from astropy.nddata import NDDataArray, StdDevUncertainty, InverseVariance from astropy...
[ "numpy.abs", "numpy.angle", "astropy.io.fits.PrimaryHDU", "numpy.ones", "numpy.isnan", "astropy.io.fits.Header", "numpy.arange", "scipy.signal.fftconvolve", "astropy.io.fits.HDUList", "astropy.io.fits.ImageHDU", "numpy.fft.ifftshift", "astropy.io.registry.register_writer", "numpy.fft.irfft",...
[((1238, 1253), 'numpy.arange', 'np.arange', (['(0)', 'M'], {}), '(0, M)\n', (1247, 1253), True, 'import numpy as np\n'), ((30442, 30477), 'astropy.io.registry.delay_doc_updates', 'registry.delay_doc_updates', (['FTSData'], {}), '(FTSData)\n', (30468, 30477), False, 'from astropy.io import fits, registry\n'), ((30555, ...
# coding=utf-8 name = "mattermost_handler" import logging import requests logger = logging.getLogger(__name__) class MattermostIncomeWebhookHandler(logging.Handler): def __init__(self, url): super(MattermostIncomeWebhookHandler, self).__init__() self.url = url if self.url is None: ...
[ "logging.getLogger" ]
[((86, 113), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (103, 113), False, 'import logging\n')]
# AUTOGENERATED! DO NOT EDIT! File to edit: 02_utils.ipynb (unless otherwise specified). __all__ = ['load_camvid_dataset', 'display_segmentation', 'display_segmentation_from_file', 'CamvidDataset'] # Cell import matplotlib.pyplot as plt import os import torch import torchvision.transforms.functional as tf from PIL i...
[ "matplotlib.pyplot.show", "torchvision.transforms.functional.hflip", "matplotlib.pyplot.imshow", "torchvision.transforms.functional.resize", "PIL.Image.open", "torch.clamp", "torchvision.transforms.functional.vflip", "torch.rand", "torchvision.transforms.functional.normalize", "os.path.join" ]
[((1655, 1665), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1663, 1665), True, 'import matplotlib.pyplot as plt\n'), ((701, 739), 'os.path.join', 'os.path.join', (['data_directory', '"""images"""'], {}), "(data_directory, 'images')\n", (713, 739), False, 'import os\n'), ((863, 907), 'os.path.join', 'os.pat...
import matrices_new_extended as mne import numpy as np import sympy as sp from equality_check import Point x, y, z = sp.symbols("x y z") Point.base_point = np.array([x, y, z, 1]) class Test_Axis_3_xxx: def test_matrix_3_xxx(self): expected = Point([ z, x, y, 1]) calculated = Point.calculate(mne....
[ "sympy.symbols", "numpy.array", "equality_check.Point.calculate", "equality_check.Point" ]
[((118, 137), 'sympy.symbols', 'sp.symbols', (['"""x y z"""'], {}), "('x y z')\n", (128, 137), True, 'import sympy as sp\n'), ((157, 179), 'numpy.array', 'np.array', (['[x, y, z, 1]'], {}), '([x, y, z, 1])\n', (165, 179), True, 'import numpy as np\n'), ((258, 277), 'equality_check.Point', 'Point', (['[z, x, y, 1]'], {}...
''' docstring ''' from collections import namedtuple import logging import os.path import sys _THIS = sys.modules[__name__] AppProperties = namedtuple('AppProperties', ('name', 'path', 'root_logger', 'init', 'get_path', 'get_logger')) def __dummy(*args, **kwargs): pass def __get_logger(fullmodulename): '''...
[ "collections.namedtuple", "logging.getLogger" ]
[((143, 241), 'collections.namedtuple', 'namedtuple', (['"""AppProperties"""', "('name', 'path', 'root_logger', 'init', 'get_path', 'get_logger')"], {}), "('AppProperties', ('name', 'path', 'root_logger', 'init',\n 'get_path', 'get_logger'))\n", (153, 241), False, 'from collections import namedtuple\n'), ((656, 682)...
#!/usr/bin/env python from __future__ import print_function from __future__ import division # Eliminate need for decimals on whole values import sys # As of 28 July 2019, python3.6 is the default "python3" in apt-get install python3 if sys.version_info[0] != 3 or sys.version_info[1] < 6: print("This ...
[ "argparse.ArgumentParser", "os.path.join", "numpy.multiply", "skyfield.iokit.Loader", "os.path.dirname", "tle_util.append_tle_file", "math.cos", "configparser.ConfigParser", "logging.StreamHandler", "numpy.cross", "math.sin", "inspect.currentframe", "numpy.dot", "math.degrees", "sys.exit...
[((950, 986), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""../python-sgp4"""'], {}), "(1, '../python-sgp4')\n", (965, 986), False, 'import sys\n'), ((1047, 1117), 'sys.path.insert', 'sys.path.insert', (['(2)', '"""/Users/chris/Dropbox/code/preMVP/python-skyfield"""'], {}), "(2, '/Users/chris/Dropbox/code/preMVP/p...
#!/usr/bin/env python # -*- coding: utf-8 -*- #https://github.com/juano2310/CarND-Behavioral-Cloning-P3-Juan/blob/master/model.py #https://github.com/udacity/self-driving-car/blob/master/steering-models/community-models/rambo/train.py import os import csv import cv2 import numpy as np import matplotlib.pyplot as plt i...
[ "matplotlib.pyplot.title", "csv.reader", "keras.layers.Cropping2D", "sklearn.model_selection.train_test_split", "keras.layers.core.Flatten", "keras.layers.core.SpatialDropout2D", "os.path.normpath", "keras.layers.core.Dropout", "cv2.resize", "keras.layers.core.Dense", "keras.callbacks.ModelCheck...
[((952, 982), 'sklearn.utils.shuffle', 'sklearn.utils.shuffle', (['samples'], {}), '(samples)\n', (973, 982), False, 'import sklearn\n'), ((1019, 1059), 'sklearn.model_selection.train_test_split', 'train_test_split', (['samples'], {'test_size': '(0.2)'}), '(samples, test_size=0.2)\n', (1035, 1059), False, 'from sklearn...
from kivy.uix.widget import Widget from kivy.graphics.instructions import Canvas from kivy.graphics.vertex_instructions import Line,Ellipse ,Ellipse,Rectangle from kivy.graphics.context_instructions import Color from kivy.metrics import dp # from kivy.clock import Clock from kivy.properties import Clock from kivymd....
[ "kivy.properties.Clock.unschedule", "kivy.properties.Clock.schedule_interval", "kivy.graphics.vertex_instructions.Rectangle", "kivy.metrics.dp", "kivy.graphics.context_instructions.Color", "kivy.graphics.vertex_instructions.Ellipse" ]
[((1018, 1024), 'kivy.metrics.dp', 'dp', (['(50)'], {}), '(50)\n', (1020, 1024), False, 'from kivy.metrics import dp\n'), ((1062, 1067), 'kivy.metrics.dp', 'dp', (['(3)'], {}), '(3)\n', (1064, 1067), False, 'from kivy.metrics import dp\n'), ((1084, 1089), 'kivy.metrics.dp', 'dp', (['(3)'], {}), '(3)\n', (1086, 1089), F...
from timesheet_utils.service_comunication import request from werkzeug.exceptions import Unauthorized, Forbidden import os def get_logged_user(): users_service_url_port = os.path.expandvars( os.environ.get('USERS_SERVICE_URL_PORT') ) data = request( '{}{}/me/'.format( users_serv...
[ "os.environ.get", "werkzeug.exceptions.Forbidden" ]
[((204, 244), 'os.environ.get', 'os.environ.get', (['"""USERS_SERVICE_URL_PORT"""'], {}), "('USERS_SERVICE_URL_PORT')\n", (218, 244), False, 'import os\n'), ((346, 384), 'os.environ.get', 'os.environ.get', (['"""USERS_SERVICE_PREFIX"""'], {}), "('USERS_SERVICE_PREFIX')\n", (360, 384), False, 'import os\n'), ((523, 561)...