code stringlengths 20 1.04M | apis list | extract_api stringlengths 75 9.94M |
|---|---|---|
import logging
import os
from selenium import webdriver
from selenium.webdriver.chrome import options
from selenium.webdriver.remote.remote_connection import LOGGER
from indic_transliteration import sanscript
LOGGER.setLevel(logging.WARNING)
from urllib3.connectionpool import log as urllibLogger
urllibLogger.setLeve... | [
"selenium.webdriver.chrome.options.Options",
"indic_transliteration.sanscript.transliterate",
"logging.basicConfig",
"os.path.dirname",
"selenium.webdriver.remote.remote_connection.LOGGER.setLevel",
"logging.info",
"selenium.webdriver.Chrome",
"urllib3.connectionpool.log.setLevel",
"os.path.join"
] | [((212, 244), 'selenium.webdriver.remote.remote_connection.LOGGER.setLevel', 'LOGGER.setLevel', (['logging.WARNING'], {}), '(logging.WARNING)\n', (227, 244), False, 'from selenium.webdriver.remote.remote_connection import LOGGER\n'), ((300, 338), 'urllib3.connectionpool.log.setLevel', 'urllibLogger.setLevel', (['loggin... |
# Copyright 2021 CR.Sparse Development Team
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | [
"jax.numpy.array",
"jax.jit",
"cr.nimble.vec_centered_jit",
"math.pow",
"jax.numpy.concatenate",
"math.sqrt",
"jax.numpy.linspace",
"jax.numpy.zeros"
] | [((2576, 2614), 'jax.jit', 'jit', (['orth_wavefun'], {'static_argnums': '(2,)'}), '(orth_wavefun, static_argnums=(2,))\n', (2579, 2614), False, 'from jax import jit\n'), ((1238, 1256), 'math.pow', 'math.pow', (['(2)', 'level'], {}), '(2, level)\n', (1246, 1256), False, 'import math\n'), ((1879, 1891), 'jax.numpy.zeros'... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import url
from django.contrib.auth import views as auth_views
urlpatterns = [
url(r'^login/$',
auth_views.login,
{'template_name': 'django_mobile_app_distribution/login.html'},
name='auth_login'),
ur... | [
"django.conf.urls.url"
] | [((171, 291), 'django.conf.urls.url', 'url', (['"""^login/$"""', 'auth_views.login', "{'template_name': 'django_mobile_app_distribution/login.html'}"], {'name': '"""auth_login"""'}), "('^login/$', auth_views.login, {'template_name':\n 'django_mobile_app_distribution/login.html'}, name='auth_login')\n", (174, 291), F... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
class NeuralNet(object):
def __init__(self, device, ngpu):
self.device, self.ngpu = device, ngpu
self.model = SRNET(self.ngpu).to(self.device)
if (self.device.type == 'cuda') and (self.model.ngp... | [
"torch.nn.MSELoss",
"torch.nn.Conv2d",
"torch.nn.ReLU"
] | [((624, 636), 'torch.nn.MSELoss', 'nn.MSELoss', ([], {}), '()\n', (634, 636), True, 'import torch.nn as nn\n'), ((872, 959), 'torch.nn.Conv2d', 'nn.Conv2d', ([], {'in_channels': '(3)', 'out_channels': '(64)', 'kernel_size': '(9)', 'stride': '(1)', 'padding': '(9 // 2)'}), '(in_channels=3, out_channels=64, kernel_size=9... |
import json
import os
import argparse
from tqdm import tqdm
idx_classes = ['Apple', 'Artichoke', 'Asparagus', 'Bagel', 'Banana', 'Beer', 'Bread', 'Broccoli', 'Burrito', 'Cabbage', 'Cake', 'Candy', 'Cantaloupe', 'Carrot', 'Cheese', 'Cocktail', 'Coffee', 'Cookie', 'Crab', 'Croissant', 'Cucumber', 'Dessert', 'Doughnut', ... | [
"json.dump",
"tqdm.tqdm",
"argparse.ArgumentParser",
"os.path.join",
"os.listdir"
] | [((1318, 1338), 'os.listdir', 'os.listdir', (['ann_path'], {}), '(ann_path)\n', (1328, 1338), False, 'import os\n'), ((1371, 1382), 'tqdm.tqdm', 'tqdm', (['paths'], {}), '(paths)\n', (1375, 1382), False, 'from tqdm import tqdm\n'), ((2771, 2832), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Convert yolo ... |
'''
File: lib_detect_gain02.py
Author: <NAME>
Version: 0.1
Create: 2018-10-01 13:33:01
Description:
'''
import math
from gio import config
from . import lib_time_op
def _last_val_value(vs, ys, i):
for _i in range(i - 1, -1, -1):
_v = vs[ys[_i]]
if _v > 100:
continue
return _v... | [
"gio.config.getfloat",
"gio.config.getint",
"gio.config.getboolean"
] | [((1197, 1255), 'gio.config.getfloat', 'config.getfloat', (['"""conf"""', '"""adjust_gain_min_increasement"""', '(0)'], {}), "('conf', 'adjust_gain_min_increasement', 0)\n", (1212, 1255), False, 'from gio import config\n'), ((1272, 1330), 'gio.config.getfloat', 'config.getfloat', (['"""conf"""', '"""gain_adjust_min_for... |
import torch
from mmdet.core.bbox import BaseBBoxCoder
from mmdet.core.bbox.builder import BBOX_CODERS
from projects.mmdet3d_plugin.core.bbox.util import denormalize_bbox
@BBOX_CODERS.register_module()
class NMSFreeCoder(BaseBBoxCoder):
"""Bbox coder for NMS-free detector.
Args:
pc_range (list[float]... | [
"projects.mmdet3d_plugin.core.bbox.util.denormalize_bbox",
"torch.tensor",
"mmdet.core.bbox.builder.BBOX_CODERS.register_module"
] | [((175, 204), 'mmdet.core.bbox.builder.BBOX_CODERS.register_module', 'BBOX_CODERS.register_module', ([], {}), '()\n', (202, 204), False, 'from mmdet.core.bbox.builder import BBOX_CODERS\n'), ((2027, 2070), 'projects.mmdet3d_plugin.core.bbox.util.denormalize_bbox', 'denormalize_bbox', (['bbox_preds', 'self.pc_range'], {... |
import numpy as np
from learnware.algorithm.anomaly_detect.ewma import Ewma
class TestTimeSeriesAnomalyDetectEwma:
def test_anomaly_detect_one_predict(self):
rng = np.random.RandomState(42)
X_train = rng.randn(100, 1)
model = Ewma()
result = model.predict_one(X_train)
pri... | [
"learnware.algorithm.anomaly_detect.ewma.Ewma",
"numpy.random.RandomState"
] | [((179, 204), 'numpy.random.RandomState', 'np.random.RandomState', (['(42)'], {}), '(42)\n', (200, 204), True, 'import numpy as np\n'), ((258, 264), 'learnware.algorithm.anomaly_detect.ewma.Ewma', 'Ewma', ([], {}), '()\n', (262, 264), False, 'from learnware.algorithm.anomaly_detect.ewma import Ewma\n'), ((416, 441), 'n... |
#!/usr/bin/env python
from datetime import datetime, timedelta
from pyobs import G5_ICARTT
if __name__ == "__main__":
# template = 'discoveraq-geos5das-PRODUCT_SITE_DATE_RA.1001.ict'
# top_url='http://opendap.nccs.nasa.gov:9090/dods/GEOS-5/fp/0.25_deg/assim'
outTopDir = './Archive'
template = 'dis... | [
"pyobs.G5_ICARTT",
"datetime.timedelta",
"datetime.datetime"
] | [((949, 973), 'datetime.timedelta', 'timedelta', ([], {'seconds': '(86400)'}), '(seconds=86400)\n', (958, 973), False, 'from datetime import datetime, timedelta\n'), ((986, 1006), 'datetime.datetime', 'datetime', (['(2011)', '(7)', '(1)'], {}), '(2011, 7, 1)\n', (994, 1006), False, 'from datetime import datetime, timed... |
from flask import Flask
from flask_cors import CORS
app = Flask(__name__)
CORS(app, resources={r"/api/*": {"origins": "*"}})
from api.product_api import product_api
from api.cart_api import cart_api
app.register_blueprint(product_api)
app.register_blueprint(cart_api)
@app.route("/")
def hello_world():
return "h... | [
"flask_cors.CORS",
"flask.Flask"
] | [((59, 74), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (64, 74), False, 'from flask import Flask\n'), ((75, 124), 'flask_cors.CORS', 'CORS', (['app'], {'resources': "{'/api/*': {'origins': '*'}}"}), "(app, resources={'/api/*': {'origins': '*'}})\n", (79, 124), False, 'from flask_cors import CORS\n')] |
#!/usr/bin/env python3
#
# Copyright (c) 2021 unfoldingWord
# http://creativecommons.org/licenses/MIT/
# See LICENSE file for details.
#
# TX WEBHOOK
#
# NOTE: This module name and function name are defined by the rq package and our own tx-enqueue-job package
# This code adapted by RJH June 2018 from tx-manager/clie... | [
"door43_tools.bible_books.BOOK_NUMBERS.keys",
"app_settings.app_settings.AppSettings",
"os.remove",
"sys.setrecursionlimit",
"app_settings.app_settings.AppSettings.logger.info",
"argparse.ArgumentParser",
"os.makedirs",
"general_tools.file_utils.remove_tree",
"app_settings.app_settings.AppSettings.l... | [((2209, 2236), 'sys.setrecursionlimit', 'sys.setrecursionlimit', (['(1500)'], {}), '(1500)\n', (2230, 2236), False, 'import sys\n'), ((3962, 3975), 'app_settings.app_settings.AppSettings', 'AppSettings', ([], {}), '()\n', (3973, 3975), False, 'from app_settings.app_settings import AppSettings\n'), ((4011, 4101), 'app_... |
import onnx
from onnx import helper, version_converter
from onnxsim import simplify
ONNX_OPSET_VERSION = 16
ONNX_AI_OPSET_VERSION = 3
ONNX_IR_VERSION = 8
OPSET_IMPORTS = [
onnx.OperatorSetIdProto(domain="", version=ONNX_OPSET_VERSION),
onnx.OperatorSetIdProto(domain="ai.onnx.ml", version=ONNX_AI_OPSET_VERSION)... | [
"onnx.helper.make_node",
"onnx.compose.add_prefix",
"onnx.helper.make_model",
"onnx.helper.make_tensor_value_info",
"onnxsim.simplify",
"onnx.compose.merge_models",
"onnx.version_converter.convert_version",
"onnx.OperatorSetIdProto",
"onnx.checker.check_model",
"onnx.shape_inference.infer_shapes"
... | [((177, 239), 'onnx.OperatorSetIdProto', 'onnx.OperatorSetIdProto', ([], {'domain': '""""""', 'version': 'ONNX_OPSET_VERSION'}), "(domain='', version=ONNX_OPSET_VERSION)\n", (200, 239), False, 'import onnx\n'), ((245, 320), 'onnx.OperatorSetIdProto', 'onnx.OperatorSetIdProto', ([], {'domain': '"""ai.onnx.ml"""', 'versi... |
import unittest
def suma(num_1, num_2):
return num_1 + num_2
class BlackBoxTest(unittest.TestCase):
def test_sum_two_positives(self):
num_1 = 10
num_2 = 5
result = suma(num_1, num_2)
self.assertEqual(resultado, 15)
def test_sum_two_nagatives(self):
num_1 = -10
... | [
"unittest.main"
] | [((441, 456), 'unittest.main', 'unittest.main', ([], {}), '()\n', (454, 456), False, 'import unittest\n')] |
import unittest
from AffineCipher.AffineCipher import AffineCipher
from assertpy import assert_that
class AffineTest(unittest.TestCase):
def setUp(self):
self.temp = AffineCipher()
def test_cipher_a(self):
assert_that(self.temp.affine_cipher("a", 1, 3)).is_equal_to("d")
def test_cipher_... | [
"unittest.main",
"AffineCipher.AffineCipher.AffineCipher",
"assertpy.assert_that"
] | [((3614, 3629), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3627, 3629), False, 'import unittest\n'), ((181, 195), 'AffineCipher.AffineCipher.AffineCipher', 'AffineCipher', ([], {}), '()\n', (193, 195), False, 'from AffineCipher.AffineCipher import AffineCipher\n'), ((1684, 1720), 'assertpy.assert_that', 'asse... |
import logging
import more_itertools
import sqlalchemy.orm as sa_orm
from app import models
LOGGER = logging.getLogger(__name__)
def log_metrics(loader_func):
def _wrapper(*args, **kwargs):
num_events = loader_func(*args, **kwargs)
LOGGER.info('Inserted %d response events into database', num_ev... | [
"more_itertools.chunked",
"more_itertools.side_effect",
"logging.getLogger"
] | [((104, 131), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (121, 131), False, 'import logging\n'), ((1165, 1222), 'more_itertools.side_effect', 'more_itertools.side_effect', (['_increment_num_events', 'events'], {}), '(_increment_num_events, events)\n', (1191, 1222), False, 'import more... |
'''
@author: 42piratas
'''
# -*- coding: utf-8 -*-
import hg
from senti_classifier import senti_classifier
def senti():
for w in hg.content_summary:
pos_score, neg_score = senti_classifier.polarity_scores(w)
hg.content_summary[w].append({'positive': pos_score})
hg.content_summary[w].app... | [
"senti_classifier.senti_classifier.polarity_scores"
] | [((189, 224), 'senti_classifier.senti_classifier.polarity_scores', 'senti_classifier.polarity_scores', (['w'], {}), '(w)\n', (221, 224), False, 'from senti_classifier import senti_classifier\n')] |
from jax import numpy as np
from jax import random, scipy
from mcx.distributions import constraints
from mcx.distributions.distribution import Distribution
from mcx.distributions.shapes import broadcast_batch_shape
class Normal(Distribution):
params_constraints = {
"mu": constraints.real,
"sigma"... | [
"jax.scipy.stats.norm.logpdf",
"jax.numpy.shape",
"jax.random.normal"
] | [((760, 795), 'jax.random.normal', 'random.normal', (['rng_key'], {'shape': 'shape'}), '(rng_key, shape=shape)\n', (773, 795), False, 'from jax import random, scipy\n'), ((937, 994), 'jax.scipy.stats.norm.logpdf', 'scipy.stats.norm.logpdf', (['x'], {'loc': 'self.mu', 'scale': 'self.sigma'}), '(x, loc=self.mu, scale=sel... |
# -*- coding: utf-8 -*-
u"""List of features available
:copyright: Copyright (c) 2016 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
# defer all imports so *_CODES is available to testing functions
#: ... | [
"pykern.pkconfig.channel_in_internal_test",
"pykern.pkconfig.channel_in"
] | [((2165, 2191), 'pykern.pkconfig.channel_in', 'pkconfig.channel_in', (['"""dev"""'], {}), "('dev')\n", (2184, 2191), False, 'from pykern import pkconfig\n'), ((2204, 2239), 'pykern.pkconfig.channel_in_internal_test', 'pkconfig.channel_in_internal_test', ([], {}), '()\n', (2237, 2239), False, 'from pykern import pkconfi... |
from torch.distributions import Normal
from .normalized_kernel import NormalizedKernel
class NormalKernel(NormalizedKernel):
""" Normal kernel """
def __init__(self, loc, scale):
self.set_density(loc, scale)
def set_density(self, loc, scale):
""" Set normal probability density function "... | [
"torch.distributions.Normal"
] | [((346, 364), 'torch.distributions.Normal', 'Normal', (['loc', 'scale'], {}), '(loc, scale)\n', (352, 364), False, 'from torch.distributions import Normal\n')] |
import os
import sys
import click
import fiona
import numpy
from trefoil.geometry.bbox import BBox
from trefoil.netcdf.crs import set_crs
from trefoil.netcdf.variable import SpatialCoordinateVariables
from netCDF4 import Dataset
from numpy.ma.core import is_masked
from pyproj import transform, Proj
from rasterio.featu... | [
"trefoil.geometry.bbox.BBox",
"netCDF4.Dataset",
"click.argument",
"fiona.open",
"numpy.ma.masked_where",
"numpy.ma.core.is_masked",
"trefoil.netcdf.variable.SpatialCoordinateVariables.from_dataset",
"click.option",
"os.path.exists",
"numpy.zeros",
"click.command",
"pyproj.Proj",
"click.Path... | [((520, 535), 'click.command', 'click.command', ([], {}), '()\n', (533, 535), False, 'import click\n'), ((537, 565), 'click.argument', 'click.argument', (['"""in_pattern"""'], {}), "('in_pattern')\n", (551, 565), False, 'import click\n'), ((567, 596), 'click.argument', 'click.argument', (['"""out_pattern"""'], {}), "('... |
#!/usr/bin/env python3
import shutil
import sys
import os
import argparse
import platform
from HashUtil import HashList
from HashUtil import EncryptionHelpers
from HashUtil import Utils
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Removes password-based encryption and applies mach... | [
"HashUtil.EncryptionHelpers.LoadMachineKeys",
"HashUtil.EncryptionHelpers.KeyFromPassword",
"argparse.ArgumentParser",
"HashUtil.EncryptionHelpers.Decrypt",
"HashUtil.Utils.GetPassword"
] | [((233, 358), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Removes password-based encryption and applies machine keying for this device"""'}), "(description=\n 'Removes password-based encryption and applies machine keying for this device'\n )\n", (256, 358), False, 'import argpar... |
"""Parser for the grammar file."""
from ast import literal_eval
from token import COMMENT, DEDENT, ENDMARKER, INDENT, NAME, NEWLINE, NL, NUMBER, STRING
from story7.parser import Parser
class Grammar:
def __init__(self, rules, metas):
self.rules = rules
self.rules_dict = {rule.name: rule for ru... | [
"ast.literal_eval"
] | [((5684, 5711), 'ast.literal_eval', 'literal_eval', (['string.string'], {}), '(string.string)\n', (5696, 5711), False, 'from ast import literal_eval\n'), ((6004, 6031), 'ast.literal_eval', 'literal_eval', (['string.string'], {}), '(string.string)\n', (6016, 6031), False, 'from ast import literal_eval\n')] |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from glob import glob
import os
from setuptools import find_packages
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), "README.md"), "r") as fh:
long_descript... | [
"os.path.basename",
"os.path.dirname",
"setuptools.find_packages",
"glob.glob"
] | [((703, 723), 'setuptools.find_packages', 'find_packages', (['"""src"""'], {}), "('src')\n", (716, 723), False, 'from setuptools import find_packages\n'), ((250, 275), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (265, 275), False, 'import os\n'), ((826, 842), 'glob.glob', 'glob', (['"""src... |
"""
.. currentmodule:: dgl
DGL at a Glance
=========================
**Author**: `<NAME> <https://jermainewang.github.io/>`_, <NAME>, `Jake
Zhao <https://cs.nyu.edu/~jakezhao/>`_, <NAME>
DGL is a Python package dedicated to deep learning on graphs, built atop
existing tensor DL frameworks (e.g. Pytorch, MX... | [
"torch.eye",
"torch.relu",
"matplotlib.pyplot.close",
"networkx.kamada_kawai_layout",
"dgl.DGLGraph",
"matplotlib.pyplot.figure",
"networkx.draw",
"torch.nn.functional.nll_loss",
"torch.nn.functional.log_softmax",
"torch.nn.Linear",
"torch.sum",
"torch.tensor"
] | [((3705, 3733), 'networkx.kamada_kawai_layout', 'nx.kamada_kawai_layout', (['nx_G'], {}), '(nx_G)\n', (3727, 3733), True, 'import networkx as nx\n'), ((3735, 3801), 'networkx.draw', 'nx.draw', (['nx_G', 'pos'], {'with_labels': '(True)', 'node_color': '[[0.7, 0.7, 0.7]]'}), '(nx_G, pos, with_labels=True, node_color=[[0.... |
import tensorflow as tf
from tensorflow import keras
from datetime import datetime
from utils.utils import savepickle
def train_with_checkpoin_tensorboard(model,**kwargs):
try:
num_epoches = kwargs["epoches"]
y_train = kwargs["y_train"]
val_data = kwargs["val_data"] # (X_v... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"tensorflow.device",
"utils.utils.savepickle",
"matplotlib.pyplot.figure",
"datetime.datetime.now"
] | [((1976, 2010), 'utils.utils.savepickle', 'savepickle', (['model_save_file', 'model'], {}), '(model_save_file, model)\n', (1986, 2010), False, 'from utils.utils import savepickle\n'), ((2412, 2438), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(8, 8)'}), '(figsize=(8, 8))\n', (2422, 2438), True, 'import ... |
import os
import re
import sys
import argparse
import time
import pdb
import datetime
import numpy as np
import random
import arg_parser
from tqdm import tqdm
from pytorch_nndct.apis import torch_quantizer
import torch
import torchvision
import torchvision.transforms as transforms
from torchvision.models.resnet import... | [
"torch.utils.data.DataLoader",
"torch.load",
"torch.nn.CrossEntropyLoss",
"torch.randn",
"pytorch_nndct.apis.torch_quantizer",
"time.time",
"torchvision.datasets.ImageFolder",
"arg_parser.get_resnet18_quant_parser",
"torchvision.models.resnet.resnet18",
"torchvision.transforms.ToTensor",
"torch.... | [((433, 508), 'torchvision.transforms.Normalize', 'transforms.Normalize', ([], {'mean': '[0.485, 0.456, 0.406]', 'std': '[0.229, 0.224, 0.225]'}), '(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])\n', (453, 508), True, 'import torchvision.transforms as transforms\n'), ((557, 568), 'time.time', 'time.time', ([], ... |
import asyncio
from datetime import datetime, timedelta
from abc import ABCMeta, abstractmethod, abstractproperty
import operator
from threading import Lock
from functools import partial
from warnings import warn
class SuspenderBase(metaclass=ABCMeta):
"""An ABC to manage the callbacks between asyincio and pyepic... | [
"asyncio.Event",
"threading.Lock",
"datetime.timedelta",
"warnings.warn",
"datetime.datetime.now"
] | [((1312, 1318), 'threading.Lock', 'Lock', ([], {}), '()\n', (1316, 1318), False, 'from threading import Lock\n'), ((15038, 15171), 'warnings.warn', 'warn', (['"""SuspendInBand has been renamed SuspendWhenOutsideBand to make its meaning more clear. Its behavior has not changed."""'], {}), "(\n 'SuspendInBand has been... |
#!/usr/bin/env python
# pylint: disable=R0913, R0914, C0301, C0111, C0103, E0401
import argparse
import os
import sys
import time
import shutil
import json
import socket
import re
import simplesam
import os.path
import pisces.run
import pisces.index
import pisces.qc
import pisces.submit
from signal import signal, SIGI... | [
"pkg_resources.get_distribution",
"tempfile.NamedTemporaryFile",
"argparse.ArgumentParser",
"os.getcwd",
"pisces.find_data_directory",
"signal.signal",
"json.dumps",
"os.path.expandvars",
"subprocess.call",
"sys.stderr.write",
"os.path.join",
"argparse.FileType",
"sys.exit",
"multiprocessi... | [((644, 665), 'pisces.find_data_directory', 'find_data_directory', ([], {}), '()\n', (663, 665), False, 'from pisces import find_data_directory\n'), ((588, 623), 'pkg_resources.get_distribution', 'get_distribution', (['"""novartis_pisces"""'], {}), "('novartis_pisces')\n", (604, 623), False, 'from pkg_resources import ... |
"""Build a wells configuration string from a CSV file of production figures"""
import os
import pandas as pd
df = pd.read_csv('NENE production.csv', index_col='Date')
df.fillna(0, inplace=True)
oil_df = df.filter(like='Oil', axis=1)
gas_df = df.filter(like='Gas', axis=1)
oil_rates = list(oil_df.iloc[-1])
gas_rates =... | [
"pandas.read_csv",
"os.remove"
] | [((116, 168), 'pandas.read_csv', 'pd.read_csv', (['"""NENE production.csv"""'], {'index_col': '"""Date"""'}), "('NENE production.csv', index_col='Date')\n", (127, 168), True, 'import pandas as pd\n'), ((581, 607), 'os.remove', 'os.remove', (['"""well_data.txt"""'], {}), "('well_data.txt')\n", (590, 607), False, 'import... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | [
"shapely.geometry.Point",
"shapely.geometry.Polygon",
"sedona.core.SpatialRDD.PolygonRDD",
"shapely.geometry.LineString",
"sedona.core.SpatialRDD.LineStringRDD",
"sedona.core.SpatialRDD.PointRDD",
"shapely.wkt.loads",
"sedona.utils.spatial_rdd_parser.GeoData"
] | [((1431, 1449), 'sedona.core.SpatialRDD.PointRDD', 'PointRDD', (['rdd_data'], {}), '(rdd_data)\n', (1439, 1449), False, 'from sedona.core.SpatialRDD import PointRDD, LineStringRDD, PolygonRDD\n'), ((1750, 1795), 'shapely.geometry.LineString', 'LineString', (['[(0.0, 1.0), (1, 1), (12.0, 1.0)]'], {}), '([(0.0, 1.0), (1,... |
from setuptools import setup, find_packages
def readme():
with open('README.md') as f:
return f.read()
def get_requirements():
with open('requirements.txt') as requirements:
return requirements.read().splitlines()
setup(
name='orca',
version='0.1.0',
long_description=readme(),
... | [
"setuptools.find_packages"
] | [((473, 488), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (486, 488), False, 'from setuptools import setup, find_packages\n')] |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Finite state normalizer module called by auto_norm.py for OOV items. Relies on Foma binaries for the current
operating systems in bin/foma/ and a compiled grammar at bin/coptic_foma.bin.
"""
from __future__ import print_function
import io, os, re, sys
from collections im... | [
"tempfile.NamedTemporaryFile",
"os.path.realpath",
"io.open",
"os.remove"
] | [((453, 479), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (469, 479), False, 'import io, os, re, sys\n'), ((1075, 1116), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', ([], {'delete': '(False)'}), '(delete=False)\n', (1102, 1116), False, 'import tempfile, subprocess\n'), (... |
import uuid
import os
import unittest
from unittest import mock
from botocore.stub import Stubber
from matrix.common.aws.batch_handler import BatchHandler
from matrix.common.aws.cloudwatch_handler import MetricName
class TestBatchHandler(unittest.TestCase):
def setUp(self):
self.request_id = str(uuid.u... | [
"unittest.mock.patch",
"uuid.uuid4",
"matrix.common.aws.batch_handler.BatchHandler",
"botocore.stub.Stubber"
] | [((448, 537), 'unittest.mock.patch', 'mock.patch', (['"""matrix.common.aws.cloudwatch_handler.CloudwatchHandler.put_metric_data"""'], {}), "(\n 'matrix.common.aws.cloudwatch_handler.CloudwatchHandler.put_metric_data')\n", (458, 537), False, 'from unittest import mock\n'), ((538, 615), 'unittest.mock.patch', 'mock.pa... |
# -*- coding: utf-8 -*-
import uuid
import re
import base64
from datetime import datetime, date
from django import forms
from decimal import Decimal
from django.apps import apps
from django.core import validators
from djangoplus.utils.icons import ICON_CHOICES
from djangoplus.ui.components.forms import widgets
from dj... | [
"django.core.exceptions.ValidationError",
"datetime.date.today",
"uuid.uuid1",
"django.apps.apps.get_app_config",
"djangoplus.ui.components.forms.widgets.PickWidget",
"datetime.datetime.now",
"re.sub",
"re.compile"
] | [((10967, 11023), 're.compile', 're.compile', (['"""^(\\\\d{2})[-\\\\.]?(\\\\d{4,5})[-\\\\.]?(\\\\d{4})$"""'], {}), "('^(\\\\d{2})[-\\\\.]?(\\\\d{4,5})[-\\\\.]?(\\\\d{4})$')\n", (10977, 11023), False, 'import re\n'), ((2027, 2039), 'datetime.date.today', 'date.today', ([], {}), '()\n', (2037, 2039), False, 'from dateti... |
'''
PyTorch Dataset Handling. The dataset folder should comprise of two subfolders namely "train" and "test" where both folders has subfolders that named
according to their class names.
'''
import os
import glob
import cv2
import torch
from torch.utils import data
from torch.utils.data import Dataset, dataset
class ... | [
"cv2.cvtColor",
"cv2.imread",
"glob.glob",
"torch.is_tensor",
"cv2.resize"
] | [((1480, 1525), 'glob.glob', 'glob.glob', (["(folder_path + '**')"], {'recursive': '(True)'}), "(folder_path + '**', recursive=True)\n", (1489, 1525), False, 'import glob\n'), ((1989, 2009), 'torch.is_tensor', 'torch.is_tensor', (['idx'], {}), '(idx)\n', (2004, 2009), False, 'import torch\n'), ((2297, 2350), 'cv2.resiz... |
from django.conf import settings
from django.shortcuts import render
from django.urls import reverse
def robotstxt(request):
sitemaps = getattr(settings, "DJROBOTS_SITEMAPS", [])
disallow_all = getattr(settings, "DJROBOTS_DISALLOWALL", False)
if isinstance(sitemaps, str):
sitemaps = [sitemaps]
... | [
"django.shortcuts.render",
"django.urls.reverse"
] | [((697, 782), 'django.shortcuts.render', 'render', (['request', '"""djrobots/robots-debug.txt"""', 'context'], {'content_type': '"""text/plain"""'}), "(request, 'djrobots/robots-debug.txt', context, content_type='text/plain'\n )\n", (703, 782), False, 'from django.shortcuts import render\n'), ((837, 911), 'django.sh... |
import unittest
import json
import os
from pathlib import Path
import shutil
from envvar_helper import add_aws_envvar
class EnvVarHelperTests(unittest.TestCase):
def setUp(self):
base_path = Path(Path.cwd(), "tests", "integration", "fixtures")
self.template = Path(base_path, "template.json")
... | [
"os.remove",
"json.load",
"shutil.copy2",
"envvar_helper.add_aws_envvar",
"pathlib.Path",
"pathlib.Path.cwd"
] | [((285, 317), 'pathlib.Path', 'Path', (['base_path', '"""template.json"""'], {}), "(base_path, 'template.json')\n", (289, 317), False, 'from pathlib import Path\n'), ((343, 376), 'pathlib.Path', 'Path', (['base_path', '"""undertest.json"""'], {}), "(base_path, 'undertest.json')\n", (347, 376), False, 'from pathlib impo... |
import re, sys, fileinput
version = "{{version}}"
def readPodVersion(path):
try:
with open (path, "r", encoding="utf-8") as podspec:
for row in podspec:
if row.strip(" ").startswith("s.version"):
global version
version = row.replace(" ",""... | [
"fileinput.input",
"sys.stderr.write",
"re.findall",
"sys.exit"
] | [((697, 750), 'fileinput.input', 'fileinput.input', (['replacePath'], {'backup': '""""""', 'inplace': '(True)'}), "(replacePath, backup='', inplace=True)\n", (712, 750), False, 'import re, sys, fileinput\n'), ((1333, 1386), 'fileinput.input', 'fileinput.input', (['replacePath'], {'backup': '""""""', 'inplace': '(True)'... |
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import pins
from esphome.components import sensor
from esphome.const import (
CONF_PIN,
STATE_CLASS_MEASUREMENT,
UNIT_PERCENT,
ICON_PERCENT,
)
duty_cycle_ns = cg.esphome_ns.namespace("duty_cycle")
DutyCycleSensor = duty_cy... | [
"esphome.components.sensor.sensor_schema",
"esphome.config_validation.Required",
"esphome.config_validation.All",
"esphome.config_validation.polling_component_schema",
"esphome.components.sensor.new_sensor",
"esphome.codegen.esphome_ns.namespace",
"esphome.codegen.gpio_pin_expression",
"esphome.codege... | [((257, 294), 'esphome.codegen.esphome_ns.namespace', 'cg.esphome_ns.namespace', (['"""duty_cycle"""'], {}), "('duty_cycle')\n", (280, 294), True, 'import esphome.codegen as cg\n'), ((708, 742), 'esphome.config_validation.polling_component_schema', 'cv.polling_component_schema', (['"""60s"""'], {}), "('60s')\n", (735, ... |
#!/usr/bin/env python3
"""
Copyright (c) 2017-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
"""
import unittest
from unittest.mock import MagicMock
import MySQLdb
from ..lib import db as db_l... | [
"MySQLdb.OperationalError",
"unittest.mock.MagicMock"
] | [((835, 846), 'unittest.mock.MagicMock', 'MagicMock', ([], {}), '()\n', (844, 846), False, 'from unittest.mock import MagicMock\n'), ((1453, 1464), 'unittest.mock.MagicMock', 'MagicMock', ([], {}), '()\n', (1462, 1464), False, 'from unittest.mock import MagicMock\n'), ((693, 745), 'MySQLdb.OperationalError', 'MySQLdb.O... |
from . import data
from .locators import GoogleSearchLocators as GSL
from libs.sel.helpers import CustomActions, _re
class GoogleSearchPage():
def __init__(self, driver):
self.driver = driver
self.helpers = CustomActions(self.driver)
def is_search_bar_on_page(self):
return self.find_... | [
"libs.sel.helpers.CustomActions"
] | [((230, 256), 'libs.sel.helpers.CustomActions', 'CustomActions', (['self.driver'], {}), '(self.driver)\n', (243, 256), False, 'from libs.sel.helpers import CustomActions, _re\n')] |
# from exhibitionist.toolbox import http_handler,JSONRequestHandler,Template
import os
import codecs
import threading
from exhibitionist.toolbox import *
from tornado.template import Template
context = None # lose the warnings
@http_handler(r'/numpy/{{objid}}/(?P<animal>cat|dog)')
class KittenGram(JSONRequestHandle... | [
"codecs.open"
] | [((627, 649), 'codecs.open', 'codecs.open', (['tmpl_file'], {}), '(tmpl_file)\n', (638, 649), False, 'import codecs\n')] |
import json
import types
import numpy as np
from io import BytesIO
from game.helpers.dataframe import Series
ENTITY_SERIALIZE = (int, str, bool, tuple, list, Series)
ENTITY_SERIALIZE_BLACKLIST = "moving"
"""
Disabled, this stuff will see an overhaul soon anyway.
"""
class SaveManager:
def __init__(sel... | [
"io.BytesIO",
"numpy.savez_compressed"
] | [((8229, 8238), 'io.BytesIO', 'BytesIO', ([], {}), '()\n', (8236, 8238), False, 'from io import BytesIO\n'), ((8251, 8287), 'numpy.savez_compressed', 'np.savez_compressed', (['f'], {}), '(f, **self.store)\n', (8270, 8287), True, 'import numpy as np\n')] |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, <NAME> <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status':... | [
"ansible.module_utils.urls.fetch_url"
] | [((9881, 9977), 'ansible.module_utils.urls.fetch_url', 'urls.fetch_url', ([], {'module': 'self.module', 'url': 'url', 'headers': 'self.headers', 'method': 'method', 'data': 'data'}), '(module=self.module, url=url, headers=self.headers, method=\n method, data=data)\n', (9895, 9977), False, 'from ansible.module_utils ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('lot', '0002_lot_next_url'),
]
operations = [
migrations.AlterField(
model_name='lot',
name='type',
... | [
"django.db.models.SlugField"
] | [((337, 378), 'django.db.models.SlugField', 'models.SlugField', ([], {'verbose_name': '"""LOT type"""'}), "(verbose_name='LOT type')\n", (353, 378), False, 'from django.db import models, migrations\n')] |
class LCG: #is dezelfde code als in __init__.py
"""
Linear congruential generator (LCG), gebaseerd op ET-rng.
:param seed: Gebruikt standaard de huidige tijd om verschillende sequenties te berekenen.
:param a: Parameter voor de LCG.
:param b: Parameter voor de LCG.
:param m: Parameter voor de LCG.
"""
#De pa... | [
"numpy.average",
"numpy.std",
"numpy.empty",
"numpy.random.randint",
"et_stopwatch.Stopwatch",
"time.time_ns"
] | [((1259, 1276), 'numpy.empty', 'np.empty', (['(1000000)'], {}), '(1000000)\n', (1267, 1276), True, 'import numpy as np\n'), ((1423, 1441), 'numpy.average', 'np.average', (['array1'], {}), '(array1)\n', (1433, 1441), True, 'import numpy as np\n'), ((1449, 1463), 'numpy.std', 'np.std', (['array1'], {}), '(array1)\n', (14... |
import subprocess
def persistent_modprobe(module):
"""Load a kernel module and configure for auto-load on reboot."""
with open('/etc/modules', 'r+') as modules:
if module not in modules.read():
modules.write(module + "\n")
def update_initramfs(version='all'):
"""Updates an initramfs ... | [
"subprocess.check_call"
] | [((341, 405), 'subprocess.check_call', 'subprocess.check_call', (["['update-initramfs', '-k', version, '-u']"], {}), "(['update-initramfs', '-k', version, '-u'])\n", (362, 405), False, 'import subprocess\n')] |
"""Handles creating the flask app"""
import functools
import os
import boltons.fileutils
import flask
import flask_login
import flask_talisman
from flask import Flask
from flask_bootstrap import Bootstrap
from flask_jsglue import JSGlue
from flask_sqlalchemy import SQLAlchemy
import logging
# todo move top level thin... | [
"flask_jsglue.JSGlue",
"infiltrate.views.update_collection.UpdateCollectionView.register",
"flask.url_for",
"infiltrate.models.user.User.query.filter",
"flask_bootstrap.Bootstrap",
"infiltrate.views.raw_data.RawDataView.register",
"infiltrate.views.login.RegisterView.register",
"flask.redirect",
"in... | [((462, 477), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (467, 477), False, 'from flask import Flask\n'), ((567, 604), 'logging.info', 'logging.info', (['"""Setting configuration"""'], {}), "('Setting configuration')\n", (579, 604), False, 'import logging\n'), ((972, 1007), 'logging.info', 'logging.inf... |
from datetime import timedelta
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from waldur_core.core.serializers import GenericRelatedField
from waldur_core.structure.models import Customer, Project
class DailyHistoryQuotaSerializer(se... | [
"rest_framework.serializers.DateField",
"waldur_core.core.serializers.GenericRelatedField",
"django.utils.timezone.now",
"rest_framework.serializers.CharField",
"datetime.timedelta",
"django.utils.translation.ugettext_lazy"
] | [((355, 410), 'waldur_core.core.serializers.GenericRelatedField', 'GenericRelatedField', ([], {'related_models': '(Project, Customer)'}), '(related_models=(Project, Customer))\n', (374, 410), False, 'from waldur_core.core.serializers import GenericRelatedField\n'), ((510, 566), 'rest_framework.serializers.DateField', '... |
import wmi
print("++++++++++++ WMI BASIC SYSTEM INFORMATION ++++++++++++\n")
try:
cpu_name = wmi.WMI().win32_Processor()[0].name
cpu_serial = wmi.WMI().win32_Processor()[0].processorid
print("---- CPU ----")
print("CPU Name: %s\nCPU Serial: %s\n\n" % (cpu_name, cpu_serial))
except:
print("---- CPU... | [
"wmi.WMI"
] | [((756, 765), 'wmi.WMI', 'wmi.WMI', ([], {}), '()\n', (763, 765), False, 'import wmi\n'), ((1236, 1245), 'wmi.WMI', 'wmi.WMI', ([], {}), '()\n', (1243, 1245), False, 'import wmi\n'), ((1498, 1507), 'wmi.WMI', 'wmi.WMI', ([], {}), '()\n', (1505, 1507), False, 'import wmi\n'), ((99, 108), 'wmi.WMI', 'wmi.WMI', ([], {}), ... |
# Flatten a sphere to the XY plane.
#
import pyvista as pv
sphere = pv.Sphere()
projected = sphere.project_points_to_plane()
projected.plot(show_edges=True, line_width=3)
| [
"pyvista.Sphere"
] | [((68, 79), 'pyvista.Sphere', 'pv.Sphere', ([], {}), '()\n', (77, 79), True, 'import pyvista as pv\n')] |
# SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.
"""Utility functions for parsing"""
from dataclasses import dataclass
from typing import Union, cast
import h5py
from okpt.io... | [
"typing.cast",
"h5py.File"
] | [((625, 648), 'h5py.File', 'h5py.File', (['dataset_path'], {}), '(dataset_path)\n', (634, 648), False, 'import h5py\n'), ((678, 711), 'typing.cast', 'cast', (['h5py.Dataset', "file['train']"], {}), "(h5py.Dataset, file['train'])\n", (682, 711), False, 'from typing import Union, cast\n'), ((741, 773), 'typing.cast', 'ca... |
from datetime import datetime
import json
import uuid
import requests # http://docs.python-requests.org/en/master/
from django.conf import settings
from tworaven_apps.utils.view_helper import \
(get_request_body_as_json,
get_json_error,
get_json_success)
from tworaven_apps.utils.basic_err_check import Ba... | [
"tworaven_apps.utils.basic_response.err_resp",
"requests.post",
"tworaven_apps.utils.basic_response.ok_resp",
"json.dumps"
] | [((2153, 2171), 'json.dumps', 'json.dumps', (['params'], {}), '(params)\n', (2163, 2171), False, 'import json\n'), ((3521, 3580), 'requests.post', 'requests.post', (['url_persistent_id'], {'data': 'payload', 'files': 'files'}), '(url_persistent_id, data=payload, files=files)\n', (3534, 3580), False, 'import requests\n'... |
import click
import redis
from click.testing import CliRunner
from mock import Mock
from dbcli.rcli import cli
r = redis.Redis()
r.flushdb()
runner = CliRunner()
def test_add_to_db():
click.edit = Mock(
return_value='{"key1": "value1",'
'"key2": {"key21": "value21", "key22": "value22"},'
... | [
"redis.Redis",
"click.testing.CliRunner",
"mock.Mock"
] | [((117, 130), 'redis.Redis', 'redis.Redis', ([], {}), '()\n', (128, 130), False, 'import redis\n'), ((152, 163), 'click.testing.CliRunner', 'CliRunner', ([], {}), '()\n', (161, 163), False, 'from click.testing import CliRunner\n'), ((205, 334), 'mock.Mock', 'Mock', ([], {'return_value': '"""{"key1": "value1","key2": {"... |
from setuptools import find_packages
import survey_analysis_tool
def define_args():
install_requirements = ['setuptools>=40.3,<49.2', 'numpy>=1.16,<2.0', 'matplotlib>=3.0.1,<3.2.1', 'scikit-image',
'pandas', 'xlrd >= 1.0']
test_requirements = ['pytest>=4.3,<4.4', 'pytest-cov>=2.7,... | [
"setuptools.find_packages"
] | [((695, 710), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (708, 710), False, 'from setuptools import find_packages\n')] |
import copy
import io
import re
import pytest
from happi import Device
from happi.device import EntryInfo
from happi.errors import ContainerError
def test_get(device, device_info):
assert device.name == device_info['name']
def test_init(device, device_info):
assert device.prefix == device_info['prefix']
... | [
"io.StringIO",
"copy.deepcopy",
"happi.device.EntryInfo",
"copy.copy",
"pytest.raises",
"happi.Device",
"pytest.mark.parametrize",
"re.compile"
] | [((1218, 1440), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""type_spec, value, expected"""', "[(int, 0, 0), (int, 1, 1), (int, 2.0, 2), (str, 'hat', 'hat'), (str, 5, '5'\n ), (bool, True, True), (bool, 0, False), (bool, 'true', True), (bool,\n 'NO', False)]"], {}), "('type_spec, value, expected', [... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
__all__ = ["TOSCA_META_LOCATION", "TEMPLATE_AUTHOR_FILED", "TEMPLATE_VERSION", "TEMPLATE_BASED_ON",
"CLOUDSHELL_MAX_RETRIES", "CLOUDSHELL_RETRY_INTERVAL_SEC", "DEFAULT_TIME_WAIT", "TEMPLATE_PROPERTY",
"TEMPLATES_YML", "SERVER_VERSION_KEY"]
CLO... | [
"os.path.join"
] | [((983, 1027), 'os.path.join', 'os.path.join', (['"""TOSCA-Metadata"""', '"""TOSCA.meta"""'], {}), "('TOSCA-Metadata', 'TOSCA.meta')\n", (995, 1027), False, 'import os\n')] |
import sys
import os
import numpy as np
import pytest
from numpy.testing import assert_allclose
import matplotlib
matplotlib.use('Agg')
sys.path.append("../../../")
from atomai.stat import imlocal
test_coord_m_ = os.path.join(
os.path.dirname(__file__), 'test_data/test_coord_m.npy')
test_nn_output_ = os.path.jo... | [
"sys.path.append",
"numpy.load",
"atomai.stat.imlocal",
"os.path.dirname",
"matplotlib.use",
"numpy.testing.assert_allclose"
] | [((114, 135), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (128, 135), False, 'import matplotlib\n'), ((137, 165), 'sys.path.append', 'sys.path.append', (['"""../../../"""'], {}), "('../../../')\n", (152, 165), False, 'import sys\n'), ((235, 260), 'os.path.dirname', 'os.path.dirname', (['__file... |
import hub75
from time import ticks_ms
import math
from machine import RTC
WIDTH, HEIGHT = 64, 32
MAX_DIST = (WIDTH * WIDTH + HEIGHT * HEIGHT) * 0.5
DIGITS = [0b1110111, 0b0100100, 0b1011101, 0b1101101, 0b0101110,
0b1101011, 0b1111010, 0b0100101, 0b1111111, 0b0101111]
ox = 32
oy = 16
hue = 0
rtc = RTC()
h... | [
"time.ticks_ms",
"hub75.Hub75",
"machine.RTC",
"math.sin"
] | [((312, 317), 'machine.RTC', 'RTC', ([], {}), '()\n', (315, 317), False, 'from machine import RTC\n'), ((325, 369), 'hub75.Hub75', 'hub75.Hub75', (['WIDTH', 'HEIGHT'], {'stb_invert': '(False)'}), '(WIDTH, HEIGHT, stb_invert=False)\n', (336, 369), False, 'import hub75\n'), ((2998, 3008), 'time.ticks_ms', 'ticks_ms', ([]... |
from django.contrib import admin
# Register your models here.
from djangoForum.accounts.models import ForumUser
admin.site.register(ForumUser) | [
"django.contrib.admin.site.register"
] | [((114, 144), 'django.contrib.admin.site.register', 'admin.site.register', (['ForumUser'], {}), '(ForumUser)\n', (133, 144), False, 'from django.contrib import admin\n')] |
# %%
import enum
from os import replace
import pandas as pd
from rdkit import Chem
from rdkit.Chem import Descriptors as ds
import numpy as np
import umap
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA
import matplotlib.pyplot as plt
import plotly.express as px
import plotly.grap... | [
"pandas.DataFrame",
"numpy.sum",
"sklearn.preprocessing.StandardScaler",
"pandas.read_csv",
"plotly.graph_objects.Figure",
"plotly.express.scatter_3d",
"umap.UMAP",
"numpy.where",
"numpy.array",
"sklearn.decomposition.PCA",
"rdkit.Chem.MolFromSmiles"
] | [((1798, 1864), 'pandas.read_csv', 'pd.read_csv', (['"""scores_with_smiles.tsv"""'], {'sep': '"""\t"""', 'usecols': '[0, 2, 3]'}), "('scores_with_smiles.tsv', sep='\\t', usecols=[0, 2, 3])\n", (1809, 1864), True, 'import pandas as pd\n'), ((2012, 2051), 'pandas.DataFrame', 'pd.DataFrame', (['features'], {'columns': 'mo... |
#!/usr/bin/env python3
"""
Copyright (c) Facebook, Inc. and its affiliates.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
"""
import argparse
import logging
import sys
def create_parser():
parser = argparse.Argu... | [
"sys.exit",
"magma.configuration.mconfig_managers.load_service_mconfig_as_json",
"argparse.ArgumentParser",
"logging.basicConfig"
] | [((307, 401), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Get magma managed configs for the specified service. (mconfig)"""'], {}), "(\n 'Get magma managed configs for the specified service. (mconfig)')\n", (330, 401), False, 'import argparse\n'), ((1147, 1250), 'logging.basicConfig', 'logging.basicC... |
# Code Sample from the tutorial at https://learncodeshare.net/2015/06/02/select-crud-using-cx_oracle/
# The following code is used as the base template for the other examples.
import cx_Oracle
import os
connectString = os.getenv('DB_CONNECT') # The environment variable for the connect string: DB_CONNECT=user/pass... | [
"cx_Oracle.connect",
"os.getenv"
] | [((225, 248), 'os.getenv', 'os.getenv', (['"""DB_CONNECT"""'], {}), "('DB_CONNECT')\n", (234, 248), False, 'import os\n'), ((341, 373), 'cx_Oracle.connect', 'cx_Oracle.connect', (['connectString'], {}), '(connectString)\n', (358, 373), False, 'import cx_Oracle\n')] |
"""parse the header lines in an observation batch file"""
import re
from components.obs80.obs80 import parse80
# maps header key to corresponding database table fields
key_col = dict([
("COD", "obs_code"), ("CON", "contact_id"), ("NET", "catalog"),
("BND", "mag_band"), ("COM", "comments"), ("NUM", "obs_count"... | [
"components.obs80.obs80.parse80"
] | [((1063, 1075), 'components.obs80.obs80.parse80', 'parse80', (['obs'], {}), '(obs)\n', (1070, 1075), False, 'from components.obs80.obs80 import parse80\n')] |
import pickle
from utils.qlearning import QLearning
if __name__=="__main__":
with open('./q_table_1.pickle', 'rb') as file:
q_table = pickle.load(file)
agent = QLearning(q_table)
agent.get_result_metrics(1000)
| [
"pickle.load",
"utils.qlearning.QLearning"
] | [((177, 195), 'utils.qlearning.QLearning', 'QLearning', (['q_table'], {}), '(q_table)\n', (186, 195), False, 'from utils.qlearning import QLearning\n'), ((147, 164), 'pickle.load', 'pickle.load', (['file'], {}), '(file)\n', (158, 164), False, 'import pickle\n')] |
# Lint as: python3
"""Defines the minitaur robot related constants and URDF specs."""
import collections
import math
import gin
MINITAUR_URDF_PATH = "quadruped/minitaur_rainbow_dash.urdf"
INIT_POSITION = (0, 0, 0.2)
INIT_RACK_POSITION = (0, 0, 1)
INIT_ORIENTATION_QUAT = (0, 0, 0, 1)
INIT_ORIENTATION_RPY = (0, 0, 0)... | [
"collections.OrderedDict",
"gin.constant"
] | [((1297, 1353), 'collections.OrderedDict', 'collections.OrderedDict', (["(('body_motors', JOINT_NAMES),)"], {}), "((('body_motors', JOINT_NAMES),))\n", (1320, 1353), False, 'import collections\n'), ((1515, 1588), 'gin.constant', 'gin.constant', (['"""minitaur_constants.MINITAUR_URDF_PATH"""', 'MINITAUR_URDF_PATH'], {})... |
from django.db import migrations, transaction
from contacts.models import Connection, Message
class Migration(migrations.Migration):
dependencies = [
('contacts', '0003_test_data_contacts'),
]
def generate_message_data(apps, schema_editor):
message_test_data = [
('Hey there!')... | [
"django.db.migrations.RunPython",
"django.db.transaction.atomic",
"contacts.models.Connection.objects.last",
"contacts.models.Message"
] | [((695, 738), 'django.db.migrations.RunPython', 'migrations.RunPython', (['generate_message_data'], {}), '(generate_message_data)\n', (715, 738), False, 'from django.db import migrations, transaction\n'), ((369, 389), 'django.db.transaction.atomic', 'transaction.atomic', ([], {}), '()\n', (387, 389), False, 'from djang... |
import io
import pandas as pd
import requests
try:
from urllib2 import urlopen
except:
from urllib.request import urlopen
class SDFReader(object):
def __init__(
self,
auth,
server_url = 'http://reg.bom.gov.au',
site_base = '/water/reg/stf',
prod... | [
"pandas.read_csv",
"requests.get"
] | [((1618, 1714), 'pandas.read_csv', 'pd.read_csv', (['forecast_csv'], {'skiprows': '(23)', 'index_col': '"""Time"""', 'parse_dates': '(True)', 'na_values': "['--']"}), "(forecast_csv, skiprows=23, index_col='Time', parse_dates=True,\n na_values=['--'])\n", (1629, 1714), True, 'import pandas as pd\n'), ((613, 653), 'r... |
# coding: utf-8
import sys
from copy import deepcopy
import itertools
import time
import logging
get_ipython().magic('load_ext autoreload')
get_ipython().magic('autoreload 2')
sys.path.append('..')
from chia_diff import GenomeLoopData
from chia_diff import ChromLoopData
from chia_diff import util
from chia_diff impor... | [
"sys.path.append",
"copy.deepcopy",
"chia_diff.chia_diff.random_walk",
"chia_diff.util.output_random_walk_loops",
"chia_diff.chia_diff.find_diff_loops",
"chia_diff.util.combine_random_walks",
"chia_diff.util.read_data",
"time.time",
"itertools.combinations",
"chia_diff.util.compare_random_walks",
... | [((178, 199), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (193, 199), False, 'import sys\n'), ((747, 766), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (764, 766), False, 'import logging\n'), ((768, 796), 'logging.config.fileConfig', 'fileConfig', (['"""chia_diff.conf"""'], {}),... |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsMapLayerModel
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"""
_... | [
"qgis.core.QgsProject.instance",
"qgis.core.QgsVectorLayer",
"qgis.core.QgsMapLayerModel",
"qgis.testing.start_app",
"qgis.PyQt.QtCore.QModelIndex",
"qgis.testing.unittest.main"
] | [((722, 733), 'qgis.testing.start_app', 'start_app', ([], {}), '()\n', (731, 733), False, 'from qgis.testing import start_app, unittest\n'), ((772, 870), 'qgis.core.QgsVectorLayer', 'QgsVectorLayer', (['"""Point?crs=EPSG:3111&field=fldtxt:string&field=fldint:integer"""', 'name', '"""memory"""'], {}), "('Point?crs=EPSG:... |
from django.urls import path
from . import views
app_name = 'predict'
urlpatterns = [
path('', views.predict, name='predict'),
path('predict/', views.predict_chances, name='submit_prediction'),
path('results/', views.view_results, name='results'),
]
| [
"django.urls.path"
] | [((93, 132), 'django.urls.path', 'path', (['""""""', 'views.predict'], {'name': '"""predict"""'}), "('', views.predict, name='predict')\n", (97, 132), False, 'from django.urls import path\n'), ((138, 203), 'django.urls.path', 'path', (['"""predict/"""', 'views.predict_chances'], {'name': '"""submit_prediction"""'}), "(... |
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
#
# 向数据库EMPLOYEE中插入相应的数据
import MySQLdb
# 打开数据库连接
conn = MySQLdb.connect("localhost","root","123456","crm" )
# 使用cursor()方法获取操作游标
cursor = conn.cursor()
# SQL 插入语句
sql = """INSERT INTO EMPLOYEE(FIRST_NAME,
LAST_NAME, AGE, SEX, INCOME)
VALUES ('Linu... | [
"MySQLdb.connect"
] | [((108, 161), 'MySQLdb.connect', 'MySQLdb.connect', (['"""localhost"""', '"""root"""', '"""123456"""', '"""crm"""'], {}), "('localhost', 'root', '123456', 'crm')\n", (123, 161), False, 'import MySQLdb\n')] |
from Jumpscale import j
def main(self):
"""
to run:
kosmos 'j.data.rivine.test(name="rivine_types")'
"""
e = j.data.rivine.encoder_rivine_get()
# in the rivine_basic test we saw we can
# serialise anything using the add method.
# One can however also directly encode the specific type... | [
"Jumpscale.j.data.rivine.encoder_rivine_get"
] | [((132, 166), 'Jumpscale.j.data.rivine.encoder_rivine_get', 'j.data.rivine.encoder_rivine_get', ([], {}), '()\n', (164, 166), False, 'from Jumpscale import j\n')] |
"""
Test that LLDB can launch a linux executable through the dynamic loader and still hit a breakpoint.
"""
import lldb
import os
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
class TestLinux64LaunchingViaDynamicLoader(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skip... | [
"lldb.SBError",
"lldb.SBModuleSpec",
"lldb.SBModule",
"lldb.SBFileSpec"
] | [((521, 540), 'lldb.SBModuleSpec', 'lldb.SBModuleSpec', ([], {}), '()\n', (538, 540), False, 'import lldb\n'), ((802, 816), 'lldb.SBError', 'lldb.SBError', ([], {}), '()\n', (814, 816), False, 'import lldb\n'), ((1590, 1604), 'lldb.SBError', 'lldb.SBError', ([], {}), '()\n', (1602, 1604), False, 'import lldb\n'), ((120... |
from math import sqrt
import math
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
def __eq__(self, other):
return self.x == other.x and self.y == other.y
class Segment:
def __init__(self, point1, point2, line=None, intersection_point=None):
self.a = point1
... | [
"math.sqrt",
"time.time"
] | [((1519, 1540), 'math.sqrt', 'sqrt', (['(a ** 2 + b ** 2)'], {}), '(a ** 2 + b ** 2)\n', (1523, 1540), False, 'from math import sqrt\n'), ((1631, 1642), 'time.time', 'time.time', ([], {}), '()\n', (1640, 1642), False, 'import time\n'), ((1682, 1693), 'time.time', 'time.time', ([], {}), '()\n', (1691, 1693), False, 'imp... |
from graph_tool.all import *
from habanero import Crossref
def get_journal_papers(ISSN):
cr = Crossref(mailto = "<EMAIL>")
cr.journals()
g = Graph()
ug = Graph(directed = False)
g1 = Graph(g)
v1 = g.add_vertex()
v2 = g.add_vertex()
e = g.add_edge(v1, v2)
print(e.source(), e.target())
vlist = g.add_vertex(10)... | [
"habanero.Crossref"
] | [((97, 123), 'habanero.Crossref', 'Crossref', ([], {'mailto': '"""<EMAIL>"""'}), "(mailto='<EMAIL>')\n", (105, 123), False, 'from habanero import Crossref\n')] |
import numpy as np # type: ignore
from typing import List
import uniplot.pixel_matrix as pixel_matrix
import uniplot.plot_elements as elements
from uniplot.options import Options
from uniplot.discretizer import discretize
Y_GRIDLINE_CHARACTERS = ["▔", "─", "▁"]
def blank_character_matrix(width: int, height: int) ... | [
"numpy.full",
"uniplot.discretizer.discretize",
"uniplot.pixel_matrix.render",
"uniplot.plot_elements.character_for_2by2_pixels",
"uniplot.pixel_matrix.merge_on_top"
] | [((1597, 1675), 'uniplot.discretizer.discretize', 'discretize', ([], {'x': 'x', 'x_min': 'options.x_min', 'x_max': 'options.x_max', 'steps': 'options.width'}), '(x=x, x_min=options.x_min, x_max=options.x_max, steps=options.width)\n', (1607, 1675), False, 'from uniplot.discretizer import discretize\n'), ((1843, 2028), '... |
from none import on_request, RequestSession
from none import on_notice, NoticeSession
# 将函数注册为群请求处理器
@on_request('group')
async def _(session: RequestSession):
# 判断验证信息是否符合要求
if session.ctx['comment'] == '暗号':
# 验证信息正确,同意入群
await session.approve()
return
# 验证信息错误,拒绝入群
await ses... | [
"none.on_request",
"none.on_notice"
] | [((104, 123), 'none.on_request', 'on_request', (['"""group"""'], {}), "('group')\n", (114, 123), False, 'from none import on_request, RequestSession\n'), ((362, 389), 'none.on_notice', 'on_notice', (['"""group_increase"""'], {}), "('group_increase')\n", (371, 389), False, 'from none import on_notice, NoticeSession\n')] |
import cv2
import numpy as np
# img1=cv2.imread(r'D:\CodeFile\PythonWorkspace\Sensor-simulation-Ue4-Ubuntu\output\test3\test34.png')
# img2=cv2.imread(r"C:\Users\chaoyu\Downloads\2020-11-26-21-09-45\img\frame34.jpg")
# res = cv2.add(img2,img1)
# gray = cv2.cvtColor(img1, cv2.COLOR_BGR2GRAY)
# gray_three_channel = ... | [
"cv2.waitKey",
"cv2.destroyAllWindows",
"cv2.imshow",
"numpy.ones"
] | [((367, 407), 'numpy.ones', 'np.ones', (['(720, 1280, 3)'], {'dtype': '"""float32"""'}), "((720, 1280, 3), dtype='float32')\n", (374, 407), True, 'import numpy as np\n'), ((688, 713), 'cv2.imshow', 'cv2.imshow', (['"""Image"""', 'test'], {}), "('Image', test)\n", (698, 713), False, 'import cv2\n'), ((714, 728), 'cv2.wa... |
#! /usr/bin/env python3
import argparse
import struct
from copy import copy
from pathlib import Path
from typing import Tuple
BRIGHTNESSES = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
COLOR_PROFILE_PATH = Path("/Library/ColorSync/Profiles/Displays")
def find_color_lcd_profile() -> Path:
"""Find the path of ... | [
"pathlib.Path",
"copy.copy",
"argparse.ArgumentParser",
"struct.pack"
] | [((211, 255), 'pathlib.Path', 'Path', (['"""/Library/ColorSync/Profiles/Displays"""'], {}), "('/Library/ColorSync/Profiles/Displays')\n", (215, 255), False, 'from pathlib import Path\n'), ((1257, 1290), 'struct.pack', 'struct.pack', (['""">L"""', 'brightness_int'], {}), "('>L', brightness_int)\n", (1268, 1290), False, ... |
from keras.preprocessing import image
from keras.models import load_model
import numpy as np
model = load_model('model.h5')
print("Model Loaded Successfully")
def classify(img_file):
img_name = img_file
test_image = image.load_img(img_name, target_size = (256, 256),grayscale=True)
test_image = image.img_t... | [
"keras.models.load_model",
"os.walk",
"numpy.expand_dims",
"numpy.amax",
"keras.preprocessing.image.img_to_array",
"keras.preprocessing.image.load_img",
"numpy.array",
"os.path.join"
] | [((101, 123), 'keras.models.load_model', 'load_model', (['"""model.h5"""'], {}), "('model.h5')\n", (111, 123), False, 'from keras.models import load_model\n'), ((835, 848), 'os.walk', 'os.walk', (['path'], {}), '(path)\n', (842, 848), False, 'import os\n'), ((225, 289), 'keras.preprocessing.image.load_img', 'image.load... |
# Imports
import lib.alphabet as mod_ab
import lib.scrambler as mod_scr
import lib.vig as mod_vig
from hashlib import md5 as func_md5
from random import shuffle as func_shuffle
from numpy import roll as func_roll
# Input
p3_raw = input("Message to decrypt: ")
p1_shift = int(input("Shift: "))
p3_slock = inpu... | [
"lib.vig.decode",
"numpy.roll"
] | [((690, 724), 'lib.vig.decode', 'mod_vig.decode', (['p3_pphrase', 'p3_raw'], {}), '(p3_pphrase, p3_raw)\n', (704, 724), True, 'import lib.vig as mod_vig\n'), ((890, 927), 'lib.vig.decode', 'mod_vig.decode', (['p3_slock', 'p3_split[1]'], {}), '(p3_slock, p3_split[1])\n', (904, 927), True, 'import lib.vig as mod_vig\n'),... |
from astroid import nodes
from pylint.checkers import BaseChecker
from pylint.checkers import utils as checker_utils
from pylint.interfaces import IAstroidChecker
from astroid.helpers import safe_infer
class ComprehensionChecker(BaseChecker):
"""
Check for comprehension usage
"""
__implem... | [
"astroid.helpers.safe_infer",
"pylint.checkers.utils.check_messages"
] | [((931, 1032), 'pylint.checkers.utils.check_messages', 'checker_utils.check_messages', (['"""use-list-comprehension"""', '"""use-dict-comprehension"""', '"""use-list-copy"""'], {}), "('use-list-comprehension',\n 'use-dict-comprehension', 'use-list-copy')\n", (959, 1032), True, 'from pylint.checkers import utils as c... |
"""
Create a directory if it doesn't exist yet
"""
from __future__ import division
from __future__ import print_function
import cea.config
import cea.inputlocator
import os
__author__ = "<NAME>"
__copyright__ = "Copyright 2020, Architecture and Building Systems - ETH Zurich"
__credits__ = ["<NAME>"]
__license__ = "MI... | [
"os.makedirs",
"os.path.abspath",
"os.path.exists",
"os.path.normpath"
] | [((702, 728), 'os.path.abspath', 'os.path.abspath', (['directory'], {}), '(directory)\n', (717, 728), False, 'import os\n'), ((745, 772), 'os.path.normpath', 'os.path.normpath', (['directory'], {}), '(directory)\n', (761, 772), False, 'import os\n'), ((784, 809), 'os.path.exists', 'os.path.exists', (['directory'], {}),... |
from typing import Tuple, Optional
from dataclasses import dataclass
from pathlib import Path
import numpy as np
import matplotlib.pyplot as plt # type: ignore
IMGDIR = Path("../images/legendre")
@dataclass
class LegendreAxesConfig:
xlim1: Tuple[float, float] = (-2.7, 2.7)
ylim1: Tuple[float, float] = (-2.7... | [
"matplotlib.pyplot.axhline",
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.xlim",
"numpy.log",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.cm.viridis",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.text",
"pathlib.Path",
"matplotlib.pyplot.figure",
"numpy.exp",
... | [((172, 198), 'pathlib.Path', 'Path', (['"""../images/legendre"""'], {}), "('../images/legendre')\n", (176, 198), False, 'from pathlib import Path\n'), ((602, 666), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'ncols': '(2)', 'nrows': '(1)', 'figsize': '(9.5, 5)', 'dpi': 'config.dpi'}), '(ncols=2, nrows=1, figsi... |
#
# VSCP (Very Simple Control Protocol)
# http://www.vscp.org
#
# The MIT License (MIT)
#
# Copyright (C) 2000-2021 <NAME>,
# The VSCP Project <<EMAIL>>
#
# Convert XML file to JSON xml2json filename.xml >filename.json
#
# - Class token
# print( o['class']['@token'])
#
# - All types
# print( o['class']['type'])
#... | [
"os.makedirs",
"getopt.getopt",
"json.dumps",
"xmltodict.parse",
"sys.exit"
] | [((2179, 2202), 'xmltodict.parse', 'xmltodict.parse', (['indata'], {}), '(indata)\n', (2194, 2202), False, 'import xmltodict, json\n'), ((2213, 2226), 'json.dumps', 'json.dumps', (['o'], {}), '(o)\n', (2223, 2226), False, 'import xmltodict, json\n'), ((1540, 1599), 'getopt.getopt', 'getopt.getopt', (['args', '"""hvo:""... |
#!/usr/bin/env python
from __future__ import print_function
import libkeepass
import getpass
import sys
import csv
try:
filename = sys.argv[1]
outputfile = sys.argv[2]
except IndexError:
print('keepass2csv.py <kdbx file name> <output csv file name>')
sys.exit(1)
try:
with libkeepass.open(filename,... | [
"getpass.getpass",
"sys.exit",
"csv.DictWriter"
] | [((268, 279), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (276, 279), False, 'import sys\n'), ((1113, 1160), 'csv.DictWriter', 'csv.DictWriter', (['csvfile'], {'fieldnames': 'csv_columns'}), '(csvfile, fieldnames=csv_columns)\n', (1127, 1160), False, 'import csv\n'), ((1371, 1382), 'sys.exit', 'sys.exit', (['(2)'],... |
"""Services for STAC API SQLAlchemy."""
import logging
from .models import db
from .models import APIKey
from .models import Attribute
from .models import CatalogEntry
from .models import Job
LOGGER = logging.getLogger('stac')
def update_api_key(api_key, permission_set):
"""Update (and/or add) an API key and pe... | [
"logging.getLogger"
] | [((203, 228), 'logging.getLogger', 'logging.getLogger', (['"""stac"""'], {}), "('stac')\n", (220, 228), False, 'import logging\n')] |
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Nodes import Node, Nodes
from PLC.Slices import Slice, Slices
from PLC.Auth import Auth
class AddSliceToNodesWhitelist(Method):
"""
Adds the specified slice to the whitelist on the specified nodes. Nodes ... | [
"PLC.Auth.Auth",
"PLC.Slices.Slices",
"PLC.Nodes.Nodes",
"PLC.Parameter.Mixed",
"PLC.Parameter.Parameter"
] | [((737, 770), 'PLC.Parameter.Parameter', 'Parameter', (['int', '"""1 if successful"""'], {}), "(int, '1 if successful')\n", (746, 770), False, 'from PLC.Parameter import Parameter, Mixed\n'), ((547, 553), 'PLC.Auth.Auth', 'Auth', ([], {}), '()\n', (551, 553), False, 'from PLC.Auth import Auth\n'), ((563, 616), 'PLC.Par... |
import argparse
import json
def add_configs():
#
# Add configuration capabilities to a file.
#
parser = argparse.ArgumentParser(description='Configuration arguments provided at run time from the CLI')
parser.add_argument(
'-c',
'--config_file',
dest='config_file',
t... | [
"argparse.Namespace",
"json.load",
"argparse.ArgumentParser"
] | [((122, 223), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Configuration arguments provided at run time from the CLI"""'}), "(description=\n 'Configuration arguments provided at run time from the CLI')\n", (145, 223), False, 'import argparse\n'), ((677, 689), 'json.load', 'json.load... |
from PySide6 import QtGui
from PySide6 import QtCore
from PySide6 import QtWidgets
from PySide6.QtCore import (Property, QSize, Qt, Signal)
from PySide6.QtWidgets import QPushButton
from PySide6.QtGui import QBrush, QPen
import functools
PALETTES = {
'paired12':['#0000FF', '#FF0000']
}
def helper_function(widget,... | [
"functools.partial",
"PySide6.QtCore.QVariantAnimation",
"PySide6.QtGui.QColor",
"PySide6.QtWidgets.QVBoxLayout",
"PySide6.QtGui.QBrush",
"PySide6.QtCore.Property",
"PySide6.QtCore.Signal",
"PySide6.QtCore.QSize",
"PySide6.QtWidgets.QGridLayout",
"PySide6.QtGui.QPen"
] | [((487, 586), 'PySide6.QtCore.QVariantAnimation', 'QtCore.QVariantAnimation', (['widget'], {'duration': 'duration', 'startValue': 'start_color', 'endValue': 'end_color'}), '(widget, duration=duration, startValue=start_color,\n endValue=end_color)\n', (511, 586), False, 'from PySide6 import QtCore\n'), ((1006, 1020),... |
__author__ = '<NAME>'
import string
from nose.tools import nottest, ok_, assert_equal, assert_false, assert_in
from nose.plugins.attrib import attr
from nose_ittr import IttrMultiplier, ittr
class TestMetaClassIttrMultiplayer(object):
def setup(self):
self.test_class_one = test_class_one()
s... | [
"nose_ittr.ittr",
"nose.tools.assert_in",
"nose.plugins.attrib.attr",
"nose.tools.assert_false"
] | [((403, 413), 'nose.plugins.attrib.attr', 'attr', ([], {'id': '(1)'}), '(id=1)\n', (407, 413), False, 'from nose.plugins.attrib import attr\n'), ((906, 916), 'nose.plugins.attrib.attr', 'attr', ([], {'id': '(2)'}), '(id=2)\n', (910, 916), False, 'from nose.plugins.attrib import attr\n'), ((1364, 1374), 'nose.plugins.at... |
from pysam.libchtslib import *
import pysam.ctabix as ctabix
from pysam.ctabix import *
import pysam.csamfile as csamfile
from pysam.csamfile import *
import pysam.calignmentfile as calignmentfile
from pysam.calignmentfile import *
import pysam.cfaidx as cfaidx
from pysam.cfaidx import *
import pysam.cvcf as cvcf
from... | [
"os.path.dirname",
"os.path.join",
"pysam.csamtools._samtools_dispatch"
] | [((1698, 1747), 'pysam.csamtools._samtools_dispatch', 'csamtools._samtools_dispatch', (['self.dispatch', 'args'], {}), '(self.dispatch, args)\n', (1726, 1747), True, 'import pysam.csamtools as csamtools\n'), ((3179, 3222), 'pysam.csamtools._samtools_dispatch', 'csamtools._samtools_dispatch', (['self.dispatch'], {}), '(... |
#!/usr/bin/env python2.5
#
# Copyright 2008 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | [
"django.utils.translation.ugettext",
"google.appengine.ext.db.StringProperty",
"google.appengine.ext.db.ReferenceProperty"
] | [((1930, 1963), 'google.appengine.ext.db.StringProperty', 'db.StringProperty', ([], {'multiline': '(True)'}), '(multiline=True)\n', (1947, 1963), False, 'from google.appengine.ext import db\n'), ((1987, 2099), 'django.utils.translation.ugettext', 'ugettext', (['"""short abstract, summary, or snippet; 500 characters or ... |
#Compile all VOC XML annotation files into a single JSON file (one for each data split)
#Existing folder structure will remain the same
#Coordinates will be zero-indexed. Originally top-left pixel is (1,1)
import os
from glob import glob
import xml.etree.ElementTree as ET
import json
source_root = '$DATA_DIRECTORY/V... | [
"xml.etree.ElementTree.parse",
"json.dump",
"os.path.join"
] | [((483, 544), 'os.path.join', 'os.path.join', (['source_root', "('ImageSets/Main/' + split + '.txt')"], {}), "(source_root, 'ImageSets/Main/' + split + '.txt')\n", (495, 544), False, 'import os\n'), ((558, 600), 'os.path.join', 'os.path.join', (['target_root', "(split + '.json')"], {}), "(target_root, split + '.json')\... |
from __future__ import annotations
from typing import Any
from typing import Generic
from typing import Literal
from typing import Protocol
from typing import TypeVar
from chemex.containers.data import Data
from chemex.nmr.spectrometer import Spectrometer
class NoFilterer:
"""Filterer that does no filtering"""
... | [
"typing.TypeVar"
] | [((1350, 1390), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {'bound': 'CestExperimentConfig'}), "('T', bound=CestExperimentConfig)\n", (1357, 1390), False, 'from typing import TypeVar\n')] |
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
"""Unit tests for sorting.py functions."""
from __future__ import print_function
from __future_... | [
"proto.tracker_pb2.ApprovalValue",
"proto.tracker_pb2.Phase",
"mox.Mox",
"tracker.tracker_bizobj.MakeComponentDef",
"framework.sorting._IndexListAccessor",
"framework.sorting._MakeSingleSortKeyAccessor",
"tracker.tracker_bizobj.MakeFieldDef",
"framework.sorting.DescendingValue",
"tracker.tracker_biz... | [((684, 728), 'framework.sorting._MaybeMakeDescending', 'sorting._MaybeMakeDescending', (['accessor', '(True)'], {}), '(accessor, True)\n', (712, 728), False, 'from framework import sorting\n'), ((804, 813), 'mox.Mox', 'mox.Mox', ([], {}), '()\n', (811, 813), False, 'import mox\n'), ((900, 949), 'tracker.tracker_bizobj... |
import os
from itertools import groupby
from lxml import etree
from typing import List, Tuple
from lxml.etree import Element, SubElement
from muscima.cropobject import CropObject
def create_annotations_in_pascal_voc_format_from_crop_objects(annotations_folder: str,
... | [
"os.makedirs",
"lxml.etree.Element",
"os.path.splitext",
"lxml.etree.SubElement",
"lxml.etree.tostring"
] | [((1663, 1709), 'os.makedirs', 'os.makedirs', (['annotations_folder'], {'exist_ok': '(True)'}), '(annotations_folder, exist_ok=True)\n', (1674, 1709), False, 'import os\n'), ((1728, 1749), 'lxml.etree.Element', 'Element', (['"""annotation"""'], {}), "('annotation')\n", (1735, 1749), False, 'from lxml.etree import Eleme... |
from unittest import TestCase
from unittest.mock import Mock
from Bio.Seq import Seq
from supergsl.core.exception import PartNotFoundError
from supergsl.core.parts.provider import PartProvider, ConstantPartProvider
class PartProviderTestCase(TestCase):
"""Test the `PartProvider` functionality."""
def test_pr... | [
"supergsl.core.parts.provider.ConstantPartProvider",
"unittest.mock.Mock",
"supergsl.core.parts.provider.PartProvider"
] | [((413, 445), 'supergsl.core.parts.provider.PartProvider', 'PartProvider', (['"""BOOMPROVIDER"""', '{}'], {}), "('BOOMPROVIDER', {})\n", (425, 445), False, 'from supergsl.core.parts.provider import PartProvider, ConstantPartProvider\n'), ((665, 671), 'unittest.mock.Mock', 'Mock', ([], {}), '()\n', (669, 671), False, 'f... |
from . import agent
from . import env
from . import model
from . import solver
__all__ = []
__all__.extend(agent.__all__)
__all__.extend(env.__all__)
__all__.extend(model.__all__)
__all__.extend(solver.__all__)
# Dirty patch to avoid annoying warning while creating `gym.spaces`
# without explicitly assigned dtype.
#... | [
"sys.stderr.write",
"types.CodeType"
] | [((2388, 2626), 'types.CodeType', 'CodeType', (['fc.co_argcount', 'fc.co_kwonlyargcount', 'fc.co_nlocals', 'stacksize', 'fc.co_flags', 'payload', 'consts', 'fc.co_names', 'fc.co_varnames', 'fc.co_filename', 'fc.co_name', 'fc.co_firstlineno', 'fc.co_lnotab', 'fc.co_freevars', 'fc.co_cellvars'], {}), '(fc.co_argcount, fc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.