code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#! /usr/bin/env python3
# Copyright (c) 2016, 2017 <NAME>
# MIT License
# 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... | [
"getpass.getpass",
"mailadmin.open_from_settings",
"mailadmin.gen_hash",
"sys.exit"
] | [((2232, 2249), 'getpass.getpass', 'getpass.getpass', ([], {}), '()\n', (2247, 2249), False, 'import getpass\n'), ((2260, 2303), 'getpass.getpass', 'getpass.getpass', ([], {'prompt': '"""Repeat password: """'}), "(prompt='Repeat password: ')\n", (2275, 2303), False, 'import getpass\n'), ((2429, 2451), 'mailadmin.gen_ha... |
import gameloop
gameloop.start_game()
| [
"gameloop.start_game"
] | [((16, 37), 'gameloop.start_game', 'gameloop.start_game', ([], {}), '()\n', (35, 37), False, 'import gameloop\n')] |
import boto3
from botocore.exceptions import ClientError
from time import sleep
from onelogin.api.client import OneLoginClient
#client_id = "<ONELOGIN CLIENT ID>"
#client_secret = "<ONELOGIN CLIENT SECRET>"
oclient = OneLoginClient("<ONELOGIN CLIENT ID>","<ONELOGIN CLIENT SECRET>")
client = boto3.client('workspaces'... | [
"onelogin.api.client.OneLoginClient",
"boto3.client",
"time.sleep"
] | [((219, 285), 'onelogin.api.client.OneLoginClient', 'OneLoginClient', (['"""<ONELOGIN CLIENT ID>"""', '"""<ONELOGIN CLIENT SECRET>"""'], {}), "('<ONELOGIN CLIENT ID>', '<ONELOGIN CLIENT SECRET>')\n", (233, 285), False, 'from onelogin.api.client import OneLoginClient\n'), ((295, 321), 'boto3.client', 'boto3.client', (['... |
import threading
from threading import Lock
# main function
def print_ln(lk, number, text):
lk.acquire()
print(f'{number}||{text}')
lk.release()
def main():
# Создаем блокиратор потока
lk = Lock()
# Создаем поток и передаем ему функцию для исполнения и аргументы
# Обозначаем поток как де... | [
"threading.Lock",
"threading.Thread"
] | [((214, 220), 'threading.Lock', 'Lock', ([], {}), '()\n', (218, 220), False, 'from threading import Lock\n'), ((436, 496), 'threading.Thread', 'threading.Thread', ([], {'target': 'print_ln', 'args': '(lk, i + 1, text[i])'}), '(target=print_ln, args=(lk, i + 1, text[i]))\n', (452, 496), False, 'import threading\n')] |
from flask import Flask, render_template, request
import pickle
import pandas as pd
def create_app():
APP = Flask(__name__)
@APP.route('/')
def form():
return render_template('base.html')
@APP.route('/data/', methods=['GET', 'POST'])
def data():
if request.met... | [
"pandas.DataFrame",
"flask.Flask",
"flask.render_template",
"flask.request.form.get"
] | [((120, 135), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (125, 135), False, 'from flask import Flask, render_template, request\n'), ((192, 220), 'flask.render_template', 'render_template', (['"""base.html"""'], {}), "('base.html')\n", (207, 220), False, 'from flask import Flask, render_template, reques... |
# -*- coding: utf-8 -*-
from __future__ import annotations
from pioreactor.automations.events import NoEvent
from pioreactor.automations.temperature.base import TemperatureAutomationJob
class Silent(TemperatureAutomationJob):
automation_name = "silent"
def __init__(self, **kwargs) -> None:
super(Si... | [
"pioreactor.automations.events.NoEvent"
] | [((461, 470), 'pioreactor.automations.events.NoEvent', 'NoEvent', ([], {}), '()\n', (468, 470), False, 'from pioreactor.automations.events import NoEvent\n')] |
#! /usr/bin/env python3
import rospy
from geometry_msgs.msg import Twist
# std_msgs가 아님
def fun():
rospy.init_node('simturtle_pub', anonymous=True)
# 본인의 노드
pub = rospy.Publisher('/turtle1/cmd_vel', Twist, queue_size=10)
# 받을 노드를 지정
twist = Twist()
# twist.linear.x=3.0
twist.linear.x=0.... | [
"rospy.Time.now",
"rospy.Publisher",
"geometry_msgs.msg.Twist",
"rospy.is_shutdown",
"rospy.init_node"
] | [((105, 153), 'rospy.init_node', 'rospy.init_node', (['"""simturtle_pub"""'], {'anonymous': '(True)'}), "('simturtle_pub', anonymous=True)\n", (120, 153), False, 'import rospy\n'), ((178, 235), 'rospy.Publisher', 'rospy.Publisher', (['"""/turtle1/cmd_vel"""', 'Twist'], {'queue_size': '(10)'}), "('/turtle1/cmd_vel', Twi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from libs.version import __version__
with open('README.md') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
# TODO: Different OS ... | [
"setuptools.setup",
"setuptools.find_packages"
] | [((371, 386), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (384, 386), False, 'from setuptools import setup, find_packages\n'), ((527, 1843), 'setuptools.setup', 'setup', ([], {'app': 'APP', 'name': '"""labelSeries"""', 'version': '__version__', 'description': '"""LabelSeries is a graphical image anno... |
import discord
from cogs.utils import checks
from discord.ext import commands
from .utils.dataIO import fileIO
from random import choice as randchoice
import os
import logging
import traceback
import aiohttp
log = logging.getLogger("ServerSydUtils")
class ServerSydUtils:
"""Insult Cog"""
def __init__(self, b... | [
"aiohttp.ClientSession",
"discord.ext.commands.command",
"cogs.utils.checks.is_owner",
"logging.getLogger"
] | [((215, 250), 'logging.getLogger', 'logging.getLogger', (['"""ServerSydUtils"""'], {}), "('ServerSydUtils')\n", (232, 250), False, 'import logging\n'), ((473, 491), 'discord.ext.commands.command', 'commands.command', ([], {}), '()\n', (489, 491), False, 'from discord.ext import commands\n'), ((497, 514), 'cogs.utils.ch... |
import numpy as np
# from scipy.fft import fft, ifft
from numpy.fft import fft, ifft, fftfreq, fftshift
import matplotlib.pyplot as plt
f = np.array([
1, 2-1j, -1j, -1+2j
])
print(f"The vector of values if {f}")
F = fft(f)
print(f"The fourier transform is {F}")
f_hat = ifft(F)
error = np.abs(f - f_hat)
print(f"... | [
"numpy.fft.ifft",
"numpy.abs",
"matplotlib.pyplot.show",
"numpy.fft.fft",
"numpy.fft.fftfreq",
"numpy.fft.fftshift",
"numpy.array",
"matplotlib.pyplot.subplots"
] | [((141, 182), 'numpy.array', 'np.array', (['[1, 2 - 1.0j, -1.0j, -1 + 2.0j]'], {}), '([1, 2 - 1.0j, -1.0j, -1 + 2.0j])\n', (149, 182), True, 'import numpy as np\n'), ((223, 229), 'numpy.fft.fft', 'fft', (['f'], {}), '(f)\n', (226, 229), False, 'from numpy.fft import fft, ifft, fftfreq, fftshift\n'), ((278, 285), 'numpy... |
import create
import time
robot = create.Create('/dev/ttyUSB0')
#robot.go(0, 100)
#time.sleep(10)
#robot.stop()
robot.demo(8)
time.sleep(30)
| [
"time.sleep",
"create.Create"
] | [((34, 63), 'create.Create', 'create.Create', (['"""/dev/ttyUSB0"""'], {}), "('/dev/ttyUSB0')\n", (47, 63), False, 'import create\n'), ((126, 140), 'time.sleep', 'time.sleep', (['(30)'], {}), '(30)\n', (136, 140), False, 'import time\n')] |
from random import randrange
# Opening file and declaring loop counter
f = open('num.txt', 'w')
def generator():
x = 0
# Generating nums
while x < 1000:
x += 1
irand = randrange(0, 1001)
f.write(str(irand))
f.write("\n")
| [
"random.randrange"
] | [((198, 216), 'random.randrange', 'randrange', (['(0)', '(1001)'], {}), '(0, 1001)\n', (207, 216), False, 'from random import randrange\n')] |
import os
import json
import yaml
from os.path import basename
from flask import Flask, render_template, jsonify
from flask_debugtoolbar import DebugToolbarExtension
from flask_caching import Cache
from flask_sqlalchemy import SQLAlchemy
from base.utils.data_utils import json_encoder
from base.utils.text_utils import r... | [
"flask_caching.Cache",
"flaskext.markdown.Markdown",
"flask.Flask",
"flask_sqlalchemy.SQLAlchemy",
"werkzeug.middleware.proxy_fix.ProxyFix",
"flask_debugtoolbar.DebugToolbarExtension",
"flask.render_template",
"os.getenv",
"flask_sslify.SSLify"
] | [((533, 575), 'flask.Flask', 'Flask', (['__name__'], {'static_url_path': '"""/static"""'}), "(__name__, static_url_path='/static')\n", (538, 575), False, 'from flask import Flask, render_template, jsonify\n'), ((604, 646), 'werkzeug.middleware.proxy_fix.ProxyFix', 'ProxyFix', (['app.wsgi_app'], {'x_for': '(1)', 'x_prot... |
"""
QUICK GUIDE:
Create a list of commands, that set up an environment for testing.
Use commands likes:
(move (ball) -47 -9.16 0 0 0) conforming to (move (ball) *x* *y* *direction* *delta_x* *delta_y*)
(move (player Team1 4) {0} {1} 0 0 0)) conforming to (move (player *team* *unum*) *x* *y* *direction* *delta_x*... | [
"random.randint",
"uppaal.strategy.generate_strategy",
"random.seed",
"random.getrandbits",
"geometry.Coordinate"
] | [((1343, 1367), 'random.seed', 'random.seed', (['random_seed'], {}), '(random_seed)\n', (1354, 1367), False, 'import random\n'), ((1445, 1468), 'random.randint', 'random.randint', (['(-20)', '(20)'], {}), '(-20, 20)\n', (1459, 1468), False, 'import random\n'), ((2350, 2371), 'random.randint', 'random.randint', (['(-5)'... |
import os
from flask import Flask, render_template
app = Flask(__name__)
env_config = os.getenv('APP_SETTINGS', 'config.DevelopmentConfig')
app.config.from_object(env_config)
import use_push_app.controllers.index_controller
| [
"flask.Flask",
"os.getenv"
] | [((58, 73), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (63, 73), False, 'from flask import Flask, render_template\n'), ((87, 140), 'os.getenv', 'os.getenv', (['"""APP_SETTINGS"""', '"""config.DevelopmentConfig"""'], {}), "('APP_SETTINGS', 'config.DevelopmentConfig')\n", (96, 140), False, 'import os\n')... |
#
# Copyright 2015-2019 CNRS-UM LIRMM, CNRS-AIST JRL
#
import mc_tasks
import mc_rbdyn
import eigen as e
from nose import with_setup
class TestMCTasks():
@classmethod
def setup_class(self):
self.robots = mc_rbdyn.Robots()
mc_rbdyn.RobotLoader.clear()
mc_rbdyn.RobotLoader.update_robot_module_path(["... | [
"mc_rbdyn.get_robot_module",
"eigen.Vector3d",
"mc_tasks.RelativeEndEffectorTask",
"mc_rbdyn.Robots",
"mc_rbdyn.RobotLoader.update_robot_module_path",
"mc_tasks.EndEffectorTask",
"mc_tasks.CoMTask",
"mc_tasks.PositionTask",
"mc_rbdyn.RobotLoader.clear",
"mc_tasks.OrientationTask",
"mc_tasks.forc... | [((217, 234), 'mc_rbdyn.Robots', 'mc_rbdyn.Robots', ([], {}), '()\n', (232, 234), False, 'import mc_rbdyn\n'), ((239, 267), 'mc_rbdyn.RobotLoader.clear', 'mc_rbdyn.RobotLoader.clear', ([], {}), '()\n', (265, 267), False, 'import mc_rbdyn\n'), ((272, 347), 'mc_rbdyn.RobotLoader.update_robot_module_path', 'mc_rbdyn.Robot... |
import os
from base64 import b64encode
__author__ = 'paxet'
APP_NAME = 'tyrachinas'
# SERVER_NAME = 'localhost'
SECRET_KEY = b64encode(os.urandom(64)).decode('utf-8')[:30]
WTF_CSRF_KEY = b64encode(os.urandom(64)).decode('utf-8')[:30]
WTF_CSRF_SECRET_KEY = b64encode(os.urandom(64)).decode('utf-8')[:30]
MAIL_SERVER =... | [
"os.urandom"
] | [((138, 152), 'os.urandom', 'os.urandom', (['(64)'], {}), '(64)\n', (148, 152), False, 'import os\n'), ((200, 214), 'os.urandom', 'os.urandom', (['(64)'], {}), '(64)\n', (210, 214), False, 'import os\n'), ((269, 283), 'os.urandom', 'os.urandom', (['(64)'], {}), '(64)\n', (279, 283), False, 'import os\n')] |
import sqlite3
###Part 2
print('###Part 2:\n')
#Open a connection to northwind_small.sqlite3
conn = sqlite3.connect('northwind_small.sqlite3')
curs = conn.cursor()
#Put the questions and quesries into lists:
questions = ['Q1: What are the ten most expensive items (per unit price) in the database?',
'Q2: Wh... | [
"sqlite3.connect"
] | [((102, 144), 'sqlite3.connect', 'sqlite3.connect', (['"""northwind_small.sqlite3"""'], {}), "('northwind_small.sqlite3')\n", (117, 144), False, 'import sqlite3\n')] |
import argparse
import sys
import logging
from easybackup import __version__
from easybackup.loader.yaml_composer import YamlComposer
from easybackup.logger import Logger
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger('easybackup')
Logger.add_logger(logger)
def parse_args():
"""Parse comman... | [
"easybackup.logger.Logger.add_logger",
"argparse.ArgumentParser",
"logging.basicConfig",
"logging.info",
"easybackup.loader.yaml_composer.YamlComposer",
"logging.getLogger"
] | [((173, 213), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (192, 213), False, 'import logging\n'), ((223, 254), 'logging.getLogger', 'logging.getLogger', (['"""easybackup"""'], {}), "('easybackup')\n", (240, 254), False, 'import logging\n'), ((255, 280), 'ea... |
"""Selenium browser tests."""
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
import unittest
# driver = webdriver.Firefox()
# driver.set_window_size('1024', '768')
# driver.get('https://www.google.com/')
# driver.quit()
class SandwichTest(unittest.TestCase):
"""."""
... | [
"selenium.webdriver.Firefox"
] | [((375, 394), 'selenium.webdriver.Firefox', 'webdriver.Firefox', ([], {}), '()\n', (392, 394), False, 'from selenium import webdriver\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import os
import re
import sys
from setuptools import find_packages, setup
def find_version(*file_paths):
version_file = read(*file_paths)
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file, re... | [
"os.path.dirname",
"re.search",
"setuptools.find_packages"
] | [((225, 298), 're.search', 're.search', (['"""^__version__ = [\'\\\\"]([^\'\\\\"]*)[\'\\\\"]"""', 'version_file', 're.M'], {}), '(\'^__version__ = [\\\'\\\\"]([^\\\'\\\\"]*)[\\\'\\\\"]\', version_file, re.M)\n', (234, 298), False, 'import re\n'), ((1734, 1749), 'setuptools.find_packages', 'find_packages', ([], {}), '()... |
import os
import glob
import wx
import chess
__all__ = ['Resources']
class Resources(object):
def __init__(self):
self.bitmaps = {}
self.bitmaps['r'] = wx.Bitmap('assets/pieces/br.png', wx.BITMAP_TYPE_PNG)
self.bitmaps['n'] = wx.Bitmap('assets/pieces/bn.png', wx.BITMAP_TYPE_PNG)
... | [
"wx.Bitmap"
] | [((177, 230), 'wx.Bitmap', 'wx.Bitmap', (['"""assets/pieces/br.png"""', 'wx.BITMAP_TYPE_PNG'], {}), "('assets/pieces/br.png', wx.BITMAP_TYPE_PNG)\n", (186, 230), False, 'import wx\n'), ((259, 312), 'wx.Bitmap', 'wx.Bitmap', (['"""assets/pieces/bn.png"""', 'wx.BITMAP_TYPE_PNG'], {}), "('assets/pieces/bn.png', wx.BITMAP_... |
"""media_worker.py
Celery worker to process media
created 3-feb-2020 by <EMAIL>
"""
import celery
from datetime import datetime
import logging
import os
from apicrud import initialize
from apicrud.exceptions import MediaUploadError
from apicrud.media.worker_processing import MediaProcessing
from apicrud.metrics imp... | [
"os.path.abspath",
"celery.Celery",
"apicrud.metrics.Metrics",
"apicrud.exceptions.MediaUploadError",
"datetime.datetime.utcnow",
"logging.info",
"apicrud.media.worker_processing.MediaProcessing"
] | [((391, 406), 'celery.Celery', 'celery.Celery', ([], {}), '()\n', (404, 406), False, 'import celery\n'), ((707, 724), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (722, 724), False, 'from datetime import datetime\n'), ((737, 766), 'apicrud.media.worker_processing.MediaProcessing', 'MediaProcessing',... |
# coding: utf-8
# # Figure SI 1: Global optimization over parameters
# This notebook contains the analysis of a direct global opimization over all four parameters ($p, q, c_{\rm constitutive}, p_{\rm uptake}$) of the model as a function of the pathogen statistics. It can be thought of as a supplement to Figure 1, mo... | [
"sys.path.append",
"analysis.printunique",
"analysis.plot_interior_boundary",
"evolimmune.polygons_from_boundaries",
"plotting.despine",
"evolimmune.phases_from_polygons",
"evolimmune.derived_quantities",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.style.use",
"analysis.loadnpz"
] | [((650, 676), 'sys.path.append', 'sys.path.append', (['"""../lib/"""'], {}), "('../lib/')\n", (665, 676), False, 'import sys\n'), ((869, 893), 'matplotlib.pyplot.style.use', 'plt.style.use', (["['paper']"], {}), "(['paper'])\n", (882, 893), True, 'import matplotlib.pyplot as plt\n'), ((950, 993), 'analysis.loadnpz', 'a... |
""" Drawing Hessian spectrum plots
Usage examples
$ python draw_hessian_spectrum.py --n-qubits 6 --n-layers-list 6 12 --lr 0.05
"""
import argparse
import shutil
import tempfile
from pathlib import Path
import jax
import jax.numpy as jnp
import matplotlib.pyplot as plt
import wandb
import qnnops
def iterate_arti... | [
"qnnops.alternating_layer_ansatz",
"argparse.ArgumentParser",
"jax.numpy.savez",
"jax.numpy.sort",
"matplotlib.pyplot.figure",
"pathlib.Path",
"jax.numpy.real",
"matplotlib.pyplot.tight_layout",
"tempfile.TemporaryDirectory",
"matplotlib.pyplot.close",
"jax.numpy.load",
"qnnops.energy",
"jax... | [((449, 460), 'wandb.Api', 'wandb.Api', ([], {}), '()\n', (458, 460), False, 'import wandb\n'), ((820, 832), 'pathlib.Path', 'Path', (['resdir'], {}), '(resdir)\n', (824, 832), False, 'from pathlib import Path\n'), ((2272, 2303), 'jax.numpy.linalg.eigvals', 'jnp.linalg.eigvals', (['hessian_mat'], {}), '(hessian_mat)\n'... |
# -*- coding: utf-8 -*-
import string
import pytest
from pytest_quickcheck.generator import IS_PY3
if IS_PY3:
unicode = str
@pytest.mark.randomize(i1=int, ncalls=1)
def test_generate_int_subs(i1):
assert isinstance(i1, int)
@pytest.mark.randomize(i1=int, min_num=0, max_num=2, ncalls=5)
def test_generate_int... | [
"pytest.mark.randomize"
] | [((132, 171), 'pytest.mark.randomize', 'pytest.mark.randomize', ([], {'i1': 'int', 'ncalls': '(1)'}), '(i1=int, ncalls=1)\n', (153, 171), False, 'import pytest\n'), ((237, 298), 'pytest.mark.randomize', 'pytest.mark.randomize', ([], {'i1': 'int', 'min_num': '(0)', 'max_num': '(2)', 'ncalls': '(5)'}), '(i1=int, min_num=... |
import pandas as pd
import torch
from dpwgan import DPWGAN, MultiCategoryGumbelSoftmax
def create_categorical_gan(noise_dim, hidden_dim, output_dims):
generator = torch.nn.Sequential(
torch.nn.Linear(noise_dim, hidden_dim),
torch.nn.ReLU(),
MultiCategoryGumbelSoftmax(hidden_dim, output_di... | [
"torch.nn.ReLU",
"pandas.crosstab",
"dpwgan.DPWGAN",
"torch.randn",
"torch.nn.Linear",
"torch.nn.LeakyReLU",
"dpwgan.MultiCategoryGumbelSoftmax"
] | [((582, 674), 'dpwgan.DPWGAN', 'DPWGAN', ([], {'generator': 'generator', 'discriminator': 'discriminator', 'noise_function': 'noise_function'}), '(generator=generator, discriminator=discriminator, noise_function=\n noise_function)\n', (588, 674), False, 'from dpwgan import DPWGAN, MultiCategoryGumbelSoftmax\n'), ((1... |
import pytest
from subject import add
@pytest.fixture
def mock_adder(mocker):
mocker.patch("subject.real_adder", autospec=True, return_value=42)
def test_adder(mock_adder):
assert add(1, 1) == 42
| [
"subject.add"
] | [((193, 202), 'subject.add', 'add', (['(1)', '(1)'], {}), '(1, 1)\n', (196, 202), False, 'from subject import add\n')] |
from crypto.PublicKey import RSA
def get_key():
""" Get RSA Keys """
return RSA.generate(2048)
def export_key(key):
""" Export RSA Keys """
with open('mykey.pem', 'a') as file:
file.write(key.export_key('PEM'))
file.close()
| [
"crypto.PublicKey.RSA.generate"
] | [((86, 104), 'crypto.PublicKey.RSA.generate', 'RSA.generate', (['(2048)'], {}), '(2048)\n', (98, 104), False, 'from crypto.PublicKey import RSA\n')] |
import os
import numpy as np
from tqdm import tqdm
import copy
import shutil
from data_info.data_info import DataInfo
from heatmap_generator.anisotropic_laplace_heatmap_generator import AnisotropicLaplaceHeatmapGenerator
class DatasetGenerator:
@classmethod
def generate_dataset(cls):
print('\nStep 1:... | [
"numpy.load",
"numpy.save",
"copy.deepcopy",
"os.makedirs",
"tqdm.tqdm",
"numpy.zeros",
"os.path.exists",
"heatmap_generator.anisotropic_laplace_heatmap_generator.AnisotropicLaplaceHeatmapGenerator",
"numpy.array",
"os.path.join",
"os.listdir"
] | [((838, 860), 'numpy.zeros', 'np.zeros', (['(400, 19, 2)'], {}), '((400, 19, 2))\n', (846, 860), True, 'import numpy as np\n'), ((884, 906), 'numpy.zeros', 'np.zeros', (['(400, 19, 2)'], {}), '((400, 19, 2))\n', (892, 906), True, 'import numpy as np\n'), ((931, 953), 'numpy.zeros', 'np.zeros', (['(400, 19, 2)'], {}), '... |
"""
Script for running over all instances of MVMC.
Since running the script can take a long time, it is possible to parallelize across
different machines using the --index and --skip arguments.
Examples:
python scripts/mvmc_driver.py --mvmc_path data/mvmc --index 0 --skip 1
"""
import argparse
import os
import su... | [
"argparse.ArgumentParser",
"tqdm.auto.tqdm",
"subprocess.call",
"os.path.join",
"os.listdir"
] | [((390, 415), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (413, 415), False, 'import argparse\n'), ((1144, 1185), 'tqdm.auto.tqdm', 'tqdm', (['instance_ids[args.index::args.skip]'], {}), '(instance_ids[args.index::args.skip])\n', (1148, 1185), False, 'from tqdm.auto import tqdm\n'), ((877, 9... |
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
CHROME_PATH = "C:/Program Files (x86)/chromedriver.exe"
FIREFOX_PATH = "C:/Program Files (x86)/geckodriver.exe"
def init_chrome_driver(path=CHROME_PATH):
op = webdriver.ChromeOptions()
op.add_argument('headless')
drive... | [
"selenium.webdriver.firefox.options.Options",
"selenium.webdriver.ChromeOptions",
"selenium.webdriver.Chrome",
"selenium.webdriver.Firefox"
] | [((252, 277), 'selenium.webdriver.ChromeOptions', 'webdriver.ChromeOptions', ([], {}), '()\n', (275, 277), False, 'from selenium import webdriver\n'), ((324, 358), 'selenium.webdriver.Chrome', 'webdriver.Chrome', (['path'], {'options': 'op'}), '(path, options=op)\n', (340, 358), False, 'from selenium import webdriver\n... |
'''
Produce Probability functions of LoS observables for sources in the distant universe, outside the constrained volume
several snapshots of the simulation are combined using cosmological data stacking (e.g., da Silva et al. 2000)
Note that the light-travel distance between snapshots exceeds the simulation volume (Vaz... | [
"sys.exit",
"multiprocessing.Pool"
] | [((1738, 1753), 'multiprocessing.Pool', 'Pool', (['N_workers'], {}), '(N_workers)\n', (1742, 1753), False, 'from multiprocessing import Pool\n'), ((1112, 1282), 'sys.exit', 'sys.exit', (['"""usage: ipython execute_MakeFarRays.py <number-of-LoS> <start-index> <number-processes/node> \n number-of-LoS should be multiple o... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG),
# acting on behalf of its Max Planck Institute for Intelligent Systems and the
# Max Planck Institute for Biological Cybernetics. All rights reserved.
#
# Max-Planck-Gesellschaft zur Förderung der Wissens... | [
"torch.nn.Parameter",
"numpy.load",
"human_body_prior.tools.model_loader.load_vposer",
"numpy.zeros",
"torch.cat",
"torch.no_grad",
"torch.tensor",
"numpy.repeat"
] | [((2797, 2863), 'numpy.repeat', 'np.repeat', (["smpl_dict['v_template'][np.newaxis]", 'batch_size'], {'axis': '(0)'}), "(smpl_dict['v_template'][np.newaxis], batch_size, axis=0)\n", (2806, 2863), True, 'import numpy as np\n'), ((2384, 2419), 'numpy.load', 'np.load', (['bm_path'], {'encoding': '"""latin1"""'}), "(bm_pat... |
from django.urls import path, include
from accounts.views import RegisterAPI, LoginAPI, UserAPI
from knox import views as know_views
from rest_framework import routers
urlpatterns = [
path('', include('knox.urls')),
path('register', RegisterAPI.as_view()),
path('login', LoginAPI.as_view()),
path('accou... | [
"accounts.views.RegisterAPI.as_view",
"knox.views.LogoutView.as_view",
"accounts.views.LoginAPI.as_view",
"django.urls.include",
"accounts.views.UserAPI.as_view"
] | [((198, 218), 'django.urls.include', 'include', (['"""knox.urls"""'], {}), "('knox.urls')\n", (205, 218), False, 'from django.urls import path, include\n'), ((242, 263), 'accounts.views.RegisterAPI.as_view', 'RegisterAPI.as_view', ([], {}), '()\n', (261, 263), False, 'from accounts.views import RegisterAPI, LoginAPI, U... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
from __future__ import print_function
import sys
import igraph
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from threading import Condition, Thread
from problog.formula import LogicFormula
from problog.program import PrologFile
from problog.logic import Term
... | [
"threading.Thread",
"problog.engine_stack.MessageOrder1.__init__",
"problog.formula.LogicFormula",
"problog.program.PrologFile",
"threading.Condition",
"igraph.Graph",
"problog.logic.term2str",
"problog.engine_stack.StackBasedEngine.__init__",
"problog.logic.Term",
"problog.engine.DefaultEngine"
] | [((9155, 9175), 'problog.program.PrologFile', 'PrologFile', (['filename'], {}), '(filename)\n', (9165, 9175), False, 'from problog.program import PrologFile\n'), ((9182, 9197), 'problog.engine.DefaultEngine', 'DefaultEngine', ([], {}), '()\n', (9195, 9197), False, 'from problog.engine import DefaultEngine\n'), ((9280, ... |
import unittest
from app.models import Jokes
class JokesTest(unittest.TestCase):
'''
Test class to test the behaviour of the jokes class
'''
def setUp(self):
'''
Set up method that will run before every test
'''
self.new_joke = Jokes("<NAME>", "Joke title", "This is a sa... | [
"app.models.Jokes"
] | [((277, 336), 'app.models.Jokes', 'Jokes', (['"""<NAME>"""', '"""Joke title"""', '"""This is a sample of a joke"""'], {}), "('<NAME>', 'Joke title', 'This is a sample of a joke')\n", (282, 336), False, 'from app.models import Jokes\n')] |
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
import re # noqa: F401
import sys # noqa: F401
from datadog_api_client.v2.api_clien... | [
"datadog_api_client.v2.api_client.ApiClient",
"datadog_api_client.v2.api_client.Endpoint"
] | [((1353, 2012), 'datadog_api_client.v2.api_client.Endpoint', '_Endpoint', ([], {'settings': "{'response_type': (LogsMetricResponse,), 'auth': ['apiKeyAuth',\n 'appKeyAuth'], 'endpoint_path': '/api/v2/logs/config/metrics',\n 'operation_id': 'create_logs_metric', 'http_method': 'POST', 'servers':\n None}", 'para... |
# -*- coding: utf-8 -*-
"""System transmission plots.
This code creates transmission line and interface plots.
@author: <NAME>, <NAME>
"""
import os
import logging
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib.colors as mcolors
import matplotlib.d... | [
"marmot.plottingmodules.plotutils.plot_exceptions.MissingInputData",
"matplotlib.pyplot.axes",
"marmot.plottingmodules.plotutils.plot_exceptions.InputSheetError",
"marmot.plottingmodules.plotutils.plot_exceptions.UnsupportedAggregation",
"numpy.arange",
"marmot.plottingmodules.plotutils.plot_exceptions.Da... | [((1941, 1985), 'logging.getLogger', 'logging.getLogger', (["('marmot_plot.' + __name__)"], {}), "('marmot_plot.' + __name__)\n", (1958, 1985), False, 'import logging\n'), ((2013, 2044), 'marmot.config.mconfig.parser', 'mconfig.parser', (['"""font_settings"""'], {}), "('font_settings')\n", (2027, 2044), True, 'import m... |
import os
import numpy as np
import h5py
import lsst.sims.photUtils as photUtils
import GCRCatalogs
from GCR import GCRQuery
import time
import argparse
import multiprocessing
def validate_chunk(data_in,
in_dir, healpix,
read_lock, write_lock, output_dict):
galaxy_id = data... | [
"numpy.abs",
"argparse.ArgumentParser",
"numpy.argsort",
"os.path.isfile",
"os.path.join",
"numpy.copy",
"GCR.GCRQuery",
"lsst.sims.photUtils.Sed",
"numpy.isfinite",
"numpy.random.RandomState",
"h5py.File",
"numpy.testing.assert_array_equal",
"lsst.sims.photUtils.getImsimFluxNorm",
"GCRCat... | [((1044, 1097), 'lsst.sims.photUtils.BandpassDict.loadTotalBandpassesFromFiles', 'photUtils.BandpassDict.loadTotalBandpassesFromFiles', ([], {}), '()\n', (1095, 1097), True, 'import lsst.sims.photUtils as photUtils\n'), ((1114, 1161), 'os.path.join', 'os.path.join', (['in_dir', "('sed_fit_%d.h5' % healpix)"], {}), "(in... |
import click
import httpx
import orjson
from click.exceptions import ClickException
@click.command()
@click.option(
"--source-url",
default="https://vial.calltheshots.us/api/searchSourceLocations",
help="API URL to fetch source locations from",
)
@click.option(
"--source-token",
help="API token to... | [
"orjson.loads",
"click.option",
"click.echo",
"click.command",
"click.exceptions.ClickException",
"orjson.dumps"
] | [((87, 102), 'click.command', 'click.command', ([], {}), '()\n', (100, 102), False, 'import click\n'), ((104, 255), 'click.option', 'click.option', (['"""--source-url"""'], {'default': '"""https://vial.calltheshots.us/api/searchSourceLocations"""', 'help': '"""API URL to fetch source locations from"""'}), "('--source-u... |
import numpy as np
def bb_iou(a, b):
a_x_tl = a[2]
a_y_tl = a[3]
a_x_br = a[0]
a_y_br = a[1]
b_x_tl = b[2]
b_y_tl = b[3]
b_x_br = b[0]
b_y_br = b[1]
# a_x_tl = a[0]-a[2]
# a_y_tl = a[1]-a[3]
# a_x_br = a[0]
# a_y_br = a[1]
#
# b_x_tl = b[0]-b[2]
# b_y_tl = ... | [
"numpy.shape"
] | [((928, 947), 'numpy.shape', 'np.shape', (['gt_bboxes'], {}), '(gt_bboxes)\n', (936, 947), True, 'import numpy as np\n')] |
import requests
from bs4 import BeautifulSoup
from datetime import datetime
import json
# This script uploads news from RSS feeds to staffbase channel
# The RSS feed url needs to be defined is the variable rssFeedUrl
# the staffbase channel to which we need to post is defined in variable staffbase_channel
# The api a... | [
"datetime.datetime.strftime",
"json.dumps",
"datetime.datetime.strptime",
"requests.get",
"bs4.BeautifulSoup"
] | [((522, 539), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (534, 539), False, 'import requests\n'), ((567, 595), 'bs4.BeautifulSoup', 'BeautifulSoup', (['response.text'], {}), '(response.text)\n', (580, 595), False, 'from bs4 import BeautifulSoup\n'), ((1029, 1085), 'datetime.datetime.strptime', 'datetime.... |
#! python3
import requests
resp = requests.get("http://clav-api.di.uminho.pt/v2/classes?nivel=3&apikey=<KEY>")
#print(resp.json())
for entrada in resp.json():
print(entrada)
| [
"requests.get"
] | [((35, 111), 'requests.get', 'requests.get', (['"""http://clav-api.di.uminho.pt/v2/classes?nivel=3&apikey=<KEY>"""'], {}), "('http://clav-api.di.uminho.pt/v2/classes?nivel=3&apikey=<KEY>')\n", (47, 111), False, 'import requests\n')] |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | [
"pulumi.get",
"pulumi.getter",
"pulumi.ResourceOptions",
"pulumi.set"
] | [((1955, 1991), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""billingAccount"""'}), "(name='billingAccount')\n", (1968, 1991), False, 'import pulumi\n'), ((5517, 5553), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""billingAccount"""'}), "(name='billingAccount')\n", (5530, 5553), False, 'import pulumi\n'), (... |
"""
Support for IntesisHome Smart AC Controllers
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/intesishome/
"""
import logging
# from datetime import timedelta
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassis... | [
"voluptuous.Optional",
"voluptuous.All",
"voluptuous.Required",
"pyintesishome.IntesisHome",
"homeassistant.components.persistent_notification.create",
"homeassistant.helpers.discovery.async_load_platform",
"logging.getLogger"
] | [((563, 590), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (580, 590), False, 'import logging\n'), ((1275, 1311), 'pyintesishome.IntesisHome', 'IntesisHome', (['_user', '_pass', 'hass.loop'], {}), '(_user, _pass, hass.loop)\n', (1286, 1311), False, 'from pyintesishome import IntesisHome... |
from setuptools import setup, find_packages
import pathlib
import os
here = pathlib.Path(__file__).parent.resolve()
long_description = (here / 'README_pypi.md').read_text(encoding='utf-8')
setup(
name='graphnet',
version=os.environ['GRAPHNET_VERSION'],
description='A python library for graph manipulati... | [
"pathlib.Path",
"setuptools.find_packages"
] | [((916, 931), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (929, 931), False, 'from setuptools import setup, find_packages\n'), ((77, 99), 'pathlib.Path', 'pathlib.Path', (['__file__'], {}), '(__file__)\n', (89, 99), False, 'import pathlib\n')] |
# -*- coding: utf-8 -*-
# Copyright © 2015 The Coil Contributors
# Copyright © 2014 <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 limitatio... | [
"webbrowser.open"
] | [((2331, 2389), 'webbrowser.open', 'webbrowser.open', (['"""http://coil.readthedocs.org/admin/setup"""'], {}), "('http://coil.readthedocs.org/admin/setup')\n", (2346, 2389), False, 'import webbrowser\n')] |
import sys
sys.path.append('..')
import numpy as np
import math
from geneticalgorithm import geneticalgorithm as ga
def f(X):
dim = len(X)
OF = 0
for i in range (0, dim):
OF+=(X[i]**2)-10*math.cos(2*math.pi*X[i])+10
return OF
def test_rastrigin():
parameters={'max_num_iteration': 1000,
... | [
"sys.path.append",
"numpy.array",
"math.cos",
"geneticalgorithm.geneticalgorithm"
] | [((11, 32), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (26, 32), False, 'import sys\n'), ((749, 778), 'numpy.array', 'np.array', (['([[-5.12, 5.12]] * 2)'], {}), '([[-5.12, 5.12]] * 2)\n', (757, 778), True, 'import numpy as np\n'), ((790, 907), 'geneticalgorithm.geneticalgorithm', 'ga', ([], ... |
"""
Main file for quail carotenoid data
"""
# import modules
import ANDfunctions_Main as m
# main function
def main():
headers = ""
bird, except_files, list_except, alt_calc, outfile_name = m.storeData()
m.modifyData(bird, except_files, list_except, alt_calc)
m.getOutput(bird, headers, outfile_name)
... | [
"ANDfunctions_Main.storeData",
"ANDfunctions_Main.modifyData",
"ANDfunctions_Main.getOutput"
] | [((200, 213), 'ANDfunctions_Main.storeData', 'm.storeData', ([], {}), '()\n', (211, 213), True, 'import ANDfunctions_Main as m\n'), ((218, 273), 'ANDfunctions_Main.modifyData', 'm.modifyData', (['bird', 'except_files', 'list_except', 'alt_calc'], {}), '(bird, except_files, list_except, alt_calc)\n', (230, 273), True, '... |
import tensorflow as tf
from functools import reduce
class Loss(object):
def __init__(self, model, weight=1.):
self._model = model
self._weight = weight
def __call__(self, *args, **kwargs):
raise NotImplementedError
class CustomScore(Loss):
def __init__(self, model, weight, score_func):
super... | [
"tensorflow.nn.l2_loss"
] | [((979, 1044), 'tensorflow.nn.l2_loss', 'tf.nn.l2_loss', (['(image[:, 1:, :, :] - image[:, :shape[1] - 1, :, :])'], {}), '(image[:, 1:, :, :] - image[:, :shape[1] - 1, :, :])\n', (992, 1044), True, 'import tensorflow as tf\n'), ((1074, 1139), 'tensorflow.nn.l2_loss', 'tf.nn.l2_loss', (['(image[:, :, 1:, :] - image[:, :... |
import webbrowser
class openyt:
def openyt():
urL='https://www.youtube.com/'
chrome_path="C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
webbrowser.register('chrome', None,webbrowser.BackgroundBrowser(chrome_path))
webbrowser.get('chrome').open_new(urL) | [
"webbrowser.BackgroundBrowser",
"webbrowser.get"
] | [((217, 258), 'webbrowser.BackgroundBrowser', 'webbrowser.BackgroundBrowser', (['chrome_path'], {}), '(chrome_path)\n', (245, 258), False, 'import webbrowser\n'), ((268, 292), 'webbrowser.get', 'webbrowser.get', (['"""chrome"""'], {}), "('chrome')\n", (282, 292), False, 'import webbrowser\n')] |
from random import seed
def benchmark(problems, algorithms, stop_criterion, runs=10, seeds=None):
"""A function to perform multiple algorithms on multiple soltions.
Note that the problems, algorithms and the stop criterion all need to have
the method reset method properly implemented for this function to... | [
"random.seed"
] | [((2810, 2817), 'random.seed', 'seed', (['i'], {}), '(i)\n', (2814, 2817), False, 'from random import seed\n')] |
from typing import Any, Dict, Union
import ignite.distributed as idist
import torch
from data import prepare_image_mask
from ignite.engine import DeterministicEngine, Engine, Events
from ignite.metrics import Metric
from torch.cuda.amp import GradScaler, autocast
from torch.nn import Module
from torch.optim import Opt... | [
"torch.cuda.amp.autocast",
"ignite.engine.DeterministicEngine",
"ignite.distributed.get_world_size",
"ignite.engine.Engine",
"utils.model_output_transform",
"torch.cuda.amp.GradScaler",
"torch.no_grad"
] | [((651, 685), 'torch.cuda.amp.GradScaler', 'GradScaler', ([], {'enabled': 'config.use_amp'}), '(enabled=config.use_amp)\n', (661, 685), False, 'from torch.cuda.amp import GradScaler, autocast\n'), ((1396, 1431), 'ignite.engine.DeterministicEngine', 'DeterministicEngine', (['train_function'], {}), '(train_function)\n', ... |
import json
import pytest
from polyIntersect import app
# data
from .sample_data import BRAZIL_USER_POLY
from .sample_data import INDONESIA_USER_POLY
# test flask client
app = app.test_client()
# slow = pytest.mark.skipif(
# not pytest.config.getoption("--runslow"),
# reason="need --runslow option to run"... | [
"polyIntersect.app.test_client"
] | [((181, 198), 'polyIntersect.app.test_client', 'app.test_client', ([], {}), '()\n', (196, 198), False, 'from polyIntersect import app\n')] |
import numpy as np
from glip.math import mat4
def test_is_similarity():
assert mat4.is_similarity(mat4.translate(4.0, 56.7, 2.3))
assert mat4.is_similarity(mat4.rotate_axis_angle(0, 1, 0, 0.453))
assert mat4.is_similarity(mat4.scale(1, -1, 1))
assert not mat4.is_similarity(mat4.scale(2, 1, 1))
as... | [
"glip.math.mat4.translate",
"numpy.random.randn",
"glip.math.mat4.rotate_axis_angle",
"glip.math.mat4.scale"
] | [((104, 134), 'glip.math.mat4.translate', 'mat4.translate', (['(4.0)', '(56.7)', '(2.3)'], {}), '(4.0, 56.7, 2.3)\n', (118, 134), False, 'from glip.math import mat4\n'), ((166, 204), 'glip.math.mat4.rotate_axis_angle', 'mat4.rotate_axis_angle', (['(0)', '(1)', '(0)', '(0.453)'], {}), '(0, 1, 0, 0.453)\n', (188, 204), F... |
# Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code mus... | [
"pyrado.tasks.reward_functions.ZeroPerStepRewFcn",
"pyrado.TypeErr"
] | [((3520, 3539), 'pyrado.tasks.reward_functions.ZeroPerStepRewFcn', 'ZeroPerStepRewFcn', ([], {}), '()\n', (3537, 3539), False, 'from pyrado.tasks.reward_functions import RewFcn, ZeroPerStepRewFcn\n'), ((3007, 3060), 'pyrado.TypeErr', 'pyrado.TypeErr', ([], {'given': 'env_spec', 'expected_type': 'EnvSpec'}), '(given=env... |
from xml.dom import ValidationErr
from market.models import User
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, SubmitField, ValidationError
from wtforms.validators import Length, EqualTo, Email, DataRequired
class RegisterForm(FlaskForm):
username = StringField(label='User name:... | [
"wtforms.ValidationError",
"wtforms.validators.Email",
"wtforms.validators.Length",
"market.models.User.query.filter_by",
"wtforms.SubmitField",
"wtforms.validators.EqualTo",
"wtforms.validators.DataRequired"
] | [((690, 725), 'wtforms.SubmitField', 'SubmitField', ([], {'label': '"""Create Account"""'}), "(label='Create Account')\n", (701, 725), False, 'from wtforms import StringField, PasswordField, SubmitField, ValidationError\n'), ((1302, 1330), 'wtforms.SubmitField', 'SubmitField', ([], {'label': '"""Sign in"""'}), "(label=... |
#!/usr/bin/python3
""" This module contains a function that handles all server endpoints. """
# import modules.
import logging
import os
from . import dependency_error, log_manager
from .handlers.api_handler import ApiHandler
from .handlers.filesystem_handler import FilesystemHandler
from .handlers.index_ha... | [
"os.path.abspath",
"logging.debug",
"tornado.ioloop.IOLoop.instance",
"os.path.isdir",
"logging.info",
"os.path.isfile",
"logging.NullHandler",
"concurrent.futures.ThreadPoolExecutor",
"tornado.web.Application",
"logging.getLogger"
] | [((3726, 3753), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (3743, 3753), False, 'import logging\n'), ((6268, 6311), 'concurrent.futures.ThreadPoolExecutor', 'ThreadPoolExecutor', ([], {'max_workers': 'max_threads'}), '(max_workers=max_threads)\n', (6286, 6311), False, 'from concurrent... |
import numpy as np
import copy
import pickle
# Data loading related
def load_from_pickle(filename, n_jets):
jets = []
fd = open(filename, "rb")
for i in range(n_jets):
jet = pickle.load(fd)
jets.append(jet)
fd.close()
return jets
# Jet related
def _pt(v):
pz = v[2]
p... | [
"copy.deepcopy",
"numpy.arctan2",
"numpy.log",
"numpy.zeros",
"numpy.isfinite",
"pickle.load",
"numpy.array",
"numpy.where",
"numpy.exp",
"numpy.cosh"
] | [((1061, 1079), 'copy.deepcopy', 'copy.deepcopy', (['jet'], {}), '(jet)\n', (1074, 1079), False, 'import copy\n'), ((1631, 1649), 'copy.deepcopy', 'copy.deepcopy', (['jet'], {}), '(jet)\n', (1644, 1649), False, 'import copy\n'), ((2803, 2821), 'copy.deepcopy', 'copy.deepcopy', (['jet'], {}), '(jet)\n', (2816, 2821), Fa... |
'''
Created on 18.02.2012
@author: SIGIESEC
'''
from base.project_default import DefaultProjectFile
from cpp.incl_deps.include_resolver_util import (
DefaultIncludePathCanonicalizerFactory, IncludeDirectiveNormalizer,
FuzzyResolverInternal)
from test.unit_tests.commons.os_util_test import MockOsPath
import po... | [
"test.unit_tests.commons.os_util_test.MockOsPath",
"unittest.skip",
"cpp.incl_deps.include_resolver_util.IncludeDirectiveNormalizer.has_line_include_directive",
"base.project_default.DefaultProjectFile"
] | [((4033, 4087), 'unittest.skip', 'unittest.skip', (['"""TODO: this should work OS-independent"""'], {}), "('TODO: this should work OS-independent')\n", (4046, 4087), False, 'import unittest\n'), ((565, 659), 'cpp.incl_deps.include_resolver_util.IncludeDirectiveNormalizer.has_line_include_directive', 'IncludeDirectiveNo... |
# 09
# Sampling
import tacoma as tc
from demo_utils import pl, disp
from tacoma.analysis import plot_group_size_histogram
from tacoma.interactive import visualize
fw = tc.load_json_taco('./fw_exmpl.json')
groups = tc.measure_group_sizes_and_durations(fw)
fig, ax = pl.subplots(1,1)
plot_group_size_histogram(gr... | [
"tacoma.measure_group_sizes_and_durations",
"demo_utils.pl.show",
"demo_utils.pl.subplots",
"tacoma.load_json_taco",
"tacoma.interactive.visualize",
"tacoma.analysis.plot_group_size_histogram",
"tacoma.sample"
] | [((175, 211), 'tacoma.load_json_taco', 'tc.load_json_taco', (['"""./fw_exmpl.json"""'], {}), "('./fw_exmpl.json')\n", (192, 211), True, 'import tacoma as tc\n'), ((222, 262), 'tacoma.measure_group_sizes_and_durations', 'tc.measure_group_sizes_and_durations', (['fw'], {}), '(fw)\n', (258, 262), True, 'import tacoma as t... |
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
"solar.core.log.log.debug",
"solar_agent.client.SolarAgentClient",
"solar.core.transports.base.Executor",
"solar.core.transports.base.SolarRunResult"
] | [((1234, 1351), 'solar_agent.client.SolarAgentClient', 'SolarAgentClient', ([], {'auth': "{'user': user, 'auth': auth}", 'transport_args': '(host, port)', 'transport_class': 'transport_class'}), "(auth={'user': user, 'auth': auth}, transport_args=(host,\n port), transport_class=transport_class)\n", (1250, 1351), Fal... |
from __future__ import division
from __future__ import print_function
import os
# name of the django settings module
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
from google.appengine.ext import vendor
vendor.add('lib') # add third party libs to "lib" folder.
| [
"google.appengine.ext.vendor.add"
] | [((209, 226), 'google.appengine.ext.vendor.add', 'vendor.add', (['"""lib"""'], {}), "('lib')\n", (219, 226), False, 'from google.appengine.ext import vendor\n')] |
import os, sklearn, pandas, numpy as np
from sklearn import svm
import skimage, skimage.io, skimage.filters
import matplotlib.pyplot as plt
## NN libs
import keras
from sklearn.decomposition import PCA
from keras.utils import to_categorical
from keras.layers import Dense, Activation
from keras.optimizers import SGD, A... | [
"data.extract_all",
"data.textlabels_to_numerical",
"data.init_dataset",
"data.show_info",
"keras.utils.to_categorical"
] | [((363, 382), 'data.init_dataset', 'data.init_dataset', ([], {}), '()\n', (380, 382), False, 'import data, config, image\n'), ((461, 508), 'data.extract_all', 'data.extract_all', (['dataset', 'dataset.train[0:amt]'], {}), '(dataset, dataset.train[0:amt])\n', (477, 508), False, 'import data, config, image\n'), ((532, 58... |
#Embedded file name: shopex_api_inj.py
import urllib
if 0:
i11iIiiIii
def assign(service, arg):
if service == 'shopex':
return (True, arg)
if 0:
O0 / iIii1I11I1II1 % OoooooooOO - i1IIi
def audit(arg):
o0OO00 = {'act': 'search_sub_regions',
'api_version': '1.0',
'retu... | [
"urllib.urlencode"
] | [((677, 701), 'urllib.urlencode', 'urllib.urlencode', (['o0OO00'], {}), '(o0OO00)\n', (693, 701), False, 'import urllib\n')] |
from unittest import TestCase
import os
from opengenomebrowser_tools.rename_eggnog import *
ROOT = os.path.dirname(os.path.dirname(__file__))
TMPFILE = '/tmp/renamed_eggnog.eggnog'
eggnogs = [
f'{ROOT}/test-data/prokka-bad/out.emapper.annotations',
f'{ROOT}/test-data/pgap-bad/out.emapper.annotations',
]
de... | [
"os.path.dirname",
"os.path.isfile",
"os.remove"
] | [((117, 142), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (132, 142), False, 'import os\n'), ((340, 363), 'os.path.isfile', 'os.path.isfile', (['TMPFILE'], {}), '(TMPFILE)\n', (354, 363), False, 'import os\n'), ((373, 391), 'os.remove', 'os.remove', (['TMPFILE'], {}), '(TMPFILE)\n', (382, ... |
import sklearn
import numpy as np
import sklearn.datasets as skdata
from matplotlib import pyplot as plt
boston_housing_data = skdata.load_boston()
print(boston_housing_data)
x = boston_housing_data.data
feat_names = boston_housing_data.feature_names
print(feat_names)
#print(boston_housing_data.DESCR)
y = boston_... | [
"matplotlib.pyplot.show",
"sklearn.datasets.load_boston",
"matplotlib.pyplot.figure",
"numpy.max",
"numpy.min"
] | [((128, 148), 'sklearn.datasets.load_boston', 'skdata.load_boston', ([], {}), '()\n', (146, 148), True, 'import sklearn.datasets as skdata\n'), ((390, 402), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (400, 402), True, 'from matplotlib import pyplot as plt\n'), ((2491, 2503), 'matplotlib.pyplot.figure',... |
from setuptools import setup
setup(name='moodle_quiz_md2xml',
version='1.0',
description='Tool and module to convert strictly formatted Markdown files to Moodle\'s XML format which can be '
'imported easily',
url='https://github.com/ComSys-OVGU/moodle-quiz-md2xml',
author='<NAME>',
author_email='<... | [
"setuptools.setup"
] | [((30, 587), 'setuptools.setup', 'setup', ([], {'name': '"""moodle_quiz_md2xml"""', 'version': '"""1.0"""', 'description': '"""Tool and module to convert strictly formatted Markdown files to Moodle\'s XML format which can be imported easily"""', 'url': '"""https://github.com/ComSys-OVGU/moodle-quiz-md2xml"""', 'author'... |
import uuid
import os
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
from django.contrib.auth.models import PermissionsMixin
from django.conf import settings
def product_image_file_path(instance, filename):
"""Generate file path for new product image"""
e... | [
"django.db.models.ManyToManyField",
"uuid.uuid4",
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.EmailField",
"django.db.models.ImageField",
"django.db.models.DecimalField",
"django.db.models.IntegerField",
"os.path.join"
] | [((400, 442), 'os.path.join', 'os.path.join', (['"""uploads/product/"""', 'filename'], {}), "('uploads/product/', filename)\n", (412, 442), False, 'import os\n'), ((1232, 1278), 'django.db.models.EmailField', 'models.EmailField', ([], {'max_length': '(255)', 'unique': '(True)'}), '(max_length=255, unique=True)\n', (124... |
import os
from .. import constants
from .. import helper
class Tag:
def __init__(self, tagname):
self.__tagname = tagname
self.__post_links = []
self.__output_top_tag_path = constants.TAGS_DIR + '/' + tagname + '/top'
self.__output_recent_tag_path = constants.TAGS_DIR + '/' + tag... | [
"os.path.exists"
] | [((398, 440), 'os.path.exists', 'os.path.exists', (['self.__output_top_tag_path'], {}), '(self.__output_top_tag_path)\n', (412, 440), False, 'import os\n'), ((515, 560), 'os.path.exists', 'os.path.exists', (['self.__output_recent_tag_path'], {}), '(self.__output_recent_tag_path)\n', (529, 560), False, 'import os\n')] |
from pygame import sprite
from game.Bloques import BloqueSerpiente
class Snake(sprite.Group):
longitudBase = "2"
defDirection = 2
def __init__(self, tablero, longitud, direccion = 0, velocidad = None, pos = None, inicio = 0):
sprite.Group.__init__(self)
self.tablero = tablero
self.direccion = self.defDirectio... | [
"game.Bloques.BloqueSerpiente",
"pygame.sprite.Group.__init__"
] | [((232, 259), 'pygame.sprite.Group.__init__', 'sprite.Group.__init__', (['self'], {}), '(self)\n', (253, 259), False, 'from pygame import sprite\n'), ((918, 976), 'game.Bloques.BloqueSerpiente', 'BloqueSerpiente', (['celda', 'orden', 'self.direccion', '(0)', 'restante'], {}), '(celda, orden, self.direccion, 0, restante... |
import pandas as pd
import numpy as np
import sklearn
import warnings
import sys
# sys.path.append('Feature Comparison/Basic.py')
from sklearn.naive_bayes import GaussianNB
from sklearn.naive_bayes import MultinomialNB
from sklearn.svm import SVC
from sklearn.linear_model import LogisticRegression
from sklearn.metric... | [
"pandas.DataFrame",
"sklearn.naive_bayes.GaussianNB",
"numpy.load",
"sklearn.naive_bayes.MultinomialNB",
"warnings.filterwarnings",
"pandas.read_csv",
"sklearn.model_selection.cross_val_score",
"sklearn.metrics.accuracy_score",
"sklearn.preprocessing.MinMaxScaler",
"numpy.hstack",
"sklearn.linea... | [((1042, 1133), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {'category': 'FutureWarning', 'module': '"""sklearn"""', 'lineno': '(196)'}), "('ignore', category=FutureWarning, module='sklearn',\n lineno=196)\n", (1065, 1133), False, 'import warnings\n'), ((1130, 1221), 'warnings.filterwarn... |
import json
from march_madness.settings import ACTUAL_EXCLUDE_YEARS
from march_madness.models.bracket import BracketActual, BracketSimulator
class PrinterOverall(object):
def __init__(self, years, predictor, print_years=False):
"""
Print out the accuracy of a simulated bracket for the given years... | [
"march_madness.models.bracket.BracketSimulator",
"march_madness.models.bracket.BracketActual",
"json.dumps"
] | [((627, 655), 'march_madness.models.bracket.BracketSimulator', 'BracketSimulator', (['year', 'pred'], {}), '(year, pred)\n', (643, 655), False, 'from march_madness.models.bracket import BracketActual, BracketSimulator\n'), ((899, 918), 'march_madness.models.bracket.BracketActual', 'BracketActual', (['year'], {}), '(yea... |
from pylightnix import ( RRef, Build, rref2path, rref2dref, match_some,
realizeMany, match_latest, store_buildtime, store_buildelta, store_context,
BuildArgs, mkdrv, build_wrapper, match_only, build_setoutpaths, readjson )
from stagedml.stages.all import *
from stagedml.stages.bert_finetune_glue import ( Model... | [
"stagedml.imports.sys.environ.get",
"official.nlp.bert.classifier_data_lib.convert_single_example",
"numpy.argmax",
"official.nlp.bert.classifier_data_lib.InputExample",
"pylightnix.store_context",
"tensorflow.constant",
"pylightnix.build_wrapper",
"stagedml.imports.sys.json_dump",
"stagedml.stages.... | [((1178, 1210), 'stagedml.imports.sys.environ.get', 'environ.get', (['"""REPIMG"""', 'genimgdir'], {}), "('REPIMG', genimgdir)\n", (1189, 1210), False, 'from stagedml.imports.sys import read_csv, OrderedDict, DataFrame, makedirs, json_dump, environ, contextmanager\n'), ((1212, 1246), 'stagedml.imports.sys.makedirs', 'm... |
from kepler import *
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import streamlit as st
import streamlit.components.v1 as components
test = keplerCalc()
el = test.ellipse()
x = el[0]
y = el[1]
def update_line(i, x,y ,line):
ax.patches = []
x = x[i]
y = y[i]
... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.ylim",
"streamlit.title",
"matplotlib.animation.FuncAnimation",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.Circle",
"numpy.random.rand",
"matplotlib.pyplot.xlabel"
] | [((456, 468), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (466, 468), True, 'import matplotlib.pyplot as plt\n'), ((586, 607), 'numpy.random.rand', 'np.random.rand', (['(2)', '(25)'], {}), '(2, 25)\n', (600, 607), True, 'import numpy as np\n'), ((616, 670), 'matplotlib.pyplot.Circle', 'plt.Circle', (['(... |
# main_application.py
#
#
# Author <NAME>
# Created for ThinkerFarm Edge project.
#
# main_application.py is main application structure class
from main_imports import *
from ui.init_ui import *
import dlib.cuda as cuda
os.environ["OPENCV_FFMPEG_CAPTURE_OPTIONS"] = "rtsp_transport;0"
class main_application:
d... | [
"dlib.cuda.get_num_devices"
] | [((865, 887), 'dlib.cuda.get_num_devices', 'cuda.get_num_devices', ([], {}), '()\n', (885, 887), True, 'import dlib.cuda as cuda\n')] |
import os
from os import path
from lxml import etree
import regex
HERE = path.abspath(path.split(__file__)[0])
re_urn = regex.compile(r'^[^\.]+\.[^\.]+\.[^\-]+-([^\.]+)(?=\.xml$)')
with open(path.join(HERE, 'ca_template.xml')) as f:
template = f.read()
def parse_urn(fname):
match = re_urn.search(path.split(... | [
"lxml.etree.ETXPath",
"lxml.etree.fromstring",
"regex.findall",
"regex.compile",
"lxml.etree.indent",
"regex.sub",
"lxml.etree.tostring",
"os.path.split",
"os.path.join"
] | [((122, 188), 'regex.compile', 'regex.compile', (['"""^[^\\\\.]+\\\\.[^\\\\.]+\\\\.[^\\\\-]+-([^\\\\.]+)(?=\\\\.xml$)"""'], {}), "('^[^\\\\.]+\\\\.[^\\\\.]+\\\\.[^\\\\-]+-([^\\\\.]+)(?=\\\\.xml$)')\n", (135, 188), False, 'import regex\n'), ((499, 542), 'lxml.etree.tostring', 'etree.tostring', (['element'], {'encoding':... |
from urllib.parse import urlparse
import collections
import logging
import requests
import validators
from nameko.dependency_providers import Config
from nameko.events import event_handler, EventDispatcher
from .logger import LoggingDependency
from .storages import RedisStorage
HEAD_TIMEOUT = 10 # in seconds
GET_T... | [
"requests.adapters.HTTPAdapter",
"requests.Session",
"validators.url",
"nameko.events.event_handler",
"collections.namedtuple",
"nameko.events.EventDispatcher",
"nameko.dependency_providers.Config",
"urllib.parse.urlparse"
] | [((385, 470), 'collections.namedtuple', 'collections.namedtuple', (['"""Response"""', "['status_code', 'headers', 'url', 'history']"], {}), "('Response', ['status_code', 'headers', 'url', 'history']\n )\n", (407, 470), False, 'import collections\n'), ((527, 545), 'requests.Session', 'requests.Session', ([], {}), '()... |
# This file is part of the Reproducible and Reusable Data Analysis Workflow
# Server (flowServ).
#
# Copyright (C) 2019-2021 NYU.
#
# flowServ is free software; you can redistribute it and/or modify it under the
# terms of the MIT License; see LICENSE file for more details.
"""Administrator command line interface to c... | [
"flowserv.util.read_object",
"click.argument",
"click.option",
"click.UsageError",
"flowserv.client.cli.table.ResultTable",
"click.command",
"click.echo",
"flowserv.model.workflow.manifest.read_instructions",
"click.Path",
"click.group",
"flowserv.client.api.service"
] | [((846, 861), 'click.command', 'click.command', ([], {}), '()\n', (859, 861), False, 'import click\n'), ((863, 940), 'click.option', 'click.option', (['"""-k"""', '"""--key"""'], {'required': '(False)', 'help': '"""Workflow application key."""'}), "('-k', '--key', required=False, help='Workflow application key.')\n", (... |
from __future__ import annotations
import numpy as np
import pandas as pd
from sklearn import datasets
from IMLearn.metrics import mean_square_error
from IMLearn.utils import split_train_test
from IMLearn.model_selection import cross_validate
from IMLearn.learners.regressors import PolynomialFitting, LinearRegression, ... | [
"numpy.random.uniform",
"numpy.random.seed",
"IMLearn.learners.regressors.RidgeRegression",
"plotly.graph_objects.Figure",
"sklearn.datasets.load_diabetes",
"numpy.argmin",
"IMLearn.learners.regressors.PolynomialFitting",
"IMLearn.model_selection.cross_validate",
"IMLearn.utils.split_train_test",
... | [((1383, 1429), 'IMLearn.utils.split_train_test', 'split_train_test', (['X', 'y'], {'train_proportion': '(2 / 3)'}), '(X, y, train_proportion=2 / 3)\n', (1399, 1429), False, 'from IMLearn.utils import split_train_test\n'), ((1440, 1451), 'plotly.graph_objects.Figure', 'go.Figure', ([], {}), '()\n', (1449, 1451), True, ... |
import datetime
from tools.desks_reservation_func import initializeCalendar, calendar_config
from tmp_tab import desk_reservations
if __name__ == '__main__':
CAL = initializeCalendar()
page_token = None
result = calendar_config()
time_min = datetime.datetime.now() - datetime.timedelta(days=5)
time... | [
"tools.desks_reservation_func.initializeCalendar",
"tools.desks_reservation_func.calendar_config",
"datetime.datetime.strptime",
"datetime.timedelta",
"datetime.datetime.now"
] | [((170, 190), 'tools.desks_reservation_func.initializeCalendar', 'initializeCalendar', ([], {}), '()\n', (188, 190), False, 'from tools.desks_reservation_func import initializeCalendar, calendar_config\n'), ((226, 243), 'tools.desks_reservation_func.calendar_config', 'calendar_config', ([], {}), '()\n', (241, 243), Fal... |
#!/usr/bin/env python3
import os
import shutil
import sys
__author__ = 'jacob'
class ProgressBar(object):
def __init__(self, message, width=20, progressSymbol=u'▣ ', emptySymbol=u'□ '):
self.width = width
if self.width < 0:
self.width = 0
self.message = message
self... | [
"sys.stdout.write",
"os.makedirs",
"os.path.isdir",
"os.walk",
"os.path.exists",
"sys.stdout.flush",
"os.path.join",
"shutil.copy"
] | [((1104, 1128), 'os.path.isdir', 'os.path.isdir', (['directory'], {}), '(directory)\n', (1117, 1128), False, 'import os\n'), ((853, 886), 'sys.stdout.write', 'sys.stdout.write', (['progressMessage'], {}), '(progressMessage)\n', (869, 886), False, 'import sys\n'), ((895, 913), 'sys.stdout.flush', 'sys.stdout.flush', ([]... |
import pandas as pd
import matplotlib.pyplot as plt
# %matplotlib inline
df = pd.read_csv('datasci/datasets/student.txt',sep=',',low_memory=False)
df.head()
#df.shape
#df.isnull().sum()
a = ['2555','2556','2557']
df = df[~df['YEAR'].isin(a)]
df['YEAR'].value_counts()
import seaborn as sns
sns.set_style('whitegrid')
... | [
"pandas.DataFrame",
"seaborn.set_style",
"seaborn.lineplot",
"pandas.read_csv",
"matplotlib.pyplot.figure",
"seaborn.countplot"
] | [((78, 148), 'pandas.read_csv', 'pd.read_csv', (['"""datasci/datasets/student.txt"""'], {'sep': '""","""', 'low_memory': '(False)'}), "('datasci/datasets/student.txt', sep=',', low_memory=False)\n", (89, 148), True, 'import pandas as pd\n'), ((293, 319), 'seaborn.set_style', 'sns.set_style', (['"""whitegrid"""'], {}), ... |
from sklearn.feature_selection import SelectFromModel
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.datasets import load_iris
iris = load_iris()
#GBDT作为基模型的特征选择
#print(SelectFromModel(GradientBoostingClassifier()).fit_transform(iris.data, iris.target))
selector = SelectFromModel(GradientBoosting... | [
"sklearn.ensemble.GradientBoostingClassifier",
"sklearn.datasets.load_iris"
] | [((157, 168), 'sklearn.datasets.load_iris', 'load_iris', ([], {}), '()\n', (166, 168), False, 'from sklearn.datasets import load_iris\n'), ((304, 332), 'sklearn.ensemble.GradientBoostingClassifier', 'GradientBoostingClassifier', ([], {}), '()\n', (330, 332), False, 'from sklearn.ensemble import GradientBoostingClassifi... |
"""
The MIT License (MIT)
Copyright (c) 2017 <NAME>
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import numpy as np
import scipy as scp
import logging
logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s',
... | [
"matplotlib.pyplot.show",
"logging.basicConfig",
"warp.PredictionWarper",
"torch.squeeze",
"logging.info",
"localseg.data_generators.loader2.get_data_loader",
"matplotlib.pyplot.figure",
"localseg.data_generators.loader2.default_conf.copy",
"torch.tensor",
"torch.all"
] | [((246, 357), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s %(levelname)s %(message)s"""', 'level': 'logging.INFO', 'stream': 'sys.stdout'}), "(format='%(asctime)s %(levelname)s %(message)s', level=\n logging.INFO, stream=sys.stdout)\n", (265, 357), False, 'import logging\n'), ((541, ... |
'''
5. Longest Palindromic Substring
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.
Example:
Input: "babad"
Output: "bab"
Note: "aba" is also a valid answer.
Example:
Input: "cbbd"
Output: "bb"
'''
class Solution(object):
#... | [
"unittest.main"
] | [((2250, 2265), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2263, 2265), False, 'import unittest\n')] |
import threading
import unittest
import tensorflow as tf
import numpy as np
import fedlearner.common.fl_logging as logging
from fedlearner.fedavg import train_from_keras_model
(x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data()
x_train = x_train.reshape(x_train.shape[0], -1).astype(np.float32) /... | [
"unittest.main",
"threading.Thread",
"fedlearner.fedavg.train_from_keras_model",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.optimizers.SGD",
"tensorflow.keras.datasets.mnist.load_data",
"numpy.isclose",
"fedlearner.common.fl_logging.se... | [((216, 251), 'tensorflow.keras.datasets.mnist.load_data', 'tf.keras.datasets.mnist.load_data', ([], {}), '()\n', (249, 251), True, 'import tensorflow as tf\n'), ((3083, 3109), 'fedlearner.common.fl_logging.set_level', 'logging.set_level', (['"""debug"""'], {}), "('debug')\n", (3100, 3109), True, 'import fedlearner.com... |
#! /usr/bin/env python3
import os
import time
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import norm
from sklearn.datasets import make_blobs
from lib_dist_app import plt_data, nns
# ### do a loop for the number of dimensions and the values of p.
ti = time.time()
np.random.seed(0)
N = 601
n... | [
"matplotlib.pyplot.tight_layout",
"numpy.random.seed",
"lib_dist_app.nns",
"matplotlib.pyplot.close",
"sklearn.datasets.make_blobs",
"time.time",
"lib_dist_app.plt_data",
"numpy.mean",
"numpy.max",
"matplotlib.pyplot.subplots"
] | [((280, 291), 'time.time', 'time.time', ([], {}), '()\n', (289, 291), False, 'import time\n'), ((292, 309), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (306, 309), True, 'import numpy as np\n'), ((1880, 1973), 'sklearn.datasets.make_blobs', 'make_blobs', ([], {'n_samples': 'n_samples', 'centers': 'ce... |
# Generated by Django 3.2.5 on 2021-07-24 09:45
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Booking',
fields=[
('id', models.BigAutoFie... | [
"django.db.models.BigAutoField",
"django.db.models.CharField",
"django.db.models.BooleanField",
"django.db.models.DecimalField",
"django.db.models.DateTimeField"
] | [((303, 399), 'django.db.models.BigAutoField', 'models.BigAutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (322, 399), False, 'from django.db import migrations, m... |
# Copyright © 2022 Province of British Columbia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | [
"entity_filer.filing_processors.filing_components.name_request.has_new_nr_for_filing",
"entity_filer.filing_processors.filing_components.business_profile.update_business_profile",
"entity_filer.filing_processors.filing_components.name_request.consume_nr",
"entity_filer.filing_processors.filing_components.busi... | [((3883, 3909), 'datetime.datetime.utcnow', 'datetime.datetime.utcnow', ([], {}), '()\n', (3907, 3909), False, 'import datetime\n'), ((5785, 5859), 'entity_filer.filing_processors.filing_components.create_party', 'create_party', ([], {'business_id': 'business.id', 'party_info': 'party_info', 'create': '(False)'}), '(bu... |
#!/usr/bin/env python
from azuremodules import *
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument('-d', '--duration', help='specify how long run time(seconds) for the stress testing', required=True, type=int)
parser.add_argument('-p', '--package', help='spcecify package name to keep d... | [
"argparse.ArgumentParser"
] | [((96, 112), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (110, 112), False, 'from argparse import ArgumentParser\n')] |
from __future__ import print_function
import numpy as np
c0prop = np.array([4, -2, 0, 0, 5]) # Frosting
c1prop = np.array([0, 5, -1, 0, 8]) # Candy
c2prop = np.array([-1, 0, 5, 0, 6]) # Butterscotch
c3prop = np.array([0, 0, -2, 2, 1]) # Sugar
max_score = 0
max_500_score = 0
for c0 in range(101):
for c1 in... | [
"numpy.outer",
"numpy.array",
"numpy.arange",
"numpy.prod"
] | [((67, 93), 'numpy.array', 'np.array', (['[4, -2, 0, 0, 5]'], {}), '([4, -2, 0, 0, 5])\n', (75, 93), True, 'import numpy as np\n'), ((116, 142), 'numpy.array', 'np.array', (['[0, 5, -1, 0, 8]'], {}), '([0, 5, -1, 0, 8])\n', (124, 142), True, 'import numpy as np\n'), ((162, 188), 'numpy.array', 'np.array', (['[-1, 0, 5,... |
"""
Copyright 2015 Brocade Communications Systems, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed t... | [
"clicrud.device.generic.ver.base.ssh",
"clicrud.device.generic.ver.base.telnet"
] | [((968, 987), 'clicrud.device.generic.ver.base.telnet', 'baseTelnet', ([], {}), '(**_args)\n', (978, 987), True, 'from clicrud.device.generic.ver.base import telnet as baseTelnet\n'), ((1119, 1135), 'clicrud.device.generic.ver.base.ssh', 'baseSSH', ([], {}), '(**_args)\n', (1126, 1135), True, 'from clicrud.device.gener... |
import time
import importlib
import configparser
from pyspark.sql import SparkSession
CONFIG = configparser.ConfigParser()
CONFIG.read("config.ini")
def run_job():
""" Main function excecuted by spark-submit command"""
spark = SparkSession.builder.appName(CONFIG["spark"]["app_name"]).getOrCreate()
job_... | [
"configparser.ConfigParser",
"pyspark.sql.SparkSession.builder.appName",
"importlib.import_module",
"time.time"
] | [((97, 124), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (122, 124), False, 'import configparser\n'), ((366, 413), 'importlib.import_module', 'importlib.import_module', (['f"""src.jobs.{job_name}"""'], {}), "(f'src.jobs.{job_name}')\n", (389, 413), False, 'import importlib\n'), ((432, 44... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 12 12:07:33 2020
@author: student
"""
import numpy as np
import tensorflow as tf
from base_functions import one_one
# File path for saving the tfrecords files
path = '/home/student/Work/Keras/GAN/mySRGAN/new_implementation/multiGPU_datasetAPI/cust... | [
"tensorflow.train.Int64List",
"tensorflow.reshape",
"matplotlib.pyplot.figure",
"tensorflow.train.FloatList",
"numpy.random.randn",
"matplotlib.pyplot.close",
"matplotlib.pyplot.imshow",
"tensorflow.io.decode_raw",
"base_functions.one_one",
"tensorflow.train.BytesList",
"numpy.save",
"tensorfl... | [((1597, 1640), 'tensorflow.keras.datasets.fashion_mnist.load_data', 'tf.keras.datasets.fashion_mnist.load_data', ([], {}), '()\n', (1638, 1640), True, 'import tensorflow as tf\n'), ((1693, 1720), 'numpy.expand_dims', 'np.expand_dims', (['x_train', '(-1)'], {}), '(x_train, -1)\n', (1707, 1720), True, 'import numpy as n... |
import pytest
from anchore_engine.auth.common import registry_record_matches
def test_registry_record_matches():
exact_matches = [
('docker.io/library/centos', 'docker.io', 'library/centos'),
('docker.io', 'docker.io', 'centos'),
('docker.io', 'docker.io', 'myuser/myrepo')
]
wildca... | [
"anchore_engine.auth.common.registry_record_matches"
] | [((839, 889), 'anchore_engine.auth.common.registry_record_matches', 'registry_record_matches', (['test[0]', 'test[1]', 'test[2]'], {}), '(test[0], test[1], test[2])\n', (862, 889), False, 'from anchore_engine.auth.common import registry_record_matches\n'), ((941, 991), 'anchore_engine.auth.common.registry_record_matche... |
from ssockets import server
myserver = server("127.0.0.1", 60006)
data = myserver.recv()
myserver.save_keys("./server_keys.pem")
| [
"ssockets.server"
] | [((40, 66), 'ssockets.server', 'server', (['"""127.0.0.1"""', '(60006)'], {}), "('127.0.0.1', 60006)\n", (46, 66), False, 'from ssockets import server\n')] |
from common_game_functions import *
from Agents.common_player_functions import *
from Agents.player import Player, Action
import time
import copy
import random
def count_card_list(knowledge, ls):
for card in ls:
remove_card(card, knowledge)
def count_board(knowledge, board):
for i in range(len(board... | [
"Agents.player.Action",
"copy.deepcopy"
] | [((610, 632), 'copy.deepcopy', 'copy.deepcopy', (['weights'], {}), '(weights)\n', (623, 632), False, 'import copy\n'), ((9711, 9733), 'Agents.player.Action', 'Action', (['DISCARD'], {'cnr': '(0)'}), '(DISCARD, cnr=0)\n', (9717, 9733), False, 'from Agents.player import Player, Action\n'), ((3670, 3693), 'Agents.player.A... |
from datetime import datetime
import os
import pytz
from pytz import timezone
project_urls = {}
projects = os.listdir('all')
for project in projects:
git_config = os.path.join('all', project, '.git', 'config')
with open(git_config, encoding='utf-8') as f:
for line in f:
if line.strip().sta... | [
"datetime.datetime.now",
"os.path.join",
"os.listdir",
"pytz.timezone"
] | [((109, 126), 'os.listdir', 'os.listdir', (['"""all"""'], {}), "('all')\n", (119, 126), False, 'import os\n'), ((1575, 1597), 'pytz.timezone', 'timezone', (['"""US/Central"""'], {}), "('US/Central')\n", (1583, 1597), False, 'from pytz import timezone\n'), ((169, 215), 'os.path.join', 'os.path.join', (['"""all"""', 'pro... |