code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from Bio import BiopythonWarning
import os
import uuid
import io
import subprocess
import logging
import sys
import csv
import time
import re
import shutil
import platform
import distro
i... | [
"Bio.SeqIO.FastaIO.SimpleFastaParser",
"tarfile.open",
"io.open",
"seaborn.set_style",
"itertools.izip",
"sys.exit",
"operator.itemgetter",
"subprocess.Popen",
"matplotlib.pyplot.xlabel",
"logging.FileHandler",
"subprocess.call",
"pkg_resources.get_distribution",
"matplotlib.pyplot.xticks",
... | [((909, 958), 'warnings.simplefilter', 'warnings.simplefilter', (['"""ignore"""', 'BiopythonWarning'], {}), "('ignore', BiopythonWarning)\n", (930, 958), False, 'import warnings\n'), ((1137, 1199), 'os.path.join', 'os.path.join', (['parentdir', '"""aux_scripts"""', '"""genemark_gtf2gff3.pl"""'], {}), "(parentdir, 'aux_... |
'''
A 'base' layer of utility methods.
'''
from collections import OrderedDict as odict
import ctypes
import logging
import json
import os
import shlex
import subprocess
import sys
def basenames(filenames:list) -> list:
'''
Executes `os.path.basename` on each element of the input to provide each element of ... | [
"subprocess.check_output",
"ctypes.windll.shell32.IsUserAnAdmin",
"subprocess.check_call",
"shlex.split",
"sys.platform.startswith",
"os.environ.get",
"os.geteuid",
"os.getcwd",
"os.chdir",
"os.path.isfile",
"os.path.realpath",
"os.path.basename",
"subprocess.call",
"json.load",
"sys.std... | [((2152, 2170), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (2168, 2170), False, 'import sys\n'), ((4390, 4408), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (4406, 4408), False, 'import sys\n'), ((6490, 6523), 'sys.platform.startswith', 'sys.platform.startswith', (['"""darwin"""'], {}), "('d... |
"""
@brief test tree node (time=50s)
"""
import sys
import os
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder
try:
import src
except ImportError:
path = os.path.normpath(
os.path.abspath(
os.path.join(
os.path.... | [
"os.path.exists",
"pyquickhelper.pycode.get_temp_folder",
"os.path.join",
"os.path.abspath",
"pyquickhelper.pycode.check_readme_syntax",
"os.path.split",
"pyquickhelper.loghelper.fLOG",
"unittest.main",
"sys.path.append"
] | [((1260, 1275), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1273, 1275), False, 'import unittest\n'), ((551, 623), 'pyquickhelper.loghelper.fLOG', 'fLOG', (['__file__', 'self._testMethodName'], {'OutputPrint': "(__name__ == '__main__')"}), "(__file__, self._testMethodName, OutputPrint=__name__ == '__main__')\n... |
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from erpnext.crm.report.campaign_efficiency.campaign_efficiency import get_lead_data
def execute(filters=None):
columns, da... | [
"erpnext.crm.report.campaign_efficiency.campaign_efficiency.get_lead_data",
"frappe._"
] | [((361, 397), 'erpnext.crm.report.campaign_efficiency.campaign_efficiency.get_lead_data', 'get_lead_data', (['filters', '"""Lead Owner"""'], {}), "(filters, 'Lead Owner')\n", (374, 397), False, 'from erpnext.crm.report.campaign_efficiency.campaign_efficiency import get_lead_data\n'), ((453, 468), 'frappe._', '_', (['""... |
import logging
from track.backends import BaseBackend
from gamification_event_tracker import client, converter
LOGGER = logging.getLogger(__name__)
TRACKING_LOGGER = logging.getLogger('tracking')
class GamificationProcessor(BaseBackend):
"""
Is responsible for capturing, transforming and sending all the e... | [
"logging.getLogger",
"gamification_event_tracker.client.publisher.publish_event",
"gamification_event_tracker.converter.to_gamma"
] | [((124, 151), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (141, 151), False, 'import logging\n'), ((170, 199), 'logging.getLogger', 'logging.getLogger', (['"""tracking"""'], {}), "('tracking')\n", (187, 199), False, 'import logging\n'), ((986, 1011), 'gamification_event_tracker.convert... |
# -*- coding: utf-8 -*-
import unittest
import re
from edl import TitleMatcher, List
class TitleMatcherTestCase(unittest.TestCase):
"""tests the edl.edl.TitleMatcher class
"""
def setup(self):
"""set up the tests
"""
pass
def test_TitleMatcher_regex_is_working_properly(self)... | [
"edl.TitleMatcher",
"edl.List",
"re.search"
] | [((452, 466), 'edl.TitleMatcher', 'TitleMatcher', ([], {}), '()\n', (464, 466), False, 'from edl import TitleMatcher, List\n'), ((480, 509), 're.search', 're.search', (['e.regex', 'test_line'], {}), '(e.regex, test_line)\n', (489, 509), False, 'import re\n'), ((795, 805), 'edl.List', 'List', (['"""24"""'], {}), "('24')... |
import os, sys
sys.path.insert(0, os.path.join("..",".."))
from nodebox.graphics.context import *
from nodebox.graphics import *
# This example demonstrates motion tweening and prototype-based inheritance on layers.
# Motion tweening is easy: set the Layer.duration parameter to the amount of seconds
# it should take... | [
"os.path.join"
] | [((34, 58), 'os.path.join', 'os.path.join', (['""".."""', '""".."""'], {}), "('..', '..')\n", (46, 58), False, 'import os, sys\n')] |
# Add import from parent directory possible
import matplotlib.pyplot as plt
from core.indicator import indicator
from indicators.candlestick import candlestick
class CandlestickPatterns(indicator):
def __init__(self, dataframe):
''' Constructor '''
indicator.__init__(self, 'CandlestickPatterns',
... | [
"indicators.candlestick.candlestick.inverted_hammer",
"indicators.candlestick.candlestick.bearish_engulfing",
"matplotlib.pyplot.annotate",
"core.indicator.indicator.__init__",
"indicators.candlestick.candlestick.bullish_engulfing",
"indicators.candlestick.candlestick.morning_star",
"indicators.candlest... | [((272, 362), 'core.indicator.indicator.__init__', 'indicator.__init__', (['self', '"""CandlestickPatterns"""', '"""momentum"""', "dataframe['Close'].index"], {}), "(self, 'CandlestickPatterns', 'momentum', dataframe[\n 'Close'].index)\n", (290, 362), False, 'from core.indicator import indicator\n'), ((3079, 3198), ... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
from torchvision import datasets, models, transforms
class STN3D(nn.Module):
def __init__(self, input_channels=3):
super(STN3D, self).__init__()
self.input_channels = input_channels
self.mlp1 = nn.Sequenti... | [
"torch.nn.ReLU",
"torch.eye",
"torch.nn.functional.max_pool1d",
"torchvision.models.resnet18",
"torch.nn.BatchNorm1d",
"torch.nn.functional.log_softmax",
"torch.nn.Linear",
"torch.nn.Conv1d"
] | [((2091, 2122), 'torch.nn.Linear', 'nn.Linear', (['(1024)', 'embedding_size'], {}), '(1024, embedding_size)\n', (2100, 2122), True, 'import torch.nn as nn\n'), ((3307, 3338), 'torch.nn.Linear', 'nn.Linear', (['(1024)', 'embedding_size'], {}), '(1024, embedding_size)\n', (3316, 3338), True, 'import torch.nn as nn\n'), (... |
import re
import os
from datetime import datetime, timedelta
import discord
from discord.ext import tasks
from dotenv import load_dotenv
from session import Session
import operations
import strike_helper
class Client(discord.Client):
def __init__(self, **options):
super().__init__(**options)
self... | [
"operations.create_server",
"operations.add_strike_proponent",
"os.getenv",
"re.compile",
"operations.get_decayed_strikes",
"strike_helper.clear_strike",
"strike_helper.strike_success",
"dotenv.load_dotenv",
"session.Session",
"discord.ext.tasks.loop",
"discord.Intents.default"
] | [((2322, 2344), 'discord.ext.tasks.loop', 'tasks.loop', ([], {'seconds': '(60)'}), '(seconds=60)\n', (2332, 2344), False, 'from discord.ext import tasks\n'), ((3444, 3457), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (3455, 3457), False, 'from dotenv import load_dotenv\n'), ((3472, 3497), 'discord.Intents.de... |
from setuptools import find_packages, setup
url = "https://github.com/SherylHYX/pytorch_geometric_signed_directed"
__version__ = '0.8.0'
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
install_requires = [
"torch",
"torch_sparse",
"torch_scatter",
"sklearn",
... | [
"setuptools.find_packages"
] | [((881, 896), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (894, 896), False, 'from setuptools import find_packages, setup\n')] |
from django.db import models
from accounts.models import Account
from store.models import Product
class Order(models.Model):
STATUS = (
('New', 'Nuevo'),
('Accepted', 'Aceptado'),
('Completed', 'Completado'),
('Cancel', 'Cancelado'),
)
user = models.ForeignKey(Account, on_... | [
"django.db.models.FloatField",
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.models.BooleanField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((290, 353), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Account'], {'on_delete': 'models.CASCADE', 'null': '(True)'}), '(Account, on_delete=models.CASCADE, null=True)\n', (307, 353), False, 'from django.db import models\n'), ((373, 404), 'django.db.models.CharField', 'models.CharField', ([], {'max_length':... |
r"""
This script is meant to act as a Catalyst instrumented simulation code.
Instead of actually computing values though it just reads in files that
are passed in through the command line and sets that up to act like
it's coming in as simulation computed values.
This script must be run with pvbatch, either in serial o... | [
"paraview.simple.servermanager.vtkProcessModule.GetProcessModule",
"paraview.modules.vtkPVPythonCatalyst.vtkCPPythonScriptPipeline",
"paraview.simple.servermanager.Fetch",
"paraview.simple.OpenDataFile",
"paraview.modules.vtkPVCatalyst.vtkCPDataDescription",
"paraview.modules.vtkPVCatalyst.vtkCPProcessor"... | [((1438, 1496), 'paraview.simple.servermanager.vtkProcessModule.GetProcessModule', 'pvsimple.servermanager.vtkProcessModule.GetProcessModule', ([], {}), '()\n', (1494, 1496), True, 'import paraview.simple as pvsimple\n'), ((1694, 1716), 'glob.glob', 'glob.glob', (['sys.argv[1]'], {}), '(sys.argv[1])\n', (1703, 1716), F... |
from django.contrib.auth.models import User
from django.core import exceptions
from django.shortcuts import render, redirect
from django.core.exceptions import ObjectDoesNotExist
from django.contrib.auth.decorators import login_required
from .forms import CreateProfileForm
from django.http import HttpResponseRedirect,H... | [
"django.shortcuts.render",
"django.http.HttpResponseRedirect",
"django.db.models.F",
"rest_framework.response.Response",
"django.shortcuts.redirect",
"django.http.request.GET.get",
"datetime.date.today",
"django.contrib.auth.models.User.objects.get"
] | [((880, 914), 'django.shortcuts.render', 'render', (['request', '"""errors/404.html"""'], {}), "(request, 'errors/404.html')\n", (886, 914), False, 'from django.shortcuts import render, redirect\n'), ((972, 987), 'datetime.date.today', 'dt.date.today', ([], {}), '()\n', (985, 987), True, 'import datetime as dt\n'), ((1... |
import time
import cv2
import numpy as np
from PIL import ImageGrab
import win32gui
import win32con
import win32api
import win32com, win32com.client
import re
from playsound import playsound
import jstyleson as json
from os import path
import sys
from collections import deque
import builtins as __builtin__
from datetim... | [
"win32gui.GetWindowRect",
"PIL.ImageGrab.grab",
"playsound.playsound",
"time.sleep",
"sys.exit",
"win32api.SendMessage",
"win32gui.SetForegroundWindow",
"collections.deque",
"numpy.asarray",
"win32gui.ShowWindow",
"re.finditer",
"win32com.client.Dispatch",
"numpy.ones",
"win32gui.GetWindow... | [((663, 680), 'collections.deque', 'deque', ([], {'maxlen': '(100)'}), '(maxlen=100)\n', (668, 680), False, 'from collections import deque\n'), ((384, 398), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (396, 398), False, 'from datetime import datetime\n'), ((535, 590), 'builtins.print', '__builtin__.print... |
# Copyright 2014 Facebook, Inc.
# You are hereby granted a non-exclusive, worldwide, royalty-free license to
# use, copy, modify, and distribute this software in source code or binary
# form for use in connection with the web services and APIs provided by
# Facebook.
# As with any software that integrates with the Fa... | [
"facebook_business.adobjects.objectparser.ObjectParser",
"facebook_business.utils.api_utils.warning",
"facebook_business.typechecker.TypeChecker"
] | [((2588, 2667), 'facebook_business.utils.api_utils.warning', 'api_utils.warning', (['"""`success` and `failure` callback only work for batch call."""'], {}), "('`success` and `failure` callback only work for batch call.')\n", (2605, 2667), False, 'from facebook_business.utils import api_utils\n'), ((3657, 3736), 'faceb... |
# -*- coding: utf-8 -*-
# rmdir.test.py
# Для удаления папки используется функция rmdir(),
# в которую передается путь к удаляемой папке:
import os
# путь относительно текущего скрипта
os.rmdir("hello")
# абсолютный путь
os.rmdir("c://somedir/hello")
| [
"os.rmdir"
] | [((187, 204), 'os.rmdir', 'os.rmdir', (['"""hello"""'], {}), "('hello')\n", (195, 204), False, 'import os\n'), ((223, 252), 'os.rmdir', 'os.rmdir', (['"""c://somedir/hello"""'], {}), "('c://somedir/hello')\n", (231, 252), False, 'import os\n')] |
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Tests for the L{array} L{pyamf.adapters._array} module.
@since: 0.5
"""
try:
import array
except ImportError:
array = None
import unittest
import pyamf
class ArrayTestCase(unittest.TestCase):
"""
"""
def setUp(self):
... | [
"array.array",
"pyamf.encode"
] | [((460, 476), 'array.array', 'array.array', (['"""b"""'], {}), "('b')\n", (471, 476), False, 'import array\n'), ((659, 700), 'pyamf.encode', 'pyamf.encode', (['self.obj'], {'encoding': 'encoding'}), '(self.obj, encoding=encoding)\n', (671, 700), False, 'import pyamf\n')] |
import numpy as np
def R2_nom_denom(y, yhat):
""" Calculates the nominator and denomitor for calculating R-squared
Args:
y (array): data
yhat (array): predicted data data
Returns:
nominator (float or array), denominator (float or array)
"""
y, yhat = np.array(y), np.array... | [
"numpy.sum",
"numpy.array",
"numpy.errstate"
] | [((299, 310), 'numpy.array', 'np.array', (['y'], {}), '(y)\n', (307, 310), True, 'import numpy as np\n'), ((312, 326), 'numpy.array', 'np.array', (['yhat'], {}), '(yhat)\n', (320, 326), True, 'import numpy as np\n'), ((336, 382), 'numpy.errstate', 'np.errstate', ([], {'divide': '"""ignore"""', 'invalid': '"""ignore"""'... |
import time
import glob
import common.gym_interface as gym_interface
import pybullet as p
import os
import pybullet_data
import shutil
import re
import numpy as np
import random
def set_torque(jointIndex, torque):
p.setJointMotorControl2(bodyIndex=robot,
jointIndex=jointIndex,
... | [
"pybullet.getJointInfo",
"pybullet.resetSimulation",
"pybullet_data.getDataPath",
"pybullet.loadMJCF",
"pybullet.loadSDF",
"pybullet.getDynamicsInfo",
"pybullet.connect",
"pybullet.getNumJoints",
"time.sleep",
"pybullet.configureDebugVisualizer",
"pybullet.stepSimulation",
"pybullet.setJointMo... | [((423, 439), 'pybullet.connect', 'p.connect', (['p.GUI'], {}), '(p.GUI)\n', (432, 439), True, 'import pybullet as p\n'), ((440, 487), 'pybullet.configureDebugVisualizer', 'p.configureDebugVisualizer', (['p.COV_ENABLE_GUI', '(0)'], {}), '(p.COV_ENABLE_GUI, 0)\n', (466, 487), True, 'import pybullet as p\n'), ((218, 330)... |
import sys
import cv2
import numpy as np
from line_boundary_check import *
# ----------------------------------------------------------------------------
g_mouse_pos = [0 ,0]
# Mouse event handler
def onMouse(event, x, y, flags, param):
global g_mouse_pos
g_mouse_pos = [x, y]
# ----------------------... | [
"cv2.setMouseCallback",
"cv2.polylines",
"cv2.line",
"cv2.imshow",
"numpy.array",
"numpy.zeros",
"cv2.waitKey",
"cv2.namedWindow",
"cv2.drawMarker"
] | [((824, 889), 'cv2.line', 'cv2.line', (['img', '(x1, y1)', '(x2, y2)', 'line.color', 'line.lineThinkness'], {}), '(img, (x1, y1), (x2, y2), line.color, line.lineThinkness)\n', (832, 889), False, 'import cv2\n'), ((1142, 1214), 'cv2.drawMarker', 'cv2.drawMarker', (['img', '(x1, y1)', 'line.color', 'cv2.MARKER_TRIANGLE_U... |
import torch
from math import log
def log_normalize(logp):
return logp - torch.logsumexp(logp.flatten(), dim=-1)
def log2prob(logp):
return torch.exp(log_normalize(logp))
def temperature(logp, temp):
return log_normalize(logp/temp)
def discrete_entropy(logp):
logp = log_normalize(logp)
plogp... | [
"torch.exp",
"math.log",
"torch.tensor",
"torch.sum",
"torch.isinf",
"torch.isnan"
] | [((448, 464), 'torch.sum', 'torch.sum', (['plogp'], {}), '(plogp)\n', (457, 464), False, 'import torch\n'), ((350, 368), 'torch.isnan', 'torch.isnan', (['plogp'], {}), '(plogp)\n', (361, 368), False, 'import torch\n'), ((385, 403), 'torch.isinf', 'torch.isinf', (['plogp'], {}), '(plogp)\n', (396, 403), False, 'import t... |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distribu... | [
"numpy.abs",
"numpy.random.rand",
"numpy.ones",
"openfermion.utils._sparse_tools.get_linear_qubit_operator_diagonal",
"numpy.hstack",
"scipy.linalg.orth",
"numpy.real",
"numpy.dot",
"numpy.stack",
"numpy.linalg.norm",
"numpy.linalg.eigh",
"warnings.warn",
"openfermion.utils._linear_qubit_ope... | [((16137, 16164), 'numpy.random.rand', 'numpy.random.rand', (['row', 'col'], {}), '(row, col)\n', (16154, 16164), False, 'import numpy\n'), ((16285, 16318), 'scipy.linalg.orth', 'scipy.linalg.orth', (['random_vectors'], {}), '(random_vectors)\n', (16302, 16318), False, 'import scipy\n'), ((6328, 6360), 'scipy.linalg.or... |
'''
Created on Oct 3, 2010
@author: Mark V Systems Limited
(c) Copyright 2010 Mark V Systems Limited, All rights reserved.
'''
import os, io, sys, traceback
from collections import defaultdict
from decimal import Decimal
from lxml import etree
from xml.sax import SAXParseException
from arelle import (PackageManager, X... | [
"re.compile",
"arelle.XbrlConst.ixbrlTagPattern.match",
"arelle.PrototypeDtsObject.ArcPrototype",
"lxml.etree.iterparse",
"arelle.XbrlConst.isTableIndexingArcrole",
"arelle.XmlValidate.lxmlSchemaValidate",
"arelle.PackageManager.isMappedUrl",
"arelle.XhtmlValidate.xhtmlValidate",
"arelle.XhtmlValida... | [((76438, 76455), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (76449, 76455), False, 'from collections import defaultdict\n'), ((76862, 76879), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (76873, 76879), False, 'from collections import defaultdict\n'), ((76962, 76978)... |
# coding=utf-8
# Author: <NAME> <<EMAIL>>
#
# License: BSD 3 clause
import warnings
import numpy as np
from deslib.base import BaseDS
from deslib.util.aggregation import majority_voting_rule
from deslib.util.diversity import Q_statistic, ratio_errors, \
negative_double_fault, compute_pairwise_diversity
from sklea... | [
"sklearn.cluster.KMeans",
"numpy.mean",
"numpy.ceil",
"numpy.where",
"deslib.util.diversity.compute_pairwise_diversity",
"numpy.argsort",
"numpy.zeros",
"numpy.apply_along_axis",
"warnings.warn",
"deslib.util.aggregation.majority_voting_rule",
"numpy.arange"
] | [((6885, 6945), 'numpy.zeros', 'np.zeros', (['(self.clustering_.n_clusters, self.n_classifiers_)'], {}), '((self.clustering_.n_clusters, self.n_classifiers_))\n', (6893, 6945), True, 'import numpy as np\n'), ((6993, 7053), 'numpy.zeros', 'np.zeros', (['(self.clustering_.n_clusters, self.n_classifiers_)'], {}), '((self.... |
import setuptools
with open("README.md", "r") as readme:
long_description = readme.read()
setuptools.setup(
name = 'hjc236_covid_dashboard',
version = '1.52',
author = 'hjc236',
author_email = '',
description = 'A python project which generates a web dashboard with COVID-19 data and relevant n... | [
"setuptools.find_packages"
] | [((504, 530), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (528, 530), False, 'import setuptools\n')] |
import selenium.webdriver as web_driver
import selenium.webdriver.support.ui as html_elem
import selenium.webdriver.support.expected_conditions as econ
import selenium.webdriver.common.by as b
import termcolor as pr
import time
import os
#import random
#tempval = ''.join(random.sample(val, 8))
# identi... | [
"selenium.webdriver.ChromeOptions",
"selenium.webdriver.support.ui.WebDriverWait",
"termcolor.colored",
"selenium.webdriver.Chrome",
"selenium.webdriver.Firefox",
"time.sleep",
"selenium.webdriver.FirefoxOptions",
"selenium.webdriver.support.expected_conditions.presence_of_element_located",
"os.syst... | [((2351, 2386), 'selenium.webdriver.support.ui.WebDriverWait', 'html_elem.WebDriverWait', (['driver', '(20)'], {}), '(driver, 20)\n', (2374, 2386), True, 'import selenium.webdriver.support.ui as html_elem\n'), ((2539, 2574), 'selenium.webdriver.support.ui.WebDriverWait', 'html_elem.WebDriverWait', (['driver', '(20)'], ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import time
import numpy as np
import tensorflow as tf
import model
from data_reader import load_data, DataReader
flags = tf.flags
# data
flags.DEFINE_string('data_dir', 'data', 'data directo... | [
"model.model_size",
"tensorflow.Summary.Value",
"tensorflow.set_random_seed",
"tensorflow.app.run",
"os.path.exists",
"tensorflow.Graph",
"data_reader.load_data",
"tensorflow.Session",
"numpy.exp",
"tensorflow.assign",
"os.mkdir",
"numpy.random.seed",
"model.training_graph",
"tensorflow.va... | [((3284, 3347), 'data_reader.load_data', 'load_data', (['FLAGS.data_dir', 'FLAGS.max_word_length'], {'eos': 'FLAGS.EOS'}), '(FLAGS.data_dir, FLAGS.max_word_length, eos=FLAGS.EOS)\n', (3293, 3347), False, 'from data_reader import load_data, DataReader\n'), ((3368, 3470), 'data_reader.DataReader', 'DataReader', (["word_t... |
import pygame
import copy
from cell import *
from settings import *
vec = pygame.math.Vector2
class Game_window:
# Initial setup for Game window and grid
def __init__(self, screen, x, y):
self.screen = screen
self.pos = vec(x, y)
self.width, self.height = 600, 600
self.image = pygam... | [
"copy.copy",
"pygame.Surface"
] | [((315, 356), 'pygame.Surface', 'pygame.Surface', (['(self.width, self.height)'], {}), '((self.width, self.height))\n', (329, 356), False, 'import pygame\n'), ((1287, 1307), 'copy.copy', 'copy.copy', (['self.grid'], {}), '(self.grid)\n', (1296, 1307), False, 'import copy\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask, render_template, request
import pandas as pd
from werkzeug.datastructures import FileStorage
app = Flask(__name__) # Flask setting
ALLOWED_EXTENSIONS = set(['csv'])
def allowed_file(filename):
return '.' in filename and \
filename.... | [
"flask.render_template",
"flask.request.form.get",
"pandas.read_csv",
"flask.Flask"
] | [((172, 187), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (177, 187), False, 'from flask import Flask, render_template, request\n'), ((448, 490), 'flask.render_template', 'render_template', (['"""index.html"""'], {'title': 'title'}), "('index.html', title=title)\n", (463, 490), False, 'from flask import... |
import json
from graphite.util import jsonResponse, HttpResponse, HttpError
from graphite.functions import SeriesFunctions, SeriesFunction, PieFunctions, PieFunction, functionInfo
class jsonInfinityEncoder(json.JSONEncoder):
def encode(self, o):
return super(jsonInfinityEncoder, self).encode(o).replace('... | [
"graphite.util.jsonResponse",
"graphite.functions.SeriesFunction",
"graphite.functions.SeriesFunctions",
"graphite.util.HttpError",
"graphite.functions.PieFunction",
"graphite.functions.functionInfo",
"graphite.util.HttpResponse",
"graphite.functions.PieFunctions"
] | [((462, 503), 'graphite.util.jsonResponse', 'jsonResponse', ([], {'encoder': 'jsonInfinityEncoder'}), '(encoder=jsonInfinityEncoder)\n', (474, 503), False, 'from graphite.util import jsonResponse, HttpResponse, HttpError\n'), ((1238, 1279), 'graphite.util.jsonResponse', 'jsonResponse', ([], {'encoder': 'jsonInfinityEnc... |
#!/usr/bin/env python
"""
Code to load an expert policy and generate roll-out data for behavioral cloning.
Example usage:
python run_expert_pytorch.py experts/Humanoid-v1.pkl Humanoid-v2 --render \
--num_rollouts 20
Author of this script and included expert policies: <NAME> (<EMAIL>)
"""
import pickl... | [
"numpy.mean",
"numpy.reshape",
"random.shuffle",
"argparse.ArgumentParser",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"tensorflow.Session",
"load_policy.load_policy",
"tf_util.initialize",
"torch.FloatTensor",
"torch.max",
"torch.nn.MSELoss",
"matplo... | [((782, 825), 'load_policy.load_policy', 'load_policy.load_policy', (['expert_policy_file'], {}), '(expert_policy_file)\n', (805, 825), False, 'import load_policy\n'), ((2125, 2153), 'numpy.reshape', 'np.reshape', (['pair[0]', '(1, -1)'], {}), '(pair[0], (1, -1))\n', (2135, 2153), True, 'import numpy as np\n'), ((2165,... |
from __future__ import absolute_import
from django.contrib import admin
from .models import Consumer, Scope, Token
class ScopeAdmin(admin.ModelAdmin):
pass
class ConsumerAdmin(admin.ModelAdmin):
raw_id_fields = ['user']
class TokenAdmin(admin.ModelAdmin):
raw_id_fields = ['user', 'consumer', 'scope'... | [
"django.contrib.admin.site.register"
] | [((324, 362), 'django.contrib.admin.site.register', 'admin.site.register', (['Scope', 'ScopeAdmin'], {}), '(Scope, ScopeAdmin)\n', (343, 362), False, 'from django.contrib import admin\n'), ((363, 407), 'django.contrib.admin.site.register', 'admin.site.register', (['Consumer', 'ConsumerAdmin'], {}), '(Consumer, Consumer... |
import re
import copy
import pickle
import numpy as np
from collections import OrderedDict
import torch
from torch.autograd import Variable
import global_variables as g
def save_checkpoint(state, filename='./checkpoints/checkpoint.pth.tar'):
print('save model!', filename)
torch.save(state, filename)
def sav... | [
"collections.OrderedDict",
"pickle.dump",
"torch.LongTensor",
"torch.stack",
"pickle.load",
"torch.from_numpy",
"numpy.zeros",
"torch.cuda.is_available",
"torch.save",
"copy.deepcopy",
"re.sub",
"torch.autograd.Variable",
"torch.FloatTensor"
] | [((283, 310), 'torch.save', 'torch.save', (['state', 'filename'], {}), '(state, filename)\n', (293, 310), False, 'import torch\n'), ((594, 673), 'collections.OrderedDict', 'OrderedDict', (["{'R_cuisine': [], 'R_location': [], 'R_price': [], 'R_number': []}"], {}), "({'R_cuisine': [], 'R_location': [], 'R_price': [], 'R... |
from django.shortcuts import render, redirect
from django.urls import reverse_lazy
from django.contrib import messages
from .models import Post
from .forms import PostForm
def post_list(request):
posts = Post.objects.all()
context = {'posts': posts}
return render(request, 'blog/post_list.html', context)
... | [
"django.shortcuts.render",
"django.contrib.messages.error",
"django.urls.reverse_lazy",
"django.contrib.messages.success"
] | [((272, 319), 'django.shortcuts.render', 'render', (['request', '"""blog/post_list.html"""', 'context'], {}), "(request, 'blog/post_list.html', context)\n", (278, 319), False, 'from django.shortcuts import render, redirect\n'), ((931, 977), 'django.shortcuts.render', 'render', (['request', '"""blog/post_new.html"""', '... |
from django.contrib import admin
from .models import Course,Category,Tag
@admin.register(Course)
class CourseAdmin(admin.ModelAdmin):
list_display = ('name','available','teacher')
list_filter = ('available',)
search_fields = ('name','description')
@admin.register(Category)
class CategoryAdmin(admin.Model... | [
"django.contrib.admin.register"
] | [((76, 98), 'django.contrib.admin.register', 'admin.register', (['Course'], {}), '(Course)\n', (90, 98), False, 'from django.contrib import admin\n'), ((264, 288), 'django.contrib.admin.register', 'admin.register', (['Category'], {}), '(Category)\n', (278, 288), False, 'from django.contrib import admin\n'), ((375, 394)... |
# Copyright (c) 2017, the ElectrumX authors
#
# All rights reserved.
#
# The MIT License (MIT)
#
# 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 limit... | [
"lib.hash.hex_str_to_hash",
"os.listdir",
"os.path.join",
"lib.coins.Coin.lookup_coin_class",
"os.path.realpath",
"pytest.fail",
"json.load",
"pytest.fixture",
"binascii.unhexlify"
] | [((1524, 1546), 'os.listdir', 'os.listdir', (['BLOCKS_DIR'], {}), '(BLOCKS_DIR)\n', (1534, 1546), False, 'import os\n'), ((1837, 1866), 'pytest.fixture', 'pytest.fixture', ([], {'params': 'blocks'}), '(params=blocks)\n', (1851, 1866), False, 'import pytest\n'), ((2007, 2037), 'binascii.unhexlify', 'unhexlify', (["block... |
import curses
import math
import os
import traceback
import threading
import time
import random
import getpass
import json
import sqlite3
import string
import re
import completer
import datetime
class CursedMenu(object):
#TODO: name your plant
'''A class which abstracts the horrors of building a curses-based m... | [
"completer",
"completer.update_input",
"curses.start_color",
"curses.endwin",
"time.sleep",
"curses.curs_set",
"getpass.getuser",
"re.search",
"os.path.exists",
"curses.init_pair",
"json.dumps",
"threading.RLock",
"completer.complete",
"curses.has_colors",
"traceback.print_exc",
"os.pa... | [((38358, 38373), 'curses.endwin', 'curses.endwin', ([], {}), '()\n', (38371, 38373), False, 'import curses\n'), ((38378, 38396), 'os.system', 'os.system', (['"""clear"""'], {}), "('clear')\n", (38387, 38396), False, 'import os\n'), ((465, 481), 'curses.initscr', 'curses.initscr', ([], {}), '()\n', (479, 481), False, '... |
""" Allows for access to these methods and classes through the .utils module.
"""
from .alae import find_alpha, allow_gradient
from .alae import adjust_lr, linear_scale_lr
from .alae import save_batch, save_reconstructions
from .noise import sample_noise, FAMOS_Noise
from .density import matrix_log_density_gaussian, lo... | [
"os.system"
] | [((575, 643), 'os.system', 'os.system', (['f"""nvidia-smi -i {i} --query-gpu=memory.free --format=csv"""'], {}), "(f'nvidia-smi -i {i} --query-gpu=memory.free --format=csv')\n", (584, 643), False, 'import os\n')] |
import Web3Wrapper
import InputGenerator
import FormulaSolidityPort
MINIMUM_VALUE_BALANCE = 100
MAXIMUM_VALUE_BALANCE = 10 ** 34
GROWTH_FACTOR_BALANCE = 2.5
MINIMUM_VALUE_WEIGHT = 100000
MAXIMUM_VALUE_WEIGHT = 900000
GROWTH_FACTOR_WEIGHT = 1.5
MINIMUM_VALUE_AMOUNT = 1
MAXIMUM_VALUE_AMOUNT = 10 ** 34
GROWTH_FACTOR_A... | [
"InputGenerator.ExponentialDistribution",
"Web3Wrapper.Contract"
] | [((366, 477), 'InputGenerator.ExponentialDistribution', 'InputGenerator.ExponentialDistribution', (['MINIMUM_VALUE_BALANCE', 'MAXIMUM_VALUE_BALANCE', 'GROWTH_FACTOR_BALANCE'], {}), '(MINIMUM_VALUE_BALANCE,\n MAXIMUM_VALUE_BALANCE, GROWTH_FACTOR_BALANCE)\n', (404, 477), False, 'import InputGenerator\n'), ((493, 601),... |
# -*- coding: utf-8 -*-
"""
jinja2.ext
~~~~~~~~~~
Jinja extensions allow to add custom tags similar to the way django custom
tags work. By default two project extensions exist: an i18n and a cache
extension.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD.
"""
import re
from jinja2... | [
"jinja2._compat.with_metaclass",
"jinja2.runtime.concat",
"jinja2._compat.iteritems",
"jinja2.nodes.Name",
"jinja2.nodes.Output",
"re.compile",
"jinja2.utils.import_string",
"jinja2.nodes.MarkSafeIfAutoescape",
"jinja2.nodes.Keyword",
"jinja2.nodes.Const",
"jinja2.utils.Markup",
"jinja2.nodes.... | [((1385, 1426), 'jinja2._compat.with_metaclass', 'with_metaclass', (['ExtensionRegistry', 'object'], {}), '(ExtensionRegistry, object)\n', (1399, 1426), False, 'from jinja2._compat import with_metaclass, string_types, iteritems\n'), ((4627, 4689), 'jinja2.nodes.ExtensionAttribute', 'nodes.ExtensionAttribute', (['self.i... |
from lib.solutions.CHK import checkout_solution
class TestSkus():
def test_skus_should_created(self):
skus_a = checkout_solution.Skus(product_name='A', price=10.0)
assert skus_a.get_product_name() == 'A'
assert skus_a.get_price() == 10.0
assert skus_a.get_number_of_items() ==... | [
"lib.solutions.CHK.checkout_solution.Discount",
"lib.solutions.CHK.checkout_solution.Skus",
"lib.solutions.CHK.checkout_solution.checkout",
"lib.solutions.CHK.checkout_solution.Basket"
] | [((128, 180), 'lib.solutions.CHK.checkout_solution.Skus', 'checkout_solution.Skus', ([], {'product_name': '"""A"""', 'price': '(10.0)'}), "(product_name='A', price=10.0)\n", (150, 180), False, 'from lib.solutions.CHK import checkout_solution\n'), ((458, 527), 'lib.solutions.CHK.checkout_solution.Discount', 'checkout_so... |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.trial import unittest
from twisted.news import database
from twisted.news import nntp
from twisted.protocols import loopback
from twisted.test import proto_helpers
ALL_GROUPS = ('alt.test.nntp', 0, 1, 'y'),
GROUP = ('0', '1', '0', 'a... | [
"twisted.news.database.NewsShelf",
"twisted.news.nntp.NNTPClient.__init__",
"twisted.news.nntp.NNTPServer",
"twisted.test.proto_helpers.StringTransport",
"twisted.protocols.loopback.loopbackAsync",
"twisted.news.nntp.NNTPClient.connectionMade"
] | [((913, 943), 'twisted.news.nntp.NNTPClient.__init__', 'nntp.NNTPClient.__init__', (['self'], {}), '(self)\n', (937, 943), False, 'from twisted.news import nntp\n'), ((1091, 1127), 'twisted.news.nntp.NNTPClient.connectionMade', 'nntp.NNTPClient.connectionMade', (['self'], {}), '(self)\n', (1121, 1127), False, 'from twi... |
import json
import os
import logging
import tempfile
import shlex
import shutil
import sys
from subprocess import Popen, PIPE
from .. import package_info
from . import client
from .constants import InsightsConstants as constants
from .config import InsightsConfig
logger = logging.getLogger(__name__)
net_logger = logg... | [
"logging.getLogger",
"shutil.move",
"shlex.split",
"json.dumps",
"os.path.join",
"os.path.isfile",
"shutil.copyfile",
"os.path.isdir",
"tempfile.mkdtemp",
"os.mkdir",
"sys.exit"
] | [((275, 302), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (292, 302), False, 'import logging\n'), ((316, 344), 'logging.getLogger', 'logging.getLogger', (['"""network"""'], {}), "('network')\n", (333, 344), False, 'import logging\n'), ((2455, 2473), 'tempfile.mkdtemp', 'tempfile.mkdtem... |
"""
Copyright 2019 Samsung SDS
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 applic... | [
"numpy.mean",
"pandas.isnull",
"numpy.median",
"numpy.unique",
"numpy.std",
"numpy.max",
"numpy.count_nonzero",
"numpy.sum",
"numpy.array",
"numpy.min",
"numpy.percentile",
"numpy.var"
] | [((768, 777), 'numpy.max', 'np.max', (['a'], {}), '(a)\n', (774, 777), True, 'import numpy as np\n'), ((802, 811), 'numpy.min', 'np.min', (['a'], {}), '(a)\n', (808, 811), True, 'import numpy as np\n'), ((884, 893), 'numpy.sum', 'np.sum', (['a'], {}), '(a)\n', (890, 893), True, 'import numpy as np\n'), ((919, 929), 'nu... |
import pytest
import ray
from ray import serve
from ray.serve.config import BackendConfig
def test_batching(serve_instance):
client = serve_instance
class BatchingExample:
def __init__(self):
self.count = 0
@serve.accept_batch
def __call__(self, requests):
se... | [
"ray.serve.config.BackendConfig",
"pytest.raises",
"ray.get",
"pytest.main"
] | [((461, 514), 'ray.serve.config.BackendConfig', 'BackendConfig', ([], {'max_batch_size': '(5)', 'batch_wait_timeout': '(1)'}), '(max_batch_size=5, batch_wait_timeout=1)\n', (474, 514), False, 'from ray.serve.config import BackendConfig\n'), ((855, 875), 'ray.get', 'ray.get', (['future_list'], {}), '(future_list)\n', (8... |
r"""
Multivariate Polynomial Rings over Generic Rings
Sage implements multivariate polynomial rings through several
backends. This generic implementation uses the classes ``PolyDict``
and ``ETuple`` to construct a dictionary with exponent tuples as keys
and coefficients as values.
AUTHORS:
- <NAME> and <NAME>
- <NA... | [
"sage.rings.polynomial.multi_polynomial_ring_base.is_MPolynomialRing",
"sage.rings.polynomial.term_order.TermOrder",
"sage.rings.polynomial.multi_polynomial_ideal.MPolynomialIdeal",
"sage.rings.polynomial.polydict.PolyDict",
"sage.rings.polynomial.multi_polynomial_element.MPolynomial_polydict",
"sage.ring... | [((3991, 4010), 'sage.rings.polynomial.term_order.TermOrder', 'TermOrder', (['order', 'n'], {}), '(order, n)\n', (4000, 4010), False, 'from sage.rings.polynomial.term_order import TermOrder\n'), ((4701, 4764), 'sage.rings.polynomial.multi_polynomial_ring_base.MPolynomialRing_base.__init__', 'MPolynomialRing_base.__init... |
# -*- coding: utf-8 -*-
"""Parser for PL/SQL Developer Recall files."""
from __future__ import unicode_literals
from dfdatetime import delphi_date_time as dfdatetime_delphi_date_time
from plaso.containers import events
from plaso.containers import time_events
from plaso.lib import errors
from plaso.lib import defini... | [
"plaso.containers.time_events.DateTimeValuesEvent",
"dfdatetime.delphi_date_time.DelphiDateTime",
"plaso.lib.timelib.Timestamp.GetNow",
"plaso.lib.errors.UnableToParseFile",
"plaso.parsers.manager.ParsersManager.RegisterParser"
] | [((4784, 4838), 'plaso.parsers.manager.ParsersManager.RegisterParser', 'manager.ParsersManager.RegisterParser', (['PlsRecallParser'], {}), '(PlsRecallParser)\n', (4821, 4838), False, 'from plaso.parsers import manager\n'), ((2557, 2583), 'plaso.lib.timelib.Timestamp.GetNow', 'timelib.Timestamp.GetNow', ([], {}), '()\n'... |
import json
from django.template.loader import render_to_string
from django.utils.decorators import method_decorator
from django.utils.translation import ugettext_lazy
from django.views.decorators.cache import cache_control
from django.http import HttpResponse, Http404
from django.http import HttpResponseRedirect
from... | [
"corehq.apps.accounting.utils.domain_has_privilege",
"corehq.apps.app_manager.models.SavedAppBuild.wrap",
"corehq.apps.app_manager.views.utils.get_langs",
"django.core.urlresolvers.reverse",
"django.views.decorators.cache.cache_control",
"corehq.apps.app_manager.views.utils.back_to_main",
"corehq.apps.a... | [((1714, 1757), 'django.views.decorators.cache.cache_control', 'cache_control', ([], {'no_cache': '(True)', 'no_store': '(True)'}), '(no_cache=True, no_store=True)\n', (1727, 1757), False, 'from django.views.decorators.cache import cache_control\n'), ((2216, 2265), 'corehq.util.timezones.utils.get_timezone_for_user', '... |
"""
Analyze spike shapes - pulled out of IVCurve 2/6/2016 pbm.
Allows routine to be used to analyze spike trains independent of acq4's data models.
Create instance, then call setup to define the "Clamps" object and the spike threshold.
The Clamps object must have the following variables defined:
commandLevels (cu... | [
"numpy.mean",
"collections.OrderedDict",
"numpy.abs",
"numpy.fabs",
"numpy.where",
"numpy.sort",
"numpy.std",
"numpy.diff",
"numpy.argmax",
"numpy.max",
"numpy.array",
"numpy.zeros",
"numpy.argwhere",
"pprint.PrettyPrinter",
"numpy.min",
"numpy.argmin",
"numpy.gradient"
] | [((6089, 6102), 'numpy.zeros', 'np.zeros', (['ntr'], {}), '(ntr)\n', (6097, 6102), True, 'import numpy as np\n'), ((6122, 6135), 'numpy.zeros', 'np.zeros', (['ntr'], {}), '(ntr)\n', (6130, 6135), True, 'import numpy as np\n'), ((6156, 6169), 'numpy.zeros', 'np.zeros', (['ntr'], {}), '(ntr)\n', (6164, 6169), True, 'impo... |
from setuptools import setup
with open('README.md') as f:
readme = f.read()
setup(name='MSATwtdenoiser',
version='0.0.4',
description='Denoising a 2D signal based on wavelet',
long_description=readme,
long_description_content_type='text/markdown',
url='https://github.com/ahsouri/MSAT... | [
"setuptools.setup"
] | [((82, 511), 'setuptools.setup', 'setup', ([], {'name': '"""MSATwtdenoiser"""', 'version': '"""0.0.4"""', 'description': '"""Denoising a 2D signal based on wavelet"""', 'long_description': 'readme', 'long_description_content_type': '"""text/markdown"""', 'url': '"""https://github.com/ahsouri/MSATwtdenoiser"""', 'author... |
from pathlib import Path
import PIL.Image as PImage
import tensorflow as tf
import numpy as np
from keras.preprocessing.image import ImageDataGenerator
from keras.preprocessing.image import img_to_array
from collections import Counter
class CNN_Model:
def __init__(self):
self.configSet = False
def cre... | [
"keras.preprocessing.image.img_to_array",
"tensorflow.keras.layers.Conv2D",
"pathlib.Path",
"numpy.argmax",
"keras.preprocessing.image.ImageDataGenerator",
"numpy.max",
"collections.Counter",
"tensorflow.keras.layers.Dense",
"numpy.expand_dims",
"tensorflow.keras.layers.Flatten",
"tensorflow.ker... | [((370, 487), 'keras.preprocessing.image.ImageDataGenerator', 'ImageDataGenerator', ([], {'rescale': '(1.0 / 255)', 'shear_range': '(0.2)', 'zoom_range': '(0.2)', 'vertical_flip': '(False)', 'horizontal_flip': '(True)'}), '(rescale=1.0 / 255, shear_range=0.2, zoom_range=0.2,\n vertical_flip=False, horizontal_flip=Tr... |
# encoder.py
# <NAME>
# Encoder Class Adapted from py-gaugette rotary encoder library
import RPi.GPIO as GPIO
import time
import math
import threading
class Encoder:
def __init__(self, pin_a, pin_b):
self.pin_a = pin_b; # Our Encoders are inverted,
self.pin_b = pin_a; # Which is why this looks we... | [
"threading.Thread.__init__",
"RPi.GPIO.add_event_detect",
"RPi.GPIO.setup",
"threading.Lock",
"RPi.GPIO.setwarnings",
"time.sleep",
"math.copysign",
"RPi.GPIO.input",
"RPi.GPIO.setmode"
] | [((332, 354), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BCM'], {}), '(GPIO.BCM)\n', (344, 354), True, 'import RPi.GPIO as GPIO\n'), ((363, 386), 'RPi.GPIO.setwarnings', 'GPIO.setwarnings', (['(False)'], {}), '(False)\n', (379, 386), True, 'import RPi.GPIO as GPIO\n'), ((395, 452), 'RPi.GPIO.setup', 'GPIO.setup', (['s... |
"""
Mask R-CNN
Train on the nuclei segmentation dataset from the
Kaggle 2018 Data Science Bowl
https://www.kaggle.com/c/data-science-bowl-2018/
Licensed under the MIT License (see LICENSE for details)
Written by <NAME>
------------------------------------------------------------
Usage: import the module (see Jupyter... | [
"mrcnn.model.MaskRCNN",
"numpy.sqrt",
"mrcnn.utils.download_trained_weights",
"imgaug.augmenters.GaussianBlur",
"mrcnn.model.compute_backbone_shapes",
"mrcnn.model.parse_image_meta",
"numpy.argsort",
"numpy.array",
"mrcnn.visualize.display_instances",
"mrcnn.model.log",
"imgaug.augmenters.Fliplr... | [((1591, 1602), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (1600, 1602), False, 'import os\n'), ((1846, 1871), 'sys.path.append', 'sys.path.append', (['ROOT_DIR'], {}), '(ROOT_DIR)\n', (1861, 1871), False, 'import sys\n'), ((2155, 2198), 'os.path.join', 'os.path.join', (['ROOT_DIR', '"""mask_rcnn_coco.h5"""'], {}), "(... |
# Copyright (c) 2019 Cisco Systems
# 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 require... | [
"sqlalchemy.Enum",
"aim.db.api.get_session"
] | [((998, 1036), 'aim.db.api.get_session', 'api.get_session', ([], {'expire_on_commit': '(True)'}), '(expire_on_commit=True)\n', (1013, 1036), False, 'from aim.db import api\n'), ((1183, 1223), 'sqlalchemy.Enum', 'sa.Enum', (['"""regular"""', '"""native"""', '"""untagged"""'], {}), "('regular', 'native', 'untagged')\n", ... |
#!/usr/bin/env python
import sys
import os
ROOT_DIR = os.getenv('PLASTICC_DIR')
WORK_DIR = os.path.join(ROOT_DIR, 'plasticc')
sys.path.append(WORK_DIR)
import numpy as np
import plasticc
import plasticc.get_data
import plasticc.database
import astropy.table as at
from collections import Counter
results = []
libs = []
... | [
"plasticc.get_data.parse_getdata_options",
"os.getenv",
"astropy.table.Table",
"plasticc.database.exec_sql_query",
"os.path.join",
"collections.Counter",
"sys.path.append",
"astropy.table.Table.read"
] | [((54, 79), 'os.getenv', 'os.getenv', (['"""PLASTICC_DIR"""'], {}), "('PLASTICC_DIR')\n", (63, 79), False, 'import os\n'), ((91, 125), 'os.path.join', 'os.path.join', (['ROOT_DIR', '"""plasticc"""'], {}), "(ROOT_DIR, 'plasticc')\n", (103, 125), False, 'import os\n'), ((126, 151), 'sys.path.append', 'sys.path.append', (... |
import matplotlib as mpl
mpl.use('Agg')
# import matplotlib.pyplot as plt
import numpy as np
import math
import pylab as plt
from matplotlib.ticker import ScalarFormatter
# path = '/home/zgy_ucla_cs/data/dropSeq/'
path = '/home/zgy_ucla_cs/Research/DropSeq/data/reads_barcode/'
read_cluster_size = []
# with open(path... | [
"matplotlib.use",
"numpy.load",
"numpy.where"
] | [((25, 39), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (32, 39), True, 'import matplotlib as mpl\n'), ((825, 871), 'numpy.load', 'np.load', (["(path + 'E31_REP3_cell_group_size.npy')"], {}), "(path + 'E31_REP3_cell_group_size.npy')\n", (832, 871), True, 'import numpy as np\n'), ((910, 943), 'numpy.w... |
# -*- coding: utf-8 -*-
from app.constants import S_OK, S_ERR
import random
import math
import base64
import time
import ujson as json
import sys
import argparse
from app import cfg
from app import util
def cron_chiayi_city():
pass
def parse_args():
''' '''
parser = argparse.ArgumentParser(description... | [
"app.cfg.init",
"argparse.ArgumentParser"
] | [((285, 339), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""roadpin_backend"""'}), "(description='roadpin_backend')\n", (308, 339), False, 'import argparse\n'), ((554, 590), 'app.cfg.init', 'cfg.init', (["{'ini_filename': args.ini}"], {}), "({'ini_filename': args.ini})\n", (562, 590), F... |
# Copyright 2020 Efabless Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | [
"os.path.exists",
"argparse.ArgumentParser",
"re.compile",
"pyverilog.vparser.parser.parse",
"re.findall",
"copy.deepcopy",
"json.load",
"io.StringIO"
] | [((909, 1019), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""top module generation for a given (core design, pads library) pair"""'}), "(description=\n 'top module generation for a given (core design, pads library) pair')\n", (932, 1019), False, 'import argparse\n'), ((1878, 1905), '... |
from flask import Flask, redirect, render_template, request
from bernstein_vazirani import quantum_calculate
# Configure application
app = Flask(__name__)
@app.route("/")
def index():
return render_template("index.html")
@app.route("/compute", methods=["POST"])
def compute():
c = 0
a = int(r... | [
"flask.render_template",
"flask.request.form.get",
"bernstein_vazirani.quantum_calculate",
"flask.Flask"
] | [((144, 159), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (149, 159), False, 'from flask import Flask, redirect, render_template, request\n'), ((205, 234), 'flask.render_template', 'render_template', (['"""index.html"""'], {}), "('index.html')\n", (220, 234), False, 'from flask import Flask, redirect, r... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012-2013 <NAME>
#
# 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 requi... | [
"distutils.extension.Extension"
] | [((1893, 1958), 'distutils.extension.Extension', 'Extension', (['"""jsonstream.cjsonstream"""', "['jsonstream/cjsonstream.c']"], {}), "('jsonstream.cjsonstream', ['jsonstream/cjsonstream.c'])\n", (1902, 1958), False, 'from distutils.extension import Extension\n'), ((2017, 2088), 'distutils.extension.Extension', 'Extens... |
import sys
import json
import types
import logging
import traceback
import six
import boto3.session
from moto.s3 import models as s3_models
from moto.iam import models as iam_models
from moto.sqs import models as sqs_models
from moto.sns import models as sns_models
from moto.core import BaseModel
from moto.server impor... | [
"logging.getLogger",
"moto.apigateway.models.Deployment",
"localstack.utils.aws.aws_stack.s3_bucket_arn",
"localstack.utils.aws.aws_stack.log_group_arn",
"moto.apigateway.models.Method",
"localstack.utils.common.short_uid",
"localstack.services.cloudformation.service_models.BaseModel",
"localstack.uti... | [((1793, 1820), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1810, 1820), False, 'import logging\n'), ((3951, 3970), 'localstack.utils.common.get_free_tcp_port', 'get_free_tcp_port', ([], {}), '()\n', (3968, 3970), False, 'from localstack.utils.common import FuncThread, short_uid, recu... |
"""Config flow for AirNow integration."""
import logging
from pyairnow import WebServiceAPI
from pyairnow.errors import AirNowError, InvalidKeyError
import voluptuous as vol
from homeassistant import config_entries, core, exceptions
from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE, CONF_RAD... | [
"logging.getLogger",
"voluptuous.Required",
"pyairnow.WebServiceAPI",
"voluptuous.Optional",
"homeassistant.helpers.aiohttp_client.async_get_clientsession"
] | [((488, 515), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (505, 515), False, 'import logging\n'), ((730, 759), 'homeassistant.helpers.aiohttp_client.async_get_clientsession', 'async_get_clientsession', (['hass'], {}), '(hass)\n', (753, 759), False, 'from homeassistant.helpers.aiohttp_c... |
from argparse import ArgumentParser
from datetime import datetime, timedelta, timezone
import logging
import pytz
from tzlocal import get_localzone
from constants import MAX_DAYS, HOURLY_TIME_CHUNK_SIZE
def valid_time(start, end):
max_historical_time = datetime.now(timezone.utc) - timedelta(days=MAX_DAYS)
min... | [
"logging.basicConfig",
"datetime.datetime",
"pytz.timezone",
"logging.debug",
"argparse.ArgumentParser",
"tzlocal.get_localzone",
"datetime.datetime.now",
"datetime.timedelta",
"logging.error"
] | [((328, 354), 'datetime.datetime.now', 'datetime.now', (['timezone.utc'], {}), '(timezone.utc)\n', (340, 354), False, 'from datetime import datetime, timedelta, timezone\n'), ((4098, 4231), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(levelname)s:%(asctime)s:%(funcName)s():%(message)s"""', 'datef... |
# -*- coding: utf-8 -*-
# (c) <NAME>, see LICENSE.rst.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from django.db import models
from lizard_apps import managers
class Application(models.Model):
"""An applica... | [
"lizard_apps.managers.ScreenManager",
"lizard_apps.managers.ApplicationManager",
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.models.ManyToManyField",
"django.db.models.ImageField",
"django.db.models.SlugField",
"lizard_apps.managers.ApplicationScreenManager",
"django.d... | [((571, 588), 'django.db.models.URLField', 'models.URLField', ([], {}), '()\n', (586, 588), False, 'from django.db import models\n'), ((600, 643), 'django.db.models.ImageField', 'models.ImageField', ([], {'upload_to': '"""lizard_apps/"""'}), "(upload_to='lizard_apps/')\n", (617, 643), False, 'from django.db import mode... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | [
"azure.cli.core.commands.cli_command"
] | [((395, 488), 'azure.cli.core.commands.cli_command', 'cli_command', (['__name__', '"""cloud list"""', '"""azure.cli.command_modules.cloud.custom#list_clouds"""'], {}), "(__name__, 'cloud list',\n 'azure.cli.command_modules.cloud.custom#list_clouds')\n", (406, 488), False, 'from azure.cli.core.commands import cli_com... |
# -*- coding: utf-8 -*-
import os
import unittest
from intercom.client import Client
intercom = Client(
os.environ.get('INTERCOM_PERSONAL_ACCESS_TOKEN'))
class AdminTest(unittest.TestCase):
def test(self):
# Iterate over all admins
for admin in intercom.admins.all():
self.assert... | [
"os.environ.get"
] | [((110, 158), 'os.environ.get', 'os.environ.get', (['"""INTERCOM_PERSONAL_ACCESS_TOKEN"""'], {}), "('INTERCOM_PERSONAL_ACCESS_TOKEN')\n", (124, 158), False, 'import os\n')] |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
"numpy.copy",
"paddle.fluid.framework._test_eager_guard",
"numpy.random.random",
"paddle.CUDAPlace",
"paddle.enable_static",
"paddle.distributed.models.moe.utils._random_routing",
"paddle.disable_static",
"paddle.to_tensor",
"numpy.random.randint",
"unittest.main",
"paddle.fluid.core.is_compiled... | [((2798, 2820), 'paddle.enable_static', 'paddle.enable_static', ([], {}), '()\n', (2818, 2820), False, 'import paddle\n'), ((2825, 2840), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2838, 2840), False, 'import unittest\n'), ((1123, 1140), 'numpy.copy', 'np.copy', (['topk_idx'], {}), '(topk_idx)\n', (1130, 1140... |
import yaml
from scipy.signal import firwin, lfilter
class SpeakerYML(object):
def __init__(self, ymlf):
# open yml file
with open(ymlf) as yf:
conf = yaml.safe_load(yf)
# read parameter from yml file
self.wav_fs = conf['wav']['fs']
self.wav_bit = conf['wav']['... | [
"scipy.signal.firwin",
"yaml.safe_load",
"scipy.signal.lfilter"
] | [((1760, 1801), 'scipy.signal.firwin', 'firwin', (['(255)', 'norm_cutoff'], {'pass_zero': '(False)'}), '(255, norm_cutoff, pass_zero=False)\n', (1766, 1801), False, 'from scipy.signal import firwin, lfilter\n'), ((1814, 1832), 'scipy.signal.lfilter', 'lfilter', (['fil', '(1)', 'x'], {}), '(fil, 1, x)\n', (1821, 1832), ... |
#!/usr/bin/env python
# Python Standard Library
from __future__ import print_function
import doctest
import sys
# Third-Party Libraries
import yaml
# Doctest Helper
# ------------------------------------------------------------------------------
# The issue: b'A' displays as b'A' in Python 3 but as 'A' in Python 2.... | [
"doctest.register_optionflag",
"sys.exit",
"doctest.__all__.append",
"doctest.testfile"
] | [((561, 597), 'doctest.register_optionflag', 'doctest.register_optionflag', (['"""BYTES"""'], {}), "('BYTES')\n", (588, 597), False, 'import doctest\n'), ((598, 629), 'doctest.__all__.append', 'doctest.__all__.append', (['"""BYTES"""'], {}), "('BYTES')\n", (620, 629), False, 'import doctest\n'), ((1855, 1892), 'doctest... |
"""
Simple Q-Learning
=================
This module provides a basic implementation of the DQN algorithm without any
optimizations.
This file defines the distributed Trainer class for the Simple Q algorithm.
See `simple_q_[tf|torch]_policy.py` for the definition of the policy loss.
"""
import logging
from typing imp... | [
"logging.getLogger",
"ray.rllib.execution.train_ops.TrainOneStep",
"ray.rllib.execution.rollout_ops.ParallelRollouts",
"ray.rllib.agents.dqn.dqn.DQNTrainer.with_updates",
"ray.rllib.execution.concurrency_ops.Concurrently",
"ray.rllib.execution.metric_ops.StandardMetricsReporting",
"ray.rllib.agents.trai... | [((1210, 1237), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1227, 1237), False, 'import logging\n'), ((1295, 1858), 'ray.rllib.agents.trainer.with_common_config', 'with_common_config', (["{'exploration_config': {'type': 'EpsilonGreedy', 'initial_epsilon': 1.0,\n 'final_epsilon': 0.... |
# Copyright 2020 Google 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 agreed to in writing, ... | [
"bot.fuzzers.engine.Crash",
"bot.fuzzers.engine.ReproduceResult",
"re.compile",
"system.environment.get_value",
"metrics.logs.log",
"os.path.join",
"bot.fuzzers.utils.get_temp_dir",
"bot.fuzzers.engine.FuzzResult",
"fnmatch.fnmatch",
"copy.copy"
] | [((1160, 1199), 'system.environment.get_value', 'environment.get_value', (['"""ANDROID_SERIAL"""'], {}), "('ANDROID_SERIAL')\n", (1181, 1199), False, 'from system import environment\n'), ((1214, 1248), 'system.environment.get_value', 'environment.get_value', (['"""BUILD_DIR"""'], {}), "('BUILD_DIR')\n", (1235, 1248), F... |
"""
we are trying to training m2det from scratch
on vgg model
"""
from torch.utils.data import DataLoader
from utils.core import *
from m2det import build_net
from layers.functions import Detect, PriorBox
from alfred.utils.log import logger as logging
from alfred.dl.torch.common import device
from alfred.vis.image.g... | [
"layers.functions.Detect",
"alfred.vis.image.get_dataset_label_map.coco_label_map.values",
"alfred.utils.log.logger.info",
"m2det.build_net",
"torch.utils.data.DataLoader"
] | [((617, 640), 'alfred.vis.image.get_dataset_label_map.coco_label_map.values', 'coco_label_map.values', ([], {}), '()\n', (638, 640), False, 'from alfred.vis.image.get_dataset_label_map import coco_label_map\n'), ((725, 801), 'm2det.build_net', 'build_net', (['"""train"""'], {'size': 'cfg.model.input_size', 'config': 'c... |
import pickle
filename = 'latest_flight_sent.data'
# Returns the latest flight number a message has been sent for
# This prevents the server to trigger a message every time the script is called when less than 1 hour remains
def get_latest_flight_sent():
try:
stream = open(filename, 'rb')
flight_nu... | [
"pickle.load",
"pickle.dump"
] | [((488, 522), 'pickle.dump', 'pickle.dump', (['flight_number', 'stream'], {}), '(flight_number, stream)\n', (499, 522), False, 'import pickle\n'), ((327, 346), 'pickle.load', 'pickle.load', (['stream'], {}), '(stream)\n', (338, 346), False, 'import pickle\n')] |
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# Written by <NAME> (<EMAIL>)
# ------------------------------------------------------------------------------
from __future__ import absolute_i... | [
"core.function.validate",
"sys.path.insert",
"torch.optim.lr_scheduler.MultiStepLR",
"core.config.config.GPUS.split",
"tensorboardX.SummaryWriter",
"argparse.ArgumentParser",
"core.config.get_model_name",
"torchvision.transforms.ToTensor",
"utils.utils.get_optimizer",
"core.function.train",
"ppr... | [((818, 839), 'os.path.dirname', 'osp.dirname', (['__file__'], {}), '(__file__)\n', (829, 839), True, 'import os.path as osp\n'), ((852, 883), 'os.path.join', 'osp.join', (['this_dir', '""".."""', '"""lib"""'], {}), "(this_dir, '..', 'lib')\n", (860, 883), True, 'import os.path as osp\n'), ((1383, 1445), 'argparse.Argu... |
import os
import sys
from philosophy import (valid_page_name,
strip_parentheses)
def test_valid_page_name():
NON_MAINSPACE = ['File:',
'File talk:',
'Wikipedia:',
'Wikipedia talk:',
'Project:',
... | [
"philosophy.valid_page_name",
"philosophy.strip_parentheses"
] | [((1962, 1986), 'philosophy.strip_parentheses', 'strip_parentheses', (['param'], {}), '(param)\n', (1979, 1986), False, 'from philosophy import valid_page_name, strip_parentheses\n'), ((709, 734), 'philosophy.valid_page_name', 'valid_page_name', (['non_main'], {}), '(non_main)\n', (724, 734), False, 'from philosophy im... |
import os
import shutil
import time
from generate_all import origin_training_dir
from generate_all import augmentation_training_set_dir as output_dir
from generate_all import augmentation_output_dir as augmentation_set_dir
from generate_all import path_to_bert_base_modle
from generate_all import path_to_bert_train_cod... | [
"generate_all.path_to_bert_base_modle.replace",
"generate_all.path_to_hans.replace",
"os.path.join",
"shutil.copytree",
"os.mkdir",
"generate_all.path_to_hans_test_set.replace",
"os.path.abspath",
"time.time",
"generate_all.path_to_bert_train_code.replace"
] | [((3201, 3261), 'shutil.copytree', 'shutil.copytree', (['origin_training_dir', 'generated_training_dir'], {}), '(origin_training_dir, generated_training_dir)\n', (3216, 3261), False, 'import shutil\n'), ((3565, 3604), 'os.path.abspath', 'os.path.abspath', (['generated_training_dir'], {}), '(generated_training_dir)\n', ... |
__author__ = '<NAME>'
import logging
import cv2
import numpy
import sys
from combining_classifications import combine_majority_vote, combine_mean_rule, combine_minimum_rule
from loading_images import load_face_vectors_from_disk, extract_color_channels
from pca import PCA
from plotting import plot_results
def main(... | [
"logging.basicConfig",
"logging.debug",
"loading_images.load_face_vectors_from_disk",
"numpy.random.permutation",
"pca.PCA",
"numpy.equal",
"loading_images.extract_color_channels",
"numpy.count_nonzero",
"numpy.empty",
"plotting.plot_results",
"sys.stdout.flush",
"cv2.waitKey",
"sys.stdout.w... | [((327, 404), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(levelname)7s: %(message)s"""', 'level': 'logging.INFO'}), "(format='%(levelname)7s: %(message)s', level=logging.INFO)\n", (346, 404), False, 'import logging\n'), ((857, 945), 'loading_images.load_face_vectors_from_disk', 'load_face_vector... |
from django.shortcuts import render, redirect
from django.http import HttpResponse, JsonResponse
# Create your views here.
def searchresult(request):
if request.method == "POST":
x = request.GET['s']
print(x)
response = {"tab": "2"}
return JsonResponse(response)
else:
... | [
"django.shortcuts.render",
"django.http.JsonResponse"
] | [((279, 301), 'django.http.JsonResponse', 'JsonResponse', (['response'], {}), '(response)\n', (291, 301), False, 'from django.http import HttpResponse, JsonResponse\n'), ((327, 364), 'django.shortcuts.render', 'render', (['request', '"""dash_mobilev3.html"""'], {}), "(request, 'dash_mobilev3.html')\n", (333, 364), Fals... |
import sys as _sys
import os
def find_vcs_root(path=os.getcwd(), dirs=(".git",), default=''):
"""
get project root path.
:param path: scripts path
:param dirs: save rule e.g: catch git
:param default: if set default then save to the default absolute path
:return: path
"""
if default:
... | [
"os.path.abspath",
"os.path.join",
"os.getcwd"
] | [((54, 65), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (63, 65), False, 'import os\n'), ((365, 386), 'os.path.abspath', 'os.path.abspath', (['path'], {}), '(path)\n', (380, 386), False, 'import os\n'), ((546, 575), 'os.path.join', 'os.path.join', (['path', 'os.pardir'], {}), '(path, os.pardir)\n', (558, 575), False, '... |
import math
import warnings
from bw2data import Database
from bw2data.logs import close_log, get_io_logger
from stats_arrays import LognormalUncertainty, UndefinedUncertainty
from ..utils import es2_activity_hash, format_for_logging
from .migrations import migrate_exchanges, migrations
def link_biosphere_by_flow_uu... | [
"bw2data.logs.get_io_logger",
"warnings.warn",
"bw2data.Database",
"bw2data.logs.close_log"
] | [((4567, 4606), 'bw2data.logs.get_io_logger', 'get_io_logger', (['"""Ecospold2-import-error"""'], {}), "('Ecospold2-import-error')\n", (4580, 4606), False, 'from bw2data.logs import close_log, get_io_logger\n'), ((5353, 5367), 'bw2data.logs.close_log', 'close_log', (['log'], {}), '(log)\n', (5362, 5367), False, 'from b... |
__author__ = 'raz0r'
import os
import click
import string
import requests
requests.packages.urllib3.disable_warnings()
def run(url, proxy):
with open(os.path.dirname(__file__) + '/../data/aem-paths.txt', 'r') as f:
paths = map(string.strip, f.readlines())
found = []
with click.progressbar... | [
"click.progressbar",
"os.path.dirname",
"requests.head",
"requests.packages.urllib3.disable_warnings"
] | [((76, 120), 'requests.packages.urllib3.disable_warnings', 'requests.packages.urllib3.disable_warnings', ([], {}), '()\n', (118, 120), False, 'import requests\n'), ((303, 358), 'click.progressbar', 'click.progressbar', (['paths'], {'label': '"""Scanning useful paths"""'}), "(paths, label='Scanning useful paths')\n", (3... |
# -*- coding: utf-8 -*-
"""
spacebodies.spacebody
---------------------
This module provides the Abstract Base Class which is used for implementing
space bodies in the library. You should subclass this to add more bodies/
event types.
"""
import abc
import datetime
import ephem
from .forecast import Forecast
from .... | [
"ephem.degrees",
"ephem.Observer",
"ephem.readtle",
"datetime.datetime.now",
"ephem.Date"
] | [((966, 982), 'ephem.Observer', 'ephem.Observer', ([], {}), '()\n', (980, 982), False, 'import ephem\n'), ((1135, 1156), 'ephem.Date', 'ephem.Date', (['timestamp'], {}), '(timestamp)\n', (1145, 1156), False, 'import ephem\n'), ((922, 945), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (943, 945), ... |
from django.shortcuts import render
from django.shortcuts import render
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response
from .models import *
from .searializers import *
@api_view(['GET', 'POST'])
def plant_list(request):
if request.... | [
"rest_framework.response.Response",
"rest_framework.decorators.api_view"
] | [((253, 278), 'rest_framework.decorators.api_view', 'api_view', (["['GET', 'POST']"], {}), "(['GET', 'POST'])\n", (261, 278), False, 'from rest_framework.decorators import api_view\n'), ((906, 931), 'rest_framework.decorators.api_view', 'api_view', (["['GET', 'POST']"], {}), "(['GET', 'POST'])\n", (914, 931), False, 'f... |
import unittest
import os
import json
import time
from flask import Flask
from app.app import create_app, db
from app.models import Users
class ApiTestCase(unittest.TestCase):
"""User test case"""
def setUp(self):
"""Initialise app and define test variables"""
self.app = create_app(config_name="testing")
self... | [
"app.app.db.session.remove",
"time.sleep",
"app.app.db.drop_all",
"app.app.create_app",
"app.app.db.create_all"
] | [((280, 313), 'app.app.create_app', 'create_app', ([], {'config_name': '"""testing"""'}), "(config_name='testing')\n", (290, 313), False, 'from app.app import create_app, db\n'), ((29487, 29501), 'time.sleep', 'time.sleep', (['(61)'], {}), '(61)\n', (29497, 29501), False, 'import time\n'), ((824, 839), 'app.app.db.crea... |
# -*- coding: utf-8 -*-
"""
Created on Sat May 22 18:46:12 2021
@author: nkele
"""
import cv2
import numpy as np
import imutils
cap =cv2.VideoCapture("lane_red3.mp4")
cap.set(3,640)
cap.set(4,480)
while(True):
try:
ret, frame= cap.read()
cv2.imshow("origin... | [
"cv2.drawContours",
"numpy.ones",
"cv2.inRange",
"cv2.imshow",
"cv2.contourArea",
"numpy.array",
"cv2.circle",
"imutils.grab_contours",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"cv2.cvtColor",
"cv2.moments",
"cv2.findContours",
"cv2.dilate",
"cv2.waitKey"
] | [((147, 180), 'cv2.VideoCapture', 'cv2.VideoCapture', (['"""lane_red3.mp4"""'], {}), "('lane_red3.mp4')\n", (163, 180), False, 'import cv2\n'), ((2595, 2618), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (2616, 2618), False, 'import cv2\n'), ((302, 331), 'cv2.imshow', 'cv2.imshow', (['"""original... |
# encoding: utf-8
from __future__ import unicode_literals
try:
import urllib.request as urllib_request
import urllib.error as urllib_error
except ImportError:
import urllib2 as urllib_request
import urllib2 as urllib_error
try:
from cStringIO import StringIO
except ImportError:
from io import ... | [
"urllib2.urlopen",
"io.BytesIO",
"urllib2.Request",
"gzip.GzipFile",
"re.search"
] | [((7288, 7334), 'urllib2.Request', 'urllib_request.Request', (['uriBase', 'body', 'headers'], {}), '(uriBase, body, headers)\n', (7310, 7334), True, 'import urllib2 as urllib_request\n'), ((1397, 1411), 'io.BytesIO', 'StringIO', (['data'], {}), '(data)\n', (1405, 1411), True, 'from io import BytesIO as StringIO\n'), ((... |
#!/usr/bin/env python3
# coding: utf-8
import numpy as np
import pandas as pd
def interpolate(s):
start = s.index[0].ceil('h')
end = s.index[-1]
new_index = pd.date_range(start, end, freq='1h')
# create a mask to select the missing values from the input
mask = s.reindex(new_index, method='bfill',... | [
"pandas.DataFrame",
"pandas.date_range"
] | [((172, 208), 'pandas.date_range', 'pd.date_range', (['start', 'end'], {'freq': '"""1h"""'}), "(start, end, freq='1h')\n", (185, 208), True, 'import pandas as pd\n'), ((373, 429), 'pandas.DataFrame', 'pd.DataFrame', (['np.nan'], {'index': 'new_index', 'columns': 's.columns'}), '(np.nan, index=new_index, columns=s.colum... |
import pandas as pd
import matplotlib.pyplot as plt
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
from keras.models import Sequential
from keras.layers import Dense, Dropout, BatchNormalization
from keras import optimizers
from dataset import *
def process(df):
df['pickup_... | [
"pandas.read_csv",
"pandas.qcut",
"sklearn.model_selection.train_test_split",
"pandas.DataFrame",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.legend",
"keras.models.Sequential",
"keras.layers.Dense",
"matplotlib.pyplot.figure",
"pandas.g... | [((4411, 4548), 'pandas.read_csv', 'pd.read_csv', (['TRAIN_PATH'], {'nrows': 'DATASET_SIZE', 'dtype': 'data_types', 'usecols': '[1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14]', 'names': 'data_names'}), '(TRAIN_PATH, nrows=DATASET_SIZE, dtype=data_types, usecols=[1, 2,\n 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14], names=dat... |
#/usr/bin/env python3
import h5py
import numpy as np
import pybind_isce3 as isce
from iscetest import data as test_data_dir
from pathlib import Path
import json
from ...focus.backproject import load_h5
from pybind_nisar.workflows.point_target_info import (analyze_point_target,
... | [
"pybind_nisar.workflows.point_target_info.analyze_point_target",
"pybind_isce3.container.RadarGeometry",
"pathlib.Path",
"json.dumps",
"numpy.exp",
"numpy.array",
"numpy.empty",
"numpy.linalg.norm",
"pybind_isce3.product.RadarGridParameters",
"pybind_isce3.core.KnabKernel",
"pybind_isce3.cuda.fo... | [((1222, 1272), 'pybind_isce3.core.KnabKernel', 'isce.core.KnabKernel', (['(9.0)', '(B / range_sampling_rate)'], {}), '(9.0, B / range_sampling_rate)\n', (1242, 1272), True, 'import pybind_isce3 as isce\n'), ((1285, 1327), 'pybind_isce3.core.TabulatedKernelF32', 'isce.core.TabulatedKernelF32', (['kernel', '(2048)'], {}... |
import numpy as np
import tempfile
import os.path as op
from ensight2obj import ensight2obj
from ensight2vtk import ensight2vtk
from ensightreader import read_case, EnsightGeometryFile, GeometryPart, IdHandling, ElementType, VariableLocation, \
VariableType
ENSIGHT_CASE_PATH = "./data/cavity/cavity.case"
def te... | [
"os.path.join",
"tempfile.TemporaryDirectory",
"ensightreader.read_case"
] | [((375, 403), 'ensightreader.read_case', 'read_case', (['ENSIGHT_CASE_PATH'], {}), '(ENSIGHT_CASE_PATH)\n', (384, 403), False, 'from ensightreader import read_case, EnsightGeometryFile, GeometryPart, IdHandling, ElementType, VariableLocation, VariableType\n'), ((3717, 3746), 'tempfile.TemporaryDirectory', 'tempfile.Tem... |
#!/usr/bin/env python3
import unittest
import torch
import learn2learn as l2l
def close(x, y):
return (x - y).norm(p=2) <= 1e-8
class NNMiscTests(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def _get_scale_shape(self, shape):
if isinstance(shape, int)... | [
"unittest.main",
"learn2learn.nn.Scale"
] | [((829, 844), 'unittest.main', 'unittest.main', ([], {}), '()\n', (842, 844), False, 'import unittest\n'), ((528, 566), 'learn2learn.nn.Scale', 'l2l.nn.Scale', ([], {'shape': 'shape', 'alpha': 'alpha'}), '(shape=shape, alpha=alpha)\n', (540, 566), True, 'import learn2learn as l2l\n')] |
# coding: utf-8
from __future__ import unicode_literals, print_function, division, absolute_import
from rest_framework import serializers
from rest_framework.reverse import reverse
def get_obj_property_value(obj, field):
"""
Given an object and a field which may have nested properties
return value of nest... | [
"rest_framework.reverse.reverse"
] | [((1265, 1330), 'rest_framework.reverse.reverse', 'reverse', (['view_name'], {'kwargs': 'kwargs', 'request': 'request', 'format': 'format'}), '(view_name, kwargs=kwargs, request=request, format=format)\n', (1272, 1330), False, 'from rest_framework.reverse import reverse\n')] |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | [
"pyangbind.lib.yangtypes.YANGDynClass",
"__builtin__.property",
"pyangbind.lib.yangtypes.RestrictedClassType"
] | [((42809, 42852), '__builtin__.property', '__builtin__.property', (['_get_tunnel_vif_index'], {}), '(_get_tunnel_vif_index)\n', (42829, 42852), False, 'import __builtin__\n'), ((42864, 42897), '__builtin__.property', '__builtin__.property', (['_get_lsp_id'], {}), '(_get_lsp_id)\n', (42884, 42897), False, 'import __buil... |
import six
if six.PY3:
import unittest
else:
import unittest2 as unittest
from mock import Mock
from twilio.rest.resources import Applications
class ApplicationsTest(unittest.TestCase):
def setUp(self):
self.parent = Mock()
self.resource = Applications("http://api.twilio.com", ("user", "p... | [
"mock.Mock",
"twilio.rest.resources.Applications"
] | [((240, 246), 'mock.Mock', 'Mock', ([], {}), '()\n', (244, 246), False, 'from mock import Mock\n'), ((271, 326), 'twilio.rest.resources.Applications', 'Applications', (['"""http://api.twilio.com"""', "('user', 'pass')"], {}), "('http://api.twilio.com', ('user', 'pass'))\n", (283, 326), False, 'from twilio.rest.resource... |
# -*- coding: utf-8 -*-
import time
from odoo import api, models, _
from odoo.exceptions import UserError
from odoo.tools import float_is_zero
from datetime import datetime
from dateutil.relativedelta import relativedelta
class ReportAgedPartnerBalance(models.AbstractModel):
_name = 'report.accounting_pdf_report... | [
"odoo._",
"dateutil.relativedelta.relativedelta",
"datetime.datetime.strptime",
"time.strftime",
"odoo.tools.float_is_zero"
] | [((1110, 1150), 'datetime.datetime.strptime', 'datetime.strptime', (['date_from', '"""%Y-%m-%d"""'], {}), "(date_from, '%Y-%m-%d')\n", (1127, 1150), False, 'from datetime import datetime\n'), ((11409, 11434), 'time.strftime', 'time.strftime', (['"""%Y-%m-%d"""'], {}), "('%Y-%m-%d')\n", (11422, 11434), False, 'import ti... |
import sphinx_rtd_theme
import audiorename
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
]
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = 'au... | [
"sphinx_rtd_theme.get_html_theme_path"
] | [((95, 133), 'sphinx_rtd_theme.get_html_theme_path', 'sphinx_rtd_theme.get_html_theme_path', ([], {}), '()\n', (131, 133), False, 'import sphinx_rtd_theme\n')] |
import torch
import torch.nn as nn
import torch.distributions as dist
from torch.distributions.kl import kl_divergence
class RBFKernel(nn.Module):
def __init__(self, in_size, prior_log_mean=None, prior_log_logvar=None, map_est=False):
super().__init__()
self.map_est = map_est
# Variation... | [
"torch.nn.ReLU",
"torch.tensor",
"torch.distributions.kl.kl_divergence",
"torch.nn.Parameter",
"torch.einsum",
"torch.nn.Linear",
"torch.zeros_like",
"torch.Size",
"torch.randn",
"torch.ones"
] | [((519, 541), 'torch.nn.Parameter', 'nn.Parameter', (['log_init'], {}), '(log_init)\n', (531, 541), True, 'import torch.nn as nn\n'), ((1677, 1719), 'torch.einsum', 'torch.einsum', (['"""...ji,...ki->...jk"""', 'sx', 'sx'], {}), "('...ji,...ki->...jk', sx, sx)\n", (1689, 1719), False, 'import torch\n'), ((1839, 1881), ... |
import os, sys, configparser, warnings
from flask import (Flask, redirect, render_template, request, session, url_for)
from app import consent, alert, experiment, complete, error
from .io import write_metadata
from .utils import gen_code
__version__ = '1.0'
## Define root directory.
ROOT_DIR = os.path.dirname(os.path.... | [
"flask.request.args.get",
"os.listdir",
"configparser.ConfigParser",
"os.makedirs",
"flask.Flask",
"os.path.join",
"flask.url_for",
"os.path.realpath",
"os.path.isdir",
"warnings.warn",
"flask.session.clear"
] | [((385, 412), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (410, 412), False, 'import os, sys, configparser, warnings\n'), ((505, 546), 'os.path.join', 'os.path.join', (['ROOT_DIR', "cfg['IO']['DATA']"], {}), "(ROOT_DIR, cfg['IO']['DATA'])\n", (517, 546), False, 'import os, sys, configpar... |
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import sys
import json
#from caresjpsutil import PythonLogger
FOSSIL_CAP = "/images/1_top_ten_emission_countries_fossil_ele_cap.png"
FOSSIL_CAP_PER = "/images/1_top_ten_emission_countries_fossil_ele_cap_per.png"
FOSSIL_GEN = ... | [
"json.loads",
"matplotlib.pyplot.savefig",
"pandas.read_csv",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.clf",
"seaborn.set_context",
"json.dumps",
"seaborn.heatmap",
"seaborn.set_style",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.yticks",
"matplotlib.pyplo... | [((640, 663), 'json.loads', 'json.loads', (['sys.argv[1]'], {}), '(sys.argv[1])\n', (650, 663), False, 'import json\n'), ((758, 856), 'pandas.read_csv', 'pd.read_csv', (["(modelsPath + 'data/input/top_ten_emission_countries.csv')"], {'header': '"""infer"""', 'sep': '""","""'}), "(modelsPath + 'data/input/top_ten_emissi... |