code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""retina_resnet50"""
import keras
from perceptron.zoo.retinanet_resnet_50 import models
import tensorflow as tf
def Retina_Resnet50(weights_file="resnet50_coco_best_v2.1.0.h5"):
from perceptron.utils.func import maybe_download_model_data
keras.backend.tensorflow_backend.set_session(get_session())
... | [
"perceptron.zoo.retinanet_resnet_50.models.load_model",
"tensorflow.ConfigProto",
"tensorflow.Session",
"perceptron.utils.func.maybe_download_model_data"
] | [((337, 485), 'perceptron.utils.func.maybe_download_model_data', 'maybe_download_model_data', (['weights_file', '"""https://perceptron-benchmark.s3-us-west-1.amazonaws.com/models/coco/resnet50_coco_best_v2.1.0.h5"""'], {}), "(weights_file,\n 'https://perceptron-benchmark.s3-us-west-1.amazonaws.com/models/coco/resnet... |
from datetime import datetime
from time import localtime
from time import sleep
from win10toast import ToastNotifier
import kthread
import os
from tkinter import *
import sys
toaster = ToastNotifier()
class Terminkalender:
def __init__(self):
self.dead = False
self.text_auf_editbutton = "Edit"
... | [
"kthread.KThread",
"os.popen",
"time.sleep",
"datetime.datetime",
"time.localtime",
"win10toast.ToastNotifier",
"sys.exit"
] | [((185, 200), 'win10toast.ToastNotifier', 'ToastNotifier', ([], {}), '()\n', (198, 200), False, 'from win10toast import ToastNotifier\n'), ((860, 921), 'kthread.KThread', 'kthread.KThread', ([], {'target': 'self.check_dates_inf', 'name': '"""checkinf"""'}), "(target=self.check_dates_inf, name='checkinf')\n", (875, 921)... |
from main import app as application
from api.utils.database import db
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
migrate = Migrate(application, db)
manager = Manager(application)
manager.add_command('db', MigrateCommand)
if __name__ == '__main__':
# python manage.py db in... | [
"flask_script.Manager",
"flask_migrate.Migrate"
] | [((164, 188), 'flask_migrate.Migrate', 'Migrate', (['application', 'db'], {}), '(application, db)\n', (171, 188), False, 'from flask_migrate import Migrate, MigrateCommand\n'), ((200, 220), 'flask_script.Manager', 'Manager', (['application'], {}), '(application)\n', (207, 220), False, 'from flask_script import Manager\... |
import numpy as np
import argparse
from maci.learners import MAVBAC, MASQL, ROMMEO
from maci.misc.sampler import MASampler
from maci.environments import PBeautyGame, MatrixGame, DifferentialGame
from maci.environments import make_particle_env
from maci.misc import logger
import gtimer as gt
import datetime
from copy i... | [
"argparse.ArgumentParser",
"tensorflow.ConfigProto",
"keras.backend.tensorflow_backend.set_session",
"maci.misc.logger.set_snapshot_dir",
"maci.misc.tf_utils.single_threaded_session",
"gtimer.set_def_unique",
"gtimer.rename_root",
"gtimer.stamp",
"gtimer.reset",
"datetime.datetime.now",
"maci.en... | [((544, 560), 'tensorflow.ConfigProto', 'tf.ConfigProto', ([], {}), '()\n', (558, 560), True, 'import tensorflow as tf\n'), ((654, 679), 'tensorflow.Session', 'tf.Session', ([], {'config': 'config'}), '(config=config)\n', (664, 679), True, 'import tensorflow as tf\n'), ((680, 697), 'keras.backend.tensorflow_backend.set... |
to_import = ['mlmodels.modelutils',
'mlmodels.search.bayesian',
'mlmodels.search.hparameters.lgbm_params']
import logging
logger = logging.getLogger()
from os.path import dirname, abspath, split
project_name = split(dirname(abspath(__file__)))[1]
logger.info(f'{__file__} module: project dire... | [
"pandas.DataFrame",
"os.path.abspath",
"lightgbm.LGBMClassifier",
"importlib.import_module",
"numpy.argmax",
"scipy.sparse.issparse",
"sklearn.metrics.accuracy_score",
"shap.TreeExplainer",
"numpy.mean",
"numpy.array",
"lightgbm.LGBMRegressor",
"shap.summary_plot",
"pandas.concat",
"loggin... | [((158, 177), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (175, 177), False, 'import logging\n'), ((455, 519), 'importlib.import_module', 'importlib.import_module', ([], {'name': 'f""".{module}"""', 'package': 'project_name'}), "(name=f'.{module}', package=project_name)\n", (478, 519), False, 'import im... |
from django.forms import RadioSelect
from .base import WidgetTest
class RadioSelectTest(WidgetTest):
widget = RadioSelect
def test_render(self):
self.check_html(self.widget(choices=self.beatles), 'beatle', 'J', html=(
"""<ul>
<li><label><input checked type="radio" name="beatl... | [
"django.forms.RadioSelect"
] | [((2063, 2117), 'django.forms.RadioSelect', 'RadioSelect', ([], {'attrs': "{'id': 'foo'}", 'choices': 'self.beatles'}), "(attrs={'id': 'foo'}, choices=self.beatles)\n", (2074, 2117), False, 'from django.forms import RadioSelect\n')] |
from http import HTTPStatus
from typing import List
from fastapi import APIRouter, Depends, Query, Request
from fastapi.concurrency import run_in_threadpool
from sqlalchemy.orm import Session
import mlrun.api.crud
import mlrun.api.utils.auth.verifier
import mlrun.api.utils.singletons.project_member
from mlrun.api imp... | [
"mlrun.api.api.utils.log_and_raise",
"mlrun.api.utils.singletons.db.get_db",
"fastapi.Query",
"mlrun.utils.is_legacy_artifact",
"fastapi.Depends",
"fastapi.APIRouter",
"mlrun.utils.logger.debug"
] | [((606, 617), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (615, 617), False, 'from fastapi import APIRouter, Depends, Query, Request\n'), ((849, 883), 'fastapi.Depends', 'Depends', (['deps.authenticate_request'], {}), '(deps.authenticate_request)\n', (856, 883), False, 'from fastapi import APIRouter, Depends, Q... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
from pedal_settings import views
from django.utils.translation import ugettext_lazy as _
handler404 = views.error404
handler500 = views.error500
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'harp.views.dashboard', na... | [
"django.utils.translation.ugettext_lazy",
"django.conf.urls.include",
"django.conf.urls.url"
] | [((385, 419), 'django.conf.urls.url', 'url', (['"""^$"""', 'views.home'], {'name': '"""home"""'}), "('^$', views.home, name='home')\n", (388, 419), False, 'from django.conf.urls import patterns, include, url\n'), ((626, 718), 'django.conf.urls.url', 'url', (['"""^dashboard/download/$"""', 'views.download_all_settings']... |
import os
import tempfile
import unittest
from dango import config
from dango import utils
import ruamel.yaml
SAMPLE_CONFIG = """
a:
stuff: 1
unicode: ( ͡° ͜ʖ ͡°)
"""
SAMPLE_COMMENTED_CONFIG="""
# Header comment
a: 1
b:
- one
- two # Comment
# commented: 123
unicode: ( ͡° ͜ʖ ͡°)
"""[1:]
class ConfigTest(unitt... | [
"os.remove",
"dango.utils.snakify",
"dango.config.register",
"dango.config.FileConfiguration",
"tempfile.mktemp",
"dango.config.StringConfiguration"
] | [((375, 416), 'dango.config.StringConfiguration', 'config.StringConfiguration', (['SAMPLE_CONFIG'], {}), '(SAMPLE_CONFIG)\n', (401, 416), False, 'from dango import config\n'), ((577, 618), 'dango.config.StringConfiguration', 'config.StringConfiguration', (['SAMPLE_CONFIG'], {}), '(SAMPLE_CONFIG)\n', (603, 618), False, ... |
from easydict import EasyDict as edict
import gflags
import tabulate
gflags.DEFINE_string('assets_dir', '', '')
gflags.DEFINE_string('dataset_dir', '', '')
gflags.DEFINE_string('maps', '', 'Comma separated map names')
gflags.DEFINE_string('model_spec', '', '')
gflags.DEFINE_string('model_file', '', '')
gflags.DEFINE_... | [
"gflags.DEFINE_string",
"gflags.DEFINE_boolean",
"gflags.DEFINE_float",
"easydict.EasyDict",
"gflags.DEFINE_integer"
] | [((71, 113), 'gflags.DEFINE_string', 'gflags.DEFINE_string', (['"""assets_dir"""', '""""""', '""""""'], {}), "('assets_dir', '', '')\n", (91, 113), False, 'import gflags\n'), ((114, 157), 'gflags.DEFINE_string', 'gflags.DEFINE_string', (['"""dataset_dir"""', '""""""', '""""""'], {}), "('dataset_dir', '', '')\n", (134, ... |
import argparse
import sys
sys.path.insert(0, '../../../../common/')
import PipelineImporter as PipelineImporter
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--continent', help='Continent of the file')
parser.add_argument('--country', help='Country of the file')
... | [
"PipelineImporter.start",
"sys.path.insert",
"argparse.ArgumentParser"
] | [((28, 69), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../../../../common/"""'], {}), "(0, '../../../../common/')\n", (43, 69), False, 'import sys\n'), ((156, 181), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (179, 181), False, 'import argparse\n'), ((431, 459), 'PipelineImporter.sta... |
from sympy import legendre, Symbol, hermite, chebyshevu, chebyshevt, \
chebyshevt_root, chebyshevu_root, assoc_legendre, Rational, \
roots, sympify, S
x = Symbol('x')
def test_legendre():
assert legendre(0, x) == 1
assert legendre(1, x) == x
assert legendre(2, x) == ((3*x**2-1)/2).expand(... | [
"sympy.Symbol",
"sympy.Rational",
"sympy.chebyshevu_root",
"sympy.hermite",
"sympy.legendre",
"sympy.chebyshevu",
"sympy.chebyshevt",
"sympy.chebyshevt_root"
] | [((173, 184), 'sympy.Symbol', 'Symbol', (['"""x"""'], {}), "('x')\n", (179, 184), False, 'from sympy import legendre, Symbol, hermite, chebyshevu, chebyshevt, chebyshevt_root, chebyshevu_root, assoc_legendre, Rational, roots, sympify, S\n'), ((218, 232), 'sympy.legendre', 'legendre', (['(0)', 'x'], {}), '(0, x)\n', (22... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_commandline
----------------------------------
Tests for `orpheum` module.
"""
from click.testing import CliRunner
def test_cli():
from orpheum.commandline import cli
runner = CliRunner()
result = runner.invoke(cli)
assert result.exit_code == ... | [
"click.testing.CliRunner"
] | [((244, 255), 'click.testing.CliRunner', 'CliRunner', ([], {}), '()\n', (253, 255), False, 'from click.testing import CliRunner\n'), ((405, 416), 'click.testing.CliRunner', 'CliRunner', ([], {}), '()\n', (414, 416), False, 'from click.testing import CliRunner\n'), ((573, 584), 'click.testing.CliRunner', 'CliRunner', ([... |
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 16 13:12:07 2021
@author: <NAME>
"""
import warnings
warnings.filterwarnings("ignore")
import time
import unittest
import numpy as np
from smoot.smoot import MOO
from smoot.zdt import ZDT
from smt.sampling_methods import LHS
from smt.problems import Branin
from smt.ut... | [
"unittest.main",
"warnings.filterwarnings",
"pymoo.factory.get_performance_indicator",
"smt.problems.Branin",
"numpy.allclose",
"smoot.zdt.ZDT",
"time.time",
"smt.sampling_methods.LHS",
"smoot.smoot.MOO"
] | [((102, 135), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (125, 135), False, 'import warnings\n'), ((2946, 2961), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2959, 2961), False, 'import unittest\n'), ((498, 506), 'smt.problems.Branin', 'Branin', ([], {}), '()\n... |
# Copyright 2020 QuantumBlack Visual Analytics Limited
#
# 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
#
# THE SOFTWARE IS PROVIDED "AS IS", WIT... | [
"pandas.DataFrame",
"pandas.util.testing.assert_frame_equal",
"kedro.io.core.generate_timestamp",
"pytest.warns",
"pytest.fixture",
"kedro.contrib.io.gcs.csv_gcs.CSVGCSDataSet",
"pytest.raises",
"kedro.io.Version",
"pytest.mark.parametrize",
"pytest.mark.usefixtures"
] | [((2232, 2261), 'pytest.fixture', 'pytest.fixture', ([], {'params': '[None]'}), '(params=[None])\n', (2246, 2261), False, 'import pytest\n'), ((2314, 2355), 'pytest.fixture', 'pytest.fixture', ([], {'params': "[{'index': False}]"}), "(params=[{'index': False}])\n", (2328, 2355), False, 'import pytest\n'), ((2408, 2437)... |
import alert
import configparser
from datetime import datetime, timedelta
import getopt
import sys
import time
def wait(minutes):
seconds = minutes * 60
time.sleep(seconds)
# Produces from string the longest substring
# that starts at index and is an integer
def get_contiguous_number(string, index):
leng... | [
"getopt.getopt",
"alert.send_email",
"time.strftime",
"time.sleep",
"alert.notify_desktop",
"datetime.timedelta",
"configparser.ConfigParser",
"datetime.datetime.now",
"sys.exit"
] | [((162, 181), 'time.sleep', 'time.sleep', (['seconds'], {}), '(seconds)\n', (172, 181), False, 'import time\n'), ((2608, 2650), 'getopt.getopt', 'getopt.getopt', (['args', 'options', 'long_options'], {}), '(args, options, long_options)\n', (2621, 2650), False, 'import getopt\n'), ((3204, 3214), 'sys.exit', 'sys.exit', ... |
# Copyright (C) 2017 Nippon Telegraph and Telephone Corporation.
#
# 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 ... | [
"inspect.isclass",
"ryu.utils.import_module",
"ryu.lib.packet.zebra.__dict__.values",
"logging.getLogger"
] | [((811, 838), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (828, 838), False, 'import logging\n'), ((846, 875), 'ryu.utils.import_module', 'utils.import_module', (['__name__'], {}), '(__name__)\n', (865, 875), False, 'from ryu import utils\n'), ((3266, 3289), 'ryu.lib.packet.zebra.__dic... |
import sys
sys.path.append("..")
from utils.api import Api
from utils.db import Database
from datetime import datetime
from utils.db_query import insert_news_query, news_query
class News:
def __init__(self, profile):
self.profile = profile
self.api = Api
@staticmethod
def _normalize(_news... | [
"sys.path.append",
"utils.db.Database"
] | [((11, 32), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (26, 32), False, 'import sys\n'), ((2008, 2030), 'utils.db.Database', 'Database', (['self.profile'], {}), '(self.profile)\n', (2016, 2030), False, 'from utils.db import Database\n'), ((1601, 1623), 'utils.db.Database', 'Database', (['self... |
# Copyright 2018 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... | [
"unittest.main",
"textwrap.dedent",
"yaml.load",
"copy.deepcopy",
"spectator_metric_transformer.SpectatorMetricTransformer",
"spectator_metric_transformer.TransformationRule",
"spectator_metric_transformer.AggregatedMetricsBuilder"
] | [((29579, 29594), 'unittest.main', 'unittest.main', ([], {}), '()\n', (29592, 29594), False, 'import unittest\n'), ((1894, 1933), 'spectator_metric_transformer.SpectatorMetricTransformer', 'SpectatorMetricTransformer', (['options', '{}'], {}), '(options, {})\n', (1920, 1933), False, 'from spectator_metric_transformer i... |
from datetime import datetime, timedelta
from mock import patch
from django import forms
from django.test import TestCase
from corehq.apps.domain.models import Domain
from corehq.apps.sso.forms import (
CreateIdentityProviderForm,
EditIdentityProviderAdminForm,
SSOEnterpriseSettingsForm,
TIME_FORMAT,
... | [
"corehq.apps.sso.models.AuthenticatedEmailDomain.objects.create",
"corehq.apps.sso.models.IdentityProvider.objects.get",
"corehq.apps.sso.models.UserExemptFromSingleSignOn.objects.create",
"corehq.apps.sso.forms.EditIdentityProviderAdminForm",
"corehq.apps.sso.models.AuthenticatedEmailDomain.objects.all",
... | [((2932, 3011), 'mock.patch', 'patch', (['"""corehq.apps.sso.utils.url_helpers.get_dashboard_link"""'], {'return_value': '"""#"""'}), "('corehq.apps.sso.utils.url_helpers.get_dashboard_link', return_value='#')\n", (2937, 3011), False, 'from mock import patch\n'), ((663, 702), 'corehq.apps.sso.tests.generator.get_billin... |
# -*- coding: utf-8 -*-
# Command line arguments
import argparse
from urllib.parse import parse_qs
from http.cookies import SimpleCookie
from MatchX.utils.user_agents import headers
parser = argparse.ArgumentParser()
parser.add_argument('-u', '--url', help='Target URL.')
parser.add_argument('-l', '--list', help='Lis... | [
"http.cookies.SimpleCookie",
"argparse.ArgumentParser",
"urllib.parse.parse_qs"
] | [((194, 219), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (217, 219), False, 'import argparse\n'), ((2303, 2338), 'urllib.parse.parse_qs', 'parse_qs', (['data'], {'strict_parsing': '(True)'}), '(data, strict_parsing=True)\n', (2311, 2338), False, 'from urllib.parse import parse_qs\n'), ((251... |
import sys
import functools
import contextlib
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
try:
import unittest2 as unittest
except ImportError:
import unittest
try:
from unittest import mock
except ImportError:
import mock
try:
import pymysql
pymys... | [
"io.StringIO",
"sys.stdout.seek",
"unittest.SkipTest",
"sys.stdout.read",
"sys.stderr.read",
"architect.commands.main",
"pymysql.install_as_MySQLdb",
"sys.stderr.seek",
"functools.wraps"
] | [((315, 343), 'pymysql.install_as_MySQLdb', 'pymysql.install_as_MySQLdb', ([], {}), '()\n', (341, 343), False, 'import pymysql\n'), ((606, 624), 'sys.stderr.seek', 'sys.stderr.seek', (['(0)'], {}), '(0)\n', (621, 624), False, 'import sys\n'), ((629, 647), 'sys.stdout.seek', 'sys.stdout.seek', (['(0)'], {}), '(0)\n', (6... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from tqdm.auto import tqdm
from typing import Dict, Any
class Conv2dBlock(nn.Module):
norm_map = {
"none": nn.Identity,
"batch": nn.BatchNorm2d,
"instance": nn.InstanceNorm2d,
}
activation_map = {
"none": ... | [
"torch.randint",
"torch.nn.ConvTranspose2d",
"torch.rand",
"torch.nn.ModuleList",
"torch.argmax",
"torch.nn.Conv2d",
"torch.nn.CrossEntropyLoss",
"torch.cat",
"torch.nn.Upsample",
"torch.device",
"torch.nn.MaxPool2d",
"torch.nn.functional.pad"
] | [((6894, 6913), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "('cpu')\n", (6906, 6913), False, 'import torch\n'), ((6999, 7020), 'torch.nn.CrossEntropyLoss', 'nn.CrossEntropyLoss', ([], {}), '()\n', (7018, 7020), True, 'import torch.nn as nn\n'), ((650, 711), 'torch.nn.Conv2d', 'nn.Conv2d', (['in_channels', 'ou... |
"""Unit tests for the affine connections."""
import warnings
import geomstats.backend as gs
import geomstats.tests
from geomstats.geometry.connection import Connection
from geomstats.geometry.euclidean import EuclideanMetric
from geomstats.geometry.hypersphere import Hypersphere
class TestConnectionMethods(geomstat... | [
"geomstats.geometry.hypersphere.Hypersphere",
"geomstats.backend.random.rand",
"geomstats.backend.array",
"warnings.simplefilter",
"geomstats.geometry.connection.Connection",
"geomstats.geometry.euclidean.EuclideanMetric",
"geomstats.backend.eye",
"geomstats.backend.zeros"
] | [((368, 421), 'warnings.simplefilter', 'warnings.simplefilter', (['"""ignore"""'], {'category': 'UserWarning'}), "('ignore', category=UserWarning)\n", (389, 421), False, 'import warnings\n'), ((476, 517), 'geomstats.geometry.euclidean.EuclideanMetric', 'EuclideanMetric', ([], {'dimension': 'self.dimension'}), '(dimensi... |
"""Utilities for dealing with the ADO REST API."""
import logging
import requests
from simple_ado.exceptions import ADOHTTPException
def boolstr(value: bool) -> str:
"""Return a boolean formatted as string for ADO calls
:param value: The value to format
:returns: A string representation of the boolea... | [
"simple_ado.exceptions.ADOHTTPException"
] | [((971, 1021), 'simple_ado.exceptions.ADOHTTPException', 'ADOHTTPException', (['"""Failed to fetch file"""', 'response'], {}), "('Failed to fetch file', response)\n", (987, 1021), False, 'from simple_ado.exceptions import ADOHTTPException\n')] |
from pymyorm.database import Database
from config import db
from models.user import User
if __name__ == '__main__':
Database.connect(**db)
names = User.find().order('id asc').offset(1).limit(2).column('name')
print(names)
| [
"models.user.User.find",
"pymyorm.database.Database.connect"
] | [((123, 145), 'pymyorm.database.Database.connect', 'Database.connect', ([], {}), '(**db)\n', (139, 145), False, 'from pymyorm.database import Database\n'), ((159, 170), 'models.user.User.find', 'User.find', ([], {}), '()\n', (168, 170), False, 'from models.user import User\n')] |
import pytest
import doctest
from insights.parsers import SkipException, tuned
from insights.parsers.tuned import Tuned
from insights.tests import context_wrap
TUNED_OUTPUT = '''
Available profiles:
- balanced
- desktop
- latency-performance
- network-latency
- network-throughput
- powersave
- throughput-performance
... | [
"insights.tests.context_wrap",
"pytest.raises",
"doctest.testmod"
] | [((3927, 3960), 'doctest.testmod', 'doctest.testmod', (['tuned'], {'globs': 'env'}), '(tuned, globs=env)\n', (3942, 3960), False, 'import doctest\n'), ((1928, 1954), 'insights.tests.context_wrap', 'context_wrap', (['TUNED_OUTPUT'], {}), '(TUNED_OUTPUT)\n', (1940, 1954), False, 'from insights.tests import context_wrap\n... |
import copy
import random
import smmp
import numpy as np
from math import *
from universe1 import *
from protein1 import *
from mergesort import *
from sklearn import preprocessing
phi = np.concatenate((np.random.uniform(-80,-50,10),np.random.uniform(-160,-120,10)))
psi = np.concatenate((np.random.uniform(-50,-20,10)... | [
"smmp.outpdb",
"numpy.random.uniform",
"copy.deepcopy",
"numpy.sum",
"numpy.zeros",
"numpy.searchsorted",
"random.random",
"numpy.random.randint",
"numpy.random.random",
"numpy.array",
"numpy.concatenate"
] | [((8489, 8516), 'smmp.outpdb', 'smmp.outpdb', (['(0)', '"""final.pdb"""'], {}), "(0, 'final.pdb')\n", (8500, 8516), False, 'import smmp\n'), ((204, 235), 'numpy.random.uniform', 'np.random.uniform', (['(-80)', '(-50)', '(10)'], {}), '(-80, -50, 10)\n', (221, 235), True, 'import numpy as np\n'), ((234, 267), 'numpy.rand... |
# Importing the Keras libraries and packages
import numpy as np
import keras
import tensorflow as tf
from keras.models import load_model
from IPython.display import display
from PIL import Image
from keras.preprocessing import image
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Seque... | [
"keras.models.load_model",
"keras.preprocessing.image.ImageDataGenerator",
"numpy.expand_dims",
"keras.preprocessing.image.img_to_array",
"keras.preprocessing.image.load_img"
] | [((478, 574), 'keras.preprocessing.image.ImageDataGenerator', 'ImageDataGenerator', ([], {'rescale': '(1.0 / 255)', 'shear_range': '(0.2)', 'zoom_range': '(0.2)', 'horizontal_flip': '(True)'}), '(rescale=1.0 / 255, shear_range=0.2, zoom_range=0.2,\n horizontal_flip=True)\n', (496, 574), False, 'from keras.preprocess... |
"""Convert CrowdHuman format dataset to Scalabel."""
import argparse
import json
import os
from typing import List
from ..common.typing import DictStrAny
from ..label.transforms import bbox_to_box2d
from .io import save
from .typing import Category, Config, Dataset, Frame, Label
def parse_arguments() -> argparse.Nam... | [
"os.path.join",
"argparse.ArgumentParser",
"json.loads"
] | [((372, 433), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""crowdhuman to scalabel"""'}), "(description='crowdhuman to scalabel')\n", (395, 433), False, 'import argparse\n'), ((1592, 1608), 'json.loads', 'json.loads', (['line'], {}), '(line)\n', (1602, 1608), False, 'import json\n'), ((... |
import spacy
import json
class PartsofSpeech:
def __init__(self, *arg,**kwargs):
self.pos = list()
self.nlp = spacy.load("en_core_web_sm")
def get_articles(self,text):
doc = self.nlp(text)
print("Articles:", [token.lemma_ for token in doc if token.pos_ == "DET"])
def get_pos(self,text):
doc = self.nlp(t... | [
"spacy.load",
"json.dumps"
] | [((116, 144), 'spacy.load', 'spacy.load', (['"""en_core_web_sm"""'], {}), "('en_core_web_sm')\n", (126, 144), False, 'import spacy\n'), ((615, 635), 'json.dumps', 'json.dumps', (['self.pos'], {}), '(self.pos)\n', (625, 635), False, 'import json\n')] |
__source__ = 'https://leetcode.com/problems/flood-fill/description/'
# Time: O(N)
# Space: O(N)
#
# Description: Leetcode # 733. Flood Fill
#
# An image is represented by a 2-D array of integers,
# each integer representing the pixel value of the image (from 0 to 65535).
#
# Given a coordinate (sr, sc) representing th... | [
"unittest.main"
] | [((3314, 3329), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3327, 3329), False, 'import unittest\n')] |
"""
If you want to make a plot, change the folder name
after installing plotly,cufflink and run the following code.
folder_name='new_results'
"""
import pandas as pd
import os,time
import glob
import cufflinks as cf
import plotly.offline
cf.go_offline()
cf.set_config_file(offline=True, world_readable=True)
import torc... | [
"pandas.MultiIndex.from_tuples",
"cufflinks.go_offline",
"pandas.read_csv",
"cufflinks.set_config_file",
"time.sleep",
"glob.glob"
] | [((239, 254), 'cufflinks.go_offline', 'cf.go_offline', ([], {}), '()\n', (252, 254), True, 'import cufflinks as cf\n'), ((255, 308), 'cufflinks.set_config_file', 'cf.set_config_file', ([], {'offline': '(True)', 'world_readable': '(True)'}), '(offline=True, world_readable=True)\n', (273, 308), True, 'import cufflinks as... |
import random
import sys
import os
import json
import couchdb
from datetime import date, datetime, timedelta
from flask import Flask, render_template, request
from flask_login import LoginManager, UserMixin, login_user, current_user
from hashlib import sha256
# ---------------------------------------------------------... | [
"os.path.join",
"couchdb.Server",
"random.choice",
"datetime.date.today",
"json.dumps",
"os.environ.get",
"flask_login.current_user.find_word",
"datetime.timedelta",
"flask.render_template",
"flask_login.LoginManager",
"datetime.datetime.now",
"flask.request.get_json",
"sys.exit"
] | [((9720, 9734), 'flask_login.LoginManager', 'LoginManager', ([], {}), '()\n', (9732, 9734), False, 'from flask_login import LoginManager, UserMixin, login_user, current_user\n'), ((9620, 9652), 'os.environ.get', 'os.environ.get', (['"""BEE_SHOW_WORDS"""'], {}), "('BEE_SHOW_WORDS')\n", (9634, 9652), False, 'import os\n'... |
import pygame
from settings import Settings
class Player:
def __init__(self, name, order, is_human):
self.name = name
self.order = order
self.is_human = is_human
self.points = 0
def show_score(self, game):
# TODO - Refactor? Don't pass in canvas, maybe create local re... | [
"pygame.Color"
] | [((1261, 1282), 'pygame.Color', 'pygame.Color', (['"""white"""'], {}), "('white')\n", (1273, 1282), False, 'import pygame\n')] |
import numpy as np
class congestionInference:
def __init__(self, latency_jumps, jitter_analysis):
self.latency_jumps = latency_jumps
self.jitter_analysis = jitter_analysis
self.congestion = False
def fit(self):
self.congestion_inferences = []
for i in rang... | [
"numpy.array"
] | [((899, 935), 'numpy.array', 'np.array', (['self.congestion_inferences'], {}), '(self.congestion_inferences)\n', (907, 935), True, 'import numpy as np\n')] |
import json
from scrapy.commands import ScrapyCommand
from scrapy.exceptions import UsageError
from scrapy_redis.scheduler import Scheduler
class Command(ScrapyCommand):
requires_project = True
def syntax(self):
return '<spider>'
def add_options(self, parser):
ScrapyCommand.add_options... | [
"json.dump",
"scrapy.exceptions.UsageError",
"scrapy_redis.scheduler.Scheduler.from_settings",
"scrapy.commands.ScrapyCommand.add_options"
] | [((295, 334), 'scrapy.commands.ScrapyCommand.add_options', 'ScrapyCommand.add_options', (['self', 'parser'], {}), '(self, parser)\n', (320, 334), False, 'from scrapy.commands import ScrapyCommand\n'), ((739, 777), 'scrapy_redis.scheduler.Scheduler.from_settings', 'Scheduler.from_settings', (['self.settings'], {}), '(se... |
"""
Recommender
"""
from __future__ import annotations
from pathlib import Path
from typing import Any, Callable, Optional, Tuple, Union, cast
import numpy as np
import torch
from sklearn.neighbors import NearestNeighbors
from torch.utils.data import DataLoader
from tqdm.auto import tqdm
from wav2rec._utils.va... | [
"wav2rec.core.similarity.similarity_calculator",
"torch.inference_mode",
"torch.utils.data.DataLoader",
"wav2rec.nn.lightening.Wav2RecNet.load_from_checkpoint",
"typing.cast",
"numpy.asarray",
"numpy.finfo",
"numpy.array",
"numpy.linalg.norm",
"torch.cuda.is_available",
"torch.as_tensor",
"num... | [((603, 657), 'numpy.linalg.norm', 'np.linalg.norm', (['array'], {'ord': '(2)', 'axis': 'axis', 'keepdims': '(True)'}), '(array, ord=2, axis=axis, keepdims=True)\n', (617, 657), True, 'import numpy as np\n'), ((847, 865), 'torch.as_tensor', 'torch.as_tensor', (['x'], {}), '(x)\n', (862, 865), False, 'import torch\n'), ... |
import math
import tensorflow as tf
# Internal
import dataset
EMBED_WIDTH = 16
TIMES_WIDTH = [ (16, 0.0) ]
INPUT_DROPOUT = 0.0
POST_RNN_DROPOUT = 0.0
DENSE_L2 = 0.0
RNN_WIDTH = [ 16 ]
DENSE_POST_WIDTH = [ (128, 0.0) ]
FEATURE_COUNT = 32
ANNEAL_MAX_STEP = 100.0
MAX_SPHERE_STRENGTH = 0.9
class Embedding():
def _... | [
"tensorflow.nn.static_rnn",
"tensorflow.reduce_sum",
"tensorflow.contrib.layers.l2_regularizer",
"tensorflow.get_variable",
"tensorflow.layers.Dense",
"tensorflow.one_hot",
"tensorflow.gather",
"tensorflow.concat",
"tensorflow.variable_scope",
"tensorflow.stack",
"tensorflow.cast",
"tensorflow... | [((871, 913), 'tensorflow.contrib.layers.l2_regularizer', 'tf.contrib.layers.l2_regularizer', (['DENSE_L2'], {}), '(DENSE_L2)\n', (903, 913), True, 'import tensorflow as tf\n'), ((1439, 1512), 'tensorflow.keras.layers.GaussianDropout', 'tf.keras.layers.GaussianDropout', ([], {'name': '"""input_dropout"""', 'rate': 'INP... |
import os
import pandas
import uuid
import math
import plotly.graph_objects as go
from scipy.stats import sem, norm
import numpy
from plotly.subplots import make_subplots
import glob
from models import Gillespie, CellDivision, DeterministicCellDivision
n_A = 6.023E23 # Avogadro's Number
e_coli_vol = 6.5E-16 # Liters... | [
"pandas.DataFrame",
"plotly.graph_objects.Scatter",
"math.exp",
"uuid.uuid4",
"plotly.graph_objects.Histogram",
"math.sqrt",
"models.DeterministicCellDivision",
"models.CellDivision",
"pandas.read_csv",
"scipy.stats.norm.pdf",
"numpy.array",
"scipy.stats.sem",
"numpy.linspace",
"glob.glob"... | [((1001, 1027), 'os.path.join', 'os.path.join', (['sim', '"""*.csv"""'], {}), "(sim, '*.csv')\n", (1013, 1027), False, 'import os\n'), ((1045, 1060), 'glob.glob', 'glob.glob', (['path'], {}), '(path)\n', (1054, 1060), False, 'import glob\n'), ((2356, 2405), 'scipy.stats.norm.pdf', 'norm.pdf', (['gauss_divide_x', 'divid... |
from dataclasses import dataclass
import json
from classes.commands import CommandType
@dataclass
class ServerInfo:
PlayerCount: int = 0
Map: str = ''
@dataclass
class LaunchOptions:
Map: str = ''
Servername: str = 'Cow Server'
Gamemode: str = ''
Port: int = 7778
BotCount: int = 0
Ma... | [
"classes.commands.CommandType"
] | [((908, 922), 'classes.commands.CommandType', 'CommandType', (['x'], {}), '(x)\n', (919, 922), False, 'from classes.commands import CommandType\n')] |
import sys
import higu.model
import higu.web_session
LEVEL_MAP = {
'none' : higu.model.ACCESS_LEVEL_NONE,
'read' : higu.model.ACCESS_LEVEL_READ,
'edit' : higu.model.ACCESS_LEVEL_EDIT,
'admin' : higu.model.ACCESS_LEVEL_ADMIN,
}
if( __name__ == '__main__' ):
import optparse
parser = optparse.... | [
"sys.exit",
"optparse.OptionParser"
] | [((311, 369), 'optparse.OptionParser', 'optparse.OptionParser', ([], {'usage': '"""Usage: %prog [options] user"""'}), "(usage='Usage: %prog [options] user')\n", (332, 369), False, 'import optparse\n'), ((1134, 1145), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (1142, 1145), False, 'import sys\n'), ((1459, 1470), 's... |
# The following comments couldn't be translated into the new config version:
#,
import FWCore.ParameterSet.Config as cms
#------------------
# clustering:
#------------------
# BasicCluster producer
from RecoEcal.EgammaClusterProducers.cosmicBasicClusters_cfi import *
# SuperCluster producer
from RecoEcal.EgammaClu... | [
"FWCore.ParameterSet.Config.Sequence"
] | [((547, 602), 'FWCore.ParameterSet.Config.Sequence', 'cms.Sequence', (['(cosmicBasicClusters * cosmicSuperClusters)'], {}), '(cosmicBasicClusters * cosmicSuperClusters)\n', (559, 602), True, 'import FWCore.ParameterSet.Config as cms\n')] |
# -*- coding: utf-8 -*-
import json
import re
import scrapy
from locations.items import GeojsonPointItem
from locations.hours import OpeningHours
DAY_MAPPING = {
'Monday': 'Mo',
'Tuesday': 'Tu',
'Wednesday': 'We',
'Thursday': 'Th',
'Friday': 'Fr',
'Saturday': 'Sa',
'Sunday': 'Su'
}
clas... | [
"locations.items.GeojsonPointItem",
"re.search",
"locations.hours.OpeningHours",
"json.loads"
] | [((1946, 1960), 'locations.hours.OpeningHours', 'OpeningHours', ([], {}), '()\n', (1958, 1960), False, 'from locations.hours import OpeningHours\n'), ((2003, 2023), 'json.loads', 'json.loads', (['weekdays'], {}), '(weekdays)\n', (2013, 2023), False, 'import json\n'), ((1820, 1850), 'locations.items.GeojsonPointItem', '... |
# ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... | [
"InnerEye.Common.common_util.MetricsDataframeLoggers",
"torch.nn.ConvTranspose3d",
"InnerEye.ML.config.SegmentationModelBase",
"numpy.isnan",
"torch.cuda.device_count",
"pytest.mark.skipif",
"pytest.mark.parametrize",
"InnerEye.ML.utils.model_util.ModelAndInfo",
"torch.nn.Conv3d",
"InnerEye.ML.dee... | [((2985, 3050), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""value_to_insert"""', '[1.0, np.NaN, np.Inf]'], {}), "('value_to_insert', [1.0, np.NaN, np.Inf])\n", (3008, 3050), False, 'import pytest\n'), ((3052, 3110), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""in_training_mode"""', '[True... |
import os
import functools
import torch
import torch.nn as nn
import torch.optim as optim
from torch.cuda.amp import autocast, GradScaler
from torchvision.utils import save_image
from ..StyleGAN2.model import Generator, Discriminator, init_weight_N01
from ..general.dataset_base import Image, make_default_transform
f... | [
"functools.partial",
"torch.cuda.amp.autocast",
"os.path.basename",
"random.shuffle",
"torch.nn.Softplus",
"PIL.Image.open",
"os.cpu_count",
"torchvision.utils.save_image",
"torch.cuda.is_available",
"glob.glob",
"torch.cuda.amp.GradScaler",
"torch.no_grad",
"torch.isnan"
] | [((2653, 2666), 'torch.nn.Softplus', 'nn.Softplus', ([], {}), '()\n', (2664, 2666), True, 'import torch.nn as nn\n'), ((3141, 3186), 'functools.partial', 'functools.partial', (['DiffAugment'], {'policy': 'policy'}), '(DiffAugment, policy=policy)\n', (3158, 3186), False, 'import functools\n'), ((8909, 8996), 'functools.... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import tensorflow as tf
class CGAN(tf.keras.Model):
def __init__(self, latent_dim, epochs = 50, batch_size = 100, learning_rate = 0.001,
im_dim = 28, n_filters = 32, g... | [
"tensorflow.ones",
"tensorflow.keras.layers.Dropout",
"tensorflow.random.normal",
"tensorflow.keras.layers.Dense",
"tensorflow.print",
"tensorflow.reduce_mean",
"tensorflow.keras.layers.InputLayer",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.sigmoid",
"tensorflow.keras.optimizers.Ad... | [((612, 656), 'tensorflow.keras.optimizers.Adam', 'tf.keras.optimizers.Adam', (['self.learning_rate'], {}), '(self.learning_rate)\n', (636, 656), True, 'import tensorflow as tf\n'), ((684, 744), 'tensorflow.keras.optimizers.Adam', 'tf.keras.optimizers.Adam', (['(self.learning_rate * self.g_factor)'], {}), '(self.learni... |
#!/usr/bin/env python3
"""Test the configuration module."""
import multiprocessing
import os
import sys
import os.path
import unittest
import shutil
import random
import string
import tempfile
import yaml
# Try to create a working PYTHONPATH
TEST_DIRECTORY = os.path.dirname(os.path.realpath(__file__))
SWITCHMAP_DIREC... | [
"os.remove",
"yaml.dump",
"yaml.safe_load",
"shutil.rmtree",
"os.path.join",
"multiprocessing.cpu_count",
"sys.path.append",
"unittest.main",
"os.path.exists",
"tempfile.mkdtemp",
"switchmap.utils.configuration.Config",
"os.path.realpath",
"os.rmdir",
"os.listdir",
"sys.exit",
"tempfil... | [((277, 303), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (293, 303), False, 'import os\n'), ((343, 382), 'os.path.join', 'os.path.join', (['TEST_DIRECTORY', 'os.pardir'], {}), '(TEST_DIRECTORY, os.pardir)\n', (355, 382), False, 'import os\n'), ((417, 461), 'os.path.join', 'os.path.join'... |
from django.views.generic import TemplateView
import re
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import login as auth_login
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.sites.models i... | [
"django.contrib.sites.models.Site.objects.get_current",
"tos.models.has_user_agreed_latest_tos",
"re.match",
"tos.models.UserAgreement.objects.create",
"tos.compat.get_request_site",
"tos.models.TermsOfService.objects.get_current_tos",
"tos.compat.get_runtime_user_model",
"django.http.HttpResponseRedi... | [((1958, 1998), 'tos.models.TermsOfService.objects.get_current_tos', 'TermsOfService.objects.get_current_tos', ([], {}), '()\n', (1996, 1998), False, 'from tos.models import has_user_agreed_latest_tos, TermsOfService, UserAgreement\n'), ((977, 1017), 'tos.models.TermsOfService.objects.get_current_tos', 'TermsOfService.... |
import os, shutil, stat
SDpath=r'C:\Depots\MBSI\Projects\OOB\UI'
def del_rw(action, name, exc):
os.chmod(name, stat.S_IWRITE)
os.remove(name)
#GitPath=r'C:\Gitprojects'
GitPath=r'C:\test\Talent'
langs=["bg", "ca-ES", "cs", "da", "de", "de-AT", "de-CH", "el", "en-AU", "en-CA", "en-GB", "en-IE", "en-IN... | [
"os.remove",
"os.chmod",
"os.makedirs",
"os.rename",
"os.path.exists",
"os.path.isfile",
"os.path.join"
] | [((105, 134), 'os.chmod', 'os.chmod', (['name', 'stat.S_IWRITE'], {}), '(name, stat.S_IWRITE)\n', (113, 134), False, 'import os, shutil, stat\n'), ((140, 155), 'os.remove', 'os.remove', (['name'], {}), '(name)\n', (149, 155), False, 'import os, shutil, stat\n'), ((1484, 1526), 'os.path.join', 'os.path.join', (['GitPath... |
from pathlib import Path
from typing import Any, Callable, List, Sequence, Type, Union
import numpy as np
import pandas as pd
from exrec.core.interface import DataFrame, DataFrameGroupBy
class DataFrameImpl:
data: pd.DataFrame
def __init__(self, data):
self.data = pd.DataFrame(data)
def __str__... | [
"pandas.read_csv",
"pandas.DataFrame"
] | [((2452, 2482), 'pandas.read_csv', 'pd.read_csv', (['src_file'], {'sep': 'sep'}), '(src_file, sep=sep)\n', (2463, 2482), True, 'import pandas as pd\n'), ((285, 303), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {}), '(data)\n', (297, 303), True, 'import pandas as pd\n')] |
from collections import namedtuple
class Ticker(
namedtuple(
"ticker",
[
"last",
"price_before_last",
"open",
"high",
"low",
"vwap",
"volume",
"bid",
"ask",
"json",
],
... | [
"collections.namedtuple"
] | [((55, 173), 'collections.namedtuple', 'namedtuple', (['"""ticker"""', "['last', 'price_before_last', 'open', 'high', 'low', 'vwap', 'volume',\n 'bid', 'ask', 'json']"], {}), "('ticker', ['last', 'price_before_last', 'open', 'high', 'low',\n 'vwap', 'volume', 'bid', 'ask', 'json'])\n", (65, 173), False, 'from col... |
import unittest
import json
from alvarium.streams.contracts import ServiceInfo, StreamInfo, StreamType
class TestStreamInfo(unittest.TestCase):
def test_to_json_should_return_json_representation(self):
stream_info = StreamInfo(type=StreamType.MQTT, config={})
result = stream_info.to_json()
... | [
"unittest.main",
"json.loads",
"alvarium.streams.contracts.StreamType",
"json.dumps",
"alvarium.streams.contracts.StreamInfo",
"alvarium.streams.contracts.ServiceInfo"
] | [((2132, 2147), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2145, 2147), False, 'import unittest\n'), ((231, 274), 'alvarium.streams.contracts.StreamInfo', 'StreamInfo', ([], {'type': 'StreamType.MQTT', 'config': '{}'}), '(type=StreamType.MQTT, config={})\n', (241, 274), False, 'from alvarium.streams.contracts... |
# generate overexposure samples from clear images
# author: @LucasX
import argparse
import os
import random
from multiprocessing import Queue, Process
import cv2
import numpy as np
parser = argparse.ArgumentParser()
parser.add_argument('-orig_dir', type=str,
default='C:/Users/LucasX/Desktop/ShelfE... | [
"argparse.ArgumentParser",
"random.randint",
"os.makedirs",
"cv2.waitKey",
"cv2.destroyAllWindows",
"os.path.basename",
"numpy.zeros",
"os.path.exists",
"numpy.clip",
"cv2.imread",
"multiprocessing.Queue",
"multiprocessing.Process",
"cv2.imshow",
"os.path.join",
"os.listdir"
] | [((192, 217), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (215, 217), False, 'import argparse\n'), ((3309, 3316), 'multiprocessing.Queue', 'Queue', ([], {}), '()\n', (3314, 3316), False, 'from multiprocessing import Queue, Process\n'), ((3334, 3362), 'os.listdir', 'os.listdir', (["args['orig... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('blogapp', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='article',
name='cate... | [
"django.db.models.TextField",
"django.db.migrations.RemoveField",
"django.db.models.CharField",
"django.db.migrations.DeleteModel",
"django.db.models.DateField"
] | [((240, 303), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""article"""', 'name': '"""categories"""'}), "(model_name='article', name='categories')\n", (262, 303), False, 'from django.db import models, migrations\n'), ((348, 405), 'django.db.migrations.RemoveField', 'migrations.Rem... |
import json
import os
import ray
import ray._private.test_utils as test_utils
from ray.util.placement_group import placement_group, remove_placement_group
import time
import tqdm
if "SMOKE_TEST" in os.environ:
MAX_PLACEMENT_GROUPS = 20
else:
MAX_PLACEMENT_GROUPS = 1000
def test_many_placement_groups():
#... | [
"ray._private.test_utils.monitor_memory_usage",
"ray.init",
"tqdm.tqdm",
"json.dump",
"ray.available_resources",
"tqdm.trange",
"ray.get",
"time.time",
"ray._private.test_utils.wait_for_condition",
"ray.util.placement_group.remove_placement_group",
"ray.util.placement_group.placement_group",
"... | [((1678, 1702), 'ray.init', 'ray.init', ([], {'address': '"""auto"""'}), "(address='auto')\n", (1686, 1702), False, 'import ray\n'), ((1704, 1752), 'ray._private.test_utils.wait_for_condition', 'test_utils.wait_for_condition', (['no_resource_leaks'], {}), '(no_resource_leaks)\n', (1733, 1752), True, 'import ray._privat... |
import dateutil.parser
from argdeco import arg, command, main
@arg("-d", "--date", help="pass some date")
def arg_date(value):
# here we can do some validations
try:
v = dateutil.parser.parse(value)
return v
except StandardError as e:
raise e
@command("check_date", arg_date)
def c... | [
"argdeco.arg",
"argdeco.command",
"argdeco.main"
] | [((65, 107), 'argdeco.arg', 'arg', (['"""-d"""', '"""--date"""'], {'help': '"""pass some date"""'}), "('-d', '--date', help='pass some date')\n", (68, 107), False, 'from argdeco import arg, command, main\n'), ((283, 314), 'argdeco.command', 'command', (['"""check_date"""', 'arg_date'], {}), "('check_date', arg_date)\n"... |
from itertools import islice
import pytest
@pytest.fixture(autouse=True)
def add_np(doctest_namespace):
doctest_namespace["islice"] = islice
| [
"pytest.fixture"
] | [((47, 75), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (61, 75), False, 'import pytest\n')] |
#!/usr/local/bin/python3
import sys
import os
import argparse
import msprime
import tskit
# simulate tree under smc model
def wrap_msprime(sample_size, Ne, length, recombination_rate, model, outpath, repnum):
tree_sequence = msprime.simulate(
sample_size=sample_size, Ne=Ne, # note, it thinks diploid pop
... | [
"os.makedirs",
"argparse.ArgumentParser",
"os.path.exists",
"msprime.simulate",
"os.path.join"
] | [((232, 351), 'msprime.simulate', 'msprime.simulate', ([], {'sample_size': 'sample_size', 'Ne': 'Ne', 'length': 'length', 'recombination_rate': 'recombination_rate', 'model': 'model'}), '(sample_size=sample_size, Ne=Ne, length=length,\n recombination_rate=recombination_rate, model=model)\n', (248, 351), False, 'impo... |
# Copyright 2018 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... | [
"pkgutil.get_data",
"os.path.isfile"
] | [((1028, 1067), 'os.path.isfile', 'os.path.isfile', (['extract_helper.__file__'], {}), '(extract_helper.__file__)\n', (1042, 1067), False, 'import os\n'), ((1159, 1206), 'os.path.isfile', 'os.path.isfile', (['extract_helper_package.__file__'], {}), '(extract_helper_package.__file__)\n', (1173, 1206), False, 'import os\... |
import json
class Config(object):
def __init__(self, config_file):
with open(config_file, 'r') as f:
config_dict = json.load(f)
self.__dict__.update(config_dict)
| [
"json.load"
] | [((140, 152), 'json.load', 'json.load', (['f'], {}), '(f)\n', (149, 152), False, 'import json\n')] |
# This code has taken from link below.
# https://bitbucket.org/damienjadeduff/hashing_example/raw/master/hash_password.py
"""The below is a simple example of how you would use "hashing" to
compare passwords without having to save the password - you would-
save the "hash" of the password instead.
Written for the class ... | [
"hashlib.sha256"
] | [((721, 742), 'hashlib.sha256', 'sha256', (['pw_bytestring'], {}), '(pw_bytestring)\n', (727, 742), False, 'from hashlib import sha256\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 28 16:40:41 2020
<NAME>
<EMAIL>
BME Bogazici University
Istanbul / Uskudar
@author: abas
"""
import numpy as np
import pytorch_lightning as pl
import torch
import torchvision
from torch.utils.data import Dataset, DataLoader
from preprocess import ... | [
"preprocess.normalizer",
"numpy.load",
"preprocess.scaler",
"pandas.read_excel",
"preprocess.transformation",
"numpy.array",
"torch.tensor",
"preprocess.smoother"
] | [((1431, 1450), 'pandas.read_excel', 'pd.read_excel', (['path'], {}), '(path)\n', (1444, 1450), True, 'import pandas as pd\n'), ((1661, 1676), 'numpy.load', 'np.load', (['gtpath'], {}), '(gtpath)\n', (1668, 1676), True, 'import numpy as np\n'), ((1717, 1756), 'numpy.array', 'np.array', (['self.exc.iloc[:, responseCol]'... |
#!/usr/bin/env python3
# SPDX-FileCopyrightText: © 2022 Decompollaborate
# SPDX-License-Identifier: MIT
from __future__ import annotations
import dataclasses
import struct
# a.k.a. Sym (symbol)
@dataclasses.dataclass
class Elf32SymEntry:
name: int # word # 0x00
value: int # address # 0x04
siz... | [
"struct.unpack_from"
] | [((777, 832), 'struct.unpack_from', 'struct.unpack_from', (['entryFormat', 'array_of_bytes', 'offset'], {}), '(entryFormat, array_of_bytes, offset)\n', (795, 832), False, 'import struct\n')] |
# -*- coding: utf-8 -*-
"""Console script for module_renamer."""
from __future__ import absolute_import
import sys
import click
from .commands.analyze_modifications import analyze_modifications
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
@click.group(context_settings=CONTEXT_SETTINGS)
def main():
... | [
"click.group",
"click.option",
"click.Path"
] | [((261, 307), 'click.group', 'click.group', ([], {'context_settings': 'CONTEXT_SETTINGS'}), '(context_settings=CONTEXT_SETTINGS)\n', (272, 307), False, 'import click\n'), ((465, 571), 'click.option', 'click.option', (['"""--compare-with"""'], {'default': '"""master"""', 'help': '"""Branch to be compared with [Default: ... |
# -*- coding: utf-8 -*
import JackFramework as jf
from .Your_Model.inference import YourModelInterface
def model_zoo(args: object, name: str) -> object:
for case in jf.Switch(name):
if case('YourMode'):
jf.log.info("Enter the YourMode model")
model = YourModelInterface(args)
... | [
"JackFramework.log.error",
"JackFramework.log.info",
"JackFramework.Switch"
] | [((172, 187), 'JackFramework.Switch', 'jf.Switch', (['name'], {}), '(name)\n', (181, 187), True, 'import JackFramework as jf\n'), ((230, 269), 'JackFramework.log.info', 'jf.log.info', (['"""Enter the YourMode model"""'], {}), "('Enter the YourMode model')\n", (241, 269), True, 'import JackFramework as jf\n'), ((391, 43... |
#!/usr/bin/python
import sys
import os
import shutil
from readConfig import *
def get_stock_data_path():
config = ReadConfig()
path = config.find_path("config.ini")
config.__read__(path)
stock_path = config.get_stock("path")
if not os.path.exists(stock_path):
os.makedirs(stock_path)
re... | [
"shutil.rmtree",
"os.path.exists",
"os.makedirs"
] | [((459, 484), 'os.path.exists', 'os.path.exists', (['directory'], {}), '(directory)\n', (473, 484), False, 'import os\n'), ((523, 545), 'os.makedirs', 'os.makedirs', (['directory'], {}), '(directory)\n', (534, 545), False, 'import os\n'), ((254, 280), 'os.path.exists', 'os.path.exists', (['stock_path'], {}), '(stock_pa... |
from typing import Any, Type
from grapl_analyzerlib.analyzer import Analyzer, OneOrMany, A
from grapl_analyzerlib.counters import ParentChildCounter
from grapl_analyzerlib.execution import ExecutionHit
from grapl_analyzerlib.prelude import ProcessQuery, ProcessView, Not
from pydgraph import DgraphClient
class RarePa... | [
"grapl_analyzerlib.prelude.Not",
"grapl_analyzerlib.counters.ParentChildCounter",
"grapl_analyzerlib.prelude.ProcessQuery",
"grapl_analyzerlib.execution.ExecutionHit"
] | [((614, 647), 'grapl_analyzerlib.counters.ParentChildCounter', 'ParentChildCounter', (['dgraph_client'], {}), '(dgraph_client)\n', (632, 647), False, 'from grapl_analyzerlib.counters import ParentChildCounter\n'), ((894, 912), 'grapl_analyzerlib.prelude.Not', 'Not', (['"""svchost.exe"""'], {}), "('svchost.exe')\n", (89... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: lry
"""
import scipy.io as sio
import numpy as np
sep = [20,40,61,103] # please pay attention to this seperation , setted according to the spectral response function of different sensors.
# setting global parameters
patch_size = 16
patch_size1 = ... | [
"numpy.reshape",
"scipy.io.loadmat"
] | [((935, 956), 'scipy.io.loadmat', 'sio.loadmat', (['filename'], {}), '(filename)\n', (946, 956), True, 'import scipy.io as sio\n'), ((1262, 1291), 'numpy.reshape', 'np.reshape', (['Xl_3d', '[-1, dimX]'], {}), '(Xl_3d, [-1, dimX])\n', (1272, 1291), True, 'import numpy as np\n')] |
import warnings
warnings.warn(
"pyschema.contrib.luigi is deprecated and will be removed.\n"
"Please use the pyschema_extensions.luigi package instead.",
DeprecationWarning,
stacklevel=2
)
import pyschema_extensions.luigi
from pyschema_extensions.luigi import *
| [
"warnings.warn"
] | [((17, 197), 'warnings.warn', 'warnings.warn', (['"""pyschema.contrib.luigi is deprecated and will be removed.\nPlease use the pyschema_extensions.luigi package instead."""', 'DeprecationWarning'], {'stacklevel': '(2)'}), '(\n """pyschema.contrib.luigi is deprecated and will be removed.\nPlease use the pyschema_exte... |
import threading
import socketserver
import argparse
import time
class ThreadedUDPRequestHandler(socketserver.BaseRequestHandler):
def handle(self):
data = self.request[0].strip()
socket = self.request[1]
print(f'[{time.time()}] Incoming: {data}')
reply = data.upper()
pr... | [
"threading.Thread",
"time.time",
"argparse.ArgumentParser",
"time.sleep"
] | [((1157, 1212), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""UDP Server Mock."""'}), "(description='UDP Server Mock.')\n", (1180, 1212), False, 'import argparse\n'), ((830, 881), 'threading.Thread', 'threading.Thread', ([], {'target': 'self._server.serve_forever'}), '(target=self._serv... |
# assign random tasks to team member 1.
import random
import sys
# Prior information
n, m, d, r = list(map(int, input().split()))
task_difficulty = []
for i in range(n):
task_difficulty.append(list(map(int, input().split())))
task_dependency = [[] for _ in range(n)]
for i in range(r):
temp = list(ma... | [
"random.shuffle",
"sys.stdout.flush"
] | [((1428, 1446), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (1444, 1446), False, 'import sys\n'), ((707, 731), 'random.shuffle', 'random.shuffle', (['tasklist'], {}), '(tasklist)\n', (721, 731), False, 'import random\n')] |
from tensorflow.keras.preprocessing.image import ImageDataGenerator
import os
def generator(BS, data_path, npix):
'''
Image Data Generator from Directory;
Given the path to the train, validation, test
directories located in data_path
preprocesses the images and the
target masks in batch sizes of BS.
'... | [
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"os.path.join"
] | [((343, 479), 'tensorflow.keras.preprocessing.image.ImageDataGenerator', 'ImageDataGenerator', ([], {'rescale': '(1.0 / 255)', 'rotation_range': '(45)', 'shear_range': '(0.2)', 'zoom_range': '(0.2)', 'horizontal_flip': '(True)', 'fill_mode': '"""nearest"""'}), "(rescale=1.0 / 255, rotation_range=45, shear_range=0.2,\n ... |
try: import ijson.backends.yajl2_cffi as ijson
except: import ijson
from datetime import datetime, date, timedelta
from collections import OrderedDict
from bs4 import BeautifulSoup
from warnings import warn
from copy import copy
from urllib.request import urlopen
import argparse
import requests
import zipfile
import j... | [
"os.mkdir",
"os.remove",
"argparse.ArgumentParser",
"os.path.join",
"csv.DictWriter",
"os.path.exists",
"datetime.timedelta",
"requests.get",
"re.sub",
"csv.writer",
"csv.DictReader",
"os.rename",
"datetime.date.today",
"datetime.datetime.strptime",
"ijson.items",
"bs4.BeautifulSoup",
... | [((2045, 2087), 'bs4.BeautifulSoup', 'BeautifulSoup', (['request.text', '"""html.parser"""'], {}), "(request.text, 'html.parser')\n", (2058, 2087), False, 'from bs4 import BeautifulSoup\n'), ((27100, 27125), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (27123, 27125), False, 'import argparse\... |
# MIT License
# Copyright 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, modify, merge, publish, di... | [
"os.path.dirname",
"os.path.join",
"setuptools.find_packages"
] | [((1923, 1948), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1938, 1948), False, 'import os\n'), ((2676, 2723), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "('morpheus_core.tests',)"}), "(exclude=('morpheus_core.tests',))\n", (2689, 2723), False, 'from setuptools import f... |
# %%
import pandas as pd
import numpy as np
from datetime import datetime
import os
import pickle
import matplotlib.pyplot as plt
import scipy.special as sc
from scipy.stats import norm
from scipy.stats import lognorm
import copy
exec(open('../env_vars.py').read())
dir_data = os.environ['dir_data']
dir_picklejar = os.... | [
"copy.deepcopy",
"numpy.sum",
"os.path.realpath",
"numpy.cumsum",
"numpy.array"
] | [((2457, 2483), 'copy.deepcopy', 'copy.deepcopy', (['latent_data'], {}), '(latent_data)\n', (2470, 2483), False, 'import copy\n'), ((2978, 3004), 'copy.deepcopy', 'copy.deepcopy', (['latent_data'], {}), '(latent_data)\n', (2991, 3004), False, 'import copy\n'), ((3608, 3660), 'copy.deepcopy', 'copy.deepcopy', (['clean_d... |
from rest_framework.permissions import AllowAny
from rest_framework.routers import DefaultRouter
from rest_framework.viewsets import ModelViewSet
from .models import Order
from .serializers import OrderSerializer
from .serializers import OrderListSerializer
from .permissions import OwnerOnly
class OrderViewset(Mode... | [
"rest_framework.routers.DefaultRouter",
"rest_framework.permissions.AllowAny"
] | [((940, 955), 'rest_framework.routers.DefaultRouter', 'DefaultRouter', ([], {}), '()\n', (953, 955), False, 'from rest_framework.routers import DefaultRouter\n'), ((883, 893), 'rest_framework.permissions.AllowAny', 'AllowAny', ([], {}), '()\n', (891, 893), False, 'from rest_framework.permissions import AllowAny\n')] |
import unittest
from labsys.app import create_app, db
from labsys.admissions.models import (
Patient, Address, Admission, Symptom, ObservedSymptom, Method, Sample,
InfluenzaExam, Vaccine, Hospitalization, UTIHospitalization, ClinicalEvolution,)
from . import mock
class TestModelsRelationships(unittest.TestCa... | [
"labsys.app.db.drop_all",
"labsys.app.create_app",
"labsys.admissions.models.ObservedSymptom.query.all",
"labsys.app.db.session.delete",
"labsys.admissions.models.Symptom",
"labsys.admissions.models.Vaccine.query.all",
"labsys.app.db.create_all",
"labsys.admissions.models.ObservedSymptom",
"labsys.a... | [((366, 387), 'labsys.app.create_app', 'create_app', (['"""testing"""'], {}), "('testing')\n", (376, 387), False, 'from labsys.app import create_app, db\n'), ((478, 493), 'labsys.app.db.create_all', 'db.create_all', ([], {}), '()\n', (491, 493), False, 'from labsys.app import create_app, db\n'), ((588, 607), 'labsys.ap... |
from .alphabet import protein_alphabet, dna_alphabet, rna_alphabet
from .alignment import Alignment, ReferenceMapping
import numpy as np
from Bio import pairwise2
from Bio.SubsMat import MatrixInfo
def _get_substitution_matrix(alphabet):
""" Return a tuple with default parameters `(substitution_matrix, gap_open... | [
"numpy.asarray",
"Bio.pairwise2.align.globalds",
"numpy.mean",
"numpy.argmax"
] | [((3260, 3277), 'numpy.argmax', 'np.argmax', (['scores'], {}), '(scores)\n', (3269, 3277), True, 'import numpy as np\n'), ((3655, 3685), 'numpy.mean', 'np.mean', (['gap_structure'], {'axis': '(1)'}), '(gap_structure, axis=1)\n', (3662, 3685), True, 'import numpy as np\n'), ((5770, 5897), 'Bio.pairwise2.align.globalds',... |
#!/usr/bin/python
# Copyright: (c) 2018, <NAME> <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
... | [
"ansible.module_utils._text.to_native",
"ansible.module_utils.utm_utils.UTM"
] | [((12069, 12116), 'ansible.module_utils.utm_utils.UTM', 'UTM', (['module', 'endpoint', 'key_to_check_for_changes'], {}), '(module, endpoint, key_to_check_for_changes)\n', (12072, 12116), False, 'from ansible.module_utils.utm_utils import UTM, UTMModule\n'), ((12183, 12195), 'ansible.module_utils._text.to_native', 'to_n... |
# Internal modules
from views import get_handler
class Agent():
def data_agent():
page = 1
while True:
agents = get_handler(f'agents?per_page=3&page={page}')
if agents:
for agent in agents:
if agent['occasional'] != True:
... | [
"views.get_handler"
] | [((146, 191), 'views.get_handler', 'get_handler', (['f"""agents?per_page=3&page={page}"""'], {}), "(f'agents?per_page=3&page={page}')\n", (157, 191), False, 'from views import get_handler\n')] |
import json
from typing import Any, Dict
from aiogram import types
from aiogram.dispatcher import FSMContext
from ..bot import settings # type: ignore
from ..product_answers import get_product
from ..product_filters import ProductFilters
from ..utils import is_admin
async def prepare_order_data(
state: FSMCont... | [
"json.loads"
] | [((403, 449), 'json.loads', 'json.loads', (['pre_checkout_query.invoice_payload'], {}), '(pre_checkout_query.invoice_payload)\n', (413, 449), False, 'import json\n')] |
# -*- coding: utf-8 -*-
import json
from abc import ABC
from typing import Optional, Any, Callable
import bottle
from pip_services3_commons.config import ConfigParams
from pip_services3_commons.config.IConfigurable import IConfigurable
from pip_services3_commons.data.FilterParams import FilterParams
from pip_services... | [
"pip_services3_commons.errors.UnauthorizedException.UnauthorizedException",
"pip_services3_commons.data.FilterParams.FilterParams",
"bottle.request.query.get",
"pip_services3_commons.errors.ConflictException.ConflictException",
"pip_services3_commons.errors.UnknownException.UnknownException",
"json.loads"... | [((1319, 1336), 'pip_services3_components.log.CompositeLogger.CompositeLogger', 'CompositeLogger', ([], {}), '()\n', (1334, 1336), False, 'from pip_services3_components.log.CompositeLogger import CompositeLogger\n'), ((1381, 1400), 'pip_services3_components.count.CompositeCounters.CompositeCounters', 'CompositeCounters... |
import numpy as np
from ._Epsilon import Epsilon
class UCB1(Epsilon):
"""
Agente que soluciona el problema del el Bandido Multibrazo
(Multi-Armed Bandit) mediante el uso de una estrategia UCB1
Parámetros
----------
bandits : array of Bandit
Vector con los bandidos con los que se ... | [
"numpy.log",
"numpy.ceil",
"numpy.isnan",
"numpy.max",
"numpy.min",
"numpy.array",
"numpy.random.choice",
"numpy.sqrt"
] | [((1368, 1397), 'numpy.random.choice', 'np.random.choice', (['max_bandits'], {}), '(max_bandits)\n', (1384, 1397), True, 'import numpy as np\n'), ((2717, 2752), 'numpy.random.choice', 'np.random.choice', (['self._num_bandits'], {}), '(self._num_bandits)\n', (2733, 2752), True, 'import numpy as np\n'), ((3484, 3513), 'n... |
from pathlib import Path
import platform
DB_NAME = "ucity"
if platform.system() == "Darwin":
GDRIVE_FOLDER = Path("/Volumes/GoogleDrive/Shared drives/U_City_FY_21")
elif platform.system() == "Windows":
GDRIVE_FOLDER = Path(r"G:\Shared drives\U_City_FY_21")
| [
"platform.system",
"pathlib.Path"
] | [((64, 81), 'platform.system', 'platform.system', ([], {}), '()\n', (79, 81), False, 'import platform\n'), ((115, 170), 'pathlib.Path', 'Path', (['"""/Volumes/GoogleDrive/Shared drives/U_City_FY_21"""'], {}), "('/Volumes/GoogleDrive/Shared drives/U_City_FY_21')\n", (119, 170), False, 'from pathlib import Path\n'), ((17... |
from blackduck import Client
import argparse
import logging
from pprint import pprint
logging.basicConfig(
level=logging.DEBUG,
format="[%(asctime)s] {%(module)s:%(lineno)d} %(levelname)s - %(message)s"
)
parser = argparse.ArgumentParser("Quickstart demonstration with Client")
parser.add_argument("--base-url... | [
"blackduck.Client",
"argparse.ArgumentParser",
"logging.basicConfig"
] | [((88, 209), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG', 'format': '"""[%(asctime)s] {%(module)s:%(lineno)d} %(levelname)s - %(message)s"""'}), "(level=logging.DEBUG, format=\n '[%(asctime)s] {%(module)s:%(lineno)d} %(levelname)s - %(message)s')\n", (107, 209), False, 'import loggin... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2018, <NAME> <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | [
"ansible.module_utils.scaleway.scaleway_argument_spec",
"ansible.module_utils.basic.AnsibleModule",
"ansible.module_utils.scaleway.SCALEWAY_LOCATION.keys"
] | [((2301, 2325), 'ansible.module_utils.scaleway.scaleway_argument_spec', 'scaleway_argument_spec', ([], {}), '()\n', (2323, 2325), False, 'from ansible.module_utils.scaleway import Scaleway, ScalewayException, scaleway_argument_spec, SCALEWAY_LOCATION\n'), ((2448, 2516), 'ansible.module_utils.basic.AnsibleModule', 'Ansi... |
from test.integration.base import DBTIntegrationTest, FakeArgs, use_profile
import json
class TestChangingPartitions(DBTIntegrationTest):
@property
def schema(self):
return "bigquery_test_022"
@property
def models(self):
return "partition-models"
def run_changes(self, before, af... | [
"test.integration.base.use_profile",
"json.dumps"
] | [((863, 886), 'test.integration.base.use_profile', 'use_profile', (['"""bigquery"""'], {}), "('bigquery')\n", (874, 886), False, 'from test.integration.base import DBTIntegrationTest, FakeArgs, use_profile\n'), ((1218, 1241), 'test.integration.base.use_profile', 'use_profile', (['"""bigquery"""'], {}), "('bigquery')\n"... |
import pyb
print("Executing main.py")
led = pyb.LED(1)
led.on()
pyb.delay(100)
led.off()
pyb.delay(100)
led.on()
pyb.delay(100)
led.off()
| [
"pyb.delay",
"pyb.LED"
] | [((46, 56), 'pyb.LED', 'pyb.LED', (['(1)'], {}), '(1)\n', (53, 56), False, 'import pyb\n'), ((67, 81), 'pyb.delay', 'pyb.delay', (['(100)'], {}), '(100)\n', (76, 81), False, 'import pyb\n'), ((92, 106), 'pyb.delay', 'pyb.delay', (['(100)'], {}), '(100)\n', (101, 106), False, 'import pyb\n'), ((116, 130), 'pyb.delay', '... |
# Generated by Django 3.1.4 on 2021-01-27 23:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('book', '0003_book_publisher'),
]
operations = [
migrations.AlterModelOptions(
name='author',
options={'ordering': ['... | [
"django.db.models.CharField",
"django.db.migrations.AlterModelOptions"
] | [((228, 388), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""author"""', 'options': "{'ordering': ['firstname', 'lastname'], 'verbose_name': 'autor',\n 'verbose_name_plural': 'autorzy'}"}), "(name='author', options={'ordering': [\n 'firstname', 'lastname'], 'verbose_na... |
import time
import doctest
import unittest
from examples.lists.models import List, Item
from django.test import TestCase
class GenericTestCase(TestCase):
def setUp(self):
pass
def tearDown(self):
pass
# @unittest.skip("Some reason. If you are reading this in a test run someone did not f... | [
"examples.lists.models.Item",
"examples.lists.models.List.objects.create",
"time.sleep"
] | [((540, 573), 'examples.lists.models.List.objects.create', 'List.objects.create', ([], {'name': '"""To Do"""'}), "(name='To Do')\n", (559, 573), False, 'from examples.lists.models import List, Item\n'), ((4726, 4739), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (4736, 4739), False, 'import time\n'), ((5733, 577... |
# coding=utf-8
"""
Copyright 2016 Load Impact
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 writi... | [
"click.testing.CliRunner",
"collections.namedtuple",
"mock.MagicMock"
] | [((1002, 1013), 'click.testing.CliRunner', 'CliRunner', ([], {}), '()\n', (1011, 1013), False, 'from click.testing import CliRunner\n'), ((1034, 1097), 'collections.namedtuple', 'namedtuple', (['"""DataStore"""', "['id', 'name', 'status', 'public_url']"], {}), "('DataStore', ['id', 'name', 'status', 'public_url'])\n", ... |
import argparse
import asyncio
import logging
from pathlib import Path
import os
import signal
import sys
import aiohttp
import aiosqlite
import lissandra
from client import APIClient
# Test
lissandra.exiting = False
def main():
try:
parser = argparse.ArgumentParser(
desc... | [
"logging.error",
"asyncio.get_event_loop",
"argparse.ArgumentParser",
"logging.basicConfig",
"asyncio.sleep",
"logging.getLogger",
"aiohttp.ClientSession",
"logging.info",
"pathlib.Path",
"client.APIClient",
"sys.exit"
] | [((1971, 1988), 'pathlib.Path', 'Path', (['"""."""', '"""data"""'], {}), "('.', 'data')\n", (1975, 1988), False, 'from pathlib import Path\n'), ((2032, 2056), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (2054, 2056), False, 'import asyncio\n'), ((2193, 2219), 'logging.info', 'logging.info', ([... |
from utils import get_page
from lxml import etree
from db import RedisClient
import random
import time
class Crawl_ip(object):
def __init__(self):
self.db = RedisClient()
def ip_xici(self):
url = 'http://www.xicidaili.com/'
con = get_page(url)
html = etree.HTML(con)
... | [
"db.RedisClient",
"random.randint",
"utils.get_page",
"time.sleep",
"lxml.etree.HTML"
] | [((176, 189), 'db.RedisClient', 'RedisClient', ([], {}), '()\n', (187, 189), False, 'from db import RedisClient\n'), ((272, 285), 'utils.get_page', 'get_page', (['url'], {}), '(url)\n', (280, 285), False, 'from utils import get_page\n'), ((302, 317), 'lxml.etree.HTML', 'etree.HTML', (['con'], {}), '(con)\n', (312, 317)... |
import json
import logging
import os
from urllib.parse import urlparse
import connexion
from connexion import FlaskApi, ProblemException, problem
from flask import g, request
from flask_cors import CORS
from swagger_ui_bundle import swagger_ui_path
from backend.corpora.common.utils.aws import AwsSecret
from backend.c... | [
"backend.corpora.common.utils.aws.AwsSecret",
"flask_cors.CORS",
"flask.g.pop",
"connexion.FlaskApp",
"urllib.parse.urlparse",
"connexion.problem",
"os.getenv",
"logging.getLogger"
] | [((501, 594), 'connexion.FlaskApp', 'connexion.FlaskApp', (['f"""{APP_NAME}-{DEPLOYMENT_STAGE}"""'], {'specification_dir': '"""backend/config"""'}), "(f'{APP_NAME}-{DEPLOYMENT_STAGE}', specification_dir=\n 'backend/config')\n", (519, 594), False, 'import connexion\n'), ((1477, 1512), 'logging.getLogger', 'logging.ge... |
####
# test_basic.py:
#
# Basic CMake tests.
#
####
import os
import platform
import cmake
# Test a normal build, with the ref executable and static libraries
BUILD_DIR = os.path.join("<FPRIME>")
OPTIONS = {"CMAKE_BUILD_TYPE": "TESTING"}
TARGETS = ["all", "check"]
EXPECTED = [
os.path.join("bin", platform.system()... | [
"platform.system",
"cmake.register_test",
"os.path.join"
] | [((172, 196), 'os.path.join', 'os.path.join', (['"""<FPRIME>"""'], {}), "('<FPRIME>')\n", (184, 196), False, 'import os\n'), ((1713, 1752), 'cmake.register_test', 'cmake.register_test', (['__name__', '"""fp-uts"""'], {}), "(__name__, 'fp-uts')\n", (1732, 1752), False, 'import cmake\n'), ((303, 320), 'platform.system', ... |
import sys
import logging
import pymysql
import json
import os
#rds settings
rds_endpoint = os.environ['rds_endpoint']
username=os.environ['username']
password=os.environ['password']
db_name=os.environ['db_name']
logger = logging.getLogger()
logger.setLevel(logging.INFO)
#Connection
try:
connection = pymysql.con... | [
"sys.exit",
"pymysql.connect",
"logging.getLogger",
"json.dumps"
] | [((224, 243), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (241, 243), False, 'import logging\n'), ((309, 387), 'pymysql.connect', 'pymysql.connect', ([], {'host': 'rds_endpoint', 'user': 'username', 'passwd': 'password', 'db': 'db_name'}), '(host=rds_endpoint, user=username, passwd=password, db=db_name)... |
import Globals
import tkinter as tk
from tkinter import filedialog, INSERT, DISABLED, messagebox, NORMAL,simpledialog,\
PhotoImage, BOTH, Canvas, N, S, W, E, ALL, Frame, SUNKEN, Radiobutton, GROOVE, ACTIVE, \
FLAT, END, Scrollbar, HORIZONTAL, VERTICAL, ttk, TOP, RIGHT, LEFT, ttk
import os
from os.path import no... | [
"Globals.profiles_doseplan_text_image.width",
"Globals.DVH_doseplans_filenames.append",
"Globals.DVH_input_lateral_displacement.config",
"Globals.profiles_showPlanes_image.width",
"Globals.DVH_distance_reference_point_ROI.append",
"Globals.DCH_film_orientation.get",
"os.path.dirname",
"tkinter.filedia... | [((2165, 2176), 'numpy.zeros', 'np.zeros', (['(3)'], {}), '(3)\n', (2173, 2176), True, 'import numpy as np\n'), ((6927, 6938), 'numpy.zeros', 'np.zeros', (['(3)'], {}), '(3)\n', (6935, 6938), True, 'import numpy as np\n'), ((9940, 9951), 'numpy.zeros', 'np.zeros', (['(3)'], {}), '(3)\n', (9948, 9951), True, 'import num... |
import numpy as np
import sys
import pandas as pd
import matplotlib.pyplot as plt
# read in csv as data frame
data_val = pd.read_csv('val_event.csv',delimiter=' ')
data_mu = pd.read_csv('ylength_mu_michel.csv',delimiter=' ')
data_pi = pd.read_csv('ylength_pi.csv',delimiter=' ')
mergedmu = data_val.merge(data_mu, o... | [
"numpy.abs",
"pandas.read_csv",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"numpy.linspace",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig"
] | [((123, 166), 'pandas.read_csv', 'pd.read_csv', (['"""val_event.csv"""'], {'delimiter': '""" """'}), "('val_event.csv', delimiter=' ')\n", (134, 166), True, 'import pandas as pd\n'), ((177, 228), 'pandas.read_csv', 'pd.read_csv', (['"""ylength_mu_michel.csv"""'], {'delimiter': '""" """'}), "('ylength_mu_michel.csv', de... |
"""
Python Markdown
A Python implementation of <NAME>'s Markdown.
Documentation: https://python-markdown.github.io/
GitHub: https://github.com/Python-Markdown/markdown/
PyPI: https://pypi.org/project/Markdown/
Started by <NAME> (http://www.dwerg.net/).
Maintained for a few years by <NAME> (http://www.freewisdom.org)... | [
"markdown.extensions.toc.TocExtension"
] | [((2107, 2163), 'markdown.extensions.toc.TocExtension', 'TocExtension', ([], {'anchorlink': '(True)', 'anchorlink_class': '"""custom"""'}), "(anchorlink=True, anchorlink_class='custom')\n", (2119, 2163), False, 'from markdown.extensions.toc import TocExtension\n'), ((2702, 2767), 'markdown.extensions.toc.TocExtension',... |