code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
__source__ = 'https://leetcode.com/problems/palindrome-permutation/' # https://github.com/kamyu104/LeetCode/blob/master/Python/palindrome-permutation.py # Time: O(n) # Space: O(1) # # Description: Leetcode # 266. Palindrome Permutation # # Given a string, determine if a permutation of the string could form a palindrom...
[ "unittest.main", "collections.defaultdict", "collections.Counter" ]
[((1764, 1779), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1777, 1779), False, 'import unittest\n'), ((1377, 1393), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (1388, 1393), False, 'from collections import defaultdict\n'), ((1144, 1166), 'collections.Counter', 'collections.Counter', ([...
# ------------------------------------------------------------------------------ # Program: The LDAR Simulator (LDAR-Sim) # File: LDAR-Sim main # Purpose: Interface for parameterizing and running LDAR-Sim. # # Copyright (C) 2018-2021 Intelligent Methane Monitoring and Management System (IM3S) Group # # ...
[ "os.path.exists", "initialization.sims.create_sims", "os.makedirs", "out_processing.prog_table.generate", "initialization.args.get_abs_path", "json.dump", "economics.cost_mitigation.cost_mitigation", "out_processing.batch_reporting.BatchReporting", "utils.generic_functions.check_ERA5_file", "os.ch...
[((2156, 2174), 'os.chdir', 'os.chdir', (['root_dir'], {}), '(root_dir)\n', (2164, 2174), False, 'import os\n'), ((2252, 2277), 'initialization.args.files_from_args', 'files_from_args', (['root_dir'], {}), '(root_dir)\n', (2267, 2277), False, 'from initialization.args import files_from_args, get_abs_path\n'), ((2298, 2...
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2018-2019 Fetch.AI Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the ...
[ "packages.fetchai.skills.tac_negotiation.helpers.build_goods_query", "aea.helpers.search.models.DataModel", "pathlib.Path", "aea.helpers.search.models.ConstraintType", "aea.helpers.search.models.Description", "aea.helpers.search.models.Attribute", "packages.fetchai.skills.tac_negotiation.helpers.build_g...
[((1436, 1502), 'pathlib.Path', 'Path', (['ROOT_DIR', '"""packages"""', '"""fetchai"""', '"""skills"""', '"""tac_negotiation"""'], {}), "(ROOT_DIR, 'packages', 'fetchai', 'skills', 'tac_negotiation')\n", (1440, 1502), False, 'from pathlib import Path\n'), ((2621, 2665), 'aea.helpers.search.models.DataModel', 'DataModel...
# -*- test-case-name: go.vumitools.tests.test_metrics_worker -*- from twisted.internet.defer import inlineCallbacks, returnValue from twisted.internet.task import LoopingCall from vumi import log from vumi.worker import BaseWorker from vumi.config import ConfigInt, ConfigError from vumi.persist.model import Manager ...
[ "twisted.internet.task.LoopingCall", "vumi.config.ConfigError", "vumi.config.ConfigInt", "go.vumitools.api.VumiApi.from_config_async", "go.vumitools.api.VumiApiCommand.command" ]
[((1151, 1349), 'vumi.config.ConfigInt', 'ConfigInt', (['"""How often (in seconds) the worker should send `collect_metrics` commands for each conversation. Must be an integer multiple of `metrics_granularity`."""'], {'default': '(300)', 'static': '(True)'}), "(\n 'How often (in seconds) the worker should send `colle...
import sys from os.path import exists from unittest.mock import patch import numpy as np # type: ignore import pytest from despace.spatial_sort import SortND sys.path.append("..") coords_1d = np.array([1.0, 0.1, 1.5, -0.3, 0.0]) sorted_coords_1d = np.array([-0.3, 0.0, 0.1, 1.0, 1.5]) coords_2d = np.array( [[1...
[ "os.path.exists", "numpy.random.rand", "numpy.array", "pytest.raises", "unittest.mock.patch", "sys.path.append", "despace.spatial_sort.SortND" ]
[((162, 183), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (177, 183), False, 'import sys\n'), ((197, 233), 'numpy.array', 'np.array', (['[1.0, 0.1, 1.5, -0.3, 0.0]'], {}), '([1.0, 0.1, 1.5, -0.3, 0.0])\n', (205, 233), True, 'import numpy as np\n'), ((253, 289), 'numpy.array', 'np.array', (['[-...
import json def is_valid(smc_type): # checks if smc_type is valid if smc_type == 'vmt': return True elif smc_type == 'flt': return True elif smc_type == 'nfl': return True else: return False def parse_vmt(contract): try: contract.get('value') cont...
[ "json.load" ]
[((1197, 1212), 'json.load', 'json.load', (['json'], {}), '(json)\n', (1206, 1212), False, 'import json\n')]
from hamcrest import * from nose.tools import eq_ from mc import List, Some, Nothing,add def test_list_map(): eq_(List([1, 2, 3]).map(lambda x: x * 2), [2, 4, 6]) def test_list_flat_map(): eq_(List([1, 3]).flat_map(lambda x: (x * 2, x * 4)), [2, 4, 6, 12]) def test_list_filter(): eq_(List([1, 2, 3]).f...
[ "mc.Nothing", "mc.List", "nose.tools.eq_", "mc.Some" ]
[((1160, 1182), 'nose.tools.eq_', 'eq_', (['actual', '{9, 8, 7}'], {}), '(actual, {9, 8, 7})\n', (1163, 1182), False, 'from nose.tools import eq_\n'), ((812, 827), 'mc.List', 'List', (['[5, 6, 7]'], {}), '([5, 6, 7])\n', (816, 827), False, 'from mc import List, Some, Nothing, add\n'), ((1083, 1098), 'mc.List', 'List', ...
import sys import re import os import commands HOST = 'grok.zope.org' RELEASEINFOPATH = '/var/www/html/grok/releaseinfo' def _upload_gtk_versions(packageroot, version): # Create the releaseinfo directory for this version. cmd = 'ssh %s "mkdir %s/%s"' % (HOST, RELEASEINFOPATH, version) print(cmd + '\n') ...
[ "commands.getoutput", "os.path.join", "os.getcwd" ]
[((426, 463), 'os.path.join', 'os.path.join', (['packageroot', '"""grok.cfg"""'], {}), "(packageroot, 'grok.cfg')\n", (438, 463), False, 'import os\n'), ((988, 999), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (997, 999), False, 'import os\n'), ((328, 351), 'commands.getoutput', 'commands.getoutput', (['cmd'], {}), '(c...
# Generated by Django 3.1 on 2020-12-25 15:24 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('obywatele', '0019_auto_20201225_1621'), ] operations = [ migrations.AlterField( model_name='uzytkownik', name='busines...
[ "django.db.models.CharField" ]
[((342, 469), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'help_text': '"""If you are running a business"""', 'max_length': '(200)', 'null': '(True)', 'verbose_name': '"""Business"""'}), "(blank=True, help_text='If you are running a business',\n max_length=200, null=True, verbose_name=...
import uuid from datetime import datetime, timedelta from controllers import zfsController import jwt import pam import render JWT_SECRET = "<KEY>" JWT_ALGORITHM = "HS256" JWT_EXP_DELTA_SECONDS = 4300 async def index(request): return render.json({'error': 'nothing to see here...'}, 200) async def auth(request...
[ "jwt.decode", "controllers.zfsController.set_mountpoint", "controllers.zfsController.create_pool", "controllers.zfsController.get_disk_info", "datetime.datetime.utcnow", "controllers.zfsController.get_status", "controllers.zfsController.add_new_disk", "controllers.zfsController.add_spare_disk", "con...
[((242, 295), 'render.json', 'render.json', (["{'error': 'nothing to see here...'}", '(200)'], {}), "({'error': 'nothing to see here...'}, 200)\n", (253, 295), False, 'import render\n'), ((447, 479), 'pam.authenticate', 'pam.authenticate', (['user', 'password'], {}), '(user, password)\n', (463, 479), False, 'import pam...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @copyright &copy; 2010 - 2021, Fraunhofer-Gesellschaft zur Foerderung der # angewandten Forschung e.V. All rights reserved. # # BSD 3-Clause License # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
[ "os.path.abspath", "os.path.join", "os.path.expanduser", "waflib.TaskGen.feature" ]
[((3005, 3032), 'waflib.TaskGen.feature', 'TaskGen.feature', (['"""cppcheck"""'], {}), "('cppcheck')\n", (3020, 3032), False, 'from waflib import Utils, Task, TaskGen, Logs\n'), ((3345, 3403), 'os.path.join', 'os.path.join', (["os.environ['PUBLIC']", '"""Documents"""', '"""MISRA-C"""'], {}), "(os.environ['PUBLIC'], 'Do...
from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String, DateTime, Sequence Base = declarative_base() class Subscription(Base): __tablename__ = 'subscriptions' id = Column(Integer, Sequence('subscription_id_seq'), primary_key=True) sr_id = Column(...
[ "sqlalchemy.Sequence", "sqlalchemy.Column", "sqlalchemy.ext.declarative.declarative_base" ]
[((131, 149), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', ([], {}), '()\n', (147, 149), False, 'from sqlalchemy.ext.declarative import declarative_base\n'), ((313, 339), 'sqlalchemy.Column', 'Column', (['String'], {'index': '(True)'}), '(String, index=True)\n', (319, 339), False, 'from sqlalchemy...
#!/usr/bin/env python # Motherstarter setup file from setuptools import setup, find_packages from motherstarter import __version__, __author__ # Open and read README file with open("README.md", "r", encoding="utf-8") as f: README = f.read() # Setup requirements to be installed requirements = [] with open("requi...
[ "setuptools.find_packages" ]
[((744, 759), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (757, 759), False, 'from setuptools import setup, find_packages\n')]
import graphene from typing import cast from graphene_django import DjangoObjectType from graphene_django.debug import DjangoDebug from django.contrib.auth import get_user_model import devind_dictionaries.schema class UserType(DjangoObjectType): class Meta: model = get_user_model() fields = ('...
[ "django.contrib.auth.get_user_model", "graphene.Field", "typing.cast" ]
[((465, 508), 'graphene.Field', 'graphene.Field', (['DjangoDebug'], {'name': '"""__debug"""'}), "(DjangoDebug, name='__debug')\n", (479, 508), False, 'import graphene\n'), ((284, 300), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (298, 300), False, 'from django.contrib.auth import get_user_...
import numpy as np def main(): from fuzzi.evaluation import pate_train from fuzzi.generated import pate_label predictions = pate_label.outputs truth = [x[-1] for x in pate_label.db_test] print(predictions) print(truth) print('PATE accuracy = %f' % (np.mean(predictions == truth)))
[ "numpy.mean" ]
[((279, 308), 'numpy.mean', 'np.mean', (['(predictions == truth)'], {}), '(predictions == truth)\n', (286, 308), True, 'import numpy as np\n')]
from __future__ import absolute_import, unicode_literals import os import subprocess import pytest from virtualenv.discovery.py_info import PythonInfo from virtualenv.run import run_via_cli from virtualenv.util.path import Path from virtualenv.util.subprocess import Popen CURRENT = PythonInfo.current_system() CREAT...
[ "virtualenv.util.path.Path", "virtualenv.discovery.py_info.PythonInfo.current_system", "virtualenv.util.subprocess.Popen" ]
[((287, 314), 'virtualenv.discovery.py_info.PythonInfo.current_system', 'PythonInfo.current_system', ([], {}), '()\n', (312, 314), False, 'from virtualenv.discovery.py_info import PythonInfo\n'), ((1611, 1621), 'virtualenv.util.subprocess.Popen', 'Popen', (['cmd'], {}), '(cmd)\n', (1616, 1621), False, 'from virtualenv....
#!/usr/bin/env python # -*- coding:utf-8 -*- """================================================================= @Project : Algorithm_YuweiYin/LeetCode-All-Solution/Python3 @File : LC-0388-Longest-Absolute-File-Path.py @Author : [YuweiYin](https://github.com/YuweiYin) @Date : 2022-04-20 ========================...
[ "time.process_time" ]
[((4946, 4965), 'time.process_time', 'time.process_time', ([], {}), '()\n', (4963, 4965), False, 'import time\n'), ((5021, 5040), 'time.process_time', 'time.process_time', ([], {}), '()\n', (5038, 5040), False, 'import time\n')]
import os import sys import warnings warnings.warn( "pathod and pathoc modules are deprecated, see https://github.com/mitmproxy/mitmproxy/issues/4273", DeprecationWarning, stacklevel=2 ) def print_tool_deprecation_message(): print("####", file=sys.stderr) print(f"### {os.path.basename(sys.argv[0...
[ "warnings.warn", "os.path.basename" ]
[((39, 196), 'warnings.warn', 'warnings.warn', (['"""pathod and pathoc modules are deprecated, see https://github.com/mitmproxy/mitmproxy/issues/4273"""', 'DeprecationWarning'], {'stacklevel': '(2)'}), "(\n 'pathod and pathoc modules are deprecated, see https://github.com/mitmproxy/mitmproxy/issues/4273'\n , Depr...
import unittest from model.curseur import Curseur from model.pion import PionBlanc, PionNoir from model.qubic import Qubic class TestQubic(unittest.TestCase): def test_poser(self): q = Qubic() q.poser((0, 7, 0)) self.assertTrue(q.get_pion((0, 0, 0)) == PionBlanc) self.assertFalse(q.get_pion((0, 1, 0))) q....
[ "unittest.main", "model.pion.PionBlanc", "model.qubic.Qubic", "model.curseur.Curseur" ]
[((2433, 2448), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2446, 2448), False, 'import unittest\n'), ((191, 198), 'model.qubic.Qubic', 'Qubic', ([], {}), '()\n', (196, 198), False, 'from model.qubic import Qubic\n'), ((522, 529), 'model.qubic.Qubic', 'Qubic', ([], {}), '()\n', (527, 529), False, 'from model.q...
from typing import Any, Dict, Type, TypeVar, Union import attr from ..models.sherpa_job_bean import SherpaJobBean from ..types import UNSET, Unset T = TypeVar("T", bound="ProjectStatus") @attr.s(auto_attribs=True) class ProjectStatus: """ """ project_name: str status: str pending_job: Union[Unset,...
[ "attr.s", "typing.TypeVar" ]
[((154, 189), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {'bound': '"""ProjectStatus"""'}), "('T', bound='ProjectStatus')\n", (161, 189), False, 'from typing import Any, Dict, Type, TypeVar, Union\n'), ((193, 218), 'attr.s', 'attr.s', ([], {'auto_attribs': '(True)'}), '(auto_attribs=True)\n', (199, 218), False, 'import...
from os import path, makedirs, walk ,remove, scandir, unlink from numpy import inf from torch import save as t_save from lib.utils import sort_human, BOLD, CLR class EarlyStopping: def __init__(self, log_path, patience=7, model=None, verbose=False, exp_tag=""): """Early stops the training if validation ...
[ "lib.utils.sort_human", "os.makedirs", "os.scandir", "os.path.join", "os.path.isdir", "os.unlink", "torch.save", "os.walk" ]
[((975, 995), 'os.path.isdir', 'path.isdir', (['save_dir'], {}), '(save_dir)\n', (985, 995), False, 'from os import path, makedirs, walk, remove, scandir, unlink\n'), ((1009, 1027), 'os.makedirs', 'makedirs', (['save_dir'], {}), '(save_dir)\n', (1017, 1027), False, 'from os import path, makedirs, walk, remove, scandir,...
""" This file tests the TC100 error: >> Missing 'from __future__ import annotations' import The idea is that we should raise one of these errors if a file contains any type-checking imports and one is missing. One thing to note: futures imports should always be at the top of a file, so we only need to check one ...
[ "pytest.mark.parametrize", "tests._get_error" ]
[((2040, 2094), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""example, expected"""', 'examples'], {}), "('example, expected', examples)\n", (2063, 2094), False, 'import pytest\n'), ((2148, 2194), 'tests._get_error', '_get_error', (['example'], {'error_code_filter': '"""TC100"""'}), "(example, error_code_f...
# Copyright (c) 2018 The Regents of the University of Michigan # and the University of Pennsylvania # # 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 li...
[ "logging.getLogger", "os.path.exists", "os.makedirs", "morf.utils.log.set_logger_handlers", "os.path.join", "morf.utils.s3interface.sync_s3_bucket_cache", "morf.utils.docker.load_docker_image", "shutil.copy", "morf.utils.log.execute_and_log_output" ]
[((1492, 1519), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1509, 1519), False, 'import logging\n'), ((1616, 1685), 'os.path.join', 'os.path.join', (['job_config.cache_dir', 'bucket', 'data_dir', 'course', 'session'], {}), '(job_config.cache_dir, bucket, data_dir, course, session)\n',...
import functools def memoise(func): @functools.wraps(func) def wrapper(*args, **kwargs): if not wrapper.hasResult: wrapper.result = func(*args, **kwargs) wrapper.hasResult = True return wrapper.result wrapper.result = None wrapper.hasResult = False return wr...
[ "functools.wraps" ]
[((42, 63), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (57, 63), False, 'import functools\n')]
import datetime as suan def al(text): try: zaman=suan.datetime.now() saat=zaman.strftime("%H") dakika=zaman.strftime("%M") saniye=zaman.strftime("%S") gun=zaman.strftime("%A") ay=zaman.strftime("%B") yil=zaman.strftime("%Y") if gun=="Monday...
[ "datetime.datetime.now" ]
[((66, 85), 'datetime.datetime.now', 'suan.datetime.now', ([], {}), '()\n', (83, 85), True, 'import datetime as suan\n')]
import requests import atexit from apscheduler.schedulers.background import BackgroundScheduler from bs4 import BeautifulSoup class lodeStoneScraper: def __init__(self): self.__URL = 'https://na.finalfantasyxiv.com/lodestone/worldstatus/' self.__statistics = {} self.update_page() ...
[ "bs4.BeautifulSoup", "requests.get", "apscheduler.schedulers.background.BackgroundScheduler" ]
[((365, 386), 'apscheduler.schedulers.background.BackgroundScheduler', 'BackgroundScheduler', ([], {}), '()\n', (384, 386), False, 'from apscheduler.schedulers.background import BackgroundScheduler\n'), ((820, 844), 'requests.get', 'requests.get', (['self.__URL'], {}), '(self.__URL)\n', (832, 844), False, 'import reque...
""" WSGI config for test_project project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/ """ import os import sys from django.core.wsgi import get_wsgi_application # This allows easy...
[ "os.environ.setdefault", "django.core.wsgi.get_wsgi_application", "os.path.join", "os.path.abspath" ]
[((519, 590), 'os.environ.setdefault', 'os.environ.setdefault', (['"""DJANGO_SETTINGS_MODULE"""', '"""config.settings.base"""'], {}), "('DJANGO_SETTINGS_MODULE', 'config.settings.base')\n", (540, 590), False, 'import os\n'), ((606, 628), 'django.core.wsgi.get_wsgi_application', 'get_wsgi_application', ([], {}), '()\n',...
# Generated by Django 2.1.1 on 2020-04-05 06:12 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Response', fields=[ ('id', models.AutoField...
[ "django.db.models.EmailField", "django.db.models.FileField", "django.db.models.AutoField", "django.db.models.DateTimeField", "django.db.models.CharField" ]
[((304, 397), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (320, 397), False, 'from django.db import migrations, models\...
from ctypes.util import find_library as _find_library print(_find_library('sndfile')) print('test fine')
[ "ctypes.util.find_library" ]
[((61, 85), 'ctypes.util.find_library', '_find_library', (['"""sndfile"""'], {}), "('sndfile')\n", (74, 85), True, 'from ctypes.util import find_library as _find_library\n')]
""" Test functions for regular module. """ import pytest import numpy as np from sklearn.linear_model import LinearRegression, LogisticRegression from sklearn.base import clone import tensorflow as tf from tensorflow.keras import Sequential, Model from tensorflow.keras.layers import Dense from tensorflow.keras.optimiz...
[ "numpy.abs", "numpy.prod", "adapt.parameter_based.RegularTransferLR", "tensorflow.random.set_seed", "tensorflow.keras.Sequential", "adapt.parameter_based.RegularTransferNN", "numpy.random.choice", "sklearn.base.clone", "sklearn.linear_model.LogisticRegression", "tensorflow.keras.optimizers.Adam", ...
[((500, 517), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (514, 517), True, 'import numpy as np\n'), ((1173, 1185), 'tensorflow.keras.Sequential', 'Sequential', ([], {}), '()\n', (1183, 1185), False, 'from tensorflow.keras import Sequential, Model\n'), ((1408, 1445), 'sklearn.linear_model.LinearRegre...
import unittest from multienv.config import Config from multienv.env_var import EnvVar from multienv.exceptions import InvalidYamlFileException, \ EnvVarContainerBuildNotFoundException class EnvVarTestCase(unittest.TestCase): def test_get_containers_to_rebuild_with_existent_env_var(self): config = Co...
[ "unittest.main", "multienv.config.Config", "multienv.env_var.EnvVar" ]
[((1794, 1809), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1807, 1809), False, 'import unittest\n'), ((318, 394), 'multienv.config.Config', 'Config', ([], {'env_var_container_build': '"""tests/fixtures/env_var_container_build.yml"""'}), "(env_var_container_build='tests/fixtures/env_var_container_build.yml')\n...
from mythic_payloadtype_container.MythicCommandBase import * import json from uuid import uuid4 from os import path from mythic_payloadtype_container.MythicRPC import * import base64 import donut class AssemblyInjectArguments(TaskArguments): def __init__(self, command_line): super().__init__(command_line)...
[ "base64.b64encode", "uuid.uuid4" ]
[((2238, 2245), 'uuid.uuid4', 'uuid4', ([], {}), '()\n', (2243, 2245), False, 'from uuid import uuid4\n'), ((2602, 2628), 'base64.b64encode', 'base64.b64encode', (['donutPic'], {}), '(donutPic)\n', (2618, 2628), False, 'import base64\n')]
''' Created on 4 Feb 2022 @author: ucacsjj ''' import random from enum import Enum import numpy as np from gym import Env, spaces from .robot_states_and_actions import * # This environment affords a much lower level control of the robot than the # battery environment. It is partially inspired by the AI Gymn Frozen...
[ "random.random", "numpy.zeros", "gym.spaces.Discrete" ]
[((457, 504), 'gym.spaces.Discrete', 'spaces.Discrete', (['RobotActions.NUMBER_OF_ACTIONS'], {}), '(RobotActions.NUMBER_OF_ACTIONS)\n', (472, 504), False, 'from gym import Env, spaces\n'), ((547, 598), 'gym.spaces.Discrete', 'spaces.Discrete', (['RobotBatteryState.NUMBER_OF_STATES'], {}), '(RobotBatteryState.NUMBER_OF_...
# coding:utf-8 # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License" # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
[ "collections.namedtuple", "plato2_en_base.tasks.dialog_generation.DialogGeneration", "paddlehub.module.module.moduleinfo", "argparse.ArgumentParser", "plato2_en_base.models.add_cmdline_args", "os.path.join", "plato2_en_base.tasks.dialog_generation.DialogGeneration.add_cmdline_args", "paddle.fluid.CUDA...
[((1207, 1478), 'paddlehub.module.module.moduleinfo', 'moduleinfo', ([], {'name': '"""plato2_en_base"""', 'version': '"""1.0.0"""', 'summary': '"""A novel pre-training model for dialogue generation, incorporated with latent discrete variables for one-to-many relationship modeling."""', 'author': '"""baidu-nlp"""', 'aut...
# Compute the distance between all the points on a sphere and a # plane. # import pyvista as pv sphere = pv.Sphere() plane = pv.Plane() _ = sphere.compute_implicit_distance(plane, inplace=True) dist = sphere['implicit_distance'] type(dist) # Expected: ## <class 'numpy.ndarray'> # # Plot these distances as a heatmap # p...
[ "pyvista.Plane", "pyvista.Plotter", "pyvista.Sphere" ]
[((105, 116), 'pyvista.Sphere', 'pv.Sphere', ([], {}), '()\n', (114, 116), True, 'import pyvista as pv\n'), ((125, 135), 'pyvista.Plane', 'pv.Plane', ([], {}), '()\n', (133, 135), True, 'import pyvista as pv\n'), ((324, 336), 'pyvista.Plotter', 'pv.Plotter', ([], {}), '()\n', (334, 336), True, 'import pyvista as pv\n')...
# -*- coding: utf-8 -*- # 系统模块 import sys # 数据处理模块 import pandas as pd # 引入外部模块 # 整理数据 from predict_prepare import Predict_Prepare as Prepare # 获取价格预测结果 from predict_predict import Predict_Predict as Predict class Predict_Lead: def __init__(self): pass # 其他包调用的函数 def predict_result(self): ...
[ "predict_predict.Predict_Predict", "predict_prepare.Predict_Prepare", "pandas.concat" ]
[((408, 417), 'predict_prepare.Predict_Prepare', 'Prepare', ([], {}), '()\n', (415, 417), True, 'from predict_prepare import Predict_Prepare as Prepare\n'), ((441, 450), 'predict_predict.Predict_Predict', 'Predict', ([], {}), '()\n', (448, 450), True, 'from predict_predict import Predict_Predict as Predict\n'), ((1752,...
from distutils.core import setup setup( name='als', packages=['als'], version='0.0.2', description='Python library for Alternating Least Squares (ALS)', author='<NAME>', author_email='<EMAIL>', url='https://github.com/ruivieira/python-als', download_url='https://github.com/' ...
[ "distutils.core.setup" ]
[((34, 439), 'distutils.core.setup', 'setup', ([], {'name': '"""als"""', 'packages': "['als']", 'version': '"""0.0.2"""', 'description': '"""Python library for Alternating Least Squares (ALS)"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https://github.com/ruivieira/python-als"""', 'downloa...
# coding=utf-8 # National Oceanic and Atmospheric Administration (NOAA) # Alaskan Fisheries Science Center (AFSC) # Resource Assessment and Conservation Engineering (RACE) # Midwater Assessment and Conservation Engineering (MACE) # THIS SOFTWARE AND ITS DOCUMENTATION ARE CONSIDERED TO BE IN THE PUBLI...
[ "numpy.logical_and", "numpy.max", "numpy.resize", "numpy.empty", "numpy.min" ]
[((1558, 1614), 'numpy.empty', 'np.empty', (['bottom_data.CHUNK_SIZE'], {'dtype': '"""datetime64[ms]"""'}), "(bottom_data.CHUNK_SIZE, dtype='datetime64[ms]')\n", (1566, 1614), True, 'import numpy as np\n'), ((1646, 1692), 'numpy.empty', 'np.empty', (['bottom_data.CHUNK_SIZE'], {'dtype': 'object'}), '(bottom_data.CHUNK_...
from View import telaRelatorio, telaNovoProjeto, telaAbrirProjeto, telaCadastro, telaConfigura, telaConexao, telaEditarControle, telaPopUp from View.Painel import painelSensores, painelControladores, painelConexao from View.Conexao import telaConAnalogAnalog, telaConAnalogDigit, telaConDigitAnalog, telaConDigitDigit ...
[ "View.telaPopUp.TelaPopUp", "View.telaNovoProjeto.TelaNovoProjeto", "View.telaAbrirProjeto.TelaAbrirProjeto", "View.telaConexao.TelaConexao", "View.Conexao.telaConDigitDigit.TelaConDigDig", "View.Painel.painelSensores.PainelSensores", "View.Conexao.telaConDigitAnalog.TelaConDigAnalog", "View.Painel.pa...
[((391, 428), 'View.telaNovoProjeto.TelaNovoProjeto', 'telaNovoProjeto.TelaNovoProjeto', (['tela'], {}), '(tela)\n', (422, 428), False, 'from View import telaRelatorio, telaNovoProjeto, telaAbrirProjeto, telaCadastro, telaConfigura, telaConexao, telaEditarControle, telaPopUp\n'), ((473, 512), 'View.telaAbrirProjeto.Tel...
import tensorflow as tf import numpy as np a = np.arange(15) out = a.reshape(5, 3) c = np.arange(15) / 2 y_onehot = c.reshape(5, 3) out_tensor = tf.convert_to_tensor(out, dtype=tf.float32) y_onehot_tensor = tf.convert_to_tensor(y_onehot, dtype=tf.float32) # y_onehot = tf.one_hot(y_onehot_tensor, depth=3) # one-hot...
[ "tensorflow.convert_to_tensor", "tensorflow.reduce_sum", "numpy.arange", "tensorflow.square" ]
[((48, 61), 'numpy.arange', 'np.arange', (['(15)'], {}), '(15)\n', (57, 61), True, 'import numpy as np\n'), ((148, 191), 'tensorflow.convert_to_tensor', 'tf.convert_to_tensor', (['out'], {'dtype': 'tf.float32'}), '(out, dtype=tf.float32)\n', (168, 191), True, 'import tensorflow as tf\n'), ((210, 258), 'tensorflow.conve...
# # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # # Author: <NAME> (<EMAIL>) # Date: 05/15/2019 # import os import numpy as np import math import sys from torch.utils.data import Sampler __all__=['BatchSampler', 'DistributedBatchSampler', '...
[ "numpy.random.RandomState", "numpy.arange" ]
[((1557, 1589), 'numpy.random.RandomState', 'np.random.RandomState', (['data_seed'], {}), '(data_seed)\n', (1578, 1589), True, 'import numpy as np\n'), ((1516, 1540), 'numpy.arange', 'np.arange', (['total_samples'], {}), '(total_samples)\n', (1525, 1540), True, 'import numpy as np\n'), ((1844, 1868), 'numpy.arange', 'n...
#!/usr/bin/env python # # soaplib - Copyright (C) Soaplib contributors. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any late...
[ "lxml.etree.Element", "soaplib.core.model.clazz.Array", "datetime.datetime", "soaplib.core.model.primitive.Integer", "soaplib.core.model.primitive.Float", "unittest.main", "soaplib.core.util.model_utils.ClassModelConverter", "soaplib.core.model.primitive.String", "soaplib.core.model.primitive.DateTi...
[((1212, 1232), 'soaplib.core.model.primitive.String', 'String', ([], {'min_occurs': '(1)'}), '(min_occurs=1)\n', (1218, 1232), False, 'from soaplib.core.model.primitive import String\n'), ((1244, 1264), 'soaplib.core.model.primitive.String', 'String', ([], {'min_occurs': '(1)'}), '(min_occurs=1)\n', (1250, 1264), Fals...
import moeda preco = float(input("Digite o preço: R$")) por100 = float(input("Digite a porcentagem: ")) formatar = str(input("Deseja formatar como moeda [S/N]? ")).upper() if "S" in formatar: formatado = True else: formatado = False print(f"\nA metade de {moeda.moeda(preco)} é {moeda.metade(preco, formatado)...
[ "moeda.moeda", "moeda.dobro", "moeda.diminuir", "moeda.aumentar", "moeda.metade" ]
[((267, 285), 'moeda.moeda', 'moeda.moeda', (['preco'], {}), '(preco)\n', (278, 285), False, 'import moeda\n'), ((291, 321), 'moeda.metade', 'moeda.metade', (['preco', 'formatado'], {}), '(preco, formatado)\n', (303, 321), False, 'import moeda\n'), ((344, 362), 'moeda.moeda', 'moeda.moeda', (['preco'], {}), '(preco)\n'...
import logging # configure logging before initializing further modules logging.basicConfig(level=logging.DEBUG, format="%(asctime)s [%(levelname)s] %(name)s - %(message)s") logging.getLogger("urllib3.connectionpool").setLevel(logging.INFO) import argparse import json import flask import flask_compress from werkzeug.m...
[ "logging.basicConfig", "logging.getLogger", "json.loads", "pvcontrol.meter.MeterFactory.newMeter", "argparse.ArgumentParser", "pvcontrol.car.CarFactory.newCar", "pvcontrol.chargecontroller.ChargeControllerFactory.newController", "flask.Flask", "pvcontrol.views.PvControlCarStatusView.as_view", "pvc...
[((72, 178), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG', 'format': '"""%(asctime)s [%(levelname)s] %(name)s - %(message)s"""'}), "(level=logging.DEBUG, format=\n '%(asctime)s [%(levelname)s] %(name)s - %(message)s')\n", (91, 178), False, 'import logging\n'), ((668, 695), 'logging.ge...
############################################################################## # Copyright (c) 2016 <NAME> and others. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at #...
[ "django.db.models.OneToOneField", "django.db.models.EmailField", "json.loads", "random.choice", "django.db.models.TextField", "django.db.models.IntegerField", "django.db.models.ForeignKey", "json.dumps", "django.db.models.FileField", "django.db.models.DateTimeField", "django.db.models.BooleanFie...
[((1129, 1181), 'django.db.models.OneToOneField', 'models.OneToOneField', (['User'], {'on_delete': 'models.CASCADE'}), '(User, on_delete=models.CASCADE)\n', (1149, 1181), False, 'from django.db import models\n'), ((1197, 1257), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)', 'blank': '(Fa...
# Blurring and Sharpening Images # Import Computer Vision package - cv2 import cv2 # Import Numerical Python package - numpy as np import numpy as np # Read the image using imread built-in function image = cv2.imread('image_6.jpg') # Display original image using imshow built-in function cv2.imshow("Orig...
[ "cv2.filter2D", "cv2.imshow", "numpy.array", "cv2.destroyAllWindows", "cv2.waitKey", "cv2.blur", "cv2.imread" ]
[((218, 243), 'cv2.imread', 'cv2.imread', (['"""image_6.jpg"""'], {}), "('image_6.jpg')\n", (228, 243), False, 'import cv2\n'), ((304, 333), 'cv2.imshow', 'cv2.imshow', (['"""Original"""', 'image'], {}), "('Original', image)\n", (314, 333), False, 'import cv2\n'), ((370, 384), 'cv2.waitKey', 'cv2.waitKey', (['(0)'], {}...
from flask import Flask, request, jsonify, abort, render_template, redirect, session, url_for import MySQLdb.cursors import hashlib import html import json import math import os import pathlib import random import re import string import urllib import sys from werkzeug.contrib.profiler import ProfilerMiddleware, MergeS...
[ "flask.render_template", "flask.request.args.get", "re.escape", "re.compile", "flask.request.isuda_db.cursor", "urllib.parse.urlencode", "flask.session.pop", "html.escape", "flask.jsonify", "flask.request.isutar_db.cursor", "werkzeug.contrib.profiler.MergeStream", "pathlib.Path", "functools....
[((560, 586), 'werkzeug.contrib.profiler.MergeStream', 'MergeStream', (['sys.stdout', 'f'], {}), '(sys.stdout, f)\n', (571, 586), False, 'from werkzeug.contrib.profiler import ProfilerMiddleware, MergeStream\n'), ((631, 698), 'werkzeug.contrib.profiler.ProfilerMiddleware', 'ProfilerMiddleware', (['app.wsgi_app', 'strea...
from leapp.actors import Actor from leapp.models import InstalledRedHatSignedRPM from leapp.libraries.common.rpms import has_package from leapp.reporting import Report, create_report from leapp import reporting from leapp.tags import ChecksPhaseTag, IPUWorkflowTag class CheckAcpid(Actor): """ Check if acpid i...
[ "leapp.reporting.RelatedResource", "leapp.reporting.Remediation", "leapp.reporting.Title", "leapp.libraries.common.rpms.has_package", "leapp.reporting.Tags", "leapp.reporting.Summary", "leapp.reporting.Severity" ]
[((569, 615), 'leapp.libraries.common.rpms.has_package', 'has_package', (['InstalledRedHatSignedRPM', '"""acpid"""'], {}), "(InstalledRedHatSignedRPM, 'acpid')\n", (580, 615), False, 'from leapp.libraries.common.rpms import has_package\n'), ((661, 732), 'leapp.reporting.Title', 'reporting.Title', (['"""Acpid incompatib...
from crypto_config import (ConfigParser, ParsingError, Crypt) import re class CryptoConfigParser(ConfigParser): def __init__(self, *args, **kwargs): key = kwargs.pop('crypt_key', None) if key != None: self.crypt_key = key else: self.crypt_key = None Config...
[ "crypto_config.ConfigParser.__init__", "crypto_config.Crypt", "crypto_config.ConfigParser.get", "re.search" ]
[((314, 358), 'crypto_config.ConfigParser.__init__', 'ConfigParser.__init__', (['self', '*args'], {}), '(self, *args, **kwargs)\n', (335, 358), False, 'from crypto_config import ConfigParser, ParsingError, Crypt\n'), ((431, 487), 'crypto_config.ConfigParser.get', 'ConfigParser.get', (['self', 'section', 'option', '*arg...
import os.path import scipy.io as sio import numpy as np # for algebraic operations, matrices import keras.models from keras.models import Sequential from keras.layers.core import Dense, Activation, Flatten, Dropout # , Layer, Flatten # from keras.layers import containers from keras.models import model_from_json,Mode...
[ "keras.layers.core.Flatten", "scipy.io.savemat", "keras.callbacks.ModelCheckpoint", "keras.layers.merge.concatenate", "keras.layers.add", "numpy.argmax", "keras.layers.Input", "keras.layers.core.Dense", "keras.regularizers.l2", "keras.models.Model", "numpy.random.seed", "keras.layers.convoluti...
[((1422, 1442), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (1436, 1442), True, 'import numpy as np\n'), ((1450, 1500), 'keras.layers.Input', 'Input', ([], {'shape': '(1, patchSize[0, 0], patchSize[0, 1])'}), '(shape=(1, patchSize[0, 0], patchSize[0, 1]))\n', (1455, 1500), False, 'from keras.laye...
from twarc import Twarc2, expansions import json # Replace your bearer token below client = Twarc2(bearer_token="<PASSWORD>") def main(): # The followers function gets followers for specified user followers = client.followers(user="twitterdev") for page in followers: result = expansions.flatten(p...
[ "twarc.expansions.flatten", "json.dumps", "twarc.Twarc2" ]
[((93, 126), 'twarc.Twarc2', 'Twarc2', ([], {'bearer_token': '"""<PASSWORD>"""'}), "(bearer_token='<PASSWORD>')\n", (99, 126), False, 'from twarc import Twarc2, expansions\n'), ((300, 324), 'twarc.expansions.flatten', 'expansions.flatten', (['page'], {}), '(page)\n', (318, 324), False, 'from twarc import Twarc2, expans...
#!/usr/bin/env python3 # encoding: utf-8 """Easily create ../app.db and import ../lemuria.json""" import asyncio from db_tools import init_db from db_tools import import_world asyncio.run(init_db()) asyncio.run(import_world('../atlemuria.txt', '../proplemuria.txt'))
[ "db_tools.init_db", "db_tools.import_world" ]
[((190, 199), 'db_tools.init_db', 'init_db', ([], {}), '()\n', (197, 199), False, 'from db_tools import init_db\n'), ((213, 267), 'db_tools.import_world', 'import_world', (['"""../atlemuria.txt"""', '"""../proplemuria.txt"""'], {}), "('../atlemuria.txt', '../proplemuria.txt')\n", (225, 267), False, 'from db_tools impor...
import numpy as np import random import matplotlib.pyplot as plt from load_data import loadLabel,loadImage def der_activation_function(x,type): if type==1: return 1 - np.power(np.tanh(x), 2) elif type==2: return (1/(1+np.exp(-x)))*(1-1/(1+np.exp(-x))) else: x[x<=0]=0.25 x[x>...
[ "random.uniform", "numpy.where", "load_data.loadImage", "numpy.tanh", "random.seed", "numpy.argmax", "numpy.exp", "numpy.zeros", "numpy.dot", "numpy.expand_dims", "load_data.loadLabel" ]
[((630, 663), 'numpy.zeros', 'np.zeros', (['(hidden_nodes, size[1])'], {}), '((hidden_nodes, size[1]))\n', (638, 663), True, 'import numpy as np\n'), ((782, 810), 'numpy.zeros', 'np.zeros', (['(10, hidden_nodes)'], {}), '((10, hidden_nodes))\n', (790, 810), True, 'import numpy as np\n'), ((924, 946), 'numpy.zeros', 'np...
import re class AlphabetPosition: alphabet = { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8, 'i': 9, 'j': 10, 'k': 11, 'l': 12, 'm': 13, 'n': 14, 'o': 15, 'p': 16, ...
[ "re.findall" ]
[((786, 819), 're.findall', 're.findall', (['"""[a-zA-Z]+"""', 'sentence'], {}), "('[a-zA-Z]+', sentence)\n", (796, 819), False, 'import re\n')]
from utils import (load_data, data_to_series_features, apply_weight, is_minimum) from algorithm import (initialize_weights, individual_to_key, pop_to_weights, select, reconstruct_population) from sklearn.metrics import mean_squared_error, mean_absolute_error from tensorflow.ker...
[ "utils.data_to_series_features", "utils.is_minimum", "utils.load_data", "argparse.ArgumentParser", "sklearn.model_selection.train_test_split", "algorithm.initialize_weights", "numpy.size", "algorithm.individual_to_key", "algorithm.pop_to_weights", "model.make_model", "algorithm.select", "tenso...
[((601, 679), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Specify Params for Experimental Setting"""'}), "(description='Specify Params for Experimental Setting')\n", (624, 679), False, 'import argparse\n'), ((2118, 2138), 'utils.load_data', 'load_data', (['args.data'], {}), '(args.dat...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys import socketserver from lxml import etree class UdpHandler(socketserver.BaseRequestHandler): def handle(self): data = self.request[0].strip() print("{} wrote:".format(self.client_address[0])) print(data) self.server.decode_...
[ "socketserver.UDPServer.__init__", "lxml.etree.fromstring" ]
[((441, 515), 'socketserver.UDPServer.__init__', 'socketserver.UDPServer.__init__', (['self', 'server_address', 'RequestHandlerClass'], {}), '(self, server_address, RequestHandlerClass)\n', (472, 515), False, 'import socketserver\n'), ((622, 643), 'lxml.etree.fromstring', 'etree.fromstring', (['xml'], {}), '(xml)\n', (...
import os import shutil import tensorflow as tf import torch from torch_mimicry.metrics import compute_kid from torch_mimicry.metrics.inception_model import inception_utils from torch_mimicry.nets.gan import gan class ExampleGen(gan.BaseGenerator): def __init__(self, bottom_width=4, ...
[ "torch_mimicry.metrics.compute_kid.compute_gen_dist_feat", "os.path.exists", "torch.ones", "os.makedirs", "torch_mimicry.metrics.inception_model.inception_utils.create_inception_graph", "torch_mimicry.metrics.compute_kid.kid_score", "torch_mimicry.metrics.compute_kid.compute_real_dist_feat", "shutil.r...
[((719, 752), 'torch.ones', 'torch.ones', (['x.shape[0]', '(3)', '(32)', '(32)'], {}), '(x.shape[0], 3, 32, 32)\n', (729, 752), False, 'import torch\n'), ((998, 1017), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "('cpu')\n", (1010, 1017), False, 'import torch\n'), ((1222, 1281), 'torch_mimicry.metrics.inceptio...
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ .. module:: identity :platform: Unix :synopsis: the top-level submodule of T_System's remote_ui that contains the functions for realizing identity process of T_System. .. moduleauthor:: <NAME> <<EMAIL>> """ from t_system.administration import is_admin from t_sy...
[ "t_system.log_manager.get_logger", "t_system.identifier.change_keys", "t_system.administration.is_admin" ]
[((386, 427), 't_system.log_manager.get_logger', 'log_manager.get_logger', (['__name__', '"""DEBUG"""'], {}), "(__name__, 'DEBUG')\n", (408, 427), False, 'from t_system import log_manager\n'), ((1197, 1215), 't_system.administration.is_admin', 'is_admin', (['admin_id'], {}), '(admin_id)\n', (1205, 1215), False, 'from t...
# Generated by Django 3.2.12 on 2022-04-12 14:00 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("product", "0167_digitalcontenturl_order_line_token"), ("order", "0140_alter_orderline_old_id_and_created_at"), ] operations = [ migrations....
[ "django.db.migrations.RunSQL" ]
[((309, 671), 'django.db.migrations.RunSQL', 'migrations.RunSQL', (['"""\n UPDATE product_digitalcontenturl\n SET order_line_token = (\n SELECT token\n FROM order_orderline\n WHERE product_digitalcontenturl.line_id = order_orderline.id\n )\n ...
from argparse import ArgumentParser from sys import stdin, stdout from tempfile import NamedTemporaryFile from time import sleep from webbrowser import open as open_web from naughtty import NaughTTY from thtml import get_version from thtml.cli import write_html from thtml.options import Scope def cli_entry() -> Non...
[ "thtml.options.Scope", "argparse.ArgumentParser", "webbrowser.open", "time.sleep", "naughtty.NaughTTY", "thtml.get_version", "tempfile.NamedTemporaryFile", "sys.stdin.read" ]
[((336, 477), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'add_help': '(False)', 'description': '"""Converts text to HTML."""', 'epilog': '"""Made with love by <NAME>: https://github.com/cariad/thtml"""'}), "(add_help=False, description='Converts text to HTML.', epilog\n ='Made with love by <NAME>: https://gi...
from flask import Flask, render_template, url_for import os app = Flask(__name__) # Homepage @app.route('/') def index(): return render_template('index.html') # Domestic Dashboards @app.route('/domestic/') @app.route('/domestic/<model>') def domestic(model=None): return render_template('domestic.html', mod...
[ "flask.render_template", "os.listdir", "flask.Flask" ]
[((67, 82), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (72, 82), False, 'from flask import Flask, render_template, url_for\n'), ((136, 165), 'flask.render_template', 'render_template', (['"""index.html"""'], {}), "('index.html')\n", (151, 165), False, 'from flask import Flask, render_template, url_for\...
import pyvisa import time import numpy as np from struct import unpack import matplotlib.pyplot as plt rm = pyvisa.ResourceManager() rm.list_resources() GEM = rm.open_resource('ASRL3::INSTR') def Turn_on(): GEM.write('ON') GEM.write('POWER=001') print('Laser has initialized!!!') def SetPower(pw_mw): ...
[ "time.sleep", "pyvisa.ResourceManager" ]
[((109, 133), 'pyvisa.ResourceManager', 'pyvisa.ResourceManager', ([], {}), '()\n', (131, 133), False, 'import pyvisa\n'), ((424, 438), 'time.sleep', 'time.sleep', (['(10)'], {}), '(10)\n', (434, 438), False, 'import time\n'), ((529, 543), 'time.sleep', 'time.sleep', (['(10)'], {}), '(10)\n', (539, 543), False, 'import...
""" Oxford Flowers dataset loader 1020 samples spanning 102 classes (avg 10 per class) http://www.robots.ox.ac.uk/~vgg/data/flowers """ from __future__ import print_function import numpy as np from PIL import Image, ImageFile from os.path import join import os import scipy.io import tarfile import shutil from torc...
[ "matplotlib.pyplot.imshow", "PIL.Image.open", "numpy.unique", "os.makedirs", "os.path.join", "torchvision.datasets.utils.download_url", "utils.debug.set_working_dir", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "shutil.rmtree", "matplotlib.pyplot.subplot", "os.path.expanduser...
[((7147, 7164), 'utils.debug.set_working_dir', 'set_working_dir', ([], {}), '()\n', (7162, 7164), False, 'from utils.debug import set_working_dir\n'), ((7348, 7360), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (7358, 7360), True, 'import matplotlib.pyplot as plt\n'), ((3059, 3100), 'os.makedirs', 'os.ma...
#!/usr/bin/python3 import re from custom_vims import VIMS import json """ commands: $ create_vims id port $ create_vertiport ENAC $ create_vertiport LFBO $ get_vertiport vertiport_name $ delete_vertiport vertiport_name """ def is_uuid(uuid): """ UUID encription. """ match = re.match('[a-fA-F0-9]{8}-[a-fA-F0-9]{...
[ "re.split", "custom_vims.VIMS", "re.match" ]
[((283, 386), 're.match', 're.match', (['"""[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}"""', 'uuid'], {}), "(\n '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}'\n , uuid)\n", (291, 386), False, 'import re\n'), ((571, 603), 're.split', 're.split', (['"""...
from channels.auth import AuthMiddlewareStack from channels.routing import ProtocolTypeRouter, URLRouter from django.urls import re_path from chat.consumers import ChatConsumer from teams.consumers import InvitationConsumer application = ProtocolTypeRouter({ 'websocket': AuthMiddlewareStack( URLRouter([ ...
[ "django.urls.re_path" ]
[((332, 388), 'django.urls.re_path', 're_path', (['"""^ws/chat/(?P<room_name>[^/]+)/$"""', 'ChatConsumer'], {}), "('^ws/chat/(?P<room_name>[^/]+)/$', ChatConsumer)\n", (339, 388), False, 'from django.urls import re_path\n'), ((403, 464), 'django.urls.re_path', 're_path', (['"""^ws/invitation/(?P<id>[^/]+)/$"""', 'Invit...
import json from spaceone.inventory.libs.manager import AWSManager from spaceone.inventory.connector.pricing import PricingConnector from spaceone.inventory.model.pricing.cloud_service_type import CLOUD_SERVICE_TYPES class PricingManager(AWSManager): conn = None def __init__(self, transaction=None, **kwargs)...
[ "json.loads" ]
[((803, 822), 'json.loads', 'json.loads', (['product'], {}), '(product)\n', (813, 822), False, 'import json\n')]
# Generated by Django 2.1.3 on 2019-02-13 13:00 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('django_drf_filepond', '0002_add_upload_dir'), ] operations = [ migrations.CreateModel( name='Stored...
[ "django.db.models.DateTimeField", "django.db.models.CharField" ]
[((625, 658), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(2048)'}), '(max_length=2048)\n', (641, 658), False, 'from django.db import migrations, models\n'), ((690, 712), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {}), '()\n', (710, 712), False, 'from django.db import migr...
from java.lang import String from org.myrobotlab.service import Speech from org.myrobotlab.service import Sphinx from org.myrobotlab.service import Runtime # create mouth arduino and servo ear = Runtime.createAndStart("ear","Sphinx") arduino = Runtime.createAndStart("arduino","Arduino") arduino.connect("COM4") servo...
[ "java.lang.String", "org.myrobotlab.service.Runtime.createAndStart" ]
[((198, 237), 'org.myrobotlab.service.Runtime.createAndStart', 'Runtime.createAndStart', (['"""ear"""', '"""Sphinx"""'], {}), "('ear', 'Sphinx')\n", (220, 237), False, 'from org.myrobotlab.service import Runtime\n'), ((247, 291), 'org.myrobotlab.service.Runtime.createAndStart', 'Runtime.createAndStart', (['"""arduino""...
import numpy as np import dace as dc M, N = (dc.symbol(s, dtype=dc.int64) for s in ('M', 'N')) @dc.program def flip(A: dc.float64[M]): B = np.ndarray((M, ), dtype=np.float64) for i in dc.map[0:M]: B[i] = A[M - 1 - i] return B @dc.program def kernel(r: dc.float64[N]): y = np.empty_like(r) ...
[ "numpy.empty_like", "numpy.ndarray", "dace.symbol" ]
[((46, 74), 'dace.symbol', 'dc.symbol', (['s'], {'dtype': 'dc.int64'}), '(s, dtype=dc.int64)\n', (55, 74), True, 'import dace as dc\n'), ((146, 180), 'numpy.ndarray', 'np.ndarray', (['(M,)'], {'dtype': 'np.float64'}), '((M,), dtype=np.float64)\n', (156, 180), True, 'import numpy as np\n'), ((302, 318), 'numpy.empty_lik...
import starry import numpy as np import matplotlib.pyplot as plt import pytest @pytest.mark.parametrize("ydeg,nw", [[0, None], [0, 10], [1, None], [1, 10]]) def test_system(ydeg, nw): # Oblate map map = starry.Map(udeg=2, ydeg=ydeg, oblate=True, nw=nw) map[1] = 0.5 map[2] = 0.25 map.omega = 0.5 ...
[ "numpy.allclose", "starry.Primary", "starry.Map", "starry.System", "pytest.mark.parametrize", "numpy.linspace" ]
[((82, 158), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""ydeg,nw"""', '[[0, None], [0, 10], [1, None], [1, 10]]'], {}), "('ydeg,nw', [[0, None], [0, 10], [1, None], [1, 10]])\n", (105, 158), False, 'import pytest\n'), ((214, 263), 'starry.Map', 'starry.Map', ([], {'udeg': '(2)', 'ydeg': 'ydeg', 'oblate'...
# -*- coding: utf-8 -*- """ Created on Mon Feb 15 19:41:48 2021 @author: Traftmine """ import time import pyautogui START = time.time() time.sleep(5) SCRIPT = open("beescript.txt", 'r') for word in SCRIPT: pyautogui.typewrite(word) pyautogui.press("enter") SCRIPT.close() END = time.time() pri...
[ "pyautogui.press", "time.time", "time.sleep", "pyautogui.typewrite" ]
[((135, 146), 'time.time', 'time.time', ([], {}), '()\n', (144, 146), False, 'import time\n'), ((148, 161), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (158, 161), False, 'import time\n'), ((304, 315), 'time.time', 'time.time', ([], {}), '()\n', (313, 315), False, 'import time\n'), ((225, 250), 'pyautogui.typew...
# Generated by Django 2.2.26 on 2022-02-25 16:28 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("home", "0002_listecategorie_utilisateurs"), ] operations = [ migrations.CreateModel( name="Listerole", fields=[ ...
[ "django.db.models.URLField", "django.db.models.AutoField", "django.db.models.CharField" ]
[((806, 844), 'django.db.models.URLField', 'models.URLField', ([], {'blank': '(True)', 'null': '(True)'}), '(blank=True, null=True)\n', (821, 844), False, 'from django.db import migrations, models\n'), ((381, 474), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)'...
from django.contrib import admin # Register your models here. from .models import Organizer admin.site.register(Organizer)
[ "django.contrib.admin.site.register" ]
[((93, 123), 'django.contrib.admin.site.register', 'admin.site.register', (['Organizer'], {}), '(Organizer)\n', (112, 123), False, 'from django.contrib import admin\n')]
"""Utility class for multivariate time series transformation.""" # Author: <NAME> <<EMAIL>> # License: BSD-3-Clause import numpy as np from scipy.sparse import csr_matrix, hstack from sklearn.base import BaseEstimator, TransformerMixin, clone from sklearn.utils.validation import check_is_fitted from ..utils import ch...
[ "sklearn.utils.validation.check_is_fitted", "numpy.unique", "sklearn.base.clone", "numpy.asarray", "scipy.sparse.hstack", "numpy.concatenate", "numpy.transpose" ]
[((3024, 3060), 'sklearn.utils.validation.check_is_fitted', 'check_is_fitted', (['self', '"""estimators_"""'], {}), "(self, 'estimators_')\n", (3039, 3060), False, 'from sklearn.utils.validation import check_is_fitted\n'), ((3377, 3398), 'scipy.sparse.hstack', 'hstack', (['X_transformed'], {}), '(X_transformed)\n', (33...
from functools import partial from itertools import chain import os import sublime import sublime_plugin import textwrap from .lint import elect, events, persist, util if False: from typing import ( Any, Dict, Iterable, List, Optional, Set, Tuple, Union ) from mypy_extensions import Typed...
[ "sublime.windows", "sublime.active_window", "os.path.dirname", "sublime.set_timeout", "functools.partial", "os.path.commonprefix", "sublime.load_resource", "mypy_extensions.TypedDict", "sublime.Region", "os.path.relpath" ]
[((379, 511), 'mypy_extensions.TypedDict', 'TypedDict', (['"""State_"""', "{'active_view': Optional[sublime.View], 'cursor': int,\n 'panel_opened_automatically': Set[sublime.WindowId]}"], {}), "('State_', {'active_view': Optional[sublime.View], 'cursor': int,\n 'panel_opened_automatically': Set[sublime.WindowId]}...
import datetime import re import sys import freezegun import pytest from loguru import logger if sys.version_info < (3, 6): UTC_NAME = "UTC+00:00" else: UTC_NAME = "UTC" @pytest.mark.parametrize( "time_format, date, timezone, expected", [ ( "%Y-%m-%d %H-%M-%S %f %Z %z", ...
[ "datetime.datetime", "loguru.logger.add", "loguru.logger.debug", "loguru.logger.info", "re.fullmatch", "pytest.mark.parametrize", "freezegun.freeze_time" ]
[((184, 2850), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""time_format, date, timezone, expected"""', "[('%Y-%m-%d %H-%M-%S %f %Z %z', '2018-06-09 01:02:03.000045', ('UTC', 0),\n '2018-06-09 01-02-03 000045 UTC +0000'), (\n 'YYYY-MM-DD HH-mm-ss SSSSSS zz ZZ', '2018-06-09 01:02:03.000045', (\n '...
import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from sklearn.metrics import mean_squared_error from sklearn.linear_model import LogisticRegression import pdb from sklearn.metrics import * import matplotlib.pyplot as plt from sklearn import preprocessing from sklearn.preproces...
[ "sklearn.model_selection.train_test_split", "numpy.random.choice", "sklearn.preprocessing.StandardScaler", "numpy.array", "numpy.random.seed", "pandas.DataFrame", "numpy.random.binomial" ]
[((801, 818), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (815, 818), True, 'import numpy as np\n'), ((2715, 2731), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', ([], {}), '()\n', (2729, 2731), False, 'from sklearn.preprocessing import StandardScaler\n'), ((3169, 3223), 'sklearn.model_sel...
# -*- coding: utf-8 -*- """Helper functions for pybaselines. Created on March 5, 2021 @author: <NAME> """ import numpy as np # the minimum positive float values such that a + _MIN_FLOAT != a _MIN_FLOAT = np.finfo(float).eps def relative_difference(old, new, norm_order=None): """ Calculates the relative d...
[ "numpy.polynomial.Polynomial.fit", "numpy.asarray", "numpy.exp", "numpy.sum", "numpy.concatenate", "numpy.linalg.norm", "numpy.finfo", "numpy.pad", "numpy.arange" ]
[((209, 224), 'numpy.finfo', 'np.finfo', (['float'], {}), '(float)\n', (217, 224), True, 'import numpy as np\n'), ((919, 956), 'numpy.linalg.norm', 'np.linalg.norm', (['(new - old)', 'norm_order'], {}), '(new - old, norm_order)\n', (933, 956), True, 'import numpy as np\n'), ((3811, 3827), 'numpy.asarray', 'np.asarray',...
import sys import os import subprocess import time import threading class Popen(object): """ Starts the subprocess with colorful output Arguments: command: The command prefix: The prefix to print before every line color: The color escape code """ def ...
[ "os.close", "subprocess.Popen", "time.sleep", "os.fdopen", "os.pipe" ]
[((2079, 2128), 'subprocess.Popen', 'subprocess.Popen', (['command'], {'stdout': 'subprocess.PIPE'}), '(command, stdout=subprocess.PIPE)\n', (2095, 2128), False, 'import subprocess\n'), ((2265, 2278), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (2275, 2278), False, 'import time\n'), ((811, 820), 'os.pipe', 'os....
from flask import Blueprint, request, jsonify from api.models.user_model import User, UserPasswords, db from flask_bcrypt import Bcrypt user_bp = Blueprint('user_bp', __name__) def validate_register_fields(req): data = req.get_json(silent=True) fields = ['first_name', 'last_name', 'email', 'password'] for...
[ "api.models.user_model.User", "api.models.user_model.db.session.add", "api.models.user_model.db.session.commit", "flask.request.get_json", "api.models.user_model.UserPasswords", "flask.Blueprint", "flask.jsonify" ]
[((146, 176), 'flask.Blueprint', 'Blueprint', (['"""user_bp"""', '__name__'], {}), "('user_bp', __name__)\n", (155, 176), False, 'from flask import Blueprint, request, jsonify\n'), ((628, 657), 'flask.request.get_json', 'request.get_json', ([], {'silent': '(True)'}), '(silent=True)\n', (644, 657), False, 'from flask im...
import subprocess import threading import time import socket import os, sys, random while True: try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) host = '127.0.0.1' port = 9998 s.connect((host, port)) def ddos(*args): def dos(*args): ...
[ "threading.Thread", "random._urandom", "time.time", "socket.socket" ]
[((124, 173), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (137, 173), False, 'import socket\n'), ((331, 342), 'time.time', 'time.time', ([], {}), '()\n', (340, 342), False, 'import time\n'), ((660, 682), 'random._urandom', 'random._urandom'...
from functools import wraps from base64 import b64encode from jose import jwt from flask import Flask, jsonify, request, _app_ctx_stack, json import requests ALGORITHMS = ["RS256"] SCOPES = 'username' # Custom scopes that you want to pass as part of the request when requesting access token AUTH_SERVER_ID = 'YOUR_OKTA_...
[ "requests.post", "jose.jwt.decode", "functools.wraps", "jose.jwt.get_unverified_claims", "jose.jwt.get_unverified_header", "flask.request.headers.get", "flask.jsonify" ]
[((705, 719), 'flask.jsonify', 'jsonify', (['error'], {}), '(error)\n', (712, 719), False, 'from flask import Flask, jsonify, request, _app_ctx_stack, json\n'), ((822, 868), 'requests.post', 'requests.post', (['url'], {'headers': 'headers', 'data': 'data'}), '(url, headers=headers, data=data)\n', (835, 868), False, 'im...
from app import create_app, db app = create_app() @app.shell_context_processor def make_shell_context(): return {'app': app, 'db': db}
[ "app.create_app" ]
[((38, 50), 'app.create_app', 'create_app', ([], {}), '()\n', (48, 50), False, 'from app import create_app, db\n')]
import numpy as np from pykeops.common.lazy_tensor import GenericLazyTensor from pykeops.numpy.utils import numpytools # Convenient aliases: def Var(x_or_ind, dim=None, cat=None): if dim is None: # init via data: we assume x_or_ind is data return LazyTensor(x_or_ind, axis=cat) else: ...
[ "numpy.array" ]
[((2288, 2299), 'numpy.array', 'np.array', (['x'], {}), '(x)\n', (2296, 2299), True, 'import numpy as np\n')]
from django.contrib import admin from .models import ColorAlias admin.site.register(ColorAlias)
[ "django.contrib.admin.site.register" ]
[((66, 97), 'django.contrib.admin.site.register', 'admin.site.register', (['ColorAlias'], {}), '(ColorAlias)\n', (85, 97), False, 'from django.contrib import admin\n')]
#! /usr/bin/env python3 # -*- encoding: utf-8 -*- """ schema object schema """ __author__ = '<NAME> <<EMAIL>>' __version__ = '1.0.0' __date__ = '2019-12-02' import graphene from app.gql.query import Query from app.gql.mutation import Mutation schema = graphene.Schema(query=Query, mutation=Mutation)
[ "graphene.Schema" ]
[((253, 300), 'graphene.Schema', 'graphene.Schema', ([], {'query': 'Query', 'mutation': 'Mutation'}), '(query=Query, mutation=Mutation)\n', (268, 300), False, 'import graphene\n')]
# -*- coding: utf-8 -*- """ @contact: <EMAIL> @time: 2019/3/25 下午9:43 """ import asyncio async def consume(): print('start consume...') await asyncio.sleep(10) print('end consume...') if __name__ == '__main__': tasks = [consume() for i in range(10)] loop = asyncio.get_event_loop() try: ...
[ "asyncio.Task.all_tasks", "asyncio.get_event_loop", "asyncio.wait", "asyncio.sleep" ]
[((284, 308), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (306, 308), False, 'import asyncio\n'), ((154, 171), 'asyncio.sleep', 'asyncio.sleep', (['(10)'], {}), '(10)\n', (167, 171), False, 'import asyncio\n'), ((350, 369), 'asyncio.wait', 'asyncio.wait', (['tasks'], {}), '(tasks)\n', (362, 36...
#!/usr/bin/env python import rospy import socket import math from std_msgs.msg import String from std_msgs.msg import Time from std_msgs.msg import UInt8 from std_msgs.msg import UInt32 from sensor_msgs.msg import Joy from consai_msgs.msg import robot_commands import topic_tools.srv # import ssl_refbox.msg class Bu...
[ "rospy.Subscriber", "rospy.init_node", "rospy.get_param", "rospy.spin", "consai_msgs.msg.robot_commands", "rospy.Publisher", "rospy.loginfo" ]
[((4137, 4169), 'rospy.init_node', 'rospy.init_node', (['"""joystick_node"""'], {}), "('joystick_node')\n", (4152, 4169), False, 'import rospy\n'), ((4318, 4349), 'rospy.get_param', 'rospy.get_param', (['"""friend_color"""'], {}), "('friend_color')\n", (4333, 4349), False, 'import rospy\n'), ((4379, 4419), 'rospy.Subsc...
import random import requests import time class Crowdtangle: def __init__(self,api_tokens=[]): self.api_tokens = api_tokens self.apiBaseUrl = "https://api.crowdtangle.com/ce/" self.chromeAppVersion = "3.0.3" self.userAgent = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KH...
[ "random.choice", "time.sleep", "requests.get" ]
[((628, 684), 'requests.get', 'requests.get', (['requestUrl'], {'params': 'params', 'headers': 'headers'}), '(requestUrl, params=params, headers=headers)\n', (640, 684), False, 'import requests\n'), ((1350, 1366), 'time.sleep', 'time.sleep', (['wait'], {}), '(wait)\n', (1360, 1366), False, 'import time\n'), ((842, 872)...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import json # see: https://en.wikipedia.org/wiki/ISO_3166-2:IR PROVINCE_MAP = { u'آذربایجان شرقی': 1, u'آذربایجان غربی': 2, u'اردبیل': 3, u'اصفهان': 4, u'ایلام': 5, u'بوشهر': 6, u'تهران': 7, u'چهار محال و بختیاری': 8, u'خوزستان': 10, ...
[ "json.load", "json.dump" ]
[((987, 1004), 'json.load', 'json.load', (['opened'], {}), '(opened)\n', (996, 1004), False, 'import json\n'), ((1316, 1361), 'json.dump', 'json.dump', (['data[pid]', 'out'], {'ensure_ascii': '(False)'}), '(data[pid], out, ensure_ascii=False)\n', (1325, 1361), False, 'import json\n')]
from sanic import Sanic from sanic.response import json, text from sanic_graphql import GraphQLView from api import schema, setup app = Sanic() @app.route("/") async def root(request): return text("Welcome! Call me via POST with graphql query in body.") @app.route("/", methods=['POST']) async def post_root(req...
[ "api.setup", "api.schema.execute", "sanic.response.json", "sanic.Sanic", "sanic_graphql.GraphQLView.as_view", "sanic.response.text" ]
[((138, 145), 'sanic.Sanic', 'Sanic', ([], {}), '()\n', (143, 145), False, 'from sanic import Sanic\n'), ((199, 260), 'sanic.response.text', 'text', (['"""Welcome! Call me via POST with graphql query in body."""'], {}), "('Welcome! Call me via POST with graphql query in body.')\n", (203, 260), False, 'from sanic.respon...
from rest_framework import viewsets, permissions, serializers from rest_framework.response import Response from iaso.models import MatchingAlgorithm from .common import HasPermission class AlgorithmsSerializer(serializers.ModelSerializer): class Meta: model = MatchingAlgorithm fields = ["id", "na...
[ "iaso.models.MatchingAlgorithm.objects.all" ]
[((835, 866), 'iaso.models.MatchingAlgorithm.objects.all', 'MatchingAlgorithm.objects.all', ([], {}), '()\n', (864, 866), False, 'from iaso.models import MatchingAlgorithm\n')]
# SPDX-License-Identifier: MIT # Copyright (c) 2020 The Pybricks Authors """ Hardware Module: 1 Description: This tests the lights on the Ultrasonic Sensor. No external sensors are used to verify that it works. """ from pybricks.pupdevices import UltrasonicSensor from pybricks.parameters import Port from pybricks.to...
[ "pybricks.tools.wait", "pybricks.pupdevices.UltrasonicSensor", "urandom.randint" ]
[((482, 491), 'pybricks.tools.wait', 'wait', (['(500)'], {}), '(500)\n', (486, 491), False, 'from pybricks.tools import wait\n'), ((610, 619), 'pybricks.tools.wait', 'wait', (['(500)'], {}), '(500)\n', (614, 619), False, 'from pybricks.tools import wait\n'), ((396, 420), 'pybricks.pupdevices.UltrasonicSensor', 'Ultraso...
#!/usr/bin/env python # -*- encoding: utf-8 -*- ''' @File : tokenzier.py @Time : 2021/09/11 16:00:04 @Author : <NAME> @Version : 1.0 @Contact : <EMAIL> @Desc : None ''' import json import os from typing import List import numpy as np from pypinyin import Style, pinyin from .. import BasicTokeniz...
[ "pypinyin.pinyin", "os.path.join", "os.path.isfile", "numpy.array", "json.load" ]
[((961, 997), 'os.path.join', 'os.path.join', (['bert_path', '"""vocab.txt"""'], {}), "(bert_path, 'vocab.txt')\n", (973, 997), False, 'import os\n'), ((1020, 1053), 'os.path.join', 'os.path.join', (['bert_path', '"""config"""'], {}), "(bert_path, 'config')\n", (1032, 1053), False, 'import os\n'), ((2900, 2919), 'numpy...
# bot.py import os import discord from discord.ext import commands from dotenv import load_dotenv from time import sleep load_dotenv() TOKEN = os.getenv('DISCORD_TOKEN') try: with open('/app/flag.txt', 'r') as r: FLAG = r.read().strip() except FileNotFoundError: FLAG = os.getenv('FLAG', 'bts{tmpflag}...
[ "os.getenv", "discord.ext.commands.Bot", "discord.utils.get", "discord.ext.commands.guild_only", "time.sleep", "dotenv.load_dotenv", "discord.Embed" ]
[((123, 136), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (134, 136), False, 'from dotenv import load_dotenv\n'), ((145, 171), 'os.getenv', 'os.getenv', (['"""DISCORD_TOKEN"""'], {}), "('DISCORD_TOKEN')\n", (154, 171), False, 'import os\n'), ((371, 429), 'discord.ext.commands.Bot', 'commands.Bot', ([], {'com...
# # pr9_3_1 from audiolazy import lazy_lpc from scipy.signal import lfilter, find_peaks from LPC import LPC from Universal import * if __name__ == '__main__': filename = 'snn27.wav' speech = Speech() x, fs = speech.audioread(filename, None) # read one frame data u = lfilter(b=np.array([1, -0.99]), a=1, x=x) # ...
[ "audiolazy.lazy_lpc.lpc.autocor", "LPC.LPC" ]
[((391, 417), 'audiolazy.lazy_lpc.lpc.autocor', 'lazy_lpc.lpc.autocor', (['u', 'p'], {}), '(u, p)\n', (411, 417), False, 'from audiolazy import lazy_lpc\n'), ((463, 468), 'LPC.LPC', 'LPC', ([], {}), '()\n', (466, 468), False, 'from LPC import LPC\n')]
#!/usr/bin/env python # This software was developed in whole or in part by employees of the # Federal Government in the course of their official duties, and with # other Federal assistance. Pursuant to title 17 Section 105 of the # United States Code portions of this software authored by Federal # employees are not su...
[ "os.path.exists", "subprocess.Popen", "dfxml.fileobject_reader", "os.path.dirname", "dfxml.fileobjects_dom", "re.search" ]
[((5442, 5478), 'dfxml.fileobject_reader', 'dfxml.fileobject_reader', ([], {'flags': 'flags'}), '(flags=flags)\n', (5465, 5478), False, 'import dfxml\n'), ((6201, 6273), 'dfxml.fileobjects_dom', 'dfxml.fileobjects_dom', ([], {'xmlfile': 'xmlfile', 'imagefile': 'imagefile', 'flags': 'flags'}), '(xmlfile=xmlfile, imagefi...
# Program to check how effective is Java's String's Hash Collision # for generating hash codes for Indian Phone No.s import random from pprint import pprint SAMPLE_SPACE = 10000 def genJavaHashCode(phone: str) -> int: """ s[0]*31^(n-1) + s[1]*31^(n-2) + … + s[n-1] where : s[i] – is the it...
[ "random.randint" ]
[((764, 784), 'random.randint', 'random.randint', (['(7)', '(9)'], {}), '(7, 9)\n', (778, 784), False, 'import random\n'), ((800, 820), 'random.randint', 'random.randint', (['(0)', '(9)'], {}), '(0, 9)\n', (814, 820), False, 'import random\n')]
import os TWO_WEEKS = 1209600 SECRET_KEY = os.getenv('SECRET_KEY', None) assert SECRET_KEY TOKEN_EXPIRES = TWO_WEEKS DATABASE_URL = os.getenv( 'DATABASE_URL', 'postgres://postgres@{0}:5432/postgres'.format(os.getenv('DB_PORT_5432_TCP_ADDR', None))) assert DATABASE_URL REDIS_HOST = os.getenv('REDIS_HOST', ...
[ "os.getenv" ]
[((46, 75), 'os.getenv', 'os.getenv', (['"""SECRET_KEY"""', 'None'], {}), "('SECRET_KEY', None)\n", (55, 75), False, 'import os\n'), ((382, 415), 'os.getenv', 'os.getenv', (['"""REDIS_PASSWORD"""', 'None'], {}), "('REDIS_PASSWORD', None)\n", (391, 415), False, 'import os\n'), ((320, 363), 'os.getenv', 'os.getenv', (['"...
import numpy as np class Compressor(): def __init__(self, num_particles: int, num_spin_orbitals: int, rdm_ideal=None) -> None: self.num_particles = num_particles self.num_spin_orbitals = num_spin_orbitals self.rdm_ideal = rdm_ideal pass def compress(self, rdm): ...
[ "numpy.zeros", "numpy.sqrt", "numpy.diag" ]
[((577, 595), 'numpy.zeros', 'np.zeros', (['(3 * S,)'], {}), '((3 * S,))\n', (585, 595), True, 'import numpy as np\n'), ((1132, 1171), 'numpy.zeros', 'np.zeros', (['((self.num_spin_orbitals,) * 4)'], {}), '((self.num_spin_orbitals,) * 4)\n', (1140, 1171), True, 'import numpy as np\n'), ((3642, 3660), 'numpy.zeros', 'np...