code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
from flask import request, render_template, redirect, url_for, session, jsonify, abort from flask_babel import _ import os.path import pandas as pd from transparentai import sustainable from ..models import Project from ..models.modules import ModuleSustainable from .services.projects import format_project, control_p...
[ "flask.abort", "flask.jsonify", "flask.url_for", "flask.render_template", "transparentai.sustainable.get_energy_data", "flask_babel._" ]
[((1011, 1024), 'flask_babel._', '_', (['"""Projects"""'], {}), "('Projects')\n", (1012, 1024), False, 'from flask_babel import _\n'), ((1116, 1222), 'flask.render_template', 'render_template', (['"""projects/index.html"""'], {'title': 'title', 'session': 'session', 'projects': 'projects', 'header': 'header'}), "('proj...
import pygame as pg TILE_D = 32 # Comment in for small or big screen # HD screen SCREEN_TW, SCREEN_TH = 50, 30 # Low res screen SCREEN_TW, SCREEN_TH = 35, 20 SCREEN_W_PX = SCREEN_TW * TILE_D SCREEN_H_PX = SCREEN_TH * TILE_D SCREEN_SIZE = (SCREEN_W_PX, SCREEN_H_PX) MAP_VIEW_TW = int(SCREEN_TW * 0.7) MAP_VIEW_TH ...
[ "pygame.Rect", "pygame.color.Color" ]
[((641, 678), 'pygame.Rect', 'pg.Rect', (['(0)', '(0)', 'MAP_DIM[0]', 'MAP_DIM[1]'], {}), '(0, 0, MAP_DIM[0], MAP_DIM[1])\n', (648, 678), True, 'import pygame as pg\n'), ((690, 748), 'pygame.Rect', 'pg.Rect', (['(0)', '(TILE_D * MAP_VIEW_TH)', 'STAT_DIM[0]', 'STAT_DIM[1]'], {}), '(0, TILE_D * MAP_VIEW_TH, STAT_DIM[0], ...
"""Global settings and imports""" import sys sys.path.append("../../") import os import numpy as np import zipfile from tqdm import tqdm import scrapbook as sb from tempfile import TemporaryDirectory import tensorflow as tf tf.get_logger().setLevel('ERROR') # only show error messages from reco_utils.recommender.deepre...
[ "sys.path.append", "reco_utils.recommender.newsrec.newsrec_utils.get_mind_data_set", "tempfile.TemporaryDirectory", "os.makedirs", "scrapbook.glue", "os.path.exists", "numpy.argsort", "reco_utils.recommender.newsrec.models.nrms.NRMSModel", "os.path.join", "reco_utils.recommender.newsrec.newsrec_ut...
[((45, 70), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (60, 70), False, 'import sys\n'), ((912, 932), 'tempfile.TemporaryDirectory', 'TemporaryDirectory', ([], {}), '()\n', (930, 932), False, 'from tempfile import TemporaryDirectory\n'), ((976, 1020), 'os.path.join', 'os.path.join', (...
#!/bin/env python import os import scipy as sp import matplotlib.pyplot as pl from mpl_toolkits.basemap.cm import sstanom, s3pcpn_l from matplotlib import dates from g5lib import field # Read validation data set obs={} path=os.environ['NOBACKUP']+'/verification/stress_mon_clim' execfile(path+'/ctl.py') obs['ctl']=ctl...
[ "scipy.where", "matplotlib.dates.MonthLocator", "matplotlib.pyplot.show", "scipy.arange", "matplotlib.pyplot.clf", "g5lib.field.absolute", "scipy.logical_and", "matplotlib.pyplot.figure", "matplotlib.dates.DateFormatter", "matplotlib.pyplot.gca", "g5lib.field.cmplx", "matplotlib.pyplot.grid", ...
[((463, 532), 'scipy.where', 'sp.where', (["(tx.grid['lon'] < 29.0)", "(tx.grid['lon'] + 360)", "tx.grid['lon']"], {}), "(tx.grid['lon'] < 29.0, tx.grid['lon'] + 360, tx.grid['lon'])\n", (471, 532), True, 'import scipy as sp\n'), ((589, 658), 'scipy.where', 'sp.where', (["(ty.grid['lon'] < 29.0)", "(ty.grid['lon'] + 36...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Helper classes for twisted.test.test_ssl. They are in a separate module so they will not prevent test_ssl importing if pyOpenSSL is unavailable. """ from __future__ import division, absolute_import from twisted.python.compat impor...
[ "OpenSSL.SSL.Context" ]
[((671, 700), 'OpenSSL.SSL.Context', 'SSL.Context', (['SSL.TLSv1_METHOD'], {}), '(SSL.TLSv1_METHOD)\n', (682, 700), False, 'from OpenSSL import SSL\n'), ((870, 899), 'OpenSSL.SSL.Context', 'SSL.Context', (['SSL.TLSv1_METHOD'], {}), '(SSL.TLSv1_METHOD)\n', (881, 899), False, 'from OpenSSL import SSL\n')]
from drl.envs.testing import LockstepEnv from drl.envs.wrappers.stateless.clip_reward import ClipRewardWrapper def test_clip_reward(): env = LockstepEnv() wrapped = ClipRewardWrapper(env, low=0.0, high=0.5, key='extrinsic') _ = wrapped.reset() o_tp1, r_t, d_t, i_t = wrapped.step(0) assert r_t['ex...
[ "drl.envs.testing.LockstepEnv", "drl.envs.wrappers.stateless.clip_reward.ClipRewardWrapper" ]
[((147, 160), 'drl.envs.testing.LockstepEnv', 'LockstepEnv', ([], {}), '()\n', (158, 160), False, 'from drl.envs.testing import LockstepEnv\n'), ((176, 234), 'drl.envs.wrappers.stateless.clip_reward.ClipRewardWrapper', 'ClipRewardWrapper', (['env'], {'low': '(0.0)', 'high': '(0.5)', 'key': '"""extrinsic"""'}), "(env, l...
from tkinter import * from PIL import ImageTk, Image from GameEngine.Vector import * class Application: def __init__(self, title, size, fps): self.root = Tk() self.root.title(title) self.width, self.height = size self.root.geometry(f"{self.width}x{self.height}") self.root....
[ "PIL.Image.new", "PIL.ImageTk.PhotoImage" ]
[((1262, 1293), 'PIL.ImageTk.PhotoImage', 'ImageTk.PhotoImage', (['frame.image'], {}), '(frame.image)\n', (1280, 1293), False, 'from PIL import ImageTk, Image\n'), ((2179, 2228), 'PIL.Image.new', 'Image.new', (['"""RGBA"""'], {'size': '(self.width, self.height)'}), "('RGBA', size=(self.width, self.height))\n", (2188, 2...
#%% from datetime import datetime import xarray as xr from cfxarray.profile import depthcoords, profiledataset from cfxarray.base import dataarraybydepth # %% temperature1 = dataarraybydepth( name="temperature", standard_name="sea_water_temperature", long_name="Sea water temperature", units="degree_C...
[ "cfxarray.base.dataarraybydepth", "datetime.datetime.fromisoformat", "cfxarray.profile.profiledataset", "xarray.concat" ]
[((533, 608), 'cfxarray.profile.profiledataset', 'profiledataset', (['[temperature1]', '"""profile1"""', '"""title"""', '"""summary"""', "['keyword']"], {}), "([temperature1], 'profile1', 'title', 'summary', ['keyword'])\n", (547, 608), False, 'from cfxarray.profile import depthcoords, profiledataset\n'), ((1005, 1080)...
from chromedriver_py import binary_path as driver_path from selenium.webdriver import DesiredCapabilities from selenium.webdriver import Chrome, ChromeOptions # TODO: Combine these two dependencies. Leaving it for now since it touches too many sites atm. from selenium.webdriver.chrome.options import Options from seleni...
[ "selenium.webdriver.support.expected_conditions.presence_of_element_located", "selenium.webdriver.chrome.options.Options", "threading.Thread", "selenium.webdriver.support.expected_conditions.element_to_be_clickable", "selenium.webdriver.common.action_chains.ActionChains", "random.choices", "requests.coo...
[((712, 721), 'selenium.webdriver.chrome.options.Options', 'Options', ([], {}), '()\n', (719, 721), False, 'from selenium.webdriver.chrome.options import Options\n'), ((3282, 3297), 'selenium.webdriver.common.action_chains.ActionChains', 'ActionChains', (['d'], {}), '(d)\n', (3294, 3297), False, 'from selenium.webdrive...
"""add ingredient availability table Revision ID: f0ddbf9cdd26 Revises: 7cf38c4ce08a Create Date: 2019-06-28 21:34:49.780023 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'f0ddbf9cdd26' down_revision = '<PASSWORD>' branch_labels = None depends_on = None def...
[ "alembic.op.drop_table", "sqlalchemy.Integer", "sqlalchemy.PrimaryKeyConstraint", "sqlalchemy.ForeignKeyConstraint" ]
[((906, 946), 'alembic.op.drop_table', 'op.drop_table', (['"""INGREDIENT_AVAILABILITY"""'], {}), "('INGREDIENT_AVAILABILITY')\n", (919, 946), False, 'from alembic import op\n'), ((677, 738), 'sqlalchemy.ForeignKeyConstraint', 'sa.ForeignKeyConstraint', (["['ingredient_id']", "['INGREDIENT.id']"], {}), "(['ingredient_id...
#imports import Cluster import math class Leader(): def __init__(self, i, height, leader=None): # represents local level id self.identity = i # Leader of this leader (if any) self.leader = leader # height of this leader in the tiers self.height = heigh...
[ "Cluster.Cluster", "math.ceil" ]
[((1162, 1214), 'math.ceil', 'math.ceil', (['(target_leader_size / 100 * (100 + hi_pct))'], {}), '(target_leader_size / 100 * (100 + hi_pct))\n', (1171, 1214), False, 'import math\n'), ((1895, 1923), 'Cluster.Cluster', 'Cluster.Cluster', ([], {'leader': 'self'}), '(leader=self)\n', (1910, 1923), False, 'import Cluster\...
from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext setup( name="ricecomp-cfitsio", version="1.0", description="Rice compression and decompression for Python.", long_description="Rice comression and decompression using the routines in the cfitsi...
[ "distutils.extension.Extension" ]
[((1028, 1090), 'distutils.extension.Extension', 'Extension', (['"""ricecomp"""', "['ricecomp.pyx']"], {'libraries': "['cfitsio']"}), "('ricecomp', ['ricecomp.pyx'], libraries=['cfitsio'])\n", (1037, 1090), False, 'from distutils.extension import Extension\n')]
import os import os.path as osp import gym import time import datetime import joblib import logging import numpy as np import tensorflow as tf from baselines import logger from baselines.common import set_global_seeds, explained_variance from baselines.common.vec_env.subproc_vec_env import SubprocVecEnv from baselines...
[ "baselines.a2c.utils.Scheduler", "tensorflow.reset_default_graph", "tensorflow.train.RMSPropOptimizer", "joblib.dump", "baselines.a2c.utils.find_trainable_variables", "tensorflow.clip_by_global_norm", "numpy.copy", "tensorflow.placeholder", "tensorflow.summary.FileWriter", "tensorflow.squeeze", ...
[((9842, 9866), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ([], {}), '()\n', (9864, 9866), True, 'import tensorflow as tf\n'), ((9871, 9893), 'baselines.common.set_global_seeds', 'set_global_seeds', (['seed'], {}), '(seed)\n', (9887, 9893), False, 'from baselines.common import set_global_seeds, explain...
# -*- coding: utf-8 -*- # BioSTEAM: The Biorefinery Simulation and Techno-Economic Analysis Modules # Copyright (C) 2020, <NAME> <<EMAIL>> # # This module is under the UIUC open-source license. See # github.com/BioSTEAMDevelopmentGroup/biosteam/blob/master/LICENSE.txt # for license details. """ """ import numpy as np...
[ "thermosteam.MultiStream", "warnings.warn", "flexsolve.IQ_interpolation", "thermosteam.Stream" ]
[((5921, 6046), 'flexsolve.IQ_interpolation', 'flx.IQ_interpolation', (['compute_overall_vapor_fraction', 'x0', 'x1', 'y0', 'y1', 'self._V1'], {'xtol': '(0.0001)', 'ytol': '(0.001)', 'checkiter': '(False)'}), '(compute_overall_vapor_fraction, x0, x1, y0, y1, self.\n _V1, xtol=0.0001, ytol=0.001, checkiter=False)\n',...
import datetime from django.contrib import messages from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render from django.urls import reverse from django.views.decorators.csrf import csrf_exempt from django.core.files.storage import FileSystemStorage from school_management_app.mod...
[ "school_management_app.models.News.objects.all", "school_management_app.models.StudentResult.objects.filter", "school_management_app.models.SComment.objects.filter", "school_management_app.models.LeaveReportStudent", "school_management_app.models.SComment", "django.contrib.messages.error", "school_manag...
[((559, 602), 'school_management_app.models.Students.objects.get', 'Students.objects.get', ([], {'admin': 'request.user.id'}), '(admin=request.user.id)\n', (579, 602), False, 'from school_management_app.models import Students, Courses, Subjects, CustomUser, Attendance, AttendanceReport, LeaveReportStudent, FeedBackStud...
"""HomeControl representation of ESPHome entities""" from typing import TYPE_CHECKING, Any, Dict, Tuple import voluptuous as vol from homecontrol.dependencies.entity_types import Item from homecontrol.dependencies.state_proxy import StateDef, StateProxy from homecontrol.modules.switch.module import Switch if TYPE_CH...
[ "homecontrol.dependencies.state_proxy.StateDef", "voluptuous.Schema", "homecontrol.dependencies.state_proxy.StateProxy", "voluptuous.Coerce" ]
[((2279, 2289), 'homecontrol.dependencies.state_proxy.StateDef', 'StateDef', ([], {}), '()\n', (2287, 2289), False, 'from homecontrol.dependencies.state_proxy import StateDef, StateProxy\n'), ((2537, 2547), 'homecontrol.dependencies.state_proxy.StateDef', 'StateDef', ([], {}), '()\n', (2545, 2547), False, 'from homecon...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # # Copyright (c) SAS Institute, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the r...
[ "os.path.dirname" ]
[((1370, 1387), 'os.path.dirname', 'dirname', (['__file__'], {}), '(__file__)\n', (1377, 1387), False, 'from os.path import dirname\n')]
import dbus from .base import BluetoothBase from .constants import * class BluetoothMediaPlayer(BluetoothBase): TRACK_TYPES = {"Title": str, "Artist": str, "Album": str, "Genre": str, "NumberOfTracks": int, "TrackNumbe...
[ "dbus.SystemBus", "dbus.Interface" ]
[((1318, 1359), 'dbus.Interface', 'dbus.Interface', (['self.device', 'PLAYER_IFACE'], {}), '(self.device, PLAYER_IFACE)\n', (1332, 1359), False, 'import dbus\n'), ((1381, 1426), 'dbus.Interface', 'dbus.Interface', (['self.device', 'PROPERTIES_IFACE'], {}), '(self.device, PROPERTIES_IFACE)\n', (1395, 1426), False, 'impo...
import tensorflow as tf from keras import Model from keras.layers import Convolution2D, BatchNormalization, Activation, Add, Dense from keras.models import load_model from tensorforce.core.networks import Network from keras.engine import Input class PommNetwork(Network): def tf_apply(self, x, internals, up...
[ "keras.layers.Activation", "keras.engine.Input", "keras.Model", "keras.layers.Dense" ]
[((567, 595), 'keras.engine.Input', 'Input', ([], {'tensor': "board['board']"}), "(tensor=board['board'])\n", (572, 595), False, 'from keras.engine import Input\n'), ((806, 836), 'keras.Model', 'Model', ([], {'inputs': 'inp', 'outputs': 'out'}), '(inputs=inp, outputs=out)\n', (811, 836), False, 'from keras import Model...
import cv2 import sys import numpy as np import pyperclip as ppc from tkinter import filedialog from tkinter import * def record_click(event,x,y,flags,param): global mouseX,mouseY if event == cv2.EVENT_LBUTTONDBLCLK: mouseX,mouseY = x,y point = "[" + str(mouseX) + ", " + str(mouseY) + "]" cv2.d...
[ "cv2.putText", "cv2.waitKey", "numpy.zeros", "tkinter.filedialog.askopenfilename", "cv2.drawMarker", "cv2.imread", "cv2.setMouseCallback", "pyperclip.copy", "cv2.moveWindow", "cv2.imshow", "cv2.namedWindow" ]
[((1004, 1036), 'cv2.namedWindow', 'cv2.namedWindow', (['"""Select Points"""'], {}), "('Select Points')\n", (1019, 1036), False, 'import cv2\n'), ((1037, 1061), 'cv2.namedWindow', 'cv2.namedWindow', (['"""Point"""'], {}), "('Point')\n", (1052, 1061), False, 'import cv2\n'), ((1062, 1102), 'cv2.moveWindow', 'cv2.moveWin...
# -*- coding: utf-8 -*- import os from textwrap import fill def wrap(text): filled = fill(str(text[1]), width=120, initial_indent='# ' + text[0] + ': ', subsequent_indent='# ') return '\n' + filled + '\n' class ToPython(object): def process_item(self, item, spider): if spider.path: ...
[ "os.path.expanduser", "os.path.exists" ]
[((327, 358), 'os.path.expanduser', 'os.path.expanduser', (['spider.path'], {}), '(spider.path)\n', (345, 358), False, 'import os\n'), ((374, 394), 'os.path.exists', 'os.path.exists', (['path'], {}), '(path)\n', (388, 394), False, 'import os\n')]
from credentials import Credential import unittest class TestCredentials(unittest.TestCase): """ Class for testing credentials methods and behaviours """ def setUp(self): """ Create new instance of credential """ self.new_credential = Credential("Instagram", "victormaina...
[ "unittest.main", "credentials.Credential" ]
[((710, 725), 'unittest.main', 'unittest.main', ([], {}), '()\n', (723, 725), False, 'import unittest\n'), ((284, 335), 'credentials.Credential', 'Credential', (['"""Instagram"""', '"""victormainak"""', '"""password"""'], {}), "('Instagram', 'victormainak', 'password')\n", (294, 335), False, 'from credentials import Cr...
from typing import Optional, Union from aiohttp import ClientSession, ClientTimeout # type: ignore from asgard import conf default_http_client_timeout = ClientTimeout( total=conf.ASGARD_HTTP_CLIENT_TOTAL_TIMEOUT, connect=conf.ASGARD_HTTP_CLIENT_CONNECT_TIMEOUT, ) class _HttpClient: _session: Optional[...
[ "aiohttp.ClientTimeout" ]
[((157, 269), 'aiohttp.ClientTimeout', 'ClientTimeout', ([], {'total': 'conf.ASGARD_HTTP_CLIENT_TOTAL_TIMEOUT', 'connect': 'conf.ASGARD_HTTP_CLIENT_CONNECT_TIMEOUT'}), '(total=conf.ASGARD_HTTP_CLIENT_TOTAL_TIMEOUT, connect=conf.\n ASGARD_HTTP_CLIENT_CONNECT_TIMEOUT)\n', (170, 269), False, 'from aiohttp import Client...
## https://nowonbun.tistory.com/668 # 소켓을 사용하기 위해서는 socket을 import해야 한다. import socket, threading # binder함수는 서버에서 accept가 되면 생성되는 socket 인스턴스를 통해 client로 부터 데이터를 받으면 echo형태로 재송신하는 메소드이다. def binder(client_socket, addr): # 커넥션이 되면 접속 주소가 나온다. print('Connected by', addr) try: # 접속 상태에서는 클라이언트로 부터 받을...
[ "threading.Thread", "socket.socket" ]
[((1479, 1528), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (1492, 1528), False, 'import socket, threading\n'), ((2126, 2185), 'threading.Thread', 'threading.Thread', ([], {'target': 'binder', 'args': '(client_socket, addr)'}), '(target=bin...
import os import flaskr import unittest import tempfile class FlaskrTestCase(unittest.TestCase): def setUp(self): self.db_fd, flaskr.DATABASE = tempfile.mkstemp() self.app = flaskr.app.test_client() flaskr.init_db() def tearDown(self): os.close(self.db_fd) os.unlink(fl...
[ "unittest.main", "flaskr.init_db", "os.unlink", "tempfile.mkstemp", "flaskr.app.test_client", "os.close" ]
[((367, 382), 'unittest.main', 'unittest.main', ([], {}), '()\n', (380, 382), False, 'import unittest\n'), ((158, 176), 'tempfile.mkstemp', 'tempfile.mkstemp', ([], {}), '()\n', (174, 176), False, 'import tempfile\n'), ((196, 220), 'flaskr.app.test_client', 'flaskr.app.test_client', ([], {}), '()\n', (218, 220), False,...
import os import signal import argparse import platform # PyQt5 doesn't play nicely with i3 and Ubuntu 18, PyQt6 is much more stable # Unfortunately, PyQt6 doesn't install on Ubuntu 18. Thankfully both # libraries are interchangeable, and we just need to swap them in this # one spot, and pyqtgraph will pick up on it...
[ "os.mkdir", "argparse.ArgumentParser", "pyqtgraph.exec", "software.thunderscope.chicker.chicker.ChickerWidget", "software.thunderscope.field.path_layer.PathLayer", "software.thunderscope.field.field.Field", "pyqtgraph.Qt.QtWidgets.QVBoxLayout", "pyqtgraph.Qt.QtWidgets.QWidget", "pyqtgraph.Qt.QtGui.Q...
[((437, 455), 'platform.version', 'platform.version', ([], {}), '()\n', (453, 455), False, 'import platform\n'), ((8135, 8186), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Thunderscope"""'}), "(description='Thunderscope')\n", (8158, 8186), False, 'import argparse\n'), ((2117, 2149), '...
import numpy as np import matplotlib.pyplot as plt from matplotlib import cm from mpl_toolkits.mplot3d import Axes3D pW = 0.48 pL = 1-pW b_max = 500 #max bet ($) def total_losses(b0, f, num_losses): sum=0 for i in range(0, num_losses): sum += f**i return b0*sum def net_winnings(b0, f, num_games):...
[ "matplotlib.pyplot.title", "numpy.meshgrid", "matplotlib.pyplot.show", "numpy.log", "numpy.argmax", "numpy.asarray", "matplotlib.pyplot.figure", "numpy.arange", "numpy.reshape" ]
[((859, 879), 'numpy.arange', 'np.arange', (['(1)', '(500)', '(1)'], {}), '(1, 500, 1)\n', (868, 879), True, 'import numpy as np\n'), ((900, 923), 'numpy.arange', 'np.arange', (['(1.01)', '(5)', '(0.1)'], {}), '(1.01, 5, 0.1)\n', (909, 923), True, 'import numpy as np\n'), ((989, 1007), 'numpy.meshgrid', 'np.meshgrid', ...
# -*- encoding: utf-8 -*- # Copyright (c) 2017 ZTE Corporation # # Authors:<NAME> <<EMAIL>> # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
[ "mock.patch.object", "watcher.common.ironic_helper.IronicHelper", "watcher.common.clients.OpenStackClients", "watcher.common.utils.generate_uuid", "mock.MagicMock" ]
[((963, 989), 'watcher.common.clients.OpenStackClients', 'clients.OpenStackClients', ([], {}), '()\n', (987, 989), False, 'from watcher.common import clients\n'), ((1009, 1041), 'mock.patch.object', 'mock.patch.object', (['osc', '"""ironic"""'], {}), "(osc, 'ironic')\n", (1026, 1041), False, 'import mock\n'), ((1133, 1...
from django.conf import settings from django.contrib.postgres.fields import JSONField from django.db import models from constants import content_types from db.models.abstract.diff import DiffModel from db.models.abstract.nameable import NameableModel class Search(DiffModel, NameableModel): """A saved search quer...
[ "django.db.models.ForeignKey", "django.contrib.postgres.fields.JSONField", "django.db.models.CharField" ]
[((676, 763), 'django.db.models.ForeignKey', 'models.ForeignKey', (['"""db.Project"""'], {'on_delete': 'models.CASCADE', 'related_name': '"""searches"""'}), "('db.Project', on_delete=models.CASCADE, related_name=\n 'searches')\n", (693, 763), False, 'from django.db import models\n'), ((803, 891), 'django.db.models.C...
# MIT License # # Copyright (c) 2020-2021 Parakoopa and the SkyTemple Contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the...
[ "json.loads", "logging.getLogger" ]
[((1259, 1286), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1276, 1286), False, 'import logging\n'), ((10501, 10521), 'json.loads', 'json.loads', (['json_str'], {}), '(json_str)\n', (10511, 10521), False, 'import json\n')]
# Copyright 2019 VMware, Inc. # All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
[ "unittest.mock.patch.object" ]
[((890, 934), 'unittest.mock.patch.object', 'mock.patch.object', (['self.nsxlib.client', '"""get"""'], {}), "(self.nsxlib.client, 'get')\n", (907, 934), False, 'from unittest import mock\n')]
import torch import torch.nn as nn import torchvision.models as models class ResNet50_Mod(nn.Module): def __init__(self, input_size=640): super().__init__() resnet50 = models.resnet50(pretrained=True) self.resnet = nn.Sequential(*(list(resnet50.children())[:-2])) self.avepool = nn....
[ "torch.nn.AvgPool2d", "torchvision.models.resnet50" ]
[((190, 222), 'torchvision.models.resnet50', 'models.resnet50', ([], {'pretrained': '(True)'}), '(pretrained=True)\n', (205, 222), True, 'import torchvision.models as models\n'), ((317, 344), 'torch.nn.AvgPool2d', 'nn.AvgPool2d', ([], {'kernel_size': '(7)'}), '(kernel_size=7)\n', (329, 344), True, 'import torch.nn as n...
# -*- coding: utf-8 -*- from django import forms from django.contrib.auth.models import User from django.contrib.auth import authenticate from .models import CoreUser class UserLoginForm(forms.ModelForm): password = forms.HiddenInput(attrs={'value': '<PASSWORD>'}) username = forms.EmailInput( attrs...
[ "django.forms.Select", "django.forms.TextInput", "django.forms.PasswordInput", "django.forms.EmailInput", "django.forms.ValidationError", "django.contrib.auth.authenticate", "django.forms.HiddenInput" ]
[((225, 273), 'django.forms.HiddenInput', 'forms.HiddenInput', ([], {'attrs': "{'value': '<PASSWORD>'}"}), "(attrs={'value': '<PASSWORD>'})\n", (242, 273), False, 'from django import forms\n'), ((289, 379), 'django.forms.EmailInput', 'forms.EmailInput', ([], {'attrs': "{'class': 'form-control line-input', 'placeholder'...
#!/usr/bin/python3 import extractWasmExport import extractComments from io import StringIO import json as JsonUtil import sys class FunctionDefinition: def __init__(self, item): self.parameters = item["params"] self.returnType = item["returnTypes"][0] if len(item["returnTypes"]) > 0 else "void" ...
[ "extractWasmExport.Executor", "extractComments.SimpleTreeWalker", "json.loads", "extractComments.DictionaryGeneratingVisitor" ]
[((2501, 2529), 'extractWasmExport.Executor', 'extractWasmExport.Executor', ([], {}), '()\n', (2527, 2529), False, 'import extractWasmExport\n'), ((2704, 2732), 'json.loads', 'JsonUtil.loads', (['exportOutput'], {}), '(exportOutput)\n', (2718, 2732), True, 'import json as JsonUtil\n'), ((2297, 2331), 'extractComments.S...
import tensorflow as tf import importlib import pytest from triplet_tools import triplet_batch_semihard_loss, triplet_batch_priming_loss, triplet_batch_hard_loss try: import keras except ImportError: pass @pytest.mark.skipif(importlib.util.find_spec("keras") is None, reason='Keras is not ...
[ "importlib.util.find_spec", "keras.layers.Flatten", "keras.layers.Dense", "triplet_tools.triplet_batch_hard_loss", "triplet_tools.triplet_batch_priming_loss" ]
[((967, 995), 'triplet_tools.triplet_batch_priming_loss', 'triplet_batch_priming_loss', ([], {}), '()\n', (993, 995), False, 'from triplet_tools import triplet_batch_semihard_loss, triplet_batch_priming_loss, triplet_batch_hard_loss\n'), ((1322, 1350), 'triplet_tools.triplet_batch_priming_loss', 'triplet_batch_priming_...
""" ..module:: crawl_dictionary :synopsis: This module is designed to add a given parameter to a provided dictionary under a designated parent. It searches for the parent recursively in order to examine all possible levels of nested dictionaries. If the parent is found, the parameter is added to the d...
[ "lib.GUIbuttons.GreyButton", "lib.MyError.MyError", "lib.HeaderKeyword.read_header_keywords_table", "util.read_yaml.read_yaml" ]
[((8946, 8992), 'lib.HeaderKeyword.read_header_keywords_table', 'hk.read_header_keywords_table', (['HEADER_KEYWORDS'], {}), '(HEADER_KEYWORDS)\n', (8975, 8992), True, 'import lib.HeaderKeyword as hk\n'), ((13318, 13360), 'lib.GUIbuttons.GreyButton', 'gb.GreyButton', (['"""+ add a new parameter"""', '(20)'], {}), "('+ a...
from common import activities, prefix from discord.ext import commands class RemoveActivity(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command(name="rm-activity") @commands.is_owner() async def remove_activity(ctx): activity = ctx.message.content[( le...
[ "discord.ext.commands.command", "discord.ext.commands.is_owner", "common.activities.remove" ]
[((167, 203), 'discord.ext.commands.command', 'commands.command', ([], {'name': '"""rm-activity"""'}), "(name='rm-activity')\n", (183, 203), False, 'from discord.ext import commands\n'), ((209, 228), 'discord.ext.commands.is_owner', 'commands.is_owner', ([], {}), '()\n', (226, 228), False, 'from discord.ext import comm...
import datetime import json from lxml.etree import Element, fromstring, tostring from passari.config import CONFIG, MUSEUMPLUS_URL from passari.museumplus.settings import ZETCOM_NS from passari.utils import retrieve_xml async def get_object_field(session, object_id: int, name: str): """ Get the value of a s...
[ "json.loads", "lxml.etree.Element", "json.dumps", "lxml.etree.tostring", "datetime.datetime.now", "passari.utils.retrieve_xml" ]
[((1939, 1958), 'lxml.etree.Element', 'Element', (['field_type'], {}), '(field_type)\n', (1946, 1958), False, 'from lxml.etree import Element, fromstring, tostring\n'), ((2014, 2030), 'lxml.etree.Element', 'Element', (['"""value"""'], {}), "('value')\n", (2021, 2030), False, 'from lxml.etree import Element, fromstring,...
import re from bs4 import * import requests import random import json from hashlib import md5 # 设置翻译API的账号和密码 BAIDU Setup your APIid and Appkey acquired from baidu API appid = '' appkey = '' # 设置从A语音翻译到B语言,其他语言码查看 If you need more language code refer to:`https://api.fanyi.baidu.com/doc/21` from_lang = 'en' to_lang =...
[ "requests.post", "re.findall", "random.randint" ]
[((962, 999), 're.findall', 're.findall', (['""""(.*?)\\""""', 'origin_content'], {}), '(\'"(.*?)"\', origin_content)\n', (972, 999), False, 'import re\n'), ((1969, 1997), 'random.randint', 'random.randint', (['(32768)', '(65536)'], {}), '(32768, 65536)\n', (1983, 1997), False, 'import random\n'), ((2275, 2326), 'reque...
# 2 Using Manual threading in python # Import Threading & Time import threading import time # Start counting start = time.perf_counter() # Create simple function that sleep in 1 second def do_something(): print('Sleeping 1 second..') time.sleep(1) print('Done Sleeping..') # Create threading, start and...
[ "threading.Thread", "time.perf_counter", "time.sleep" ]
[((119, 138), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (136, 138), False, 'import time\n'), ((331, 368), 'threading.Thread', 'threading.Thread', ([], {'target': 'do_something'}), '(target=do_something)\n', (347, 368), False, 'import threading\n'), ((374, 411), 'threading.Thread', 'threading.Thread', ...
import asyncio import base64 import itertools import json import os from enum import Enum from pydantic import BaseModel from pathlib import Path, PosixPath from typing import Union, List, cast, Mapping, Callable, Iterable, Any import aiohttp from fastapi import HTTPException from starlette.requests import Request f...
[ "asyncio.gather", "youwol_utils.clients.utils.to_group_id", "base64.urlsafe_b64encode", "aiohttp.FormData", "typing.cast", "fastapi.HTTPException", "aiohttp.ClientSession", "youwol_utils.clients.utils.raise_exception_from_response", "base64.urlsafe_b64decode", "youwol_utils.clients.utils.to_group_...
[((1080, 1104), 'youwol_utils.clients.utils.to_group_scope', 'to_group_scope', (['group_id'], {}), '(group_id)\n', (1094, 1104), False, 'from youwol_utils.clients.utils import raise_exception_from_response, to_group_id, to_group_scope\n'), ((4456, 4483), 'os.getenv', 'os.getenv', (['"""AUTH_CLIENT_ID"""'], {}), "('AUTH...
#!/usr/bin/env python3 import logging import sqlite3 import os from json import load from urllib.request import urlopen from bs4 import BeautifulSoup from re import compile from datetime import date, datetime def GetScriptPath(): return '/'.join(os.path.abspath(__file__).split('/')[:-1]) def GetConfig(path, fn...
[ "logging.error", "json.load", "os.path.abspath", "logging.warning", "urllib.request.urlopen", "datetime.datetime.now", "datetime.date.today", "datetime.datetime.strptime", "os.path.join", "re.compile" ]
[((405, 422), 'json.load', 'load', (['config_file'], {}), '(config_file)\n', (409, 422), False, 'from json import load\n'), ((2816, 2883), 'logging.warning', 'logging.warning', (['"""Folder "database" does not exist - creating one."""'], {}), '(\'Folder "database" does not exist - creating one.\')\n', (2831, 2883), Fal...
"""sync-my-tasks. Usage: sync-my-tasks (--from-asana --asana-workspace=<name> [--asana-token-file PATH]) (--to-mstodo) sync-my-tasks (-h | --help) sync-my-tasks --version Options: -h --help Show this screen. --version Show version. --from-asana Pul...
[ "sync_my_tasks.provider_asana.AsanaProvider", "sync_my_tasks.provider_mstodo.MsTodoProvider", "docopt.docopt" ]
[((731, 777), 'docopt.docopt', 'docopt', (['__doc__'], {'version': '"""sync-my-tasks 0.1.0"""'}), "(__doc__, version='sync-my-tasks 0.1.0')\n", (737, 777), False, 'from docopt import docopt\n'), ((1005, 1063), 'sync_my_tasks.provider_asana.AsanaProvider', 'AsanaProvider', (['asana_token', "arguments['--asana-workspace'...
import torch import torch.nn as nn from torch.nn import functional as F from .base import get_syncbn from .base import ASPP class dec_deeplabv3(nn.Module): def __init__(self, in_planes, num_classes=19, inner_planes=256, sync_bn=False, dilations=(12, 24, 36)): super(dec_deeplabv3, self).__init__() ...
[ "torch.nn.Dropout2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.cat", "torch.nn.functional.interpolate" ]
[((1579, 1653), 'torch.nn.Conv2d', 'nn.Conv2d', (['(256)', 'num_classes'], {'kernel_size': '(1)', 'stride': '(1)', 'padding': '(0)', 'bias': '(True)'}), '(256, num_classes, kernel_size=1, stride=1, padding=0, bias=True)\n', (1588, 1653), True, 'import torch.nn as nn\n'), ((2367, 2440), 'torch.nn.functional.interpolate'...
import cv2 import numpy as np from skimage.segmentation import slic from skimage import color from skimage.measure import regionprops from PIL import Image, ImageDraw import moviepy.editor as mp import random import os class GifMaker(): def to_mosaic_gif(self, img_path, n_segments = 150, segments_per_frame = 3): ...
[ "numpy.uint8", "skimage.color.label2rgb", "moviepy.editor.VideoFileClip", "cv2.bitwise_and", "cv2.cvtColor", "numpy.zeros", "PIL.Image.fromarray", "cv2.imread", "cv2.normalize", "skimage.segmentation.slic", "os.path.split", "os.path.join", "numpy.unique" ]
[((326, 346), 'cv2.imread', 'cv2.imread', (['img_path'], {}), '(img_path)\n', (336, 346), False, 'import cv2\n'), ((385, 426), 'skimage.segmentation.slic', 'slic', (['img'], {'n_segments': 'n_segments', 'sigma': '(5)'}), '(img, n_segments=n_segments, sigma=5)\n', (389, 426), False, 'from skimage.segmentation import sli...
from django.contrib import admin from .models import Student # Register your models here. class StudentModelAdmin(admin.ModelAdmin): list_display = ["__str__"] class Meta: model = Student admin.site.register(Student,StudentModelAdmin)
[ "django.contrib.admin.site.register" ]
[((215, 262), 'django.contrib.admin.site.register', 'admin.site.register', (['Student', 'StudentModelAdmin'], {}), '(Student, StudentModelAdmin)\n', (234, 262), False, 'from django.contrib import admin\n')]
from typing import List from typing import Tuple import numpy as np import yaml from music_genre_classifier import dataset from music_genre_classifier import models if __name__ == "__main__": import argparse parser = argparse.ArgumentParser(prog="Music Genre Classifier") parser.add_argument("classifie...
[ "yaml.load", "argparse.ArgumentParser", "music_genre_classifier.dataset.split_dataset", "music_genre_classifier.models.build_from_config", "music_genre_classifier.dataset.create_gtzan_dataset" ]
[((231, 285), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""Music Genre Classifier"""'}), "(prog='Music Genre Classifier')\n", (254, 285), False, 'import argparse\n'), ((744, 802), 'music_genre_classifier.dataset.create_gtzan_dataset', 'dataset.create_gtzan_dataset', ([], {}), "(**classifier_c...
import MeCab # text = "昨日の天気は晴れでした。" text = input() mecab = MeCab.Tagger() parses = mecab.parse(text) parse = parses.split('\n') for par in parse: p = par.split(',') if p[0] == "EOS": break print(p[0], "\t", p[-3])
[ "MeCab.Tagger" ]
[((61, 75), 'MeCab.Tagger', 'MeCab.Tagger', ([], {}), '()\n', (73, 75), False, 'import MeCab\n')]
# game.py import pygame from field import GameField from preview import Preview from brick import Brick from figure import generate_randomized_figures as FigureFactory from control import Control from score import Score import colors GAME_TITLE = "Shricktris" START_FPS = 12 START_GAME_STEPOVER = 8 SCREEN_RESOLUTION ...
[ "pygame.quit", "pygame.display.set_caption", "pygame.font.SysFont", "pygame.display.set_mode", "control.Control", "score.Score", "pygame.init", "figure.generate_randomized_figures", "pygame.display.update", "field.GameField" ]
[((445, 458), 'pygame.init', 'pygame.init', ([], {}), '()\n', (456, 458), False, 'import pygame\n'), ((467, 505), 'pygame.display.set_caption', 'pygame.display.set_caption', (['GAME_TITLE'], {}), '(GAME_TITLE)\n', (493, 505), False, 'import pygame\n'), ((529, 571), 'pygame.display.set_mode', 'pygame.display.set_mode', ...
# conda activate pymesh import math import numpy as np import trimesh import cv2 import os import configs.config_loader as cfg_loader import NDF_combine as NDF def str2bool(inp): return inp.lower() in 'true' class Renderer(): def __init__(self): self.get_args() self.create_plane_points_from...
[ "numpy.ones", "cv2.transpose", "numpy.linalg.norm", "configs.config_loader.get_config", "os.path.join", "numpy.prod", "numpy.meshgrid", "numpy.multiply", "numpy.copy", "math.radians", "numpy.transpose", "numpy.insert", "NDF_combine.predictRotGradientNDF", "numpy.reshape", "numpy.linspace...
[((484, 507), 'configs.config_loader.get_config', 'cfg_loader.get_config', ([], {}), '()\n', (505, 507), True, 'import configs.config_loader as cfg_loader\n'), ((600, 644), 'os.makedirs', 'os.makedirs', (['self.args.folder'], {'exist_ok': '(True)'}), '(self.args.folder, exist_ok=True)\n', (611, 644), False, 'import os\...
import os, sys import numpy as np from copy import deepcopy from warnings import warn from .Mesh import Mesh from .GeometricPath import * from Florence.Tensor import totuple, unique2d __all__ = ['HarvesterPatch', 'SubdivisionArc', 'SubdivisionCircle', 'QuadBall', 'QuadBallSphericalArc'] """ A series of custom meshes...
[ "os.remove", "Florence.Tensor.totuple", "numpy.isclose", "numpy.sin", "numpy.linalg.norm", "Florence.LinearElastic", "Florence.Mesh", "numpy.unique", "Florence.BoundaryCondition", "Florence.Tensor.prime_number_factorisation", "numpy.zeros_like", "numpy.copy", "numpy.linspace", "copy.deepco...
[((700, 725), 'numpy.array', 'np.array', (['[30.6979, 20.5]'], {}), '([30.6979, 20.5])\n', (708, 725), True, 'import numpy as np\n'), ((738, 760), 'numpy.array', 'np.array', (['[30.0, 20.0]'], {}), '([30.0, 20.0])\n', (746, 760), True, 'import numpy as np\n'), ((771, 793), 'numpy.array', 'np.array', (['[30.0, 21.0]'], ...
import os import pytest from capreolus.collection import COLLECTIONS, Collection from capreolus.index.anserini import AnseriniIndex from capreolus.utils.common import Anserini @pytest.fixture(scope="function") def trec_index(request, tmpdir): """ Build an index based on sample data and create an AnseriniInd...
[ "capreolus.utils.common.Anserini.get_fat_jar", "os.system", "pytest.fixture", "os.path.join" ]
[((181, 213), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (195, 213), False, 'import pytest\n'), ((971, 1001), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (985, 1001), False, 'import pytest\n'), ((364, 416), 'os.path.join'...
import tensorflow as tf from PIL import Image import numpy as np import os from util import check_or_makedirs im = Image.open("1.jpg") print(im.mode, im.size) np_im = np.array(im) tf_im = tf.constant(np_im) print(tf_im.dtype) img = tf.image.grayscale_to_rgb(tf_im[:, :, tf.newaxis]) # scale image to fixed size fixed...
[ "tensorflow.image.grayscale_to_rgb", "os.path.join", "tensorflow.random.normal", "tensorflow.image.adjust_jpeg_quality", "tensorflow.image.adjust_hue", "tensorflow.pad", "tensorflow.constant", "PIL.Image.open", "tensorflow.cast", "tensorflow.shape", "numpy.array", "tensorflow.image.adjust_cont...
[((116, 135), 'PIL.Image.open', 'Image.open', (['"""1.jpg"""'], {}), "('1.jpg')\n", (126, 135), False, 'from PIL import Image\n'), ((169, 181), 'numpy.array', 'np.array', (['im'], {}), '(im)\n', (177, 181), True, 'import numpy as np\n'), ((190, 208), 'tensorflow.constant', 'tf.constant', (['np_im'], {}), '(np_im)\n', (...
import glob import random import os import numpy as np from torch.utils.data import Dataset from PIL import Image import torchvision.transforms as transforms class ImageDataset(Dataset): def __init__(self, root, transforms_=None, unaligned=False, mode='train', portion=None): self.transform = tran...
[ "numpy.uint8", "numpy.flip", "numpy.asarray", "numpy.floor", "torchvision.transforms.Compose", "glob.glob", "numpy.random.rand", "os.path.join" ]
[((316, 347), 'torchvision.transforms.Compose', 'transforms.Compose', (['transforms_'], {}), '(transforms_)\n', (334, 347), True, 'import torchvision.transforms as transforms\n'), ((2362, 2393), 'torchvision.transforms.Compose', 'transforms.Compose', (['transforms_'], {}), '(transforms_)\n', (2380, 2393), True, 'import...
import numpy as np from sas7bdat import SAS7BDAT import glob import pandas as pd from sklearn import preprocessing from sas7bdat import SAS7BDAT import glob import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt from sklearn import utils, model_selection, metrics, linear_model, neighbors, ensemble...
[ "pandas.read_csv", "sklearn.model_selection.train_test_split", "numpy.arange", "glob.glob", "numpy.round", "pandas.DataFrame", "matplotlib.patches.Rectangle", "sklearn.linear_model.ElasticNet", "pandas.merge", "matplotlib.pyplot.xticks", "matplotlib.pyplot.subplots", "pandas.concat", "sklear...
[((3880, 3914), 'pandas.read_csv', 'pd.read_csv', (['"""featureTableMap.csv"""'], {}), "('featureTableMap.csv')\n", (3891, 3914), True, 'import pandas as pd\n'), ((3926, 4000), 'pandas.read_csv', 'pd.read_csv', (['"""./data/subjectsWithBiomarkers.csv"""'], {'usecols': "['idind', 'Age']"}), "('./data/subjectsWithBiomark...
# Public python modules import numpy as np import pandas as pd import pickle import feature from os import path # If categories of test data = categories of the training data class load(): def __init__(self, data_path, batch_size): self.pointer = 0 self.dataframe = pickle.load(open(data_path,"rb"))...
[ "numpy.float32", "numpy.zeros" ]
[((1029, 1051), 'numpy.zeros', 'np.zeros', (['self.n_class'], {}), '(self.n_class)\n', (1037, 1051), True, 'import numpy as np\n'), ((929, 946), 'numpy.float32', 'np.float32', (['patch'], {}), '(patch)\n', (939, 946), True, 'import numpy as np\n'), ((2291, 2308), 'numpy.float32', 'np.float32', (['patch'], {}), '(patch)...
from random import choices from typing import Callable import humanize from .covid import Covid from .graph import Graph from .image import Image from .testing import Testing from .twitter import Twitter class Alerts(Covid, Graph, Image, Testing, Twitter): def __init__(self): super().__init__() @pr...
[ "random.choices", "humanize.intcomma" ]
[((583, 804), 'random.choices', 'choices', (['[self.world_data, self.random_country_data, self.random_country_graph, self\n .random_image, self.random_country_tests, self.random_country_group_graph]'], {'weights': '[0.2, 0.1, 0.25, 0.05, 0.15, 0.25]', 'k': '(1)'}), '([self.world_data, self.random_country_data, self....
#!/usr/bin/env python3 # # __init__.py """ Use black with formate. """ # # Copyright © 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 restriction, includ...
[ "domdf_python_tools.paths.PathPlus" ]
[((2623, 2649), 'domdf_python_tools.paths.PathPlus', 'PathPlus', (['formate_filename'], {}), '(formate_filename)\n', (2631, 2649), False, 'from domdf_python_tools.paths import PathPlus\n')]
import floppyforms as forms from django.forms.models import modelformset_factory from django.utils.translation import ugettext_lazy as _ from horizon import tables from horizon.tables.formset import FormsetDataTable, FormsetRow from leonardo.module.web.models import WidgetDimension class Slider(forms.RangeInput): ...
[ "leonardo.module.web.models.WidgetDimension.objects.none", "horizon.tables.Column", "django.utils.translation.ugettext_lazy", "django.forms.models.modelformset_factory" ]
[((969, 1063), 'django.forms.models.modelformset_factory', 'modelformset_factory', (['WidgetDimension'], {'form': 'WidgetDimensionForm', 'can_delete': '(True)', 'extra': '(1)'}), '(WidgetDimension, form=WidgetDimensionForm, can_delete=\n True, extra=1)\n', (989, 1063), False, 'from django.forms.models import modelfo...
from swcpm import click, swc_pm from .run import run_command from .info import info_command from .wget import wget_command from .install import install_command from .update import update_command from .remove import remove_command #############################################################################...
[ "swcpm.swc_pm.command", "swcpm.swc_pm", "swcpm.click.echo" ]
[((370, 431), 'swcpm.swc_pm.command', 'swc_pm.command', (['"""debug"""'], {'short_help': '"""Debugs the application."""'}), "('debug', short_help='Debugs the application.')\n", (384, 431), False, 'from swcpm import click, swc_pm\n'), ((712, 720), 'swcpm.swc_pm', 'swc_pm', ([], {}), '()\n', (718, 720), False, 'from swcp...
# Copyright (c) 2015, Palo Alto Networks # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS...
[ "common.exit_with_error", "os.path.abspath", "common.log", "os.path.join", "environment.run_by_splunk", "pandevice.firewall.Firewall", "pandevice.panorama.Panorama", "common.apikey", "common.check_debug", "common.logging.getLogger" ]
[((2150, 2175), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (2165, 2175), False, 'import os\n'), ((2193, 2221), 'os.path.join', 'os.path.join', (['libpath', '"""lib"""'], {}), "(libpath, 'lib')\n", (2205, 2221), False, 'import os\n'), ((2332, 2359), 'environment.run_by_splunk', 'environmen...
# flake8: noqa import os WTF_CSRF_ENABLED = False # On production, delete this line! SECRET_KEY = '' SERVER_ADDRESS = os.getenv('SERVER_ADDRESS', '127.0.0.1:80') FEATURE_FLAG_CHECK_IDENTICAL_CODE_ON = os.getenv( 'FEATURE_FLAG_CHECK_IDENTICAL_CODE_ON', False, ) USERS_CSV = 'users.csv' # Babel config LANGUA...
[ "os.getenv" ]
[((122, 165), 'os.getenv', 'os.getenv', (['"""SERVER_ADDRESS"""', '"""127.0.0.1:80"""'], {}), "('SERVER_ADDRESS', '127.0.0.1:80')\n", (131, 165), False, 'import os\n'), ((206, 262), 'os.getenv', 'os.getenv', (['"""FEATURE_FLAG_CHECK_IDENTICAL_CODE_ON"""', '(False)'], {}), "('FEATURE_FLAG_CHECK_IDENTICAL_CODE_ON', False...
""" ================================================ Toy Injected Glucose Phosphorylation Compartment ================================================ This is a toy example referenced in the documentation. """ from vivarium.core.experiment import Experiment from vivarium.core.process import Composite from vivarium.li...
[ "vivarium_cell.processes.glucose_phosphorylation.GlucosePhosphorylation", "vivarium_cell.processes.injector.Injector" ]
[((938, 971), 'vivarium_cell.processes.injector.Injector', 'Injector', (["self.config['injector']"], {}), "(self.config['injector'])\n", (946, 971), False, 'from vivarium_cell.processes.injector import Injector\n'), ((1006, 1068), 'vivarium_cell.processes.glucose_phosphorylation.GlucosePhosphorylation', 'GlucosePhospho...
#https://docs.python.org/ko/3/library/__main__.html #main.py #from module import * import module if __name__ == "__main__": print(__name__) #hello() module.hello()
[ "module.hello" ]
[((178, 192), 'module.hello', 'module.hello', ([], {}), '()\n', (190, 192), False, 'import module\n')]
import sys import os def readDepths(filePath): with open(filePath) as f: depths = f.readlines() return depths #Process Individual depths def processDepthReadings(depthReadings): previousDepth = -1 depthIncreases = 0 for depth in depthReadings: depth = int(depth) if previou...
[ "os.path.isfile" ]
[((1270, 1297), 'os.path.isfile', 'os.path.isfile', (['sys.argv[1]'], {}), '(sys.argv[1])\n', (1284, 1297), False, 'import os\n')]
import math class Cache(object): """docstring for cache""" def __init__(self, size, length, associativity, cycle_time, writing_policy,parent ): #super(cache, self).__init__() #self.arg = arg self.index = int(math.log(size / (length * associativity),2)) self.offset = int(math.log(length,2)) self.tag ...
[ "math.log" ]
[((221, 265), 'math.log', 'math.log', (['(size / (length * associativity))', '(2)'], {}), '(size / (length * associativity), 2)\n', (229, 265), False, 'import math\n'), ((289, 308), 'math.log', 'math.log', (['length', '(2)'], {}), '(length, 2)\n', (297, 308), False, 'import math\n')]
# -*- coding: utf-8 -*- # Learn more: https://github.com/kennethreitz/setup.py from setuptools import setup, find_packages with open('README.md') as f: readme = f.read() with open('LICENSE') as f: license = f.read() setup( name='livedata-subscribetags', version='0.1.0', description='Sample scr...
[ "setuptools.find_packages" ]
[((553, 593), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "('tests', 'docs')"}), "(exclude=('tests', 'docs'))\n", (566, 593), False, 'from setuptools import setup, find_packages\n')]
import pprint template = { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-111.6782379150,39.32373809814] # Lat then Long } }, { "type": "Feature", "geometry": { "...
[ "pprint.pprint" ]
[((1453, 1473), 'pprint.pprint', 'pprint.pprint', (['spots'], {}), '(spots)\n', (1466, 1473), False, 'import pprint\n')]
#! /usr/bin/env python3 """ UI class for Serial Port hardware. This will have an instantiation of a Serial port. """ # # The GUI libraries since we build some GUI components here # import PyQt5 import PyQt5.QtCore import PyQt5.QtWidgets import SerialPort class SerialPortUI(PyQt5.QtCore.QObject): connectButton...
[ "PyQt5.QtCore.pyqtSignal", "PyQt5.QtWidgets.QLabel", "PyQt5.QtWidgets.QComboBox", "PyQt5.QtWidgets.QHBoxLayout", "PyQt5.QtWidgets.QPushButton", "SerialPort.SerialPort", "PyQt5.QtWidgets.QApplication" ]
[((329, 354), 'PyQt5.QtCore.pyqtSignal', 'PyQt5.QtCore.pyqtSignal', ([], {}), '()\n', (352, 354), False, 'import PyQt5\n'), ((3889, 3927), 'PyQt5.QtWidgets.QApplication', 'PyQt5.QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (3917, 3927), False, 'import PyQt5\n'), ((619, 682), 'SerialPort.SerialPort', 'Se...
"""Main module.""" import itertools as it import numpy as np def read_data(filepath, sep=" "): """This function reads file containing Points Coordinates Arguments: filepath (str) -- Path to the file to be read Keyword Arguments: sep (str) -- Separator for columns in file (default: " ") ...
[ "numpy.std", "numpy.cross", "numpy.append", "numpy.mean", "numpy.array", "numpy.linalg.norm", "numpy.linspace", "numpy.linalg.inv", "numpy.matmul" ]
[((1264, 1282), 'numpy.cross', 'np.cross', (['y_1', 'y_2'], {}), '(y_1, y_2)\n', (1272, 1282), True, 'import numpy as np\n'), ((1345, 1373), 'numpy.cross', 'np.cross', (['x_versor', 'y_versor'], {}), '(x_versor, y_versor)\n', (1353, 1373), True, 'import numpy as np\n'), ((3134, 3152), 'numpy.array', 'np.array', (['poin...
# Lines starting with # are comments and are not run by Python. """ Multi-line comments are possible with triple quotes like this. """ # import pandas and matplotlib # Load the pandas library as pd import pandas as pd # Load the matplotlib library as plt import matplotlib.pyplot as plt # load the numpy library...
[ "pandas.read_csv" ]
[((548, 570), 'pandas.read_csv', 'pd.read_csv', (['"""day.csv"""'], {}), "('day.csv')\n", (559, 570), True, 'import pandas as pd\n')]
import os import numpy as np import glob from sklearn.model_selection import StratifiedShuffleSplit import sys, os sys.path.insert(0, os.path.join( os.path.dirname(os.path.realpath(__file__)), "../../")) from deep_audio_features.bin import config import wave import contextlib def load(folders=None, test_val=[0.2,...
[ "wave.open", "os.path.realpath", "sklearn.model_selection.StratifiedShuffleSplit", "numpy.max", "os.path.join" ]
[((1898, 1966), 'sklearn.model_selection.StratifiedShuffleSplit', 'StratifiedShuffleSplit', ([], {'n_splits': '(1)', 'test_size': 'test_p', 'random_state': '(0)'}), '(n_splits=1, test_size=test_p, random_state=0)\n', (1920, 1966), False, 'from sklearn.model_selection import StratifiedShuffleSplit\n'), ((2437, 2504), 's...
#!/usr/bin/env python3 """ :problem: https://www.hackerrank.com/challenges/frequency-queries/problem """ from typing import List, Tuple from collections import Counter def process_queries(queries: List[Tuple[int, int]]) -> List[int]: """Execute queries and report whether a value with a given count exists.""" ...
[ "collections.Counter" ]
[((330, 339), 'collections.Counter', 'Counter', ([], {}), '()\n', (337, 339), False, 'from collections import Counter\n'), ((353, 362), 'collections.Counter', 'Counter', ([], {}), '()\n', (360, 362), False, 'from collections import Counter\n')]
""" Copyright [2009-2019] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
[ "pathlib.Path", "os.getenv" ]
[((1504, 1537), 'os.getenv', 'os.getenv', (['"""ENVIRONMENT"""', '"""LOCAL"""'], {}), "('ENVIRONMENT', 'LOCAL')\n", (1513, 1537), False, 'import os\n'), ((1221, 1243), 'pathlib.Path', 'pathlib.Path', (['__file__'], {}), '(__file__)\n', (1233, 1243), False, 'import pathlib\n'), ((2191, 2217), 'os.getenv', 'os.getenv', (...
# # Copyright (c) Contributors to the Open 3D Engine Project. # For complete copyright and license terms please see the LICENSE at the root of this distribution. # # SPDX-License-Identifier: Apache-2.0 OR MIT # # import platform if platform.system() == 'Windows': from tempfile import TemporaryDirectory from ...
[ "platform.system", "pathlib.Path", "os.walk" ]
[((235, 252), 'platform.system', 'platform.system', ([], {}), '()\n', (250, 252), False, 'import platform\n'), ((850, 868), 'os.walk', 'os.walk', (['self.name'], {}), '(self.name)\n', (857, 868), False, 'import os\n'), ((926, 939), 'pathlib.Path', 'Path', (['dirpath'], {}), '(dirpath)\n', (930, 939), False, 'from pathl...
#!/usr/bin/env python3 # encoding: utf-8 # Copyright 2019 <NAME> # Licensed under the Apache License, Version 2.0 (the "License") import os import argparse import torch import torch.distributed as dist import torch.multiprocessing as mp from pynn.util import save_object_param from pynn.net.lm_lstm import SeqLM from...
[ "pynn.bin.train_language_model", "pynn.net.lm_lstm.SeqLM", "torch.distributed.init_process_group", "argparse.ArgumentParser", "torch.distributed.destroy_process_group", "torch.multiprocessing.spawn", "torch.manual_seed", "pynn.util.save_object_param", "torch.cuda.device_count", "pynn.bin.print_mod...
[((381, 424), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""pynn"""'}), "(description='pynn')\n", (404, 424), False, 'import argparse\n'), ((2660, 2675), 'pynn.net.lm_lstm.SeqLM', 'SeqLM', ([], {}), '(**params)\n', (2665, 2675), False, 'from pynn.net.lm_lstm import SeqLM\n'), ((2680, 27...
import datetime import logging import uuid import marshmallow as ma from flask import url_for, g, jsonify from flask.views import MethodView from flask_smorest import Blueprint, abort import http.client as http_client from drift.core.extensions.jwt import current_user, requires_roles from drift.core.extensions.urlreg...
[ "marshmallow.fields.Dict", "flask.g.db.commit", "logging.getLogger", "flask_smorest.Blueprint", "datetime.datetime.utcnow", "flask.jsonify", "flask.url_for", "driftbase.models.db.Machine", "marshmallow.fields.Url", "marshmallow.fields.Integer", "datetime.timedelta", "marshmallow.fields.String"...
[((491, 518), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (508, 518), False, 'import logging\n'), ((525, 622), 'flask_smorest.Blueprint', 'Blueprint', (['"""servers"""', '__name__'], {'url_prefix': '"""/servers"""', 'description': '"""Battle server processes"""'}), "('servers', __name_...
import os stream = os.popen('echo Returned output') output = stream.read() output
[ "os.popen" ]
[((20, 52), 'os.popen', 'os.popen', (['"""echo Returned output"""'], {}), "('echo Returned output')\n", (28, 52), False, 'import os\n')]
import time import logging from mcsf.commands.base import Command from mcsf.services.backup import BackupService from mcsf.services.json_storage import JsonStorage from mcsf.services.ssh import SshService from mcsf.services.vultr import VultrService class UpCommand(Command): def __init__(self): self.json...
[ "logging.error", "mcsf.services.vultr.VultrService", "time.sleep", "logging.info", "mcsf.services.ssh.SshService", "mcsf.services.backup.BackupService", "mcsf.services.json_storage.JsonStorage" ]
[((331, 344), 'mcsf.services.json_storage.JsonStorage', 'JsonStorage', ([], {}), '()\n', (342, 344), False, 'from mcsf.services.json_storage import JsonStorage\n'), ((595, 609), 'mcsf.services.vultr.VultrService', 'VultrService', ([], {}), '()\n', (607, 609), False, 'from mcsf.services.vultr import VultrService\n'), ((...
#-*- coding: utf-8 -*- import numpy as np class GPSConverter(object): ''' GPS Converter class which is able to perform convertions between the CH1903 and WGS84 system. ''' # Convert CH y/x/h to WGS height def CHtoWGSheight(self, y, x, h): # Axiliary values (% Bern) y_aux = (y ...
[ "numpy.floor" ]
[((1645, 1674), 'numpy.floor', 'np.floor', (['((dec - degree) * 60)'], {}), '((dec - degree) * 60)\n', (1653, 1674), True, 'import numpy as np\n')]
# Authors: <NAME> <<EMAIL>> # # License: Simplified BSD import pytest from mne.viz._mpl_figure import _psd_figure from mne.viz._figure import _get_browser def test_browse_figure_constructor(): """Test error handling in MNEBrowseFigure constructor.""" with pytest.raises(TypeError, match='an instance of Raw, E...
[ "pytest.raises", "mne.viz._mpl_figure._psd_figure", "mne.viz._figure._get_browser" ]
[((267, 335), 'pytest.raises', 'pytest.raises', (['TypeError'], {'match': '"""an instance of Raw, Epochs, or ICA"""'}), "(TypeError, match='an instance of Raw, Epochs, or ICA')\n", (280, 335), False, 'import pytest\n'), ((345, 369), 'mne.viz._figure._get_browser', '_get_browser', ([], {'inst': '"""foo"""'}), "(inst='fo...
import copy from typing import Tuple import numpy as np from odyssey.distribution import Distribution from iliad.integrators.info import SoftAbsLeapfrogInfo from iliad.integrators.states import SoftAbsLeapfrogState from iliad.integrators.terminal import cond from iliad.integrators.fields import riemannian, softabs ...
[ "numpy.abs", "iliad.integrators.info.SoftAbsLeapfrogInfo", "iliad.integrators.fields.softabs.decomposition", "iliad.integrators.fields.softabs.force", "copy.copy", "numpy.ones", "numpy.diag", "iliad.integrators.terminal.cond", "numpy.linalg.cholesky" ]
[((1270, 1462), 'iliad.integrators.fields.softabs.force', 'softabs.force', (['pmcand', 'state.grad_log_posterior', 'state.jac_hessian', 'state.hessian_eigenvals', 'state.softabs_eigenvals', 'state.softabs_inv_eigenvals', 'state.hessian_eigenvecs', 'state.alpha'], {}), '(pmcand, state.grad_log_posterior, state.jac_hessi...
import logging logging = logging.getLogger() import constants from mailchimp3 import MailChimp import web_template from string import Template client = MailChimp(mc_api=constants.MAILCHIMPAPI, mc_user=constants.MAILCHIMPUSENAME) campaign_name="trading_alert" from_name="<NAME>" reply_to="<EMAIL>" audience_id="4e7840aba...
[ "logging.error", "mailchimp3.MailChimp", "logging.getLogger", "string.Template" ]
[((25, 44), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (42, 44), False, 'import logging\n'), ((153, 229), 'mailchimp3.MailChimp', 'MailChimp', ([], {'mc_api': 'constants.MAILCHIMPAPI', 'mc_user': 'constants.MAILCHIMPUSENAME'}), '(mc_api=constants.MAILCHIMPAPI, mc_user=constants.MAILCHIMPUSENAME)\n', (1...
from abc import abstractmethod from typing import List from typing import Optional from typing import Tuple from typing import Union import tensorflow as tf from config_state import builder from config_state import ConfigField from config_state import ConfigState from config_state import DeferredConf from config_stat...
[ "tensorflow.add_n", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.MaxPooling2D", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.AveragePooling2D", "tensorflow.concat", "tensorflow.keras.layers.InputLayer", "tensorflow.keras.Model", "tensor...
[((442, 498), 'config_state.ConfigField', 'ConfigField', (['...', '"""Input shape of the model"""'], {'type': 'tuple'}), "(..., 'Input shape of the model', type=tuple)\n", (453, 498), False, 'from config_state import ConfigField\n'), ((611, 667), 'config_state.ConfigField', 'ConfigField', (['...', '"""Model\'s output u...
# -*- coding: utf-8 -*- """ test_scrape_selector ~~~~~~~~~~~~~~~~~~~~ Test the HTML/XML Selector. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging import unittest from chemdataextra...
[ "unittest.main", "chemdataextractor.scrape.selector.Selector.from_text", "logging.getLogger", "logging.basicConfig" ]
[((362, 402), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (381, 402), False, 'import logging\n'), ((410, 437), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (427, 437), False, 'import logging\n'), ((1763, 1778), 'unittest.mai...
from ibidem.advent_of_code.board import Board from ibidem.advent_of_code.util import get_input_name PART1_SLOPE = (3, 1) PART2_SLOPES = ( (1, 1), (3, 1), (5, 1), (7, 1), (1, 2), ) def load(): with open(get_input_name(3, 2020)) as fobj: return Board.from_string(fobj.read()) def part1...
[ "ibidem.advent_of_code.util.get_input_name" ]
[((229, 252), 'ibidem.advent_of_code.util.get_input_name', 'get_input_name', (['(3)', '(2020)'], {}), '(3, 2020)\n', (243, 252), False, 'from ibidem.advent_of_code.util import get_input_name\n')]
""" .. _ref_contact_example: Contact Element Example ~~~~~~~~~~~~~~~~~~~~~~~ This example demonstrates how to create contact elements for general contact. Begin by launching MAPDL. """ from ansys.mapdl import core as pymapdl mapdl = pymapdl.launch_mapdl() ##########################################################...
[ "ansys.mapdl.core.launch_mapdl" ]
[((238, 260), 'ansys.mapdl.core.launch_mapdl', 'pymapdl.launch_mapdl', ([], {}), '()\n', (258, 260), True, 'from ansys.mapdl import core as pymapdl\n')]
from chalice import Blueprint from chalicelib import _overrides from chalicelib.utils.SAML2_helper import prepare_request, init_saml_auth app = Blueprint(__name__) _overrides.chalice_app(app) from chalicelib.utils.helper import environ from onelogin.saml2.auth import OneLogin_Saml2_Logout_Request from onelogin.saml...
[ "chalicelib.utils.SAML2_helper.init_saml_auth", "chalicelib._overrides.chalice_app", "chalicelib.core.users.update", "chalice.Response", "onelogin.saml2.utils.OneLogin_Saml2_Utils.get_self_url", "chalicelib.core.users.get_by_email_only", "chalice.Blueprint", "chalicelib.core.tenants.get_by_tenant_key"...
[((146, 165), 'chalice.Blueprint', 'Blueprint', (['__name__'], {}), '(__name__)\n', (155, 165), False, 'from chalice import Blueprint\n'), ((166, 193), 'chalicelib._overrides.chalice_app', '_overrides.chalice_app', (['app'], {}), '(app)\n', (188, 193), False, 'from chalicelib import _overrides\n'), ((547, 591), 'chalic...
import numpy as np def rank5_accuracy(predictions, labels): # initialize the rank-1 and rank-5 accuracies rank_1 = 0 rank_5 = 0 # new_predictions = [] # loop over the predictions and the ground-truth labels for (prediction_, ground_truth) in zip(predictions, labels): # sort the probab...
[ "numpy.argsort" ]
[((459, 482), 'numpy.argsort', 'np.argsort', (['prediction_'], {}), '(prediction_)\n', (469, 482), True, 'import numpy as np\n')]
from numbers import Number from phi import math from phi.math.blas import conjugate_gradient from phi.math.helper import _dim_shifted from phi.physics.field import CenteredGrid from .solver_api import PoissonDomain, PoissonSolver class GeometricCG(PoissonSolver): def __init__(self, accuracy=1e-5, gradient_accur...
[ "phi.math.with_custom_gradient", "phi.physics.material.Material.extrapolation_mode", "phi.math.helper._dim_shifted", "phi.math.spatial_rank", "phi.math.sum", "phi.math.mul", "phi.math.blas.conjugate_gradient", "phi.physics.field.CenteredGrid" ]
[((4165, 4218), 'phi.physics.material.Material.extrapolation_mode', 'Material.extrapolation_mode', (['domain.domain.boundaries'], {}), '(domain.domain.boundaries)\n', (4192, 4218), False, 'from phi.physics.material import Material\n'), ((4483, 4580), 'phi.math.blas.conjugate_gradient', 'conjugate_gradient', (['divergen...
from flask import Flask import locale from flask_sqlalchemy import SQLAlchemy from config import Config app = Flask(__name__) app.config.from_object(Config) locale.setlocale(locale.LC_ALL, '') db = SQLAlchemy(app) @app.route('/') def index(): return 'UnitPay API' from models import UnitpayPayments, AccountData...
[ "flask.request.args.get", "flask.Flask", "flask_sqlalchemy.SQLAlchemy", "locale.setlocale", "unitpay.UnitPay", "datetime.datetime.now" ]
[((111, 126), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (116, 126), False, 'from flask import Flask\n'), ((158, 193), 'locale.setlocale', 'locale.setlocale', (['locale.LC_ALL', '""""""'], {}), "(locale.LC_ALL, '')\n", (174, 193), False, 'import locale\n'), ((199, 214), 'flask_sqlalchemy.SQLAlchemy', '...
import numpy as np from astropy.io import fits from astropy.table import Table from scipy.interpolate import InterpolatedUnivariateSpline import matplotlib.pyplot as plt #from scipy.signal import medfilt # Your input template template = 'Template_s1d_Gl699_sc1d_v_file_AB.fits' # template = 'Template_s1d_Gl15A_sc1d_v_f...
[ "numpy.polyfit", "numpy.ones", "numpy.argmin", "numpy.mean", "numpy.arange", "numpy.round", "numpy.zeros_like", "scipy.interpolate.InterpolatedUnivariateSpline", "astropy.io.fits.getdata", "numpy.isfinite", "matplotlib.pyplot.show", "matplotlib.pyplot.legend", "os.system", "astropy.table.T...
[((1107, 1149), 'astropy.io.fits.getdata', 'fits.getdata', (['template'], {'ext': '(1)', 'header': '(True)'}), '(template, ext=1, header=True)\n', (1119, 1149), False, 'from astropy.io import fits\n'), ((1801, 1825), 'astropy.io.fits.getdata', 'fits.getdata', (['model_file'], {}), '(model_file)\n', (1813, 1825), False,...
# This program displays a plot of the functions x, x2 and 2x in the range [0, 4] # <NAME> 2019-03-24 # I formulated this solution using the week 9 lectures as a starting point followed by further reading and research which is detailed further in the references section in the Readme file # Additional reading included th...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid" ]
[((728, 754), 'numpy.arange', 'np.arange', ([], {'start': '(0)', 'stop': '(4)'}), '(start=0, stop=4)\n', (737, 754), True, 'import numpy as np\n'), ((924, 975), 'matplotlib.pyplot.xlabel', 'pl.xlabel', (['"""x axis"""'], {'fontsize': '(12)', 'fontweight': '"""bold"""'}), "('x axis', fontsize=12, fontweight='bold')\n", ...
import numpy as np from scipy.linalg import expm class Env( object): def __init__(self, action_space=[0,1,2], dt=0.1): super(Env, self).__init__() self.action_space = action_space self.n_actions = len(self.action_space) self.n_features = 4 self.state = np.arr...
[ "scipy.linalg.expm", "numpy.abs", "numpy.identity", "numpy.array", "numpy.mat" ]
[((314, 336), 'numpy.array', 'np.array', (['[1, 0, 0, 0]'], {}), '([1, 0, 0, 0])\n', (322, 336), True, 'import numpy as np\n'), ((419, 441), 'numpy.array', 'np.array', (['[1, 0, 0, 0]'], {}), '([1, 0, 0, 0])\n', (427, 441), True, 'import numpy as np\n'), ((683, 694), 'numpy.mat', 'np.mat', (['psi'], {}), '(psi)\n', (68...
# CSC 321, Assignment 4 # # This is the main training file for the vanilla GAN part of the assignment. # # Usage: # ====== # To train with the default hyperparamters (saves results to checkpoints_vanilla/ and samples_vanilla/): # python vanilla_gan.py import os import pdb import pickle import argparse import...
[ "models.WGANGenerator", "numpy.random.seed", "argparse.ArgumentParser", "torch.autograd.grad", "torch.device", "scipy.misc.imsave", "torch.no_grad", "os.path.join", "models.WGANDiscriminator", "utils.create_dir", "utils.to_data", "torch.manual_seed", "torch.cuda.manual_seed", "models.WGANG...
[((330, 363), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (353, 363), False, 'import warnings\n'), ((809, 829), 'numpy.random.seed', 'np.random.seed', (['SEED'], {}), '(SEED)\n', (823, 829), True, 'import numpy as np\n'), ((830, 853), 'torch.manual_seed', 'torch.manual_...
import pandas as pd import numpy as np import matplotlib.pyplot as plt df = pd.read_csv('fifa-world-cup/WorldCupMatches.csv') goles = map(sum,zip(df['Home Team Goals'], df['Away Team Goals'])) fig, ax = plt.subplots() # the histogram of the data ax.boxplot(list(goles), vert=True, # vertical box alignment...
[ "pandas.read_csv", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show" ]
[((77, 126), 'pandas.read_csv', 'pd.read_csv', (['"""fifa-world-cup/WorldCupMatches.csv"""'], {}), "('fifa-world-cup/WorldCupMatches.csv')\n", (88, 126), True, 'import pandas as pd\n'), ((206, 220), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (218, 220), True, 'import matplotlib.pyplot as plt\n'), (...
# Generated by Django 3.0.4 on 2020-03-26 14:44 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('neighbourhoodapp', '0004...
[ "django.db.migrations.swappable_dependency", "django.db.migrations.RenameModel", "django.db.models.ForeignKey", "django.db.models.CharField", "django.db.models.AutoField", "django.db.models.ImageField" ]
[((227, 284), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (258, 284), False, 'from django.db import migrations, models\n'), ((377, 434), 'django.db.migrations.RenameModel', 'migrations.RenameModel', ([], {'old_name':...
'''' this is a customize trainer for T5-like mode training, in this class, the training loop is customized for more flexibility and control over ''' import math import os import sys import warnings import tensorflow as tf from tqdm import tqdm from sklearn.metrics import accuracy_score, classification_report import nu...
[ "tensorflow.nn.compute_average_loss", "tensorflow.keras.losses.SparseCategoricalCrossentropy", "tqdm.tqdm", "math.ceil", "sklearn.metrics.accuracy_score", "tensorflow.reshape", "tensorflow.data.Dataset.from_tensor_slices", "sklearn.metrics.classification_report", "sacrebleu.corpus_bleu", "tensorfl...
[((3310, 3359), 'math.ceil', 'math.ceil', (['(num_train_examples / global_batch_size)'], {}), '(num_train_examples / global_batch_size)\n', (3319, 3359), False, 'import math\n'), ((1936, 2075), 'warnings.warn', 'warnings.warn', (['"""Passing `inputs` as a keyword argument is deprecated. Use train_dataset and eval_datas...
import tensorflow as tf import os import numpy as np import time def get_timestamp(name): timestamp = time.asctime().replace(' ', '_').replace(':', '') unique_name = f'{name}_at_{timestamp}' return unique_name def get_callbacks(config, X_train): logs = config['logs'] unique_dir_name = get_timest...
[ "time.asctime", "tensorflow.summary.image", "os.makedirs", "tensorflow.keras.callbacks.ModelCheckpoint", "numpy.reshape", "tensorflow.summary.create_file_writer", "tensorflow.keras.callbacks.TensorBoard", "os.path.join", "tensorflow.keras.callbacks.EarlyStopping" ]
[((366, 445), 'os.path.join', 'os.path.join', (["logs['logs_dir']", 'logs[TENSORBOARD_ROOT_LOG_DIR]', 'unique_dir_name'], {}), "(logs['logs_dir'], logs[TENSORBOARD_ROOT_LOG_DIR], unique_dir_name)\n", (378, 445), False, 'import os\n'), ((451, 503), 'os.makedirs', 'os.makedirs', (['TENSORBOARD_ROOT_LOG_DIR'], {'exist_ok'...
from dash import html import dash_bootstrap_components as dbc import pandas as pd import json # Reading accidents, casualty and vehicles data from last 5 years dfa = pd.read_csv('data/dft-road-casualty-statistics-accident-last-5-years.csv', low_memory=False) dfc = pd.read_csv('data/dft-road-casualty-statistics-casual...
[ "dash.html.H2", "pandas.read_csv", "dash_bootstrap_components.Button", "pandas.read_excel", "dash.html.H6", "dash.html.H5", "dash.html.H3" ]
[((168, 264), 'pandas.read_csv', 'pd.read_csv', (['"""data/dft-road-casualty-statistics-accident-last-5-years.csv"""'], {'low_memory': '(False)'}), "('data/dft-road-casualty-statistics-accident-last-5-years.csv',\n low_memory=False)\n", (179, 264), True, 'import pandas as pd\n'), ((267, 363), 'pandas.read_csv', 'pd....