code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from dotted.collection import DottedDict
import nexinfosys
from nexinfosys.command_definitions import commands
from nexinfosys.command_descriptions import c_descriptions
from nexinfosys.command_field_definitions import command_fields
from nexinfosys.command_field_descriptions import cf_descriptions
from nexinfosys.comm... | [
"dotted.collection.DottedDict",
"nexinfosys.command_field_definitions.command_fields.get",
"nexinfosys.command_generators.parser_field_examples.generic_field_examples.get",
"nexinfosys.command_descriptions.c_descriptions.get",
"nexinfosys.command_generators.parser_field_examples.generic_field_syntax.get",
... | [((2066, 2105), 'nexinfosys.command_descriptions.c_descriptions.get', 'c_descriptions.get', (["(cmd.name, 'title')"], {}), "((cmd.name, 'title'))\n", (2084, 2105), False, 'from nexinfosys.command_descriptions import c_descriptions\n'), ((3112, 3191), 'nexinfosys.command_field_descriptions.cf_descriptions.get', 'cf_desc... |
import re
import scrapy
from scrapy.http import HtmlResponse
import hashlib
class ReviewsSpider(scrapy.Spider):
name = "healthgrades"
start_urls = [
'https://www.healthgrades.com/physician/dr-michael-hinckley-3mmkm',
]
data = {}
reviews = []
pagination = []
... | [
"scrapy.http.HtmlResponse",
"re.search"
] | [((636, 699), 're.search', 're.search', (['"""https?://([A-Za-z_0-9.-]+).*"""', 'response.request.url'], {}), "('https?://([A-Za-z_0-9.-]+).*', response.request.url)\n", (645, 699), False, 'import re\n'), ((1614, 1673), 'scrapy.http.HtmlResponse', 'HtmlResponse', ([], {'url': '"""HTML string"""', 'body': 'res', 'encodi... |
import pytest
from tekmoney.currency import Currency
from tekmoney.currency_tax import CurrencyWithTax
from tekmoney.utils import tek_sum
def test_init():
currency = CurrencyWithTax(net=Currency(1, "USD"), gross=Currency(1, "USD"))
assert (currency.net == Currency(1, "USD")) and (
currency.gross == C... | [
"tekmoney.utils.tek_sum",
"pytest.raises",
"tekmoney.currency.Currency",
"tekmoney.currency_tax.CurrencyWithTax"
] | [((353, 378), 'pytest.raises', 'pytest.raises', (['ValueError'], {}), '(ValueError)\n', (366, 378), False, 'import pytest\n'), ((463, 487), 'pytest.raises', 'pytest.raises', (['TypeError'], {}), '(TypeError)\n', (476, 487), False, 'import pytest\n'), ((497, 518), 'tekmoney.currency_tax.CurrencyWithTax', 'CurrencyWithTa... |
"""
With molecular inversion probes, we map reads to the genome that include the
ligation and extension arms, along with a molecular tag (AKA UMI).
This script takes:
1) ref.fasta
2) mips design file (likely from MIPgen)
3) de-multiplxed, paired-end fastqs
and moves the UMI into the read-name, aligns the r... | [
"sys.exit",
"os.path.exists",
"argparse.ArgumentParser",
"math.copysign",
"doctest.testmod",
"os.unlink",
"sys.stdout.flush",
"atexit.register",
"operator.attrgetter",
"toolshed.reader",
"sys.stderr.write",
"itertools.islice",
"tempfile.mktemp",
"collections.Counter",
"io.TextIOWrapper",... | [((8099, 8143), 'sys.stderr.write', 'sys.stderr.write', (["('reading %s\\n' % mips_file)"], {}), "('reading %s\\n' % mips_file)\n", (8115, 8143), False, 'import sys\n'), ((8279, 8299), 'toolshed.reader', 'ts.reader', (['mips_file'], {}), '(mips_file)\n', (8288, 8299), True, 'import toolshed as ts\n'), ((9107, 9208), 't... |
"""
Cross-industry standard process for data mining
"""
import pandas as pd
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import train_test_split
from sklearn import metrics
from data_mining.vars import download, adult_data, adult_test, adult_data_test
from data_mining import crawler... | [
"data_mining.utils.build_final_decision_tree",
"data_mining.utils.replace_characters",
"data_mining.utils.build_decision_tree",
"data_mining.crawler.extract_data",
"data_mining.utils.delete_lines",
"data_mining.utils.append_files",
"data_mining.utils.create_continent_column",
"data_mining.utils.create... | [((596, 618), 'data_mining.crawler.extract_data', 'crawler.extract_data', ([], {}), '()\n', (616, 618), False, 'from data_mining import crawler\n'), ((729, 835), 'data_mining.utils.append_files', 'append_files', ([], {'output_file': 'adult_data_test', 'input_filenames': '[adult_data, adult_test]', 'basepath': 'download... |
# -*- coding: utf-8 -*-
"""
Pharmacopedia.Py v1.0
Pharmacy Counting Project
<NAME>
DESCRIPTION
Analyzes and organizes medical pharmacy data. Using data from the Centers for
Medicare & Medicaid Services, this script calculates: (1) total number of
prescribers and (2) total prescriber expenditure for all listed drugs.... | [
"DysartComm.parse_warn",
"DysartComm.parse_warn_quotes",
"DysartComm.check_paths"
] | [((4668, 4709), 'DysartComm.check_paths', 'adc.check_paths', (['import_path', 'export_path'], {}), '(import_path, export_path)\n', (4683, 4709), True, 'import DysartComm as adc\n'), ((9350, 9387), 'DysartComm.parse_warn_quotes', 'adc.parse_warn_quotes', (['comma_split[0]'], {}), '(comma_split[0])\n', (9371, 9387), True... |
from guizero import App, Text
app = App(title="Hello World")
message = Text(app,text="Welcome to the app")
app.display()
| [
"guizero.Text",
"guizero.App"
] | [((37, 61), 'guizero.App', 'App', ([], {'title': '"""Hello World"""'}), "(title='Hello World')\n", (40, 61), False, 'from guizero import App, Text\n'), ((72, 108), 'guizero.Text', 'Text', (['app'], {'text': '"""Welcome to the app"""'}), "(app, text='Welcome to the app')\n", (76, 108), False, 'from guizero import App, T... |
#!/usr/bin/env python3
#
# Wrappers meant for cores used in non-LiteX contexts
#
# Copyright (C) 2021 <NAME> <<EMAIL>>
# SPDX-License-Identifier: CERN-OHL-P-2.0
#
import importlib
import os
import pkg_resources
import tempfile
from migen import *
from migen.genlib.cdc import MultiReg, PulseSynchronizer
from migen.g... | [
"migen.genlib.cdc.MultiReg",
"migen.genlib.fifo.SyncFIFOBuffered",
"pkg_resources.resource_filename",
"importlib.util.module_from_spec",
"tempfile.NamedTemporaryFile",
"os.path.abspath",
"migen.genlib.cdc.PulseSynchronizer",
"os.path.relpath"
] | [((1907, 1931), 'os.path.relpath', 'os.path.relpath', (['ip_path'], {}), '(ip_path)\n', (1922, 1931), False, 'import os\n'), ((2929, 2970), 'importlib.util.module_from_spec', 'importlib.util.module_from_spec', (['mod_spec'], {}), '(mod_spec)\n', (2960, 2970), False, 'import importlib\n'), ((3671, 3711), 'tempfile.Named... |
import bibtexparser as bp
import Levenshtein as le
import fuzzy as fz
import numpy
import scipy.misc as ch
from sklearn import linear_model
from sklearn.cross_validation import train_test_split
# from scipy import misc as ch
# import gmpy2 as ch
import re, csv, os, threading, logging, sys
from datetime import *
fr... | [
"logging.getLogger",
"Levenshtein.jaro_winkler",
"numpy.array",
"numpy.random.RandomState",
"fuzzy.Soundex",
"numpy.mean",
"os.listdir",
"numpy.exp",
"os.path.isdir",
"csv.reader",
"scipy.misc.comb",
"csv.writer",
"os.path.splitext",
"bibtexparser.bparser.BibTexParser",
"Levenshtein.dist... | [((436, 463), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (453, 463), False, 'import re, csv, os, threading, logging, sys\n'), ((2596, 2780), 'numpy.array', 'numpy.array', (['[200.064, 1.192, -3.152, 33.034, 0.0, 0.985, 80.515, -3.527, -2.33, -1.916,\n 0.006, 1.863, 0.149, -0.108, -... |
# Copyright (c) 2021 The Trustees of the University of Pennsylvania
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, co... | [
"types.MappingProxyType"
] | [((7359, 7394), 'types.MappingProxyType', 'types.MappingProxyType', (['self._steps'], {}), '(self._steps)\n', (7381, 7394), False, 'import types\n'), ((7446, 7481), 'types.MappingProxyType', 'types.MappingProxyType', (['self._elses'], {}), '(self._elses)\n', (7468, 7481), False, 'import types\n'), ((12043, 12083), 'typ... |
""" This cpawd.taskRunner module implements the running of all watch-do
tasks.
----
The following description is illustrated in the interaction diagram below.
The top level `runTasks` method initiates an `asyncio.Tasks` running the
`watchDo` method for each watch-do task. The `watchDo` method `reStart`s
an `asyncio.... | [
"logging.getLogger",
"cputils.fsWatcher.FSWatcher",
"asyncio.Event",
"cputils.debouncingTaskRunner.DebouncingTaskRunner",
"cputils.fsWatcher.getMaskName",
"cputils.debouncingTaskRunner.FileLogger"
] | [((4564, 4595), 'logging.getLogger', 'logging.getLogger', (['"""taskRunner"""'], {}), "('taskRunner')\n", (4581, 4595), False, 'import logging\n'), ((6138, 6153), 'asyncio.Event', 'asyncio.Event', ([], {}), '()\n', (6151, 6153), False, 'import asyncio\n'), ((5021, 5038), 'cputils.fsWatcher.FSWatcher', 'FSWatcher', (['l... |
from flask import Blueprint
from flask_cors import CORS
callbacks = Blueprint('callbacks', __name__)
CORS(callbacks)
from app.callbacks import routes # noqa: F401 E402
| [
"flask.Blueprint",
"flask_cors.CORS"
] | [((69, 101), 'flask.Blueprint', 'Blueprint', (['"""callbacks"""', '__name__'], {}), "('callbacks', __name__)\n", (78, 101), False, 'from flask import Blueprint\n'), ((102, 117), 'flask_cors.CORS', 'CORS', (['callbacks'], {}), '(callbacks)\n', (106, 117), False, 'from flask_cors import CORS\n')] |
# -*- coding: utf-8 -*-
"""
Created on Mon July 9 22:20:12 2018
@author: Adam
"""
import os
import sqlite3
import numpy as np
import pandas as pd
from datetime import datetime
from emonitor.core import TABLE, DATA_DIRE
from emonitor.tools import db_path, db_init, db_check, db_describe, db_insert
from emonitor.data imp... | [
"datetime.datetime",
"os.path.exists",
"sqlite3.connect",
"emonitor.tools.db_insert",
"emonitor.tools.db_describe",
"os.path.isfile",
"numpy.array",
"numpy.array_equal",
"emonitor.history",
"emonitor.data.EmonitorData",
"emonitor.tools.db_path",
"emonitor.tools.db_init",
"emonitor.tools.db_c... | [((452, 465), 'emonitor.tools.db_path', 'db_path', (['NAME'], {}), '(NAME)\n', (459, 465), False, 'from emonitor.tools import db_path, db_init, db_check, db_describe, db_insert\n'), ((469, 487), 'os.path.isfile', 'os.path.isfile', (['DB'], {}), '(DB)\n', (483, 487), False, 'import os\n'), ((514, 533), 'sqlite3.connect'... |
"""empty message
Revision ID: 0c924d67603c
Revises: <KEY>
Create Date: 2019-12-12 16:04:20.120627
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "0c924d67603c"
down_revision = "dc82194b354b"
branch_labels = None
depends_on = None
def upgrade():
# ### com... | [
"sqlalchemy.String",
"alembic.op.drop_column",
"sqlalchemy.VARCHAR"
] | [((769, 820), 'alembic.op.drop_column', 'op.drop_column', (['"""downloadable_files"""', '"""crc32c_hash"""'], {}), "('downloadable_files', 'crc32c_hash')\n", (783, 820), False, 'from alembic import op\n'), ((447, 458), 'sqlalchemy.String', 'sa.String', ([], {}), '()\n', (456, 458), True, 'import sqlalchemy as sa\n'), (... |
#
# Copyright (c) 2016-2021 <NAME>
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import numpy as np
from sklearn.utils import arrayfuncs
from sklearn import datasets
class LarsLasso:
def __init__(self, alpha: flo... | [
"numpy.copy",
"numpy.abs",
"numpy.sqrt",
"sklearn.datasets.load_boston",
"numpy.dot",
"numpy.zeros",
"numpy.linalg.inv",
"numpy.sign",
"sklearn.utils.arrayfuncs.min_pos"
] | [((3781, 3803), 'sklearn.datasets.load_boston', 'datasets.load_boston', ([], {}), '()\n', (3801, 3803), False, 'from sklearn import datasets\n'), ((628, 639), 'numpy.zeros', 'np.zeros', (['p'], {}), '(p)\n', (636, 639), True, 'import numpy as np\n'), ((718, 729), 'numpy.zeros', 'np.zeros', (['p'], {}), '(p)\n', (726, 7... |
import collections
import numbers
import torch
import torch.nn.functional as F
from types import SimpleNamespace as nm
from .bioes import entities_jie_bioes
from .viterbi import decode_bioes_logits, INFTY
EPSILON = 1.e-8
def token_and_record_accuracy(logits, labels):
'''Computes accuracy metric from logits and ... | [
"collections.defaultdict",
"torch.nn.functional.cross_entropy",
"torch.argmax"
] | [((1187, 1214), 'torch.argmax', 'torch.argmax', (['logits'], {'dim': '(2)'}), '(logits, dim=2)\n', (1199, 1214), False, 'import torch\n'), ((3586, 3613), 'torch.argmax', 'torch.argmax', (['logits'], {'dim': '(2)'}), '(logits, dim=2)\n', (3598, 3613), False, 'import torch\n'), ((5483, 5513), 'collections.defaultdict', '... |
#!/usr/bin/env python
# coding: utf-8
# <img style="float: left;padding: 1.3em" src="https://indico.in2p3.fr/event/18313/logo-786578160.png">
#
# # Gravitational Wave Open Data Workshop #3
#
#
# ## Tutorial 2.1 PyCBC Tutorial, An introduction to matched-filtering
#
# We will be using the [PyCBC](http://github.c... | [
"pylab.title",
"pycbc.waveform.get_td_waveform",
"pylab.xlabel",
"pylab.loglog",
"numpy.mean",
"pylab.ylim",
"pylab.ylabel",
"pylab.plot",
"pylab.xlim",
"numpy.random.normal",
"numpy.argmax",
"pylab.figure",
"numpy.correlate",
"scipy.stats.norm.pdf",
"numpy.std",
"matplotlib.pyplot.sho... | [((2644, 2697), 'numpy.random.normal', 'numpy.random.normal', ([], {'size': '[sample_rate * data_length]'}), '(size=[sample_rate * data_length])\n', (2663, 2697), False, 'import numpy\n'), ((3479, 3574), 'pycbc.waveform.get_td_waveform', 'get_td_waveform', ([], {'approximant': 'apx', 'mass1': '(10)', 'mass2': '(10)', '... |
import numpy
import cv2
def make2Dcolormap(
colors=(
(1, 1, 0),
(0, 0, 1),
(0, 1, 0),
(1, 0, 0),
), size=20):
######################
colormap = numpy.zeros((2, 2, 3))
colormap[1, 1] = colors[0]
colormap[0, 1] = colors[1]
colormap[0, ... | [
"numpy.clip",
"numpy.zeros",
"cv2.resize"
] | [((219, 241), 'numpy.zeros', 'numpy.zeros', (['(2, 2, 3)'], {}), '((2, 2, 3))\n', (230, 241), False, 'import numpy\n'), ((401, 435), 'cv2.resize', 'cv2.resize', (['colormap', '(size, size)'], {}), '(colormap, (size, size))\n', (411, 435), False, 'import cv2\n'), ((451, 477), 'numpy.clip', 'numpy.clip', (['colormap', '(... |
# Copyright (c) 2019 <NAME>.
# Cura is released under the terms of the LGPLv3 or higher.
from unittest.mock import patch, MagicMock
import pytest
from UM.Settings.DefinitionContainer import DefinitionContainer
from cura.Machines.ContainerTree import ContainerTree
from cura.Settings.GlobalStack import GlobalStack
def... | [
"unittest.mock.MagicMock",
"cura.Machines.ContainerTree.ContainerTree"
] | [((373, 400), 'unittest.mock.MagicMock', 'MagicMock', ([], {'spec': 'GlobalStack'}), '(spec=GlobalStack)\n', (382, 400), False, 'from unittest.mock import patch, MagicMock\n'), ((433, 470), 'unittest.mock.MagicMock', 'MagicMock', ([], {'return_value': 'definition_id'}), '(return_value=definition_id)\n', (442, 470), Fal... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" The Cannon for absolute stellar luminosities. """
__author__ = "<NAME> <<EMAIL>>"
import logging
import numpy as np
from warnings import simplefilter
# Speak up.
logging.basicConfig(level=logging.INFO,
format="%(asctime)s [%(levelname)s] %(message)s")
logger = ... | [
"logging.basicConfig",
"warnings.simplefilter",
"logging.getLogger"
] | [((216, 310), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(asctime)s [%(levelname)s] %(message)s"""'}), "(level=logging.INFO, format=\n '%(asctime)s [%(levelname)s] %(message)s')\n", (235, 310), False, 'import logging\n'), ((320, 347), 'logging.getLogger', 'logging.get... |
import tkinter as tk
from tkinter import filedialog
import pyproj
import shapefile
import shapely.geometry
class Map(tk.Canvas):
projections = {
'mercator': pyproj.Proj(init="epsg:3395"),
'spherical': pyproj.Proj('+proj=ortho +lon_0=28 +lat_0=47')
}
def __init__(self, root):
... | [
"tkinter.Menu",
"shapefile.Reader",
"tkinter.Tk",
"tkinter.filedialog.askopenfilenames",
"pyproj.Proj"
] | [((6809, 6816), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (6814, 6816), True, 'import tkinter as tk\n'), ((172, 201), 'pyproj.Proj', 'pyproj.Proj', ([], {'init': '"""epsg:3395"""'}), "(init='epsg:3395')\n", (183, 201), False, 'import pyproj\n'), ((224, 270), 'pyproj.Proj', 'pyproj.Proj', (['"""+proj=ortho +lon_0=28 +lat... |
# -*- coding: utf-8 -*-
import pytest
import pycamunda.identity
import pycamunda.group
import pycamunda.user
def test_group_load(my_users_groups_json):
users_groups = pycamunda.identity.UsersGroups.load(my_users_groups_json)
assert all(isinstance(group, pycamunda.group.Group) for group in users_groups.grou... | [
"pytest.raises"
] | [((623, 646), 'pytest.raises', 'pytest.raises', (['KeyError'], {}), '(KeyError)\n', (636, 646), False, 'import pytest\n')] |
# Copyright 2019 Nokia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... | [
"logging.getLogger",
"os.listdir",
"subprocess.check_call",
"os.path.join",
"re.match",
"rpmbuilder.executor.Executor",
"os.path.isfile",
"os.path.isdir",
"rpmUtils.miscutils.splitFilename",
"re.search"
] | [((932, 959), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (949, 959), False, 'import logging\n'), ((1366, 1408), 'os.path.join', 'os.path.join', (['directory', 'self.specfilename'], {}), '(directory, self.specfilename)\n', (1378, 1408), False, 'import os\n'), ((2044, 2071), 'logging.ge... |
from typing import Dict
import psycopg2
from DBConfig import db_config
class DBConnection:
__config: Dict[str, str]
__conn: psycopg2
def __init__(self):
self.__config = db_config
print(self.__config)
self.__conn = psycopg2.connect(
host=self.__config['host'],
... | [
"psycopg2.connect"
] | [((254, 399), 'psycopg2.connect', 'psycopg2.connect', ([], {'host': "self.__config['host']", 'database': "self.__config['database']", 'user': "self.__config['user']", 'password': "self.__config['pass']"}), "(host=self.__config['host'], database=self.__config[\n 'database'], user=self.__config['user'], password=self.... |
import numpy as np
from gym_cooking.cooking_world.world_objects import *
from collections import namedtuple
GraphicScaling = namedtuple("GraphicScaling", ["holding_scale", "container_scale"])
class GraphicStore:
OBJECT_PROPERTIES = {Blender: GraphicScaling(None, 0.5)}
def __init__(self, world_height, worl... | [
"collections.namedtuple",
"numpy.asarray"
] | [((127, 193), 'collections.namedtuple', 'namedtuple', (['"""GraphicScaling"""', "['holding_scale', 'container_scale']"], {}), "('GraphicScaling', ['holding_scale', 'container_scale'])\n", (137, 193), False, 'from collections import namedtuple\n'), ((645, 671), 'numpy.asarray', 'np.asarray', (['self.tile_size'], {}), '(... |
#!/usr/bin/env python3
# Convert HTML returned by http://tagger.jensenlab.org/ExtractPopup
# into brat-flavoured standoff (http://brat.nlplab.org/standoff.html).
import sys
import os
from collections import defaultdict
from html.parser import HTMLParser
from logging import warn, error
EXTRACT_DATA_CONTENT_CLASS = ... | [
"logging.warn",
"argparse.ArgumentParser",
"os.path.join",
"collections.defaultdict",
"os.path.basename"
] | [((1080, 1105), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1103, 1105), False, 'import argparse\n'), ((7517, 7534), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (7528, 7534), False, 'from collections import defaultdict\n'), ((8087, 8126), 'os.path.join', 'os.path.j... |
"""Upload CSMR data to t3 table so EpiViz can access it for plotting."""
import pandas as pd
from cascade.core import getLoggers
from cascade.core.db import cursor, db_queries
from cascade.input_data.db import METRIC_IDS, MEASURE_IDS, GBDDataError
CODELOG, MATHLOG = getLoggers(__name__)
def _csmr_in_t3(execution_c... | [
"cascade.input_data.db.GBDDataError",
"cascade.core.db.cursor",
"cascade.core.getLoggers",
"cascade.core.db.db_queries.get_outputs",
"pandas.notnull"
] | [((270, 290), 'cascade.core.getLoggers', 'getLoggers', (['__name__'], {}), '(__name__)\n', (280, 290), False, 'from cascade.core import getLoggers\n'), ((696, 721), 'cascade.core.db.cursor', 'cursor', (['execution_context'], {}), '(execution_context)\n', (702, 721), False, 'from cascade.core.db import cursor, db_querie... |
import numpy as np
import seaborn as sns
import matplotlib.pyplot as pl
from sklearn.metrics import roc_curve
def uim_data(N=20, M=100, sparsity=0.1, frac_test=0.2, show=True, fill_num=0.9,
fs=30):
"""
Show splitting by frac_test using random holdout.
"""
np.random.seed(1234)
tot_size... | [
"seaborn.cubehelix_palette",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.ylabel",
"numpy.argsort",
"numpy.array",
"sklearn.metrics.roc_curve",
"numpy.arange",
"matplotlib.pyplot.imshow",
"numpy.mean",
"numpy.where",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.max",
"matpl... | [((287, 307), 'numpy.random.seed', 'np.random.seed', (['(1234)'], {}), '(1234)\n', (301, 307), True, 'import numpy as np\n'), ((345, 374), 'numpy.round', 'np.round', (['(tot_size * sparsity)'], {}), '(tot_size * sparsity)\n', (353, 374), True, 'import numpy as np\n'), ((538, 564), 'matplotlib.pyplot.figure', 'pl.figure... |
#This includes many words.
from random import randint
WORDS_DIC_SUBJ_THIRDA = ['Apple','Ken','Banana','Jvvg','Everybody','Kaj','ST','She','He','The dog','Scratch Cat','Pico','Nano','Giga','Tera','Gobo','TemplatesFTW']
WORDS_FIRST="I"
WORDS_DIC_SUBJ_THIRDM = ['They','The dogs', 'The cats','My bags','The bots','Scratch... | [
"random.randint"
] | [((2867, 2880), 'random.randint', 'randint', (['(0)', '(1)'], {}), '(0, 1)\n', (2874, 2880), False, 'from random import randint\n'), ((2766, 2779), 'random.randint', 'randint', (['(0)', '(2)'], {}), '(0, 2)\n', (2773, 2779), False, 'from random import randint\n')] |
import os
import re
import requests
from datetime import datetime as dt
import dotenv
from shared_library.shared_library import generate_workfolder, delete_workfolder
from listener.listener import Listener
from speaker.speaker import Speaker
dotenv.load_dotenv()
ACTIVATION_WORD = os.environ.get("ACTIVATION_WORD")
pr... | [
"os.environ.get",
"speaker.speaker.Speaker",
"shared_library.shared_library.delete_workfolder",
"dotenv.load_dotenv",
"re.match",
"datetime.datetime.now",
"requests.get",
"shared_library.shared_library.generate_workfolder",
"listener.listener.Listener"
] | [((243, 263), 'dotenv.load_dotenv', 'dotenv.load_dotenv', ([], {}), '()\n', (261, 263), False, 'import dotenv\n'), ((283, 316), 'os.environ.get', 'os.environ.get', (['"""ACTIVATION_WORD"""'], {}), "('ACTIVATION_WORD')\n", (297, 316), False, 'import os\n'), ((406, 427), 'shared_library.shared_library.generate_workfolder... |
# coding=utf-8
"""
@Author: <NAME>
@Email: <EMAIL>
@File: check.py
@Created: 2020/9/4 18:14
@Desc:
"""
import re
from typing import Union
class Check:
def __init__(self, target):
self._target = target
def contains_any(self, values: Union[list, tuple, str]):
if isinstance(values, str):
... | [
"re.compile"
] | [((2604, 2617), 're.compile', 're.compile', (['v'], {}), '(v)\n', (2614, 2617), False, 'import re\n'), ((2557, 2570), 're.compile', 're.compile', (['v'], {}), '(v)\n', (2567, 2570), False, 'import re\n')] |
import cv2
import time
import os
def tomar():
cam = cv2.VideoCapture(0)
s, im = cam.read()
#cv2.waitKey()
hora = time.strftime("%H%M%S")
fecha = time.strftime("%Y%m%d")
#cv2.imshow(fecha+"_"+hora, im)
cv2.imwrite("fotos/"+fecha+"/"+hora+".jpg",im)
def deteccion():
fecha = time.strftime("%Y%... | [
"cv2.imwrite",
"os.path.exists",
"os.makedirs",
"time.strftime",
"cv2.VideoCapture"
] | [((59, 78), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (75, 78), False, 'import cv2\n'), ((127, 150), 'time.strftime', 'time.strftime', (['"""%H%M%S"""'], {}), "('%H%M%S')\n", (140, 150), False, 'import time\n'), ((161, 184), 'time.strftime', 'time.strftime', (['"""%Y%m%d"""'], {}), "('%Y%m%d')\n",... |
import sqlite3
import os
import logging
from zipfile import ZipFile
from collections import defaultdict
from operator import itemgetter
from backtest import constants
def median(values):
sorts = sorted(values)
length = len(sorts)
if not length % 2:
return (sorts[length / 2] + sorts[le... | [
"logging.basicConfig",
"operator.itemgetter",
"collections.defaultdict",
"zipfile.ZipFile"
] | [((2676, 2780), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG', 'format': '"""%(levelname)s %(asctime)s %(module)s %(message)s"""'}), "(level=logging.DEBUG, format=\n '%(levelname)s %(asctime)s %(module)s %(message)s')\n", (2695, 2780), False, 'import logging\n'), ((870, 897), 'zipfile.... |
from flask import Flask
app = Flask(__name__)
import time
@app.route('/')
def hello_world():
return 'Hello world!'
t = time.localtime()
current_time = time.strftime("%H:%M:%S", t)
print(current_time)
app.run(host='0.0.0.0',
port=8080,
debug=True)
| [
"time.localtime",
"time.strftime",
"flask.Flask"
] | [((30, 45), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (35, 45), False, 'from flask import Flask\n'), ((127, 143), 'time.localtime', 'time.localtime', ([], {}), '()\n', (141, 143), False, 'import time\n'), ((159, 187), 'time.strftime', 'time.strftime', (['"""%H:%M:%S"""', 't'], {}), "('%H:%M:%S', t)\n"... |
from .base_settings import *
import os
import sys
PRJ_ROOT = os.path.normpath(os.path.dirname(__file__))
DEBUG = True
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'biblioteca',
'USER': 'biblioteca',
'PASSWORD': '<PASSWORD>',
... | [
"os.path.dirname"
] | [((79, 104), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (94, 104), False, 'import os\n')] |
import os
# src_dir = "/usr/lib/x86_64-linux-gnu"
src_dir = "/mnt/drive_c/datasets/kaju/opencv_libs"
# dst_dir = None
dst_dir = None
libname = "opencv"
# libversion = "1.58.0"
# leading . needed
src_libversion = ""
dst_libversion = ".4.0.0"
dry_run = True
if not dst_dir:
dst_dir = src_dir
files = os.listdir(src_d... | [
"os.listdir",
"os.path.join",
"os.symlink",
"os.remove"
] | [((304, 323), 'os.listdir', 'os.listdir', (['src_dir'], {}), '(src_dir)\n', (314, 323), False, 'import os\n'), ((642, 690), 'os.path.join', 'os.path.join', (['src_dir', '(filename + src_libversion)'], {}), '(src_dir, filename + src_libversion)\n', (654, 690), False, 'import os\n'), ((710, 758), 'os.path.join', 'os.path... |
#!/usr/bin/env python
"""
Input: User-defined set of filters and the database authentifications.
Output: set of compounds that pass all the selected filters.
"""
import argparse
import json
import sys
import cheminfolib
import psycopg2.extras
cheminfolib.pybel_stop_logging()
def parse_command_line(argv):
parse... | [
"cheminfolib.print_output",
"argparse.ArgumentParser",
"cheminfolib.db_connect",
"cheminfolib.pybel_stop_logging"
] | [((246, 278), 'cheminfolib.pybel_stop_logging', 'cheminfolib.pybel_stop_logging', ([], {}), '()\n', (276, 278), False, 'import cheminfolib\n'), ((324, 349), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (347, 349), False, 'import argparse\n'), ((1305, 1333), 'cheminfolib.db_connect', 'cheminfo... |
#! /bin/python3
print('generating code from xml protocols')
from os import path, listdir;
from sys import argv;
from subprocess import run;
if len(argv) < 2:
print('please specify the path for the protocols')
exit(1)
elif len(argv) > 2:
print('too many arguments')
base_path = argv[1]
xml_files = [ path.join(base_pat... | [
"os.listdir",
"os.path.join"
] | [((302, 327), 'os.path.join', 'path.join', (['base_path', 'xml'], {}), '(base_path, xml)\n', (311, 327), False, 'from os import path, listdir\n'), ((339, 357), 'os.listdir', 'listdir', (['base_path'], {}), '(base_path)\n', (346, 357), False, 'from os import path, listdir\n')] |
# Various functions and methods for preprocessing/metric measurement/plotting etc...
import numpy as np
import matplotlib.pyplot as plt
########################################################################################################################
# Metrics ###################################################... | [
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.argmax",
"numpy.sum",
"numpy.load",
"matplotlib.pyplot.legend"
] | [((2501, 2534), 'numpy.sum', 'np.sum', (['[(x == 0) for x in truth]'], {}), '([(x == 0) for x in truth])\n', (2507, 2534), True, 'import numpy as np\n'), ((2548, 2581), 'numpy.sum', 'np.sum', (['[(x == 1) for x in truth]'], {}), '([(x == 1) for x in truth])\n', (2554, 2581), True, 'import numpy as np\n'), ((2595, 2628)... |
from django.contrib.auth.models import User, Group
from .models import EveService, EveInvoice, EvePayment
from django.dispatch import receiver
from django.db.models.signals import post_save
from django.db import transaction
from .email import send_service_request_notification, send_service_update_notification, send_inv... | [
"logging.getLogger",
"django.db.transaction.on_commit",
"django.dispatch.receiver",
"django.contrib.auth.models.User.objects.filter"
] | [((363, 390), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (380, 390), False, 'import logging\n'), ((393, 431), 'django.dispatch.receiver', 'receiver', (['post_save'], {'sender': 'EveService'}), '(post_save, sender=EveService)\n', (401, 431), False, 'from django.dispatch import receiver... |
import model
import time
def izpis_igre(igra):
konec_igre = model.konec_igre
print('---Dobrodosli v igri potapljanje ladjic---')
print('Imate 40 strelov, da zadanete 4 ladje velikosti 2, 3, 4, 5. Naj se bitka zacne!')
while not konec_igre:
for vrstica in igra.izpisi_plosco():
print... | [
"model.nova_igra",
"time.time"
] | [((1196, 1213), 'model.nova_igra', 'model.nova_igra', ([], {}), '()\n', (1211, 1213), False, 'import model\n'), ((1067, 1078), 'time.time', 'time.time', ([], {}), '()\n', (1076, 1078), False, 'import time\n'), ((543, 554), 'time.time', 'time.time', ([], {}), '()\n', (552, 554), False, 'import time\n')] |
import os
import sys
import threading
from queue import Empty
from google.cloud import translate
os.environ["GOOGLE_APPLICATION_CREDENTIALS"]=os.path.join(os.path.dirname(__file__), "creds.json")
def translate_text(translation_client, text="<NAME>", project_id="wearableai", source_language="es", target_language="en")... | [
"threading.currentThread",
"os.path.dirname",
"google.cloud.translate.TranslationServiceClient"
] | [((156, 181), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (171, 181), False, 'import os\n'), ((1317, 1353), 'google.cloud.translate.TranslationServiceClient', 'translate.TranslationServiceClient', ([], {}), '()\n', (1351, 1353), False, 'from google.cloud import translate\n'), ((1363, 1388)... |
"""
Verify the functionality of the evaluation suite.
Executes the evaluation procedure against five samples and outputs the
results. Compare them with the results from the BSDS dataset to verify
that this Python port works properly.
"""
import os
import config_main
import tqdm
from Benchmarking.bsds500.bsds.bsds_dat... | [
"os.path.exists",
"Utils.log_handler.log_setup_info_to_console",
"Utils.log_handler.log_benchmark_info_to_console",
"Benchmarking.bsds500.bsds.evaluate_boundaries.pr_evaluation",
"os.makedirs",
"os.path.join",
"Benchmarking.bsds500.bsds.bsds_dataset.BSDSDataset.load_boundaries",
"os.getcwd",
"skimag... | [((734, 770), 'Benchmarking.bsds500.bsds.bsds_dataset.BSDSDataset.load_boundaries', 'BSDSDataset.load_boundaries', (['gt_path'], {}), '(gt_path)\n', (761, 770), False, 'from Benchmarking.bsds500.bsds.bsds_dataset import BSDSDataset\n'), ((1018, 1075), 'Utils.log_handler.log_setup_info_to_console', 'log_setup_info_to_co... |
# The MIT License (MIT).
# Copyright (c) 2015, <NAME> & contributors.
from imapfw.imap import Imap as ImapBackend
from imapfw.interface import adapts, checkInterfaces
from .driver import Driver, DriverInterface
# Annotations.
from imapfw.imap import SearchConditions, FetchAttributes
from imapfw.types.folder import F... | [
"imapfw.interface.checkInterfaces",
"imapfw.interface.adapts",
"imapfw.imap.SearchConditions"
] | [((480, 510), 'imapfw.interface.checkInterfaces', 'checkInterfaces', ([], {'reverse': '(False)'}), '(reverse=False)\n', (495, 510), False, 'from imapfw.interface import adapts, checkInterfaces\n'), ((512, 535), 'imapfw.interface.adapts', 'adapts', (['DriverInterface'], {}), '(DriverInterface)\n', (518, 535), False, 'fr... |
from chat import db
async def get_chat(conn, chat_id):
chat_records = await conn.execute(
db.chat.select().
where(db.chat.c.id == chat_id),
)
return await chat_records.fetchone()
async def get_chat_participants(conn, chat_id):
participant_records = await conn.execute(
db.part... | [
"chat.db.message_status.insert",
"chat.db.participant_chat.select",
"chat.db.user.select",
"chat.db.chat.select",
"chat.db.message.insert",
"chat.db.token.select"
] | [((521, 537), 'chat.db.user.select', 'db.user.select', ([], {}), '()\n', (535, 537), False, 'from chat import db\n'), ((649, 666), 'chat.db.token.select', 'db.token.select', ([], {}), '()\n', (664, 666), False, 'from chat import db\n'), ((104, 120), 'chat.db.chat.select', 'db.chat.select', ([], {}), '()\n', (118, 120),... |
#!/usr/bin/env python
'''
Base class and example implementations for serial destinations. Anything that implements
write and optionally close can be used too.
A destination can get just the item or a tuple with id and item, depending on how the processor
was configured before running.
NOTE: the set_data method was adde... | [
"json.dumps"
] | [((2420, 2436), 'json.dumps', 'json.dumps', (['item'], {}), '(item)\n', (2430, 2436), False, 'import json\n')] |
import os
import time
import re
from common.constant import Constant
import shutil
def archive_file(filepath=Constant.REPORT_DIR) -> None: # 打包归档文件
file = os.path.join(filepath, "history", time.strftime("%Y%m%d"))
dirs = str(os.listdir(filepath))
p = r"\w+.html"
dirs = re.findall(p, dirs)
if not ... | [
"os.path.exists",
"os.listdir",
"os.makedirs",
"time.strftime",
"re.findall"
] | [((289, 308), 're.findall', 're.findall', (['p', 'dirs'], {}), '(p, dirs)\n', (299, 308), False, 'import re\n'), ((196, 219), 'time.strftime', 'time.strftime', (['"""%Y%m%d"""'], {}), "('%Y%m%d')\n", (209, 219), False, 'import time\n'), ((236, 256), 'os.listdir', 'os.listdir', (['filepath'], {}), '(filepath)\n', (246, ... |
import matplotlib as mpl
import os
import numpy as np
def figsize(scale):
fig_width_pt = 510.
inches_per_pt = 1.0/72.27
golden_mean = (np.sqrt(5.0)-1.0)/2.
fig_width = fig_width_pt * inches_per_pt * scale
fig_height = fig_width_pt * inches_per_pt * golden_mean * 0.5
fig_size = [fig_width, fig_h... | [
"numpy.mean",
"numpy.shape",
"matplotlib.pyplot.axvspan",
"matplotlib.pyplot.savefig",
"numpy.sqrt",
"matplotlib.rcParams.update",
"matplotlib.pyplot.ylabel",
"matplotlib.use",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.tick_params",
... | [((349, 363), 'matplotlib.use', 'mpl.use', (['"""pgf"""'], {}), "('pgf')\n", (356, 363), True, 'import matplotlib as mpl\n'), ((758, 803), 'matplotlib.rcParams.update', 'mpl.rcParams.update', (['pgf_with_custom_preamble'], {}), '(pgf_with_custom_preamble)\n', (777, 803), True, 'import matplotlib as mpl\n'), ((2153, 229... |
from django.urls import path, include
from . import views
app_name = "articles"
urlpatterns = [
path('', views.ArticleList.as_view(), name='all_articles'),
path('<str:slug>/', views.ArticleDetail.as_view(), name='article_detail'),
path('<str:slug>/like/', views.LikeArticle.as_view(), name='like_article')... | [
"django.urls.include"
] | [((476, 533), 'django.urls.include', 'include', (['"""authors.apps.ratings.urls"""'], {'namespace': '"""ratings"""'}), "('authors.apps.ratings.urls', namespace='ratings')\n", (483, 533), False, 'from django.urls import path, include\n')] |
from tkinter import *
import random
import PA_func as pf
import sqlite3
import datetime
import Expressions as xp
sqlite_file = 'assistant.sqlite'
conn = sqlite3.connect(sqlite_file)
c = conn.cursor()
now = datetime.datetime.now()
def start_gui():
master = Tk()
master.geometry('450x400')
m... | [
"random.choice",
"PA_func.locate_user_state",
"sqlite3.connect",
"PA_func.user_dob",
"PA_func.name_user",
"PA_func.create_assistant",
"datetime.datetime.now",
"PA_func.create_user",
"PA_func.locate_user_zip",
"PA_func.name_assistant",
"PA_func.locate_user_city"
] | [((162, 190), 'sqlite3.connect', 'sqlite3.connect', (['sqlite_file'], {}), '(sqlite_file)\n', (177, 190), False, 'import sqlite3\n'), ((217, 240), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (238, 240), False, 'import datetime\n'), ((547, 568), 'PA_func.create_assistant', 'pf.create_assistant', ... |
import re
from typing import Match, Optional, Tuple
import aqt
import aqt.utils
from PyQt5.QtGui import QColor
from .helpers import ColorParsingError, Defaults
RawColor = Tuple[float, float, float, float]
class _ColorParser:
def parse(self, color: Optional[str], color_fallback: QColor) -> QColor:
if ... | [
"re.compile",
"PyQt5.QtGui.QColor",
"PyQt5.QtGui.QColor.fromHslF",
"PyQt5.QtGui.QColor.fromRgbF",
"aqt.utils.showInfo"
] | [((3812, 3830), 're.compile', 're.compile', (['"""\\\\w+"""'], {}), "('\\\\w+')\n", (3822, 3830), False, 'import re\n'), ((3864, 4035), 're.compile', 're.compile', (['"""\n ^\\\\#(\n\n [A-Fa-f0-9]{6}\n\n |\n\n [A-Fa-f0-9]{3}\n )$\n """'], {'flags... |
import time
import uuid
import hashlib
import json
import requests
from exceptions import PyiCloudFailedLoginException
from services import (
FindMyiPhoneServiceManager,
CalendarService,
UbiquityService,
ContactsService,
)
class PyiCloudService(object):
"""
A base authentication class for the... | [
"requests.Session",
"json.dumps",
"services.ContactsService",
"services.FindMyiPhoneServiceManager",
"uuid.uuid4",
"services.UbiquityService",
"uuid.uuid1",
"services.CalendarService",
"exceptions.PyiCloudFailedLoginException"
] | [((1273, 1291), 'requests.Session', 'requests.Session', ([], {}), '()\n', (1289, 1291), False, 'import requests\n'), ((3390, 3457), 'services.FindMyiPhoneServiceManager', 'FindMyiPhoneServiceManager', (['service_root', 'self.session', 'self.params'], {}), '(service_root, self.session, self.params)\n', (3416, 3457), Fal... |
""" Some useful functions in various parts of BERNAISE. """
import dolfin as df
import ufl
__author__ = "<NAME>"
# Phase field chemical potential
def pf_potential(phi):
""" Phase field potential. """
return 0.25*(1.-phi**2)**2
def diff_pf_potential(phi):
""" Derivative of the phase field potential. """
... | [
"dolfin.ln",
"ufl.min_value",
"ufl.sign",
"ufl.max_value",
"dolfin.Constant"
] | [((1589, 1621), 'dolfin.Constant', 'df.Constant', (['(0.5 * (A[0] - A[1]))'], {}), '(0.5 * (A[0] - A[1]))\n', (1600, 1621), True, 'import dolfin as df\n'), ((1976, 1987), 'ufl.sign', 'ufl.sign', (['a'], {}), '(a)\n', (1984, 1987), False, 'import ufl\n'), ((2022, 2041), 'ufl.max_value', 'ufl.max_value', (['a', 'b'], {})... |
# -*- coding: utf-8 -*-
from dataclasses import dataclass
from pprint import pprint
from serpyco import Serializer
@dataclass
class Point(object):
x: float
y: float
serializer = Serializer(Point)
pprint(serializer.json_schema())
pprint(serializer.load({"x": 3.14, "y": 1.5}))
try:
serializer.load({"x"... | [
"serpyco.Serializer",
"pprint.pprint"
] | [((192, 209), 'serpyco.Serializer', 'Serializer', (['Point'], {}), '(Point)\n', (202, 209), False, 'from serpyco import Serializer\n'), ((371, 381), 'pprint.pprint', 'pprint', (['ex'], {}), '(ex)\n', (377, 381), False, 'from pprint import pprint\n'), ((522, 532), 'pprint.pprint', 'pprint', (['ex'], {}), '(ex)\n', (528,... |
from mmdet.apis import init_detector, inference_detector
import mmcv
import os
import time
config_file = 'configs/cascade_rcnn/cascade_rcnn_r101_fpn_1x_coco.py'
checkpoint_file = 'checkpoints/cascade_rcnn_r101_fpn_1x_coco_20200317-0b6a2fbf.pth'
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
input_dir = '../eval_code/select1... | [
"os.listdir",
"mmdet.apis.init_detector",
"mmcv.imread",
"mmdet.apis.inference_detector",
"time.time"
] | [((405, 465), 'mmdet.apis.init_detector', 'init_detector', (['config_file', 'checkpoint_file'], {'device': '"""cuda:0"""'}), "(config_file, checkpoint_file, device='cuda:0')\n", (418, 465), False, 'from mmdet.apis import init_detector, inference_detector\n'), ((475, 496), 'os.listdir', 'os.listdir', (['input_dir'], {})... |
import pytest
import base64
from mock import MagicMock
from volttrontesting.utils.utils import AgentMock
from volttron.platform.vip.agent import Agent
from volttroncentral.platforms import PlatformHandler, Platforms
from volttroncentral.agent import VolttronCentralAgent
@pytest.fixture
def mock_vc():
VolttronCent... | [
"mock.MagicMock",
"volttroncentral.agent.VolttronCentralAgent",
"volttroncentral.platforms.Platforms"
] | [((402, 424), 'volttroncentral.agent.VolttronCentralAgent', 'VolttronCentralAgent', ([], {}), '()\n', (422, 424), False, 'from volttroncentral.agent import VolttronCentralAgent\n'), ((552, 573), 'volttroncentral.platforms.Platforms', 'Platforms', ([], {'vc': 'mock_vc'}), '(vc=mock_vc)\n', (561, 573), False, 'from voltt... |
###modified based on centernet###
#MIT License
#Copyright (c) 2019 <NAME>
#All rights reserved.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
import datetime
import pycocotools.coco as coco
from pycocotools.cocoeval import COCOeval
import nump... | [
"numpy.clip",
"numpy.sqrt",
"re.compile",
"numpy.log",
"torch.from_numpy",
"numpy.array",
"torch.utils.data.distributed.DistributedSampler",
"numpy.sin",
"numpy.random.RandomState",
"numpy.arange",
"numpy.random.random",
"numpy.asarray",
"pycocotools.coco.COCO",
"numpy.exp",
"numpy.dot",... | [((9777, 9797), 're.compile', 're.compile', (['"""[SaUO]"""'], {}), "('[SaUO]')\n", (9787, 9797), False, 'import re\n'), ((601, 628), 'torch.manual_seed', 'torch.manual_seed', (['opt.seed'], {}), '(opt.seed)\n', (618, 628), False, 'import torch\n'), ((742, 855), 'torch.utils.data.distributed.DistributedSampler', 'torch... |
from util.webRequest import WebRequest
import requests
import re
import json
import time
csdnWebSite="https://blog.csdn.net/"
csdnUserName = "hubaoquanu"
# 只刷大于该Blog ID的Blog
MIN_BLOG_ID=105890062
# 下载首页,一般新发表的文章在首页 https://blog.csdn.net/hubaoquanu/
content = WebRequest().get(csdnWebSite+csdnUserName, timeout=10)
# 提取文... | [
"json.loads",
"time.sleep",
"requests.head",
"util.webRequest.WebRequest",
"re.findall"
] | [((336, 414), 're.findall', 're.findall', (["(csdnWebSite + csdnUserName + '/article/details/\\\\d*')", 'content.text'], {}), "(csdnWebSite + csdnUserName + '/article/details/\\\\d*', content.text)\n", (346, 414), False, 'import re\n'), ((811, 845), 'json.loads', 'json.loads', (['proxy_server_json.text'], {}), '(proxy_... |
from time import sleep
from SimConnect import *
from math import ceil
import sys
class WeightManager:
def __init__(self) -> None:
self.sm = SimConnect()
self.aq = AircraftRequests(self.sm)
self.ae = AircraftEvents(self.sm)
self.extra_weight = 0
self._request_sleep = 0.01
... | [
"math.ceil",
"time.sleep"
] | [((535, 561), 'time.sleep', 'sleep', (['self._request_sleep'], {}), '(self._request_sleep)\n', (540, 561), False, 'from time import sleep\n'), ((1275, 1306), 'math.ceil', 'ceil', (['(weight / num_payload_bays)'], {}), '(weight / num_payload_bays)\n', (1279, 1306), False, 'from math import ceil\n'), ((822, 848), 'time.s... |
import yaml
import logging
from importlib import import_module
from securitybot.auth.auth import BaseAuthClient
from securitybot.chat.chat import BaseChatClient
from securitybot.db.database import BaseDbClient
from securitybot.secretsmgmt.secretsmgmt import BaseSecretsClient
from securitybot.tasker import Tasker
... | [
"securitybot.tasker.Tasker",
"importlib.import_module"
] | [((4135, 4151), 'securitybot.tasker.Tasker', 'Tasker', (['dbclient'], {}), '(dbclient)\n', (4141, 4151), False, 'from securitybot.tasker import Tasker\n'), ((684, 710), 'importlib.import_module', 'import_module', (['module_name'], {}), '(module_name)\n', (697, 710), False, 'from importlib import import_module\n'), ((25... |
import sqlite3 as sql
def create(CPF, nome, password, email, telefone, rua, numero, bairro, cidade, estado, CEP, complemento):
print("ok")
with sql.connect("db/agrifacil.db") as con:
cur = con.cursor()
cur.execute("INSERT into consumidor (CPF, nome, password, telefone, email, rua, numero, bairr... | [
"sqlite3.connect"
] | [((153, 183), 'sqlite3.connect', 'sql.connect', (['"""db/agrifacil.db"""'], {}), "('db/agrifacil.db')\n", (164, 183), True, 'import sqlite3 as sql\n'), ((598, 628), 'sqlite3.connect', 'sql.connect', (['"""db/agrifacil.db"""'], {}), "('db/agrifacil.db')\n", (609, 628), True, 'import sqlite3 as sql\n')] |
# Sciprt to calculate user location centroids with parallel processing
import multiprocessing
import psycopg2 # For connecting to PostgreSQL database
import pandas as pd # Data analysis toolkit with flexible data structures
import numpy as np # Fundamental toolkit for scientific computation with N-dimensional array s... | [
"psycopg2.connect",
"sqlalchemy.create_engine",
"multiprocessing.Pool",
"pandas.DataFrame"
] | [((541, 602), 'psycopg2.connect', 'psycopg2.connect', (['"""dbname=\'yelp\' host=\'\' user=\'\' password=\'\'"""'], {}), '("dbname=\'yelp\' host=\'\' user=\'\' password=\'\'")\n', (557, 602), False, 'import psycopg2\n'), ((844, 862), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {}), '(data)\n', (856, 862), True, 'imp... |
import os
from setuptools import find_packages, setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-orgapy',
ver... | [
"os.path.abspath",
"os.path.dirname",
"setuptools.find_packages"
] | [((347, 362), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (360, 362), False, 'from setuptools import find_packages, setup\n'), ((78, 103), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (93, 103), False, 'import os\n'), ((239, 264), 'os.path.abspath', 'os.path.abspath', (['... |
import numpy as np
from keras_htr import compute_output_shape
from keras_htr.adapters.base import BatchAdapter
import tensorflow as tf
class CTCAdapter(BatchAdapter):
def compute_input_lengths(self, image_arrays):
batch_size = len(image_arrays)
lstm_input_shapes = [compute_output_shape(a.shape) f... | [
"numpy.array",
"tensorflow.keras.preprocessing.image.img_to_array",
"keras_htr.compute_output_shape"
] | [((1404, 1452), 'tensorflow.keras.preprocessing.image.img_to_array', 'tf.keras.preprocessing.image.img_to_array', (['image'], {}), '(image)\n', (1445, 1452), True, 'import tensorflow as tf\n'), ((289, 318), 'keras_htr.compute_output_shape', 'compute_output_shape', (['a.shape'], {}), '(a.shape)\n', (309, 318), False, 'f... |
# -*- coding: utf-8 -*-
from GAparsimony.lhs.util import isValidLHS, isValidLHS_int
from GAparsimony.lhs import geneticLHS, improvedLHS, maximinLHS, optimumLHS, randomLHS, randomLHS_int
import pytest
@pytest.mark.parametrize("shape", [
(2, 2),
(6, 6),
(3, 8)
])
def test_randomLHS_int(shape):
assert i... | [
"GAparsimony.lhs.maximinLHS",
"GAparsimony.lhs.randomLHS_int",
"pytest.mark.parametrize",
"GAparsimony.lhs.randomLHS",
"GAparsimony.lhs.improvedLHS",
"GAparsimony.lhs.optimumLHS",
"GAparsimony.lhs.geneticLHS"
] | [((204, 262), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""shape"""', '[(2, 2), (6, 6), (3, 8)]'], {}), "('shape', [(2, 2), (6, 6), (3, 8)])\n", (227, 262), False, 'import pytest\n'), ((359, 417), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""shape"""', '[(2, 2), (6, 6), (3, 8)]'], {}), "('... |
import networkx as nx
from matplotlib import pyplot as plt
graph = nx.DiGraph()
graph.add_edges_from([("root", "a"), ("a", "b"), ("a", "e"), ("b", "c"), ("b", "d"), ("d", "e")])
graph.nodes() # => NodeView(('root', 'a', 'b', 'e', 'c', 'd'))
nx.shortest_path(graph, 'root', 'e') # => ['root', 'a', 'e']
nx.d... | [
"networkx.dag_longest_path",
"networkx.topological_sort",
"networkx.is_directed",
"networkx.DiGraph",
"networkx.is_directed_acyclic_graph",
"networkx.shortest_path"
] | [((71, 83), 'networkx.DiGraph', 'nx.DiGraph', ([], {}), '()\n', (81, 83), True, 'import networkx as nx\n'), ((252, 288), 'networkx.shortest_path', 'nx.shortest_path', (['graph', '"""root"""', '"""e"""'], {}), "(graph, 'root', 'e')\n", (268, 288), True, 'import networkx as nx\n'), ((316, 342), 'networkx.dag_longest_path... |
import os
import time
import matplotlib.pylab
import matplotlib.pyplot
class Plotter(object):
def __init__(self):
self.font = {'fontname': 'DejaVu Sans'}
def plot_transcription_result(self, name, data_dict, all_notes):
items = [(float(timestamp), val) for timestamp, val in
da... | [
"os.path.normpath"
] | [((629, 651), 'os.path.normpath', 'os.path.normpath', (['name'], {}), '(name)\n', (645, 651), False, 'import os\n')] |
from tests.base_test_case import BaseTestCase
from electionguard.manifest import (
ContestDescriptionWithPlaceholders,
SelectionDescription,
VoteVariationType,
)
from electionguard.encrypt import contest_from
from electionguard.utils import NullVoteException, OverVoteException, UnderVoteException
NUMBER_... | [
"electionguard.manifest.ContestDescriptionWithPlaceholders",
"electionguard.manifest.SelectionDescription",
"electionguard.encrypt.contest_from"
] | [((843, 1066), 'electionguard.manifest.ContestDescriptionWithPlaceholders', 'ContestDescriptionWithPlaceholders', (['"""favorite-character-id"""', '(1)', '"""dagobah-id"""', 'VoteVariationType.n_of_m', 'NUMBER_ELECTED', 'None', '"""favorite-star-wars-character"""', 'ballot_selections', 'None', 'None', 'placeholder_sele... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" requirementz.py
Check requirements.txt against installed/latest packages using pip and
requirements-parser.
Bonus features:
Check for duplicate entries
Search for entries using regex.
Add requirement lines.
List requirements or all ... | [
"traceback.format_exc",
"colr.auto_disable",
"os.getcwd",
"os.path.isfile",
"colr.disable",
"colr.docopt",
"sys.exit",
"colr.Colr"
] | [((1131, 1150), 'colr.auto_disable', 'colr_auto_disable', ([], {}), '()\n', (1148, 1150), True, 'from colr import auto_disable as colr_auto_disable, disable as colr_disable, docopt, Colr as C\n'), ((9628, 9645), 'sys.exit', 'sys.exit', (['mainret'], {}), '(mainret)\n', (9636, 9645), False, 'import sys\n'), ((9899, 9923... |
from rest_framework.views import exception_handler
def custom_exception_handler(exc, context):
# Call REST framework's default exception handler first,
# to get the standard error response.
response = exception_handler(exc, context)
# Now add the HTTP status code to the response.
if response is no... | [
"rest_framework.views.exception_handler"
] | [((214, 245), 'rest_framework.views.exception_handler', 'exception_handler', (['exc', 'context'], {}), '(exc, context)\n', (231, 245), False, 'from rest_framework.views import exception_handler\n')] |
##############################################################
#
# ccm_unred: Deredden a flux vector using the CCM 1989 parameterization
#
# Cardelli_coeff: Calculate a,b and a+b/Rv for the Cardelli dust
# law given a wavelength lam in angstroms
#
# calc_Av_from_Balmer_decrement: derive extinction using Balmer decr... | [
"numpy.isscalar",
"numpy.where",
"numpy.log",
"numpy.array",
"numpy.zeros",
"numpy.polyval",
"numpy.ndarray"
] | [((4029, 4042), 'numpy.zeros', 'n.zeros', (['npts'], {}), '(npts)\n', (4036, 4042), True, 'import numpy as n\n'), ((4055, 4068), 'numpy.zeros', 'n.zeros', (['npts'], {}), '(npts)\n', (4062, 4068), True, 'import numpy as n\n'), ((4124, 4154), 'numpy.where', 'n.where', (['((x > 0.3) & (x < 1.1))'], {}), '((x > 0.3) & (x ... |
# -*- coding: utf-8 -*-
"""Tarea_2.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1zWnlDFVNS9UkQ9mCQwPC7u-tTaHEVeox
"""
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
#datos
Lm=0.05 #Longitud en x
Ln=0.05 #... | [
"seaborn.set",
"seaborn.heatmap",
"numpy.linspace",
"numpy.zeros",
"matplotlib.pyplot.scatter",
"numpy.meshgrid"
] | [((269, 278), 'seaborn.set', 'sns.set', ([], {}), '()\n', (276, 278), True, 'import seaborn as sns\n'), ((418, 440), 'numpy.linspace', 'np.linspace', (['(0)', 'Lm', 'Nm'], {}), '(0, Lm, Nm)\n', (429, 440), True, 'import numpy as np\n'), ((459, 481), 'numpy.linspace', 'np.linspace', (['(0)', 'Ln', 'Nn'], {}), '(0, Ln, N... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# everything that relates to ProbFuse2006 is in this library.
# Enjoy.
import os
import random
import numpy as np
from itertools import *
import shutil
def clean_out_files(output_folder):
# make sure tmp/topic_id.txt file are empty before appending, if they exi... | [
"random.sample",
"os.listdir",
"os.path.isfile",
"os.path.dirname",
"numpy.zeros",
"os.path.isdir",
"shutil.rmtree"
] | [((327, 355), 'os.path.isdir', 'os.path.isdir', (['output_folder'], {}), '(output_folder)\n', (340, 355), False, 'import os\n'), ((15150, 15199), 'random.sample', 'random.sample', (['possible_topics', 'n_training_topics'], {}), '(possible_topics, n_training_topics)\n', (15163, 15199), False, 'import random\n'), ((385, ... |
# numpy.isnumeric() function
import numpy as np
# counting a substring
print(np.char.isnumeric('arfyslowy'))
# counting a substring
print(np.char.isnumeric('kloter2surga')) | [
"numpy.char.isnumeric"
] | [((83, 113), 'numpy.char.isnumeric', 'np.char.isnumeric', (['"""arfyslowy"""'], {}), "('arfyslowy')\n", (100, 113), True, 'import numpy as np\n'), ((146, 179), 'numpy.char.isnumeric', 'np.char.isnumeric', (['"""kloter2surga"""'], {}), "('kloter2surga')\n", (163, 179), True, 'import numpy as np\n')] |
from zope.interface import implements
import os
from nevow import rend, loaders, guard, url
from webut.skin import iskin
from ldaptor.apps.webui import i18n
from ldaptor.apps.webui.i18n import _
def getActionURL(current, history):
action = current
if len(history) == 1:
action = action.here()
else:
... | [
"ldaptor.apps.webui.i18n.render",
"nevow.url.URL.fromContext",
"zope.interface.implements",
"ldaptor.apps.webui.i18n._",
"os.path.abspath"
] | [((629, 657), 'zope.interface.implements', 'implements', (['iskin.ISkinnable'], {}), '(iskin.ISkinnable)\n', (639, 657), False, 'from zope.interface import implements\n'), ((671, 681), 'ldaptor.apps.webui.i18n._', '_', (['"""Login"""'], {}), "('Login')\n", (672, 681), False, 'from ldaptor.apps.webui.i18n import _\n'), ... |
# encoding: utf-8
from django.conf import settings
from django.http import HttpResponse
import csv
from os.path import join as join_path
from sindec import models
def csv_test(request, *args, **kwargs):
# files = ['reclamacoes-fundamentadas-sindec-2009-v2.csv', ]
# files = ['reclamacoes-fundamentadas-sindec-20... | [
"sindec.models.Empresa",
"sindec.models.Reclamacao",
"django.http.HttpResponse",
"os.path.join",
"sindec.models.Problema",
"sindec.models.CNAE",
"sindec.models.Consumidor",
"sindec.models.Assunto",
"sindec.models.Procom",
"csv.reader",
"sindec.models.Procom.objects.filter"
] | [((7451, 7471), 'django.http.HttpResponse', 'HttpResponse', (['result'], {}), '(result)\n', (7463, 7471), False, 'from django.http import HttpResponse\n'), ((774, 813), 'os.path.join', 'join_path', (['settings.BASE_DIR', '"""db_init"""'], {}), "(settings.BASE_DIR, 'db_init')\n", (783, 813), True, 'from os.path import j... |
from math import floor
def bank(n, years):
total = n * 1.1
for year in range(years - 1):
total *= 1.1
return floor(total)
def main():
n = float(input("Input the deposit: "))
years = int(input("Input the duration of deposit in years: "))
print(bank(n, years))
if __name__ == '__main_... | [
"math.floor"
] | [((131, 143), 'math.floor', 'floor', (['total'], {}), '(total)\n', (136, 143), False, 'from math import floor\n')] |
from pytest import approx
from sciengdox.units import ureg
import sciengdox.constants as constants
def test_c0_has_correct_units_and_value():
assert constants.c0.m == approx(299792458)
assert constants.c0.u == ureg.parse_units('m / s')
def test_planck_constant_has_correct_units_and_value():
assert const... | [
"pytest.approx",
"sciengdox.units.ureg.parse_units"
] | [((173, 190), 'pytest.approx', 'approx', (['(299792458)'], {}), '(299792458)\n', (179, 190), False, 'from pytest import approx\n'), ((220, 245), 'sciengdox.units.ureg.parse_units', 'ureg.parse_units', (['"""m / s"""'], {}), "('m / s')\n", (236, 245), False, 'from sciengdox.units import ureg\n'), ((332, 365), 'pytest.ap... |
from .Interactor import Interactor
import cv2
import ipywidgets as ipy
import bqplot as bq
import numpy as np
class BoxSelector(Interactor):
def __init__(self):
self.bq_selection_outline = None
self.selector_indicator = None
def link_with(self, display_pane):
super().link_with(displa... | [
"bqplot.Tooltip"
] | [((465, 494), 'bqplot.Tooltip', 'bq.Tooltip', ([], {'fields': "['x', 'y']"}), "(fields=['x', 'y'])\n", (475, 494), True, 'import bqplot as bq\n')] |
#!/usr/bin/env python3
import hashlib
import os
import os.path
import random
import threading
import time
import wave
import pyaudio
import lib.STT as STT
import lib.TTS as TTS
import lib.sr_wrapper as sr
import logger
import utils
from languages import F
from lib.audio_utils import StreamRecognition, StreamDetector... | [
"time.sleep",
"lib.TTS.support",
"wave.open",
"threading.Lock",
"utils.check_phrases",
"utils.pretty_time",
"utils.rhvoice_rest_sets",
"os.path.isfile",
"os.path.dirname",
"utils.TextBox",
"utils.PrettyException",
"utils.mask_off",
"time.time",
"random.SystemRandom",
"pyaudio.PyAudio",
... | [((1081, 1098), 'threading.Event', 'threading.Event', ([], {}), '()\n', (1096, 1098), False, 'import threading\n'), ((1258, 1269), 'time.time', 'time.time', ([], {}), '()\n', (1267, 1269), False, 'import time\n'), ((3739, 3765), 'lib.TTS.support', 'TTS.support', (['prov_priority'], {}), '(prov_priority)\n', (3750, 3765... |
from flask import Flask
from flask_migrate import Migrate
from flask_sqlalchemy import SQLAlchemy
# Globally accessible library
# Initialize ORM
db = SQLAlchemy()
def create_app():
"""Initialize the core application."""
app = Flask(__name__, instance_relative_config=False)
app.config.from_object('config.... | [
"flask_sqlalchemy.SQLAlchemy",
"flask_migrate.Migrate",
"flask.Flask"
] | [((151, 163), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {}), '()\n', (161, 163), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((237, 284), 'flask.Flask', 'Flask', (['__name__'], {'instance_relative_config': '(False)'}), '(__name__, instance_relative_config=False)\n', (242, 284), False, 'from flask impor... |
# Copyright (c) MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | [
"torch.mul",
"monai.utils.module.optional_import",
"monai.visualize.class_activation_maps.ModelWithHooks",
"functools.partial",
"torch.normal",
"torch.zeros_like"
] | [((871, 909), 'monai.utils.module.optional_import', 'optional_import', (['"""tqdm"""'], {'name': '"""trange"""'}), "('tqdm', name='trange')\n", (886, 909), False, 'from monai.utils.module import optional_import\n'), ((1148, 1170), 'torch.mul', 'torch.mul', (['x', 'pos_mask'], {}), '(x, pos_mask)\n', (1157, 1170), False... |
#!/usr/bin/env python
import logging
import os
import signal
import sys
import uvicorn
from fastapi import FastAPI
from fiaas_logging import init_logging
from console import api, gql
from console.core.config import settings
LOG = logging.getLogger(__name__)
app = FastAPI(title="NAIS management console")
app.includ... | [
"logging.getLogger",
"signal.signal",
"fastapi.FastAPI",
"fiaas_logging.init_logging",
"uvicorn.run",
"os.getenv",
"logging.exception"
] | [((233, 260), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (250, 260), False, 'import logging\n'), ((269, 309), 'fastapi.FastAPI', 'FastAPI', ([], {'title': '"""NAIS management console"""'}), "(title='NAIS management console')\n", (276, 309), False, 'from fastapi import FastAPI\n'), ((1... |
#tests for appObj
from TestHelperSuperClass import testHelperAPIClient
from jobsDataAPI import jobClass
from JobExecution import JobExecutionClass
from appObj import appObj
import time
from baseapp_for_restapi_backend_with_swagger import from_iso8601
import threading
class test_JobExecution(testHelperAPIClient):
Job... | [
"jobsDataAPI.jobClass",
"threading.Lock",
"appObj.appObj.getCurDateTime",
"baseapp_for_restapi_backend_with_swagger.from_iso8601"
] | [((336, 352), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (350, 352), False, 'import threading\n'), ((684, 787), 'jobsDataAPI.jobClass', 'jobClass', (['appObj', '"""TestJob123"""', 'command', '(False)', '""""""', '(False)', 'None', 'None', 'None', 'None', 'None', 'None', 'None'], {}), "(appObj, 'TestJob123', ... |
import collections
from .helpers import makeInverse, makeInverseVal
class EdgeFeatures(object):
pass
class EdgeFeature(object):
def __init__(self, api, metaData, data, doValues):
self.api = api
self.meta = metaData
self.doValues = doValues
if type(data) is tuple:
... | [
"collections.Counter"
] | [((2144, 2165), 'collections.Counter', 'collections.Counter', ([], {}), '()\n', (2163, 2165), False, 'import collections\n'), ((2641, 2662), 'collections.Counter', 'collections.Counter', ([], {}), '()\n', (2660, 2662), False, 'import collections\n')] |
"""Tests for `fake_data_for_learning` package."""
import pytest
import numpy as np
from sklearn.preprocessing import LabelEncoder
from fake_data_for_learning.fake_data_for_learning import (
BayesianNodeRV, SampleValue
)
# (Conditional) probability distributions
@pytest.fixture
def binary_pt():
return np.arr... | [
"sklearn.preprocessing.LabelEncoder",
"fake_data_for_learning.fake_data_for_learning.SampleValue",
"numpy.array",
"pytest.raises",
"fake_data_for_learning.fake_data_for_learning.BayesianNodeRV",
"fake_data_for_learning.fake_data_for_learning.SampleValue.possible_default_value"
] | [((314, 334), 'numpy.array', 'np.array', (['[0.1, 0.9]'], {}), '([0.1, 0.9])\n', (322, 334), True, 'import numpy as np\n'), ((382, 416), 'numpy.array', 'np.array', (['[[0.2, 0.8], [0.7, 0.3]]'], {}), '([[0.2, 0.8], [0.7, 0.3]])\n', (390, 416), True, 'import numpy as np\n'), ((516, 547), 'fake_data_for_learning.fake_dat... |
from OO import bd_contas, menu
def iniciar():
print('ACESSO CAIXA ELETRONICO')
agencia = input('DIGITE AGENCIA')
num_conta = input('DIGITE A CONTA')
conta = bd_contas.buscar_contas(agencia, num_conta)
if conta is not None:
while True:
menu.caixa_eletronico()
op = i... | [
"OO.menu.caixa_eletronico",
"OO.bd_contas.buscar_contas"
] | [((176, 219), 'OO.bd_contas.buscar_contas', 'bd_contas.buscar_contas', (['agencia', 'num_conta'], {}), '(agencia, num_conta)\n', (199, 219), False, 'from OO import bd_contas, menu\n'), ((278, 301), 'OO.menu.caixa_eletronico', 'menu.caixa_eletronico', ([], {}), '()\n', (299, 301), False, 'from OO import bd_contas, menu\... |
#!/usr/bin/python
# Copyright (c) 2020, 2022 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | [
"ansible.module_utils.basic.AnsibleModule",
"ansible_collections.oracle.oci.plugins.module_utils.oci_common_utils.get_common_arg_spec",
"ansible_collections.oracle.oci.plugins.module_utils.oci_resource_utils.get_custom_class"
] | [((14660, 14723), 'ansible_collections.oracle.oci.plugins.module_utils.oci_resource_utils.get_custom_class', 'get_custom_class', (['"""LogAnalyticsEntityTopologyFactsHelperCustom"""'], {}), "('LogAnalyticsEntityTopologyFactsHelperCustom')\n", (14676, 14723), False, 'from ansible_collections.oracle.oci.plugins.module_ut... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import copy
from net.st_gcn_no_proj import Model as STGCN
from net.utils import EMA, MLP
class AimCLR(nn.Module):
def __init__(self, base_encoder=None, pretrain=True, queue_size=32768,
in_channels=3, hidden_channels=64, out_chan... | [
"net.st_gcn_no_proj.Model",
"torch.topk",
"torch.nn.functional.normalize",
"torch.softmax",
"torch.einsum",
"net.utils.MLP",
"net.utils.EMA",
"copy.deepcopy",
"torch.no_grad",
"torch.zeros_like",
"torch.randn",
"torch.cat"
] | [((2240, 2255), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (2253, 2255), False, 'import torch\n'), ((1897, 1915), 'copy.deepcopy', 'copy.deepcopy', (['net'], {}), '(net)\n', (1910, 1915), False, 'import copy\n'), ((2354, 2408), 'torch.cat', 'torch.cat', (['(self.queue[:, batch_size:], keys.T)'], {'dim': '(1)'}... |
#!python
#
#Calculate the lattice constant and elastic constant of refractory HEAs
import os
import re
import shutil
import operator
from itertools import combinations
from pymatgen.core.periodic_table import Element
import scipy.constants
from pyemto.latticeinputs.batch import batch_head
from pyemto.utilities import ... | [
"math.sqrt",
"numpy.array",
"pyemto.utilities.distort",
"os.path.exists",
"re.split",
"os.listdir",
"pymatgen.core.periodic_table.Element",
"numpy.linspace",
"os.path.isfile",
"operator.eq",
"pyemto.latticeinputs.batch.batch_head",
"os.makedirs",
"math.pow",
"os.path.join",
"os.chdir",
... | [((2387, 2445), 'pyemto.examples.emto_input_generator.EMTO', 'EMTO', ([], {'folder': 'emtopath', 'EMTOdir': '"""/storage/home/mjl6505/bin"""'}), "(folder=emtopath, EMTOdir='/storage/home/mjl6505/bin')\n", (2391, 2445), False, 'from pyemto.examples.emto_input_generator import EMTO\n'), ((3022, 3059), 'numpy.linspace', '... |
import pandas as pd
import flexmatcher
# Let's assume that the mediated schema has three attributes
# movie_name, movie_year, movie_rating
# creating one sample DataFrame where the schema is (year, Movie, imdb_rating)
vals1 = [['year', 'Movie', 'imdb_rating'],
['2001', 'Lord of the Rings', '8.8'],
[... | [
"pandas.DataFrame",
"flexmatcher.FlexMatcher"
] | [((419, 454), 'pandas.DataFrame', 'pd.DataFrame', (['vals1'], {'columns': 'header'}), '(vals1, columns=header)\n', (431, 454), True, 'import pandas as pd\n'), ((946, 981), 'pandas.DataFrame', 'pd.DataFrame', (['vals2'], {'columns': 'header'}), '(vals2, columns=header)\n', (958, 981), True, 'import pandas as pd\n'), ((1... |
# Generated by Django 3.2 on 2022-01-27 11:44
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
opera... | [
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.migrations.swappable_dependency",
"django.db.models.CharField"
] | [((245, 302), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (276, 302), False, 'from django.db import migrations, models\n'), ((433, 526), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)... |
import requests
import sentry_sdk
from flask import current_app
def track_event(category, action, label=None, value=0):
data = {
"v": "1", # API Version.
"tid": current_app.config["GA_TRACKING_ID"], # Tracking ID / Property ID.
# Anonymous Client Identifier. Ideally, this should be a UUI... | [
"requests.post",
"sentry_sdk.capture_exception"
] | [((736, 804), 'requests.post', 'requests.post', (['"""https://www.google-analytics.com/collect"""'], {'data': 'data'}), "('https://www.google-analytics.com/collect', data=data)\n", (749, 804), False, 'import requests\n'), ((1191, 1222), 'sentry_sdk.capture_exception', 'sentry_sdk.capture_exception', (['e'], {}), '(e)\n... |
import os
import numpy as np
import pandas as pd
from collections import defaultdict
from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
def tabulate_events(dir_path):
summary_iterators = [EventAccumulator(os.path.join(dir_path, dname)).Reload() for dname in os.listdir(dir_path)]
... | [
"os.path.exists",
"os.listdir",
"os.makedirs",
"os.path.join",
"numpy.array",
"collections.defaultdict",
"numpy.vstack"
] | [((460, 477), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (471, 477), False, 'from collections import defaultdict\n'), ((940, 964), 'os.listdir', 'os.listdir', (['log_dir_path'], {}), '(log_dir_path)\n', (950, 964), False, 'import os\n'), ((1074, 1090), 'numpy.array', 'np.array', (['values'], ... |
#!/usr/bin/env python3
"""
Module to take in .mat MatLab files and generate spectrogram images via Short Time Fourier Transform
---------- ------------------------------ --------------------
| Data.mat | -> | Short-Time Fourier Transform | -> | Spectrogram Images |
... | [
"numpy.log10",
"matplotlib.pyplot.ylabel",
"math.floor",
"numpy.genfromtxt",
"os.walk",
"argparse.ArgumentParser",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"os.path.isdir",
"os.mkdir",
"matplotlib.pyplot.axis",
"glob.glob",
"numpy.abs",
"matplotlib.pyplot.savefig",
"matplotl... | [((489, 510), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (503, 510), False, 'import matplotlib\n'), ((643, 668), 'numpy.seterr', 'np.seterr', ([], {'divide': '"""raise"""'}), "(divide='raise')\n", (652, 668), True, 'import numpy as np\n'), ((1004, 1029), 'os.path.join', 'os.path.join', (['CWD... |
import pytest
from .api_structure import APIRoot
@pytest.fixture(scope='module')
def api_root():
return APIRoot(parent=None, ref='')
| [
"pytest.fixture"
] | [((52, 82), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (66, 82), False, 'import pytest\n')] |
import logging
import cv2
import numpy as np
from image_segmentation.extended_image import ExtendedImage
from image_segmentation.line import Line
LOGGER = logging.getLogger()
class Picture(ExtendedImage):
INDENTATION_THRESHOLD = 50
ARTIFACT_PERCENTAGE_THRESHOLD = 0.08
MINIMUM_LINE_OVERLAP = 0.25
d... | [
"logging.getLogger",
"numpy.copy",
"cv2.rectangle",
"cv2.drawContours",
"cv2.bitwise_and",
"numpy.equal",
"cv2.imshow",
"cv2.waitKey",
"image_segmentation.line.Line",
"numpy.concatenate",
"numpy.zeros_like",
"cv2.boundingRect"
] | [((158, 177), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (175, 177), False, 'import logging\n'), ((3051, 3069), 'numpy.zeros_like', 'np.zeros_like', (['img'], {}), '(img)\n', (3064, 3069), True, 'import numpy as np\n'), ((3078, 3134), 'cv2.drawContours', 'cv2.drawContours', (['mask', 'contours', 'conto... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'preferences.ui'
#
# Created by: PyQt5 UI code generator 5.13.0
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_preferencesDialog(object):
def setupUi(self, preferencesDialo... | [
"PyQt5.QtWidgets.QToolButton",
"PyQt5.QtWidgets.QDialogButtonBox",
"PyQt5.QtWidgets.QSpinBox",
"PyQt5.QtGui.QFont",
"PyQt5.QtWidgets.QComboBox",
"PyQt5.QtWidgets.QDoubleSpinBox",
"PyQt5.QtCore.QMetaObject.connectSlotsByName",
"PyQt5.QtWidgets.QHBoxLayout",
"PyQt5.QtWidgets.QGridLayout",
"PyQt5.QtW... | [((458, 498), 'PyQt5.QtWidgets.QVBoxLayout', 'QtWidgets.QVBoxLayout', (['preferencesDialog'], {}), '(preferencesDialog)\n', (479, 498), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((580, 603), 'PyQt5.QtWidgets.QVBoxLayout', 'QtWidgets.QVBoxLayout', ([], {}), '()\n', (601, 603), False, 'from PyQt5 import QtC... |
from flask import Flask, redirect, render_template, request, url_for
from flask_cors import CORS
from winston.app import Winston
import datetime, json, os, re
app = Flask(__name__)
CORS(app)
@app.route("/")
def root():
return redirect(url_for("inbox"))
@app.route("/folder", methods = ["GET"])
def folder_all():
... | [
"flask.render_template",
"re.split",
"flask_cors.CORS",
"flask.Flask",
"json.dumps",
"winston.app.Winston",
"flask.url_for",
"os.path.realpath",
"datetime.date.today"
] | [((166, 181), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (171, 181), False, 'from flask import Flask, redirect, render_template, request, url_for\n'), ((182, 191), 'flask_cors.CORS', 'CORS', (['app'], {}), '(app)\n', (186, 191), False, 'from flask_cors import CORS\n'), ((610, 639), 'json.dumps', 'json.... |
import os
import json
import collections
from REL.wikipedia import Wikipedia
from REL.wikipedia_yago_freq import WikipediaYagoFreq
from load_ttl import (
load_ttl_oke_2015,
load_ttl_oke_2016,
load_ttl_n3,
)
from inference import load_tsv
# entity_name2count = collections.defaultdict(int)
# doc_name2insta... | [
"REL.wikipedia_yago_freq.WikipediaYagoFreq",
"json.dumps",
"os.path.join",
"os.path.isfile",
"REL.wikipedia.Wikipedia"
] | [((897, 930), 'REL.wikipedia.Wikipedia', 'Wikipedia', (['base_url', 'wiki_version'], {}), '(base_url, wiki_version)\n', (906, 930), False, 'from REL.wikipedia import Wikipedia\n'), ((948, 1000), 'REL.wikipedia_yago_freq.WikipediaYagoFreq', 'WikipediaYagoFreq', (['base_url', 'wiki_version', 'wikipedia'], {}), '(base_url... |