code stringlengths 20 1.04M | apis list | extract_api stringlengths 75 9.94M |
|---|---|---|
# -*- coding: utf-8 -*-
# Copyright 2020 <NAME> (@dathudeptrai)
#
# 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... | [
"yaml.load",
"numpy.sum",
"argparse.ArgumentParser",
"tensorflow_tts.configs.Tacotron2Config",
"numpy.shape",
"matplotlib.pyplot.figure",
"os.path.join",
"matplotlib.pyplot.tight_layout",
"sys.path.append",
"examples.tacotron2.tacotron_dataset.CharactorMelDataset",
"logging.warning",
"matplotl... | [((757, 777), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (772, 777), False, 'import sys\n'), ((1057, 1075), 'numba.jit', 'jit', ([], {'nopython': '(True)'}), '(nopython=True)\n', (1060, 1075), False, 'from numba import jit\n'), ((1426, 1602), 'argparse.ArgumentParser', 'argparse.ArgumentParser'... |
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import math
class BS_curve(object):
def __init__(self, n, p, cp=None, knots=None):
self.n = n # n+1 control points >>> p0,p1,,,pn
self.p = p
if type(cp) is np.ndarray:
self.cp = cp
... | [
"numpy.sum",
"numpy.zeros",
"numpy.ones",
"numpy.nonzero",
"numpy.array",
"numpy.linspace",
"numpy.dot",
"numpy.linalg.solve"
] | [((1250, 1288), 'numpy.zeros', 'np.zeros', (['(self.m + 1)'], {'dtype': 'np.float64'}), '(self.m + 1, dtype=np.float64)\n', (1258, 1288), True, 'import numpy as np\n'), ((1776, 1803), 'numpy.sum', 'np.sum', (['(self.u == self.u[k])'], {}), '(self.u == self.u[k])\n', (1782, 1803), True, 'import numpy as np\n'), ((4738, ... |
import asynctest
import aiohttp
from beacon_api.utils.db_load import parse_arguments, init_beacon_db, main
from beacon_api.conf.config import init_db_pool
from beacon_api.api.query import access_resolution
from beacon_api.utils.validate_jwt import token_scheme_check, verify_aud_claim
from beacon_api.permissions.ga4gh i... | [
"beacon_api.utils.db_load.main",
"beacon_api.api.query.access_resolution",
"beacon_api.permissions.ga4gh.get_ga4gh_controlled",
"beacon_api.permissions.ga4gh.validate_passport",
"beacon_api.permissions.ga4gh.get_ga4gh_bona_fide",
"beacon_api.utils.validate_jwt.token_scheme_check",
"beacon_api.permission... | [((2607, 2661), 'asynctest.mock.patch', 'asynctest.mock.patch', (['"""beacon_api.conf.config.asyncpg"""'], {}), "('beacon_api.conf.config.asyncpg')\n", (2627, 2661), False, 'import asynctest\n'), ((2971, 3023), 'asynctest.mock.patch', 'asynctest.mock.patch', (['"""beacon_api.utils.db_load.LOG"""'], {}), "('beacon_api.u... |
# Generated by Django 2.0.4 on 2018-05-19 06:43
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0002_auto_20180519_0242'),
]
operations = [
migrations.AddField(
model_name='customuse... | [
"django.db.models.ForeignKey"
] | [((370, 505), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'blank': '(True)', 'null': '(True)', 'on_delete': 'django.db.models.deletion.SET_NULL', 'to': '"""users.Section"""', 'verbose_name': '"""Seccion"""'}), "(blank=True, null=True, on_delete=django.db.models.\n deletion.SET_NULL, to='users.Section',... |
import os
import tweepy
from dotenv import load_dotenv
from tweepy import OAuthHandler
# from app.src.common.utils import read_yaml
# from app.src.common.logger import logger
# Set the application variables
APP_NAME: str = os.environ.get("APP_NAME", "Test")
# if you want to test gunicorn the below environment varia... | [
"os.path.abspath",
"tweepy.API",
"os.environ.get",
"dotenv.load_dotenv",
"tweepy.OAuthHandler",
"os.path.join",
"os.getenv"
] | [((227, 261), 'os.environ.get', 'os.environ.get', (['"""APP_NAME"""', '"""Test"""'], {}), "('APP_NAME', 'Test')\n", (241, 261), False, 'import os\n'), ((357, 393), 'os.environ.get', 'os.environ.get', (['"""DEBUG_MODE"""', '"""True"""'], {}), "('DEBUG_MODE', 'True')\n", (371, 393), False, 'import os\n'), ((411, 447), 'o... |
#!/usr/bin/env python
"""
"""
import sys
import os
def main(*directories):
directory_set = set(directories)
base_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'test')
print("Searching in %s"%(base_dir))
for (dirpath, dirnames, filenames) in os.walk(base_dir):
for filenam... | [
"os.path.realpath",
"os.walk",
"os.path.split",
"os.path.join",
"sys.exit"
] | [((282, 299), 'os.walk', 'os.walk', (['base_dir'], {}), '(base_dir)\n', (289, 299), False, 'import os\n'), ((706, 717), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (714, 717), False, 'import sys\n'), ((841, 852), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (849, 852), False, 'import sys\n'), ((157, 183), 'os.pa... |
import pytest
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AnonymousUser
from guardian.shortcuts import assign_perm
from rest_framework.test import APIRequestFactory
from demanage.invitations.api_permissions import InvitationPermission
from demanage.members.models import Member... | [
"django.contrib.auth.models.AnonymousUser",
"django.contrib.auth.get_user_model",
"guardian.shortcuts.assign_perm",
"demanage.invitations.api_permissions.InvitationPermission"
] | [((437, 459), 'demanage.invitations.api_permissions.InvitationPermission', 'InvitationPermission', ([], {}), '()\n', (457, 459), False, 'from demanage.invitations.api_permissions import InvitationPermission\n'), ((468, 484), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (482, 484), False, 'f... |
from torchstat import stat
import torch
from vision.yolof.mobiledet_yolof import create_mobiledet_yolof, create_efficientnet_yolof, create_mobilenetv2_yolof_lite,create_mobilenetv3_large_yolof_lite,create_mobilenetv3_small_yolof_lite,create_mobilenetv1_yolof,create_mobiledet_yolof_predictor
num_classes = 4
net = cre... | [
"vision.yolof.mobiledet_yolof.create_efficientnet_yolof",
"torchstat.stat",
"torch.randn"
] | [((317, 355), 'vision.yolof.mobiledet_yolof.create_efficientnet_yolof', 'create_efficientnet_yolof', (['num_classes'], {}), '(num_classes)\n', (342, 355), False, 'from vision.yolof.mobiledet_yolof import create_mobiledet_yolof, create_efficientnet_yolof, create_mobilenetv2_yolof_lite, create_mobilenetv3_large_yolof_lit... |
import math
#Ex.20
x = int(input())
y = int(input())
if x > y:
maior = x
menor = y
else:
maior = y
menor = x
menor = pow(menor, 2)
try:
maior = math.sqrt(maior)
except:
maior = str('Não foi possível calcular a raiz do maior número.')
print(f'{menor}\n{maior}')
| [
"math.sqrt"
] | [((164, 180), 'math.sqrt', 'math.sqrt', (['maior'], {}), '(maior)\n', (173, 180), False, 'import math\n')] |
from abc import abstractmethod
from .utils import *
import matplotlib.pyplot as plt
import numpy as np
import pdb
import torch
import torch.nn.functional as F
import ast
def add_config_args(parser):
parser.add_argument(
'-weight-strgy', type=str, default='default',
choices=['default', 'meta']
)
parse... | [
"torch.zeros_like",
"torch.cat",
"matplotlib.pyplot.subplots",
"torch.nn.functional.softmax",
"numpy.min",
"numpy.max",
"numpy.array",
"torch.no_grad",
"matplotlib.pyplot.tight_layout",
"torch.tensor"
] | [((1917, 1947), 'numpy.array', 'np.array', (['self.class_norm_logs'], {}), '(self.class_norm_logs)\n', (1925, 1947), True, 'import numpy as np\n'), ((1959, 1985), 'numpy.array', 'np.array', (['self.result_logs'], {}), '(self.result_logs)\n', (1967, 1985), True, 'import numpy as np\n'), ((2114, 2149), 'matplotlib.pyplot... |
# Copyright (c) Facebook, Inc. and its affiliates.
from pythia.datasets.vqa.m4c_textvqa.dataset import M4CTextVQADataset
from pythia.utils.objects_to_byte_tensor import enc_obj2bytes
class M4CTextCapsDataset(M4CTextVQADataset):
def __init__(self, dataset_type, imdb_file_index, config, *args, **kwargs):
su... | [
"pythia.utils.objects_to_byte_tensor.enc_obj2bytes"
] | [((1627, 1668), 'pythia.utils.objects_to_byte_tensor.enc_obj2bytes', 'enc_obj2bytes', (["sample_info['caption_str']"], {}), "(sample_info['caption_str'])\n", (1640, 1668), False, 'from pythia.utils.objects_to_byte_tensor import enc_obj2bytes\n'), ((1699, 1743), 'pythia.utils.objects_to_byte_tensor.enc_obj2bytes', 'enc_... |
import asyncio
import os
import time
import pytest
from mitmproxy.test import tflow
from mitmproxy.test import taddons
class TestConcurrent:
@pytest.mark.asyncio
@pytest.mark.parametrize("addon", ["concurrent_decorator.py", "concurrent_decorator_class.py"])
async def test_concurrent(self, addon, tdata):... | [
"mitmproxy.test.tflow.tflow",
"time.time",
"os.environ.get",
"mitmproxy.test.taddons.context",
"pytest.mark.parametrize"
] | [((175, 273), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""addon"""', "['concurrent_decorator.py', 'concurrent_decorator_class.py']"], {}), "('addon', ['concurrent_decorator.py',\n 'concurrent_decorator_class.py'])\n", (198, 273), False, 'import pytest\n'), ((334, 351), 'mitmproxy.test.taddons.context... |
# Generated by Django 2.2.9 on 2020-05-04 06:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("db_data", "0015_auto_20191017_1438")]
operations = [
migrations.AlterField(
model_name="semester",
name="id",
field=m... | [
"django.db.models.CharField"
] | [((319, 447), 'django.db.models.CharField', 'models.CharField', ([], {'help_text': '"""Used for URLs, should match /(fa|sp)[0-9]{2}/"""', 'max_length': '(8)', 'primary_key': '(True)', 'serialize': '(False)'}), "(help_text='Used for URLs, should match /(fa|sp)[0-9]{2}/',\n max_length=8, primary_key=True, serialize=Fa... |
import bisect
import collections
import itertools
import os
import random
import re
import threading
import time
import traceback
import typing
import urllib.parse
from hydrus.core import HydrusConstants as HC
from hydrus.core import HydrusData
from hydrus.core import HydrusExceptions
from hydrus.core import HydrusFil... | [
"bisect.insort",
"hydrus.client.importing.ClientImportFiles.CheckFileImportStatus",
"hydrus.client.networking.ClientNetworkingDomain.ConvertHTTPToHTTPS",
"hydrus.core.HydrusGlobals.client_controller.network_engine.domain_manager.GetDefaultTagImportOptionsForURL",
"hydrus.core.HydrusGlobals.client_controller... | [((1677, 1727), 'hydrus.core.HydrusSerialisable.SerialisableBase.__init__', 'HydrusSerialisable.SerialisableBase.__init__', (['self'], {}), '(self)\n', (1721, 1727), False, 'from hydrus.core import HydrusSerialisable\n'), ((1861, 1880), 'hydrus.core.HydrusData.GetNow', 'HydrusData.GetNow', ([], {}), '()\n', (1878, 1880... |
# Import models
from mmic_docking.models import DockInput
from mmelemental.models import Molecule
from mmic_autodock_vina.models import AutoDockComputeInput
# Import components
from mmic.components.blueprints import GenericComponent
from mmic_cmd.components import CmdComponent
from mmelemental.util.units import conve... | [
"mmelemental.util.files.random_file",
"mmic_cmd.components.CmdComponent.compute",
"os.remove",
"mmelemental.util.units.convert",
"os.path.abspath",
"os.environ.copy",
"mmic_autodock_vina.models.AutoDockComputeInput"
] | [((2044, 2061), 'os.environ.copy', 'os.environ.copy', ([], {}), '()\n', (2059, 2061), False, 'import os\n'), ((2288, 2314), 'mmelemental.util.files.random_file', 'random_file', ([], {'suffix': '""".pdb"""'}), "(suffix='.pdb')\n", (2299, 2314), False, 'from mmelemental.util.files import random_file\n'), ((2439, 2467), '... |
"""
"""
from yoyo import step
__depends__ = {'20210712_01_pT4eP'}
steps = [
step(
"DROP TABLE answer",
"CREATE TABLE answer ( id SERIAL, url VARCHAR(255), answer TEXT )",
)
]
| [
"yoyo.step"
] | [((84, 181), 'yoyo.step', 'step', (['"""DROP TABLE answer"""', '"""CREATE TABLE answer ( id SERIAL, url VARCHAR(255), answer TEXT )"""'], {}), "('DROP TABLE answer',\n 'CREATE TABLE answer ( id SERIAL, url VARCHAR(255), answer TEXT )')\n", (88, 181), False, 'from yoyo import step\n')] |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import os
import compas
try:
import rhinoscriptsyntax as rs
except ImportError:
compas.raise_if_ironpython()
__all__ = [
'get_document_name',
'get_document_filename',
'get_document_path... | [
"rhinoscriptsyntax.DocumentPath",
"rhinoscriptsyntax.DocumentName",
"compas.raise_if_ironpython"
] | [((390, 407), 'rhinoscriptsyntax.DocumentName', 'rs.DocumentName', ([], {}), '()\n', (405, 407), True, 'import rhinoscriptsyntax as rs\n'), ((529, 546), 'rhinoscriptsyntax.DocumentPath', 'rs.DocumentPath', ([], {}), '()\n', (544, 546), True, 'import rhinoscriptsyntax as rs\n'), ((201, 229), 'compas.raise_if_ironpython'... |
import os
import email
import mimetypes
import smtpd
from logging import debug
from datetime import datetime
from email import message_from_string
from email.Header import decode_header, make_header
from email.Utils import decode_rfc2231
from maillog.models import RealAddress, LoggedMail, Attatchment
from django.conf... | [
"logging.debug",
"os.path.join",
"maillog.models.RealAddress.objects.filter",
"smtpd.PureProxy.process_message",
"maillog.models.LoggedMail",
"email.message_from_string"
] | [((351, 394), 'os.path.join', 'os.path.join', (['settings.MEDIA_ROOT', '"""attach"""'], {}), "(settings.MEDIA_ROOT, 'attach')\n", (363, 394), False, 'import os\n'), ((1159, 1184), 'email.message_from_string', 'message_from_string', (['data'], {}), '(data)\n', (1178, 1184), False, 'from email import message_from_string\... |
"""encoder.py
<NAME>, 2018
Encoder module for featurizing and fine-tuning language models on new data.
Utilizes pre-trained modules available on tensorflow_hub and Keras for defining model graph and computing forward-pass or fine-tuning.
Notes:
- fine-tuning on GPU doesn't work for USE, see [https://github.com/tens... | [
"sklearn.preprocessing.LabelBinarizer",
"pathlib.Path.home",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"tensorflow_hub.Module",
"load_data.load_attack_encoded",
"tensorflow.tables_initializer",
"keras.layers.Input",
"pandas.DataFrame",
"load_data.tokenize",
"tensorflow.cast"... | [((4079, 4095), 'load_data.load_imdb_data', 'load_imdb_data', ([], {}), '()\n', (4093, 4095), False, 'from load_data import load_imdb_data\n'), ((4691, 4724), 'keras.utils.to_categorical', 'to_categorical', (['imdb_df.sentiment'], {}), '(imdb_df.sentiment)\n', (4705, 4724), False, 'from keras.utils import to_categorica... |
from ewmh import EWMH
from Xlib import X
ewmh = EWMH()
_NET_WM_STATE_MAXIMIZED_VERT = ewmh.display.get_atom('_NET_WM_STATE_MAXIMIZED_VERT')
_NET_WM_STATE_MAXIMIZED_HORZ = ewmh.display.get_atom('_NET_WM_STATE_MAXIMIZED_HORZ')
_NET_WM_STATE_FULLSCREEN = ewmh.display.get_atom('_NET_WM_STATE_FULLSCREEN')
def raise_wind... | [
"ewmh.EWMH"
] | [((49, 55), 'ewmh.EWMH', 'EWMH', ([], {}), '()\n', (53, 55), False, 'from ewmh import EWMH\n')] |
from keras.datasets import cifar10
import autokeras as ak
from tensorflow.keras.models import model_from_json
from sklearn.metrics import classification_report
import os
def build_model():
input_layer = ak.Input()
cnn_layer = ak.ConvBlock()(input_layer)
cnn_layer2 = ak.ConvBlock()(cnn_layer)
dense_laye... | [
"autokeras.Input",
"keras.datasets.cifar10.load_data",
"os.path.dirname",
"sklearn.metrics.classification_report",
"autokeras.ConvBlock",
"autokeras.auto_model.AutoModel",
"autokeras.ClassificationHead",
"autokeras.DenseBlock"
] | [((208, 218), 'autokeras.Input', 'ak.Input', ([], {}), '()\n', (216, 218), True, 'import autokeras as ak\n'), ((488, 590), 'autokeras.auto_model.AutoModel', 'ak.auto_model.AutoModel', (['input_layer', 'output_layer'], {'max_trials': '(20)', 'seed': '(123)', 'project_name': '"""autoML"""'}), "(input_layer, output_layer,... |
from rlberry.envs.benchmarks.generalization.twinrooms import TwinRooms
from rlberry.agents.mbqvi import MBQVIAgent
from rlberry.wrappers.discretize_state import DiscretizeStateWrapper
env = TwinRooms()
env = DiscretizeStateWrapper(env, n_bins=20)
horizon = 20
agent = MBQVIAgent(env, n_samples=10, gamma=1.0, horizon=h... | [
"rlberry.agents.mbqvi.MBQVIAgent",
"rlberry.wrappers.discretize_state.DiscretizeStateWrapper",
"rlberry.envs.benchmarks.generalization.twinrooms.TwinRooms"
] | [((192, 203), 'rlberry.envs.benchmarks.generalization.twinrooms.TwinRooms', 'TwinRooms', ([], {}), '()\n', (201, 203), False, 'from rlberry.envs.benchmarks.generalization.twinrooms import TwinRooms\n'), ((210, 248), 'rlberry.wrappers.discretize_state.DiscretizeStateWrapper', 'DiscretizeStateWrapper', (['env'], {'n_bins... |
from django.core.management.base import BaseCommand
from paying_for_college.disclosures.scripts.notifications import (
send_stale_notifications
)
COMMAND_HELP = "Send_stale_notifications gathers up stale notifications -- "
"those that are more than a day old and have failed to reach a school -- "
"assembles deta... | [
"paying_for_college.disclosures.scripts.notifications.send_stale_notifications"
] | [((1030, 1086), 'paying_for_college.disclosures.scripts.notifications.send_stale_notifications', 'send_stale_notifications', ([], {'add_email': "options['add_email']"}), "(add_email=options['add_email'])\n", (1054, 1086), False, 'from paying_for_college.disclosures.scripts.notifications import send_stale_notifications\... |
import unittest
from play_results.sqlite3_orm import SqliteORM
DATABASE = "test_apps.db"
APP_ID = "com.pixelbite.rr3"
class Sqlite3ORMTest(unittest.TestCase):
def setUp(self) -> None:
self.sqlite = SqliteORM(DATABASE)
self.sqlite.connect()
def tearDown(self) -> None:
self.sqlite.clo... | [
"play_results.sqlite3_orm.SqliteORM"
] | [((1654, 1673), 'play_results.sqlite3_orm.SqliteORM', 'SqliteORM', (['DATABASE'], {}), '(DATABASE)\n', (1663, 1673), False, 'from play_results.sqlite3_orm import SqliteORM\n'), ((214, 233), 'play_results.sqlite3_orm.SqliteORM', 'SqliteORM', (['DATABASE'], {}), '(DATABASE)\n', (223, 233), False, 'from play_results.sqlit... |
# Copyright 2017 PerfKitBenchmarker 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... | [
"perfkitbenchmarker.flags.DEFINE_list",
"uuid.uuid4",
"perfkitbenchmarker.resource.GetResourceClass",
"perfkitbenchmarker.vm_util.IssueCommand",
"perfkitbenchmarker.flags.DEFINE_integer",
"perfkitbenchmarker.flags.DEFINE_boolean",
"six.iteritems",
"re.search",
"perfkitbenchmarker.flags.DEFINE_string... | [((830, 932), 'perfkitbenchmarker.flags.DEFINE_string', 'flags.DEFINE_string', (['"""managed_db_engine"""', 'None', '"""Managed database flavor to use (mysql, postgres)"""'], {}), "('managed_db_engine', None,\n 'Managed database flavor to use (mysql, postgres)')\n", (849, 932), False, 'from perfkitbenchmarker import... |
# Generated by Django 3.0.7 on 2020-06-11 15:14
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('grupos', '0006_grupo_integrante'),
]
operations = [
migrations.AddField(
model_name='comeback',... | [
"django.db.models.ForeignKey"
] | [((365, 461), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'default': '(1)', 'on_delete': 'django.db.models.deletion.CASCADE', 'to': '"""grupos.Grupo"""'}), "(default=1, on_delete=django.db.models.deletion.CASCADE,\n to='grupos.Grupo')\n", (382, 461), False, 'from django.db import migrations, models\n')... |
#!/usr/bin/env python
# coding: utf-8
from git import Repo
import os
import numpy as np
import xarray as xr
import pandas as pd
import scipy
import Nio
import datetime
import sys
script_full_path = '/scripts/reformat_SAR_and_TAR.py'
#=================================
# Process SAR models
# Second Assessment Report... | [
"os.getcwd",
"xarray.open_dataset",
"os.system",
"numpy.array",
"datetime.datetime.now",
"os.listdir"
] | [((405, 446), 'os.system', 'os.system', ([], {'command': 'f"""mkdir -p {save_dir}"""'}), "(command=f'mkdir -p {save_dir}')\n", (414, 446), False, 'import os\n'), ((858, 878), 'os.listdir', 'os.listdir', (['load_dir'], {}), '(load_dir)\n', (868, 878), False, 'import os\n'), ((3551, 3571), 'os.listdir', 'os.listdir', (['... |
from imutils import face_utils, resize
import dlib
import cv2
from .utils import *
import random
class FaceDet(BaseDet):
def __init__(self):
super().__init__()
# 第一步:使用dlib.get_frontal_face_detector() 获得脸部位置检测器
self.detector = dlib.get_frontal_face_detector()
# 第二步:使用dlib.shape_pr... | [
"cv2.line",
"cv2.circle",
"cv2.putText",
"cv2.cvtColor",
"random.random",
"imutils.face_utils.shape_to_np",
"cv2.convexHull",
"dlib.get_frontal_face_detector",
"imutils.resize",
"cv2.drawContours",
"dlib.shape_predictor"
] | [((258, 290), 'dlib.get_frontal_face_detector', 'dlib.get_frontal_face_detector', ([], {}), '()\n', (288, 290), False, 'import dlib\n'), ((364, 435), 'dlib.shape_predictor', 'dlib.shape_predictor', (['"""./weights/shape_predictor_68_face_landmarks.dat"""'], {}), "('./weights/shape_predictor_68_face_landmarks.dat')\n", ... |
# -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2020 PANGAEA (https://www.pangaea.de/)
#
# 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 limita... | [
"fuji_server.helper.identifier_helper.IdentifierHelper",
"uuid.UUID",
"hashid.HashID",
"fuji_server.models.uniqueness_output.UniquenessOutput",
"re.search",
"fuji_server.models.uniqueness.Uniqueness"
] | [((1663, 1772), 'fuji_server.models.uniqueness.Uniqueness', 'Uniqueness', ([], {'id': 'self.metric_number', 'metric_identifier': 'self.metric_identifier', 'metric_name': 'self.metric_name'}), '(id=self.metric_number, metric_identifier=self.metric_identifier,\n metric_name=self.metric_name)\n', (1673, 1772), False, '... |
# Copyright 2019 DeepMind Technologies Ltd. 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 appl... | [
"pyspiel.load_game",
"absl.testing.absltest.main",
"numpy.random.seed",
"pyspiel.GameParameter",
"open_spiel.python.algorithms.outcome_sampling_mccfr.OutcomeSamplingSolver"
] | [((2733, 2748), 'absl.testing.absltest.main', 'absltest.main', ([], {}), '()\n', (2746, 2748), False, 'from absl.testing import absltest\n'), ((1117, 1137), 'numpy.random.seed', 'np.random.seed', (['SEED'], {}), '(SEED)\n', (1131, 1137), True, 'import numpy as np\n'), ((1149, 1181), 'pyspiel.load_game', 'pyspiel.load_g... |
### Libraries
import torch.nn as nn, torch
from torchvision import models
from collections import namedtuple
################################################################################################
### NOTE: Divide and put into channels? ########################################################
###############... | [
"torch.nn.Dropout",
"torch.cat",
"torch.nn.LocalResponseNorm",
"torch.nn.Linear",
"torch.zeros",
"torchvision.models.vgg16",
"torch.autograd.Variable",
"torch.nn.Conv2d",
"torch.nn.BatchNorm2d",
"torch.cuda.is_available",
"torch.rand",
"torch.nn.MaxPool2d",
"torch.nn.LeakyReLU",
"torch.nn.... | [((716, 731), 'torch.nn.Sequential', 'nn.Sequential', ([], {}), '()\n', (729, 731), True, 'import torch.nn as nn, torch\n'), ((2137, 2152), 'torch.nn.Sequential', 'nn.Sequential', ([], {}), '()\n', (2150, 2152), True, 'import torch.nn as nn, torch\n'), ((2346, 2361), 'torch.nn.Sequential', 'nn.Sequential', ([], {}), '(... |
import math
import torch
from torch import nn as nn
from torch.nn import functional as F
from basicsr.models.archs.arch_util import flow_warp
class BasicModule(nn.Module):
"""Basic Module for SpyNet.
"""
def __init__(self):
super(BasicModule, self).__init__()
self.basic_module = nn.Seque... | [
"torch.nn.ReLU",
"math.ceil",
"torch.nn.functional.avg_pool2d",
"torch.load",
"torch.nn.Conv2d",
"torch.Tensor",
"torch.nn.functional.interpolate",
"torch.nn.functional.pad"
] | [((3836, 3927), 'torch.nn.functional.interpolate', 'F.interpolate', ([], {'input': 'ref', 'size': '(h_floor, w_floor)', 'mode': '"""bilinear"""', 'align_corners': '(False)'}), "(input=ref, size=(h_floor, w_floor), mode='bilinear',\n align_corners=False)\n", (3849, 3927), True, 'from torch.nn import functional as F\n... |
#!/usr/bin/env python
# coding:utf-8
import os
import configparser
import sys
from pymongo import MongoClient
import subprocess
import time
from pymongo.errors import ConnectionFailure
# Will also create an index if not none.
def createCollIfNotExist(db, collName, index):
coll = None
if db.system.namespaces.... | [
"configparser.ConfigParser",
"time.sleep"
] | [((652, 679), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (677, 679), False, 'import configparser\n'), ((2302, 2316), 'time.sleep', 'time.sleep', (['(10)'], {}), '(10)\n', (2312, 2316), False, 'import time\n')] |
import Levenshtein
import operator
import csv
import pickle
import os
import re
from pkg_resources import Requirement, resource_filename
dictionary_file = resource_filename(Requirement.parse("drugstandards"), "drugstandards/data/synonyms.dat")
drugdict = pickle.load(open(dictionary_file, "rb"))
def create_drug_dicti... | [
"Levenshtein.jaro_winkler",
"pkg_resources.Requirement.parse",
"operator.itemgetter",
"re.compile"
] | [((174, 208), 'pkg_resources.Requirement.parse', 'Requirement.parse', (['"""drugstandards"""'], {}), "('drugstandards')\n", (191, 208), False, 'from pkg_resources import Requirement, resource_filename\n'), ((2447, 2470), 're.compile', 're.compile', (['"""\\\\W+|\\\\d+"""'], {}), "('\\\\W+|\\\\d+')\n", (2457, 2470), Fal... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Description
"""
import os
import random
import numpy as np
from pathlib import Path
from enum import Enum, unique, auto
from sklearn.preprocessing import MinMaxScaler, RobustScaler, StandardScaler
import torch
import torch.utils.data as data
from ptranking.ltr_adho... | [
"sklearn.preprocessing.StandardScaler",
"numpy.abs",
"ptranking.utils.bigdata.BigPickle.pickle_load",
"random.shuffle",
"sklearn.preprocessing.MinMaxScaler",
"numpy.greater",
"numpy.clip",
"pathlib.Path",
"os.path.exists",
"torch.FloatTensor",
"torch.squeeze",
"torch.gt",
"numpy.random.choic... | [((36592, 36616), 'torch.FloatTensor', 'torch.FloatTensor', (['[0.0]'], {}), '([0.0])\n', (36609, 36616), False, 'import torch\n'), ((2951, 2957), 'enum.auto', 'auto', ([], {}), '()\n', (2955, 2957), False, 'from enum import Enum, unique, auto\n'), ((2979, 2985), 'enum.auto', 'auto', ([], {}), '()\n', (2983, 2985), Fal... |
# TODO analyse if this optimization is needed or whether we can use HF transformers code
from typing import Dict, Any, Optional
import inspect
import logging
import sys
from importlib import import_module
import torch
from torch.nn import DataParallel
from torch.nn.parallel import DistributedDataParallel
logger = log... | [
"apex.amp.initialize",
"importlib.import_module",
"torch.cuda.device_count",
"haystack.modeling.logger.MLFlowLogger.log_params",
"inspect.signature",
"apex.parallel.convert_syncbn_model",
"logging.getLogger"
] | [((317, 344), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (334, 344), False, 'import logging\n'), ((7227, 7341), 'haystack.modeling.logger.MLFlowLogger.log_params', 'MlLogger.log_params', (["{'use_amp': use_amp, 'num_train_optimization_steps': schedule_opts[\n 'num_training_steps']}... |
from urllib2 import Request, urlopen
import json
from pandas.io.json import json_normalize
request=Request('https://www.kaggle.com/max-mind/world-cities-database/download/fIa40mQCPcC6ZJIDQR4Y%2Fversions%2FOH1ToFMEYfoKbCjSUppD%2Ffiles%2Fworldcitiespop.csv?datasetVersionNumber=3')
response = urlopen(request)
eleva... | [
"pandas.io.json.json_normalize",
"urllib2.Request",
"urllib2.urlopen",
"json.loads"
] | [((104, 294), 'urllib2.Request', 'Request', (['"""https://www.kaggle.com/max-mind/world-cities-database/download/fIa40mQCPcC6ZJIDQR4Y%2Fversions%2FOH1ToFMEYfoKbCjSUppD%2Ffiles%2Fworldcitiespop.csv?datasetVersionNumber=3"""'], {}), "(\n 'https://www.kaggle.com/max-mind/world-cities-database/download/fIa40mQCPcC6ZJIDQ... |
from cms.models import CMSPlugin
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
CLASS_NAMES = getattr(settings, "CMS_STYLE_NAMES", (
('info', _("info")),
('new', _("new")),
('hint', _("hint"))
)
)
class Style(CMSPlugi... | [
"django.db.models.OneToOneField",
"django.utils.translation.ugettext_lazy"
] | [((657, 724), 'django.db.models.OneToOneField', 'models.OneToOneField', (['CMSPlugin'], {'related_name': '"""+"""', 'parent_link': '(True)'}), "(CMSPlugin, related_name='+', parent_link=True)\n", (677, 724), False, 'from django.db import models\n'), ((759, 774), 'django.utils.translation.ugettext_lazy', '_', (['"""clas... |
# add docstring
"""
Build book PDFs in batch.
https://github.com/kerwinso/osc-tools
"""
# use cURL : http://pycurl.io/
# or requests : http://docs.python-requests.org/en/master/
# instead of a full browser
# import webbrowser
import requests
# check if a file exists before trying to read it
import os.path
# move the... | [
"requests.get"
] | [((3125, 3148), 'requests.get', 'requests.get', (['build_url'], {}), '(build_url)\n', (3137, 3148), False, 'import requests\n'), ((3389, 3412), 'requests.get', 'requests.get', (['build_url'], {}), '(build_url)\n', (3401, 3412), False, 'import requests\n')] |
from __future__ import annotations
from typing import Optional, TYPE_CHECKING, Union
# noinspection PyPackageRequirements
from pyspark.sql.types import StructType, DataType
from spark_auto_mapper_fhir.fhir_types.date_time import FhirDateTime
from spark_auto_mapper_fhir.fhir_types.list import FhirList
from spark_auto_m... | [
"spark_fhir_schemas.r4.resources.measurereport.MeasureReportSchema.get_schema"
] | [((10959, 11026), 'spark_fhir_schemas.r4.resources.measurereport.MeasureReportSchema.get_schema', 'MeasureReportSchema.get_schema', ([], {'include_extension': 'include_extension'}), '(include_extension=include_extension)\n', (10989, 11026), False, 'from spark_fhir_schemas.r4.resources.measurereport import MeasureReport... |
# Generated by Django 3.0.5 on 2020-05-04 13:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('plans', '0005_recurring_payments'),
]
operations = [
migrations.AlterModelOptions(
name='planpricing',
options={'ord... | [
"django.db.models.IntegerField",
"django.db.migrations.AlterModelOptions"
] | [((233, 415), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""planpricing"""', 'options': "{'ordering': ('order', 'pricing__period'), 'verbose_name': 'Plan pricing',\n 'verbose_name_plural': 'Plans pricings'}"}), "(name='planpricing', options={'ordering': (\n 'order', '... |
#!/usr/bin/env python
# Copyright (C) 2015 Ion Torrent Systems, Inc. All Rights Reserved
"""
* Counts the number of new datasets created per day for the given number of days.
* Uses the number of Experiment objects created in each time period.
* Note: Experiment object's date field gets initialized to the time the o... | [
"sys.stdout.write",
"iondb.rundb.models.DMFileSet.objects.all",
"django.utils.timezone.now",
"django.utils.timezone.localtime",
"json.dumps",
"iondb.rundb.models.Experiment.objects.filter",
"datetime.timedelta"
] | [((6100, 6178), 'json.dumps', 'json.dumps', (['self.mydatadict'], {'sort_keys': '(False)', 'indent': '(2)', 'separators': "(',', ': ')"}), "(self.mydatadict, sort_keys=False, indent=2, separators=(',', ': '))\n", (6110, 6178), False, 'import json\n'), ((1911, 1925), 'django.utils.timezone.now', 'timezone.now', ([], {})... |
from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(name='discopy-data-rknaebel',
version='1.0.1',
description='Data and Structures for Neural Discourse Parsing',
long_description=long_description,
long_description_content_typ... | [
"setuptools.find_packages"
] | [((481, 496), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (494, 496), False, 'from setuptools import setup, find_packages\n')] |
import pytest
import neispy
fail_list = []
@pytest.mark.asyncio
async def test_requests():
AE = "B10"
SE1 = "test001"
SE2 = "test002"
SE3 = "test003"
itsok = "DataNotFound"
neis = neispy.Client()
try:
await neis.schoolInfo()
except Exception as e:
fail_list.append(f"... | [
"neispy.Client"
] | [((208, 223), 'neispy.Client', 'neispy.Client', ([], {}), '()\n', (221, 223), False, 'import neispy\n')] |
# GENERATED BY KOMAND SDK - DO NOT EDIT
import insightconnect_plugin_runtime
import json
class Component:
DESCRIPTION = "Poll for user activity events"
class Input:
ACTIVITY_TYPE = "activity_type"
class Output:
USER_ACTIVITY = "user_activity"
class UserActivityEventInput(insightcon... | [
"json.loads"
] | [((361, 749), 'json.loads', 'json.loads', (['"""\n {\n "type": "object",\n "title": "Variables",\n "properties": {\n "activity_type": {\n "type": "string",\n "title": "Activity Type",\n "description": "Type of user activity to match event",\n "enum": [\n "Sign in",\n "Sign out"... |
import gi
import logging
from gi.repository import Gtk, Gst
class UiBuilder(object):
def __init__(self, uifile):
if not hasattr(self, 'log'):
self.log = logging.getLogger('UiBuilder')
self.uifile = uifile
self.builder = Gtk.Builder()
self.builder.add_from_file(self.u... | [
"gi.repository.Gtk.Buildable.get_name",
"gi.repository.Gtk.Builder",
"logging.getLogger"
] | [((265, 278), 'gi.repository.Gtk.Builder', 'Gtk.Builder', ([], {}), '()\n', (276, 278), False, 'from gi.repository import Gtk, Gst\n'), ((180, 210), 'logging.getLogger', 'logging.getLogger', (['"""UiBuilder"""'], {}), "('UiBuilder')\n", (197, 210), False, 'import logging\n'), ((776, 806), 'gi.repository.Gtk.Buildable.g... |
from lib.operators.Operator import Operator
import numpy as np
class Gaussian(Operator):
def __init__(self):
super().__init__()
@staticmethod
def function(x):
return np.exp(-(np.power(x, 2)))
@staticmethod
def derivative(x):
return -2 * x * np.exp(-(np.power(x, 2)))
| [
"numpy.power"
] | [((206, 220), 'numpy.power', 'np.power', (['x', '(2)'], {}), '(x, 2)\n', (214, 220), True, 'import numpy as np\n'), ((298, 312), 'numpy.power', 'np.power', (['x', '(2)'], {}), '(x, 2)\n', (306, 312), True, 'import numpy as np\n')] |
#!/usr/bin/env python
import cv2
import numpy as np
import argparse
import os
#img= cv2.imread('A.png')
#print img.shape
#img2 =img[59:538,393:1032]
path = '/home/djtobias/Downloads/A-Y/Y/'
#cv2.imwrite('messigray.png',img2)
for i in os.walk(path):
(root,dirs,files) = i
num = 0
for name in files:
i... | [
"cv2.imread",
"os.walk"
] | [((235, 248), 'os.walk', 'os.walk', (['path'], {}), '(path)\n', (242, 248), False, 'import os\n'), ((325, 354), 'cv2.imread', 'cv2.imread', (["(root + '/' + name)"], {}), "(root + '/' + name)\n", (335, 354), False, 'import cv2\n')] |
class PixelAccess_Int:
"""
An interface for more easily interacting with PixelAccess objects from PIL.
"""
def px_field(self):
"""
Yield a 3-tuple of the pixel index tuple, the graph x value, and the
graph y value for each pixel in the image.
"""
for px, py in se... | [
"PIL.Image.new"
] | [((985, 1034), 'PIL.Image.new', 'Image.new', (['mode', '(self.width, self.height)', 'color'], {}), '(mode, (self.width, self.height), color)\n', (994, 1034), False, 'from PIL import Image\n')] |
# Copyright (C) 2019-2020, TomTom (http://tomtom.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 applicable law o... | [
"pytest.mark.parametrize"
] | [((669, 732), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""api_reference_set"""', "[['cpp/default']]"], {}), "('api_reference_set', [['cpp/default']])\n", (692, 732), False, 'import pytest\n'), ((1889, 1952), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""api_reference_set"""', "[['cpp/defau... |
# Copyright (c) MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | [
"monai.transforms.RandRotate90",
"monai.data.utils.decollate_batch",
"monai.transforms.RandSpatialCropd",
"monai.transforms.PadListDataCollate.inverse",
"numpy.arange",
"monai.transforms.RandZoomd",
"monai.utils.set_determinism",
"unittest.main",
"monai.data.utils.pad_list_data_collate",
"monai.tr... | [((1234, 1283), 'monai.transforms.PadListDataCollate', 'PadListDataCollate', ([], {'method': '"""end"""', 'mode': '"""constant"""'}), "(method='end', mode='constant')\n", (1252, 1283), False, 'from monai.transforms import Compose, PadListDataCollate, RandRotate, RandRotate90, RandRotate90d, RandRotated, RandSpatialCrop... |
import time
import functools
def timer(func):
@functools.wraps(func)
def wrapper_timer(*args, **kwargs):
start_time = time.time()
value = func(*args, **kwargs)
time_eplapsed = time.time()-start_time
print(f"Finished {func.__name__} in {time_eplapsed:.6f} secs")
return v... | [
"functools.wraps",
"time.time"
] | [((53, 74), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (68, 74), False, 'import functools\n'), ((136, 147), 'time.time', 'time.time', ([], {}), '()\n', (145, 147), False, 'import time\n'), ((210, 221), 'time.time', 'time.time', ([], {}), '()\n', (219, 221), False, 'import time\n')] |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np # type: ignore
import onnx
from ..base import Base
from . import expect
def apply_momentum(t, r, x, g, v, norm_coefficient, alpha, beta): # type: ... | [
"onnx.helper.make_node",
"numpy.array",
"onnx.helper.make_opsetid"
] | [((1415, 1622), 'onnx.helper.make_node', 'onnx.helper.make_node', (['"""Momentum"""'], {'inputs': "['R', 'T', 'X', 'G', 'V']", 'outputs': "['X_new', 'V_new']", 'norm_coefficient': 'norm_coefficient', 'alpha': 'alpha', 'beta': 'beta', 'mode': '"""standard"""', 'domain': '"""ai.onnx.training"""'}), "('Momentum', inputs=[... |
import os
import subprocess
import sys
import time
from contextlib import contextmanager
import docker
import pytest
from dagster_test.dagster_core_docker_buildkite import (
build_and_tag_test_image,
get_test_project_docker_image,
)
import dagster._check as check
import dagster.seven as seven
from dagster.cor... | [
"docker.from_env",
"dagster_test.dagster_core_docker_buildkite.build_and_tag_test_image",
"dagster.grpc.client.DagsterGrpcClient",
"dagster.utils.file_relative_path",
"os.environ.copy",
"subprocess.check_output",
"pytest.fixture",
"dagster_test.dagster_core_docker_buildkite.get_test_project_docker_ima... | [((989, 1020), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (1003, 1020), False, 'import pytest\n'), ((4060, 4091), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (4074, 4091), False, 'import pytest\n'), ((4414, 4445), 'pytest... |
# -*-coding:utf-8 -*-
'''
@File : main.py.py
@Author : <NAME>
@Date : 2020/8/11
@Desc :
'''
import sys
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(BASE_DIR)
import tensorflow as tf
import argparse
from QuestionAnswerSummaryAnd... | [
"sys.path.append",
"os.path.abspath",
"argparse.ArgumentParser",
"loguru.logger.add",
"tensorflow.config.experimental.set_visible_devices",
"QuestionAnswerSummaryAndReasoning.seq2seq_pgn_tf2.train_eval_test.evaluate",
"loguru.logger.info",
"QuestionAnswerSummaryAndReasoning.seq2seq_pgn_tf2.train_eval_... | [((225, 250), 'sys.path.append', 'sys.path.append', (['BASE_DIR'], {}), '(BASE_DIR)\n', (240, 250), False, 'import sys\n'), ((698, 723), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (721, 723), False, 'import argparse\n'), ((6175, 6209), 'loguru.logger.info', 'logger.info', (['"""Arguments se... |
""" Convert dataset to HDF5
This script preprocesses a dataset and saves it (images and labels) to
an HDF5 file for improved I/O. """
import os
import sys
from argparse import ArgumentParser
from tqdm import tqdm, trange
import h5py as h5
import numpy as np
import torch
import torchvision.datasets as dset
imp... | [
"h5py.File",
"tqdm.tqdm",
"argparse.ArgumentParser",
"torch.utils.data.DataLoader",
"utils.create_filters",
"torchvision.transforms.ToTensor",
"torchvision.datasets.ImageFolder",
"utils.CenterCropLongEdge",
"torch.cuda.is_available",
"torchvision.transforms.Normalize",
"torchvision.transforms.Re... | [((625, 658), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': 'usage'}), '(description=usage)\n', (639, 658), False, 'from argparse import ArgumentParser\n'), ((1506, 1534), 'utils.create_filters', 'utils.create_filters', (['device'], {}), '(device)\n', (1526, 1534), False, 'import utils\n'), ((1882, ... |
import argparse
import os
import sys
sys.path.append('.')
from iscr.ranker.indexer import text_to_wordcount
from iscr.utils import load_from_pickle, save_to_pickle
def build_query_answer(lex_dict, query_file, answer_file, out_pickle):
# Perform query wordcount
print("Counting queries...")
query = {}
with open(que... | [
"sys.path.append",
"iscr.utils.load_from_pickle",
"argparse.ArgumentParser",
"iscr.ranker.indexer.text_to_wordcount",
"iscr.utils.save_to_pickle"
] | [((37, 57), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (52, 57), False, 'import sys\n'), ((827, 860), 'iscr.utils.save_to_pickle', 'save_to_pickle', (['out_pickle', 'query'], {}), '(out_pickle, query)\n', (841, 860), False, 'from iscr.utils import load_from_pickle, save_to_pickle\n'), ((915, 94... |
from ip2geotools.databases.noncommercial import DbIpCity
from colorama import Fore
from tkinter import *
from tkinter import ttk
from tqdm import tqdm
from queue import Queue
import urllib.request, re
import time
import os
import socket
import subprocess
import ipaddress
import threading
import speedtest
class Vindu(T... | [
"tkinter.ttk.Label",
"threading.Thread",
"speedtest.Speedtest",
"os.chmod",
"ipaddress.ip_network",
"ip2geotools.databases.noncommercial.DbIpCity.get",
"subprocess.STARTUPINFO",
"time.time",
"threading.Lock",
"socket.gethostname",
"subprocess.call",
"tkinter.ttk.Button",
"queue.Queue"
] | [((585, 639), 'tkinter.ttk.Button', 'ttk.Button', ([], {'text': '"""Execute Ping"""', 'command': 'self.run_ping'}), "(text='Execute Ping', command=self.run_ping)\n", (595, 639), False, 'from tkinter import ttk\n'), ((708, 766), 'tkinter.ttk.Button', 'ttk.Button', ([], {'text': '"""Ping Your IP"""', 'command': 'self.pin... |
import numpy as np
import time
import gym
import or_gym
import ray
from ray import tune
from ray.rllib.agents import ppo
from ray.tune import grid_search
from or_gym.algos import rl_utils
def train_rl_knapsack(env_name, rl_config, max_episodes=1000):
ray.init(ignore_reinit_error=True)
# rl_utils.register_env... | [
"ray.init",
"or_gym.algos.rl_utils.create_env",
"time.time",
"numpy.array",
"ray.shutdown"
] | [((258, 292), 'ray.init', 'ray.init', ([], {'ignore_reinit_error': '(True)'}), '(ignore_reinit_error=True)\n', (266, 292), False, 'import ray\n'), ((534, 545), 'time.time', 'time.time', ([], {}), '()\n', (543, 545), False, 'import time\n'), ((1152, 1166), 'ray.shutdown', 'ray.shutdown', ([], {}), '()\n', (1164, 1166), ... |
import pytest
from db.db_utils import add_data_to_questions, clear_table, create_connection
from server.api.main import get_app, get_db_config, set_db_client
@pytest.fixture()
def app():
app = get_app()
db_config = get_db_config()
set_db_client(app, db_config)
return app
@pytest.fixture
async def a... | [
"db.db_utils.add_data_to_questions",
"pytest.fixture",
"db.db_utils.clear_table",
"server.api.main.get_app",
"server.api.main.get_db_config",
"server.api.main.set_db_client",
"db.db_utils.create_connection"
] | [((162, 178), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (176, 178), False, 'import pytest\n'), ((200, 209), 'server.api.main.get_app', 'get_app', ([], {}), '()\n', (207, 209), False, 'from server.api.main import get_app, get_db_config, set_db_client\n'), ((226, 241), 'server.api.main.get_db_config', 'get_db... |
from __future__ import absolute_import
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
#
# Sandesh State Machine
#
from builtins import object
from fysom import Fysom
import gevent
from .gen_py.sandesh.ttypes import SandeshTxDropReason
from .sandesh_session import SandeshSession
from .work_que... | [
"fysom.Fysom",
"gevent.spawn",
"gevent.kill",
"gevent.spawn_later"
] | [((4873, 6597), 'fysom.Fysom', 'Fysom', (["{'initial': {'state': State._IDLE, 'event': Event._EV_START, 'defer': True},\n 'events': [{'name': Event._EV_IDLE_HOLD_TIMER_EXPIRED, 'src': State.\n _IDLE, 'dst': State._CONNECT}, {'name': Event._EV_COLLECTOR_CHANGE,\n 'src': State._IDLE, 'dst': State._CONNECT}, {'na... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 16 12:44:27 2020
@author: jarekj
"""
import datetime
from typing import Sequence, Union
import numpy as np
import pandas as pd
from astral import sun
from astral import Observer
import pickle, os
import matplotlib.pyplot as plt
import matplotlib.g... | [
"matplotlib.pyplot.figure",
"numpy.exp",
"datetime.time",
"pandas.DataFrame",
"matplotlib.pyplot.close",
"datetime.timedelta",
"numpy.linspace",
"matplotlib.ticker.MultipleLocator",
"matplotlib.pyplot.xticks",
"numpy.repeat",
"datetime.datetime.today",
"datetime.date",
"datetime.datetime",
... | [((467, 499), 'pandas.plotting.register_matplotlib_converters', 'register_matplotlib_converters', ([], {}), '()\n', (497, 499), False, 'from pandas.plotting import register_matplotlib_converters\n'), ((845, 867), 'datetime.date', 'datetime.date', (['(1)', '(1)', '(1)'], {}), '(1, 1, 1)\n', (858, 867), False, 'import da... |
from __future__ import absolute_import, unicode_literals, division
import time
import hmac
import simplejson
from urllib.parse import urlencode,quote
from hashlib import sha256
from paxful.exceptions import RequestError
class RestClient(object):
"""REST client using HMAC SHA256 Authentication
:param url: ... | [
"time.time"
] | [((2833, 2844), 'time.time', 'time.time', ([], {}), '()\n', (2842, 2844), False, 'import time\n')] |
"""
ckwg +31
Copyright 2018 by Kitware, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the ... | [
"kwiver.vital.types.Timestamp"
] | [((1753, 1764), 'kwiver.vital.types.Timestamp', 'Timestamp', ([], {}), '()\n', (1762, 1764), False, 'from kwiver.vital.types import Timestamp\n'), ((1769, 1793), 'kwiver.vital.types.Timestamp', 'Timestamp', (['(1234000000)', '(1)'], {}), '(1234000000, 1)\n', (1778, 1793), False, 'from kwiver.vital.types import Timestam... |
# Copyright (c) 2002-2012 IronPort Systems and Cisco Systems
#
# 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, mod... | [
"string.translate",
"string.maketrans"
] | [((1964, 2020), 'string.maketrans', 'string.maketrans', (['nonprintable', 'nonprintable_replacement'], {}), '(nonprintable, nonprintable_replacement)\n', (1980, 2020), False, 'import string\n'), ((2190, 2229), 'string.translate', 'string.translate', (['s', 'nonprintable_table'], {}), '(s, nonprintable_table)\n', (2206,... |
import numpy as np
import matplotlib
from matplotlib import cm
import matplotlib.pyplot as plt
import lmfit as lm
import matplotlib.gridspec as gridspec
class analysis():
fontSize = 14
def __init__(self, imageData, xPixSize, yPixSize, minX, maxX, minY, maxY, savePath, date, time):
# %% Read... | [
"matplotlib.colors.LinearSegmentedColormap",
"numpy.sum",
"numpy.abs",
"numpy.shape",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.arange",
"matplotlib.colors.LogNorm",
"lmfit.Parameters",
"numpy.meshgrid",
"matplotlib.pyplot.getp",
"matplotlib.pyplot.setp",
"matplotlib.pyplot.colorbar",... | [((1908, 1967), 'matplotlib.colors.LinearSegmentedColormap', 'matplotlib.colors.LinearSegmentedColormap', (['"""fireice"""', 'cdict'], {}), "('fireice', cdict)\n", (1949, 1967), False, 'import matplotlib\n'), ((5095, 5139), 'numpy.logical_and', 'np.logical_and', (['(xAxis >= xMin)', '(xAxis <= xMax)'], {}), '(xAxis >= ... |
from flask import Flask
from api.kme import KME
app = Flask(__name__)
from api import routes
# **********************************CHANGE ABSOLUTE PATH TO config.ini HERE*************************************
config_path = "/home/alvin/PycharmProjects/etsi-qkd-api/api/config.ini"
# ************************************... | [
"api.kme.KME",
"flask.Flask"
] | [((56, 71), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (61, 71), False, 'from flask import Flask\n'), ((412, 428), 'api.kme.KME', 'KME', (['config_path'], {}), '(config_path)\n', (415, 428), False, 'from api.kme import KME\n')] |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import event_store_pb2 as event__store__pb2
class EventStoreStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
... | [
"grpc.unary_stream_rpc_method_handler",
"grpc.method_handlers_generic_handler",
"grpc.unary_unary_rpc_method_handler"
] | [((3621, 3707), 'grpc.method_handlers_generic_handler', 'grpc.method_handlers_generic_handler', (['"""eventstore.EventStore"""', 'rpc_method_handlers'], {}), "('eventstore.EventStore',\n rpc_method_handlers)\n", (3657, 3707), False, 'import grpc\n'), ((2610, 2812), 'grpc.unary_unary_rpc_method_handler', 'grpc.unary_... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from io import StringIO
from wex import ncr
script = """
<SCRIPT src="/foo">
var my_html = "</p>";
var x = "•":
</SCRIPT>
"""
elem = "<code>Hello •</code>"
def test_end_char_ref():
assert ncr.end_char_ref.search('#123;').group(1) ... | [
"io.StringIO",
"wex.ncr.replace_invalid_ncr",
"wex.ncr.clean_ncr",
"wex.ncr.end_char_ref.search"
] | [((2203, 2217), 'io.StringIO', 'StringIO', (['html'], {}), '(html)\n', (2211, 2217), False, 'from io import StringIO\n'), ((458, 487), 'wex.ncr.clean_ncr', 'ncr.clean_ncr', (['"""•"""', '(True)'], {}), "('•', True)\n", (471, 487), False, 'from wex import ncr\n'), ((562, 589), 'wex.ncr.clean_ncr', 'ncr.clean_n... |
#!/usr/bin/python3
'''Day 11 of the 2017 advent of code'''
import pytest
from main import HexCounter
def helper(coords):
'''helper function to run the test'''
hexer = HexCounter()
coords = coords.split(",")
for coord in coords:
hexer.move(coord)
return hexer
def tests():
'''test... | [
"main.HexCounter"
] | [((180, 192), 'main.HexCounter', 'HexCounter', ([], {}), '()\n', (190, 192), False, 'from main import HexCounter\n')] |
#!/usr/bin/env python
#
# Copyright 2007 Google 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 o... | [
"sys.platform.startswith",
"google.appengine.tools.devappserver2.go_errors.BuildError",
"atexit.register",
"logging.debug",
"shutil.rmtree",
"os.getcwd",
"tempfile.mkdtemp",
"google.appengine.tools.devappserver2.safe_subprocess.start_process",
"os.path.join",
"os.chdir"
] | [((1325, 1355), 'sys.platform.startswith', 'sys.platform.startswith', (['"""win"""'], {}), "('win')\n", (1348, 1355), False, 'import sys\n'), ((970, 994), 'shutil.rmtree', 'shutil.rmtree', (['directory'], {}), '(directory)\n', (983, 994), False, 'import shutil\n'), ((1478, 1566), 'google.appengine.tools.devappserver2.s... |
from cryptography.fernet import Fernet # Encrypt/decrypt files on target system.
import os # Get system root.
import webbrowser # Visit specific websites.
import ctypes # Interact with Windows .dll files and change windows wallpaper.
import urllib.request # Download and save wallpaper.
import requests # Make... | [
"os.path.expanduser",
"threading.Thread",
"webbrowser.open",
"subprocess.Popen",
"os.path.join",
"os.walk",
"Crypto.Cipher.PKCS1_OAEP.new",
"datetime.date.today",
"datetime.datetime.now",
"time.sleep",
"win32gui.GetForegroundWindow",
"requests.get",
"cryptography.fernet.Fernet",
"cryptogra... | [((9863, 9907), 'threading.Thread', 'threading.Thread', ([], {'target': 'rw.show_ransom_note'}), '(target=rw.show_ransom_note)\n', (9879, 9907), False, 'import threading\n'), ((9918, 9963), 'threading.Thread', 'threading.Thread', ([], {'target': 'rw.put_me_on_desktop'}), '(target=rw.put_me_on_desktop)\n', (9934, 9963),... |
## ANALYSE EOF TIME AND SPACE SCALES
import numpy as np
import matplotlib.pyplot as plt
exec(open('python/ecco2/colormap.py').read())
## LOAD
(eofL1,pctau1) = np.load('python/gyres/eof_lowres_ltscales.npy')
(eofL2,pctau2) = np.load('python/gyres/eof_highres_ltscales.npy')
(eofs1,pcs1,eigs1) = np.load('python/gyres/t... | [
"numpy.load",
"numpy.sqrt",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((161, 208), 'numpy.load', 'np.load', (['"""python/gyres/eof_lowres_ltscales.npy"""'], {}), "('python/gyres/eof_lowres_ltscales.npy')\n", (168, 208), True, 'import numpy as np\n'), ((226, 274), 'numpy.load', 'np.load', (['"""python/gyres/eof_highres_ltscales.npy"""'], {}), "('python/gyres/eof_highres_ltscales.npy')\n"... |
import boto3
from flask import Flask
from flask import render_template
from importlib_resources import read_text
from werkzeug.contrib.fixers import ProxyFix
from yaml import load
from lib.soundcloud import soundcloud_get
conf = load(read_text('conf', 'config.yaml'))
app = Flask(__name__)
app.wsgi_app = ProxyFix(ap... | [
"werkzeug.contrib.fixers.ProxyFix",
"flask.Flask",
"boto3.resource",
"lib.soundcloud.soundcloud_get",
"flask.render_template",
"importlib_resources.read_text"
] | [((278, 293), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (283, 293), False, 'from flask import Flask\n'), ((309, 331), 'werkzeug.contrib.fixers.ProxyFix', 'ProxyFix', (['app.wsgi_app'], {}), '(app.wsgi_app)\n', (317, 331), False, 'from werkzeug.contrib.fixers import ProxyFix\n'), ((237, 269), 'importli... |
from pathlib import Path
def search_line(line):
parentheses, brackets=0,0
dots=[0]
for char in line:
if char=='[':
dots.append(0)
brackets+=1
elif char==']':
dots.pop()
brackets-=1
elif char=='(':
dots.append(0)
... | [
"pathlib.Path"
] | [((881, 891), 'pathlib.Path', 'Path', (['base'], {}), '(base)\n', (885, 891), False, 'from pathlib import Path\n')] |
from visionpy import Vision
from visionpy.exceptions import AddressNotFound
from pprint import pprint
client = Vision()
def check_balance(address):
try:
balance=client.get_account_balance(address)
return balance
except AddressNotFound:
return 'Adress not found..!'
pprint(check_balan... | [
"visionpy.Vision"
] | [((112, 120), 'visionpy.Vision', 'Vision', ([], {}), '()\n', (118, 120), False, 'from visionpy import Vision\n')] |
import os
import fileinput
import hashlib
import random
from ipython_genutils.py3compat import cast_bytes, str_to_bytes
# Get the password from the environment
password_environment_variable = os.environ.get('JUPYTER_PASSWORD')
# Hash the password, this is taken from https://github.com/jupyter/notebook/blob/master/not... | [
"fileinput.input",
"ipython_genutils.py3compat.cast_bytes",
"os.environ.get",
"hashlib.new",
"random.getrandbits",
"os.getenv",
"ipython_genutils.py3compat.str_to_bytes"
] | [((193, 227), 'os.environ.get', 'os.environ.get', (['"""JUPYTER_PASSWORD"""'], {}), "('JUPYTER_PASSWORD')\n", (207, 227), False, 'import os\n'), ((393, 415), 'hashlib.new', 'hashlib.new', (['algorithm'], {}), '(algorithm)\n', (404, 415), False, 'import hashlib\n'), ((1067, 1108), 'fileinput.input', 'fileinput.input', (... |
#!/usr/bin/env python
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2008-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.ec... | [
"sys.path.append",
"rmsd.superpose",
"optparse.OptionParser",
"xml.sax.make_parser"
] | [((1264, 1289), 'sys.path.append', 'sys.path.append', (['"""../lib"""'], {}), "('../lib')\n", (1279, 1289), False, 'import sys\n'), ((5564, 5578), 'optparse.OptionParser', 'OptionParser', ([], {}), '()\n', (5576, 5578), False, 'from optparse import OptionParser\n'), ((6616, 6629), 'xml.sax.make_parser', 'make_parser', ... |
from setuptools import setup, find_packages
# read the contents of your README file
from os import path
THISDIRECTORY = path.abspath(path.dirname(__file__))
with open(path.join(THISDIRECTORY, "README.md")) as f:
LONGDESC = f.read()
setup(
name="tehran-stocks",
version="0.7.1",
description="Data Down... | [
"os.path.dirname",
"os.path.join",
"setuptools.setup"
] | [((240, 859), 'setuptools.setup', 'setup', ([], {'name': '"""tehran-stocks"""', 'version': '"""0.7.1"""', 'description': '"""Data Downloader for Tehran stock market"""', 'url': '"""http://github.com/ghodsizdeh/tehran-stocks"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'license': '"""MIT"""', 'long_de... |
# Generated by Django 2.2.23 on 2021-06-22 16:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('search', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='synonym',
name='synonym',
... | [
"django.db.models.CharField"
] | [((327, 427), 'django.db.models.CharField', 'models.CharField', ([], {'help_text': '"""A comma-separated list of words that are synonyms"""', 'max_length': '(500)'}), "(help_text=\n 'A comma-separated list of words that are synonyms', max_length=500)\n", (343, 427), False, 'from django.db import migrations, models\n... |
# Copyright (c) 2019 StackHPC 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 wr... | [
"ansible.errors.AnsibleFilterError",
"re.compile"
] | [((698, 734), 're.compile', 're.compile', (['"""^(.*\\\\D(?=\\\\d))(\\\\d+)$"""'], {}), "('^(.*\\\\D(?=\\\\d))(\\\\d+)$')\n", (708, 734), False, 'import re\n'), ((944, 1037), 'ansible.errors.AnsibleFilterError', 'errors.AnsibleFilterError', (['("Inventory hostname \'%s\' not in hostvars" % inventory_hostname)'], {}), '... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import typing
from flask import render_template
from flask import url_for as flask_url_for
from . import wsgi, controller
__routes = {}
def add_route(path: str, ctrl: typing.Union[controller.Controller, typing.Type]):
"""
add router class to system
:para... | [
"flask.url_for",
"flask.render_template"
] | [((2129, 2168), 'flask.url_for', 'flask_url_for', (['__routes[ctrl]'], {}), '(__routes[ctrl], **kwargs)\n', (2142, 2168), True, 'from flask import url_for as flask_url_for\n'), ((890, 921), 'flask.render_template', 'render_template', (['view'], {}), '(view, **params)\n', (905, 921), False, 'from flask import render_tem... |
# Copyright 2021 <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 applicable law or agreed to in writing, softw... | [
"subprocess.check_output",
"re.match",
"pathlib.Path",
"re.findall",
"collections.OrderedDict",
"pccm.code",
"os.getenv"
] | [((2692, 2844), 'collections.OrderedDict', 'collections.OrderedDict', (["[('Maxwell', '5.2+PTX'), ('Pascal', '6.0;6.1+PTX'), ('Volta', '7.0+PTX'), (\n 'Turing', '7.5+PTX'), ('Ampere', '8.0;8.6+PTX')]"], {}), "([('Maxwell', '5.2+PTX'), ('Pascal', '6.0;6.1+PTX'),\n ('Volta', '7.0+PTX'), ('Turing', '7.5+PTX'), ('Amp... |
from django.db import models
from config.base_models import BaseAbstractModel, User
class Customer(BaseAbstractModel):
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name="customers")
name = models.CharField(max_length=255, blank=False)
email = models.EmailField(max_length=255, blank=Fa... | [
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.models.EmailField"
] | [((133, 208), 'django.db.models.ForeignKey', 'models.ForeignKey', (['User'], {'on_delete': 'models.CASCADE', 'related_name': '"""customers"""'}), "(User, on_delete=models.CASCADE, related_name='customers')\n", (150, 208), False, 'from django.db import models\n'), ((220, 265), 'django.db.models.CharField', 'models.CharF... |
# add Horizontal Tail files to DATCOM #
import csv
with open('HT.csv') as f:
reader = csv.reader(f)
for row in reader:
a = row
# Chord Tip
CHRDTP = round(float(a[0]), 4)
# Chord Root
CHRDR = round(float(a[1]), 4)
# Semi Span (Exposed)
SSPNE = round(float(a[2]), 4)
# Semi Span (Theoretical)
SSPN = round(... | [
"csv.reader"
] | [((90, 103), 'csv.reader', 'csv.reader', (['f'], {}), '(f)\n', (100, 103), False, 'import csv\n')] |
from typing import List, TypeVar, Dict
import mmd_scripting.core.nuthouse01_core as core
import mmd_scripting.core.nuthouse01_vmd_struct as vmdstruct
_SCRIPT_VERSION = "Script version: Nuthouse01 - v1.07.04 - 8/19/2021"
################################################################################
# this file def... | [
"mmd_scripting.core.nuthouse01_core.quaternion_to_euler",
"mmd_scripting.core.nuthouse01_core.linear_map",
"mmd_scripting.core.nuthouse01_core.my_slerp",
"mmd_scripting.core.nuthouse01_core.MyBezier",
"mmd_scripting.core.nuthouse01_core.MY_PRINT_FUNC",
"mmd_scripting.core.nuthouse01_vmd_struct.VmdBoneFram... | [((406, 494), 'typing.TypeVar', 'TypeVar', (['"""BONEFRAME_OR_MORPHFRAME"""', 'vmdstruct.VmdBoneFrame', 'vmdstruct.VmdMorphFrame'], {}), "('BONEFRAME_OR_MORPHFRAME', vmdstruct.VmdBoneFrame, vmdstruct.\n VmdMorphFrame)\n", (413, 494), False, 'from typing import List, TypeVar, Dict\n'), ((1369, 1482), 'mmd_scripting.c... |
"""
General Curate
==============
Tasks for curating and merging MySQL data, and then piping to unified table.
"""
from nesta.core.luigihacks.luigi_logging import set_log_level
from nesta.core.luigihacks.sql2batchtask import Sql2BatchTask
from nesta.core.luigihacks.misctools import find_filepath_from_pathstub as f3p
... | [
"nesta.core.orms.orm_utils.get_class_by_tablename",
"sqlalchemy.sql.text",
"nesta.core.luigihacks.misctools.find_filepath_from_pathstub",
"pathlib.Path",
"luigi.BoolParameter",
"yaml.safe_load",
"nesta.core.luigihacks.mysqldb.make_mysql_target",
"functools.lru_cache",
"datetime.datetime.now",
"lui... | [((940, 951), 'functools.lru_cache', 'lru_cache', ([], {}), '()\n', (949, 951), False, 'from functools import lru_cache\n'), ((2419, 2451), 'luigi.IntParameter', 'luigi.IntParameter', ([], {'default': '(1000)'}), '(default=1000)\n', (2437, 2451), False, 'import luigi\n'), ((2469, 2503), 'luigi.BoolParameter', 'luigi.Bo... |
"""Base class for apps (actions)."""
import logging
from copy import deepcopy
from typing import List
from typing import Pattern
from typing import Tuple
from typing import Union
from ansible_navigator.actions import kegexes
from .app_public import AppPublic
from .configuration_subsystem import ApplicationConfigurati... | [
"ansible_navigator.actions.kegexes",
"copy.deepcopy",
"logging.getLogger"
] | [((1086, 1116), 'logging.getLogger', 'logging.getLogger', (['logger_name'], {}), '(logger_name)\n', (1103, 1116), False, 'import logging\n'), ((1751, 1760), 'ansible_navigator.actions.kegexes', 'kegexes', ([], {}), '()\n', (1758, 1760), False, 'from ansible_navigator.actions import kegexes\n'), ((3939, 3953), 'copy.dee... |
if __name__ == "__main__":
print("This is a bokeh script, and isn't run like that! From the directory containing GP_pointClick/ you need to run:")
print("bokeh serve --show GP_pointClick")
else:
import matplotlib.pyplot as plt
import numpy as np
import george as g
bound = 10
yerr = 0.... | [
"bokeh.models.widgets.Dropdown",
"george.kernels.ExpKernel",
"numpy.mean",
"george.kernels.ConstantKernel",
"bokeh.models.widgets.markups.Div",
"numpy.zeros_like",
"george.kernels.Matern52Kernel",
"bokeh.io.curdoc",
"george.kernels.Matern32Kernel",
"numpy.linspace",
"george.kernels.RationalQuadr... | [((961, 1095), 'bokeh.plotting.figure', 'figure', ([], {'title': '"""Double click to leave a dot"""', 'tools': 'TOOLS', 'width': '(900)', 'height': '(600)', 'x_range': '(-bound, bound)', 'y_range': '(-bound, bound)'}), "(title='Double click to leave a dot', tools=TOOLS, width=900, height=\n 600, x_range=(-bound, bou... |
# -*- coding: UTF-8 -*-
from __future__ import unicode_literals
import attr
from ._attachment import Attachment
@attr.s(cmp=False)
class LocationAttachment(Attachment):
"""Represents a user location
Latitude and longitude OR address is provided by Facebook
"""
#: Latitude of the location
latitu... | [
"attr.s",
"attr.ib"
] | [((116, 133), 'attr.s', 'attr.s', ([], {'cmp': '(False)'}), '(cmp=False)\n', (122, 133), False, 'import attr\n'), ((891, 920), 'attr.s', 'attr.s', ([], {'cmp': '(False)', 'init': '(False)'}), '(cmp=False, init=False)\n', (897, 920), False, 'import attr\n'), ((325, 338), 'attr.ib', 'attr.ib', (['None'], {}), '(None)\n',... |
from __future__ import division
import logging
import math
import re
""" Program to Calculate the calculation result for given Reverse Polish Notation(RPN) Expression """
class RPN_Calculator(object):
""" Calculate result for given RPN expression """
REMAINING_CHECK = re.compile(r' ')
OPERATORS = r'\+\-... | [
"logging.error",
"re.sub",
"logging.basicConfig",
"re.compile"
] | [((281, 296), 're.compile', 're.compile', (['""" """'], {}), "(' ')\n", (291, 296), False, 'import re\n'), ((361, 395), 're.compile', 're.compile', (['"""(\\\\d+|\\\\d+\\\\.\\\\d+) !"""'], {}), "('(\\\\d+|\\\\d+\\\\.\\\\d+) !')\n", (371, 395), False, 'import re\n'), ((426, 500), 're.compile', 're.compile', (["('(\\\\d+... |
import os
import tarfile
from PIL import Image
from tqdm import tqdm
import urllib.request
import sys
import torch
from torch.utils.data import Dataset
from torchvision import transforms as T
import shutil
import backbone as bb
URL = 'https://www.mydrive.ch/shares/38536/3830184030e49fe74747669442f0f282/download/420938... | [
"os.remove",
"backbone.myPrint",
"os.makedirs",
"tarfile.open",
"shutil.rmtree",
"os.path.isdir",
"os.path.basename",
"os.path.exists",
"PIL.Image.open",
"torchvision.transforms.ToTensor",
"torch.zeros",
"torchvision.transforms.CenterCrop",
"torchvision.transforms.Normalize",
"os.path.join... | [((2472, 2527), 'os.path.join', 'os.path.join', (['self.dataset_path', 'self.class_name', 'phase'], {}), '(self.dataset_path, self.class_name, phase)\n', (2484, 2527), False, 'import os\n'), ((2545, 2609), 'os.path.join', 'os.path.join', (['self.dataset_path', 'self.class_name', '"""ground_truth"""'], {}), "(self.datas... |
import attr
import typing
@attr.s
class District:
name: str = attr.ib()
chamber_type: str = attr.ib()
division_id: typing.Optional[str] = attr.ib()
num_seats: int = attr.ib(default=1)
title_override: typing.Optional[str] = attr.ib(default=None)
@attr.s(auto_attribs=True)
class Chamber:
chamb... | [
"attr.s",
"attr.ib",
"typing.cast"
] | [((270, 295), 'attr.s', 'attr.s', ([], {'auto_attribs': '(True)'}), '(auto_attribs=True)\n', (276, 295), False, 'import attr\n'), ((830, 855), 'attr.s', 'attr.s', ([], {'auto_attribs': '(True)'}), '(auto_attribs=True)\n', (836, 855), False, 'import attr\n'), ((68, 77), 'attr.ib', 'attr.ib', ([], {}), '()\n', (75, 77), ... |
import os
from dataclasses import dataclass
from typing import Tuple, List, Optional, Type, Any
import numpy as np
import torch
from src.huggingmolecules.configuration.configuration_api import PretrainedConfigMixin
from src.huggingmolecules.featurization.featurization_api import PretrainedFeaturizerMixin, RecursiveTo... | [
"numpy.zeros_like",
"torch.zeros_like",
"numpy.logical_not",
"numpy.hstack",
"molbert.apps.finetune.FinetuneSmilesMolbertApp",
"numpy.array",
"molbert.utils.featurizer.molfeaturizer.SmilesIndexFeaturizer.bert_smiles_index_featurizer",
"torch.tensor",
"numpy.vstack"
] | [((1609, 1676), 'molbert.utils.featurizer.molfeaturizer.SmilesIndexFeaturizer.bert_smiles_index_featurizer', 'SmilesIndexFeaturizer.bert_smiles_index_featurizer', (['config.max_size'], {}), '(config.max_size)\n', (1659, 1676), False, 'from molbert.utils.featurizer.molfeaturizer import SmilesIndexFeaturizer\n'), ((1857,... |
from src.db.database_logic_objects import TravelDbBackgroundProcess, WeatherDbBackgroundProcess
from time import sleep
def db_travel_daemon(db_path):
print('starting travel db daemon')
database = TravelDbBackgroundProcess(db_path)
while True:
database.update_resorts_check()
sleep(2)
def ... | [
"src.db.database_logic_objects.WeatherDbBackgroundProcess",
"src.db.database_logic_objects.TravelDbBackgroundProcess",
"time.sleep"
] | [((206, 240), 'src.db.database_logic_objects.TravelDbBackgroundProcess', 'TravelDbBackgroundProcess', (['db_path'], {}), '(db_path)\n', (231, 240), False, 'from src.db.database_logic_objects import TravelDbBackgroundProcess, WeatherDbBackgroundProcess\n'), ((403, 438), 'src.db.database_logic_objects.WeatherDbBackground... |
import pytest
def test_delete_rule(setup, monkeypatch, create_one_ruleset_one_rule, rulesengine_db, library_db, create_one_scene,current_scene_db, query_start, query_end):
from src.praxxis.rulesengine import delete_rule_from_ruleset
from src.praxxis.sqlite import sqlite_rulesengine
from tests.src.praxxis.r... | [
"tests.src.praxxis.util.dummy_object.make_dummy_ruleset",
"src.praxxis.display.display_error.rule_not_found_error",
"src.praxxis.rulesengine.delete_rule_from_ruleset.delete_rule_from_ruleset",
"src.praxxis.sqlite.sqlite_rulesengine.list_rules_in_ruleset",
"src.praxxis.sqlite.sqlite_rulesengine.get_filenames... | [((417, 479), 'tests.src.praxxis.util.dummy_object.make_dummy_ruleset', 'dummy_object.make_dummy_ruleset', (['"""generated_ruleset_with_rule"""'], {}), "('generated_ruleset_with_rule')\n", (448, 479), False, 'from tests.src.praxxis.util import dummy_object\n'), ((499, 562), 'src.praxxis.sqlite.sqlite_rulesengine.get_ru... |
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ##... | [
"logging.getLogger"
] | [((644, 717), 'logging.getLogger', 'logging.getLogger', (['"""datalad.metadata.extractors.metalad_external_dataset"""'], {}), "('datalad.metadata.extractors.metalad_external_dataset')\n", (661, 717), False, 'import logging\n')] |
#!/usr/bin/env python3
import unittest
from os import sys, path
def run(modules=None):
"""
Runs out test suite.
Accepts module name arguments for specific testing.
"""
loader = unittest.TestLoader()
if modules:
test_modules = ['tests.test_' + x for x in modules]
test_suite =... | [
"os.path.abspath",
"unittest.TestLoader",
"unittest.runner.TextTestRunner"
] | [((201, 222), 'unittest.TestLoader', 'unittest.TestLoader', ([], {}), '()\n', (220, 222), False, 'import unittest\n'), ((455, 498), 'unittest.runner.TextTestRunner', 'unittest.runner.TextTestRunner', ([], {'verbosity': '(1)'}), '(verbosity=1)\n', (485, 498), False, 'import unittest\n'), ((683, 705), 'os.path.abspath', ... |
from flask import Flask
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
from flask_sqlalchemy import SQLAlchemy
from flask_ckeditor import CKEditor
from flask_login import LoginManager, current_user
from flask_bcrypt import Bcrypt
from config import Config
app = Flask(__name__, temp... | [
"flask_script.Manager",
"flask.Flask",
"flask_bcrypt.Bcrypt",
"flask_sqlalchemy.SQLAlchemy",
"flask_migrate.Migrate",
"flask_ckeditor.CKEditor",
"flask_login.LoginManager"
] | [((300, 344), 'flask.Flask', 'Flask', (['__name__'], {'template_folder': '"""templates"""'}), "(__name__, template_folder='templates')\n", (305, 344), False, 'from flask import Flask\n'), ((381, 396), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', (['app'], {}), '(app)\n', (391, 396), False, 'from flask_sqlalchemy import... |
from typing import Dict
import cftime
import numpy as np
import xarray as xr
from nexusproto import DataTile_pb2 as nexusproto
from nexusproto.serialization import to_shaped_array
from granule_ingester.processors.reading_processors.TileReadingProcessor import TileReadingProcessor
class GridReadingProcessor(TileRead... | [
"nexusproto.DataTile_pb2.GridTile",
"numpy.squeeze",
"nexusproto.serialization.to_shaped_array"
] | [((925, 946), 'nexusproto.DataTile_pb2.GridTile', 'nexusproto.GridTile', ([], {}), '()\n', (944, 946), True, 'from nexusproto import DataTile_pb2 as nexusproto\n'), ((1210, 1232), 'numpy.squeeze', 'np.squeeze', (['lat_subset'], {}), '(lat_subset)\n', (1220, 1232), True, 'import numpy as np\n'), ((1276, 1298), 'numpy.sq... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.