code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import random
STEVILO_DOVOLJENIH_NAPAK = 10
PRAVILNA_CRKA = '+'
PONOVLJENA_CRKA = 'o'
NAPACNA_CRKA = '-'
ZMAGA = 'W'
PORAZ = 'X'
ZACETEK = '???'
class Igra:
def __init__(self, geslo, crke=[]):
self.geslo = geslo.lower()
self.crke = [z.lower() for z in crke]
def napacne_crke(self):
... | [
"random.choice"
] | [((1846, 1872), 'random.choice', 'random.choice', (['bazen_besed'], {}), '(bazen_besed)\n', (1859, 1872), False, 'import random\n')] |
#!/usr/bin/env python
# -*- coding: utf8 -*-
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('localhost', 31337))
s.send('python says hello nc')
# 20
s.recv(30)
'nc says hello python\n'
s.close()
| [
"socket.socket"
] | [((66, 115), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (79, 115), False, 'import socket\n')] |
from nmigen import *
import axi
class PS7(Elaboratable):
def __init__(self):
self.fclk = Signal(4)
self.m_axi_gp0 = axi.AXI3Bus()
self.s_axi_hp0 = axi.AXI3Bus(id_bits=6, data_bits=64)
self.irqf2p = Signal(16)
self.emiogpio_i = Signal(64)
self.emiogpio_o = Signal(64)
... | [
"axi.AXI3Bus"
] | [((137, 150), 'axi.AXI3Bus', 'axi.AXI3Bus', ([], {}), '()\n', (148, 150), False, 'import axi\n'), ((176, 212), 'axi.AXI3Bus', 'axi.AXI3Bus', ([], {'id_bits': '(6)', 'data_bits': '(64)'}), '(id_bits=6, data_bits=64)\n', (187, 212), False, 'import axi\n')] |
from unittest import TestCase
from named_entity_recognition.database_value_finder.database_value_finder import DatabaseValueFinder
class TestDatabaseValueFinder(TestCase):
def test_get_relevant_columns_with_or_without_pk_fk(self):
# GIVEN
db_name = 'concert_singer'
db_schemas = 'data/spi... | [
"named_entity_recognition.database_value_finder.database_value_finder.DatabaseValueFinder"
] | [((373, 416), 'named_entity_recognition.database_value_finder.database_value_finder.DatabaseValueFinder', 'DatabaseValueFinder', (['db_name', 'db_schemas', '(1)'], {}), '(db_name, db_schemas, 1)\n', (392, 416), False, 'from named_entity_recognition.database_value_finder.database_value_finder import DatabaseValueFinder\... |
"""Species Entity Recogition Pipeline"""
import os
import pathlib
import pandas as pd # type: ignore
import spacy # type: ignore
from spacy.language import Language # type: ignore
from spacy_lookup import Entity # type: ignore
data = pathlib.Path(os.path.abspath(os.path.join("data")))
species = pd.read_json(dat... | [
"os.path.join",
"pandas.read_json",
"spacy.load",
"spacy_lookup.Entity",
"spacy.language.Language.factory"
] | [((304, 339), 'pandas.read_json', 'pd.read_json', (["(data / 'species.json')"], {}), "(data / 'species.json')\n", (316, 339), True, 'import pandas as pd\n'), ((352, 389), 'pandas.read_json', 'pd.read_json', (["(data / 'locations.json')"], {}), "(data / 'locations.json')\n", (364, 389), True, 'import pandas as pd\n'), (... |
# direct to proper path
import os
import sys
module_path = os.path.abspath(os.path.join('..'))
if module_path not in sys.path:
sys.path.append(module_path)
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import cm, rcParams
from matplotlib.colors import ListedColormap, ... | [
"sys.path.append",
"numpy.load",
"pandas.read_csv",
"numpy.array",
"os.path.join",
"numpy.concatenate"
] | [((993, 1027), 'pandas.read_csv', 'pd.read_csv', (['result_path'], {'header': '(0)'}), '(result_path, header=0)\n', (1004, 1027), True, 'import pandas as pd\n'), ((75, 93), 'os.path.join', 'os.path.join', (['""".."""'], {}), "('..')\n", (87, 93), False, 'import os\n'), ((131, 159), 'sys.path.append', 'sys.path.append',... |
from django.db import models
from django.utils.translation import gettext_lazy as _
from froide.foirequest.models import FoiRequest
from froide.follow.models import Follower
class FoiRequestFollower(Follower):
content_object = models.ForeignKey(
FoiRequest,
on_delete=models.CASCADE,
relat... | [
"django.utils.translation.gettext_lazy"
] | [((460, 481), 'django.utils.translation.gettext_lazy', '_', (['"""Request Follower"""'], {}), "('Request Follower')\n", (461, 481), True, 'from django.utils.translation import gettext_lazy as _\n'), ((512, 534), 'django.utils.translation.gettext_lazy', '_', (['"""Request Followers"""'], {}), "('Request Followers')\n", ... |
import launch
from launch_ros.actions import ComposableNodeContainer
from launch_ros.descriptions import ComposableNode
# detect all 16h5 tags
cfg_36h11 = {
"image_transport": "raw",
"family": "36h11",
"max_hamming": 0,
"z_up": True,
"tag_ids": [0, 1, 4, 5],
"tag_frames": ["0", "1", "4", "5"],
... | [
"launch_ros.descriptions.ComposableNode",
"launch.LaunchDescription",
"launch_ros.actions.ComposableNodeContainer"
] | [((502, 719), 'launch_ros.descriptions.ComposableNode', 'ComposableNode', ([], {'name': '"""apriltag"""', 'package': '"""apriltag_ros"""', 'plugin': '"""AprilTagNode"""', 'remappings': "[('/apriltag/image', '/camera/image_raw'), ('/apriltag/camera_info',\n '/camera/camera_info')]", 'parameters': '[cfg_36h11]'}), "(n... |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
#
# P A G E B O T
#
# Copyright (c) 2016+ <NAME> + <NAME>
# www.pagebot.io
# Licensed under MIT conditions
#
# Supporting DrawBot, www.drawbot.com
# Supporting Flat, xxy... | [
"pagebot.fonttoolbox.analyzers.apoint.APoint",
"pagebot.fonttoolbox.analyzers.APointContext",
"weakref.ref",
"pagebot.fonttoolbox.analyzers.asegment.ASegment",
"doctest.testmod",
"pagebot.fonttoolbox.analyzers.acomponent.AComponent"
] | [((11278, 11295), 'weakref.ref', 'weakref.ref', (['font'], {}), '(font)\n', (11289, 11295), False, 'import weakref\n'), ((6300, 6341), 'pagebot.fonttoolbox.analyzers.apoint.APoint', 'APoint', (['(x, y)', 'flags[index]', 'self', 'index'], {}), '((x, y), flags[index], self, index)\n', (6306, 6341), False, 'from pagebot.f... |
from abc import abstractmethod
import torch
from deeplite.profiler.evaluate import EvaluationFunction
from deeplite.profiler.utils import Device, cast_tuple
def cudafy(*args, **kwargs):
return funcify('cuda', args, **kwargs)
def cpufy(*args, **kwargs):
return funcify('cpu', args, **kwargs)
def itemify(*a... | [
"torch.argmax",
"torch.nn.functional.softmax",
"torch.gt",
"deeplite.profiler.utils.cast_tuple",
"torch.no_grad"
] | [((3238, 3254), 'deeplite.profiler.utils.cast_tuple', 'cast_tuple', (['topk'], {}), '(topk)\n', (3248, 3254), False, 'from deeplite.profiler.utils import Device, cast_tuple\n'), ((1571, 1586), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (1584, 1586), False, 'import torch\n'), ((2346, 2362), 'torch.gt', 'torch.g... |
from unittest import TestCase
import codecs
from datetime import datetime, timedelta
from eq3bt import Thermostat, TemperatureException
from eq3bt.eq3btsmart import (PROP_NTFY_HANDLE, PROP_ID_QUERY,
PROP_INFO_QUERY, Mode)
ID_RESPONSE = b'01780000807581626163606067659e'
STATUS_RESPONSES... | [
"codecs.decode",
"datetime.timedelta",
"eq3bt.Thermostat",
"datetime.datetime"
] | [((1532, 1584), 'eq3bt.Thermostat', 'Thermostat', ([], {'_mac': 'None', 'connection_cls': 'FakeConnection'}), '(_mac=None, connection_cls=FakeConnection)\n', (1542, 1584), False, 'from eq3bt import Thermostat, TemperatureException\n'), ((2959, 2987), 'datetime.datetime', 'datetime', (['(2019)', '(3)', '(29)', '(23)', '... |
"""plotting widget"""
from itertools import cycle
import pyqtgraph as pg
from abf_explorer.abf_logging import make_logger
pg.setConfigOption("background", "w")
pg.setConfigOption("foreground", "k")
# each thing plotted needs to be a distinct plotdataitem added to the plotitem
# https://pyqtgraph.readthedocs.io/en/lat... | [
"pyqtgraph.LinearRegionItem",
"pyqtgraph.setConfigOption",
"abf_explorer.abf_logging.make_logger"
] | [((123, 160), 'pyqtgraph.setConfigOption', 'pg.setConfigOption', (['"""background"""', '"""w"""'], {}), "('background', 'w')\n", (141, 160), True, 'import pyqtgraph as pg\n'), ((161, 198), 'pyqtgraph.setConfigOption', 'pg.setConfigOption', (['"""foreground"""', '"""k"""'], {}), "('foreground', 'k')\n", (179, 198), True... |
import sys
print((sys.getrecursionlimit()))
| [
"sys.getrecursionlimit"
] | [((18, 41), 'sys.getrecursionlimit', 'sys.getrecursionlimit', ([], {}), '()\n', (39, 41), False, 'import sys\n')] |
"""
Build all spec files which exists and which don't already have
equivalent built RPMs in the build directory.
"""
import os
import glob
import subprocess
def name_version_release(spec_fh):
"""
Take the name, version and release number from the given filehandle pointing at a sepc file.
"""
content ... | [
"os.path.join",
"argparse.ArgumentParser"
] | [((879, 914), 'os.path.join', 'os.path.join', (['rpmbuild_dir', '"""SPECS"""'], {}), "(rpmbuild_dir, 'SPECS')\n", (891, 914), False, 'import os\n'), ((939, 976), 'os.path.join', 'os.path.join', (['rpmbuild_dir', '"""SOURCES"""'], {}), "(rpmbuild_dir, 'SOURCES')\n", (951, 976), False, 'import os\n'), ((1600, 1625), 'arg... |
from django.db import models
from apps.data.models import Conferencia
from apps.accounts.models import Account
class Receitas(models.Model):
_TIPO_RECEITA = (
(1, 'PagSeguro'),
(2, 'Oferta'),
(3, 'Outro'),
)
tipo_receita = models.IntegerField(choices=_TIPO_RECEITA, default=1, ve... | [
"django.db.models.FileField",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"apps.accounts.models.Account.notificate",
"apps.accounts.models.Account.objects.filter",
"django.db.models.BooleanField",
"django.db.models.DecimalField",
"django.db.models.IntegerField",
"django.db.models.Da... | [((264, 354), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'choices': '_TIPO_RECEITA', 'default': '(1)', 'verbose_name': '"""Tipo de Receita"""'}), "(choices=_TIPO_RECEITA, default=1, verbose_name=\n 'Tipo de Receita')\n", (283, 354), False, 'from django.db import models\n'), ((362, 436), 'django.db... |
from difflib import SequenceMatcher
class Score(object):
"""Encapsulates ranking information for matching existing requests.
This is currently used with 'rbt post -u' to match the new change with
existing review requests. The 'get_match' method will return a new Score,
and then multiple scores can be... | [
"difflib.SequenceMatcher"
] | [((1120, 1175), 'difflib.SequenceMatcher', 'SequenceMatcher', (['None', 'summary_pair[0]', 'summary_pair[1]'], {}), '(None, summary_pair[0], summary_pair[1])\n', (1135, 1175), False, 'from difflib import SequenceMatcher\n'), ((1225, 1288), 'difflib.SequenceMatcher', 'SequenceMatcher', (['None', 'description_pair[0]', '... |
from django.db import models
# Create your models here.
class TodoItem(models.Model):
content = models.TextField() #it will ne like coulumn for the DB
| [
"django.db.models.TextField"
] | [((107, 125), 'django.db.models.TextField', 'models.TextField', ([], {}), '()\n', (123, 125), False, 'from django.db import models\n')] |
"""
$Revision: 1.2 $ $Date: 2010/05/18 07:56:00 $
Author: <NAME> (<EMAIL>)
Affiliation: Space Telescope - European Coordinating Facility
WWW: http://www.stecf.org/software/slitless_software/axesim/
"""
import os
import iraf
import sys
no = iraf.no
yes = iraf.yes
from axe import axesrc
#import axesrc
# Point to defau... | [
"iraf.help",
"iraf.IrafTaskFactory",
"axe.axesrc.straighten_string",
"iraf.osfn"
] | [((2285, 2304), 'iraf.osfn', 'iraf.osfn', (['_parfile'], {}), '(_parfile)\n', (2294, 2304), False, 'import iraf\n'), ((2309, 2431), 'iraf.IrafTaskFactory', 'iraf.IrafTaskFactory', ([], {'taskname': '_taskname', 'value': 'parfile', 'pkgname': 'PkgName', 'pkgbinary': 'PkgBinary', 'function': 'simdispim_iraf'}), '(tasknam... |
from itertools import product
import numpy as np
import pandas as pd
from neuralforecast.losses.numpy import mape, rmse, smape, mae, mase
from neuralforecast.data.datasets.m4 import M4Evaluation, M4Info
from src.data import get_data, dict_datasets
def evaluate(lib: str, dataset: str, group: str):
try:
f... | [
"pandas.DataFrame",
"src.data.get_data",
"pandas.read_csv",
"itertools.product",
"neuralforecast.losses.numpy.mase",
"pandas.concat"
] | [((464, 497), 'src.data.get_data', 'get_data', (['"""data/"""', 'dataset', 'group'], {}), "('data/', dataset, group)\n", (472, 497), False, 'from src.data import get_data, dict_datasets\n'), ((549, 589), 'src.data.get_data', 'get_data', (['"""data/"""', 'dataset', 'group', '(False)'], {}), "('data/', dataset, group, Fa... |
import pytest
from scipy import signal
from scipy.interpolate import interp1d
import numpy as np
from numpy import pi
# This package must first be installed with `pip install -e .` or similar
from waveform_analysis import ABC_weighting, A_weighting, A_weight
# It will plot things for sanity-checking if MPL is install... | [
"numpy.fft.rfft",
"pytest.main",
"matplotlib.pyplot.figure",
"scipy.interpolate.interp1d",
"scipy.signal.sosfreqz",
"waveform_analysis.A_weighting",
"scipy.signal.freqs_zpk",
"waveform_analysis.A_weight",
"pytest.raises",
"numpy.less_equal",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.legend"... | [((475, 823), 'numpy.array', 'np.array', (['(10.0, 12.59, 15.85, 19.95, 25.12, 31.62, 39.81, 50.12, 65.1, 79.43, 100.0,\n 125.9, 158.5, 199.5, 251.2, 316.2, 398.1, 501.2, 631.0, 794.3, 1000.0, \n 1259.0, 1585.0, 1995.0, 2512.0, 3162.0, 3981.0, 5012.0, 6310.0, 7943.0,\n 10000.0, 12590.0, 15850.0, 19950.0, 25120... |
import random
seeded = False
def generate(size, bytes = False):
""" Randomly generates a binary string key that can used for encryption
Arguments:
size -- The number of bits or bytes the key should contain
bytes -- The input size will be in bits if True, otherwise in bytes
Returns:
The g... | [
"random.seed",
"random.randint"
] | [((808, 821), 'random.seed', 'random.seed', ([], {}), '()\n', (819, 821), False, 'import random\n'), ((840, 857), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (851, 857), False, 'import random\n'), ((595, 615), 'random.randint', 'random.randint', (['(0)', '(1)'], {}), '(0, 1)\n', (609, 615), False, 'import... |
#!/usr/bin/env python
"""
Copyright (C) <NAME> - All Rights Reserved
You may use, distribute and modify this code under the
terms of the MIT license. See LICENSE file in the project
root for full license information.
"""
import unittest
import sys
import os
MAIN_DIR = (os.path.dirname(os.path.dirname(os.path.abspath(_... | [
"unittest.main",
"os.path.abspath",
"playingcard.PlayingCard",
"common.get_value_of_players_hand",
"os.path.join"
] | [((351, 385), 'os.path.join', 'os.path.join', (['MAIN_DIR', '"""includes"""'], {}), "(MAIN_DIR, 'includes')\n", (363, 385), False, 'import os\n'), ((2362, 2377), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2375, 2377), False, 'import unittest\n'), ((303, 328), 'os.path.abspath', 'os.path.abspath', (['__file__'... |
from x7.geom.testing import TestCaseGeomExtended
from x7.geom.geom import Point, Vector
class TestTestCaseExtendedWithPoint(TestCaseGeomExtended):
def test_assertAlmostEqual_point_list(self):
"""Test that List[Point] works with assertAlmostEqual. Should be tested in x7-testing, but easier here"""
... | [
"x7.geom.geom.Point",
"x7.geom.geom.Vector"
] | [((345, 356), 'x7.geom.geom.Point', 'Point', (['(0)', '(0)'], {}), '(0, 0)\n', (350, 356), False, 'from x7.geom.geom import Point, Vector\n'), ((360, 371), 'x7.geom.geom.Point', 'Point', (['(0)', '(0)'], {}), '(0, 0)\n', (365, 371), False, 'from x7.geom.geom import Point, Vector\n'), ((406, 417), 'x7.geom.geom.Point', ... |
# (C) Copyright 2020- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernme... | [
"uuid.uuid4",
"servicelib.compat.Path",
"servicelib.compat.open",
"random.randint",
"servicelib.logutils.get_logger",
"servicelib.compat.urlparse",
"random.choice",
"servicelib.config.get",
"socket.getfqdn",
"os.close",
"mimetypes.add_type",
"mimetypes.guess_extension"
] | [((4425, 4473), 'mimetypes.add_type', 'mimetypes.add_type', (['"""application/binary"""', '""".bin"""'], {}), "('application/binary', '.bin')\n", (4443, 4473), False, 'import mimetypes\n'), ((4474, 4521), 'mimetypes.add_type', 'mimetypes.add_type', (['"""application/json"""', '""".json"""'], {}), "('application/json', ... |
from lib.steps.PyTests import PyTests
import unittest
import pathlib
class TestPyTests(unittest.TestCase):
def _getTestFolderPath(self):
path = pathlib.Path(__file__).parent
return "{0}/testData/testTests".format(path)
def test_run_successed(self):
data = {
"path":self._g... | [
"lib.steps.PyTests.PyTests",
"pathlib.Path"
] | [((394, 403), 'lib.steps.PyTests.PyTests', 'PyTests', ([], {}), '()\n', (401, 403), False, 'from lib.steps.PyTests import PyTests\n'), ((159, 181), 'pathlib.Path', 'pathlib.Path', (['__file__'], {}), '(__file__)\n', (171, 181), False, 'import pathlib\n')] |
import datetime
import factory
import os
from django.contrib.auth import get_user_model
from django.test import TestCase
from waliki import settings
from .models import Project
User = get_user_model()
rst = """
Title
=====
some rst markup
.. raw:: html
<script>alert()</script>
"""
rst_html = """\n <h2>Ti... | [
"django.contrib.auth.get_user_model",
"os.path.join",
"os.path.exists",
"datetime.datetime"
] | [((190, 206), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (204, 206), False, 'from django.contrib.auth import get_user_model\n'), ((1040, 1129), 'os.path.join', 'os.path.join', (['settings.WALIKI_DATA_DIR', '"""wouter/995c9b1ac3ca7356a8b4225171158e70.rst"""'], {}), "(settings.WALIKI_DATA_D... |
from django.conf.urls import url
from results_explorer import views
app_name = 'results_explorer'
urlpatterns = [
url(r'^ghg_reduction$', views.ghg_reduction, name='ghg_reduction'),
url(r'^gpc_report$', views.gpc_report, name='gpc_report'),
url(r'^result_types$', views.result_types, name='result_types'),
... | [
"django.conf.urls.url"
] | [((120, 185), 'django.conf.urls.url', 'url', (['"""^ghg_reduction$"""', 'views.ghg_reduction'], {'name': '"""ghg_reduction"""'}), "('^ghg_reduction$', views.ghg_reduction, name='ghg_reduction')\n", (123, 185), False, 'from django.conf.urls import url\n'), ((192, 248), 'django.conf.urls.url', 'url', (['"""^gpc_report$""... |
#!/usr/bin/env python3
import argparse
from flask import (
Flask,
render_template,
request,
send_from_directory,
redirect,
jsonify,
)
import sys
import flask_socketio
from flask_jwt_extended import (
JWTManager,
jwt_required,
create_access_token,
set_access_cookies,
)
from w... | [
"argparse.ArgumentParser",
"shlex.quote",
"select.select",
"flask.jsonify",
"flask.request.get_json",
"flask.redirect",
"shlex.split",
"flask.render_template",
"flask.send_from_directory",
"os.read",
"flask.request.values.get",
"flask_socketio.SocketIO",
"os.write",
"os.getenv",
"sys.exi... | [((521, 596), 'flask.Flask', 'Flask', (['__name__'], {'template_folder': '"""."""', 'static_folder': '"""."""', 'static_url_path': '""""""'}), "(__name__, template_folder='.', static_folder='.', static_url_path='')\n", (526, 596), False, 'from flask import Flask, render_template, request, send_from_directory, redirect,... |
# Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | [
"torch._C._nn.multilabel_margin_loss",
"torch.randn",
"torch.Tensor",
"torch.nn.functional.multilabel_margin_loss",
"common_utils.run_tests",
"torch.tensor"
] | [((6230, 6241), 'common_utils.run_tests', 'run_tests', ([], {}), '()\n', (6239, 6241), False, 'from common_utils import TestCase, run_tests\n'), ((964, 1058), 'torch.nn.functional.multilabel_margin_loss', 'torch.nn.functional.multilabel_margin_loss', ([], {'input': 'data', 'target': 'target', 'reduction': 'reduction'})... |
import copy
"""Из массива целых чисел удалите наименьшее значение.
Не мутируйте исходный массив/список. Если есть несколько элементов
с одинаковым значением, удалите элемент с меньшим индексом.
Если вы получите пустой массив/список, верните пустой массив/список.
Не изменяйте порядок оставшихся элементов."""
def rem... | [
"copy.deepcopy"
] | [((415, 437), 'copy.deepcopy', 'copy.deepcopy', (['numbers'], {}), '(numbers)\n', (428, 437), False, 'import copy\n')] |
#!/usr/bin/env python
"""
Copyright 2016-2017 Ellation, Inc.
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 ag... | [
"ef_template_resolver.EFTemplateResolver",
"ef_conf_utils.get_account_alias"
] | [((4421, 4453), 'ef_template_resolver.EFTemplateResolver', 'EFTemplateResolver', ([], {'verbose': '(True)'}), '(verbose=True)\n', (4439, 4453), False, 'from ef_template_resolver import EFTemplateResolver\n'), ((4277, 4304), 'ef_conf_utils.get_account_alias', 'get_account_alias', (['"""proto0"""'], {}), "('proto0')\n", ... |
import os
import src
class Config:
input_contexts_path = None
input_user_mappings_path = None
def root_dir(self):
return os.path.dirname(src.__file__)
def get_input_user_mappings_path(self):
return self.input_user_mappings_path
def set_input_user_mappings_path(self, value):
... | [
"os.path.dirname",
"os.path.abspath"
] | [((145, 174), 'os.path.dirname', 'os.path.dirname', (['src.__file__'], {}), '(src.__file__)\n', (160, 174), False, 'import os\n'), ((332, 354), 'os.path.abspath', 'os.path.abspath', (['value'], {}), '(value)\n', (347, 354), False, 'import os\n'), ((613, 635), 'os.path.abspath', 'os.path.abspath', (['value'], {}), '(val... |
""" Quicksort using DNF, good w/ duplicates """
import random
import heapq
def heapsort_in_out_w_key(arr, reverse=False):
h = []
for el in arr:
k = el
if reverse:
k = -k
heapq.heappush(h, (k, el))
out = []
while len(h):
out.append(heapq.heappop(h)[1])
re... | [
"random.random",
"random.randint",
"heapq.heappush",
"heapq.heappop"
] | [((216, 242), 'heapq.heappush', 'heapq.heappush', (['h', '(k, el)'], {}), '(h, (k, el))\n', (230, 242), False, 'import heapq\n'), ((438, 465), 'random.randint', 'random.randint', (['(-1000)', '(1000)'], {}), '(-1000, 1000)\n', (452, 465), False, 'import random\n'), ((775, 790), 'random.random', 'random.random', ([], {}... |
from django.db import models
# Create your models here.
class Project(models.Model):
title = models.CharField(max_length=100)
description = models.TextField()
technology = models.CharField(max_length=20)
# image = models.FilePathField(path='/projects/img')
image = models.CharField(max_length=100)
... | [
"django.db.models.CharField",
"django.db.models.TextField"
] | [((99, 131), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (115, 131), False, 'from django.db import models\n'), ((150, 168), 'django.db.models.TextField', 'models.TextField', ([], {}), '()\n', (166, 168), False, 'from django.db import models\n'), ((186, 217), 'd... |
from pybamm import tanh
def nco_ocp_Ecker2015_function(sto):
"""
NCO OCP as a function of stochiometry [1, 2, 3].
References
----------
.. [1] <NAME>, et al. "Parameterization of a physico-chemical model of
a lithium-ion battery i. determination of parameters." Journal of the
Electrochemi... | [
"pybamm.tanh"
] | [((1455, 1474), 'pybamm.tanh', 'tanh', (['(o * (sto - p))'], {}), '(o * (sto - p))\n', (1459, 1474), False, 'from pybamm import tanh\n'), ((1421, 1440), 'pybamm.tanh', 'tanh', (['(k * (sto - m))'], {}), '(k * (sto - m))\n', (1425, 1440), False, 'from pybamm import tanh\n'), ((1387, 1406), 'pybamm.tanh', 'tanh', (['(h *... |
import cv2
import numpy as np
img = cv2.imread("test1.jpg")
emptyImage = np.zeros(img.shape, np.uint8)
emptyImage2 = img.copy()
emptyImage3=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
cv2.imshow("EmptyImage3", emptyImage3)
cv2.waitKey (0)
cv2.destroyAllWindows()
| [
"cv2.cvtColor",
"cv2.waitKey",
"cv2.destroyAllWindows",
"numpy.zeros",
"cv2.imread",
"cv2.imshow"
] | [((43, 66), 'cv2.imread', 'cv2.imread', (['"""test1.jpg"""'], {}), "('test1.jpg')\n", (53, 66), False, 'import cv2\n'), ((82, 111), 'numpy.zeros', 'np.zeros', (['img.shape', 'np.uint8'], {}), '(img.shape, np.uint8)\n', (90, 111), True, 'import numpy as np\n'), ((159, 196), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.... |
import os
import re
import requests
from bs4 import BeautifulSoup
mainweb = 'https://www.nzherald.co.nz/nzh-search/NZH/pollutant/'
punctuations = '''!()-[]{};:'"\,<>./?@#$%^&*_~'''
page_start = 1
page_end = 51
def webpage(mainweb, page_start, page_end):
'''Getting webpage'''
list_results = []
... | [
"bs4.BeautifulSoup",
"os.chdir",
"requests.get"
] | [((1165, 1186), 'requests.get', 'requests.get', (['new_url'], {}), '(new_url)\n', (1177, 1186), False, 'import requests\n'), ((1199, 1242), 'bs4.BeautifulSoup', 'BeautifulSoup', (['response.text', '"""html.parser"""'], {}), "(response.text, 'html.parser')\n", (1212, 1242), False, 'from bs4 import BeautifulSoup\n'), ((2... |
# ==========================================
# packages for ros
# ==========================================
import rclpy
import sys
from sensor_msgs.msg import Image
import cv2
import base64
import time
import numpy as np
from rmoss_interfaces.msg import ChassisCmd
from rmoss_interfaces.msg import GimbalCmd
from rmo... | [
"rclpy.init",
"rclpy.spin",
"rclpy.create_node"
] | [((1238, 1250), 'rclpy.init', 'rclpy.init', ([], {}), '()\n', (1248, 1250), False, 'import rclpy\n'), ((1260, 1291), 'rclpy.create_node', 'rclpy.create_node', (['"""player_web"""'], {}), "('player_web')\n", (1277, 1291), False, 'import rclpy\n'), ((2251, 2267), 'rclpy.spin', 'rclpy.spin', (['node'], {}), '(node)\n', (2... |
import matplotlib.pyplot as plt
import psycopg2
table_list = ['table1', 'table2', 'table3']
def plot_data_distribution(connection):
with connection.cursor() as cursor:
partition_size_list = []
for table_name in table_list:
cursor.execute(f"SELECT count(*) AS row_count FROM {table_nam... | [
"matplotlib.pyplot.bar",
"matplotlib.pyplot.savefig"
] | [((395, 435), 'matplotlib.pyplot.bar', 'plt.bar', (['table_list', 'partition_size_list'], {}), '(table_list, partition_size_list)\n', (402, 435), True, 'import matplotlib.pyplot as plt\n'), ((464, 502), 'matplotlib.pyplot.savefig', 'plt.savefig', (['"""Graph.png"""'], {'format': '"""PNG"""'}), "('Graph.png', format='PN... |
import unittest
import os
import yaml
from medleydb import multitrack
from medleydb import AUDIO_PATH
from medleydb import MIXING_COEFFICIENTS
class TestMultitrack(unittest.TestCase):
def setUp(self):
self.mtrack = multitrack.MultiTrack("NightPanther_Fire")
self.mtrack2 = multitrack.MultiTrack("Ph... | [
"medleydb.multitrack.get_dict_leaves",
"yaml.load",
"medleydb.multitrack.is_valid_instrument",
"os.path.basename",
"os.path.dirname",
"medleydb.multitrack.get_valid_instrument_labels",
"medleydb.multitrack.Track",
"medleydb.multitrack.get_dataset_version",
"medleydb.multitrack._path_basedir",
"med... | [((229, 271), 'medleydb.multitrack.MultiTrack', 'multitrack.MultiTrack', (['"""NightPanther_Fire"""'], {}), "('NightPanther_Fire')\n", (250, 271), False, 'from medleydb import multitrack\n'), ((295, 340), 'medleydb.multitrack.MultiTrack', 'multitrack.MultiTrack', (['"""Phoenix_ScotchMorris"""'], {}), "('Phoenix_ScotchM... |
#!/usr/bin/env python
#
# atlaspanel.py - The AtlasPanel class.
#
# Author: <NAME> <<EMAIL>>
#
"""This module provides the :class:`AtlasPanel`, a *FSLeyes control* panel
which allows the user to browse the FSL atlas images. See the
:mod:`~fsleyes` package documentation for more details on control panels,
and the :mod:`... | [
"fsleyes.controls.controlpanel.ControlPanel.destroy",
"fsleyes.controls.controlpanel.ControlPanel.__init__",
"wx.BoxSizer",
"numpy.concatenate",
"numpy.abs",
"fsl.utils.idle.idle",
"fsl.data.atlases.getAtlasDescription",
"fsleyes_props.suppress",
"fsl.data.atlases.loadAtlas",
"fsl.data.image.Image... | [((1125, 1152), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1142, 1152), False, 'import logging\n'), ((5725, 5810), 'fsleyes.controls.controlpanel.ControlPanel.__init__', 'ctrlpanel.ControlPanel.__init__', (['self', 'parent', 'overlayList', 'displayCtx', 'viewPanel'], {}), '(self, par... |
# https://github.com/gothinkster/flask-realworld-example-app/blob/master/conduit/user/views.py
from flask import Blueprint
blueprint = Blueprint('users', __name__, url_prefix='/users')
@blueprint.route("/", methods=('GET',))
def get_user_list():
return {"message": "Get List of Users."}
@blueprint.route("/", met... | [
"flask.Blueprint"
] | [((137, 186), 'flask.Blueprint', 'Blueprint', (['"""users"""', '__name__'], {'url_prefix': '"""/users"""'}), "('users', __name__, url_prefix='/users')\n", (146, 186), False, 'from flask import Blueprint\n')] |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"jax.numpy.array",
"numpy.load",
"numpy.dtype",
"jax.test_util._default_tolerance.copy",
"jax.test_util.device_under_test"
] | [((1191, 1220), 'jax.test_util._default_tolerance.copy', 'jtu._default_tolerance.copy', ([], {}), '()\n', (1218, 1220), True, 'import jax.test_util as jtu\n'), ((3660, 3770), 'jax.numpy.array', 'jnp.array', (['[[C[0, 0], C[0, 3], C[0, 4]], [C[0, 3], C[0, 1], C[0, 5]], [C[0, 4], C[0, 5\n ], C[0, 2]]]', 'dtype'], {}),... |
# Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# 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, copy, modify, merge, publ... | [
"netforce.model.fields.Text",
"time.strftime",
"netforce.model.fields.Decimal",
"netforce.model.get_model",
"netforce.model.fields.Reference",
"netforce.model.fields.Date",
"netforce.model.fields.Many2One"
] | [((1329, 1428), 'netforce.model.fields.Many2One', 'fields.Many2One', (['"""account.track.categ"""', '"""Tracking Category"""'], {'required': '(True)', 'on_delete': '"""cascade"""'}), "('account.track.categ', 'Tracking Category', required=True,\n on_delete='cascade')\n", (1344, 1428), False, 'from netforce.model impo... |
import pathlib
from ignite.exceptions import NotComputableError
from ignite.metrics.metric import Metric
import rouge_papier
class PerlRouge(Metric):
"""
Calculates the average rouge score using the original perl rouge script.
"""
def __init__(self, summary_length, remove_stopwords=True,
... | [
"rouge_papier.util.make_simple_config_text",
"rouge_papier.compute_rouge",
"ignite.exceptions.NotComputableError",
"pathlib.Path",
"rouge_papier.util.TempFileManager"
] | [((1042, 1135), 'ignite.exceptions.NotComputableError', 'NotComputableError', (['"""PerlRouge must have at least one example before it can be computed"""'], {}), "(\n 'PerlRouge must have at least one example before it can be computed')\n", (1060, 1135), False, 'from ignite.exceptions import NotComputableError\n'), ... |
"""
This script reads the tag output and generates some markdown for sample tags,
for us to put in the jupyter notebook for the experiment.
"""
import sys
import csv
import fileinput
import ast
import random
reader = csv.reader(sys.stdin)
rows = list(fileinput.input())
sample = random.sample(rows, 20)
for row in sam... | [
"random.sample",
"ast.literal_eval",
"fileinput.input",
"csv.reader"
] | [((218, 239), 'csv.reader', 'csv.reader', (['sys.stdin'], {}), '(sys.stdin)\n', (228, 239), False, 'import csv\n'), ((281, 304), 'random.sample', 'random.sample', (['rows', '(20)'], {}), '(rows, 20)\n', (294, 304), False, 'import random\n'), ((252, 269), 'fileinput.input', 'fileinput.input', ([], {}), '()\n', (267, 269... |
"""Line current class code
DOCSTRINGS V4 READY
"""
from magpylib._src.input_checks import check_format_input_vertices
from magpylib._src.obj_classes.class_BaseDisplayRepr import BaseDisplayRepr
from magpylib._src.obj_classes.class_BaseExcitations import BaseCurrent
from magpylib._src.obj_classes.class_BaseGeo import Ba... | [
"magpylib._src.obj_classes.class_BaseExcitations.BaseCurrent.__init__",
"magpylib._src.obj_classes.class_BaseGeo.BaseGeo.__init__",
"magpylib._src.input_checks.check_format_input_vertices",
"magpylib._src.obj_classes.class_BaseDisplayRepr.BaseDisplayRepr.__init__"
] | [((3685, 3753), 'magpylib._src.obj_classes.class_BaseGeo.BaseGeo.__init__', 'BaseGeo.__init__', (['self', 'position', 'orientation'], {'style': 'style'}), '(self, position, orientation, style=style, **kwargs)\n', (3701, 3753), False, 'from magpylib._src.obj_classes.class_BaseGeo import BaseGeo\n'), ((3762, 3792), 'magp... |
"""SLURM management functionality"""
import logging
import multiprocessing
import tempfile
from jade.enums import Status
from jade.hpc.common import HpcJobStatus, HpcJobInfo
from jade.hpc.hpc_manager_interface import HpcManagerInterface
logger = logging.getLogger(__name__)
DEFAULTS = {
"walltime": 60 * 12,
... | [
"jade.hpc.common.HpcJobInfo",
"tempfile.gettempdir",
"logging.getLogger",
"multiprocessing.cpu_count"
] | [((250, 277), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (267, 277), False, 'import logging\n'), ((365, 386), 'tempfile.gettempdir', 'tempfile.gettempdir', ([], {}), '()\n', (384, 386), False, 'import tempfile\n'), ((838, 875), 'jade.hpc.common.HpcJobInfo', 'HpcJobInfo', (['""""""', '... |
# Version 1.0.0 Released: 14/11/21
# <NAME>
# <EMAIL>
# License Apache 2.0
# ==================================================================================================================================================================================
#LaharZ v0.3 - working
#Laharz v0.4 - temporary version - not t... | [
"tkinter.StringVar",
"PIL.Image.new",
"numpy.amin",
"numpy.empty",
"scipy.ndimage.binary_fill_holes",
"tkinter.ttk.Progressbar",
"gmsh.model.add",
"numpy.shape",
"os.path.isfile",
"tkinter.BooleanVar",
"numpy.arange",
"tkinter.Frame",
"gmsh.finalize",
"tkinter.Label",
"tkinter.Checkbutto... | [((100048, 100055), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (100053, 100055), True, 'import tkinter as tk\n'), ((86104, 86119), 'simplekml.Kml', 'simplekml.Kml', ([], {}), '()\n', (86117, 86119), False, 'import simplekml\n'), ((86131, 86157), 'pyproj.Geod', 'pyproj.Geod', ([], {'ellps': '"""WGS84"""'}), "(ellps='WGS84... |
import json
from django.urls import reverse
from django.utils.functional import cached_property
from django.utils.text import slugify
from django.db import models
from ordered_model.models import OrderedModelManager, OrderedModel
from . import choices, validators
class ActiveManager(models.Manager):
""" Custom q... | [
"django.db.models.TextField",
"django.db.models.URLField",
"django.db.models.UniqueConstraint",
"json.loads",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.Manager",
"django.db.models.SlugField",
"django.utils.text.slugify",
"django.urls.reverse",
"django.db.mode... | [((521, 619), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(8)', 'choices': 'choices.STATUS_CHOICES', 'default': 'choices.ACTIVE_STATUS'}), '(max_length=8, choices=choices.STATUS_CHOICES, default=\n choices.ACTIVE_STATUS)\n', (537, 619), False, 'from django.db import models\n'), ((630, 646)... |
"""
Provide abstract classes for services.
"""
from abc import (
ABC,
abstractmethod,
)
from project_version.utils import parse_project_version
class AbstractCheckProjectVersion(ABC):
"""
Abstract check a project version service.
"""
NOT_CHANGED_REASON = 'Project version file is not changed.... | [
"project_version.utils.parse_project_version"
] | [((2442, 2492), 'project_version.utils.parse_project_version', 'parse_project_version', (['base_branch_project_version'], {}), '(base_branch_project_version)\n', (2463, 2492), False, 'from project_version.utils import parse_project_version\n'), ((2633, 2683), 'project_version.utils.parse_project_version', 'parse_projec... |
import numpy as np
from scipy import constants
from .conversion import vol_uc2mol
def zharkov_panh(v, temp, v0, a0, m, n, z, t_ref=300.,
three_r=3. * constants.R):
"""
calculate pressure from anharmonicity for Zharkov equation
the equation is from Dorogokupets 2015
:param v: unit-cel... | [
"numpy.power"
] | [((794, 808), 'numpy.power', 'np.power', (['x', 'm'], {}), '(x, m)\n', (802, 808), True, 'import numpy as np\n'), ((874, 890), 'numpy.power', 'np.power', (['t', '(2.0)'], {}), '(t, 2.0)\n', (882, 890), True, 'import numpy as np\n')] |
import motor.motor_tornado
from bson import ObjectId
db = motor.motor_tornado.MotorClient('localhost', 27017).RichaCarDB
class UserFunctions:
async def getUsers(self):
global db
collection = db.users
cursor = collection.find()
users = []
for doc in await cursor.to_list():
users.append(doc)... | [
"bson.ObjectId"
] | [((548, 560), 'bson.ObjectId', 'ObjectId', (['id'], {}), '(id)\n', (556, 560), False, 'from bson import ObjectId\n'), ((683, 695), 'bson.ObjectId', 'ObjectId', (['id'], {}), '(id)\n', (691, 695), False, 'from bson import ObjectId\n'), ((1716, 1728), 'bson.ObjectId', 'ObjectId', (['id'], {}), '(id)\n', (1724, 1728), Fal... |
from setuptools import setup
setup(
name='txredis',
version='2.3',
packages=['txredis'],
description='Python/Twisted client for Redis key-value store',
author='<NAME>',
author_email='<EMAIL>',
maintainer='<NAME>',
maintainer_email='<EMAIL>',
keywords=['Redis', 'key-value store', 'T... | [
"setuptools.setup"
] | [((31, 639), 'setuptools.setup', 'setup', ([], {'name': '"""txredis"""', 'version': '"""2.3"""', 'packages': "['txredis']", 'description': '"""Python/Twisted client for Redis key-value store"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'maintainer': '"""<NAME>"""', 'maintainer_email': '"""<EMAIL>"""'... |
import copy
import os
import flask
from flask import request, jsonify
class Db:
def __init__(self):
self.data = [
{'id': 0, 'title': 'clean house', 'details': 'do it now', 'level': 5},
{'id': 1, 'title': 'make fire', 'details': 'use everburning wood', 'level': 7},
{'... | [
"flask.jsonify",
"os.path.dirname",
"flask.Flask"
] | [((1269, 1334), 'flask.Flask', 'flask.Flask', (['__name__'], {'static_url_path': '""""""', 'static_folder': 'PATH_WWW'}), "(__name__, static_url_path='', static_folder=PATH_WWW)\n", (1280, 1334), False, 'import flask\n'), ((1225, 1250), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1240, 12... |
"""
Copyright BOOSTRY Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distr... | [
"eth_utils.to_checksum_address",
"cerberus.Validator",
"app.errors.NotSupportedError",
"app.errors.InvalidParameterError",
"app.model.blockchain.BondToken.get",
"app.model.blockchain.CouponToken.get",
"app.contracts.Contract.call_function",
"app.model.blockchain.ShareToken.get",
"app.log.get_logger"... | [((1077, 1093), 'app.log.get_logger', 'log.get_logger', ([], {}), '()\n', (1091, 1093), False, 'from app import log\n'), ((1546, 1643), 'app.contracts.Contract.get_contract', 'Contract.get_contract', ([], {'contract_name': '"""TokenList"""', 'address': 'config.TOKEN_LIST_CONTRACT_ADDRESS'}), "(contract_name='TokenList'... |
from YoutubeDownloader.Video.Video import VideoDownloader
from YoutubeDownloader.Playlist.Playlist import PlaylistDownloader
from os.path import expanduser
import os
class Downloader:
def __init__(self, url, output_directory = os.path.join(expanduser('~'),'Videos'), batch_size=4):
self._url = url
... | [
"os.path.expanduser",
"YoutubeDownloader.Playlist.Playlist.PlaylistDownloader",
"YoutubeDownloader.Video.Video.VideoDownloader"
] | [((248, 263), 'os.path.expanduser', 'expanduser', (['"""~"""'], {}), "('~')\n", (258, 263), False, 'from os.path import expanduser\n'), ((1213, 1257), 'YoutubeDownloader.Video.Video.VideoDownloader', 'VideoDownloader', (['self._url', 'self._output_dir'], {}), '(self._url, self._output_dir)\n', (1228, 1257), False, 'fro... |
#!/usr/bin/env python3
# Software License Agreement (BSD License)
#
# Copyright (c) 2019, UFACTORY, Inc.
# All rights reserved.
#
# Author: Vinman <<EMAIL>> <<EMAIL>>
"""
Description: event callback registration and release
1. Instantiate XArmAPI and specify do_not_open to be true
2. Register different event c... | [
"os.path.dirname",
"xarm.wrapper.XArmAPI",
"time.sleep",
"configparser.ConfigParser",
"sys.exit"
] | [((1531, 1560), 'xarm.wrapper.XArmAPI', 'XArmAPI', (['ip'], {'do_not_open': '(True)'}), '(ip, do_not_open=True)\n', (1538, 1560), False, 'from xarm.wrapper import XArmAPI\n'), ((2099, 2113), 'time.sleep', 'time.sleep', (['(20)'], {}), '(20)\n', (2109, 2113), False, 'import time\n'), ((484, 509), 'os.path.dirname', 'os.... |
from odoo import models, fields, api, _
class Clientes(models.Model):
_name = 'tienda.clientes'
# codigo = fields.Integer('Codigo', required=True)
# marca = fields.Char('Marca', required=True)
dni = fields.Char('DNI', required=True)
nombre = fields.Char('Nombre', required=True)
apellidos = fie... | [
"odoo.fields.Integer",
"odoo.fields.Char"
] | [((217, 250), 'odoo.fields.Char', 'fields.Char', (['"""DNI"""'], {'required': '(True)'}), "('DNI', required=True)\n", (228, 250), False, 'from odoo import models, fields, api, _\n'), ((264, 300), 'odoo.fields.Char', 'fields.Char', (['"""Nombre"""'], {'required': '(True)'}), "('Nombre', required=True)\n", (275, 300), Fa... |
# python color_tracking.py --video balls.mp4
# python color_tracking.py
# import the necessary packages
from collections import deque
import numpy as np
import argparse
import imutils
import cv2
import urllib # for reading image from URL
# construct the argument parse and parse the arguments
ap = argpars... | [
"cv2.GaussianBlur",
"cv2.minEnclosingCircle",
"argparse.ArgumentParser",
"cv2.cvtColor",
"cv2.morphologyEx",
"cv2.waitKey",
"cv2.moments",
"cv2.imshow",
"numpy.ones",
"cv2.VideoCapture",
"imutils.resize",
"cv2.destroyAllWindows",
"cv2.inRange"
] | [((313, 338), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (336, 338), False, 'import argparse\n'), ((4089, 4112), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (4110, 4112), False, 'import cv2\n'), ((1328, 1347), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(1)'], {}), '(... |
import sys
from django.apps import AppConfig
from utils.scheduler_manager import SchedulerManager
class RestapiConfig(AppConfig):
name = 'restapi'
def __init__(self, app_name, app_module):
super().__init__(app_name, app_module)
def ready(self):
argv = sys.argv
print(argv)
... | [
"utils.scheduler_manager.SchedulerManager"
] | [((544, 562), 'utils.scheduler_manager.SchedulerManager', 'SchedulerManager', ([], {}), '()\n', (560, 562), False, 'from utils.scheduler_manager import SchedulerManager\n')] |
from typing import Union
import pandas as pd
from frp.visualization.vis_decorator import visualization_grid
def visualize_features(
data: pd.DataFrame,
x_col: str = None,
columns: list = None,
excl_columns: list = None,
subplot_titles: Union[list, dict] = None,
fig_title: str = None,
nco... | [
"frp.visualization.vis_decorator.visualization_grid"
] | [((2707, 2747), 'frp.visualization.vis_decorator.visualization_grid', 'visualization_grid', ([], {'pass_ax_or_grid': '"""ax"""'}), "(pass_ax_or_grid='ax')\n", (2725, 2747), False, 'from frp.visualization.vis_decorator import visualization_grid\n'), ((5611, 5651), 'frp.visualization.vis_decorator.visualization_grid', 'v... |
import os
# Generates validation/input definitions as if they were created by splunk for tests
class MockDefinitions(object):
def __init__(self, session_key=None):
self.session_key = session_key if session_key is not None else '123456789'
@property
def metadata(self):
host = os.getenv('SPLU... | [
"os.getenv"
] | [((305, 346), 'os.getenv', 'os.getenv', (['"""SPLUNK_API_HOST"""', '"""127.0.0.1"""'], {}), "('SPLUNK_API_HOST', '127.0.0.1')\n", (314, 346), False, 'import os\n')] |
from bs4 import BeautifulSoup as bs
import requests
import cfscrape
from urllib.request import (urlopen, urlparse, urlunparse, urlretrieve)
import time
import os
from MangaToPDF import MangaToPDF
from MangaCrawler import MangaCrawler
class MangaKisa(MangaCrawler):
website = "https://mangakisa.com"
scraper =... | [
"cfscrape.create_scraper",
"os.makedirs",
"requests.Session",
"os.path.exists",
"bs4.BeautifulSoup"
] | [((569, 587), 'requests.Session', 'requests.Session', ([], {}), '()\n', (585, 587), False, 'import requests\n'), ((611, 648), 'cfscrape.create_scraper', 'cfscrape.create_scraper', ([], {'sess': 'session'}), '(sess=session)\n', (634, 648), False, 'import cfscrape\n'), ((728, 753), 'bs4.BeautifulSoup', 'bs', (['r.text', ... |
import argparse
import os
import string
import sys
import time
import cv2
import numpy as np
import torch
from torch.autograd import Variable
from torchvision import transforms
import utils
import crnn_captcha
parser = argparse.ArgumentParser()
parser.add_argument('--model_path', type=str, default='./crnn_capcha.pth'... | [
"crnn_captcha.CRNN",
"argparse.ArgumentParser",
"torch.autograd.Variable",
"torch.load",
"utils.strLabelConverter",
"time.time",
"cv2.imread",
"torch.cuda.is_available",
"numpy.reshape",
"torchvision.transforms.Normalize",
"os.path.join",
"os.listdir",
"cv2.resize",
"torch.from_numpy"
] | [((221, 246), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (244, 246), False, 'import argparse\n'), ((599, 663), 'torchvision.transforms.Normalize', 'transforms.Normalize', (['[0.906, 0.91, 0.907]', '[0.147, 0.13, 0.142]'], {}), '([0.906, 0.91, 0.907], [0.147, 0.13, 0.142])\n', (619, 663), Fa... |
from django.contrib import admin
from .models import School
# Register your models here.
class SchoolAdmin(admin.ModelAdmin):
school_display = ('name')
search_fields = ['name']
admin.site.register(School, SchoolAdmin) | [
"django.contrib.admin.site.register"
] | [((188, 228), 'django.contrib.admin.site.register', 'admin.site.register', (['School', 'SchoolAdmin'], {}), '(School, SchoolAdmin)\n', (207, 228), False, 'from django.contrib import admin\n')] |
# -*- coding: utf-8 -*-
# Copyright 2017 <NAME> (马子昂)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | [
"ttk.Combobox",
"csv.reader",
"os.path.exists",
"csv.writer"
] | [((2178, 2203), 'os.path.exists', 'os.path.exists', (['FILE_RULE'], {}), '(FILE_RULE)\n', (2192, 2203), False, 'import os\n'), ((2653, 2712), 'csv.writer', 'csv.writer', (['self.file_rules_w'], {'delimiter': '""","""', 'quotechar': '"""|"""'}), "(self.file_rules_w, delimiter=',', quotechar='|')\n", (2663, 2712), False,... |
# -*- coding: utf-8 -*-
from django.urls import path
from django.conf.urls import include, url
from django.views.generic import RedirectView, TemplateView
from servo.views import account, files, gsx
from servo.views.error import report
from servo.views.note import show_barcode
from servo.views.events import acknowled... | [
"django.views.generic.TemplateView.as_view",
"django.conf.urls.include",
"django.conf.urls.url",
"django.views.generic.RedirectView.as_view"
] | [((1035, 1077), 'django.conf.urls.url', 'url', (['"""^queues/(\\\\d+)/statuses/$"""', 'statuses'], {}), "('^queues/(\\\\d+)/statuses/$', statuses)\n", (1038, 1077), False, 'from django.conf.urls import include, url\n'), ((1084, 1149), 'django.conf.urls.url', 'url', (['"""^barcode/([\\\\w\\\\-]+)/$"""', 'show_barcode'],... |
#!/usr/bin/python3
import json
import sys
import os
import re
import requests
import time
from PIL import Image
import random
data_dir = '/home/nick/Desktop/darknet/data'
rate_limit = True
sleep_time = .5
# Percent of data to use for validation
validation_split = 20
skip_string = 'skip_reasons'
skip_classes = {'sk... | [
"json.load",
"os.makedirs",
"random.randint",
"os.path.exists",
"PIL.Image.open",
"time.sleep",
"requests.get",
"re.search"
] | [((534, 561), 'os.path.exists', 'os.path.exists', (['import_path'], {}), '(import_path)\n', (548, 561), False, 'import os\n'), ((1075, 1099), 'os.path.exists', 'os.path.exists', (['data_dir'], {}), '(data_dir)\n', (1089, 1099), False, 'import os\n'), ((1105, 1126), 'os.makedirs', 'os.makedirs', (['data_dir'], {}), '(da... |
import re
from ..Config import PERSON_KEY, GRADE_KEY
from .AbstractDjangoApi import AbstractDjangoApi
class AplusApi(AbstractDjangoApi):
API_URL = '{host}/api/v2/'
COURSE_LIST = '{url}courses/'
EXERCISE_LIST = '{url}courses/{course_id:d}/exercises/'
SUBMISSION_ROWS = '{url}courses/{course_id:d}/submissiondata... | [
"re.compile"
] | [((1399, 1431), 're.compile', 're.compile', (['self.FILE_KEY_REGEXP'], {}), '(self.FILE_KEY_REGEXP)\n', (1409, 1431), False, 'import re\n'), ((1455, 1487), 're.compile', 're.compile', (['self.FILE_VAL_REGEXP'], {}), '(self.FILE_VAL_REGEXP)\n', (1465, 1487), False, 'import re\n'), ((1511, 1562), 're.compile', 're.compil... |
# OUT: Python shell history and tab completion are enabled.
from couchdb import Server
s=Server('https://172.16.17.32/couchdb/')
db=s['ucldc']
resp=db.changes(since=288000)
results=resp['results']
doc=db.get(results[0]['id'])
dir(doc)
# OUT: ['__class__', '__cmp__', '__contains__', '__delattr__', '__delitem__', '__dict... | [
"couchdb.Server",
"pickle.dump",
"pickle.dumps"
] | [((89, 128), 'couchdb.Server', 'Server', (['"""https://172.16.17.32/couchdb/"""'], {}), "('https://172.16.17.32/couchdb/')\n", (95, 128), False, 'from couchdb import Server\n'), ((1068, 1085), 'pickle.dumps', 'pickle.dumps', (['doc'], {}), '(doc)\n', (1080, 1085), False, 'import pickle\n'), ((1120, 1139), 'pickle.dump'... |
from flask_restful import Resource
from flask_restful import reqparse
from pajbot.managers.db import DBManager
from pajbot.models.sock import SocketClientManager
from pajbot.models.twitter import TwitterUser
from pajbot.web.utils import requires_level
class APITwitterFollows(Resource):
def __init__(self):
... | [
"pajbot.web.utils.requires_level",
"flask_restful.reqparse.RequestParser",
"pajbot.models.sock.SocketClientManager.send",
"pajbot.models.twitter.TwitterUser.id.asc",
"pajbot.models.twitter.TwitterUser.id.desc",
"pajbot.managers.db.DBManager.create_session_scope"
] | [((698, 717), 'pajbot.web.utils.requires_level', 'requires_level', (['(500)'], {}), '(500)\n', (712, 717), False, 'from pajbot.web.utils import requires_level\n'), ((1638, 1658), 'pajbot.web.utils.requires_level', 'requires_level', (['(1000)'], {}), '(1000)\n', (1652, 1658), False, 'from pajbot.web.utils import require... |
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
import os
from .. import Backend
if os.environ.get('SYM_STRICT_TESTING', '0')[:1].lower() in ('1', 't'):
AVAILABLE_BACKENDS = list(Backend.backends)
else:
AVAILABLE_BACKENDS = []
for k in Backend.backends:
... | [
"os.environ.get"
] | [((129, 170), 'os.environ.get', 'os.environ.get', (['"""SYM_STRICT_TESTING"""', '"""0"""'], {}), "('SYM_STRICT_TESTING', '0')\n", (143, 170), False, 'import os\n')] |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import einsum
from tortoise.models.arch_util import CheckpointedXTransformerEncoder
from tortoise.models.transformer import Transformer
from tortoise.models.xtransformers import Encoder
def exists(val):
return val is not None
def mas... | [
"tortoise.models.xtransformers.Encoder",
"torch.randint",
"torch.nn.Embedding",
"tortoise.models.transformer.Transformer",
"torch.nn.functional.cross_entropy",
"torch.einsum",
"torch.arange",
"torch.nn.Linear",
"torch.nn.functional.normalize",
"torch.tensor"
] | [((1318, 1357), 'torch.nn.Embedding', 'nn.Embedding', (['num_text_tokens', 'dim_text'], {}), '(num_text_tokens, dim_text)\n', (1330, 1357), True, 'import torch.nn as nn\n'), ((1388, 1431), 'torch.nn.Linear', 'nn.Linear', (['dim_text', 'dim_latent'], {'bias': '(False)'}), '(dim_text, dim_latent, bias=False)\n', (1397, 1... |
import pandas as pd
import warnings
import os
import pickle as pkl
"""
Author: <NAME>
02/15/21
Methods and intermediate state for loading data and putting it into pandas tables for use by pathway reconstruction algorithms.
"""
class Dataset:
NODE_ID = "NODEID"
warning_threshold = 0.05 #Threshold for scarcit... | [
"pandas.DataFrame",
"pickle.dump",
"pickle.load",
"os.path.join"
] | [((2483, 2529), 'pandas.DataFrame', 'pd.DataFrame', (['node_set'], {'columns': '[self.NODE_ID]'}), '(node_set, columns=[self.NODE_ID])\n', (2495, 2529), True, 'import pandas as pd\n'), ((784, 801), 'pickle.dump', 'pkl.dump', (['self', 'f'], {}), '(self, f)\n', (792, 801), True, 'import pickle as pkl\n'), ((1044, 1055),... |
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"numpy.random.seed",
"etcmodel.layers.RelativeAttention",
"tensorflow.initializers.constant",
"numpy.random.randint",
"numpy.random.normal",
"tensorflow.compat.v1.global_variables_initializer",
"tensorflow.test.main",
"tensorflow.random.uniform",
"tensorflow.concat",
"etcmodel.layers.FusedGlobalLo... | [((1137, 1222), 'absl.testing.parameterized.named_parameters', 'parameterized.named_parameters', (["('using_gather', False)", "('using_one_hot', True)"], {}), "(('using_gather', False), ('using_one_hot', True)\n )\n", (1167, 1222), False, 'from absl.testing import parameterized\n'), ((2629, 2714), 'absl.testing.para... |
#!/usr/bin/env python3
# coding: utf-8
import numpy as np
import os
import copy
input_fp="/home/alicja/PET-LAB Code/PET-LAB/PET tumour segmentations/"
patient_no="04"
def renameFiles(input_fp,patient_no,percentile):
exp=f"pet_seg_0{patient_no}"
filenames=os.listdir(input_fp)
good_filenames = [name for n... | [
"os.rename",
"copy.deepcopy",
"os.listdir"
] | [((267, 287), 'os.listdir', 'os.listdir', (['input_fp'], {}), '(input_fp)\n', (277, 287), False, 'import os\n'), ((494, 517), 'copy.deepcopy', 'copy.deepcopy', (['files_pc'], {}), '(files_pc)\n', (507, 517), False, 'import copy\n'), ((1192, 1256), 'os.rename', 'os.rename', (["('' + input_fp + new_files_pc[i])", "('' + ... |
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from pydantic import BaseModel
from src.pytts import TTSGenerator
class Data(BaseModel):
text: str
app = FastAPI(docs_url=None)
tts = TTSGenerator()
app.mount("/static", StaticFiles(directory="static"), name="static")
@app.post("/generat... | [
"fastapi.staticfiles.StaticFiles",
"src.pytts.TTSGenerator",
"fastapi.FastAPI"
] | [((186, 208), 'fastapi.FastAPI', 'FastAPI', ([], {'docs_url': 'None'}), '(docs_url=None)\n', (193, 208), False, 'from fastapi import FastAPI\n'), ((215, 229), 'src.pytts.TTSGenerator', 'TTSGenerator', ([], {}), '()\n', (227, 229), False, 'from src.pytts import TTSGenerator\n'), ((252, 283), 'fastapi.staticfiles.StaticF... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, os
from utils import *
from pprint import pprint as pp
import requests, json
cache_file = 'barmenu.cache'
if '-b' in sys.argv[1:]:
barmenu_enable = True
else: barmenu_enable = False
if '-c' in sys.argv[1:]:
cache_enable = True
else: cache_enable = Fal... | [
"os.path.exists",
"json.loads",
"requests.get"
] | [((807, 937), 'requests.get', 'requests.get', (['"""https://products.izettle.com/organizations/self/library"""'], {'headers': "{'Authorization': 'Bearer %s' % access_token}"}), "('https://products.izettle.com/organizations/self/library',\n headers={'Authorization': 'Bearer %s' % access_token})\n", (819, 937), False,... |
# -*- coding: utf-8 -*-
"""
Created on Wed May 20 21:34:39 2020
@author: Ankush
"""
#Step 0 : Import Libraries
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
#Step 1: Import dataset
iris_dataset = pd.read_csv('Iris.csv')
iris_dataset.head(5)
iris_dataset.... | [
"matplotlib.pyplot.subplot",
"seaborn.heatmap",
"seaborn.scatterplot",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.classification_report",
"matplotlib.pyplot.figure",
"sklearn.neighbors.KNeighborsClassifier",
"seaborn.pairplot",
"sklearn.metrics.confusion_matrix... | [((260, 283), 'pandas.read_csv', 'pd.read_csv', (['"""Iris.csv"""'], {}), "('Iris.csv')\n", (271, 283), True, 'import pandas as pd\n'), ((363, 454), 'seaborn.scatterplot', 'sns.scatterplot', ([], {'x': '"""SepalLengthCm"""', 'y': '"""SepalWidthCm"""', 'hue': '"""Species"""', 'data': 'iris_dataset'}), "(x='SepalLengthCm... |
from flask import Blueprint, jsonify, request
from .service import UserService
from project.common.decorators import require_user
users_blueprint = Blueprint('users', __name__)
@users_blueprint.route('/user/create', methods=['POST'])
def create() -> dict:
user = request.json
rsp = UserService.register(user)... | [
"flask.Blueprint"
] | [((150, 178), 'flask.Blueprint', 'Blueprint', (['"""users"""', '__name__'], {}), "('users', __name__)\n", (159, 178), False, 'from flask import Blueprint, jsonify, request\n')] |
"""
This file was copied from
https://github.com/TaylorSMarks/playsound
playsound.py - For playing audio file, Copyright (c) 2016 <NAME>
MIT License
----
I've added async play for linux using a thread, changed names to be more pythonic
I've also added a thin wrapper around pygame as well
"""
from platform import syste... | [
"pygame.mixer.init",
"pygame.mixer.music.load",
"ctypes.windll.winmm.mciSendStringA",
"os.path.abspath",
"Foundation.NSURL.URLWithString_",
"pygame.mixer.music.play",
"sys.getfilesystemencoding",
"pygame.mixer.music.get_busy",
"threading.Thread",
"time.sleep",
"random.random",
"gi.repository.G... | [((332, 340), 'platform.system', 'system', ([], {}), '()\n', (338, 340), False, 'from platform import system\n'), ((2717, 2744), 'Foundation.NSURL.URLWithString_', 'NSURL.URLWithString_', (['sound'], {}), '(sound)\n', (2737, 2744), False, 'from Foundation import NSURL\n'), ((3393, 3425), 'gi.require_version', 'gi.requi... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-05-17 02:27
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('frbb', '0004_word'),
]
operations = [
migrations.AddField(
model... | [
"django.db.models.IntegerField",
"django.db.models.BooleanField"
] | [((382, 412), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(0)'}), '(default=0)\n', (401, 412), False, 'from django.db import migrations, models\n'), ((540, 570), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default': '(2)'}), '(default=2)\n', (559, 570), False, 'from djan... |
import torch
import torch.nn as nn
def _down_sample(in_channels, out_channels, padding=1, kernel_size=4, stride=2,
negative_slope=0.2):
return nn.Sequential(
nn.Conv2d(
in_channels=in_channels,
out_channels=out_channels,
kernel_size=kernel_size,
... | [
"torch.nn.ReLU",
"torch.nn.ConvTranspose2d",
"torch.nn.Tanh",
"torch.nn.Conv2d",
"torch.nn.BatchNorm2d",
"torch.nn.Linear",
"torch.nn.LeakyReLU"
] | [((189, 312), 'torch.nn.Conv2d', 'nn.Conv2d', ([], {'in_channels': 'in_channels', 'out_channels': 'out_channels', 'kernel_size': 'kernel_size', 'stride': 'stride', 'padding': 'padding'}), '(in_channels=in_channels, out_channels=out_channels, kernel_size=\n kernel_size, stride=stride, padding=padding)\n', (198, 312),... |
from tkinter import Tk, Canvas
from datetime import date, datetime
def get_events():
list_events = []
with open('events.txt') as file:
for line in file:
line = line.rstrip('\n')
root = Tk()
c = Canvas(root, width=800, height=800, bg='black')
c.pack()
c.create_text(100, 50, anchor='... | [
"tkinter.Canvas",
"tkinter.Tk"
] | [((223, 227), 'tkinter.Tk', 'Tk', ([], {}), '()\n', (225, 227), False, 'from tkinter import Tk, Canvas\n'), ((232, 279), 'tkinter.Canvas', 'Canvas', (['root'], {'width': '(800)', 'height': '(800)', 'bg': '"""black"""'}), "(root, width=800, height=800, bg='black')\n", (238, 279), False, 'from tkinter import Tk, Canvas\n... |
import sys
import datetime
import traceback
from pywinauto.application import Application
from pywinauto import mouse
from pywinauto import win32api
def retrieve_project_parameters():
parameters = sys.argv
parameters_number = parameters.index("-traces") if "-traces" in parameters else None
if parame... | [
"pywinauto.win32api.GetCursorPos",
"pywinauto.application.Application",
"traceback.format_exc",
"datetime.datetime.now",
"pywinauto.mouse.move"
] | [((24782, 24804), 'traceback.format_exc', 'traceback.format_exc', ([], {}), '()\n', (24802, 24804), False, 'import traceback\n'), ((14839, 14861), 'traceback.format_exc', 'traceback.format_exc', ([], {}), '()\n', (14859, 14861), False, 'import traceback\n'), ((20668, 20691), 'pywinauto.win32api.GetCursorPos', 'win32api... |
"""Manage grid logic"""
import math
from random import random
import numpy as np
from PIL import Image, ImageDraw, ImageFilter
# defaults
HNPOLY = 64 # image height will contain HNPOLY polygons
COEF = 0.560451 # [0, 1) move verteces coef dist as ratio to next vert
NCOLORS = 128 # reduce pallete to... | [
"PIL.Image.new",
"numpy.zeros",
"math.sin",
"PIL.Image.open",
"random.random",
"math.cos",
"PIL.ImageDraw.Draw"
] | [((766, 862), 'numpy.zeros', 'np.zeros', (['(self.h, self.w)'], {'dtype': "[('rgb', int, 3), ('noise', float), ('sharpness', float)]"}), "((self.h, self.w), dtype=[('rgb', int, 3), ('noise', float), (\n 'sharpness', float)])\n", (774, 862), True, 'import numpy as np\n'), ((906, 976), 'numpy.zeros', 'np.zeros', (['(s... |
import logging
from utils import dotdict
from gomaku.pytorch.NNet import NNetWrapper as NNet
from MCTS import MCTS
import numpy as np
from time import sleep
from gomaku.GomakuGame import GomakuGame
import os
from tqdm import tqdm
log = logging.getLogger(__name__) | [
"logging.getLogger"
] | [((238, 265), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (255, 265), False, 'import logging\n')] |
import argparse
import logging
import multiprocessing as mp
import logging
import os
from detectron2.evaluation import inference_context
import torch
import torch.distributed as dist
import torch.multiprocessing as mp
from detectron2.utils.collect_env import collect_env_info
from detectron2.utils.logger import setup_lo... | [
"shapenet.config.config.get_shapenet_cfg",
"shapenet.utils.checkpoint.clean_state_dict",
"pytorch3d.io.save_obj",
"argparse.ArgumentParser",
"detectron2.utils.logger.setup_logger",
"torchvision.transforms.ToTensor",
"torch.multiprocessing.set_start_method",
"shapenet.data.utils.imagenet_preprocess",
... | [((746, 771), 'logging.getLogger', 'logging.getLogger', (['"""demo"""'], {}), "('demo')\n", (763, 771), False, 'import logging\n'), ((805, 823), 'shapenet.config.config.get_shapenet_cfg', 'get_shapenet_cfg', ([], {}), '()\n', (821, 823), False, 'from shapenet.config.config import get_shapenet_cfg\n'), ((965, 1017), 'ar... |
import logging
from database import Database
from kafka import KafkaConsumer
from os import getenv
from prometheus_client import Counter, start_http_server
from pythonjsonlogger import jsonlogger
if __name__ == '__main__':
logger = logging.getLogger()
logHandler = logging.StreamHandler()
format_str = '%(... | [
"pythonjsonlogger.jsonlogger.JsonFormatter",
"prometheus_client.start_http_server",
"logging.exception",
"logging.StreamHandler",
"logging.info",
"database.Database",
"logging.shutdown",
"prometheus_client.Counter",
"os.getenv",
"logging.getLogger"
] | [((239, 258), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (256, 258), False, 'import logging\n'), ((276, 299), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (297, 299), False, 'import logging\n'), ((375, 411), 'pythonjsonlogger.jsonlogger.JsonFormatter', 'jsonlogger.JsonFormatter',... |
__author__ = '<NAME>'
from pyevolve import Util
from random import randint as rand_randint, gauss as rand_gauss
from pyevolve import Consts
def G1DListMutatorIntegerGaussian(genome, **args):
""" A gaussian mutator for G1DList of Integers
Accepts the *rangemin* and *rangemax* genome parameters, both optional... | [
"random.gauss",
"pyevolve.Util.randomFlipCoin",
"random.randint"
] | [((898, 931), 'pyevolve.Util.randomFlipCoin', 'Util.randomFlipCoin', (["args['pmut']"], {}), "(args['pmut'])\n", (917, 931), False, 'from pyevolve import Util\n'), ((1321, 1350), 'random.randint', 'rand_randint', (['(0)', '(listSize - 1)'], {}), '(0, listSize - 1)\n', (1333, 1350), True, 'from random import randint as ... |
import dash_bootstrap_components as dbc
import dash_html_components as html
from dash.dependencies import Input, Output
button_group = html.Div(
[
dbc.RadioItems(
id="radios",
className="btn-group",
labelClassName="btn btn-secondary",
labelCheckedClassName="a... | [
"dash_html_components.Div",
"dash.dependencies.Input",
"dash.dependencies.Output",
"dash_bootstrap_components.RadioItems"
] | [((635, 663), 'dash.dependencies.Output', 'Output', (['"""output"""', '"""children"""'], {}), "('output', 'children')\n", (641, 663), False, 'from dash.dependencies import Input, Output\n'), ((160, 415), 'dash_bootstrap_components.RadioItems', 'dbc.RadioItems', ([], {'id': '"""radios"""', 'className': '"""btn-group"""'... |
from .particle_filter_base import ParticleFilter
from core.resampling.resampler import Resampler
import copy
import numpy as np
from scipy.stats import multivariate_normal
from scipy import linalg
class KalmanParticleFilter(ParticleFilter):
"""
Notes:
* State is (x, y, heading), where x and y are in ... | [
"numpy.random.uniform",
"copy.deepcopy",
"numpy.arctan2",
"numpy.eye",
"numpy.transpose",
"numpy.cumsum",
"numpy.sin",
"numpy.random.multivariate_normal",
"numpy.array",
"scipy.stats.multivariate_normal.pdf",
"numpy.cos",
"numpy.dot",
"numpy.diag",
"scipy.linalg.pinv",
"numpy.sqrt"
] | [((1674, 1737), 'numpy.diag', 'np.diag', (['[process_noise[0], process_noise[0], process_noise[1]]'], {}), '([process_noise[0], process_noise[0], process_noise[1]])\n', (1681, 1737), True, 'import numpy as np\n'), ((1755, 1808), 'numpy.diag', 'np.diag', (['[measurement_noise[0], measurement_noise[1]]'], {}), '([measure... |
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(25,GPIO.OUT)
while True:
GPIO.output(25,GPIO.HIGH)
time.sleep(1)
GPIO.output(25,GPIO.LOW)
time.sleep(1)
| [
"RPi.GPIO.setup",
"RPi.GPIO.setmode",
"RPi.GPIO.output",
"time.sleep"
] | [((38, 60), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BCM'], {}), '(GPIO.BCM)\n', (50, 60), True, 'import RPi.GPIO as GPIO\n'), ((61, 85), 'RPi.GPIO.setup', 'GPIO.setup', (['(25)', 'GPIO.OUT'], {}), '(25, GPIO.OUT)\n', (71, 85), True, 'import RPi.GPIO as GPIO\n'), ((102, 128), 'RPi.GPIO.output', 'GPIO.output', (['(25... |
from app import db
class CompanyPostalCode(db.Model):
__tablename__ = 'company_postal_code'
id = db.Column(db.Integer, primary_key=True)
postal_code_id = db.Column(db.Integer, db.ForeignKey('postal_codes.id'))
company_id = db.Column(db.Integer, db.ForeignKey('companies.id'))
| [
"app.db.ForeignKey",
"app.db.Column"
] | [((107, 146), 'app.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (116, 146), False, 'from app import db\n'), ((190, 222), 'app.db.ForeignKey', 'db.ForeignKey', (['"""postal_codes.id"""'], {}), "('postal_codes.id')\n", (203, 222), False, 'from app import db\n')... |
from telegram.ext import Updater
from CREDENTIALS import TOKEN
updater = Updater(token=TOKEN)
dispatcher = updater.dispatcher
| [
"telegram.ext.Updater"
] | [((74, 94), 'telegram.ext.Updater', 'Updater', ([], {'token': 'TOKEN'}), '(token=TOKEN)\n', (81, 94), False, 'from telegram.ext import Updater\n')] |
"""
Compare puncta distribution in a channel with synapse distribution.
"""
import os
import copy
import socket
import numpy as np
import pandas as pd
from skimage import measure
from at_synapse_detection import SynapseDetection as syn
from at_synapse_detection import dataAccess as da
from at_synapse_detection import... | [
"at_synapse_detection.antibodyAnalysis.calculuate_target_ratio",
"numpy.load",
"at_synapse_detection.antibodyAnalysis.write_dfs_to_excel",
"skimage.measure.label",
"at_synapse_detection.SynapseDetection.convolveVolume",
"at_synapse_detection.SynapseAnalysis.mask_synaptic_volumes",
"os.path.join",
"ski... | [((1029, 1055), 'at_synapse_detection.antibodyAnalysis.AntibodyAnalysis', 'aa.AntibodyAnalysis', (['query'], {}), '(query)\n', (1048, 1055), True, 'from at_synapse_detection import antibodyAnalysis as aa\n'), ((1606, 1683), 'at_synapse_detection.antibodyAnalysis.compute_raw_measures', 'aa.compute_raw_measures', (['pres... |
import subprocess
import os
from invoke import task
SRC_DIR = "signal_interpreter_client"
TEST_DIR = "tests"
UNIT_DIR = os.path.join(TEST_DIR, "unit")
INTEGRATION_DIR = os.path.join(TEST_DIR, "integration")
COV_PATH = ".coveragerc"
@task
def style(_):
cmd = f"pycodestyle {SRC_DIR} --ignore=E501"
subprocess.c... | [
"subprocess.call",
"os.path.join"
] | [((121, 151), 'os.path.join', 'os.path.join', (['TEST_DIR', '"""unit"""'], {}), "(TEST_DIR, 'unit')\n", (133, 151), False, 'import os\n'), ((170, 207), 'os.path.join', 'os.path.join', (['TEST_DIR', '"""integration"""'], {}), "(TEST_DIR, 'integration')\n", (182, 207), False, 'import os\n'), ((308, 340), 'subprocess.call... |
import os
import tempfile
from Bio.Blast import NCBIXML
from django.test import TestCase
from blastplus import utils
from blastplus.features import record
from blastplus.settings import SAMPLE_DIR
class UtilsTestCase(TestCase):
def setUp(self):
self.fastfile = tempfile.NamedTemporaryFile(mode="w+", dele... | [
"tempfile.NamedTemporaryFile",
"blastplus.utils.get_sample_data",
"os.path.join",
"os.unlink"
] | [((277, 329), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', ([], {'mode': '"""w+"""', 'delete': '(False)'}), "(mode='w+', delete=False)\n", (304, 329), False, 'import tempfile\n'), ((469, 506), 'os.path.join', 'os.path.join', (['SAMPLE_DIR', '"""blast.xml"""'], {}), "(SAMPLE_DIR, 'blast.xml')\n", (481, ... |
import cobra
import copy
from commmodelpy.commmodelpy import Community, SingleModel, create_community_model_with_balanced_growth
from typing import Dict
growth_rate = 0.4
# ecolicore double model
# with internal exchanges for everything in the periplasm
ecoli_model = cobra.io.read_sbml_model(
"./publication_runs/e... | [
"copy.deepcopy",
"cobra.io.read_sbml_model",
"commmodelpy.commmodelpy.SingleModel",
"commmodelpy.commmodelpy.create_community_model_with_balanced_growth",
"cobra.io.write_sbml_model"
] | [((269, 366), 'cobra.io.read_sbml_model', 'cobra.io.read_sbml_model', (['"""./publication_runs/ecoli_models/original_sbml_models/iML1515.xml"""'], {}), "(\n './publication_runs/ecoli_models/original_sbml_models/iML1515.xml')\n", (293, 366), False, 'import cobra\n'), ((3176, 3536), 'commmodelpy.commmodelpy.SingleMode... |