code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from scipy import linalg
import numpy as np
def error_norm(theta_star, theta_hat, norm='frobenius', scaling=True, squared=True):
""" sklearn Graphical LASSO """
# compute the error
error = theta_star - theta_hat
# compute the error norm
if norm == "frobenius":
squared_norm = np.sum(error *... | [
"numpy.dot",
"numpy.sum",
"numpy.sqrt"
] | [((306, 324), 'numpy.sum', 'np.sum', (['(error ** 2)'], {}), '(error ** 2)\n', (312, 324), True, 'import numpy as np\n'), ((769, 790), 'numpy.sqrt', 'np.sqrt', (['squared_norm'], {}), '(squared_norm)\n', (776, 790), True, 'import numpy as np\n'), ((400, 422), 'numpy.dot', 'np.dot', (['error.T', 'error'], {}), '(error.T... |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import logging
import copy
from flexget import plugin
from flexget.config_schema import one_or_more
from flexget.event import event
from flexget.plugin import PluginWarnin... | [
"copy.deepcopy",
"flexget.plugin.get_plugin_by_name",
"flexget.event.event",
"flexget.plugin.register",
"flexget.config_schema.one_or_more",
"flexget.utils.template.get_template",
"logging.getLogger"
] | [((390, 417), 'logging.getLogger', 'logging.getLogger', (['"""notify"""'], {}), "('notify')\n", (407, 417), False, 'import logging\n'), ((8713, 8737), 'flexget.event.event', 'event', (['"""plugin.register"""'], {}), "('plugin.register')\n", (8718, 8737), False, 'from flexget.event import event\n'), ((2030, 2062), 'copy... |
"""
Map variants:
DEVEL -> Does not contain most unit object data. Contains only necessary pre-placed doodads. Saves the fastest in the Editor.
-> Used when editing script files.
-> Loads quickly in WC3. Great for testing script changes.
DEVELOPMENT -> Does not co... | [
"os.mkdir",
"os.path.abspath",
"_scripts.makedevel.do",
"shutil.rmtree",
"os.path.dirname",
"os.path.exists",
"shutil.copyfile",
"shutil.copytree",
"configparser.ConfigParser",
"os.path.join"
] | [((8049, 8115), '_scripts.makedevel.do', 'makedevel.do', (['"""development/table/unit.ini"""', '"""devel/table/unit.ini"""'], {}), "('development/table/unit.ini', 'devel/table/unit.ini')\n", (8061, 8115), False, 'from _scripts import makedevel\n'), ((8120, 8194), 'shutil.copyfile', 'shutil.copyfile', (['"""_scripts/dev... |
import os
import sys
import argparse
import logging
import service
import toolbox
import riscv.constants
def do_tick(service, state, results, events):
for pc in map(lambda w: w.get('data'), filter(lambda x: x and '%pc' == x.get('name'), map(lambda y: y.get('register'), results))):
if 0 == int.from_bytes(... | [
"service.tx",
"os.path.basename",
"argparse.ArgumentParser",
"toolbox.report_stats"
] | [((4745, 4815), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""μService-SIMulator: Simple Core"""'}), "(description='μService-SIMulator: Simple Core')\n", (4768, 4815), False, 'import argparse\n'), ((1070, 1125), 'toolbox.report_stats', 'toolbox.report_stats', (['service', 'state', '"""f... |
"""
Script that trains Tensorflow multitask models on PCBA dataset.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import numpy as np
import shutil
from pcba_datasets import load_pcba
from deepchem.utils.save import load_from_disk
from deepch... | [
"pcba_datasets.load_pcba",
"deepchem.utils.evaluate.Evaluator",
"numpy.random.seed",
"deepchem.metrics.Metric"
] | [((577, 596), 'numpy.random.seed', 'np.random.seed', (['(123)'], {}), '(123)\n', (591, 596), True, 'import numpy as np\n'), ((640, 651), 'pcba_datasets.load_pcba', 'load_pcba', ([], {}), '()\n', (649, 651), False, 'from pcba_datasets import load_pcba\n'), ((723, 784), 'deepchem.metrics.Metric', 'Metric', (['metrics.roc... |
import matplotlib.pyplot as plt
import pathlib
from tqdm import tqdm
def set_theme(name):
if name == 'normal':
return
elif name == 'xkcd':
plt.xkcd()
return
plt.style.use(name)
def get_filepath(filename, dirpath=None):
if dirpath is None:
dirpath = pathlib.Path.cwd()
... | [
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.figure",
"pathlib.Path",
"pathlib.Path.cwd",
"matplotlib.pyplot.get_fignums",
"matplotlib.pyplot.xkcd"
] | [((195, 214), 'matplotlib.pyplot.style.use', 'plt.style.use', (['name'], {}), '(name)\n', (208, 214), True, 'import matplotlib.pyplot as plt\n'), ((920, 937), 'matplotlib.pyplot.get_fignums', 'plt.get_fignums', ([], {}), '()\n', (935, 937), True, 'import matplotlib.pyplot as plt\n'), ((300, 318), 'pathlib.Path.cwd', 'p... |
# Funções padrões
def título(txt):
print(f'\033[1;34;40m{txt.upper()}\033[m')
def linha(tipo, cor, tamanho):
print(f'\033[{cor}m{tipo}\033[m' * tamanho)
# Importação de bibliotecas
from datetime import date
# Título do programa
título('funções para votação')
# Objetos
# Funções
def voto(nasc):
idade ... | [
"datetime.date.today"
] | [((322, 334), 'datetime.date.today', 'date.today', ([], {}), '()\n', (332, 334), False, 'from datetime import date\n')] |
import numpy as np
import pandas as pd
def table_atm(h, parametr):
"""
Cтандартная атмосфера для высот h = -2000 м ... 80000 м (ГОСТ 4401-81)
arguments: h высота [м], parametr:
1 - температура [К];
2 - давление [Па];
3 -... | [
"pandas.read_csv",
"numpy.interp",
"numpy.sqrt"
] | [((611, 697), 'pandas.read_csv', 'pd.read_csv', (['"""data_constants/table_atm.csv"""'], {'names': "['h', 'p', 'rho', 'T']", 'sep': '""","""'}), "('data_constants/table_atm.csv', names=['h', 'p', 'rho', 'T'],\n sep=',')\n", (622, 697), True, 'import pandas as pd\n'), ((1934, 2008), 'pandas.read_csv', 'pd.read_csv', ... |
"""Contain logging implementation."""
import logging
from logging.handlers import RotatingFileHandler
import pathlib
def logger() -> logging.getLogger:
"""Create logger."""
filename = str(pathlib.Path(__file__).parent.parent / "water_scheduler.log")
log = logging.getLogger("water_scheduler")
log.setL... | [
"logging.Formatter",
"pathlib.Path",
"logging.handlers.RotatingFileHandler",
"logging.getLogger"
] | [((271, 307), 'logging.getLogger', 'logging.getLogger', (['"""water_scheduler"""'], {}), "('water_scheduler')\n", (288, 307), False, 'import logging\n'), ((358, 446), 'logging.handlers.RotatingFileHandler', 'RotatingFileHandler', ([], {'filename': 'filename', 'delay': '(True)', 'backupCount': '(1)', 'maxBytes': '(20000... |
# coding: utf-8
"""
Created on 2016-08-23
@author: naoey
"""
import logging
import logging.config # find out why this is necessary when logging already imported
import discord
import time
import datetime
import os
import sys
import json
import importlib
import threading
from functools import partial
import config
... | [
"functools.partial",
"threading.Timer",
"json.load",
"logging.error",
"logging.exception",
"models.Server.get",
"config.STATS.serialise",
"models.Server.get_or_create",
"time.time",
"logging.info",
"discord.Game",
"discord.opus.load_opus",
"logging.config.dictConfig",
"config.MODULES.items... | [((1412, 1449), 'logging.config.dictConfig', 'logging.config.dictConfig', (['LOG_CONFIG'], {}), '(LOG_CONFIG)\n', (1437, 1449), False, 'import logging\n'), ((16360, 16397), 'logging.info', 'logging.info', (['"""Initialising SlashBot"""'], {}), "('Initialising SlashBot')\n", (16372, 16397), False, 'import logging\n'), (... |
from tensorflow.keras import models
import numpy as np
# for using PIL, we have to add "Pillow" to requirements.txt
from PIL import Image
import io
from flask import jsonify, make_response
import json
import base64
import cv2 as cv
from google.cloud import storage
# Xception Fine Tuning モデルを読み込む( Global variable として定義... | [
"tensorflow.keras.models.load_model",
"numpy.argmax",
"cv2.imdecode",
"numpy.expand_dims",
"json.dumps",
"google.cloud.storage.Client",
"numpy.array",
"numpy.fromstring"
] | [((409, 425), 'google.cloud.storage.Client', 'storage.Client', ([], {}), '()\n', (423, 425), False, 'from google.cloud import storage\n'), ((622, 656), 'tensorflow.keras.models.load_model', 'models.load_model', (['"""/tmp/tmp.hdf5"""'], {}), "('/tmp/tmp.hdf5')\n", (639, 656), False, 'from tensorflow.keras import models... |
import io
import json
import os
import unittest
import yaml
from aws_cdk import core
from moto import mock_stepfunctions
from stepfunctions.steps.states import Parallel
from stepfunctions.steps.states import Task
from datajob.datajob_stack import DataJobStack
from datajob.stepfunctions import stepfunctions_workflow
f... | [
"datajob.datajob_stack.DataJobStack",
"io.StringIO",
"yaml.load",
"stepfunctions.steps.states.Task",
"aws_cdk.core.App",
"datajob.stepfunctions.stepfunctions_workflow.StepfunctionsWorkflow"
] | [((560, 586), 'stepfunctions.steps.states.Task', 'Task', ([], {'state_id': 'unique_name'}), '(state_id=unique_name)\n', (564, 586), False, 'from stepfunctions.steps.states import Task\n'), ((1022, 1032), 'aws_cdk.core.App', 'core.App', ([], {}), '()\n', (1030, 1032), False, 'from aws_cdk import core\n'), ((1499, 1641),... |
import unittest
from django.conf import settings
from django_inlines.inlines import Registry, parse_inline, InlineUnparsableError
from core.tests.test_inlines import DoubleInline, QuineInline, KeyErrorInline
class ParserTestCase(unittest.TestCase):
def testParser(self):
OUT = ('simple', '', {})
se... | [
"django_inlines.inlines.parse_inline",
"django_inlines.inlines.Registry"
] | [((1779, 1789), 'django_inlines.inlines.Registry', 'Registry', ([], {}), '()\n', (1787, 1789), False, 'from django_inlines.inlines import Registry, parse_inline, InlineUnparsableError\n'), ((2398, 2408), 'django_inlines.inlines.Registry', 'Registry', ([], {}), '()\n', (2406, 2408), False, 'from django_inlines.inlines i... |
from typing import Optional
from pydantic import BaseModel, EmailStr, Field
class ReviewSchema(BaseModel):
review_id: str = Field(...)
user: str = Field(...)
text: int = Field(...)
rating: float = Field(..., ge=0, le=5)
sentiment: str = Field(...)
date: str = Field(...)
business: str = Fie... | [
"pydantic.Field"
] | [((130, 140), 'pydantic.Field', 'Field', (['...'], {}), '(...)\n', (135, 140), False, 'from pydantic import BaseModel, EmailStr, Field\n'), ((157, 167), 'pydantic.Field', 'Field', (['...'], {}), '(...)\n', (162, 167), False, 'from pydantic import BaseModel, EmailStr, Field\n'), ((184, 194), 'pydantic.Field', 'Field', (... |
import os
import unittest
import sys
sys.path.insert(0, os.path.abspath('.'))
from pageobject import PageObject
from pageobject import PageObjectList
class PageObjectTests(unittest.TestCase):
def test_PO_len_returns_number_of_children(self):
root_po = PageObject('')
root_po.nested_po = PageObje... | [
"unittest.main",
"pageobject.PageObject",
"os.path.abspath"
] | [((57, 77), 'os.path.abspath', 'os.path.abspath', (['"""."""'], {}), "('.')\n", (72, 77), False, 'import os\n'), ((1610, 1625), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1623, 1625), False, 'import unittest\n'), ((269, 283), 'pageobject.PageObject', 'PageObject', (['""""""'], {}), "('')\n", (279, 283), False... |
import contextlib
import uuid
from datetime import timedelta
from bgjobs.models import BackgroundJob, JobModelMessageMixin, LOG_LEVEL_DEBUG
from django.conf import settings
from django.db.models import JSONField
from django.db import models, transaction
from django.urls import reverse
from django.utils import timezone... | [
"django.db.models.TextField",
"django.db.models.UUIDField",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.utils.timezone.now",
"django.utils.timezone.localtime",
"django.db.models.JSONField",
"django.db.models.Q",
"django.urls.reverse",
"django.db.models.IntegerField",
"da... | [((5224, 5312), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)', 'help_text': '"""DateTime of container creation"""'}), "(auto_now_add=True, help_text=\n 'DateTime of container creation')\n", (5244, 5312), False, 'from django.db import models, transaction\n'), ((5391, 5484), ... |
import sys
from os import path
sys.path.insert(0, path.join(path.dirname(path.dirname(__file__)), 'src'))
import scrape_sic_sec
import scrape_sic_osha
path_test = path.dirname(path.abspath(__file__))
| [
"os.path.abspath",
"os.path.dirname"
] | [((177, 199), 'os.path.abspath', 'path.abspath', (['__file__'], {}), '(__file__)\n', (189, 199), False, 'from os import path\n'), ((73, 95), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (85, 95), False, 'from os import path\n')] |
from io import BytesIO
import json
import sqlite3
import time
from typing import Any, Dict, Iterable, NamedTuple, Optional, List, Sequence, Tuple
import bitcoinx
from bitcoinx import hash_to_hex_str
from ..constants import (TxFlags, ScriptType, DerivationType, TransactionOutputFlag,
KeyInstanceFlag, PaymentState)... | [
"io.BytesIO",
"bitcoinx.read_varint",
"bitcoinx.hash_to_hex_str",
"json.loads",
"json.dumps",
"time.time",
"bitcoinx.pack_varbytes",
"bitcoinx.pack_varint",
"bitcoinx.read_varbytes"
] | [((10912, 10935), 'bitcoinx.pack_varint', 'bitcoinx.pack_varint', (['(1)'], {}), '(1)\n', (10932, 10935), False, 'import bitcoinx\n'), ((10951, 10987), 'bitcoinx.pack_varint', 'bitcoinx.pack_varint', (['proof.position'], {}), '(proof.position)\n', (10971, 10987), False, 'import bitcoinx\n'), ((11222, 11234), 'io.BytesI... |
import os
import redis
from flask import render_template_string
def load(app):
# If we're not using redis, then you probably messed up
if not app.config.get('CACHE_REDIS_URL'):
print('WARNING!!! Not using Redis. Try setting the REDIS_URL environment variable')
redis_host = None
redis_p... | [
"redis.Redis",
"os.path.realpath",
"os.path.join",
"flask.render_template_string"
] | [((499, 535), 'os.path.join', 'os.path.join', (['dir_path', '"""redis.html"""'], {}), "(dir_path, 'redis.html')\n", (511, 535), False, 'import os\n'), ((451, 477), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (467, 477), False, 'import os\n'), ((1293, 1361), 'flask.render_template_string'... |
from argparse import ArgumentParser
from blockchain import Blockchain
from server import Server
from wallet import Wallet
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("-p", "--port", default=5000, type=int, help="port to listen on")
args = parser.parse_args()
port = args.po... | [
"wallet.Wallet",
"blockchain.Blockchain",
"server.Server",
"argparse.ArgumentParser"
] | [((164, 180), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (178, 180), False, 'from argparse import ArgumentParser\n'), ((341, 353), 'blockchain.Blockchain', 'Blockchain', ([], {}), '()\n', (351, 353), False, 'from blockchain import Blockchain\n'), ((367, 375), 'wallet.Wallet', 'Wallet', ([], {}), '()... |
import smtplib
import threading
import pynput
log=""
def callback_function(key):
global log
try:
log=log+key.char.encode("utf-8")
except AttributeError:
if key == key.space:
log=log + " "
else:
log=log+str(key)
print(log)
def send_ema... | [
"threading.Timer",
"smtplib.SMTP",
"pynput.keyboard.Listener"
] | [((752, 804), 'pynput.keyboard.Listener', 'pynput.keyboard.Listener', ([], {'on_press': 'callback_function'}), '(on_press=callback_function)\n', (776, 804), False, 'import pynput\n'), ((366, 401), 'smtplib.SMTP', 'smtplib.SMTP', (['"""smtp.gmail.com"""', '(587)'], {}), "('smtp.gmail.com', 587)\n", (378, 401), False, 'i... |
import sys, os
sys.path.append(os.path.abspath(__file__).split('test')[0])
import pandas as pd
import numpy as np
from pyml.supervised.linear_regression.LinearRegression import LinearRegression
"""
----------------------------------------------------------------------------------------------------------------------... | [
"numpy.matrix",
"os.path.abspath",
"numpy.concatenate",
"numpy.ravel",
"pandas.read_csv",
"pandas.get_dummies",
"numpy.ones",
"pyml.supervised.linear_regression.LinearRegression.LinearRegression"
] | [((894, 957), 'pandas.read_csv', 'pd.read_csv', (['"""../../../data/ex1data1.txt"""'], {'sep': '""","""', 'header': 'None'}), "('../../../data/ex1data1.txt', sep=',', header=None)\n", (905, 957), True, 'import pandas as pd\n'), ((2303, 2333), 'pyml.supervised.linear_regression.LinearRegression.LinearRegression', 'Linea... |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of... | [
"primaires.interpreteur.editeur.presentation.Presentation.__init__",
"primaires.interpreteur.editeur.presentation.Presentation.fermer"
] | [((2853, 2911), 'primaires.interpreteur.editeur.presentation.Presentation.__init__', 'Presentation.__init__', (['self', 'instance_connexion', 'prototype'], {}), '(self, instance_connexion, prototype)\n', (2874, 2911), False, 'from primaires.interpreteur.editeur.presentation import Presentation\n'), ((10841, 10866), 'pr... |
from rest_framework import routers
from app import viewsets
router = routers.SimpleRouter()
| [
"rest_framework.routers.SimpleRouter"
] | [((70, 92), 'rest_framework.routers.SimpleRouter', 'routers.SimpleRouter', ([], {}), '()\n', (90, 92), False, 'from rest_framework import routers\n')] |
import unittest
import sys
sys.path.append('..')
from scipy.stats import hypergeom, fisher_exact
import numpy as np
from server.from_uniprot_get_go import create_all_go_map
from server.go_processing import process_ontology
from server.add_go_from_higherup import enrich_cnag_map
from server.cnag_list_to_go import find... | [
"sys.path.append",
"unittest.main",
"server.go_processing.process_ontology",
"numpy.array",
"server.add_go_from_higherup.enrich_cnag_map",
"server.from_uniprot_get_go.create_all_go_map"
] | [((28, 49), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (43, 49), False, 'import sys\n'), ((4986, 5001), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4999, 5001), False, 'import unittest\n'), ((576, 645), 'server.from_uniprot_get_go.create_all_go_map', 'create_all_go_map', (['"""test/t... |
import types
import pytest
from plenum.test.helper import checkViewNoForNodes, \
sdk_send_random_and_check, countDiscarded
from plenum.test.malicious_behaviors_node import slow_primary
from plenum.test.test_node import getPrimaryReplica, ensureElectionsDone
from plenum.test.view_change.helper import provoke_and_w... | [
"plenum.test.malicious_behaviors_node.slow_primary",
"plenum.test.test_node.getPrimaryReplica",
"plenum.test.view_change.helper.ensure_view_change",
"stp_core.common.log.getlogger",
"plenum.test.test_node.ensureElectionsDone",
"plenum.test.helper.sdk_send_random_and_check"
] | [((413, 424), 'stp_core.common.log.getlogger', 'getlogger', ([], {}), '()\n', (422, 424), False, 'from stp_core.common.log import getlogger\n'), ((802, 843), 'plenum.test.malicious_behaviors_node.slow_primary', 'slow_primary', (['txnPoolNodeSet', '(0)'], {'delay': '(10)'}), '(txnPoolNodeSet, 0, delay=10)\n', (814, 843)... |
"""
Test the CONMIN optimizer component
"""
import unittest
import numpy
# pylint: disable=F0401,E0611
from openmdao.main.api import Assembly, Component, VariableTree, set_as_top, Driver
from openmdao.main.datatypes.api import Float, Array, Str, VarTree
from openmdao.lib.casehandlers.api import ListCaseRecorder
from ... | [
"unittest.main",
"openmdao.main.api.Assembly",
"openmdao.main.datatypes.api.Str",
"openmdao.util.testutil.assert_rel_error",
"openmdao.main.interfaces.implements",
"openmdao.main.datatypes.api.Float",
"openmdao.util.decorators.add_delegate",
"openmdao.main.datatypes.api.Array",
"numpy.array",
"ope... | [((1529, 1565), 'openmdao.main.datatypes.api.Array', 'Array', ([], {'iotype': '"""in"""', 'low': '(-10)', 'high': '(99)'}), "(iotype='in', low=-10, high=99)\n", (1534, 1565), False, 'from openmdao.main.datatypes.api import Float, Array, Str, VarTree\n'), ((1574, 1610), 'openmdao.main.datatypes.api.Array', 'Array', (['[... |
import unittest
import sys
sys.path.append('./')
solutions = __import__('solutions.022_generate_parentheses', fromlist='*')
class Test022(unittest.TestCase):
def test_generateParenthesis(self):
s = solutions.Solution()
self.assertEqual(s.generateParenthesis(0), [])
self.assertEqual(s.gen... | [
"sys.path.append",
"unittest.main"
] | [((27, 48), 'sys.path.append', 'sys.path.append', (['"""./"""'], {}), "('./')\n", (42, 48), False, 'import sys\n'), ((554, 569), 'unittest.main', 'unittest.main', ([], {}), '()\n', (567, 569), False, 'import unittest\n')] |
import uuid
from datetime import timedelta
from random import choice, randint
from unittest import mock
from puppy_interactions.interactions.help_message import HELP_MESSAGE
from django.test import TestCase, Client
from django.urls import reverse_lazy
from django.utils import timezone
from puppy_interactions.interact... | [
"puppy_interactions.interactions.models.Interaction.objects.count",
"uuid.uuid4",
"random.randint",
"django.test.Client",
"django.utils.timezone.now",
"django.urls.reverse_lazy",
"puppy_interactions.interactions.models.Person.objects.bulk_create",
"puppy_interactions.interactions.models.Interaction.ob... | [((962, 970), 'django.test.Client', 'Client', ([], {}), '()\n', (968, 970), False, 'from django.test import TestCase, Client\n'), ((1024, 1065), 'puppy_interactions.interactions.models.Person.objects.create', 'Person.objects.create', ([], {'user_id': '"""R2385729"""'}), "(user_id='R2385729')\n", (1045, 1065), False, 'f... |
# Author: <NAME> <<EMAIL>>
import pytest
from eelbrain._experiment import test_def
from eelbrain._experiment.definitions import DefinitionError, find_dependent_epochs, find_epoch_vars, find_epochs_vars
def test_find_epoch_vars():
assert find_epoch_vars({'sel': "myvar == 'x'"}) == {'myvar'}
assert find_epoch_... | [
"eelbrain._experiment.test_def.TTestRelated",
"eelbrain._experiment.definitions.find_epochs_vars",
"eelbrain._experiment.definitions.find_dependent_epochs",
"eelbrain._experiment.definitions.find_epoch_vars",
"eelbrain._experiment.test_def.TwoStageTest",
"pytest.raises",
"eelbrain._experiment.test_def.T... | [((1205, 1241), 'eelbrain._experiment.test_def.TTestRelated', 'test_def.TTestRelated', (['"""A"""', '"""a"""', '"""b"""'], {}), "('A', 'a', 'b')\n", (1226, 1241), False, 'from eelbrain._experiment import test_def\n'), ((1317, 1361), 'eelbrain._experiment.test_def.TTestIndependent', 'test_def.TTestIndependent', (['"""gr... |
#SELF DESTRUCTIVE WEBSPLOIT Installer for Termux v0.1
#Created by @voldemort1912 (GitHub)
#@hewhomustn0tbenamed (Telegram)
#Created on 20/02/2019 10:52 IST
#imports
import os
import sys
import subprocess
from time import sleep
from queue import Queue
from os.path import exists
from subprocess import Popen
from thre... | [
"threading.Thread",
"os.remove",
"subprocess.Popen",
"os.getcwd",
"threading.RLock",
"os.path.exists",
"os.system",
"time.sleep",
"queue.Queue"
] | [((377, 403), 'os.system', 'os.system', (['"""pkg update -y"""'], {}), "('pkg update -y')\n", (386, 403), False, 'import os\n'), ((404, 431), 'os.system', 'os.system', (['"""pkg upgrade -y"""'], {}), "('pkg upgrade -y')\n", (413, 431), False, 'import os\n'), ((2646, 2684), 'os.system', 'os.system', (['"""pip install --... |
# _SequenceGenerator.py
__module_name__ = "_SequenceGenerator.py"
__author__ = ", ".join(["<NAME>"])
__email__ = ", ".join(["<EMAIL>",])
# package imports #
# --------------- #
import numpy as np
def _set_weight_simplex(A=1, C=1, G=1, T=1):
"""
Change the composition of weights for sampling bases at r... | [
"numpy.array",
"numpy.random.choice"
] | [((653, 675), 'numpy.array', 'np.array', (['[A, C, G, T]'], {}), '([A, C, G, T])\n', (661, 675), True, 'import numpy as np\n'), ((1359, 1389), 'numpy.array', 'np.array', (["['A', 'C', 'G', 'T']"], {}), "(['A', 'C', 'G', 'T'])\n", (1367, 1389), True, 'import numpy as np\n'), ((2134, 2187), 'numpy.random.choice', 'np.ran... |
#!/usr/bin/env python
import sys
import argparse
import matplotlib
import numpy as np
import pandas as pd
matplotlib.use('Agg')
from pathlib import Path
import matplotlib.pyplot as plt
def get_ase(ase_fname):
"""parse the ASE TSV for the top n most promising str-tissue pairs"""
ase = pd.read_csv(
ase... | [
"numpy.poly1d",
"argparse.ArgumentParser",
"numpy.polyfit",
"pandas.read_csv",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.clf",
"numpy.var",
"matplotlib.pyplot.figure",
"matplotlib.use",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pypl... | [((106, 127), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (120, 127), False, 'import matplotlib\n'), ((296, 508), 'pandas.read_csv', 'pd.read_csv', (['ase_fname'], {'sep': '"""\t"""', 'header': '(0)', 'index_col': "['str', 'tissue']", 'usecols': "['str', 'tissue', 'chrom', 'str_pos', 'str_a1',... |
import json
import os
TRAIN_SCRIPT_TEMPLATE = "python transformers/examples/language-modeling/run_language_modeling.py --model_type gpt2 --tokenizer_name model-configs/{0}-config --config_name model-configs/{0}-config/config.json --train_data_file ../data/wikitext-103-raw/wiki.train.raw --eval_data_file ../data/wikit... | [
"os.path.isdir",
"os.mkdir"
] | [((8230, 8260), 'os.path.isdir', 'os.path.isdir', (['"""train-scripts"""'], {}), "('train-scripts')\n", (8243, 8260), False, 'import os\n'), ((8270, 8295), 'os.mkdir', 'os.mkdir', (['"""train-scripts"""'], {}), "('train-scripts')\n", (8278, 8295), False, 'import os\n'), ((8307, 8336), 'os.path.isdir', 'os.path.isdir', ... |
from typing import Union, List, Optional
from pyspark.sql.types import StructType, StructField, StringType, ArrayType, DataType
# This file is auto-generated by generate_schema so do not edit it manually
# noinspection PyPep8Naming
class ContractSchema:
"""
Legally enforceable, formally recorded unilateral o... | [
"pyspark.sql.types.StringType",
"spark_fhir_schemas.r4.complex_types.meta.MetaSchema.get_schema",
"spark_fhir_schemas.r4.complex_types.codeableconcept.CodeableConceptSchema.get_schema",
"spark_fhir_schemas.r4.complex_types.resourcelist.ResourceListSchema.get_schema",
"spark_fhir_schemas.r4.complex_types.per... | [((13634, 13646), 'pyspark.sql.types.StringType', 'StringType', ([], {}), '()\n', (13644, 13646), False, 'from pyspark.sql.types import StructType, StructField, StringType, ArrayType, DataType\n'), ((13876, 14262), 'spark_fhir_schemas.r4.simple_types.id.idSchema.get_schema', 'idSchema.get_schema', ([], {'max_nesting_de... |
from django import forms
from django.forms import ModelForm
from .models import *
class QuestionCommentCreateForm(ModelForm):
question = forms.CharField(required=True, max_length=50, widget=forms.HiddenInput())
class Meta:
model = QuestionComment
fields = ['question','text']
class AnswerCommen... | [
"django.forms.HiddenInput",
"django.forms.TextInput"
] | [((195, 214), 'django.forms.HiddenInput', 'forms.HiddenInput', ([], {}), '()\n', (212, 214), False, 'from django import forms\n'), ((410, 429), 'django.forms.HiddenInput', 'forms.HiddenInput', ([], {}), '()\n', (427, 429), False, 'from django import forms\n'), ((616, 635), 'django.forms.HiddenInput', 'forms.HiddenInput... |
# -*- coding: utf-8 -*-
import unittest
from src.graph import Graph
class TestGraph(unittest.TestCase):
def test_split_edge_with_value(self):
edge = (1,2,3)
g = Graph()
(tail, head, value) = g.split_edge(edge)
self.assertEqual(tail, 1)
self.assertEqual(head, 2)
... | [
"src.graph.Graph"
] | [((186, 193), 'src.graph.Graph', 'Graph', ([], {}), '()\n', (191, 193), False, 'from src.graph import Graph\n'), ((426, 433), 'src.graph.Graph', 'Graph', ([], {}), '()\n', (431, 433), False, 'from src.graph import Graph\n'), ((634, 641), 'src.graph.Graph', 'Graph', ([], {}), '()\n', (639, 641), False, 'from src.graph i... |
from tests.port_tests.hints import (PortedGeometryCategory,
PortedPoint,
PortedPointsList,
PortedSegment,
PortedSegmentsList,
PortedSourceCa... | [
"tests.utils.enum_to_values",
"tests.port_tests.hints.PortedPoint"
] | [((481, 519), 'tests.utils.enum_to_values', 'enum_to_values', (['PortedGeometryCategory'], {}), '(PortedGeometryCategory)\n', (495, 519), False, 'from tests.utils import RawMultipoint, RawMultisegment, enum_to_values\n'), ((547, 583), 'tests.utils.enum_to_values', 'enum_to_values', (['PortedSourceCategory'], {}), '(Por... |
import csv
import datetime
from pathlib import Path
import trade_record
from openpyxl import Workbook
import daily_settlement
import common
import position_stock
downloads_path = str(Path.home() / "Downloads")
class Sheet:
def __init__(self, sheet_name: str):
self.sheet_name = sheet_name
self... | [
"pathlib.Path.home",
"csv.writer",
"openpyxl.Workbook",
"datetime.datetime.today",
"datetime.timedelta",
"position_stock.get_position_stock",
"daily_settlement.get_daily_settlement"
] | [((706, 716), 'openpyxl.Workbook', 'Workbook', ([], {}), '()\n', (714, 716), False, 'from openpyxl import Workbook\n'), ((1211, 1221), 'openpyxl.Workbook', 'Workbook', ([], {}), '()\n', (1219, 1221), False, 'from openpyxl import Workbook\n'), ((2541, 2576), 'position_stock.get_position_stock', 'position_stock.get_posit... |
# We publish the code under MIT license as it is the most permissible license we have managed to find and because Free Software Foundation **does not recommend** using informal licenses like "Do whatever you want" (https://www.gnu.org/licenses/license-list.en.html#informal).
#
# However, our knowledge in the area of li... | [
"ortools.constraint_solver.pywrapcp.RoutingModel",
"ortools.constraint_solver.pywrapcp.DefaultRoutingSearchParameters",
"prepare_data.prepare_data",
"math.ceil"
] | [((2346, 2404), 'math.ceil', 'math.ceil', (['(60 / STOP_TIME_MIN * OPERATING_DAY_LENGTH_HOURS)'], {}), '(60 / STOP_TIME_MIN * OPERATING_DAY_LENGTH_HOURS)\n', (2355, 2404), False, 'import math\n'), ((2478, 2513), 'math.ceil', 'math.ceil', (['(200000 / DRONES_CAPACITY)'], {}), '(200000 / DRONES_CAPACITY)\n', (2487, 2513)... |
from pprint import pprint
from dml import delete, insert, select, update
insert('Regis', '98989898', '<EMAIL>')
insert('Fabricio', '98989898', '<EMAIL>')
insert('Mazinho', '98989898', '<EMAIL>')
update('Fabricião', '<EMAIL>')
delete('<EMAIL>')
pprint(select('phone', '98989898'))
| [
"dml.delete",
"dml.update",
"dml.insert",
"dml.select"
] | [((75, 113), 'dml.insert', 'insert', (['"""Regis"""', '"""98989898"""', '"""<EMAIL>"""'], {}), "('Regis', '98989898', '<EMAIL>')\n", (81, 113), False, 'from dml import delete, insert, select, update\n'), ((114, 155), 'dml.insert', 'insert', (['"""Fabricio"""', '"""98989898"""', '"""<EMAIL>"""'], {}), "('Fabricio', '989... |
import datetime
from flask_restful import Resource, reqparse
from flask import jsonify
from resources.models.Artist import Artist
from resources.models.Track import Track
from resources.models.Release import Release
from resources.models.ReleaseMedia import ReleaseMedia
from sqlalchemy.orm import sessionmaker
from sqla... | [
"sqlalchemy.sql.text",
"sqlalchemy.sql.func.count",
"flask_restful.reqparse.RequestParser",
"sqlalchemy.sql.func.sum",
"datetime.timedelta"
] | [((649, 673), 'flask_restful.reqparse.RequestParser', 'reqparse.RequestParser', ([], {}), '()\n', (671, 673), False, 'from flask_restful import Resource, reqparse\n'), ((1674, 2016), 'sqlalchemy.sql.text', 'text', (['("lower(release.title) = \'" + name + "\' " +\n "OR lower(release.title) LIKE \'%" + name + "%\' " +... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import boto3
class Creator(object):
def __init__(self):
super().__init__()
self._ec2 = boto3.client('ec2')
self._cloudwatch = boto3.client('cloudwatch')
def _create_vpc(self, name, cidr, creator):
vpc = self._ec2... | [
"boto3.client"
] | [((174, 193), 'boto3.client', 'boto3.client', (['"""ec2"""'], {}), "('ec2')\n", (186, 193), False, 'import boto3\n'), ((221, 247), 'boto3.client', 'boto3.client', (['"""cloudwatch"""'], {}), "('cloudwatch')\n", (233, 247), False, 'import boto3\n')] |
import click
import sys
import twisted.python.filepath as fp
import os
from .Deconstructor import RipTokens
@click.command(name="TokenGenerator.Deconstructor")
@click.argument("input-path", nargs=-1)
@click.argument("output-path", is_eager=True)
def makeTokens(input_path, output_path):
inps = []
for ip in inpu... | [
"click.argument",
"twisted.python.filepath.FilePath",
"click.command"
] | [((110, 160), 'click.command', 'click.command', ([], {'name': '"""TokenGenerator.Deconstructor"""'}), "(name='TokenGenerator.Deconstructor')\n", (123, 160), False, 'import click\n'), ((162, 200), 'click.argument', 'click.argument', (['"""input-path"""'], {'nargs': '(-1)'}), "('input-path', nargs=-1)\n", (176, 200), Fal... |
# -*- coding: UTF-8 -*-
# Copyright 2014-2015 <NAME>
# License: BSD (see file COPYING for details)
from __future__ import print_function
from __future__ import unicode_literals
import logging
logger = logging.getLogger(__name__)
import datetime
from unipath import Path
from lino.api import rt
TICKETS = """
#1 [cl... | [
"logging.getLogger",
"unipath.Path"
] | [((203, 230), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (220, 230), False, 'import logging\n'), ((6118, 6137), 'unipath.Path', 'Path', (['lino.__file__'], {}), '(lino.__file__)\n', (6122, 6137), False, 'from unipath import Path\n')] |
#!/usr/bin/env python
import jinja2
import sys
import os
import subprocess
commitHash = subprocess.check_output(['git','rev-parse', 'HEAD']).decode('utf-8')[:-1]
templateLoader = jinja2.FileSystemLoader(searchpath="./")
templateEnv = jinja2.Environment(loader=templateLoader)
templates = [
"advisor/index.html",
... | [
"jinja2.FileSystemLoader",
"subprocess.check_output",
"os.path.dirname",
"jinja2.Environment"
] | [((180, 220), 'jinja2.FileSystemLoader', 'jinja2.FileSystemLoader', ([], {'searchpath': '"""./"""'}), "(searchpath='./')\n", (203, 220), False, 'import jinja2\n'), ((235, 276), 'jinja2.Environment', 'jinja2.Environment', ([], {'loader': 'templateLoader'}), '(loader=templateLoader)\n', (253, 276), False, 'import jinja2\... |
import setuptools
from setuptools import setup
#from manafa._version import __version__
with open("README.md", "r", encoding='utf-8') as fh:
long_description = fh.read()
setup(
name='manafa',
description='E-MANAFA: Energy Monitor and ANAlyzer For Android',
long_description=long_description,
long_d... | [
"setuptools.find_packages"
] | [((486, 512), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (510, 512), False, 'import setuptools\n')] |
import setuptools
setuptools.setup(
name="bump_release",
version="0.0.1",
)
| [
"setuptools.setup"
] | [((19, 73), 'setuptools.setup', 'setuptools.setup', ([], {'name': '"""bump_release"""', 'version': '"""0.0.1"""'}), "(name='bump_release', version='0.0.1')\n", (35, 73), False, 'import setuptools\n')] |
#!/Users/craigmclean/miniconda3/bin/python3
import requests
import json
import re
## python3 script used to gather information to link agencies and AID numbers
endpoint = "https://api.usaspending.gov/api/v2/references/agency/"
## outer for loop - used to enter different agency codes to api
for i in list(range(0,15... | [
"re.search"
] | [((750, 792), 're.search', 're.search', (['"""{"results":{}}"""', 'response.text'], {}), '(\'{"results":{}}\', response.text)\n', (759, 792), False, 'import re\n')] |
#!/usr/bin/env python
#coding:utf-8
import tensorflow as tf
import numpy as np
from tensorflow.examples.tutorials.mnist import input_data
batch_size = 128
test_size = 256
def init_weights(shape, s):
return tf.Variable(tf.random_normal(shape, stddev=0.01), name = s)
def model(X, w, w2, w3, w4, w_o, p_keep_conv, p... | [
"tensorflow.summary.scalar",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.argmax",
"tensorflow.train.SummaryWriter",
"tensorflow.train.RMSPropOptimizer",
"tensorflow.Session",
"tensorflow.merge_all_summaries",
"tensorflow.placeholder",
"tensorflow.nn.max_pool",
"tensorflow.matmul... | [((1824, 1878), 'tensorflow.examples.tutorials.mnist.input_data.read_data_sets', 'input_data.read_data_sets', (['"""MNIST_data/"""'], {'one_hot': '(True)'}), "('MNIST_data/', one_hot=True)\n", (1849, 1878), False, 'from tensorflow.examples.tutorials.mnist import input_data\n'), ((2053, 2076), 'tensorflow.name_scope', '... |
import pyzbar.pyzbar as pyzbar
from PIL import Image,ImageEnhance
# 通过Image对象打开图片
img = Image.open('qrcode.png')
img.show()
# 解析图片,获取所有二维码
barcodes = pyzbar.decode(img)
for barcode in barcodes:
barcodeData = barcode.data.decode() # 对每个二维码解析成文本
print(barcodeData)
| [
"pyzbar.pyzbar.decode",
"PIL.Image.open"
] | [((89, 113), 'PIL.Image.open', 'Image.open', (['"""qrcode.png"""'], {}), "('qrcode.png')\n", (99, 113), False, 'from PIL import Image, ImageEnhance\n'), ((152, 170), 'pyzbar.pyzbar.decode', 'pyzbar.decode', (['img'], {}), '(img)\n', (165, 170), True, 'import pyzbar.pyzbar as pyzbar\n')] |
# Copyright 2018 AT&T Intellectual Property. All other 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... | [
"unittest.mock.patch.object",
"pegleg.engine.util.encryption.encrypt",
"uuid.uuid4",
"testfixtures.log_capture",
"pegleg.engine.generators.passphrase_generator.PassphraseGenerator",
"pegleg.engine.util.cryptostring.CryptoString",
"unittest.mock.patch.dict",
"pegleg.engine.util.encryption.decrypt",
"... | [((1045, 2138), 'yaml.safe_load', 'yaml.safe_load', (['"""\n---\nschema: pegleg/PassphraseCatalog/v1\nmetadata:\n schema: metadata/Document/v1\n name: cluster-passphrases\n layeringDefinition:\n abstract: false\n layer: site\n storagePolicy: cleartext\ndata:\n passphrases:\n - description: \'short descrip... |
#!/usr/bin/python3
import json
import pathlib
import unittest
from app.lineage import lineage
def credentials():
auth_file = pathlib.Path(pathlib.Path(__file__).parent, "../../resources/auth.json")
with auth_file.open() as f:
auth = json.loads(f.read())
return (auth["user"], auth["password"])
... | [
"unittest.main",
"pathlib.Path",
"app.lineage.lineage.build_request_named_tuple",
"app.lineage.lineage.create_lineage_payload"
] | [((145, 167), 'pathlib.Path', 'pathlib.Path', (['__file__'], {}), '(__file__)\n', (157, 167), False, 'import pathlib\n'), ((4061, 4076), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4074, 4076), False, 'import unittest\n'), ((516, 625), 'app.lineage.lineage.build_request_named_tuple', 'lineage.build_request_nam... |
from tkinter import Button, IntVar, Label, Toplevel
from pynput import keyboard
class KeyMappingButton(Button):
def __init__(self, parent, **kwargs):
super().__init__(parent, **kwargs)
self.configure(command=self.change_key_mapping)
def change_key_mapping(self):
def onPress(key):
... | [
"tkinter.IntVar",
"tkinter.Toplevel",
"tkinter.Label",
"pynput.keyboard.Listener"
] | [((786, 794), 'tkinter.IntVar', 'IntVar', ([], {}), '()\n', (792, 794), False, 'from tkinter import Button, IntVar, Label, Toplevel\n'), ((809, 819), 'tkinter.Toplevel', 'Toplevel', ([], {}), '()\n', (817, 819), False, 'from tkinter import Button, IntVar, Label, Toplevel\n'), ((1074, 1131), 'pynput.keyboard.Listener', ... |
#coding:utf-8
import requests
url = "https://ancient-river-92518.herokuapp.com/guess"
r=requests.get(url)
print(r.status_code) | [
"requests.get"
] | [((88, 105), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (100, 105), False, 'import requests\n')] |
# -*- coding: utf-8 -*-
import urwid
class SimpleButton(urwid.Button):
"""
Custom Urwid button without a visible cursor,
Based on https://stackoverflow.com/a/44682928
"""
button_left = u'< '
button_right = u' >'
def __init__(self, label, on_press=None, user_data=None):
self._i... | [
"urwid.Text",
"urwid.connect_signal",
"urwid.Columns"
] | [((3661, 3760), 'urwid.Columns', 'urwid.Columns', (["[self._label, ('fixed', self.reserve_columns, self.states[state]), self._label]"], {}), "([self._label, ('fixed', self.reserve_columns, self.states[\n state]), self._label])\n", (3674, 3760), False, 'import urwid\n'), ((720, 776), 'urwid.connect_signal', 'urwid.co... |
from datetime import date, datetime, timedelta
from django.test import Client, TestCase
from django.urls import reverse
from .models import Lesson, User
from .payments.stripe import create_or_update_user_profile
from .payments.utils import PLUS_ONE_MONTH, PLUS_ONE_YEAR
class UserProfileTest(TestCase):
def setUp... | [
"django.test.Client",
"datetime.date.today",
"django.urls.reverse",
"datetime.timedelta",
"datetime.datetime.now",
"datetime.datetime.timestamp"
] | [((1059, 1071), 'datetime.date.today', 'date.today', ([], {}), '()\n', (1069, 1071), False, 'from datetime import date, datetime, timedelta\n'), ((1091, 1109), 'datetime.timedelta', 'timedelta', ([], {'days': '(15)'}), '(days=15)\n', (1100, 1109), False, 'from datetime import date, datetime, timedelta\n'), ((1462, 1474... |
#!/usr/bin/python
import requests
import json
json_str={'sampleText':'testing the machine learning thing', 'count':'20'}
data_json = json.dumps(json_str)
ws_header = {'Content-Type': 'application/json'}
url = 'https://metatagger.dtic.mil/mauitagger/api/mauitagger/getTags'
response = requests.post(url, data=data_json... | [
"requests.post",
"json.dumps"
] | [((135, 155), 'json.dumps', 'json.dumps', (['json_str'], {}), '(json_str)\n', (145, 155), False, 'import json\n'), ((287, 340), 'requests.post', 'requests.post', (['url'], {'data': 'data_json', 'headers': 'ws_header'}), '(url, data=data_json, headers=ws_header)\n', (300, 340), False, 'import requests\n')] |
# Copyright 2018 The Feast 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | [
"pandas.read_csv",
"google.cloud.bigquery.Client",
"feast.sdk.utils.print_utils.spec_to_yaml",
"feast.sdk.utils.gs_utils.gcs_to_df",
"feast.sdk.utils.types.dtype_to_value_type",
"feast.sdk.utils.gs_utils.is_gs_path",
"feast.core.CoreService_pb2.CoreServiceTypes.GetUploadUrlRequest.FileType.Value",
"fe... | [((13821, 13837), 'feast.sdk.utils.gs_utils.is_gs_path', 'is_gs_path', (['path'], {}), '(path)\n', (13831, 13837), False, 'from feast.sdk.utils.gs_utils import gcs_to_df, is_gs_path, df_to_gcs\n'), ((14042, 14063), 'ntpath.basename', 'ntpath.basename', (['path'], {}), '(path)\n', (14057, 14063), False, 'import ntpath\n... |
from __future__ import division
import sublime, sublime_plugin
import time
import threading
import copy
from functools import partial
XMIN, YMIN, XMAX, YMAX = list(range(4))
try:
# Do not import State directly to not break us in case the MaxPane.max_pane module is reloaded
import MaxPane
except ImportError a... | [
"functools.partial",
"copy.deepcopy",
"threading.Thread",
"sublime.save_settings",
"time.sleep",
"sublime.active_window",
"sublime.load_settings",
"sublime.ok_cancel_dialog",
"sublime.version"
] | [((8604, 8670), 'functools.partial', 'partial', (['self._on_reorder_done', 'old_index', 'leave_files_at_position'], {}), '(self._on_reorder_done, old_index, leave_files_at_position)\n', (8611, 8670), False, 'from functools import partial\n'), ((11414, 11485), 'functools.partial', 'partial', (['self._on_resize_panes', '... |
import asyncio
from loguru import logger
from time import sleep
from struct import unpack
from collections import deque
from buffer_protocol import BufferProtocol
from push import temp, hum, pa, channel_pb_packet_event, channel_pb_error_event
from sense_pb2 import SenseUpdate
TEMP = 1
HUM = 2
PA = 3
async def source_... | [
"loguru.logger.warning",
"sense_pb2.SenseUpdate",
"push.channel_pb_error_event.inc",
"push.channel_pb_packet_event.inc"
] | [((543, 556), 'sense_pb2.SenseUpdate', 'SenseUpdate', ([], {}), '()\n', (554, 556), False, 'from sense_pb2 import SenseUpdate\n'), ((1212, 1241), 'push.channel_pb_packet_event.inc', 'channel_pb_packet_event.inc', ([], {}), '()\n', (1239, 1241), False, 'from push import temp, hum, pa, channel_pb_packet_event, channel_pb... |
from pycaret.classification import load_model, predict_model
import pandas as pd
import numpy as np
import streamlit as st
from PIL import Image
import os
class StreamlitApp:
def __init__(self):
self.model = load_model('model/final_model_heart_failure')
self.save_fn = 'path.csv'
... | [
"pycaret.classification.load_model",
"pandas.DataFrame",
"streamlit.image",
"streamlit.sidebar.success",
"streamlit.slider",
"pandas.read_csv",
"streamlit.checkbox",
"os.path.exists",
"streamlit.title",
"PIL.Image.open",
"streamlit.file_uploader",
"streamlit.write",
"streamlit.sidebar.select... | [((227, 272), 'pycaret.classification.load_model', 'load_model', (['"""model/final_model_heart_failure"""'], {}), "('model/final_model_heart_failure')\n", (237, 272), False, 'from pycaret.classification import load_model, predict_model\n'), ((373, 415), 'pycaret.classification.predict_model', 'predict_model', (['self.m... |
#!/usr/bin/env python
# ___INFO__MARK_BEGIN__
#######################################################################################
# Copyright 2008-2021 Univa Corporation (acquired and owned by Altair Engineering Inc.)
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file exce... | [
"datetime.datetime.utcfromtimestamp"
] | [((1128, 1156), 'datetime.datetime.utcfromtimestamp', 'datetime.utcfromtimestamp', (['(0)'], {}), '(0)\n', (1153, 1156), False, 'from datetime import datetime\n')] |
"""
ZiGate lock platform that implements locks.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/lock.zigate/
"""
import logging
from homeassistant.exceptions import PlatformNotReady
from homeassistant.components.lock import LockEntity, ENTITY_ID_FORMAT
impor... | [
"zigate.dispatcher.connect",
"homeassistant.components.lock.ENTITY_ID_FORMAT.format",
"logging.getLogger"
] | [((410, 437), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (427, 437), False, 'import logging\n'), ((1749, 1838), 'zigate.dispatcher.connect', 'zigate.dispatcher.connect', (['sync_attributes', 'zigate.ZIGATE_ATTRIBUTE_ADDED'], {'weak': '(False)'}), '(sync_attributes, zigate.ZIGATE_ATTRI... |
from django.contrib import admin
from .models import \
LoanAccount, LoanProduct, LoanTransaction, LoanProfile,\
LoanApplication, LoanAccountBalance
admin.site.register(LoanApplication)
admin.site.register(LoanProduct)
admin.site.register(LoanAccountBalance)
admin.site.register(LoanProfile)
admin.site.register... | [
"django.contrib.admin.site.register"
] | [((158, 194), 'django.contrib.admin.site.register', 'admin.site.register', (['LoanApplication'], {}), '(LoanApplication)\n', (177, 194), False, 'from django.contrib import admin\n'), ((195, 227), 'django.contrib.admin.site.register', 'admin.site.register', (['LoanProduct'], {}), '(LoanProduct)\n', (214, 227), False, 'f... |
from app.main import db
import datetime
from app.main.models.SignUpContestModel import SignUpContestModel
def save_changes(data):
try:
db.session.add(data)
db.session.commit()
print('saved!!')
except Exception as e:
db.session.rollback()
print('not saved!!')
pri... | [
"app.main.models.SignUpContestModel.SignUpContestModel.query.filter_by",
"app.main.db.session.add",
"app.main.models.SignUpContestModel.SignUpContestModel",
"app.main.db.session.commit",
"app.main.db.session.rollback"
] | [((374, 440), 'app.main.models.SignUpContestModel.SignUpContestModel', 'SignUpContestModel', ([], {'contest_id': "data['contest_id']", 'user_id': 'user_id'}), "(contest_id=data['contest_id'], user_id=user_id)\n", (392, 440), False, 'from app.main.models.SignUpContestModel import SignUpContestModel\n'), ((149, 169), 'ap... |
"""
SQLAlchemy models - defines table for storing scraped data.
"""
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import ForeignKey, Column, Integer, Float, String, Text, DateTime
from sqlalchemy.orm import relationship
from .util.history_meta import Versioned
Base = declarative_base()
de... | [
"sqlalchemy.ForeignKey",
"sqlalchemy.ext.declarative.declarative_base",
"sqlalchemy.orm.relationship",
"sqlalchemy.Column",
"sqlalchemy.String"
] | [((298, 316), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', ([], {}), '()\n', (314, 316), False, 'from sqlalchemy.ext.declarative import declarative_base\n'), ((560, 593), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)'}), '(Integer, primary_key=True)\n', (566, 593), False, 'f... |
import codecs
from setuptools import find_packages, setup
setup(name='gapipy',
description='A wrapper for the Google Analytics API.',
long_description=codecs.open('README.md', 'r', 'utf-8').read(),
author='<NAME>',
author_email='<EMAIL>',
url='https://github.com/huwfulcher/gapipy/',
... | [
"codecs.open",
"setuptools.find_packages"
] | [((452, 467), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (465, 467), False, 'from setuptools import find_packages, setup\n'), ((165, 203), 'codecs.open', 'codecs.open', (['"""README.md"""', '"""r"""', '"""utf-8"""'], {}), "('README.md', 'r', 'utf-8')\n", (176, 203), False, 'import codecs\n')] |
import gym
from stable_baselines import DQN
from stable_baselines.common.evaluation import evaluate_policy
# Create environment
env = gym.make('LunarLander-v2')
# Instantiate the agent
model = DQN('MlpPolicy', env, learning_rate=1e-3, prioritized_replay=True, verbose=1)
# Train the agent
model.learn(total_timesteps... | [
"stable_baselines.DQN.load",
"stable_baselines.DQN",
"gym.make"
] | [((137, 163), 'gym.make', 'gym.make', (['"""LunarLander-v2"""'], {}), "('LunarLander-v2')\n", (145, 163), False, 'import gym\n'), ((197, 275), 'stable_baselines.DQN', 'DQN', (['"""MlpPolicy"""', 'env'], {'learning_rate': '(0.001)', 'prioritized_replay': '(True)', 'verbose': '(1)'}), "('MlpPolicy', env, learning_rate=0.... |
import os
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from ez_torch.base_module import Module
from ez_torch.utils import get_uv_grid
def leaky(slope=0.2):
return nn.LeakyReLU(slope, inplace=True)
def conv_block(i, o, ks, s, p, a=leaky(), d=1, bn=True):
block = [nn... | [
"torch.nn.ConvTranspose2d",
"torch.nn.functional.grid_sample",
"torch.nn.Sequential",
"torch.nn.Conv2d",
"numpy.prod",
"torch.nn.BatchNorm2d",
"ez_torch.utils.get_uv_grid",
"torch.nn.Linear",
"torch.nn.LeakyReLU",
"torch.tensor",
"torch.nn.Sigmoid"
] | [((212, 245), 'torch.nn.LeakyReLU', 'nn.LeakyReLU', (['slope'], {'inplace': '(True)'}), '(slope, inplace=True)\n', (224, 245), True, 'import torch.nn as nn\n'), ((493, 514), 'torch.nn.Sequential', 'nn.Sequential', (['*block'], {}), '(*block)\n', (506, 514), True, 'import torch.nn as nn\n'), ((920, 941), 'torch.nn.Seque... |
# _*_ coding: utf-8 _*_
"""
Created by Allen7D on 2018/6/17.
"""
from flask import request
from app.libs.limiter import cached
from app.libs.error_code import Success
from app.libs.redprint import RedPrint
from app.models.theme import Theme
from app.validators.params import IDCollection, IDMustBePositiveInt
from app.... | [
"app.validators.params.IDCollection",
"app.libs.limiter.cached",
"app.libs.redprint.RedPrint",
"app.models.theme.Theme.get_themes",
"app.libs.error_code.Success",
"app.validators.params.IDMustBePositiveInt",
"app.models.theme.Theme.get_theme_detail"
] | [((387, 444), 'app.libs.redprint.RedPrint', 'RedPrint', ([], {'name': '"""theme"""', 'description': '"""主题"""', 'api_doc': 'api_doc'}), "(name='theme', description='主题', api_doc=api_doc)\n", (395, 444), False, 'from app.libs.redprint import RedPrint\n'), ((490, 498), 'app.libs.limiter.cached', 'cached', ([], {}), '()\n... |
import stats
import util
PRIORITY = 1
'''
Returns true if user input is valid for this command
Usually some sort of RegEx or "x in y" statement would go here
'''
def is_valid(tweet):
return "basic stat" in tweet or "calculate my averages" in tweet or "calculate averages" in tweet
'''
Command logic goes here.
Wh... | [
"util.add_tweets",
"stats.get_averages"
] | [((542, 570), 'stats.get_averages', 'stats.get_averages', (['statuses'], {}), '(statuses)\n', (560, 570), False, 'import stats\n'), ((757, 790), 'util.add_tweets', 'util.add_tweets', (['statuses', 'wilbur'], {}), '(statuses, wilbur)\n', (772, 790), False, 'import util\n')] |
import tensorflow as tf
import numpy as np
x_data = np.array([
[0,0] , [0,1], [1,0], [1,1]
])
y_data = np.array([
[1,0], #0
[1,0], #0
[1,0], #0
[0,1] #1
])
X = tf.placeholder(tf.float32)
Y = tf.placeholder(tf.float32)
W = tf.Variable(tf.random_uniform([2, 2], -1., 1.))
b = tf.Variable(tf.zeros([2]))
model... | [
"tensorflow.random_uniform",
"tensorflow.global_variables_initializer",
"tensorflow.Session",
"tensorflow.placeholder",
"tensorflow.floor",
"tensorflow.zeros",
"numpy.array",
"tensorflow.cast",
"tensorflow.matmul",
"tensorflow.log",
"tensorflow.train.GradientDescentOptimizer"
] | [((54, 96), 'numpy.array', 'np.array', (['[[0, 0], [0, 1], [1, 0], [1, 1]]'], {}), '([[0, 0], [0, 1], [1, 0], [1, 1]])\n', (62, 96), True, 'import numpy as np\n'), ((108, 150), 'numpy.array', 'np.array', (['[[1, 0], [1, 0], [1, 0], [0, 1]]'], {}), '([[1, 0], [1, 0], [1, 0], [0, 1]])\n', (116, 150), True, 'import numpy ... |
import pygame as pg
from view import View
from chess import Chess
from controller import Controller
class App:
"""
App - main application class
"""
def __init__(self):
self._running = True
self._display_surf = None
self._controller = Controller()
def on_init(self):
... | [
"pygame.quit",
"pygame.event.get",
"pygame.display.set_mode",
"controller.Controller",
"pygame.init",
"pygame.display.update"
] | [((281, 293), 'controller.Controller', 'Controller', ([], {}), '()\n', (291, 293), False, 'from controller import Controller\n'), ((326, 335), 'pygame.init', 'pg.init', ([], {}), '()\n', (333, 335), True, 'import pygame as pg\n'), ((365, 441), 'pygame.display.set_mode', 'pg.display.set_mode', (['self._controller.view.s... |
import tensorflow as tf
def feature_reconstruction_loss(content, combination):
with tf.name_scope('scale_factor'):
shape = tf.shape(combination)
factor = tf.cast(tf.reduce_prod(shape), tf.float32)
return tf.reduce_sum(tf.squared_difference(combination, content)) / factor
def gram_matrix(x):
... | [
"tensorflow.split",
"tensorflow.summary.scalar",
"tensorflow.reshape",
"tensorflow.keras.applications.VGG16",
"tensorflow.variable_scope",
"tensorflow.pow",
"tensorflow.transpose",
"tensorflow.concat",
"tensorflow.matmul",
"tensorflow.shape",
"tensorflow.reduce_prod",
"tensorflow.constant",
... | [((533, 597), 'tensorflow.reshape', 'tf.reshape', (['x'], {'shape': '(batch_size, -1, channels)', 'name': '"""features"""'}), "(x, shape=(batch_size, -1, channels), name='features')\n", (543, 597), True, 'import tensorflow as tf\n'), ((615, 672), 'tensorflow.transpose', 'tf.transpose', (['features'], {'perm': '[0, 2, 1... |
# Generated by Django 3.2.6 on 2021-09-17 10:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("corporate", "0013_alter_zulipsponsorshiprequest_org_website"),
]
operations = [
migrations.AddField(
model_name="customerplan",
... | [
"django.db.models.DateTimeField"
] | [((367, 398), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'null': '(True)'}), '(null=True)\n', (387, 398), False, 'from django.db import migrations, models\n')] |
# 判断内网服务器是否存活
import json
from flask import current_app
from certif_page.config.setting import RedisTime
from certif_page.libs.cache import cache
from certif_page.models.School import School
def check_alive(school_id: str, alive_redis):
try:
record = json.loads(alive_redis.get(
current_app.co... | [
"certif_page.libs.cache.cache.memoize"
] | [((541, 587), 'certif_page.libs.cache.cache.memoize', 'cache.memoize', (['RedisTime.check_remote_or_local'], {}), '(RedisTime.check_remote_or_local)\n', (554, 587), False, 'from certif_page.libs.cache import cache\n')] |
import json
import random
import string
def via_json(video_filename, description=None):
"""
Create a dictionary to be saved as VIA json annotation file.
:param video_filename: relative video filename_or_buffer
:param description: annotation description
:return: dict
"""
json_template = ""... | [
"json.dump",
"random.choices",
"json.loads"
] | [((1341, 1366), 'json.loads', 'json.loads', (['json_template'], {}), '(json_template)\n', (1351, 1366), False, 'import json\n'), ((5434, 5491), 'random.choices', 'random.choices', (['(string.ascii_letters + string.digits)'], {'k': '(8)'}), '(string.ascii_letters + string.digits, k=8)\n', (5448, 5491), False, 'import ra... |
import os
import re
from typing import List, Union
from s3_data_packer.helpers import _get_file_size
from s3_data_packer.s3_table_store import S3TableStore
from s3_data_packer.constants import default_file_limit_gigabytes
class S3OutputStore(S3TableStore):
def __init__(
self,
basepath: str,
... | [
"os.path.join",
"os.path.basename",
"s3_data_packer.helpers._get_file_size",
"re.search",
"re.compile"
] | [((2319, 2343), 're.search', 're.search', (['"""_[0-9]+."""', 'f'], {}), "('_[0-9]+.', f)\n", (2328, 2343), False, 'import re\n'), ((1036, 1105), 're.compile', 're.compile', (['f"""^.+{self.partition_name}={self.partition_values[0]}/.+"""'], {}), "(f'^.+{self.partition_name}={self.partition_values[0]}/.+')\n", (1046, 1... |
from plugin.core.environment import translate as _
from plugin.managers.account import TraktAccountManager
from plugin.models import TraktAccount
from plugin.preferences.options.core.base import SimpleOption
import logging
log = logging.getLogger(__name__)
class PinOption(SimpleOption):
type = 'string'
gro... | [
"plugin.managers.account.TraktAccountManager.update.from_pin",
"plugin.managers.account.TraktAccountManager.get",
"plugin.core.environment.translate",
"logging.getLogger"
] | [((231, 258), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (248, 258), False, 'import logging\n'), ((361, 384), 'plugin.core.environment.translate', '_', (['"""Authentication PIN"""'], {}), "('Authentication PIN')\n", (362, 384), True, 'from plugin.core.environment import translate as _... |
#!/usr/bin/env python
from pathlib import Path
from shopping_cart.make_store import make_new_store
from shopping_cart.shopping.cart import ShoppingCart
directory = Path(__file__).parent.parent
def main():
store = make_new_store(directory / "files/stores/store_2.yaml")
cart_1 = ShoppingCart(store=store)
... | [
"shopping_cart.shopping.cart.ShoppingCart",
"pathlib.Path",
"shopping_cart.make_store.make_new_store"
] | [((222, 277), 'shopping_cart.make_store.make_new_store', 'make_new_store', (["(directory / 'files/stores/store_2.yaml')"], {}), "(directory / 'files/stores/store_2.yaml')\n", (236, 277), False, 'from shopping_cart.make_store import make_new_store\n'), ((291, 316), 'shopping_cart.shopping.cart.ShoppingCart', 'ShoppingCa... |
# This file is part of the P3IV Simulator (https://github.com/fzi-forschungszentrum-informatik/P3IV),
# copyright by FZI Forschungszentrum Informatik, licensed under the BSD-3 license (see LICENSE file in main directory)
from __future__ import division
import numpy as np
import warnings
import random
from .external.da... | [
"p3iv_core.bindings.interaction_dataset.track_reader.track_reader",
"numpy.empty"
] | [((761, 864), 'p3iv_core.bindings.interaction_dataset.track_reader.track_reader', 'track_reader', (["configurations['map']", "configurations['dataset']", "configurations['track_file_number']"], {}), "(configurations['map'], configurations['dataset'],\n configurations['track_file_number'])\n", (773, 864), False, 'fro... |
#!/usr/bin/env python
import serial
from time import time
import struct
import numpy as np
import rospy
from kvh_gyro.msg import gyro
if __name__ == '__main__':
#init the node
rospy.init_node('gyro_node')
#define the publisher
pub = rospy.Publisher('/gyro', gyro, queue_size=1000)
#define some p... | [
"serial.Serial",
"rospy.Time.now",
"struct.unpack",
"rospy.Publisher",
"rospy.loginfo",
"rospy.is_shutdown",
"rospy.init_node",
"kvh_gyro.msg.gyro"
] | [((187, 215), 'rospy.init_node', 'rospy.init_node', (['"""gyro_node"""'], {}), "('gyro_node')\n", (202, 215), False, 'import rospy\n'), ((253, 300), 'rospy.Publisher', 'rospy.Publisher', (['"""/gyro"""', 'gyro'], {'queue_size': '(1000)'}), "('/gyro', gyro, queue_size=1000)\n", (268, 300), False, 'import rospy\n'), ((65... |
#!/bin/env python
# -*- coding: utf-8 -*-
#
#Created on 08.03.17
#
#Created for py_bacy
#
#@author: <NAME>, <EMAIL>
#
# Copyright (C) {2017} {<NAME>}
#
# System modules
import logging
import os
import datetime
import subprocess
import time
import glob
import shutil
# External modules
import cdo
# Internal module... | [
"os.remove",
"subprocess.Popen",
"os.path.basename",
"datetime.datetime.now",
"time.sleep",
"datetime.datetime",
"subprocess.call",
"glob.glob",
"cdo.Cdo",
"os.path.join",
"logging.getLogger"
] | [((416, 443), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (433, 443), False, 'import logging\n'), ((450, 459), 'cdo.Cdo', 'cdo.Cdo', ([], {}), '()\n', (457, 459), False, 'import cdo\n'), ((1627, 1657), 'os.path.join', 'os.path.join', (['run_dir', '"""input"""'], {}), "(run_dir, 'input'... |
import os
from pathlib import Path
from ..creds import createDefaultCreds
dbname = "database"
def init():
if not os.path.isdir(dbname):
setupDb(dbname)
def setupDb(name):
os.makedirs(name)
folders = ["tables", "index"]
createDefaultCreds() | [
"os.path.isdir",
"os.makedirs"
] | [((191, 208), 'os.makedirs', 'os.makedirs', (['name'], {}), '(name)\n', (202, 208), False, 'import os\n'), ((119, 140), 'os.path.isdir', 'os.path.isdir', (['dbname'], {}), '(dbname)\n', (132, 140), False, 'import os\n')] |
#!python
# -*- coding: utf-8 -*-
#
# This software and supporting documentation are distributed by
# Institut Federatif de Recherche 49
# CEA/NeuroSpin, Batiment 145,
# 91191 Gif-sur-Yvette cedex
# France
#
# This software is governed by the CeCILL license version 2 under
# French law and abiding b... | [
"argparse.ArgumentParser",
"soma.aims.Volume",
"joblib.cpu_count",
"numpy.asarray",
"soma.aims.write",
"soma.aims.read",
"glob.glob",
"re.search"
] | [((2251, 2262), 'joblib.cpu_count', 'cpu_count', ([], {}), '()\n', (2260, 2262), False, 'from joblib import cpu_count\n'), ((2502, 2622), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""write_skeleton.py"""', 'description': '"""Generates bucket files converted from volume files"""'}), "(prog='wr... |
from masonite.app import App
from masonite.request import Request
from masonite.routes import Get, Post
from masonite.exceptions import ContainerError
import inspect
import pytest
REQUEST = Request({})
class TestApp:
def setup_method(self):
self.app = App()
def test_app_binds(self):
self.app... | [
"masonite.request.Request",
"pytest.raises",
"masonite.app.App",
"masonite.routes.Get"
] | [((191, 202), 'masonite.request.Request', 'Request', (['{}'], {}), '({})\n', (198, 202), False, 'from masonite.request import Request\n'), ((267, 272), 'masonite.app.App', 'App', ([], {}), '()\n', (270, 272), False, 'from masonite.app import App\n'), ((788, 847), 'pytest.raises', 'pytest.raises', (['ContainerError'], {... |
from api.process.utils.singleton import Singleton
import mantistable.settings
from pymongo import MongoClient
from pymongo import UpdateOne
@Singleton
class MongoWrapper():
def __init__(self):
host = mantistable.settings.DATABASES["default"]["HOST"]
port = mantistable.settings.DATABASES["default"]... | [
"pymongo.MongoClient",
"pymongo.UpdateOne"
] | [((428, 468), 'pymongo.MongoClient', 'MongoClient', (['f"""mongodb://{host}:{port}/"""'], {}), "(f'mongodb://{host}:{port}/')\n", (439, 468), False, 'from pymongo import MongoClient\n'), ((660, 703), 'pymongo.UpdateOne', 'UpdateOne', (["{'id': doc['id']}", "{'$set': doc}"], {}), "({'id': doc['id']}, {'$set': doc})\n", ... |
#!/usr/bin/env python
#
# *********************************************************
# Copyright (c) Microsoft. All rights reserved.
#
# Apache 2.0 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
# dis... | [
"os.getpid",
"json.loads"
] | [((872, 883), 'os.getpid', 'os.getpid', ([], {}), '()\n', (881, 883), False, 'import os\n'), ((963, 1103), 'json.loads', 'json.loads', (['"""{"runtimeSettings": [{"handlerSettings": {"publicSettings": {"EncryptionOperation": "EnableEncryptionFormatAll"}}}]}"""'], {}), '(\n \'{"runtimeSettings": [{"handlerSettings": ... |
import os
from dataclasses import dataclass
from typing import Union, List, Dict
from radiome.core.utils.s3 import S3Resource
@dataclass(frozen=True)
class Context:
working_dir: Union[str, os.PathLike]
inputs_dir: Union[str, os.PathLike, S3Resource]
outputs_dir: Union[str, os.PathLike, S3Resource]
pa... | [
"dataclasses.dataclass"
] | [((130, 152), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (139, 152), False, 'from dataclasses import dataclass\n')] |
#!/usr/bin/python3
import sys
from nuscenes.nuscenes import NuScenes
import nuscenes.utils.geometry_utils as geoutils
from pyquaternion import Quaternion
import numpy as np
import os
import numpy.linalg as la
if __name__ == "__main__":
if len(sys.argv) < 3:
print("Usage: ./nuscenes2kitti.py <dataset_fold... | [
"os.makedirs",
"nuscenes.nuscenes.NuScenes",
"os.path.exists",
"numpy.max",
"numpy.min",
"numpy.linalg.inv",
"pyquaternion.Quaternion",
"numpy.dot",
"os.path.join"
] | [((414, 476), 'nuscenes.nuscenes.NuScenes', 'NuScenes', ([], {'version': '"""v1.0-mini"""', 'dataroot': 'dataroot', 'verbose': '(True)'}), "(version='v1.0-mini', dataroot=dataroot, verbose=True)\n", (422, 476), False, 'from nuscenes.nuscenes import NuScenes\n'), ((1018, 1055), 'os.path.join', 'os.path.join', (['sys.arg... |
"""
Project.x
Author: <NAME>
"""
from __future__ import print_function, absolute_import
from qtpy import QtWidgets, QtCore, QtGui
from ._basic_tab_widget import BasicTabWidget
from fem.utilities import MrSignal
from fem.utilities.command_dispatcher import CommandDispatcher, ChildCommand, dispatcher_version
asse... | [
"fem.utilities.MrSignal"
] | [((2590, 2600), 'fem.utilities.MrSignal', 'MrSignal', ([], {}), '()\n', (2598, 2600), False, 'from fem.utilities import MrSignal\n'), ((2630, 2640), 'fem.utilities.MrSignal', 'MrSignal', ([], {}), '()\n', (2638, 2640), False, 'from fem.utilities import MrSignal\n')] |
from naive_bayes import NaiveBayes
model = NaiveBayes()
model.fit('vertebrate_20.txt',
target_col="ClassLabel",
ignore_col="Name",
start_idx=0,
end_idx=10)
print("Likelihood:")
model.likelihood()
print("\nPosterior Probability:")
model.predict('vertebrate_20.txt', start_idx=10, ... | [
"naive_bayes.NaiveBayes"
] | [((44, 56), 'naive_bayes.NaiveBayes', 'NaiveBayes', ([], {}), '()\n', (54, 56), False, 'from naive_bayes import NaiveBayes\n')] |
import sys
import time
import pandas as pd
from pysradb.sraweb import SRAweb
import numpy as np
def filter_previous_run(df):
"""
This method filters datasets before fetching metadata based on
last update. Provided a file from previous extract of NCBI
SARS-CoV-2 resources https://www.ncbi.nlm.nih.gov/s... | [
"pandas.read_csv",
"time.sleep",
"pandas.concat",
"pysradb.sraweb.SRAweb"
] | [((2321, 2329), 'pysradb.sraweb.SRAweb', 'SRAweb', ([], {}), '()\n', (2327, 2329), False, 'from pysradb.sraweb import SRAweb\n'), ((2400, 2446), 'pandas.read_csv', 'pd.read_csv', (['"""Coronaviridae_runs_20201103.csv"""'], {}), "('Coronaviridae_runs_20201103.csv')\n", (2411, 2446), True, 'import pandas as pd\n'), ((334... |
# -*- coding: utf-8 -*-
# Standard library imports
import re
from collections import namedtuple
from functools import total_ordering
# Local imports
from . import compat
__all__ = [
'ParseError',
'Version',
'parse_version',
'default_version',
]
# Strange nuke version pattern
nuke_version_pattern =... | [
"re.search",
"collections.namedtuple"
] | [((1066, 1161), 'collections.namedtuple', 'namedtuple', (['"""Version"""', "['major', 'minor', 'patch', 'prerelease', 'buildmetadata', 'string']"], {}), "('Version', ['major', 'minor', 'patch', 'prerelease',\n 'buildmetadata', 'string'])\n", (1076, 1161), False, 'from collections import namedtuple\n'), ((3436, 3475)... |
"""
Test the various utilities in serpentTools/utils.py
"""
from unittest import TestCase
from numpy import arange, ndarray, array, ones, ones_like, zeros_like
from numpy.testing import assert_array_equal
from serpentTools.utils import (
convertVariableName,
splitValsUncs,
str2vec,
getCommonKeys,
... | [
"numpy.zeros_like",
"numpy.ones_like",
"serpentTools.utils.formatPlot",
"numpy.testing.assert_array_equal",
"serpentTools.utils.splitValsUncs",
"numpy.ones",
"serpentTools.utils.directCompare",
"tests.plotAttrTest",
"serpentTools.utils.getOverlaps",
"serpentTools.utils.getCommonKeys",
"serpentTo... | [((9305, 9312), 'numpy.ones', 'ones', (['(4)'], {}), '(4)\n', (9309, 9312), False, 'from numpy import arange, ndarray, array, ones, ones_like, zeros_like\n'), ((9345, 9370), 'numpy.array', 'array', (['[0, 0.2, 0.1, 0.2]'], {}), '([0, 0.2, 0.1, 0.2])\n', (9350, 9370), False, 'from numpy import arange, ndarray, array, on... |
# Filename: ahrs.py
# -*- coding: utf-8 -*-
# pylint: disable=locally-disabled
"""
AHRS calibration.
"""
import io
from collections import defaultdict
import time
import xml.etree.ElementTree as ET
import km3db
import numpy as np
from numpy import cos, sin, arctan2
import km3pipe as kp
from km3pipe.tools import tim... | [
"km3db.CLBMap",
"io.BytesIO",
"numpy.arctan2",
"io.StringIO",
"numpy.degrees",
"numpy.median",
"km3pipe.logger.get_logger",
"km3db.DBManager",
"collections.defaultdict",
"time.time",
"km3pipe.tools.timed_cache",
"numpy.sin",
"numpy.array",
"numpy.cos",
"km3db.tools.clbupi2compassupi",
... | [((444, 474), 'km3pipe.logger.get_logger', 'kp.logger.get_logger', (['__name__'], {}), '(__name__)\n', (464, 474), True, 'import km3pipe as kp\n'), ((4368, 4415), 'km3pipe.tools.timed_cache', 'timed_cache', ([], {'hours': '(1)', 'maxsize': 'None', 'typed': '(False)'}), '(hours=1, maxsize=None, typed=False)\n', (4379, 4... |
import topas2numpy as t2np
import numpy as np
import os
######################
os.chdir("/home/ethanb/TOPAS/Linac_Model/output/PDD")
######################
cyl1 = t2np.BinnedResult("../../mac/PDDCyl.csv")
depth = np.flip(cyl1.dimensions[2].get_bin_centers())
files = {}
for filename in os.listdir():
print(file... | [
"topas2numpy.BinnedResult",
"os.stat",
"numpy.asarray",
"numpy.savetxt",
"os.chdir",
"numpy.squeeze",
"os.listdir"
] | [((81, 134), 'os.chdir', 'os.chdir', (['"""/home/ethanb/TOPAS/Linac_Model/output/PDD"""'], {}), "('/home/ethanb/TOPAS/Linac_Model/output/PDD')\n", (89, 134), False, 'import os\n'), ((167, 208), 'topas2numpy.BinnedResult', 't2np.BinnedResult', (['"""../../mac/PDDCyl.csv"""'], {}), "('../../mac/PDDCyl.csv')\n", (184, 208... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020 <NAME>
# Licensed under the MIT License
"""Main module for applying zreion function."""
import warnings
import numpy as np
import pyfftw
from . import _zreion
# define constants
b0 = 1.0 / 1.686
def tophat(x):
"""
Compute spherical tophat Fourier window functio... | [
"numpy.meshgrid",
"numpy.ones_like",
"warnings.simplefilter",
"numpy.abs",
"numpy.fft.irfftn",
"numpy.fft.rfftn",
"pyfftw.empty_aligned",
"numpy.fft.rfftfreq",
"numpy.fft.fftfreq",
"numpy.sin",
"warnings.catch_warnings",
"pyfftw.FFTW",
"numpy.cos",
"numpy.float64",
"numpy.sqrt"
] | [((4212, 4284), 'pyfftw.empty_aligned', 'pyfftw.empty_aligned', (['padded_shape', 'input_dtype'], {'n': 'pyfftw.simd_alignment'}), '(padded_shape, input_dtype, n=pyfftw.simd_alignment)\n', (4232, 4284), False, 'import pyfftw\n'), ((6634, 6655), 'numpy.fft.rfftn', 'np.fft.rfftn', (['density'], {}), '(density)\n', (6646,... |
# Copyright (c) 2013, <NAME> and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import (flt)
from frappe import _, throw
def execute(filters=None):
if not filters: filters = {}
columns = get_columns()
data = []
ind_map = get_i... | [
"frappe.db.sql",
"frappe._",
"frappe._dict",
"frappe.utils.flt"
] | [((3195, 3209), 'frappe._dict', 'frappe._dict', ([], {}), '()\n', (3207, 3209), False, 'import frappe\n'), ((3222, 3549), 'frappe.db.sql', 'frappe.db.sql', (["('SELECT tar.name, tar.uom, tar.target, tar.bsc_indicator, tar.fiscal_year, ind.full_name, ind.bsc_objective, obj.bsc_perspective \\t\\tFROM `tabBSC Target` tar,... |