code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from pylab import *
import re
from sklearn.metrics.pairwise import euclidean_distances
import keywords
import problem_params
pb_video_id_dict = {
'1-1' : 'ID',
}
# specify problem number
unit = int(sys.argv[1])
pb = int(sys.argv[2])
u_pb = '{}-... | [
"pandas.Series",
"pandas.read_csv",
"pandas.DataFrame",
"re.sub",
"pandas.concat"
] | [((852, 869), 'pandas.concat', 'pd.concat', (['yr_dfs'], {}), '(yr_dfs)\n', (861, 869), True, 'import pandas as pd\n'), ((901, 961), 'pandas.read_csv', 'pd.read_csv', (['"""../../data/video_stats_day_id_1-1_2-3_4-7.csv"""'], {}), "('../../data/video_stats_day_id_1-1_2-3_4-7.csv')\n", (912, 961), True, 'import pandas as... |
import numpy as np
def score(input):
if (input[2]) <= (2.6):
var0 = np.asarray([1.0, 0.0, 0.0])
else:
if (input[2]) <= (4.8500004):
if (input[3]) <= (1.6500001):
var0 = np.asarray([0.0, 1.0, 0.0])
else:
var0 = np.asarray([0.0, 0.33333333333... | [
"numpy.asarray"
] | [((80, 107), 'numpy.asarray', 'np.asarray', (['[1.0, 0.0, 0.0]'], {}), '([1.0, 0.0, 0.0])\n', (90, 107), True, 'import numpy as np\n'), ((221, 248), 'numpy.asarray', 'np.asarray', (['[0.0, 1.0, 0.0]'], {}), '([0.0, 1.0, 0.0])\n', (231, 248), True, 'import numpy as np\n'), ((290, 347), 'numpy.asarray', 'np.asarray', (['... |
from otp.ai.AIBaseGlobal import *
from direct.task.Task import Task
from direct.distributed.ClockDelta import *
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM, State
from direct.distributed import DistributedObjectAI
from direct.fsm import State
class DistributedDoorAI(Distributed... | [
"direct.distributed.DistributedObjectAI.DistributedObjectAI.delete",
"direct.fsm.State.State",
"direct.distributed.DistributedObjectAI.DistributedObjectAI.__init__"
] | [((453, 512), 'direct.distributed.DistributedObjectAI.DistributedObjectAI.__init__', 'DistributedObjectAI.DistributedObjectAI.__init__', (['self', 'air'], {}), '(self, air)\n', (501, 512), False, 'from direct.distributed import DistributedObjectAI\n'), ((2636, 2688), 'direct.distributed.DistributedObjectAI.DistributedO... |
#!/home/zhihou/anaconda3/envs/tf/bin/python
# --------------------------------------------------------
# Tensorflow VCL
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# ---------
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
... | [
"argparse.ArgumentParser"
] | [((429, 484), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Test VCL on HICO"""'}), "(description='Test VCL on HICO')\n", (452, 484), False, 'import argparse\n')] |
# Basic example of setting digits on a LED segment display.
# This example and library is meant to work with Adafruit CircuitPython API.
# Author: <NAME>
# License: Public Domain
import time
# Import all board pins.
import board
import busio
# Import the HT16K33 LED segment module.
from adafruit_ht16k33 import segme... | [
"adafruit_ht16k33.segments.Seg7x4",
"busio.I2C",
"time.sleep"
] | [((360, 391), 'busio.I2C', 'busio.I2C', (['board.SCL', 'board.SDA'], {}), '(board.SCL, board.SDA)\n', (369, 391), False, 'import busio\n'), ((483, 503), 'adafruit_ht16k33.segments.Seg7x4', 'segments.Seg7x4', (['i2c'], {}), '(i2c)\n', (498, 503), False, 'from adafruit_ht16k33 import segments\n'), ((810, 823), 'time.slee... |
import numpy as np
import matplotlib as mpl
if os.environ.get('DISPLAY','') == '':
print('no display found. Using non-interactive Agg backend')
mpl.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
import paths
import counterfactuals.infrastructurefunctions as infr
import counter... | [
"matplotlib.pyplot.savefig",
"matplotlib.use",
"numpy.array",
"matplotlib.pyplot.tight_layout",
"numpy.load",
"matplotlib.pyplot.subplots",
"numpy.arange"
] | [((386, 414), 'numpy.array', 'np.array', (['[-4.0, -2.5, -1.8]'], {}), '([-4.0, -2.5, -1.8])\n', (394, 414), True, 'import numpy as np\n'), ((423, 463), 'numpy.array', 'np.array', (['[0.0, 0.2, 0.4, 0.6, 0.8, 0.9]'], {}), '([0.0, 0.2, 0.4, 0.6, 0.8, 0.9])\n', (431, 463), True, 'import numpy as np\n'), ((2776, 2868), 'm... |
# Copyright 2011-2021 <NAME> and The University of British Columbia
# 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 appli... | [
"datetime.datetime",
"unittest.mock.Mock",
"unittest.mock.mock_open",
"unittest.mock.call",
"arrow.get",
"pytest.mark.usefixtures",
"pytest.fixture",
"unittest.mock.patch"
] | [((1057, 1089), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (1071, 1089), False, 'import pytest\n'), ((2412, 2447), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""ensemble"""'], {}), "('ensemble')\n", (2435, 2447), False, 'import pytest\n'), ((2553, 2593),... |
# %% IMPORTS
# Package imports
from matplotlib.cm import register_cmap
from matplotlib.colors import ListedColormap
# All declaration
__all__ = ['cmap']
# Author declaration
__author__ = "<NAME> (@1313e)"
# Package declaration
__package__ = 'cmasher'
# %% GLOBALS AND DEFINITIONS
# Type of this colormap
cm_type = '... | [
"matplotlib.cm.register_cmap",
"matplotlib.colors.ListedColormap"
] | [((25458, 25510), 'matplotlib.colors.ListedColormap', 'ListedColormap', (['cm_data'], {'name': '"""cmr.waterlily"""', 'N': '(511)'}), "(cm_data, name='cmr.waterlily', N=511)\n", (25472, 25510), False, 'from matplotlib.colors import ListedColormap\n'), ((25571, 25595), 'matplotlib.cm.register_cmap', 'register_cmap', ([]... |
"""
Copyright 2020 Cartesi Pte. 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 d... | [
"subprocess.Popen",
"subprocess.run",
"os.remove"
] | [((2494, 2566), 'subprocess.run', 'subprocess.run', (['cmd_line'], {'stdout': 'subprocess.PIPE', 'stderr': 'subprocess.PIPE'}), '(cmd_line, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n', (2508, 2566), False, 'import subprocess\n'), ((4125, 4197), 'subprocess.run', 'subprocess.run', (['cmd_line'], {'stdout': 'subpr... |
from PyQt4 import QtGui
from PySide import QtGui
import dictionaries.constants as cs
################################################################################
class InfoDialog(QtGui.QWidget):
def __init__(self, info_message):
super(InfoDialog, self).__init__()
self.build_lab... | [
"PySide.QtGui.QFont",
"PySide.QtGui.QHBoxLayout",
"PySide.QtGui.QPushButton",
"PySide.QtGui.QVBoxLayout",
"PySide.QtGui.QLabel"
] | [((453, 472), 'PySide.QtGui.QHBoxLayout', 'QtGui.QHBoxLayout', ([], {}), '()\n', (470, 472), False, 'from PySide import QtGui\n'), ((571, 590), 'PySide.QtGui.QVBoxLayout', 'QtGui.QVBoxLayout', ([], {}), '()\n', (588, 590), False, 'from PySide import QtGui\n'), ((936, 968), 'PySide.QtGui.QLabel', 'QtGui.QLabel', (['info... |
####################################################################################################
# #
# Script for the analysis of Free energy simulations using MBAR #
# ... | [
"matplotlib.pylab.savefig",
"matplotlib.pylab.ioff",
"ipywidgets.BoundedIntText",
"sys.exit",
"os.listdir",
"matplotlib.pylab.figure",
"ipywidgets.Checkbox",
"bz2.BZ2File",
"os.path.isdir",
"ipywidgets.interactive_output",
"warnings.warn",
"matplotlib.pylab.close",
"matplotlib.pylab.errorbar... | [((3559, 3601), 'pymbar.MBAR', 'MBAR', (['self._u_kln', 'self._N_k'], {'verbose': '(True)'}), '(self._u_kln, self._N_k, verbose=True)\n', (3563, 3601), False, 'from pymbar import MBAR\n'), ((14600, 14637), 'ipywidgets.Layout', 'Layout', ([], {'flex': '"""2 1 auto"""', 'width': '"""auto"""'}), "(flex='2 1 auto', width='... |
import random
import numpy as np
import torch
from openprompt.utils.logging import logger
from typing import *
def set_seed(seed:Optional[int] = None):
"""set seed for reproducibility
Args:
seed (:obj:`int`): the seed to seed everything for reproducibility. if None, do nothing.
"""
if seed:
... | [
"torch.cuda.manual_seed_all",
"torch.manual_seed",
"random.seed",
"openprompt.utils.logging.logger.info",
"numpy.random.seed"
] | [((328, 345), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (339, 345), False, 'import random\n'), ((354, 374), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (368, 374), True, 'import numpy as np\n'), ((383, 406), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (40... |
from sklearn.pipeline import Pipeline
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.calibration import CalibratedClassifierCV
from sklearn.svm import LinearSVC
from sklearn.multiclass import OneVsRestClassifier
import pandas as pd
from sklearn.model_selection import train_test_split
from skle... | [
"pandas.Series",
"matplotlib.pyplot.savefig",
"pandas.read_csv",
"numpy.hstack",
"sklearn.model_selection.train_test_split",
"numpy.delete",
"matplotlib.pyplot.ylabel",
"sklearn.svm.LinearSVC",
"matplotlib.pyplot.show",
"numpy.argsort",
"sklearn.feature_extraction.text.TfidfVectorizer",
"matpl... | [((2003, 2038), 'pandas.read_csv', 'pd.read_csv', (["('Data/' + icd + '.csv')"], {}), "('Data/' + icd + '.csv')\n", (2014, 2038), True, 'import pandas as pd\n'), ((2044, 2062), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {}), '(data)\n', (2056, 2062), True, 'import pandas as pd\n'), ((2110, 2139), 'pandas.Series', '... |
from pydantic import AnyHttpUrl, BaseModel, PositiveInt
from pydantic.networks import stricturl
from tortoise.contrib.pydantic import pydantic_model_creator
from typing import Dict, List, Literal, Optional
from app import models
# 環境設定を表す Pydantic モデル
# バリデーションは環境設定をこの Pydantic モデルに通して行う
class Config(BaseModel):
... | [
"tortoise.contrib.pydantic.pydantic_model_creator",
"pydantic.networks.stricturl"
] | [((861, 916), 'tortoise.contrib.pydantic.pydantic_model_creator', 'pydantic_model_creator', (['models.Programs'], {'name': '"""Program"""'}), "(models.Programs, name='Program')\n", (883, 916), False, 'from tortoise.contrib.pydantic import pydantic_model_creator\n'), ((1049, 1104), 'tortoise.contrib.pydantic.pydantic_mo... |
import pandas as pd
import pyarrow as pa
import pyarrow.parquet as pq
def convert(csv_file:str, parquet_file:str ,chunksize = 100_000, sep=','):
"""[summary]
Parameters
----------
csv_file : str
'/path/to/my.tsv'
parquet_file : str
'/path/to/my.parquet'
chunksize : [type], opti... | [
"pyarrow.Table.from_pandas",
"pyarrow.parquet.ParquetWriter",
"pandas.read_csv"
] | [((455, 524), 'pandas.read_csv', 'pd.read_csv', (['csv_file'], {'sep': 'sep', 'chunksize': 'chunksize', 'low_memory': '(False)'}), '(csv_file, sep=sep, chunksize=chunksize, low_memory=False)\n', (466, 524), True, 'import pandas as pd\n'), ((956, 1006), 'pyarrow.Table.from_pandas', 'pa.Table.from_pandas', (['chunk'], {'... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Dict, List, Optional, Tuple
from ax.core.data import Data
from ax.core.experiment import Experiment... | [
"ax.modelbridge.modelbridge_utils.extract_parameter_constraints",
"ax.modelbridge.modelbridge_utils.transform_callback",
"ax.modelbridge.modelbridge_utils.extract_search_space_digest",
"ax.utils.common.docutils.copy_doc",
"ax.modelbridge.modelbridge_utils.get_fixed_features",
"ax.modelbridge.modelbridge_u... | [((1923, 1951), 'ax.utils.common.docutils.copy_doc', 'copy_doc', (['ModelBridge.update'], {}), '(ModelBridge.update)\n', (1931, 1951), False, 'from ax.utils.common.docutils import copy_doc\n'), ((2625, 2683), 'ax.modelbridge.modelbridge_utils.extract_search_space_digest', 'extract_search_space_digest', (['search_space'... |
from aleph.model.messages import Message
from aleph.web import app
from aleph.web.controllers.utils import (Pagination,
cond_output, prepare_date_filters)
async def view_messages_list(request):
""" Messages list view with filters
"""
find_filters = {}
query_s... | [
"aleph.model.messages.Message.collection.count_documents",
"aleph.web.app.router.add_get",
"aleph.web.controllers.utils.prepare_date_filters",
"aleph.web.controllers.utils.Pagination",
"aleph.web.controllers.utils.Pagination.get_pagination_params",
"aleph.web.controllers.utils.cond_output",
"aleph.model... | [((3543, 3606), 'aleph.web.app.router.add_get', 'app.router.add_get', (['"""/api/v0/messages.json"""', 'view_messages_list'], {}), "('/api/v0/messages.json', view_messages_list)\n", (3561, 3606), False, 'from aleph.web import app\n'), ((3607, 3682), 'aleph.web.app.router.add_get', 'app.router.add_get', (['"""/api/v0/me... |
# This code parses date/times, so please
#
# pip install python-dateutil
#
# To use this code, make sure you
#
# import json
#
# and then, to convert JSON from a string, do
#
# result = article_model_from_dict(json.loads(json_string))
from enum import Enum
from dataclasses import dataclass
from typing impo... | [
"typing.cast",
"typing.TypeVar"
] | [((423, 435), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (430, 435), False, 'from typing import Any, List, TypeVar, Type, Callable, cast\n'), ((444, 472), 'typing.TypeVar', 'TypeVar', (['"""EnumT"""'], {'bound': 'Enum'}), "('EnumT', bound=Enum)\n", (451, 472), False, 'from typing import Any, List, TypeV... |
import os
from uuid import getnode as get_mac
APP_PATH = os.path.normpath(os.path.join(
os.path.dirname(os.path.abspath(__file__)),
os.pardir))
LIB_PATH = os.path.join(APP_PATH, "robot")
DATA_PATH = os.path.join(APP_PATH, "static")
TEMP_PATH = os.path.join(APP_PATH, "temp")
OUTFILES_PATH = os.path.jo... | [
"os.path.abspath",
"os.path.join",
"os.getenv",
"uuid.getnode"
] | [((171, 202), 'os.path.join', 'os.path.join', (['APP_PATH', '"""robot"""'], {}), "(APP_PATH, 'robot')\n", (183, 202), False, 'import os\n'), ((216, 248), 'os.path.join', 'os.path.join', (['APP_PATH', '"""static"""'], {}), "(APP_PATH, 'static')\n", (228, 248), False, 'import os\n'), ((262, 292), 'os.path.join', 'os.path... |
from django.urls import path
from . import views
from .views import AboutView, CategoryListView, PostClassBasedListView, PostClassFilteringListView, \
CategoryCreateView, CategoryUpdateView, CategoryFormView, DetailCoolUser, category_api, \
categories_list
urlpatterns = [
path('', views.post_list, name='p... | [
"django.urls.path"
] | [((287, 331), 'django.urls.path', 'path', (['""""""', 'views.post_list'], {'name': '"""posts-list"""'}), "('', views.post_list, name='posts-list')\n", (291, 331), False, 'from django.urls import path\n'), ((337, 404), 'django.urls.path', 'path', (['"""post/<int:post_id>/"""', 'views.post_detail'], {'name': '"""posts-de... |
import json
import os
class JsonLoader:
"""
JsonLoader is used to load the data from all structured json files associated with the DeepInterpolation package.
"""
def __init__(self, path):
self.path = path
self.load_json()
def load_json(self):
"""
This function lo... | [
"json.load",
"json.dump",
"os.chmod"
] | [((2471, 2490), 'os.chmod', 'os.chmod', (['path', '(511)'], {}), '(path, 511)\n', (2479, 2490), False, 'import os\n'), ((538, 558), 'json.load', 'json.load', (['read_file'], {}), '(read_file)\n', (547, 558), False, 'import json\n'), ((2430, 2462), 'json.dump', 'json.dump', (['self.dict', 'write_file'], {}), '(self.dict... |
"""Top-level commands for peer reviewing.
This module contains the top-level functions for RepoBee's peer review
functionality. Each public function in this module is to be treated as a
self-contained program.
.. module:: peer
:synopsis: Top-level commands for peer reviewing.
.. moduleauthor:: <NAME>
"""
from ty... | [
"_repobee.formatters.format_peer_review_progress_output",
"repobee_plug.generate_review_team_name",
"repobee_plug.generate_repo_name",
"repobee_plug.manager.hook.generate_review_allocations"
] | [((1721, 1809), 'repobee_plug.manager.hook.generate_review_allocations', 'plug.manager.hook.generate_review_allocations', ([], {'teams': 'teams', 'num_reviews': 'num_reviews'}), '(teams=teams, num_reviews=\n num_reviews)\n', (1766, 1809), True, 'import repobee_plug as plug\n'), ((3392, 3449), 'repobee_plug.generate_... |
import urllib
import httplib
import re
import os
import time
import userinterface.Client as Client
def sendCommand(function, node, _logger):
"""
Send a command to the panda server.
URL is composed by baseURLSS+function parameter
The node parameter is url encoded and sent in the request
The answer ... | [
"httplib.HTTPSConnection",
"os.getuid",
"urllib.urlencode",
"time.time",
"os.environ.has_key",
"re.search"
] | [((418, 455), 'os.environ.has_key', 'os.environ.has_key', (['"""X509_USER_PROXY"""'], {}), "('X509_USER_PROXY')\n", (436, 455), False, 'import os\n'), ((673, 712), 're.search', 're.search', (['"""[^:/]+://([^/]+)(/.+)"""', 'url'], {}), "('[^:/]+://([^/]+)(/.+)', url)\n", (682, 712), False, 'import re\n'), ((779, 801), ... |
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
"logger.warning",
"test_utils.skip_test",
"functools.wraps"
] | [((859, 883), 'logger.warning', 'logger.warning', (['MOCK_MSG'], {}), '(MOCK_MSG)\n', (873, 883), False, 'import logger\n'), ((1110, 1119), 'functools.wraps', 'wraps', (['fn'], {}), '(fn)\n', (1115, 1119), False, 'from functools import wraps\n'), ((1255, 1274), 'test_utils.skip_test', 'skip_test', (['MOCK_MSG'], {}), '... |
# Copyright 2017 - RoboDK Software S.L. - http://www.robodk.com/
# 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 applicabl... | [
"os.startfile",
"subprocess.Popen"
] | [((6837, 6878), 'subprocess.Popen', 'subprocess.Popen', (['[show_result, filesave]'], {}), '([show_result, filesave])\n', (6853, 6878), False, 'import subprocess\n'), ((6980, 7022), 'subprocess.Popen', 'subprocess.Popen', (['(show_result + [filesave])'], {}), '(show_result + [filesave])\n', (6996, 7022), False, 'import... |
"""
Run multiple instances from terminal to test
python tabtool/resource_test.py
"""
from tabtool import resource
import unittest
import time
import logging
import os
def _incorrect_code():
for i in a:
print(i)
def _runtime_error():
return 1 / 0
class TestResource(unittest.TestCase):
def test_ge... | [
"logging.basicConfig",
"logging.getLogger",
"time.sleep",
"tabtool.resource.get_available_gpus",
"unittest.main",
"logging.info",
"tabtool.resource.Scheduler"
] | [((1179, 1276), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""[tabtool:%(filename)s:L%(lineno)d] %(levelname)-6s %(message)s"""'}), "(format=\n '[tabtool:%(filename)s:L%(lineno)d] %(levelname)-6s %(message)s')\n", (1198, 1276), False, 'import logging\n'), ((1337, 1352), 'unittest.main', 'unittest... |
import numpy as np
world_alcohol = np.genfromtxt('world_alcohol.csv', delimiter =',', dtype = 'U75', skip_header = 1)
#Je ne dois pas utiliser skip_header, sinon quand on utilise le skip_header pour suprrimer la première ligne
print(world_alcohol) | [
"numpy.genfromtxt"
] | [((36, 113), 'numpy.genfromtxt', 'np.genfromtxt', (['"""world_alcohol.csv"""'], {'delimiter': '""","""', 'dtype': '"""U75"""', 'skip_header': '(1)'}), "('world_alcohol.csv', delimiter=',', dtype='U75', skip_header=1)\n", (49, 113), True, 'import numpy as np\n')] |
"""
Copyright (c) 2016-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
"""
import logging
import textwr... | [
"textwrap.wrap"
] | [((810, 833), 'textwrap.wrap', 'textwrap.wrap', (['value', '(2)'], {}), '(value, 2)\n', (823, 833), False, 'import textwrap\n')] |
from flask import Flask, render_template
app = Flask(__name__)
app.config['SECRET_KEY'] = 'important to keep unknown in production'
from flask_wtf import Form
from wtforms import StringField
from wtforms.validators import DataRequired
class MyForm(Form):
name = StringField('first name', validators=[DataRequired... | [
"flask.render_template",
"flask_sqlalchemy.SQLAlchemy",
"wtforms.validators.DataRequired",
"flask.Flask"
] | [((48, 63), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (53, 63), False, 'from flask import Flask, render_template\n'), ((497, 512), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', (['app'], {}), '(app)\n', (507, 512), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((1203, 1308), 'flask.render_templa... |
import random
from typing import List, Union
class InvalidAction(Exception):
pass
class Round:
def __init__(self) -> None:
self.dice = [
None,
None,
None,
None,
None,
]
self.rolls = 0
self.roll()
def roll(
... | [
"random.randint"
] | [((667, 687), 'random.randint', 'random.randint', (['(1)', '(6)'], {}), '(1, 6)\n', (681, 687), False, 'import random\n'), ((737, 757), 'random.randint', 'random.randint', (['(1)', '(6)'], {}), '(1, 6)\n', (751, 757), False, 'import random\n'), ((807, 827), 'random.randint', 'random.randint', (['(1)', '(6)'], {}), '(1,... |
import collections
import fnmatch
import json
import math
import os
from typing import Dict, List
from PIL import Image # requires: pip install Pillow
AllocatedSpace = collections.namedtuple("AllocatedSpace", ["x", "y", "width", "height"])
Row = collections.namedtuple("Row", ["top", "height", "free_width"])
class... | [
"collections.namedtuple",
"os.listdir",
"os.makedirs",
"PIL.Image.new",
"os.path.join",
"json.load",
"PIL.Image.frombytes"
] | [((172, 243), 'collections.namedtuple', 'collections.namedtuple', (['"""AllocatedSpace"""', "['x', 'y', 'width', 'height']"], {}), "('AllocatedSpace', ['x', 'y', 'width', 'height'])\n", (194, 243), False, 'import collections\n'), ((250, 312), 'collections.namedtuple', 'collections.namedtuple', (['"""Row"""', "['top', '... |
"""
"""
from vyapp.mixins import DataEvent, IdleEvent
from vyapp.stderr import printd
from tkinter import Text, IntVar
import os
class AreaVi(Text, DataEvent, IdleEvent):
INPUT = None
# Plugins should commonly use self.project
# if it fails then use HOME.
HOME = ''
def __init__(self, default_... | [
"tkinter.IntVar",
"vyapp.mixins.DataEvent.__init__",
"tkinter.Text.__init__",
"os.path.splitext",
"os.path.abspath",
"vyapp.mixins.IdleEvent.__init__",
"vyapp.stderr.printd"
] | [((654, 690), 'tkinter.Text.__init__', 'Text.__init__', (['self', '*args'], {}), '(self, *args, **kwargs)\n', (667, 690), False, 'from tkinter import Text, IntVar\n'), ((699, 729), 'vyapp.mixins.DataEvent.__init__', 'DataEvent.__init__', (['self', 'self'], {}), '(self, self)\n', (717, 729), False, 'from vyapp.mixins im... |
import os
import numpy as np
from experiments import exp_interface
from data import *
from model.fully_connected import *
from model.vqc_layers import *
from algo.hmc import *
from quant_architecture.variational_qunt_circuit import *
from algo.algo_interface import *
class digits_exp(exp_interface):
def _... | [
"os.path.basename"
] | [((359, 385), 'os.path.basename', 'os.path.basename', (['__file__'], {}), '(__file__)\n', (375, 385), False, 'import os\n')] |
from pathlib import Path, PosixPath
from typing import List, Union
from hydra import compose, initialize_config_dir
from omegaconf import DictConfig
from experiment_utils import __path__ as experiment_utils_path
experiment_utils_path = experiment_utils_path[0]
def initialize_config(overrides: List[str] = [],
... | [
"hydra.compose",
"pathlib.Path"
] | [((1109, 1136), 'pathlib.Path', 'Path', (['experiment_utils_path'], {}), '(experiment_utils_path)\n', (1113, 1136), False, 'from pathlib import Path, PosixPath\n'), ((1230, 1283), 'hydra.compose', 'compose', ([], {'config_name': 'config_name', 'overrides': 'overrides'}), '(config_name=config_name, overrides=overrides)\... |
"""Mission configuration model."""
import logging
from auvsi_suas.models.fly_zone import FlyZone
from auvsi_suas.models.gps_position import GpsPosition
from auvsi_suas.models.odlc import Odlc
from auvsi_suas.models.stationary_obstacle import StationaryObstacle
from auvsi_suas.models.waypoint import Waypoint
from djang... | [
"logging.getLogger",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.contrib.admin.register",
"django.core.validators.MinValueValidator"
] | [((417, 444), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (434, 444), False, 'import logging\n'), ((3121, 3150), 'django.contrib.admin.register', 'admin.register', (['MissionConfig'], {}), '(MissionConfig)\n', (3135, 3150), False, 'from django.contrib import admin\n'), ((591, 690), 'dj... |
from utils.visualize import HumanPoseVisualizer
from utils.OakRunner import OakRunner
from utils.pose import getKeypoints
from utils.draw import displayFPS
from pathlib import Path
import depthai as dai
import numpy as np
import cv2
fps_limit = 6
frame_width, frame_height = 456, 256
pairs = [[1, 2], [1, 5], [2, 3], ... | [
"depthai.SpatialLocationCalculatorConfigData",
"pathlib.Path",
"cv2.line",
"depthai.Point2f",
"cv2.imshow",
"utils.OakRunner.OakRunner",
"cv2.circle",
"numpy.concatenate",
"utils.visualize.HumanPoseVisualizer",
"cv2.resize",
"depthai.SpatialLocationCalculatorConfig",
"utils.pose.getKeypoints"
... | [((3415, 3426), 'utils.OakRunner.OakRunner', 'OakRunner', ([], {}), '()\n', (3424, 3426), False, 'from utils.OakRunner import OakRunner\n'), ((885, 1008), 'utils.visualize.HumanPoseVisualizer', 'HumanPoseVisualizer', (['(300)', '(300)', '[runner.left_camera_location, runner.right_camera_location]'], {'colors': 'colors'... |
import numpy as np
import pandas as pd
class StrategyOptimiser:
def __init__(self,
fitness_function,
n_generations,
generation_size,
n_genes,
gene_ranges,
mutation_probability,
gene_mutation_probability,
n_select_best):
"""
Initializes a genetic algorithm with the given parameters.
Par... | [
"numpy.multiply",
"numpy.random.random",
"numpy.logical_not",
"numpy.array",
"numpy.random.randint",
"pandas.DataFrame"
] | [((1590, 1655), 'numpy.random.randint', 'np.random.randint', (['self.gene_ranges[i][0]', 'self.gene_ranges[i][1]'], {}), '(self.gene_ranges[i][0], self.gene_ranges[i][1])\n', (1607, 1655), True, 'import numpy as np\n'), ((2389, 2413), 'numpy.logical_not', 'np.logical_not', (['dad_mask'], {}), '(dad_mask)\n', (2403, 241... |
"""Tests for distos.linalg
"""
import sys
sys.path.insert(1, "..")
import unittest
import sympy as sp
import random
from dictos.linalg import dot_product, div
from dictos.error.linear_algebra import InconsistentDataSetError
from gen import random_int, random_string
class LinalgTest(unittest.TestCase):
def test... | [
"sys.path.insert",
"sympy.Mul",
"gen.random_int",
"sympy.simplify",
"sympy.core.Number",
"gen.random_string",
"dictos.linalg.dot_product",
"unittest.main",
"random.randint"
] | [((43, 67), 'sys.path.insert', 'sys.path.insert', (['(1)', '""".."""'], {}), "(1, '..')\n", (58, 67), False, 'import sys\n'), ((4437, 4452), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4450, 4452), False, 'import unittest\n'), ((414, 435), 'random.randint', 'random.randint', (['(1)', '(10)'], {}), '(1, 10)\n',... |
import tensorflow as tf
from tensorflow.keras.layers import Layer
# noinspection DuplicatedCode
class ExtractPatchLayer3(Layer):
def __init__(self, k_size: int = 5, **kwargs):
super().__init__(**kwargs)
if (k_size % 2) == 0:
raise RuntimeError("`k_size` should be odd number.")
... | [
"tensorflow.tile",
"tensorflow.range",
"tensorflow.keras.layers.ZeroPadding2D",
"tensorflow.reshape",
"tensorflow.repeat",
"tensorflow.expand_dims",
"tensorflow.gather_nd",
"tensorflow.stack"
] | [((1001, 1040), 'tensorflow.tile', 'tf.tile', (['wh_indices', '(_img_wh, _k_size)'], {}), '(wh_indices, (_img_wh, _k_size))\n', (1008, 1040), True, 'import tensorflow as tf\n'), ((1057, 1084), 'tensorflow.stack', 'tf.stack', (['[a1, a2]'], {'axis': '(-1)'}), '([a1, a2], axis=-1)\n', (1065, 1084), True, 'import tensorfl... |
from docking_prep_tools import *
import matplotlib.pyplot as plt
# The three following lines utilize functions defined in the
# docking_prep_tools.py script. Change variables as needed.
all_smiles = make_smiles_dict('sample_smiles.smi')
mols = smiles_dict_to_mol_list(all_smiles)
all_fps = fingerprint_mols(mols)
# ... | [
"matplotlib.pyplot.hist",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.title",
"matplotlib.pyplot.xlim"
] | [((944, 967), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""ggplot"""'], {}), "('ggplot')\n", (957, 967), True, 'import matplotlib.pyplot as plt\n'), ((968, 990), 'matplotlib.pyplot.hist', 'plt.hist', (['similarities'], {}), '(similarities)\n', (976, 990), True, 'import matplotlib.pyplot as plt\n'), ((991, 1005... |
#!env/bin/python
# Copyright (C) 2015, Availab.io(R) Ltd. All rights reserved.
import sys
from street_book.app import app
import street_book.startup
if __name__ == '__main__':
app.run()
| [
"street_book.app.app.run"
] | [((181, 190), 'street_book.app.app.run', 'app.run', ([], {}), '()\n', (188, 190), False, 'from street_book.app import app\n')] |
# -*- coding: utf-8 -*-
import scrapy
from floss.items import FramasoftItem
class FramalibreSpider(scrapy.Spider):
name = "framalibre"
allowed_domains = ["framasoft.net"]
start_urls = (
"http://framasoft.net/rubrique2.html",
)
def parse(self, response):
for href in response.xpath(... | [
"floss.items.FramasoftItem",
"scrapy.Request"
] | [((888, 903), 'floss.items.FramasoftItem', 'FramasoftItem', ([], {}), '()\n', (901, 903), False, 'from floss.items import FramasoftItem\n'), ((407, 460), 'scrapy.Request', 'scrapy.Request', (['url'], {'callback': 'self.parse_dir_contents'}), '(url, callback=self.parse_dir_contents)\n', (421, 460), False, 'import scrapy... |
import codecademylib3_seaborn
import numpy as np
from matplotlib import pyplot as plt
from sklearn import datasets
from sklearn.cluster import KMeans
digits = datasets.load_digits()
print(digits.target)
plt.gray()
plt.matshow(digits.images[100])
plt.show()
print(digits.target[100])
model = KMeans(n_clusters = 10, r... | [
"sklearn.cluster.KMeans",
"matplotlib.pyplot.gray",
"sklearn.datasets.load_digits",
"numpy.array",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.matshow",
"matplotlib.pyplot.show"
] | [((161, 183), 'sklearn.datasets.load_digits', 'datasets.load_digits', ([], {}), '()\n', (181, 183), False, 'from sklearn import datasets\n'), ((206, 216), 'matplotlib.pyplot.gray', 'plt.gray', ([], {}), '()\n', (214, 216), True, 'from matplotlib import pyplot as plt\n'), ((217, 248), 'matplotlib.pyplot.matshow', 'plt.m... |
import numpy as np
import tqdm
from scipy import stats
from hmmpy.base import BaseHiddenMarkov
class SampleHMM(BaseHiddenMarkov):
"""
Class to handle sampling from HMM hidden_markov with user parameters.
Parameters
----------
n_states : int, default=2
Number of hidden states
hmm_... | [
"numpy.sqrt",
"numpy.random.choice",
"scipy.stats.norm.rvs",
"numpy.array",
"numpy.zeros",
"numpy.empty",
"numpy.random.seed",
"numpy.arange"
] | [((1931, 1957), 'numpy.array', 'np.array', (["hmm_params['mu']"], {}), "(hmm_params['mu'])\n", (1939, 1957), True, 'import numpy as np\n'), ((1977, 2004), 'numpy.array', 'np.array', (["hmm_params['std']"], {}), "(hmm_params['std'])\n", (1985, 2004), True, 'import numpy as np\n'), ((2024, 2051), 'numpy.array', 'np.array... |
from ctypes import resize
from dataclasses import field
from django import forms
from website.models import Contact,Newsletter
class NameForm(forms.Form):
name = forms.CharField(label='Your Name',max_length=225)
email = forms.EmailField(label='Your Email')
subject = forms.CharField(label='Your Subject',max... | [
"django.forms.Textarea",
"django.forms.EmailField",
"django.forms.CharField"
] | [((167, 217), 'django.forms.CharField', 'forms.CharField', ([], {'label': '"""Your Name"""', 'max_length': '(225)'}), "(label='Your Name', max_length=225)\n", (182, 217), False, 'from django import forms\n'), ((229, 265), 'django.forms.EmailField', 'forms.EmailField', ([], {'label': '"""Your Email"""'}), "(label='Your ... |
import pypipegraph as ppg
from pathlib import Path
from mbf_sampledata import get_Candidatus_carsonella_ruddii_pv
from mbf_genomes import InteractiveFileBasedGenome
from mbf_genomes import HardCodedGenome # noqa: F401
from pypipegraph.testing import ( # noqa: F401
RaisesDirectOrInsidePipegraph,
run_pipegraph,... | [
"pathlib.Path",
"pypipegraph.run_pipegraph",
"mbf_genomes.InteractiveFileBasedGenome",
"pypipegraph.util.inside_ppg",
"mbf_sampledata.get_Candidatus_carsonella_ruddii_pv",
"pypipegraph.new_pipegraph"
] | [((998, 1248), 'mbf_genomes.InteractiveFileBasedGenome', 'InteractiveFileBasedGenome', (['name', "ppg_genome._filename_lookups['genome.fasta']", "ppg_genome._filename_lookups['cdna.fasta']", "ppg_genome._filename_lookups['proteins.fasta']", "ppg_genome._filename_lookups['genes.gtf']", 'ppg_genome.cache_dir'], {}), "(na... |
import os
import numpy as np
import argparse
import time
import torch
import torchvision
import cv2
def yolo_forward_dynamic(output, num_classes, anchors, num_anchors, scale_x_y):
# Output would be invalid if it does not satisfy this assert
# assert (output.size(1) == (5 + num_classes) * num_anchor... | [
"numpy.fromfile",
"os.listdir",
"numpy.minimum",
"os.makedirs",
"argparse.ArgumentParser",
"numpy.where",
"torch.sigmoid",
"os.path.join",
"numpy.argmax",
"torch.exp",
"numpy.max",
"torch.from_numpy",
"numpy.array",
"torch.tensor",
"numpy.maximum",
"numpy.loadtxt",
"torch.cat"
] | [((1178, 1204), 'torch.cat', 'torch.cat', (['bxy_list'], {'dim': '(1)'}), '(bxy_list, dim=1)\n', (1187, 1204), False, 'import torch\n'), ((1263, 1289), 'torch.cat', 'torch.cat', (['bwh_list'], {'dim': '(1)'}), '(bwh_list, dim=1)\n', (1272, 1289), False, 'import torch\n'), ((1350, 1382), 'torch.cat', 'torch.cat', (['det... |
'''OpenGL extension IMG.read_format
This module customises the behaviour of the
OpenGL.raw.GLES2.IMG.read_format to provide a more
Python-friendly API
Overview (from the spec)
This extension is intended to supplement the GL_OES_read_format
extension by adding support for more format/type combinations t... | [
"OpenGL.extensions.hasGLExtension"
] | [((1760, 1802), 'OpenGL.extensions.hasGLExtension', 'extensions.hasGLExtension', (['_EXTENSION_NAME'], {}), '(_EXTENSION_NAME)\n', (1785, 1802), False, 'from OpenGL import extensions\n')] |
# -*- coding: utf-8 -*-
import cv2
import numpy as np
import sys
def packagedWarpPerspective(f, u0, v0, a, b, c, w, h):
m31 = 0 - a
m32 = 0 - b
m33 = f + a * (w/2 + u0) + b * (h/2 + v0)
m11 = c - w / 2 * a
m12 = 0 - w / 2 * b
m13 = w / 2 * m33 - c * (w/2 + u0)
m21 = 0 - h / 2 * a
m22 = ... | [
"numpy.mat",
"cv2.imwrite",
"cv2.destroyAllWindows",
"sys.exit",
"cv2.waitKey",
"cv2.imread"
] | [((1373, 1408), 'cv2.imread', 'cv2.imread', (['image', 'cv2.IMREAD_COLOR'], {}), '(image, cv2.IMREAD_COLOR)\n', (1383, 1408), False, 'import cv2\n'), ((1776, 1819), 'cv2.imwrite', 'cv2.imwrite', (['"""cxl190012_outp_1.png"""', 'output'], {}), "('cxl190012_outp_1.png', output)\n", (1787, 1819), False, 'import cv2\n'), (... |
#!/usr/bin/env python3
from filterpy.kalman import KalmanFilter
import matplotlib.pyplot as plt
import numpy as np
import pdb
from scipy.optimize import linear_sum_assignment as linear_assignment
import sys
import time
from transform_utils import convert_3dbox_to_8corner
from iou_utils import compute_iou_2d_bboxes
... | [
"scipy.optimize.linear_sum_assignment",
"numpy.where",
"filterpy.kalman.KalmanFilter",
"numpy.column_stack",
"numpy.diag",
"transform_utils.convert_3dbox_to_8corner",
"numpy.array",
"numpy.stack",
"numpy.empty",
"numpy.isnan",
"numpy.concatenate",
"iou_utils.compute_iou_2d_bboxes",
"numpy.ma... | [((8172, 8202), 'scipy.optimize.linear_sum_assignment', 'linear_assignment', (['(-iou_matrix)'], {}), '(-iou_matrix)\n', (8189, 8202), True, 'from scipy.optimize import linear_sum_assignment as linear_assignment\n'), ((8250, 8282), 'numpy.column_stack', 'np.column_stack', (['matched_indices'], {}), '(matched_indices)\n... |
#!/Users/farnoosh/Projects/PyradiomicsExample/myenv/bin/python3
"""
Execute a graph cut on a region image based on some foreground and background markers.
Copyright (C) 2013 <NAME>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published b... | [
"os.path.exists",
"medpy.io.load",
"medpy.core.ArgumentError",
"medpy.graphcut.graph_from_labels",
"scipy.unique",
"argparse.ArgumentParser",
"medpy.filter.relabel_map",
"medpy.core.Logger.getInstance",
"medpy.graphcut.wrapper.split_marker",
"medpy.filter.relabel"
] | [((3441, 3461), 'medpy.core.Logger.getInstance', 'Logger.getInstance', ([], {}), '()\n', (3459, 3461), False, 'from medpy.core import ArgumentError, Logger\n'), ((4375, 4392), 'medpy.io.load', 'load', (['args.region'], {}), '(args.region)\n', (4379, 4392), False, 'from medpy.io import load, save\n'), ((4421, 4439), 'me... |
"""
This file is part of pyS5p
https://github.com/rmvanhees/pys5p.git
The class ICMio provides read access to S5p Tropomi ICM_CA_SIR products
Copyright (c) 2017-2021 SRON - Netherlands Institute for Space Research
All Rights Reserved
License: BSD-3-Clause
"""
from datetime import datetime, timedelta
from pathli... | [
"datetime.datetime",
"pathlib.Path",
"datetime.datetime.utcnow",
"numpy.asarray",
"h5py.File",
"numpy.squeeze",
"numpy.append",
"numpy.issubdtype",
"setuptools_scm.get_version",
"numpy.isnan",
"numpy.split",
"numpy.concatenate",
"h5py.special_dtype",
"pathlib.PurePosixPath"
] | [((11000, 11029), 'datetime.datetime', 'datetime', (['(2010)', '(1)', '(1)', '(0)', '(0)', '(0)'], {}), '(2010, 1, 1, 0, 0, 0)\n', (11008, 11029), False, 'from datetime import datetime, timedelta\n'), ((30579, 30616), 'numpy.concatenate', 'np.concatenate', (['data'], {'axis': 'column_dim'}), '(data, axis=column_dim)\n'... |
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# 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
... | [
"string.replace"
] | [((865, 897), 'string.replace', 'string.replace', (['line', 'tag', 'value'], {}), '(line, tag, value)\n', (879, 897), False, 'import string\n'), ((1615, 1647), 'string.replace', 'string.replace', (['line', 'tag', 'value'], {}), '(line, tag, value)\n', (1629, 1647), False, 'import string\n')] |
import cv2 # Importe l'api OpenCV
import numpy as np # Importe le module "numpy"
def main():
confidence_ratio = 0.8 #Assigne une valeur de confiance au résultat du detecteur de chaines de caractères prenant donc que les prédictions qui ont plus de 90% de chance d'être juste
image = cv2.imread('input.png') #Ch... | [
"cv2.rectangle",
"cv2.text_TextDetectorCNN.create",
"cv2.drawContours",
"cv2.inRange",
"numpy.zeros",
"cv2.cvtColor",
"cv2.findContours",
"cv2.resize",
"cv2.imread",
"cv2.boundingRect"
] | [((293, 316), 'cv2.imread', 'cv2.imread', (['"""input.png"""'], {}), "('input.png')\n", (303, 316), False, 'import cv2\n'), ((361, 392), 'numpy.zeros', 'np.zeros', (['image.shape', 'np.uint8'], {}), '(image.shape, np.uint8)\n', (369, 392), True, 'import numpy as np\n'), ((562, 633), 'cv2.text_TextDetectorCNN.create', '... |
#
# cpu_mode_tracker.py - a "process tracker" that tracks only the
# processor user/supervisor modes
#
# Copyright (C) 2005 Virtutech AB, All Rights Reserved
#
# This program is a component ("Component") of Virtutech Simics and is
# being distributed under Section 1(a)(iv) of the Virtutech Si... | [
"sim_commands.new_status_command"
] | [((5126, 5181), 'sim_commands.new_status_command', 'sim_commands.new_status_command', (['class_name', 'get_status'], {}), '(class_name, get_status)\n', (5157, 5181), False, 'import sim_commands\n')] |
import requests
from bs4 import BeautifulSoup
def get_res(url):
header = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 \
(KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36'}
res = requests.get(url, headers=header).text
return res
def get_soup(url):
header = {'... | [
"bs4.BeautifulSoup",
"requests.get"
] | [((466, 499), 'requests.get', 'requests.get', (['url'], {'headers': 'header'}), '(url, headers=header)\n', (478, 499), False, 'import requests\n'), ((513, 551), 'bs4.BeautifulSoup', 'BeautifulSoup', (['res.text', '"""html.parser"""'], {}), "(res.text, 'html.parser')\n", (526, 551), False, 'from bs4 import BeautifulSoup... |
from pak.datasets.Dataset import Dataset
import numpy as np
import zipfile
import tarfile
import urllib.request
import shutil
from os import makedirs, listdir
from os.path import join, isfile, isdir, exists, splitext
from scipy.ndimage import imread
from scipy.misc import imresize
from scipy.io import loadmat
from skim... | [
"os.listdir",
"numpy.memmap",
"os.path.join",
"pak.datasets.Dataset.Dataset.__init__",
"scipy.io.loadmat",
"numpy.max",
"os.path.isfile",
"numpy.array",
"pak.utils.talk",
"numpy.min"
] | [((683, 737), 'pak.datasets.Dataset.Dataset.__init__', 'Dataset.__init__', (['self', '"""egohands_data"""', 'root', 'verbose'], {}), "(self, 'egohands_data', root, verbose)\n", (699, 737), False, 'from pak.datasets.Dataset import Dataset\n'), ((845, 872), 'os.path.join', 'join', (['root', '"""egohands_data"""'], {}), "... |
#
# Copyright (c) nexB Inc. and others. All rights reserved.
# ScanCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/scancode-toolkit for support or download.
# See https://aboutcode.org for more in... | [
"packagedcode.conda.CondaPackage.get_package_root",
"packagedcode.conda.parse",
"os.path.dirname",
"commoncode.resource.Codebase",
"packagedcode.conda.get_variables",
"packagedcode.conda.get_yaml_data"
] | [((554, 579), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (569, 579), False, 'import os\n'), ((705, 735), 'packagedcode.conda.get_variables', 'conda.get_variables', (['test_file'], {}), '(test_file)\n', (724, 735), False, 'from packagedcode import conda\n'), ((986, 1016), 'packagedcode.con... |
# imports
import time
from pathlib import Path
from typing import Tuple, Union
import numpy as np
import torch
from shapely.geometry.point import Point
from skimage.draw import circle_perimeter_aa
from torch import nn, Tensor # using torch.Tensor is annoying
from torch.utils.data import Dataset, DataLoader
from CNN ... | [
"numpy.mean",
"skimage.draw.circle_perimeter_aa",
"numpy.random.rand",
"pathlib.Path",
"CNN.CNN",
"torch.from_numpy",
"numpy.array",
"numpy.zeros",
"numpy.random.randint",
"torch.is_tensor",
"torch.nn.MSELoss",
"torch.sum",
"torch.utils.data.DataLoader",
"time.time",
"shapely.geometry.po... | [((3378, 3445), 'torch.utils.data.DataLoader', 'DataLoader', (['train_dataset'], {'batch_size': 'args.batch_size', 'shuffle': '(True)'}), '(train_dataset, batch_size=args.batch_size, shuffle=True)\n', (3388, 3445), False, 'from torch.utils.data import Dataset, DataLoader\n'), ((3504, 3570), 'torch.utils.data.DataLoader... |
import numpy as np
class Maze(object):
def __init__(self, filename):
'''
Maze objects have two main attributes:
- dim: mazes should be square, with sides of even length. (integer)
- walls: passages are coded as a 4-bit number, with a bit value taking
0 if there is a wall... | [
"numpy.array"
] | [((1283, 1298), 'numpy.array', 'np.array', (['walls'], {}), '(walls)\n', (1291, 1298), True, 'import numpy as np\n')] |
from utilities.logging import Logging
from music.song import Song
class Playlist:
"Music Playlist class"
def __init__(self, utilities, ytmusic, dbh, info=None):
self.u = utilities # Utilities Object
self.ytm = ytmusic # youtube Music API object
self.dbh = dbh # database handle
... | [
"music.song.Song"
] | [((1484, 1516), 'music.song.Song', 'Song', (['self.u', 'self.ytm', 'self.dbh'], {}), '(self.u, self.ytm, self.dbh)\n', (1488, 1516), False, 'from music.song import Song\n')] |
# -*- coding: utf-8 -*-
# from trash import *
# вот так можно добавлять template helpers
# INSTALLED_APPS.append('your_helpers')
# для выкладки стенда на какой-то сервер необходимо сделать там файл host_settings.py согласно hosts.py
"""
Django settings for testadmin project.
For more information on this file, see
... | [
"os.path.dirname",
"os.path.join"
] | [((594, 619), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (609, 619), False, 'import os\n'), ((3848, 3880), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""static"""'], {}), "(BASE_DIR, 'static')\n", (3860, 3880), False, 'import os\n'), ((3471, 3507), 'os.path.join', 'os.path.join', (['B... |
#!/usr/bin/env python3
from helpers import fonts
from sys import argv, stderr
# Check arguments.
if len(argv) < 2:
stderr.write("Usage: ./rename-fonts.py [font_path]...")
exit(1)
fonts.run_in_parallel(fonts.get_font_files(argv[1:]), fonts.rename_font) # Rename fonts. | [
"sys.stderr.write",
"helpers.fonts.get_font_files"
] | [((116, 171), 'sys.stderr.write', 'stderr.write', (['"""Usage: ./rename-fonts.py [font_path]..."""'], {}), "('Usage: ./rename-fonts.py [font_path]...')\n", (128, 171), False, 'from sys import argv, stderr\n'), ((203, 233), 'helpers.fonts.get_font_files', 'fonts.get_font_files', (['argv[1:]'], {}), '(argv[1:])\n', (223,... |
"""Test case for autocomplete implementations."""
import os
import uuid
from django import VERSION
from django.contrib.contenttypes.models import ContentType
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
try:
from django.urls import reverse
except ImportError:
from django.core.urlres... | [
"uuid.uuid1",
"django.contrib.contenttypes.models.ContentType.objects.get_for_model",
"os.environ.get",
"django.core.urlresolvers.reverse"
] | [((2310, 2423), 'django.core.urlresolvers.reverse', 'reverse', (["('admin:%s_%s_%s' % (self.model._meta.app_label, self.model._meta.\n model_name, action))"], {'kwargs': 'kwargs'}), "('admin:%s_%s_%s' % (self.model._meta.app_label, self.model._meta.\n model_name, action), kwargs=kwargs)\n", (2317, 2423), False, '... |
# Generated by Django 3.2.9 on 2022-01-09 16:47
import cloudinary.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
(... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.models.BigAutoField",
"django.db.models.DateTimeField",
"django.db.migrations.swappable_dependency",
"django.db.models.CharField"
] | [((252, 309), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (283, 309), False, 'from django.db import migrations, models\n'), ((2318, 2456), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', ... |
from itty import *
from tropo import Tropo, Result, MachineDetection
@post('/index.json')
def index(request):
t = Tropo()
mc = MachineDetection(introduction="This is a test. Please hold while I determine if you are a Machine or Human. Processing. Finished. THank you for your patience.", voice="Victor").json
t.... | [
"tropo.Result",
"tropo.Tropo",
"tropo.MachineDetection"
] | [((118, 125), 'tropo.Tropo', 'Tropo', ([], {}), '()\n', (123, 125), False, 'from tropo import Tropo, Result, MachineDetection\n'), ((493, 513), 'tropo.Result', 'Result', (['request.body'], {}), '(request.body)\n', (499, 513), False, 'from tropo import Tropo, Result, MachineDetection\n'), ((520, 527), 'tropo.Tropo', 'Tr... |
from django import forms
from django.contrib.auth import get_user_model
class SignupForm(forms.Form):
CHOICES = (
("VD", ("Vendedor")),
("CP", ("Comprador"))
)
type = forms.ChoiceField(choices=CHOICES, label="Tipo")
def signup(self, request, user):
user.type = se... | [
"django.forms.ChoiceField"
] | [((206, 254), 'django.forms.ChoiceField', 'forms.ChoiceField', ([], {'choices': 'CHOICES', 'label': '"""Tipo"""'}), "(choices=CHOICES, label='Tipo')\n", (223, 254), False, 'from django import forms\n')] |
import typing # noqa: F401
import datetime as _datetime # noqa: F401
from kubernetes import client # noqa: F401
from kuber import kube_api as _kube_api # noqa: F401
from kuber import definitions as _kuber_definitions # noqa: F401
from kuber import _types # noqa: F401
from kuber.v1_18.meta_v1 import ListMeta # ... | [
"kubernetes.client.V1DeleteOptions",
"kuber.kube_api.to_kuber_dict",
"kuber.kube_api.execute",
"kubernetes.client.ApiregistrationV1Api",
"kuber.v1_18.meta_v1.ListMeta",
"kuber.v1_18.meta_v1.ObjectMeta",
"typing.cast"
] | [((5978, 6120), 'kuber.kube_api.execute', '_kube_api.execute', ([], {'action': '"""read"""', 'resource': 'self', 'names': 'names', 'namespace': 'namespace', 'api_client': 'None', 'api_args': "{'name': self.metadata.name}"}), "(action='read', resource=self, names=names, namespace=\n namespace, api_client=None, api_ar... |
import json
import random
from datetime import datetime, timedelta
from flask import current_app
from notifications_utils.s3 import s3upload
from requests import HTTPError, request
from app import notify_celery
from app.aws.s3 import file_exists
from app.celery.process_ses_receipts_tasks import process_ses_results
fr... | [
"app.celery.process_ses_receipts_tasks.process_ses_results.apply_async",
"datetime.datetime.utcnow",
"notifications_utils.s3.s3upload",
"json.dumps",
"requests.request",
"datetime.timedelta",
"app.notify_celery.task",
"flask.current_app.logger.info",
"random.random",
"app.aws.s3.file_exists"
] | [((3492, 3606), 'app.notify_celery.task', 'notify_celery.task', ([], {'bind': '(True)', 'name': '"""create-fake-letter-response-file"""', 'max_retries': '(5)', 'default_retry_delay': '(300)'}), "(bind=True, name='create-fake-letter-response-file',\n max_retries=5, default_retry_delay=300)\n", (3510, 3606), False, 'f... |
# models.py
from app import db
class Passenger(db.Model):
__tablename__ = "passengers"
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(30), nullable=False)
dob = db.Column(db.Date, nullable=False)
email = db.Column(db.String(30), unique=True, nullable=False)
address = ... | [
"app.db.String",
"app.db.Column",
"app.db.ForeignKey",
"app.db.relationship"
] | [((103, 142), 'app.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (112, 142), False, 'from app import db\n'), ((205, 239), 'app.db.Column', 'db.Column', (['db.Date'], {'nullable': '(False)'}), '(db.Date, nullable=False)\n', (214, 239), False, 'from app import d... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
"numpy.random.randint",
"numpy.random.uniform",
"unittest.main",
"numpy.maximum",
"paddle.fluid.core.CPUPlace"
] | [((2104, 2119), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2117, 2119), False, 'import unittest\n'), ((1531, 1581), 'numpy.random.randint', 'np.random.randint', (['(0)', '(2)', '(batch_size, num_classes)'], {}), '(0, 2, (batch_size, num_classes))\n', (1548, 1581), True, 'import numpy as np\n'), ((1792, 1807),... |
#!/usr/bin/python
# Copyright 2021 Northern.tech AS
#
# 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... | [
"cli.Cli"
] | [((861, 895), 'cli.Cli', 'cli.Cli', (['"""/usr/bin/docker-compose"""'], {}), "('/usr/bin/docker-compose')\n", (868, 895), False, 'import cli\n')] |
# -*- coding: utf-8 -*-
import socket
import logging
from typing import Iterable, Tuple
OptionsType = Iterable[Tuple[int, int, int]]
def bind_socket(
address: str, port: int,
family=socket.AF_INET, type=socket.SOCK_STREAM,
options: OptionsType = (),
reuse_addr: bool = True, reuse_port: bool = False,... | [
"logging.warning",
"logging.info",
"socket.socket"
] | [((380, 407), 'socket.socket', 'socket.socket', (['family', 'type'], {}), '(family, type)\n', (393, 407), False, 'import socket\n'), ((1612, 1685), 'logging.warning', 'logging.warning', (['"""SO_REUSEPORT is not implemented by underlying library."""'], {}), "('SO_REUSEPORT is not implemented by underlying library.')\n"... |
import peewee
import dotenv
import os
dotenv.load_dotenv()
mysql_db = peewee.MySQLDatabase(
"openfoodfact",
user=os.getenv("USER_DB"),
password=os.getenv("PASSWORD_DB"),
host="localhost",
)
class Database(peewee.Model):
class Meta:
database = mysql_db # This model uses the "openfoodfa... | [
"peewee.FixedCharField",
"peewee.CharField",
"os.getenv",
"peewee.ForeignKeyField",
"dotenv.load_dotenv",
"peewee.SmallIntegerField",
"peewee.AutoField"
] | [((40, 60), 'dotenv.load_dotenv', 'dotenv.load_dotenv', ([], {}), '()\n', (58, 60), False, 'import dotenv\n'), ((446, 495), 'peewee.FixedCharField', 'peewee.FixedCharField', (['(1)'], {'unique': '(True)', 'null': '(False)'}), '(1, unique=True, null=False)\n', (467, 495), False, 'import peewee\n'), ((534, 575), 'peewee.... |
import math
from ozobotmapf.utils.constants import Directions
class Point:
"""Class representing a point in 2D space.
Point(0, 0) is located in the top-left corner of the application window.
Attributes:
x (int): X coordinate (vertical axis)
y (int): Y coordinate (horizontal axis)
""... | [
"math.sqrt"
] | [((2493, 2553), 'math.sqrt', 'math.sqrt', (['((self.x - other.x) ** 2 + (self.y - other.y) ** 2)'], {}), '((self.x - other.x) ** 2 + (self.y - other.y) ** 2)\n', (2502, 2553), False, 'import math\n')] |
import logging
from functools import partial
from typing import Any, Dict, List, Optional, Tuple
import qcodes as qc
from typing_extensions import TypedDict
import nanotune as nt
from nanotune.classification.classifier import Classifier
from nanotune.device_tuner.tuningresult import TuningResult
from nanotune.fit.dot... | [
"logging.getLogger",
"nanotune.tuningstages.tuningstage.TuningStage.__init__",
"functools.partial",
"typing_extensions.TypedDict"
] | [((1214, 1330), 'typing_extensions.TypedDict', 'TypedDict', (['"""RangeChangeSettingsDict"""', "{'relative_range_change': float, 'min_change': float, 'max_change': float}"], {}), "('RangeChangeSettingsDict', {'relative_range_change': float,\n 'min_change': float, 'max_change': float})\n", (1223, 1330), False, 'from ... |
from bs4 import BeautifulSoup
def make_map(file_path):
color_map = {}
with open(file_path) as f:
text = f.read()
soup = BeautifulSoup(text, 'html.parser')
# the first table contains the standard colors
table = soup.find('table')
rows = table.find_all('tr')
for row in rows:
... | [
"bs4.BeautifulSoup"
] | [((146, 180), 'bs4.BeautifulSoup', 'BeautifulSoup', (['text', '"""html.parser"""'], {}), "(text, 'html.parser')\n", (159, 180), False, 'from bs4 import BeautifulSoup\n'), ((738, 772), 'bs4.BeautifulSoup', 'BeautifulSoup', (['text', '"""html.parser"""'], {}), "(text, 'html.parser')\n", (751, 772), False, 'from bs4 impor... |
import tempfile
from importlib import reload
import os
import io
import sys
path = os.path.dirname(os.path.abspath(__file__))
sys.path.append('qa327/frontend')
import app
################################################################
# if want to force printing to console:
# pritn(something)
# assert false
#######... | [
"app.main",
"os.close",
"os.path.join",
"os.remove",
"importlib.reload",
"os.path.abspath",
"sys.path.append",
"tempfile.mkstemp"
] | [((128, 161), 'sys.path.append', 'sys.path.append', (['"""qa327/frontend"""'], {}), "('qa327/frontend')\n", (143, 161), False, 'import sys\n'), ((100, 125), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (115, 125), False, 'import os\n'), ((3040, 3051), 'importlib.reload', 'reload', (['app'],... |
# Copyright 2020 The TensorFlow Probability 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 applicable law o... | [
"jax.util.as_hashable_function",
"oryx.core.primitive.tie_in",
"dataclasses.dataclass",
"jax.interpreters.ad.call_transpose",
"jax.core.Primitive",
"jax.tree_util.tree_leaves",
"jax.lax.lax_control_flow._initial_style_jaxpr",
"jax.abstract_arrays.ShapedArray",
"jax.api_util.flatten_fun_nokwargs",
... | [((7009, 7043), 'dataclasses.dataclass', 'dataclasses.dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (7030, 7043), False, 'import dataclasses\n'), ((10278, 10369), 'jax.tree_util.register_pytree_node', 'tree_util.register_pytree_node', (['HarvestList', 'HarvestList.flatten', 'HarvestList.unflatten'], {}), '... |
# -*- coding: utf-8 -*-
# Copyright FMR LLC <<EMAIL>>
# SPDX-License-Identifier: Apache-2.0
"""Handles payloads from markup files"""
import os
import sys
from abc import abstractmethod
from itertools import chain
from pathlib import Path
from spock.backend.handler import BaseHandler
from spock.backend.utils import ... | [
"spock.backend.utils.get_attr_fields",
"spock.backend.utils.deep_update",
"os.path.exists",
"pathlib.Path",
"spock.backend.utils.get_type_fields",
"os.path.dirname",
"os.path.basename",
"spock.backend.utils.convert_to_tuples",
"spock.utils.check_path_s3"
] | [((9793, 9837), 'spock.backend.utils.get_attr_fields', 'get_attr_fields', ([], {'input_classes': 'input_classes'}), '(input_classes=input_classes)\n', (9808, 9837), False, 'from spock.backend.utils import convert_to_tuples, deep_update, get_attr_fields, get_type_fields\n'), ((9894, 9939), 'spock.backend.utils.get_attr_... |
# Generated by Django 2.1.5 on 2019-01-28 23:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dtta', '0006_relatedlink'),
]
operations = [
migrations.AddField(
model_name='relatedlink',
name='order_number',
... | [
"django.db.models.PositiveSmallIntegerField"
] | [((335, 378), 'django.db.models.PositiveSmallIntegerField', 'models.PositiveSmallIntegerField', ([], {'default': '(1)'}), '(default=1)\n', (367, 378), False, 'from django.db import migrations, models\n')] |
###############################################################################
#
# Tests for XlsxWriter.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c), 2013-2021, <NAME>, <EMAIL>
#
import unittest
from io import StringIO
from ..helperfunctions import _xml_to_list
from ...drawing import Drawing
class Tes... | [
"io.StringIO"
] | [((555, 565), 'io.StringIO', 'StringIO', ([], {}), '()\n', (563, 565), False, 'from io import StringIO\n'), ((3482, 3492), 'io.StringIO', 'StringIO', ([], {}), '()\n', (3490, 3492), False, 'from io import StringIO\n')] |
# ------------------------------
# 594. Longest Harmonious Subsequence
#
# Description:
# We define a harmonious array is an array where the difference between its maximum value and its minimum value is exactly 1.
# Now, given an integer array, you need to find the length of its longest harmonious subsequence among al... | [
"collections.Counter"
] | [((783, 796), 'collections.Counter', 'Counter', (['nums'], {}), '(nums)\n', (790, 796), False, 'from collections import Counter\n')] |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | [
"os.path.isfile",
"googlecloudsdk.api_lib.util.apis.GetClientInstance",
"re.match",
"googlecloudsdk.api_lib.util.apis.GetMessagesModule"
] | [((903, 946), 'googlecloudsdk.api_lib.util.apis.GetClientInstance', 'apis.GetClientInstance', (['VISION_API', 'version'], {}), '(VISION_API, version)\n', (925, 946), False, 'from googlecloudsdk.api_lib.util import apis\n'), ((1009, 1052), 'googlecloudsdk.api_lib.util.apis.GetMessagesModule', 'apis.GetMessagesModule', (... |
from setting import *
from machine import Pin
S1_IN_S2_OUT = const(0)
S1_OUT_S2_IN = const(1)
S1_OUT_S2_OUT = const(2)
S1_IN_S2_IN = const(3)
class LineFinder:
def __init__(self):
pass
def _reset_port(self, port):
if port < 0 or port > 5:
print('Port not supported')
self.p... | [
"machine.Pin"
] | [((355, 406), 'machine.Pin', 'Pin', (['PORTS_DIGITAL[port][0]'], {'mode': 'Pin.IN', 'pull': 'None'}), '(PORTS_DIGITAL[port][0], mode=Pin.IN, pull=None)\n', (358, 406), False, 'from machine import Pin\n'), ((432, 483), 'machine.Pin', 'Pin', (['PORTS_DIGITAL[port][1]'], {'mode': 'Pin.IN', 'pull': 'None'}), '(PORTS_DIGITA... |
"""
.. codeauthor:: <NAME> <<EMAIL>>
"""
import ipaddress
import re
import pyparsing as pp
import typepy
from .._const import Tc, TcSubCommand
from .._logger import logger
from .._network import sanitize_network
from ._interface import AbstractParser
from ._model import Filter
class TcFilterParser(AbstractParser):... | [
"pyparsing.SkipTo",
"collections.namedtuple",
"typepy.is_null_string",
"pyparsing.Word",
"pyparsing.Literal"
] | [((680, 705), 'pyparsing.Word', 'pp.Word', (["(pp.hexnums + ':')"], {}), "(pp.hexnums + ':')\n", (687, 705), True, 'import pyparsing as pp\n'), ((822, 843), 'pyparsing.Word', 'pp.Word', (['pp.alphanums'], {}), '(pp.alphanums)\n', (829, 843), True, 'import pyparsing as pp\n'), ((956, 972), 'pyparsing.Word', 'pp.Word', (... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import lo... | [
"logging.getLogger"
] | [((336, 363), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (353, 363), False, 'import logging\n')] |
#!/usr/bin/python
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | [
"casfs.CASFS",
"fs.zipfs.ZipFS",
"fs.copy.copy_fs",
"fs.open_fs",
"io.BytesIO",
"uv.util.json_str",
"fs.path.abspath"
] | [((2743, 2779), 'fs.open_fs', 'pyfs.open_fs', (['cas_input'], {'create': '(True)'}), '(cas_input, create=True)\n', (2755, 2779), True, 'import fs as pyfs\n'), ((2789, 2802), 'casfs.CASFS', 'CASFS', (['cas_fs'], {}), '(cas_fs)\n', (2794, 2802), False, 'from casfs import CASFS\n'), ((1192, 1215), 'fs.path.abspath', 'pyfs... |
"""Philips Hue lights platform tests."""
import asyncio
from collections import deque
import logging
from unittest.mock import Mock
import aiohue
from aiohue.lights import Lights
from aiohue.groups import Groups
import pytest
from homeassistant import config_entries
from homeassistant.components import hue
import hom... | [
"logging.getLogger",
"homeassistant.config_entries.ConfigEntry",
"collections.deque",
"unittest.mock.Mock",
"aiohue.groups.Groups",
"homeassistant.util.color.color_xy_to_hs",
"aiohue.lights.Lights"
] | [((413, 440), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (430, 440), False, 'import logging\n'), ((3893, 3900), 'collections.deque', 'deque', ([], {}), '()\n', (3898, 3900), False, 'from collections import deque\n'), ((3935, 3942), 'collections.deque', 'deque', ([], {}), '()\n', (3940... |
import sys
from typing import Tuple
import numpy as np
import pandas as pd
class DummyTkinterFrame:
...
class DummyTkinter:
Frame = DummyTkinterFrame
sys.modules["Tkinter"] = DummyTkinter # Magellan imports Tkinter, but we don't need it for our use case
import py_entitymatching as em
import py_entityma... | [
"py_entitymatching.set_rtable",
"pandas.Series",
"py_entitymatching.set_fk_rtable",
"py_entitymatching.extract_feature_vecs",
"py_entitymatching.feature.simfunctions.get_sim_funs_for_matching",
"py_entitymatching.RFMatcher",
"py_entitymatching.set_key",
"py_entitymatching.feature.tokenizers.get_tokeni... | [((883, 903), 'py_entitymatching.set_key', 'em.set_key', (['A', '"""rid"""'], {}), "(A, 'rid')\n", (893, 903), True, 'import py_entitymatching as em\n'), ((948, 968), 'py_entitymatching.set_key', 'em.set_key', (['B', '"""rid"""'], {}), "(B, 'rid')\n", (958, 968), True, 'import py_entitymatching as em\n'), ((1092, 1124)... |
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | [
"flask_bcrypt.check_password_hash",
"sqlalchemy.orm.relationship",
"sqlalchemy.orm.backref",
"sqlalchemy.PrimaryKeyConstraint",
"sqlalchemy.ForeignKey",
"sqlalchemy.Integer",
"sqlalchemy.Unicode",
"sqlalchemy.types.Boolean",
"sqlalchemy.UnicodeText",
"flask_bcrypt.generate_password_hash"
] | [((1535, 1578), 'sqlalchemy.PrimaryKeyConstraint', 'PrimaryKeyConstraint', (['"""user_id"""', '"""group_id"""'], {}), "('user_id', 'group_id')\n", (1555, 1578), False, 'from sqlalchemy import PrimaryKeyConstraint\n'), ((1864, 1921), 'sqlalchemy.orm.relationship', 'relationship', (['u"""Sketch"""'], {'backref': 'u"""use... |
#!/usr/bin/env python3
""" Robot Module
This module initializes the robot class
Author: <NAME>
"""
import numpy as np
class Robot:
def __init__(self, x_dim, y_dim):
self._x_dim = x_dim
self._y_dim = y_dim
self._tunnel_grid = np.zeros((self._x_dim, self._y_dim))
self._explored_map = np.zeros_like(self._t... | [
"numpy.zeros",
"numpy.zeros_like"
] | [((239, 275), 'numpy.zeros', 'np.zeros', (['(self._x_dim, self._y_dim)'], {}), '((self._x_dim, self._y_dim))\n', (247, 275), True, 'import numpy as np\n'), ((299, 331), 'numpy.zeros_like', 'np.zeros_like', (['self._tunnel_grid'], {}), '(self._tunnel_grid)\n', (312, 331), True, 'import numpy as np\n'), ((441, 473), 'num... |
import asyncio
from contextlib import asynccontextmanager
from datetime import datetime, timedelta
from http.cookies import SimpleCookie
from json import dumps
from typing import Any, AnyStr, AsyncGenerator, List, Optional, Tuple, TYPE_CHECKING, Union
from urllib.parse import unquote, urlencode
from .datastructures im... | [
"datetime.datetime.utcnow",
"asyncio.Queue",
"json.dumps",
"http.cookies.SimpleCookie",
"asyncio.sleep",
"urllib.parse.urlencode",
"urllib.parse.unquote"
] | [((852, 867), 'asyncio.Queue', 'asyncio.Queue', ([], {}), '()\n', (865, 867), False, 'import asyncio\n'), ((2992, 3027), 'urllib.parse.urlencode', 'urlencode', (['query_string'], {'doseq': '(True)'}), '(query_string, doseq=True)\n', (3001, 3027), False, 'from urllib.parse import unquote, urlencode\n'), ((3106, 3119), '... |
import torch
import numpy as np
import carb
from pxr import UsdGeom, Gf, Sdf, Usd, PhysxSchema, PhysicsSchema, PhysicsSchemaTools, Semantics
import os
import time
import atexit
import asyncio
import numpy as np
import random
import matplotlib.pyplot as plt
import collections
from omni.isaac.synthetic_utils import v... | [
"numpy.flip",
"omni.isaac.synthetic_utils.SyntheticDataHelper",
"random.choice",
"collections.deque",
"random.uniform",
"road_environment.Environment",
"random.randrange",
"gym.spaces.Box",
"numpy.exp",
"numpy.array",
"numpy.dot",
"jetbot.Jetbot",
"numpy.random.randn",
"pxr.Gf.Vec3d"
] | [((825, 882), 'gym.spaces.Box', 'spaces.Box', ([], {'low': '(0)', 'high': '(2.0)', 'shape': '(2,)', 'dtype': 'np.float32'}), '(low=0, high=2.0, shape=(2,), dtype=np.float32)\n', (835, 882), False, 'from gym import spaces\n'), ((1047, 1111), 'gym.spaces.Box', 'spaces.Box', ([], {'low': '(0)', 'high': '(255)', 'shape': '... |
# Copyright (c) 2019-2020 <NAME>
# Copyright (c) 2014-2020 <NAME>
# 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, m... | [
"pymedphys._imports.numpy.percentile",
"pymedphys._imports.numpy.sum",
"pymedphys._imports.numpy.average",
"pymedphys._imports.numpy.logical_and",
"pymedphys._imports.numpy.argsort",
"pymedphys._imports.skimage.measure.regionprops",
"pymedphys._imports.scipy.ndimage.measurements.center_of_mass",
"pyme... | [((15211, 15232), 'functools.lru_cache', 'functools.lru_cache', ([], {}), '()\n', (15230, 15232), False, 'import functools\n'), ((3493, 3566), 'pymedphys._experimental.vendor.pylinac_vendored._pylinac_installed.pylinac.image.ArrayImage', '_pylinac_installed.image.ArrayImage', (['array'], {'dpi': 'dpi', 'sid': 'sid', 'd... |
from django.contrib import admin
from .models import NamaLayanan, DonorForm
admin.site.register(DonorForm)
# Register your models here.
| [
"django.contrib.admin.site.register"
] | [((78, 108), 'django.contrib.admin.site.register', 'admin.site.register', (['DonorForm'], {}), '(DonorForm)\n', (97, 108), False, 'from django.contrib import admin\n')] |
import sys, os, imp, math, shutil
import py
from cffi import FFI, FFIError
from cffi.verifier import Verifier, _locate_engine_class, _get_so_suffixes
from cffi.ffiplatform import maybe_relative_path
from testing.udir import udir
class DistUtilsTest(object):
def setup_class(self):
self.lib_m = "m... | [
"testing.udir.udir.ensure",
"cffi.verifier.Verifier",
"os.path.exists",
"testing.udir.udir.remove",
"os.waitpid",
"cffi.ffiplatform.maybe_relative_path",
"cffi.FFI",
"os.path.join",
"cffi.verifier._get_so_suffixes",
"os.WEXITSTATUS",
"testing.udir.udir.isdir",
"os._exit",
"os.WIFEXITED",
"... | [((627, 639), 'testing.udir.udir.isdir', 'udir.isdir', ([], {}), '()\n', (637, 639), False, 'from testing.udir import udir\n'), ((695, 713), 'testing.udir.udir.ensure', 'udir.ensure', ([], {'dir': '(1)'}), '(dir=1)\n', (706, 713), False, 'from testing.udir import udir\n'), ((1348, 1353), 'cffi.FFI', 'FFI', ([], {}), '(... |
from typing import Callable, Optional
import cProfile
def doProfiling(methodToCall: Callable, firstArgumentForMethod: Optional, secondArgumentForMethod: Optional) -> None:
pr = cProfile.Profile()
pr.enable()
pr.runcall(methodToCall, firstArgumentForMethod, secondArgumentForMethod)
pr.disable()
pr.... | [
"cProfile.Profile"
] | [((183, 201), 'cProfile.Profile', 'cProfile.Profile', ([], {}), '()\n', (199, 201), False, 'import cProfile\n')] |
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4 fileencoding=utf-8
from django.core.management.base import BaseCommand
from django.utils.translation import ugettext_lazy
from onadata.apps.logger.models.xform import XForm
from onadata.libs.utils.model_tools import queryset_iterator
class Command(BaseCommand):
... | [
"django.utils.translation.ugettext_lazy",
"onadata.apps.logger.models.xform.XForm.objects.all"
] | [((328, 379), 'django.utils.translation.ugettext_lazy', 'ugettext_lazy', (['"""Import a folder of XForms for ODK."""'], {}), "('Import a folder of XForms for ODK.')\n", (341, 379), False, 'from django.utils.translation import ugettext_lazy\n'), ((437, 456), 'onadata.apps.logger.models.xform.XForm.objects.all', 'XForm.o... |
"""
This module contains a set of basic application errors.
Any custom extensions of the exceptions should be a subclass of any of these
classes.
"""
from marshmallow import Schema, fields
class ApplicationException(Exception):
"""Base exception for the application."""
class ErrorSchema(Schema):
"""... | [
"marshmallow.fields.Url",
"marshmallow.fields.Integer",
"marshmallow.fields.String"
] | [((457, 473), 'marshmallow.fields.Integer', 'fields.Integer', ([], {}), '()\n', (471, 473), False, 'from marshmallow import Schema, fields\n'), ((490, 505), 'marshmallow.fields.String', 'fields.String', ([], {}), '()\n', (503, 505), False, 'from marshmallow import Schema, fields\n'), ((521, 550), 'marshmallow.fields.Ur... |