code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# -*- coding: utf-8 -*-
"""
---------------------------------------
@file : 2P_demo_multi
@Version : ??
@Author : <NAME>
@software: PyCharm
@For :
---------------------------------------
"""
# History:
# 2021/8/29: Create
import PnP_Demo
import os
def demo_ver(input, output):
pic_obj = PnP_Demo.load_ima... | [
"os.listdir",
"PnP_Demo.img_resize",
"PnP_Demo.load_image",
"PnP_Demo.write_exif",
"os.path.splitext",
"PnP_Demo.load_exif",
"PnP_Demo.img_sign_text_draw",
"os.path.join",
"os.chdir"
] | [((303, 329), 'PnP_Demo.load_image', 'PnP_Demo.load_image', (['input'], {}), '(input)\n', (322, 329), False, 'import PnP_Demo\n'), ((334, 368), 'PnP_Demo.img_resize', 'PnP_Demo.img_resize', (['pic_obj', '(1050)'], {}), '(pic_obj, 1050)\n', (353, 368), False, 'import PnP_Demo\n'), ((384, 409), 'PnP_Demo.load_exif', 'PnP... |
# This module defines functions that can be used to check whether OpenMP is
# available and if so what flags to use. To use this, import the
# add_openmp_flags_if_available function in a setup_package.py file where you
# are defining your extensions:
#
# from astropy_helpers.openmp_helpers import add_openmp_flags_i... | [
"distutils.log.warn",
"os.mkdir",
"os.path.abspath",
"distutils.ccompiler.new_compiler",
"subprocess.check_output",
"tempfile.mkdtemp",
"distutils.sysconfig.customize_compiler",
"distutils.log.info",
"os.path.join",
"os.chdir"
] | [((1318, 1332), 'distutils.ccompiler.new_compiler', 'new_compiler', ([], {}), '()\n', (1330, 1332), False, 'from distutils.ccompiler import new_compiler\n'), ((1337, 1366), 'distutils.sysconfig.customize_compiler', 'customize_compiler', (['ccompiler'], {}), '(ccompiler)\n', (1355, 1366), False, 'from distutils.sysconfi... |
# - pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
# - pip install --upgrade oauth2client
# - pip install gspread
import os, sys
import json
from googleapiclient.discovery import build
from oauth2client.service_account import ServiceAccountCredentials ## googledrive 인증
PATH... | [
"googleapiclient.discovery.build"
] | [((830, 891), 'googleapiclient.discovery.build', 'build', (['api_name', "api_spec['version']"], {'credentials': 'credentials'}), "(api_name, api_spec['version'], credentials=credentials)\n", (835, 891), False, 'from googleapiclient.discovery import build\n')] |
import re
from steem import Steem
from steem.amount import Amount
from steem.post import Post
from dateutil.parser import parse
from steembase.exceptions import PostDoesNotExist
from flask import Flask, render_template, abort, request, redirect, jsonify
import redis, requests
app = Flask(__name__)
def get_steemd_... | [
"redis.Redis",
"steem.post.Post",
"dateutil.parser.parse",
"flask.request.args.get",
"flask.redirect",
"steem.Steem",
"flask.request.form.get",
"flask.Flask",
"steem.amount.Amount",
"flask.abort",
"flask.jsonify",
"flask.render_template",
"requests.get",
"re.sub"
] | [((287, 302), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (292, 302), False, 'from flask import Flask, render_template, abort, request, redirect, jsonify\n'), ((391, 404), 'redis.Redis', 'redis.Redis', ([], {}), '()\n', (402, 404), False, 'import redis, requests\n'), ((343, 384), 'steem.Steem', 'Steem',... |
import csv
import os
import shutil
import subprocess
from pathlib import Path
import yaml
from cached_property import cached_property
from ebi_eva_common_pyutils import command_utils
from ebi_eva_common_pyutils.config import cfg
from ebi_eva_common_pyutils.config_utils import get_mongo_uri_for_eva_profile, get_primary... | [
"os.makedirs",
"ebi_eva_common_pyutils.config_utils.get_mongo_uri_for_eva_profile",
"csv.writer",
"yaml.safe_dump",
"ebi_eva_common_pyutils.metadata_utils.resolve_variant_warehouse_db_name",
"eva_submission.eload_utils.provision_new_database_for_variant_warehouse",
"eva_submission.assembly_taxonomy_inse... | [((1763, 1857), 'ebi_eva_common_pyutils.config_utils.get_mongo_uri_for_eva_profile', 'get_mongo_uri_for_eva_profile', (["cfg['maven']['environment']", "cfg['maven']['settings_file']"], {}), "(cfg['maven']['environment'], cfg['maven'][\n 'settings_file'])\n", (1792, 1857), False, 'from ebi_eva_common_pyutils.config_u... |
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, <NAME>, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must r... | [
"rosbag.Bag"
] | [((1703, 1753), 'rosbag.Bag', 'rosbag.Bag', (['"""test/migrated_explicit_gen3.bag"""', '"""w"""'], {}), "('test/migrated_explicit_gen3.bag', 'w')\n", (1713, 1753), False, 'import rosbag\n'), ((1889, 1939), 'rosbag.Bag', 'rosbag.Bag', (['"""test/migrated_implicit_gen3.bag"""', '"""w"""'], {}), "('test/migrated_implicit_... |
# Broj nekretnina za prodaju koje imaju parking, u odnosu na ukupan broj nekretnina za prodaju (samo za Beograd).
import json
import matplotlib.pyplot as plt
import numpy as np
dict_json = {'Ima parking': 0, 'Ukupno nekretnina': 0}
def plotting():
labels = ['Ima parking', 'Ukupno nekretnina']
x =... | [
"json.load",
"matplotlib.pyplot.show",
"json.dumps",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig"
] | [((514, 528), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (526, 528), True, 'import matplotlib.pyplot as plt\n'), ((920, 960), 'matplotlib.pyplot.savefig', 'plt.savefig', (['"""izgradjene_nekretnine.png"""'], {}), "('izgradjene_nekretnine.png')\n", (931, 960), True, 'import matplotlib.pyplot as plt\... |
# Copyright 2015 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | [
"oslo_log.log.getLogger",
"osc_lib.utils.get_dict_properties",
"json.dumps",
"os.environ.get",
"osc_lib.utils.get_item_properties",
"zaqarclient._i18n._"
] | [((1526, 1562), 'zaqarclient._i18n._', '_', (['"""Post messages for a given queue"""'], {}), "('Post messages for a given queue')\n", (1527, 1562), False, 'from zaqarclient._i18n import _\n'), ((1573, 1618), 'oslo_log.log.getLogger', 'logging.getLogger', (["(__name__ + '.PostMessages')"], {}), "(__name__ + '.PostMessag... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""A script for running some tests on the envs."""
import gym
from stable_baselines3.common.env_checker import check_env
from gym_simplifiedtetris.register import env_list
def main() -> None:
"""
Check if each env created is compliant with the OpenAI Gym API
... | [
"stable_baselines3.common.env_checker.check_env",
"gym.make"
] | [((632, 650), 'gym.make', 'gym.make', (['env_name'], {}), '(env_name)\n', (640, 650), False, 'import gym\n'), ((659, 701), 'stable_baselines3.common.env_checker.check_env', 'check_env', ([], {'env': 'env', 'skip_render_check': '(True)'}), '(env=env, skip_render_check=True)\n', (668, 701), False, 'from stable_baselines3... |
#!/usr/bin/env python
from pathlib import Path
import pandas as pd
import numpy as np
import os
import datetime
import pickle
from sklearn.linear_model import SGDClassifier
from sklearn.metrics import accuracy_score
class FraudDetectionModelTrainer:
def __init__(
self,
train_dataset_path,
... | [
"pickle.dump",
"os.makedirs",
"sklearn.linear_model.SGDClassifier",
"sklearn.metrics.accuracy_score",
"os.path.exists",
"pathlib.Path",
"pickle.load",
"pandas.read_pickle",
"datetime.datetime.now"
] | [((1166, 1209), 'sklearn.metrics.accuracy_score', 'accuracy_score', (['features_prediction', 'labels'], {}), '(features_prediction, labels)\n', (1180, 1209), False, 'from sklearn.metrics import accuracy_score\n'), ((1296, 1324), 'pandas.read_pickle', 'pd.read_pickle', (['dataset_path'], {}), '(dataset_path)\n', (1310, ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Case',
fields=[
('id', models.AutoField(primary... | [
"django.db.models.CharField",
"django.db.models.DateTimeField",
"django.db.models.AutoField"
] | [((296, 389), 'django.db.models.AutoField', 'models.AutoField', ([], {'primary_key': '(True)', 'serialize': '(False)', 'auto_created': '(True)', 'verbose_name': '"""ID"""'}), "(primary_key=True, serialize=False, auto_created=True,\n verbose_name='ID')\n", (312, 389), False, 'from django.db import models, migrations\... |
"""
Example script to do acquire a composite survey image using stage shift.
The script uses the center 50% of the image, shifts the stage by the appropriate amount
in x, y directions, and stitches the resulting images together into a larger super image.
To use:
Run Nion Swift and get a good image
Set the def... | [
"nionlib.api.get_instrument_by_id",
"math.radians",
"numpy.empty",
"nionlib.api.get_hardware_source_by_id",
"math.sin",
"time.time",
"math.cos"
] | [((5764, 5781), 'math.radians', 'math.radians', (['(-23)'], {}), '(-23)\n', (5776, 5781), False, 'import math\n'), ((1386, 1443), 'nionlib.api.get_hardware_source_by_id', 'nionlib.api.get_hardware_source_by_id', (['"""nionccd1010"""', '"""1"""'], {}), "('nionccd1010', '1')\n", (1423, 1443), False, 'import nionlib\n'), ... |
"""
An extention to DBAPI-2.0 for more easily building SQL statements.
This extension allows you to call a DBAPI Cursor's execute method with a string
that contains format specifiers for escaped and/or unescaped arguments. Escaped
arguments are specified using `` %X `` or `` %S `` (capital X or capital S).
You can al... | [
"unittest.main",
"itertools.imap",
"io.StringIO",
"collections._iskeyword",
"datetime.date",
"itertools.count",
"sqlite3.connect",
"itertools.izip",
"pprint.pprint",
"re.search",
"operator.itemgetter",
"re.sub",
"re.compile"
] | [((4888, 4941), 're.compile', 're.compile', (["('%%(\\\\(([a-zA-Z0-9_]+)\\\\))?(%s)' % re_fmt)"], {}), "('%%(\\\\(([a-zA-Z0-9_]+)\\\\))?(%s)' % re_fmt)\n", (4898, 4941), False, 'import re\n'), ((15903, 15929), 're.compile', 're.compile', (['"""[^a-zA-Z0-9]"""'], {}), "('[^a-zA-Z0-9]')\n", (15913, 15929), False, 'import... |
import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
stdout = logging.StreamHandler()
stdout.setLevel(logging.DEBUG)
formatter = logging.Formatter('[%(asctime)s] %(levelname)s: %(message)s')
stdout.setFormatter(formatter)
logger.addHandler(stdout)
| [
"logging.Formatter",
"logging.StreamHandler",
"logging.getLogger"
] | [((26, 53), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (43, 53), False, 'import logging\n'), ((94, 117), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (115, 117), False, 'import logging\n'), ((161, 222), 'logging.Formatter', 'logging.Formatter', (['"""[%(asctime)... |
import os
from datetime import datetime
import torch.distributed as dist
from cprint import cprint
def dprint(text):
pid = os.getpid()
now = datetime.now().strftime("%m-%d %I:%M:%S:%f %p")
rank = dist.get_rank() if dist.is_available() and dist.is_initialized() else -1
cprint(rank, f"[{rank}]({pid}){n... | [
"cprint.cprint",
"torch.distributed.is_initialized",
"os.getpid",
"torch.distributed.get_rank",
"torch.distributed.is_available",
"datetime.datetime.now"
] | [((130, 141), 'os.getpid', 'os.getpid', ([], {}), '()\n', (139, 141), False, 'import os\n'), ((288, 334), 'cprint.cprint', 'cprint', (['rank', 'f"""[{rank}]({pid}){now} - {text}"""'], {}), "(rank, f'[{rank}]({pid}){now} - {text}')\n", (294, 334), False, 'from cprint import cprint\n'), ((211, 226), 'torch.distributed.ge... |
# @date 2018-08-07
# @author <NAME>, All rights reserved without prejudices.
# @license Copyright (c) 2018 Dream Overflow
# www.bitmex.com watcher implementation
from __future__ import annotations
from typing import Union
import re
import time
import traceback
import math
from datetime import datetime
from common.... | [
"database.database.Database.inst",
"time.sleep",
"time.time",
"trader.market.Market",
"datetime.datetime.strptime",
"traceback.format_exc",
"common.utils.UTC",
"logging.getLogger",
"re.compile"
] | [((633, 673), 'logging.getLogger', 'logging.getLogger', (['"""siis.watcher.bitmex"""'], {}), "('siis.watcher.bitmex')\n", (650, 673), False, 'import logging\n'), ((688, 725), 'logging.getLogger', 'logging.getLogger', (['"""siis.exec.bitmex"""'], {}), "('siis.exec.bitmex')\n", (705, 725), False, 'import logging\n'), ((7... |
import json
import logging
from ssl import SSLContext
from typing import Dict, Union, List, Optional
import aiohttp
from aiohttp import BasicAuth, ClientSession
from slack.errors import SlackApiError
from .internal_utils import _debug_log_response, _build_request_headers, _build_body
from .webhook_response import Web... | [
"aiohttp.ClientTimeout",
"slack.errors.SlackApiError",
"logging.getLogger",
"json.dumps"
] | [((495, 522), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (512, 522), False, 'import logging\n'), ((4315, 4331), 'json.dumps', 'json.dumps', (['body'], {}), '(body)\n', (4325, 4331), False, 'import json\n'), ((4850, 4891), 'aiohttp.ClientTimeout', 'aiohttp.ClientTimeout', ([], {'total'... |
from flask import jsonify, request
from wrappers import dictionary_wrapper
from validators import dictionary_validator
from utils.nft_errors import abort, NFTError, NFTValidationError
def dictionaries():
'''
GET:
List all dictionaries in the system
POST:
Create a new dictionary in the system
... | [
"wrappers.dictionary_wrapper.update_dictionary",
"wrappers.dictionary_wrapper.create_dictionary",
"wrappers.dictionary_wrapper.list_all_dictionaries",
"flask.jsonify",
"flask.request.get_json",
"wrappers.dictionary_wrapper.get_dictionary",
"utils.nft_errors.abort"
] | [((494, 547), 'wrappers.dictionary_wrapper.create_dictionary', 'dictionary_wrapper.create_dictionary', (['dictionary_json'], {}), '(dictionary_json)\n', (530, 547), False, 'from wrappers import dictionary_wrapper\n'), ((567, 597), 'flask.jsonify', 'jsonify', ([], {'dictionary': 'dictionary'}), '(dictionary=dictionary)\... |
from rest_framework import status
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.authtoken.models import Token
from django.contrib.auth import authenticate
from rest_framework import mixins
from rest_framework.viewsets import GenericViewSet
from accounts.model... | [
"accounts.serializers.LoginSerializer",
"rest_framework.authtoken.models.Token.objects.get_or_create",
"rest_framework.response.Response",
"django.contrib.auth.authenticate",
"accounts.models.User.objects.all"
] | [((479, 497), 'accounts.models.User.objects.all', 'User.objects.all', ([], {}), '()\n', (495, 497), False, 'from accounts.models import User\n'), ((618, 652), 'accounts.serializers.LoginSerializer', 'LoginSerializer', ([], {'data': 'request.data'}), '(data=request.data)\n', (633, 652), False, 'from accounts.serializers... |
# This sample tests that type aliases can consist of
# partially-specialized classes that can be further
# specialized.
# pyright: strict
from typing import Callable, Generic, Literal, Tuple, Optional, TypeVar
from typing_extensions import ParamSpec
T = TypeVar("T")
P = ParamSpec("P")
ValidationResult = Tuple[bool,... | [
"typing.TypeVar",
"typing_extensions.ParamSpec"
] | [((257, 269), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (264, 269), False, 'from typing import Callable, Generic, Literal, Tuple, Optional, TypeVar\n'), ((274, 288), 'typing_extensions.ParamSpec', 'ParamSpec', (['"""P"""'], {}), "('P')\n", (283, 288), False, 'from typing_extensions import ParamSpec\n')... |
# Author: <NAME>
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
try:
import cPickle as pickle
except:
import pickle
import os
import active_learners.helper as helper
import h5py
import numpy as np
from active_learners.active_learner import run_ActiveL... | [
"os.mkdir",
"active_learners.active_learner.run_ActiveLearner",
"h5py.File",
"ipdb.set_trace",
"os.path.isdir",
"active_learners.helper.get_func_from_exp",
"active_learners.helper.get_xx_yy",
"numpy.array",
"active_learners.helper.gen_data",
"active_learners.helper.get_learner_from_method",
"act... | [((758, 787), 'active_learners.helper.get_func_from_exp', 'helper.get_func_from_exp', (['exp'], {}), '(exp)\n', (782, 787), True, 'import active_learners.helper as helper\n'), ((801, 830), 'active_learners.helper.gen_data', 'helper.gen_data', (['func', 'n_data'], {}), '(func, n_data)\n', (816, 830), True, 'import activ... |
import pytest
from powersimdata.input.change_table import ChangeTable
from powersimdata.input.changes.electrification import (
AreaScaling,
ScaleFactors,
_check_scale_factors,
add_electrification,
)
from powersimdata.input.grid import Grid
def test_scale_factors():
info = {"standard_heat_pump_v1"... | [
"powersimdata.input.changes.electrification.add_electrification",
"powersimdata.input.changes.electrification.ScaleFactors",
"pytest.raises",
"powersimdata.input.grid.Grid",
"powersimdata.input.changes.electrification.AreaScaling",
"powersimdata.input.changes.electrification._check_scale_factors"
] | [((565, 583), 'powersimdata.input.changes.electrification.ScaleFactors', 'ScaleFactors', (['info'], {}), '(info)\n', (577, 583), False, 'from powersimdata.input.changes.electrification import AreaScaling, ScaleFactors, _check_scale_factors, add_electrification\n'), ((884, 901), 'powersimdata.input.changes.electrificati... |
# From https://github.com/boxiangliu/covseq
from collections import defaultdict
def parse_align(align_fn):
header_ref = ''
ref = ''
header_qry = ''
qry = ''
n_record = 0
with open(align_fn, "r") as f:
for line in f:
if line.startswith(">"):
if n_record == 0:
is_ref = True
n_record += 1
... | [
"collections.defaultdict",
"os.rename",
"os.remove"
] | [((643, 659), 'collections.defaultdict', 'defaultdict', (['str'], {}), '(str)\n', (654, 659), False, 'from collections import defaultdict\n'), ((675, 691), 'collections.defaultdict', 'defaultdict', (['str'], {}), '(str)\n', (686, 691), False, 'from collections import defaultdict\n'), ((2735, 2752), 'os.remove', 'os.rem... |
from math import sin, pi
import matplotlib.pyplot as plt
domain = range(0, 360, 6)
sines = [sin(angle / 360 * 2 * pi) for angle in domain]
plt.scatter(domain, sines)
plt.show()
| [
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.show",
"math.sin"
] | [((140, 166), 'matplotlib.pyplot.scatter', 'plt.scatter', (['domain', 'sines'], {}), '(domain, sines)\n', (151, 166), True, 'import matplotlib.pyplot as plt\n'), ((167, 177), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (175, 177), True, 'import matplotlib.pyplot as plt\n'), ((93, 118), 'math.sin', 'sin', ([... |
from enum import Enum
import re
class TokenType(Enum):
ADD = "\\+",
SUB = "\\-",
MUL = "\\*",
DIV = "\\/",
MORE = ">",
LESS = "<",
EMORE = ">=",
ELESS = "<=",
EQUIV = "=",
ASSIGN = ":=",
PRINT = "print",
IF = 'if'
THEN = 'then'
ELSE = 'else'
END = 'end'
S... | [
"re.match"
] | [((1213, 1249), 're.match', 're.match', (['value', 'self.src[self.pos:]'], {}), '(value, self.src[self.pos:])\n', (1221, 1249), False, 'import re\n')] |
#!/usr/bin/env python2
import os
import sys
import time
import optparse
import threading
import signal
import glob
import traceback
# the size of block used to find the position of end of DST in SRC.
# note: false-positive (too small) or false-negative (too large) will
# cause data duplication.
PATTERN_SIZE = 4096
BU... | [
"time.asctime",
"threading.Thread",
"os.remove",
"traceback.print_exc",
"os.getpid",
"os.makedirs",
"optparse.OptionParser",
"os.path.getsize",
"os.walk",
"os.path.exists",
"time.time",
"time.sleep",
"os.path.isfile",
"os._exit",
"os.path.getmtime",
"signal.signal",
"os.path.join"
] | [((3077, 3108), 'threading.Thread', 'threading.Thread', ([], {'target': 'target'}), '(target=target)\n', (3093, 3108), False, 'import threading\n'), ((4604, 4615), 'os._exit', 'os._exit', (['(1)'], {}), '(1)\n', (4612, 4615), False, 'import os\n'), ((4642, 4698), 'optparse.OptionParser', 'optparse.OptionParser', (['"""... |
''' Piranha - Simple Amazon scraper
Piranha is a simple Amazon scraper. Using the Amazon Product Advertising API, Piranha searches Amazon for you. Nuff said.
Scraper by <NAME>.
'''
import requests as r
import xmltodict
import datetime as d
from pprint import PrettyPrinter
p = PrettyPrinter()
class Piranha:
i... | [
"pprint.PrettyPrinter",
"requests.get"
] | [((282, 297), 'pprint.PrettyPrinter', 'PrettyPrinter', ([], {}), '()\n', (295, 297), False, 'from pprint import PrettyPrinter\n'), ((1395, 1405), 'requests.get', 'r.get', (['url'], {}), '(url)\n', (1400, 1405), True, 'import requests as r\n')] |
# -*- coding: UTF-8 -*-
# This file is part of the jetson_stats package (https://github.com/rbonghi/jetson_stats or http://rnext.it).
# Copyright (c) 2019 <NAME>.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the ... | [
"os.access"
] | [((2141, 2187), 'os.access', 'os.access', (["(path + '/clk_enable_count')", 'os.R_OK'], {}), "(path + '/clk_enable_count', os.R_OK)\n", (2150, 2187), False, 'import os\n'), ((2371, 2409), 'os.access', 'os.access', (["(path + '/clk_rate')", 'os.R_OK'], {}), "(path + '/clk_rate', os.R_OK)\n", (2380, 2409), False, 'import... |
from timeit import default_timer as timer
import numpy as np
start = timer()
class Link (object):
def __init__(self, data, next=None, previous=None):
self.data = data
self.next = next
self.previous = previous
class CircularList(object):
# Constructor
def __init__(self):
s... | [
"timeit.default_timer",
"numpy.unique"
] | [((69, 76), 'timeit.default_timer', 'timer', ([], {}), '()\n', (74, 76), True, 'from timeit import default_timer as timer\n'), ((1808, 1815), 'timeit.default_timer', 'timer', ([], {}), '()\n', (1813, 1815), True, 'from timeit import default_timer as timer\n'), ((1470, 1504), 'numpy.unique', 'np.unique', (['raw'], {'ret... |
import argparse
import os
import sys
import re
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.dirname(BASE_DIR)
sys.path.append(BASE_DIR)
from model import *
import indoor3d_util
import time
import numpy as np
import get_instances
import project_inst
"python inference_online_all.py --path_dat... | [
"os.mkdir",
"os.remove",
"argparse.ArgumentParser",
"numpy.amin",
"numpy.argmax",
"os.walk",
"indoor3d_util.get_info_classes",
"numpy.mean",
"os.path.join",
"sys.path.append",
"os.path.abspath",
"indoor3d_util.room2blocks_plus_normalized_parsed",
"os.path.dirname",
"os.path.exists",
"pro... | [((112, 137), 'os.path.dirname', 'os.path.dirname', (['BASE_DIR'], {}), '(BASE_DIR)\n', (127, 137), False, 'import os\n'), ((138, 163), 'sys.path.append', 'sys.path.append', (['BASE_DIR'], {}), '(BASE_DIR)\n', (153, 163), False, 'import sys\n'), ((455, 480), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}... |
from siptracklib.objectregistry import object_registry
from siptracklib import treenodes
from siptracklib import container
from siptracklib import attribute
from siptracklib import counter
from siptracklib import device
from siptracklib import network
from siptracklib import password
from siptracklib import user
from s... | [
"siptracklib.objectregistry.object_registry.registerClass"
] | [((4309, 4348), 'siptracklib.objectregistry.object_registry.registerClass', 'object_registry.registerClass', (['ViewTree'], {}), '(ViewTree)\n', (4338, 4348), False, 'from siptracklib.objectregistry import object_registry\n'), ((4736, 4771), 'siptracklib.objectregistry.object_registry.registerClass', 'object_registry.r... |
"""Module that contains the tools to open and retrieve raster properties and statistics.
Classes:
ImgManagerError.
ImgManager.
"""
import logging
import gettext
import numpy as np
from osgeo import gdal
from controls.imagery_controls.results import WorldFileData
class RasterManagerError(Exception):
"""Exception... | [
"numpy.count_nonzero",
"osgeo.gdal.Open",
"controls.imagery_controls.results.WorldFileData",
"logging.getLogger"
] | [((1198, 1331), 'controls.imagery_controls.results.WorldFileData', 'WorldFileData', ([], {'pixel_size': '[self.geo_transform[1], self.geo_transform[5]]', 'rotation': '[self.geo_transform[4], self.geo_transform[2]]'}), '(pixel_size=[self.geo_transform[1], self.geo_transform[5]],\n rotation=[self.geo_transform[4], sel... |
import sys
import os
import shutil
import warnings
import numpy as np
import math as m
import meshio
from isg_gen import IsoGeomGen
import visit as v
class IvDb(IsoGeomGen):
"""Class containing necessary methods for generating isosurface
volumes from a mesh file with data. This class uses the python
int... | [
"visit.ExportDatabase",
"visit.IsovolumeAttributes",
"visit.RemoveAllOperators",
"os.makedirs",
"visit.AddPlot",
"os.path.isdir",
"visit.ExportDBAttributes",
"visit.CloseComputeEngine",
"visit.DrawPlots",
"visit.DeleteAllPlots",
"meshio.read",
"visit.AddOperator",
"visit.OpenDatabase",
"wa... | [((2064, 2088), 'visit.OpenDatabase', 'v.OpenDatabase', (['filename'], {}), '(filename)\n', (2078, 2088), True, 'import visit as v\n'), ((2534, 2569), 'visit.AddPlot', 'v.AddPlot', (['"""Pseudocolor"""', 'self.data'], {}), "('Pseudocolor', self.data)\n", (2543, 2569), True, 'import visit as v\n'), ((2578, 2591), 'visit... |
import numpy as np
import pandas as pd
from copy import deepcopy as dc
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.cm as cm
from tqdm import tqdm_notebook as tqdm
import XPyS
from .helper_functions import index_of, guess_from_data
import XPyS.config as cfg
import os
fro... | [
"numpy.abs",
"numpy.empty",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.exp",
"scipy.interpolate.interp1d",
"matplotlib.patches.Patch",
"numpy.round",
"pandas.DataFrame",
"XPyS.config.element_color.keys",
"numpy.cumsum",
"numpy.max",
"nump... | [((2976, 2993), 'numpy.round', 'np.round', (['xnew', '(3)'], {}), '(xnew, 3)\n', (2984, 2993), True, 'import numpy as np\n'), ((5682, 5700), 'pandas.concat', 'pd.concat', (['df_list'], {}), '(df_list)\n', (5691, 5700), True, 'import pandas as pd\n'), ((5772, 5797), 'pandas.concat', 'pd.concat', (['df_params_list'], {})... |
import platform
system = platform.system()
def get_user_idle_time():
"""
Args:
Returns:
This is normally obtained from a lack of keyboard and/or mouse input.
"""
if system == "Windows":
return get_user_idle_time_windows()
elif system == "Darwin":
retu... | [
"subprocess.Popen",
"ctypes.byref",
"ctypes.sizeof",
"ctypes.windll.kernel32.GetTickCount",
"platform.system",
"re.compile"
] | [((28, 45), 'platform.system', 'platform.system', ([], {}), '()\n', (43, 45), False, 'import platform\n'), ((736, 757), 'ctypes.sizeof', 'sizeof', (['lastInputInfo'], {}), '(lastInputInfo)\n', (742, 757), False, 'from ctypes import Structure, windll, c_uint, sizeof, byref\n'), ((1009, 1081), 'subprocess.Popen', 'subpro... |
"""
Command line interface to several manipulations of D-WAQ formatted
hydrodynamic data.
Typical invocation:
python -m stompy.model.delft.waq_hydro_editor -h
(to get help message).
python -m stompy.model.delft.waq_hydro_editor -i path/to/com-foo.hyd -a agg.shp -o output_agg/output
Read existing, serial DWAQ ... | [
"numpy.abs",
"argparse.ArgumentParser",
"os.path.dirname",
"logging.info",
"datetime.timedelta"
] | [((2953, 3039), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Manipulate transport data in D-WAQ format."""'}), "(description=\n 'Manipulate transport data in D-WAQ format.')\n", (2976, 3039), False, 'import argparse\n'), ((8664, 8692), 'os.path.dirname', 'os.path.dirname', (['args.o... |
# pylint: disable=redefined-outer-name,invalid-name,no-name-in-module,unused-argument,too-few-public-methods,too-many-arguments,too-many-locals
# type: ignore
from brownie import (
Registry,
accounts,
)
ROPSTEN_RESOLVER_ADDRESS = "0x907B454E33edc407194d5b5ea84c1f1122907adF"
def main():
a = accounts.load(... | [
"brownie.accounts.load",
"brownie.Registry.publish_source",
"brownie.Registry.deploy"
] | [((306, 335), 'brownie.accounts.load', 'accounts.load', (['"""renft-test-1"""'], {}), "('renft-test-1')\n", (319, 335), False, 'from brownie import Registry, accounts\n'), ((408, 477), 'brownie.Registry.deploy', 'Registry.deploy', (['ROPSTEN_RESOLVER_ADDRESS', 'beneficiary', 'admin', 'from_a'], {}), '(ROPSTEN_RESOLVER_... |
import os
import time
import numpy as np
from functools import reduce
import torch
import torch.nn as nn
import torch.nn.functional as F
from carle.env import CARLE
from carle.mcl import RND2D, AE2D
from game_of_carle.agents.agent import Agent
class CARLA(Agent):
def __init__(self, **kwargs):
super(CA... | [
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.rand_like",
"torch.Tensor",
"numpy.array",
"torch.rand",
"functools.reduce",
"torch.nn.Sigmoid"
] | [((807, 897), 'torch.nn.Conv2d', 'nn.Conv2d', (['(1)', '(9)', '(3)'], {'groups': '(1)', 'padding': '(1)', 'stride': '(1)', 'padding_mode': '"""circular"""', 'bias': '(False)'}), "(1, 9, 3, groups=1, padding=1, stride=1, padding_mode='circular',\n bias=False)\n", (816, 897), True, 'import torch.nn as nn\n'), ((2482, ... |
import os
from PIL import Image
# -----------------------------------------------------------------------------------------------------------
# 현재 위치 불러와서 이미지 파일 경로 저장
cwd = os.getcwd()
file = cwd + '/image2.jpg'
print('현재 폴더 위치:', cwd)
img = Image.open(file)
# 높이 너비 저장
# height, width = img.shape[0:2]
full_width,... | [
"os.getcwd",
"PIL.Image.open"
] | [((176, 187), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (185, 187), False, 'import os\n'), ((246, 262), 'PIL.Image.open', 'Image.open', (['file'], {}), '(file)\n', (256, 262), False, 'from PIL import Image\n')] |
import argparse
import os
from os.path import join
from tempfile import TemporaryDirectory
from collections import OrderedDict
import numpy as np
import torch
from sklearn.metrics import confusion_matrix, accuracy_score
from torch.utils.data import DataLoader
from torchvision import transforms
from torchvision.dataset... | [
"pytorch_lightning.Trainer",
"pytorch_lightning.seed_everything",
"argparse.ArgumentParser",
"numpy.argmax",
"torch.cat",
"torchvision.transforms.Normalize",
"torch.no_grad",
"os.path.join",
"tempfile.TemporaryDirectory",
"torch.utils.data.DataLoader",
"create_datasets.create_patches_dataset_fir... | [((10699, 10738), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'add_help': '(False)'}), '(add_help=False)\n', (10722, 10738), False, 'import argparse\n'), ((15625, 15675), 'pytorch_lightning.loggers.WandbLogger', 'WandbLogger', ([], {'project': '"""TFG"""', 'tags': '[hparams.dataset]'}), "(project='TFG',... |
#!/usr/bin/python
import os
import sys
APT_PKGS = [
"python3-tk",
"python3-pil.imagetk",
]
# Must NOT be run as sudo
if os.getuid() == 0:
print("ERROR: Do not run as root")
sys.exit(1)
# Install the requirements if the system does not have it installed
# print("INFO: Checking and installing requirem... | [
"os.getuid",
"os.system",
"sys.exit"
] | [((458, 520), 'os.system', 'os.system', (['"""python3 -m pip install --user -r requirements.txt"""'], {}), "('python3 -m pip install --user -r requirements.txt')\n", (467, 520), False, 'import os\n'), ((131, 142), 'os.getuid', 'os.getuid', ([], {}), '()\n', (140, 142), False, 'import os\n'), ((192, 203), 'sys.exit', 's... |
import logging
from dataladmetadatamodel.mapper.gitmapper.objectreference import flush_object_references
from tools.metadata_creator.mrrcreator import create_mrrs_from_dataset
from tools.metadata_creator.treeversionlistcreator import create_tree_version_list_for_mrrs
from tools.metadata_creator.uuidsetcreator import... | [
"tools.metadata_creator.mrrcreator.create_mrrs_from_dataset",
"tools.metadata_creator.treeversionlistcreator.create_tree_version_list_for_mrrs",
"tools.metadata_creator.uuidsetcreator.create_uuid_set_for_mrrs",
"logging.getLogger"
] | [((361, 398), 'logging.getLogger', 'logging.getLogger', (['"""metadata_creator"""'], {}), "('metadata_creator')\n", (378, 398), False, 'import logging\n'), ((667, 741), 'tools.metadata_creator.mrrcreator.create_mrrs_from_dataset', 'create_mrrs_from_dataset', (['mapper', 'realm', 'dataset_path', 'parameter_set_count'], ... |
from model.contact import Contact
def test_change_first_contact(app):
app.session.login(username="admin", password="<PASSWORD>")
app.contact.change_first_contact(Contact(firstname="11111", middlename="2222", lastname="33333", nickname="444444", title="5555", company="666", address="777777", home="88888888888",... | [
"model.contact.Contact"
] | [((171, 576), 'model.contact.Contact', 'Contact', ([], {'firstname': '"""11111"""', 'middlename': '"""2222"""', 'lastname': '"""33333"""', 'nickname': '"""444444"""', 'title': '"""5555"""', 'company': '"""666"""', 'address': '"""777777"""', 'home': '"""88888888888"""', 'mobile': '"""9999999999"""', 'work': '"""wwwwwwww... |
from typing import Dict
from yaml import SafeLoader, dump, load
DEFALUT_CONFIG = {
"message_service": {
"app_id": "",
"app_secret": "",
"email": ""
}
}
def CreateDefaultConfig() -> None:
with open("config.yaml", "w", encoding="utf-8") as f:
dump(DEFALUT_CONFIG, f, indent=... | [
"yaml.load",
"yaml.dump"
] | [((289, 342), 'yaml.dump', 'dump', (['DEFALUT_CONFIG', 'f'], {'indent': '(4)', 'allow_unicode': '(True)'}), '(DEFALUT_CONFIG, f, indent=4, allow_unicode=True)\n', (293, 342), False, 'from yaml import SafeLoader, dump, load\n'), ((460, 479), 'yaml.load', 'load', (['f', 'SafeLoader'], {}), '(f, SafeLoader)\n', (464, 479)... |
#
# ============LICENSE_START==========================================
# org.onap.vvp/engagementmgr
# ===================================================================
# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
# ===================================================================
#
# Unless ... | [
"engagementmanager.slack_client.api.SlackClient",
"engagementmanager.models.Checklist.objects.get",
"json.loads",
"engagementmanager.service.logging_service.LoggingServiceFactory.get_logger",
"engagementmanager.models.VF.objects.get",
"engagementmanager.utils.request_data_mgr.request_data_mgr.set_user",
... | [((2346, 2380), 'engagementmanager.service.logging_service.LoggingServiceFactory.get_logger', 'LoggingServiceFactory.get_logger', ([], {}), '()\n', (2378, 2380), False, 'from engagementmanager.service.logging_service import LoggingServiceFactory\n'), ((3006, 3074), 'engagementmanager.models.Checklist.objects.get', 'Che... |
import streamlit as st
import datetime
import calendar as c
import time
#Take a look at your chrome tab. With the code below you can change the header of the page
st.set_page_config(
page_title='When were you born?',
page_icon="👶"
)
#Display a GIF on top of the app
st.markdown("![Alt... | [
"streamlit.number_input",
"streamlit.set_page_config",
"streamlit.markdown",
"datetime.date"
] | [((171, 238), 'streamlit.set_page_config', 'st.set_page_config', ([], {'page_title': '"""When were you born?"""', 'page_icon': '"""👶"""'}), "(page_title='When were you born?', page_icon='👶')\n", (189, 238), True, 'import streamlit as st\n'), ((301, 469), 'streamlit.markdown', 'st.markdown', (['"""
"""
import md5
import sha
import threading
import cherrypy
import pkg_resources
import logging
log = lo... | [
"turbogears.util.load_class",
"md5.new",
"turbogears.config.get",
"sha.new",
"turbogears.util.request_available",
"pkg_resources.iter_entry_points",
"logging.getLogger"
] | [((318, 358), 'logging.getLogger', 'logging.getLogger', (['"""turbogears.identity"""'], {}), "('turbogears.identity')\n", (335, 358), False, 'import logging\n'), ((808, 863), 'turbogears.config.get', 'turbogears.config.get', (['"""identity.provider"""', '"""sqlobject"""'], {}), "('identity.provider', 'sqlobject')\n", (... |
# load modules
from dataclasses import dataclass
# definition class
@dataclass(frozen=True)
class MapStats:
downloads: int
downvotes: int
plays: int
score: float
scoreOneDP: float
upvotes: int
# definition function
def gen(response):
if response is not None:
instance = MapStats... | [
"dataclasses.dataclass"
] | [((71, 93), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (80, 93), False, 'from dataclasses import dataclass\n')] |
import torch.optim as optim # Import optim
import torchvision # Import torchvision
import h5py # import h5py
from torch.utils.data import dataset # import dataset
from torch.utils.data import DataLoader # Import Dataloader
import torchvision.transforms as transforms # Import Transform
import pandas as pd # Impor... | [
"numpy.random.seed",
"pytorchtools.EarlyStopping",
"torch.device",
"torch.no_grad",
"os.path.join",
"torch.utils.data.DataLoader",
"torch.load",
"random.seed",
"torch.utils.data.random_split",
"torch.nn.Linear",
"numpy.save",
"torch.manual_seed",
"torch.nn.Conv2d",
"torch.cuda.manual_seed"... | [((1361, 1378), 'random.seed', 'random.seed', (['SEED'], {}), '(SEED)\n', (1372, 1378), False, 'import random\n'), ((1379, 1399), 'numpy.random.seed', 'np.random.seed', (['SEED'], {}), '(SEED)\n', (1393, 1399), True, 'import numpy as np\n'), ((1400, 1423), 'torch.manual_seed', 'torch.manual_seed', (['SEED'], {}), '(SEE... |
# This script will return X that are similar to Y based on high Jaccard index of common one-hop nodes Z (X<->Z<->Y)
import os
import sys
import argparse
# PyCharm doesn't play well with relative imports + python console + terminal
try:
from code.reasoningtool import ReasoningUtilities as RU
except ImportError:
sys.p... | [
"os.path.abspath",
"argparse.ArgumentParser",
"ReasoningUtilities.return_subgraph_paths_of_type",
"FormatOutput.FormatResponse",
"ReasoningUtilities.weight_graph_with_cohd_frequency",
"ReasoningUtilities.get_node_property",
"networkx.get_node_attributes",
"networkx.subgraph"
] | [((4254, 4437), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Answers questions of the type \'What are the most common symptoms of disease X?"""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), '(description=\n "Answers questions of the type \'What are the most common... |
# To add a new cell, type '# %%'
# To add a new markdown cell, type '# %% [markdown]'
# %%
import math
import numpy as np
import matplotlib.pyplot as plt
import struct
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data as D
import os
import multiprocessing as mp
os.environ["KMP_D... | [
"math.isnan",
"numpy.save",
"struct.unpack_from",
"multiprocessing.Array",
"numpy.empty",
"torch.load",
"numpy.zeros",
"torch.FloatTensor",
"struct.calcsize",
"torch.nn.Linear",
"torch.nn.functional.sigmoid",
"multiprocessing.Pool",
"multiprocessing.cpu_count"
] | [((4021, 4040), 'torch.load', 'torch.load', (['filestr'], {}), '(filestr)\n', (4031, 4040), False, 'import torch\n'), ((4560, 4585), 'numpy.zeros', 'np.zeros', (['(21 * 900 * 1800)'], {}), '(21 * 900 * 1800)\n', (4568, 4585), True, 'import numpy as np\n'), ((4590, 4608), 'multiprocessing.Array', 'mp.Array', (['"""f"""'... |
# cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False
# -*- coding: utf-8 -*-
"""
Functions related to events.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from zope.interface import classImplements
from zope.interface import... | [
"zope.interface.providedBy",
"zope.event.notify",
"zope.interface.classImplements",
"nti.externalization.interfaces.ObjectModifiedFromExternalEvent",
"nti.externalization._interface_cache.cache_for_key_in_providedBy"
] | [((983, 1024), 'zope.interface.classImplements', 'classImplements', (['_Attributes', 'IAttributes'], {}), '(_Attributes, IAttributes)\n', (998, 1024), False, 'from zope.interface import classImplements\n'), ((1641, 1668), 'zope.interface.providedBy', 'providedBy', (['containedObject'], {}), '(containedObject)\n', (1651... |
# Copyright (c) 2016-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import json
import logging
import subprocess
import sys
import traceback
from logging import Logger
from pathlib import Path
from ty... | [
"subprocess.run",
"json.dump",
"json.load",
"argparse.ArgumentParser",
"logging.basicConfig",
"subprocess.check_output",
"logging.getLogger",
"pathlib.Path",
"traceback.format_exc",
"pathlib.Path.cwd",
"sys.exit"
] | [((825, 852), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (842, 852), False, 'import logging\n'), ((21063, 21113), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'fromfile_prefix_chars': '"""@"""'}), "(fromfile_prefix_chars='@')\n", (21086, 21113), False, 'import argparse\... |
import re
class LanguageRule(object):
__slots__ = ['regex', 'replace']
def __init__(self, rule, replace):
self.regex = re.compile(rule, re.IGNORECASE)
self.replace = replace
PLURAL_RULES = [
# https://github.com/rails/rails/blob/master/activesupport/lib/active_support/inflections.rb
... | [
"re.compile"
] | [((138, 169), 're.compile', 're.compile', (['rule', 're.IGNORECASE'], {}), '(rule, re.IGNORECASE)\n', (148, 169), False, 'import re\n')] |
# Convolution Neural Networks
# Part 1: Building Convolution Neural Networks
from keras.models import Sequential
from keras.layers import Convolution2D
from keras.layers import MaxPooling2D
from keras.layers import Flatten
from keras.layers import Dense
# Initialize CNN
classifier = Sequential()
# Step 1: Convolutio... | [
"keras.preprocessing.image.ImageDataGenerator",
"keras.layers.Convolution2D",
"keras.layers.Flatten",
"keras.layers.Dense",
"keras.models.Sequential",
"keras.layers.MaxPooling2D"
] | [((286, 298), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (296, 298), False, 'from keras.models import Sequential\n'), ((1301, 1397), 'keras.preprocessing.image.ImageDataGenerator', 'ImageDataGenerator', ([], {'rescale': '(1.0 / 255)', 'shear_range': '(0.2)', 'zoom_range': '(0.2)', 'horizontal_flip': '(T... |
import random
def rabinMiller(n, d):
a = random.randint(2, (n - 2) - 2)
x = pow(a, int(d), n)
if x == 1 or x == n - 1:
return True
# square x
while d != n - 1:
x = pow(x, 2, n)
d *= 2
if x == 1:
return False
elif x == n - 1:
return ... | [
"random.randrange",
"random.randint"
] | [((47, 75), 'random.randint', 'random.randint', (['(2)', '(n - 2 - 2)'], {}), '(2, n - 2 - 2)\n', (61, 75), False, 'import random\n'), ((1840, 1894), 'random.randrange', 'random.randrange', (['(2 ** (keysize - 1))', '(2 ** keysize - 1)'], {}), '(2 ** (keysize - 1), 2 ** keysize - 1)\n', (1856, 1894), False, 'import ran... |
from base64 import b64decode
from io import BytesIO
from io import StringIO
from onegov.ballot import Ballot
from onegov.ballot import Election
from onegov.ballot import ElectionCompound
from onegov.core.custom import json
from onegov.core.utils import module_path
from onegov.election_day import _
from onegov.election_... | [
"onegov.election_day.utils.ballot.get_ballot_data_by_district",
"io.StringIO",
"onegov.election_day.utils.election.get_candidates_data",
"onegov.election_day.utils.ballot.get_ballot_data_by_entity",
"onegov.election_day.utils.election.get_connections_data",
"onegov.election_day.utils.election.get_parties_... | [((3283, 3306), 'io.StringIO', 'StringIO', (['response.text'], {}), '(response.text)\n', (3291, 3306), False, 'from io import StringIO\n'), ((4227, 4247), 'onegov.election_day.utils.election.get_lists_data', 'get_lists_data', (['item'], {}), '(item)\n', (4241, 4247), False, 'from onegov.election_day.utils.election impo... |
import csv
import itertools
import numpy
import numpy as np
import pandas as pd
import sklearn
from matplotlib import pyplot as plt
from pandas import DataFrame
import tsv
import experiments
import utils
from granularity import *
from sklearn.metrics import f1_score, accuracy_score
input_df = pd.read_csv("data/answer... | [
"pandas.read_csv",
"pandas.DataFrame"
] | [((296, 351), 'pandas.read_csv', 'pd.read_csv', (['"""data/answer_weather_ordinal.csv"""'], {'sep': '""","""'}), "('data/answer_weather_ordinal.csv', sep=',')\n", (307, 351), True, 'import pandas as pd\n'), ((363, 408), 'pandas.read_csv', 'pd.read_csv', (['"""data/truth_weather_ordinal.csv"""'], {}), "('data/truth_weat... |
from distutils.core import setup
setup(
name="jroh",
version="0.10.2",
description="JSON RPC over HTTP",
packages=["jroh"],
package_dir={"jroh": "src/jroh"},
python_requires=">=3.9",
install_requires=[
"PyYAML==5.4.1",
"Mako==1.1.4",
"google-re2==0.2.20210901",
]... | [
"distutils.core.setup"
] | [((34, 343), 'distutils.core.setup', 'setup', ([], {'name': '"""jroh"""', 'version': '"""0.10.2"""', 'description': '"""JSON RPC over HTTP"""', 'packages': "['jroh']", 'package_dir': "{'jroh': 'src/jroh'}", 'python_requires': '""">=3.9"""', 'install_requires': "['PyYAML==5.4.1', 'Mako==1.1.4', 'google-re2==0.2.20210901... |
""" Debug module. """
# ISC License
#
# Copyright (c) 2020–2021, <NAME>, <NAME>. <<EMAIL>>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# ... | [
"inspect.isclass",
"colorit.color_front",
"colorit.bold",
"inspect.stack"
] | [((2566, 2578), 'inspect.isclass', 'isclass', (['obj'], {}), '(obj)\n', (2573, 2578), False, 'from inspect import isclass, stack\n'), ((3222, 3229), 'inspect.stack', 'stack', ([], {}), '()\n', (3227, 3229), False, 'from inspect import isclass, stack\n'), ((3952, 3962), 'colorit.bold', 'bold', (['name'], {}), '(name)\n'... |
import pymysql
from .settings import Settings
class MysqlConnection(object):
__instances = {}
@classmethod
def instance(cls, name=''):
setting = Settings.instance()
if '' == name:
name = setting.get('mysql', 'connection')
if cls.__instances.get(name) is None:
... | [
"pymysql.connect"
] | [((717, 820), 'pymysql.connect', 'pymysql.connect', ([], {'host': "connection['host']", 'user': "connection['user']", 'password': "connection['password']"}), "(host=connection['host'], user=connection['user'], password=\n connection['password'])\n", (732, 820), False, 'import pymysql\n')] |
# -*- coding: utf-8 -*-
import functools
import inspect
__all__ = ("golang", "defer", "panic", "recover")
class GolangContext(object):
"""Golang context"""
def __init__(self):
self.defers = []
self.panic = None
def __enter__(self):
return self
def __exit__(self, exc_type, ... | [
"inspect.stack",
"functools.wraps"
] | [((1210, 1231), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (1225, 1231), False, 'import functools\n'), ((1889, 1904), 'inspect.stack', 'inspect.stack', ([], {}), '()\n', (1902, 1904), False, 'import inspect\n'), ((2818, 2833), 'inspect.stack', 'inspect.stack', ([], {}), '()\n', (2831, 2833), Fals... |
from __future__ import (
division, print_function, unicode_literals, absolute_import)
import os
from collections import OrderedDict
from .utils import parse_walltime
class Task(object):
"""Base class for all tasks to be submitted.
"""
def __init__(self):
self.opts = OrderedDict([])
... | [
"collections.OrderedDict",
"os.path.join"
] | [((298, 313), 'collections.OrderedDict', 'OrderedDict', (['[]'], {}), '([])\n', (309, 313), False, 'from collections import OrderedDict\n'), ((538, 581), 'collections.OrderedDict', 'OrderedDict', ([], {'current_working_directory': '(True)'}), '(current_working_directory=True)\n', (549, 581), False, 'from collections im... |
from pathlib import Path
import PIL.Image
import pytest
import torch
from tvl_backends.fffr import FffrBackendFactory
data_dir = Path(__file__).parent.parent.parent.parent.joinpath('data')
# Get the slow CUDA initialisation out of the way
CUDA_DEVICES = [f'cuda:{i}' for i in range(torch.cuda.device_count())]
for de... | [
"tvl_backends.fffr.FffrBackendFactory",
"pytest.fixture",
"torch.empty",
"torch.cuda.device_count",
"pathlib.Path"
] | [((1384, 1429), 'pytest.fixture', 'pytest.fixture', ([], {'params': "['cpu', *CUDA_DEVICES]"}), "(params=['cpu', *CUDA_DEVICES])\n", (1398, 1429), False, 'import pytest\n'), ((286, 311), 'torch.cuda.device_count', 'torch.cuda.device_count', ([], {}), '()\n', (309, 311), False, 'import torch\n'), ((346, 360), 'torch.emp... |
# coding: utf-8
"""
Gate API v4
Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501
Contact: <EMAIL>
Generated by: ht... | [
"six.iteritems",
"gate_api.configuration.Configuration"
] | [((5831, 5864), 'six.iteritems', 'six.iteritems', (['self.openapi_types'], {}), '(self.openapi_types)\n', (5844, 5864), False, 'import six\n'), ((1730, 1745), 'gate_api.configuration.Configuration', 'Configuration', ([], {}), '()\n', (1743, 1745), False, 'from gate_api.configuration import Configuration\n')] |
# encoding: utf-8
"""Test suite for the docx.bookmark module."""
from __future__ import absolute_import, division, print_function, unicode_literals
import pytest
from docx.bookmark import (
_Bookmark,
Bookmarks,
_DocumentBookmarkFinder,
_PartBookmarkFinder,
)
from docx.opc.part import Part, XmlPart
... | [
"pytest.fixture",
"docx.bookmark._DocumentBookmarkFinder",
"pytest.raises",
"docx.bookmark.Bookmarks",
"docx.bookmark._Bookmark",
"docx.bookmark._PartBookmarkFinder",
"docx.bookmark._PartBookmarkFinder.iter_start_end_pairs"
] | [((4899, 5079), 'pytest.fixture', 'pytest.fixture', ([], {'params': "[((), 'foo', False), (('foo',), 'foo', True), (('foo',), 'fiz', False), ((\n 'foo', 'bar', 'baz'), 'foo', True), (('foo', 'bar', 'baz'), 'fiz', False)]"}), "(params=[((), 'foo', False), (('foo',), 'foo', True), (('foo'\n ,), 'fiz', False), (('fo... |
# Copyright (c) 2020-2021 CRS4
#
# 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, distribut... | [
"lifemonitor.lang.messages.no_registry_found.format",
"lifemonitor.auth.serializers.SubscriptionSchema",
"lifemonitor.lang.messages.unable_to_delete_suite.format",
"lifemonitor.lang.messages.not_authorized_registry_access.format",
"lifemonitor.api.serializers.BuildSummarySchema",
"lifemonitor.api.serializ... | [((1702, 1728), 'lifemonitor.api.services.LifeMonitor.get_instance', 'LifeMonitor.get_instance', ([], {}), '()\n', (1726, 1728), False, 'from lifemonitor.api.services import LifeMonitor\n'), ((1770, 1797), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1787, 1797), False, 'import logging... |
# ============================================================================
# FILE: matcher/regexp.py
# AUTHOR: <NAME> <<EMAIL> at g<EMAIL>>
# License: MIT license
# ============================================================================
import re
from denite.base.filter import Base
from denite.util import co... | [
"denite.util.convert2regex_pattern",
"re.compile"
] | [((1109, 1141), 'denite.util.convert2regex_pattern', 'convert2regex_pattern', (['input_str'], {}), '(input_str)\n', (1130, 1141), False, 'from denite.util import convert2regex_pattern, Nvim, UserContext, Candidates\n'), ((772, 857), 're.compile', 're.compile', (["context['input']"], {'flags': "(re.IGNORECASE if context... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.loadDockerHome, name='dockerHome'),
# url(r'^images', views.loadImages, name='loadImages'),
url(r'^getTags', views.getTags, name='getTags'),
url(r'^runContainer', views.runContainer, name='runContainer'),
url(r'^s... | [
"django.conf.urls.url"
] | [((74, 124), 'django.conf.urls.url', 'url', (['"""^$"""', 'views.loadDockerHome'], {'name': '"""dockerHome"""'}), "('^$', views.loadDockerHome, name='dockerHome')\n", (77, 124), False, 'from django.conf.urls import url\n'), ((191, 237), 'django.conf.urls.url', 'url', (['"""^getTags"""', 'views.getTags'], {'name': '"""g... |
'''
The proposed methoed: DynWalks
---------------------------------
scheme=3, # the final version of DynWalks presented and tested in our paper
limit=0.1, local_global=0.5 # DynWalks key hyper-parameters
# NOTE: limit i.e. $\alpha$, local_global i.e. $... | [
"pickle.dump",
"random.uniform",
"warnings.filterwarnings",
"random.shuffle",
"gensim.models.Word2Vec",
"random.choice",
"time.time",
"networkx.neighbors",
"pickle.load",
"numpy.random.choice",
"collections.Counter"
] | [((759, 838), 'warnings.filterwarnings', 'warnings.filterwarnings', ([], {'action': '"""ignore"""', 'category': 'UserWarning', 'module': '"""gensim"""'}), "(action='ignore', category=UserWarning, module='gensim')\n", (782, 838), False, 'import warnings\n'), ((8235, 8246), 'time.time', 'time.time', ([], {}), '()\n', (82... |
#%%
import pandas as pd
import pickle
import numpy as np
import matplotlib.pyplot as plt
import gensim
import sklearn.decomposition
import sklearn.manifold
from sklearn.neural_network import MLPClassifier
#%%
#--Read in data
D2V_WOstop = gensim.models.Doc2Vec.load(r'..\data\process\D2V_WOstop')
df = pd.read_csv(r'..... | [
"matplotlib.pyplot.show",
"gensim.models.Doc2Vec.load",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.close",
"matplotlib.pyplot.yticks",
"pandas.read_csv",
"matplotlib.pyplot.figure",
"numpy.array",
"numpy.arange",
"sklearn.neural_network.MLPClassifier",
"matplotlib.pyplot.xticks",
"pandas.... | [((241, 300), 'gensim.models.Doc2Vec.load', 'gensim.models.Doc2Vec.load', (['"""..\\\\data\\\\process\\\\D2V_WOstop"""'], {}), "('..\\\\data\\\\process\\\\D2V_WOstop')\n", (267, 300), False, 'import gensim\n'), ((1202, 1221), 'numpy.array', 'np.array', (['core_vecs'], {}), '(core_vecs)\n', (1210, 1221), True, 'import n... |
#!/usr/bin/env python
from setuptools import setup, find_packages
from redis_sort_queue import VERSION
setup(
name='redis-sort-queue',
version=VERSION,
url='https://github.com/yordanglez/redis-sort-queue',
description=(
"ordered queue for redis"),
long_description=open('README.rst').read()... | [
"setuptools.find_packages"
] | [((458, 473), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (471, 473), False, 'from setuptools import setup, find_packages\n')] |
""" Primes the metadata backend. """
from appscale.cloud_storage.utils import pg_connection
def prime():
""" Populates the metadata backend with the required tables. """
with pg_connection.cursor() as cur:
cur.execute("""
CREATE TABLE IF NOT EXISTS buckets (
project text,
... | [
"appscale.cloud_storage.utils.pg_connection.cursor",
"appscale.cloud_storage.utils.pg_connection.commit"
] | [((966, 988), 'appscale.cloud_storage.utils.pg_connection.commit', 'pg_connection.commit', ([], {}), '()\n', (986, 988), False, 'from appscale.cloud_storage.utils import pg_connection\n'), ((186, 208), 'appscale.cloud_storage.utils.pg_connection.cursor', 'pg_connection.cursor', ([], {}), '()\n', (206, 208), False, 'fro... |
from collections import deque
import numpy as np
import pickle
import os
import cv2
import inspect
import functools
from ddpg_curiosity_mc_her import logger
try:
from mujoco_py import MujocoException
except Exception:
logger.warn("Mujoco could not be imported.")
def convert_episode_to_batch_major(episode):... | [
"pickle.dump",
"numpy.abs",
"inspect.getfullargspec",
"cv2.VideoWriter_fourcc",
"cv2.waitKey",
"numpy.empty",
"numpy.zeros",
"numpy.isnan",
"numpy.mean",
"numpy.array",
"ddpg_curiosity_mc_her.logger.get_dir",
"functools.wraps",
"ddpg_curiosity_mc_her.logger.warn",
"cv2.destroyAllWindows",
... | [((755, 785), 'inspect.getfullargspec', 'inspect.getfullargspec', (['method'], {}), '(method)\n', (777, 785), False, 'import inspect\n'), ((1070, 1093), 'functools.wraps', 'functools.wraps', (['method'], {}), '(method)\n', (1085, 1093), False, 'import functools\n'), ((229, 273), 'ddpg_curiosity_mc_her.logger.warn', 'lo... |
# -*- coding: utf-8 -*-
import copy
import random
import pytest
from iconservice.icon_constant import Revision
from iconservice.icx.stake_part import StakePart
class TestStakePart:
@pytest.mark.parametrize(
"block_height,params,expected",
[
(
999,
{"s... | [
"pytest.mark.parametrize",
"copy.deepcopy",
"random.randint",
"iconservice.icx.stake_part.StakePart"
] | [((191, 1210), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""block_height,params,expected"""', "[(999, {'stake': 0, 'unstake': 100, 'unstake_block_height': 1000}, {'stake':\n 0, 'unstake': 100, 'unstake_block_height': 1000, 'expired_unstake': 0}),\n (999, {'stake': 50, 'unstake': 100, 'unstake_block... |
import boto3
# Create an S3 client pointed at the localhost. The credentials are totally made up
session = boto3.session.Session()
endpointurl = "http://localhost:4572"
s3_client = session.client(service_name = "s3", aws_access_key_id="a", aws_secret_access_key="b", endpoint_url=endpointurl)
# List the buckets
print(... | [
"boto3.session.Session"
] | [((108, 131), 'boto3.session.Session', 'boto3.session.Session', ([], {}), '()\n', (129, 131), False, 'import boto3\n')] |
import os
Import("env", "projenv")
print("THIS IS POST SCRIPT")
def before_build():
signing_script = "~/.platformio/packages/framework-arduinoespressif8266/tools/signing.py"
file_to_sign = "src/OTAPublicKey.h"
public_key = "~/projects/firmware_keys/public_intexspa.key"
print ("Signing: " + file_to_sign)
print (... | [
"os.system"
] | [((502, 516), 'os.system', 'os.system', (['cmd'], {}), '(cmd)\n', (511, 516), False, 'import os\n'), ((1105, 1119), 'os.system', 'os.system', (['cmd'], {}), '(cmd)\n', (1114, 1119), False, 'import os\n')] |
# SPDX-FileCopyrightText: 2017 <NAME>, written for Adafruit Industries
# SPDX-FileCopyrightText: Copyright (c) 2021 <NAME> for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense
"""Use this file as CIRCUITPY/boot.py in conjunction with ov2640_jpeg_kaluga1_3.py
It makes the CIRCUITPY filesystem writable to Circ... | [
"analogio.AnalogIn",
"storage.remount"
] | [((541, 569), 'analogio.AnalogIn', 'analogio.AnalogIn', (['board.IO6'], {}), '(board.IO6)\n', (558, 569), False, 'import analogio\n'), ((764, 800), 'storage.remount', 'storage.remount', (['"""/"""'], {'readonly': '(False)'}), "('/', readonly=False)\n", (779, 800), False, 'import storage\n')] |
# -*- coding : utf-8 -*-
# Copyright (C) 2018 by
# <NAME> <<EMAIL>>
# All rights reserved.
# BSD license.
#
# Authors:
# <NAME> <<EMAIL>>
from pg2l.meta.parser.parser import Parser
import networkx as nx
class Grammar(nx.DiGraph):
@staticmethod
def from_string(meta, grammar):
parser = P... | [
"pg2l.meta.parser.parser.Parser"
] | [((319, 331), 'pg2l.meta.parser.parser.Parser', 'Parser', (['meta'], {}), '(meta)\n', (325, 331), False, 'from pg2l.meta.parser.parser import Parser\n')] |
import unittest
from pprint import pprint
from Statistics.Statistics import Statistics
from CSVReader.CSVReader import CsvReader
class MyTestCase(unittest.TestCase):
test_result = CsvReader("Test/Data/result.csv").data
def setUp(self) -> None:
self.statistics = Statistics()
def test_instantiate... | [
"unittest.main",
"Statistics.Statistics.Statistics",
"CSVReader.CSVReader.CsvReader"
] | [((4819, 4834), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4832, 4834), False, 'import unittest\n'), ((187, 220), 'CSVReader.CSVReader.CsvReader', 'CsvReader', (['"""Test/Data/result.csv"""'], {}), "('Test/Data/result.csv')\n", (196, 220), False, 'from CSVReader.CSVReader import CsvReader\n'), ((282, 294), 'S... |
from collections import namedtuple
from pyteomics import mzxml
from threading import Thread
import urllib.request
import queue
Fragment = namedtuple('Fragment', ['Weight', 'Abundance'], defaults=[0.0, 0])
Precursor = namedtuple('Precursor', ['Id', 'PrecursorWeight', 'PrecursorCharge', 'Fragments'], defaults=['', 0.0,... | [
"queue.Queue",
"threading.Thread.__init__",
"pyteomics.mzxml.read",
"collections.namedtuple"
] | [((140, 206), 'collections.namedtuple', 'namedtuple', (['"""Fragment"""', "['Weight', 'Abundance']"], {'defaults': '[0.0, 0]'}), "('Fragment', ['Weight', 'Abundance'], defaults=[0.0, 0])\n", (150, 206), False, 'from collections import namedtuple\n'), ((219, 332), 'collections.namedtuple', 'namedtuple', (['"""Precursor"... |
import matplotlib.pyplot as plt
import numpy as np
import random as r
import time
from drawnow import *
recipe = ["225 g flour",
"90 g sugar",
"1 egg",
"60 g butter",
"100 ml milk",
"1/2 package of yeast",
"225 g flour",
"90 g sugar",
"1... | [
"matplotlib.pyplot.title",
"random.randint",
"numpy.deg2rad",
"time.sleep",
"numpy.sign"
] | [((1502, 1541), 'matplotlib.pyplot.title', 'plt.title', (['"""Matplotlib bakery: A donut"""'], {}), "('Matplotlib bakery: A donut')\n", (1511, 1541), True, 'import matplotlib.pyplot as plt\n'), ((2475, 2514), 'matplotlib.pyplot.title', 'plt.title', (['"""Matplotlib bakery: A donut"""'], {}), "('Matplotlib bakery: A don... |
# MIT License
# Copyright (c) 2021 SUBIN
# 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,... | [
"os.environ.get",
"youtube_dl.YoutubeDL",
"re.match",
"re.search"
] | [((1216, 1235), 'youtube_dl.YoutubeDL', 'YoutubeDL', (['ydl_opts'], {}), '(ydl_opts)\n', (1225, 1235), False, 'from youtube_dl import YoutubeDL\n'), ((1300, 1360), 'os.environ.get', 'os.environ.get', (['"""STREAM_URL"""', '"""https://t.me/DumpPlaylist/30"""'], {}), "('STREAM_URL', 'https://t.me/DumpPlaylist/30')\n", (1... |
#!/usr/bin/env python
#
# Scanning th momdp_plates_v0 in both the MuJoCo environment and the script environment.
#
# Created by <NAME> on June 1, 2020.
#
import time
import matplotlib.pyplot as plt
import gym
plt.style.use('ggplot')
env = gym.make(id='MomdpBumps2d-v0', rendering=False)
belief = None
for i in range... | [
"matplotlib.pyplot.style.use",
"gym.make"
] | [((212, 235), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""ggplot"""'], {}), "('ggplot')\n", (225, 235), True, 'import matplotlib.pyplot as plt\n'), ((243, 290), 'gym.make', 'gym.make', ([], {'id': '"""MomdpBumps2d-v0"""', 'rendering': '(False)'}), "(id='MomdpBumps2d-v0', rendering=False)\n", (251, 290), False... |
# This example demonstrates how to regrid between a UGRID Mesh and a Grid.
# The data files can be retrieved from the ESMF data repository by uncommenting the
# following block of code:
#
# import os
# DD = os.path.join(os.getcwd(), "examples/data")
# if not os.path.isdir(DD):
# os.makedirs(DD)
# from ESMF.util.cac... | [
"numpy.radians",
"matplotlib.pyplot.show",
"numpy.abs",
"numpy.copy",
"matplotlib.pyplot.gca",
"ESMF.Field",
"ESMF.Regrid",
"matplotlib.pyplot.figure",
"numpy.where",
"ESMF.Grid",
"numpy.min",
"numpy.max",
"ESMF.Mesh",
"ESMF.local_pet"
] | [((3391, 3480), 'ESMF.Mesh', 'ESMF.Mesh', ([], {'filename': 'meshfile', 'filetype': 'ESMF.FileFormat.UGRID', 'meshname': '"""adcirc_mesh"""'}), "(filename=meshfile, filetype=ESMF.FileFormat.UGRID, meshname=\n 'adcirc_mesh')\n", (3400, 3480), False, 'import ESMF\n'), ((3584, 3689), 'ESMF.Grid', 'ESMF.Grid', ([], {'fi... |
# -*- coding:utf-8 -*-
#!/usr/bin/env python
"""
author <EMAIL>
"""
from kpages import url
from kpages.model import ModelMaster
from utility import BaseHandler
areamodel = ModelMaster()('AreaModel')
@url(r'/area')
class Area(BaseHandler):
def get(self):
user = ModelMaster()('AccountModel').info(sel... | [
"kpages.url",
"kpages.model.ModelMaster"
] | [((209, 221), 'kpages.url', 'url', (['"""/area"""'], {}), "('/area')\n", (212, 221), False, 'from kpages import url\n'), ((180, 193), 'kpages.model.ModelMaster', 'ModelMaster', ([], {}), '()\n', (191, 193), False, 'from kpages.model import ModelMaster\n'), ((282, 295), 'kpages.model.ModelMaster', 'ModelMaster', ([], {}... |
from joern.shelltool.JoernTool import JoernTool
class TraversalTool(JoernTool):
def __init__(self, DESCRIPTION):
JoernTool.__init__(self, DESCRIPTION)
# @Override
def processLine(self, line):
query = self.queryFromLine(line)
y = self._runGremlinQuery(query)
self.outputRes... | [
"joern.shelltool.JoernTool.JoernTool.__init__"
] | [((127, 164), 'joern.shelltool.JoernTool.JoernTool.__init__', 'JoernTool.__init__', (['self', 'DESCRIPTION'], {}), '(self, DESCRIPTION)\n', (145, 164), False, 'from joern.shelltool.JoernTool import JoernTool\n')] |
from sys import setrecursionlimit
setrecursionlimit(100000)
ans = str(eval(input()))
print(ans if len(ans) < 5 else ans[-4:])
| [
"sys.setrecursionlimit"
] | [((34, 59), 'sys.setrecursionlimit', 'setrecursionlimit', (['(100000)'], {}), '(100000)\n', (51, 59), False, 'from sys import setrecursionlimit\n')] |
import random
import tmdb_manager
import movie_data
import discord
from globals import GlobalDiscordMethods
from trivia.trivia_manager import TriviaManager
async def ask_for_release_year(ctx):
release_year = None
while release_year is None:
movie = tmdb_manager.TMDB.get_recommended_movie_by_title(rand... | [
"discord.Embed",
"random.shuffle",
"random.choice",
"random.randrange",
"trivia.trivia_manager.TriviaManager.display_reactions"
] | [((671, 698), 'random.shuffle', 'random.shuffle', (['decoy_years'], {}), '(decoy_years)\n', (685, 698), False, 'import random\n'), ((719, 819), 'discord.Embed', 'discord.Embed', ([], {'title': 'f"""Which year was \'{movie.title}\' released in?"""', 'description': '""""""', 'color': '(65280)'}), '(title=f"Which year was... |
# Standard Library imports
# Core Flask imports
# Third-party imports
from marshmallow import Schema, fields, validate
# App imports
class AccountValidator(Schema):
username = fields.Str(required=True, load_only=True, validate=[
validate.Length(1, 15, error="Usernames must be less than or equal to ... | [
"marshmallow.fields.Email",
"marshmallow.validate.Length",
"marshmallow.validate.Regexp"
] | [((551, 594), 'marshmallow.fields.Email', 'fields.Email', ([], {'required': '(True)', 'load_only': '(True)'}), '(required=True, load_only=True)\n', (563, 594), False, 'from marshmallow import Schema, fields, validate\n'), ((638, 681), 'marshmallow.fields.Email', 'fields.Email', ([], {'required': '(True)', 'load_only': ... |
# -*- coding: utf-8 -*-
# Copyright (c) 2019 by University of Kassel, <NAME>, RWTH Aachen University and Fraunhofer
# Institute for Energy Economics and Energy System Technology (IEE) Kassel and individual
# contributors (see AUTHORS file for details). All rights reserved.
import pytest
import os
from copy import dee... | [
"pandapower.create_ext_grid",
"simbench.converter.csv2pp",
"pandapower.create_line",
"pytest.main",
"pandapower.create_bus",
"pandapower.networks.example_simple",
"pytest.mark.skipif",
"simbench.converter.read_csv_data",
"simbench.converter.pp2csv_data",
"os.path.join",
"simbench.converter.csv_d... | [((923, 950), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (940, 950), False, 'import logging\n'), ((983, 1024), 'os.path.join', 'os.path.join', (['sb_dir', '"""test"""', '"""converter"""'], {}), "(sb_dir, 'test', 'converter')\n", (995, 1024), False, 'import os\n'), ((1045, 1103), 'os.p... |
# Copyright 2017 Neural Networks and Deep Learning lab, MIPT
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"random.setstate",
"random.shuffle",
"random.seed",
"random.getstate"
] | [((979, 996), 'random.getstate', 'random.getstate', ([], {}), '()\n', (994, 996), False, 'import random\n'), ((1005, 1022), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (1016, 1022), False, 'import random\n'), ((1051, 1068), 'random.getstate', 'random.getstate', ([], {}), '()\n', (1066, 1068), False, 'impo... |
from medio.metadata.affine import Affine
from medio.metadata.metadata import MetaData
from medio.read_save import read_img, save_img
from medio.utils.explicit_slicing import explicit_inds
class MedImg:
def __init__(self, np_image, metadata, filename=None, **kwargs):
"""
Class for a single medical ... | [
"medio.metadata.metadata.MetaData",
"medio.utils.explicit_slicing.explicit_inds",
"medio.read_save.read_img",
"medio.read_save.save_img"
] | [((932, 990), 'medio.read_save.save_img', 'save_img', (['filename', 'self.np_image', 'self.metadata'], {}), '(filename, self.np_image, self.metadata, **kwargs)\n', (940, 990), False, 'from medio.read_save import read_img, save_img\n'), ((1345, 1385), 'medio.utils.explicit_slicing.explicit_inds', 'explicit_inds', (['ite... |
#!/usr/bin/env python
""" Open and close relay on a specific gpio pin """
import time
import sys
global SHOULD_FAKE
SHOULD_FAKE = False
try:
import RPi.GPIO as GPIO
except ImportError:
SHOULD_FAKE = True
RELAY_PIN = 23
STATE = False
def set_relay_pin(pin_id):
if pin_id:
RELAY_PIN = pin_id
# if len(sys.... | [
"RPi.GPIO.setmode",
"RPi.GPIO.setup",
"time.sleep",
"RPi.GPIO.output",
"RPi.GPIO.setwarnings"
] | [((602, 625), 'RPi.GPIO.setwarnings', 'GPIO.setwarnings', (['(False)'], {}), '(False)\n', (618, 625), True, 'import RPi.GPIO as GPIO\n'), ((630, 652), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BCM'], {}), '(GPIO.BCM)\n', (642, 652), True, 'import RPi.GPIO as GPIO\n'), ((658, 683), 'RPi.GPIO.setup', 'GPIO.setup', (['p... |
from pathlib import Path
import numpy as np
import pandas as pd
import pandas.testing as tm
import pytest
from tableauhyperapi import Connection, CreateMode, HyperProcess, TableName, Telemetry
import pantab
import pantab._compat as compat
def assert_roundtrip_equal(result, expected):
"""Compat helper for compar... | [
"pandas.testing.assert_frame_equal",
"pantab.frames_to_hyper",
"pantab.frame_to_hyper",
"pytest.raises",
"pantab.frame_from_hyper_query",
"tableauhyperapi.HyperProcess",
"tableauhyperapi.Connection",
"tableauhyperapi.TableName",
"pathlib.Path.cwd",
"pandas.concat",
"pantab.frames_from_hyper",
... | [((518, 557), 'pandas.testing.assert_frame_equal', 'tm.assert_frame_equal', (['result', 'expected'], {}), '(result, expected)\n', (539, 557), True, 'import pandas.testing as tm\n'), ((706, 783), 'pantab.frame_to_hyper', 'pantab.frame_to_hyper', (['df', 'tmp_hyper'], {'table': 'table_name', 'table_mode': 'table_mode'}),... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright © 2020 <NAME>
# This code is released under the license described in the LICENSE file
from pathlib import Path
import subprocess
from hashlib import sha1
import shutil
from markdown import markdown
subprocess.run(['wasm-pack', 'build', '--target', 'web', '--r... | [
"subprocess.run",
"shutil.rmtree",
"pathlib.Path",
"shutil.copytree",
"shutil.copy"
] | [((259, 345), 'subprocess.run', 'subprocess.run', (["['wasm-pack', 'build', '--target', 'web', '--release']"], {'check': '(True)'}), "(['wasm-pack', 'build', '--target', 'web', '--release'],\n check=True)\n", (273, 345), False, 'import subprocess\n'), ((342, 377), 'subprocess.run', 'subprocess.run', (["['tsc']"], {'... |
import random
def findCountMaxMin(mas1, mas2):
multi_mas = [a * b for a in mas1 for b in mas2 if a * b < 0]
count = len(multi_mas)
if (count > 0):
max_mult = max(multi_mas)
min_mult = min(multi_mas)
else:
max_mult = min_mult = None
return count, max_mult, min_mult
def fi... | [
"random.randint"
] | [((862, 887), 'random.randint', 'random.randint', (['(-100)', '(100)'], {}), '(-100, 100)\n', (876, 887), False, 'import random\n')] |
import os
import sys
from snakemake.shell import shell
# the reference_name argument is inferred by stripping the .seq suffix from
# the output.seq value
# sys.argv[1] = snakemake.input.reference_genome
input = sys.argv[1]
# sys.argv[2] = snakemake.output.seq
output_directory = os.path.dirname(os.path.abspath(sys.argv... | [
"snakemake.shell.shell",
"os.path.abspath",
"os.path.join",
"os.path.basename"
] | [((337, 366), 'os.path.basename', 'os.path.basename', (['sys.argv[2]'], {}), '(sys.argv[2])\n', (353, 366), False, 'import os\n'), ((701, 803), 'snakemake.shell.shell', 'shell', (['"""rsem-prepare-reference --num-threads 1 {extra} {input} {reference_name} > {log} 2>1"""'], {}), "(\n 'rsem-prepare-reference --num-thr... |
from getpass import getpass
# Connection sur le prompt des appareils
def get_input(prompt=''):
try:
line = raw_input(prompt)
except NameError:
line = input(prompt)
return line
def get_credentials():
#Invite, et retourne, un nom d'utilisateur et un mot de passe.
username = get_input('... | [
"getpass.getpass"
] | [((413, 422), 'getpass.getpass', 'getpass', ([], {}), '()\n', (420, 422), False, 'from getpass import getpass\n'), ((449, 485), 'getpass.getpass', 'getpass', (['"""Retaper le mot de passe: """'], {}), "('Retaper le mot de passe: ')\n", (456, 485), False, 'from getpass import getpass\n')] |
import json
import matplotlib.pyplot as plt
import pandas as pd
with open('benchmark_results.json') as f:
data = json.load(f)
df = pd.json_normalize(data['benchmarks'])
df['func'] = df['name'].str.split('[', expand=True)[0]
df['fullfunc'] = df['fullname'].str.split('[', expand=True)[0]
df['param'] = pd.to_numeri... | [
"pandas.json_normalize",
"json.load",
"matplotlib.pyplot.subplots",
"pandas.to_numeric"
] | [((138, 175), 'pandas.json_normalize', 'pd.json_normalize', (["data['benchmarks']"], {}), "(data['benchmarks'])\n", (155, 175), True, 'import pandas as pd\n'), ((308, 334), 'pandas.to_numeric', 'pd.to_numeric', (["df['param']"], {}), "(df['param'])\n", (321, 334), True, 'import pandas as pd\n'), ((119, 131), 'json.load... |