code
stringlengths
20
1.04M
apis
list
extract_api
stringlengths
75
9.94M
# coding=utf-8 # Distributed under the MIT software license, see the accompanying # file LICENSE or http://www.opensource.org/licenses/mit-license.php. import grpc from concurrent.futures import ThreadPoolExecutor from unittest import TestCase from mock import Mock from pyqrllib.pyqrllib import bin2hstr, hstr2bin fro...
[ "tests.misc.helper.set_qrl_dir", "qrl.core.misc.logger.initialize_default", "qrl.generated.qrl_pb2.IsSlaveResp", "tests.misc.helper.get_bob_xmss", "qrl.generated.qrl_pb2.GetHeightResp", "qrl.generated.qrl_pb2.GetNodeStateResp", "qrl.generated.qrl_pb2.SlaveMetadata", "pyqrllib.pyqrllib.bin2hstr", "qr...
[((1012, 1039), 'qrl.core.misc.logger.initialize_default', 'logger.initialize_default', ([], {}), '()\n', (1037, 1039), False, 'from qrl.core.misc import logger\n'), ((1819, 1845), 'tests.misc.helper.set_qrl_dir', 'set_qrl_dir', (['"""wallet_ver1"""'], {}), "('wallet_ver1')\n", (1830, 1845), False, 'from tests.misc.hel...
import numpy as np from keras.preprocessing.sequence import pad_sequences from models.utils import load_data,SentenceGetter,bulid_dataset from keras.models import Model,Input,load_model from keras.layers import LSTM,Embedding,Dense,TimeDistributed,Bidirectional from keras_contrib.layers import CRF from keras_contrib.ut...
[ "keras.models.load_model", "keras_contrib.utils.save_load_utils.load_all_weights", "flask.request.args.get", "numpy.argmax", "keras.layers.LSTM", "flask.Flask", "numpy.zeros", "keras.models.Input", "keras.models.Model", "flask.jsonify", "keras.layers.Dense", "keras_contrib.layers.CRF", "kera...
[((416, 445), 'keras.backend.clear_session', 'keras.backend.clear_session', ([], {}), '()\n', (443, 445), False, 'import keras\n'), ((450, 465), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (455, 465), False, 'from flask import Flask, request, render_template, jsonify\n'), ((552, 578), 'models.utils.load...
import os import socketserver import threading from http.server import SimpleHTTPRequestHandler from os.path import dirname, realpath from urllib.parse import parse_qs, urlparse LOCAL_WEBSERVER_PORT = 8000 BASE_TEST_URL_DOMAIN = "localhost" BASE_TEST_URL_NOPATH = "http://%s:%s" % (BASE_TEST_URL_DOMAIN, LOCAL_WEBSERVER...
[ "threading.Thread", "http.server.SimpleHTTPRequestHandler.__init__", "http.server.SimpleHTTPRequestHandler.do_GET", "os.path.realpath", "urllib.parse.parse_qs", "urllib.parse.urlparse" ]
[((3812, 3857), 'threading.Thread', 'threading.Thread', ([], {'target': 'server.serve_forever'}), '(target=server.serve_forever)\n', (3828, 3857), False, 'import threading\n'), ((2000, 2056), 'http.server.SimpleHTTPRequestHandler.__init__', 'SimpleHTTPRequestHandler.__init__', (['self', '*args'], {}), '(self, *args, **...
# coding=utf-8 # Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA 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...
[ "torch.nn.Dropout", "copy.deepcopy", "pytorch_pretrained_bert.modeling_gpt2.GPT2LMHead", "pytorch_pretrained_bert.modeling_gpt2.MLP", "torch.nn.Embedding", "pytorch_pretrained_bert.modeling_gpt2.LayerNorm", "torch.nn.CrossEntropyLoss", "torch.exp", "torch.nn.Softmax", "torch.nn.Linear", "torch.m...
[((1069, 1096), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1086, 1096), False, 'import logging\n'), ((1300, 1318), 'torch.matmul', 'torch.matmul', (['q', 'k'], {}), '(q, k)\n', (1312, 1318), False, 'import torch\n'), ((1593, 1611), 'torch.matmul', 'torch.matmul', (['w', 'v'], {}), '(...
# Copyright 2018 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
[ "contrib.bitflip_env.rlgraph.environments.OpenAIGymEnv", "numpy.mean" ]
[((1085, 1108), 'contrib.bitflip_env.rlgraph.environments.OpenAIGymEnv', 'OpenAIGymEnv', (['"""Pong-v0"""'], {}), "('Pong-v0')\n", (1097, 1108), False, 'from contrib.bitflip_env.rlgraph.environments import OpenAIGymEnv\n'), ((1821, 1847), 'contrib.bitflip_env.rlgraph.environments.OpenAIGymEnv', 'OpenAIGymEnv', (['"""bi...
# Importing the Kratos Library import KratosMultiphysics import KratosMultiphysics.IgaApplication from KratosMultiphysics.StructuralMechanicsApplication.structural_mechanics_analysis import StructuralMechanicsAnalysis # Import KratosUnittest import KratosMultiphysics.KratosUnittest as KratosUnittest class IgaTestFact...
[ "KratosMultiphysics.KratosUnittest.main", "KratosMultiphysics.Model", "KratosMultiphysics.KratosUnittest.WorkFolderScope", "KratosMultiphysics.Logger.GetDefaultOutput", "KratosMultiphysics.StructuralMechanicsApplication.structural_mechanics_analysis.StructuralMechanicsAnalysis" ]
[((3425, 3446), 'KratosMultiphysics.KratosUnittest.main', 'KratosUnittest.main', ([], {}), '()\n', (3444, 3446), True, 'import KratosMultiphysics.KratosUnittest as KratosUnittest\n'), ((424, 469), 'KratosMultiphysics.KratosUnittest.WorkFolderScope', 'KratosUnittest.WorkFolderScope', (['"""."""', '__file__'], {}), "('.'...
# -*- coding: utf-8 -*- ''' Module for listing programs that automatically run on startup (very alpha...not tested on anything but my Win 7x64) ''' # Import python libs import os # Import bonneville libs import bonneville.utils # Define a function alias in order not to shadow built-in's __func_alias__ = { 'list...
[ "os.listdir" ]
[((1552, 1572), 'os.listdir', 'os.listdir', (['user_dir'], {}), '(user_dir)\n', (1562, 1572), False, 'import os\n'), ((1660, 1680), 'os.listdir', 'os.listdir', (['full_dir'], {}), '(full_dir)\n', (1670, 1680), False, 'import os\n')]
import json import logging from cloud_scanner.contracts import ( CloudConfigReader, QueueFactory, StorageContainerFactory ) from cloud_scanner.config.process_config import ProcessConfig class TaskScheduler: """Schedule tasks for resource scanning.""" @staticmethod def execute(): """Execute s...
[ "json.dumps", "logging.info", "cloud_scanner.contracts.StorageContainerFactory.create", "cloud_scanner.contracts.QueueFactory.create", "cloud_scanner.contracts.CloudConfigReader", "cloud_scanner.config.process_config.ProcessConfig" ]
[((476, 507), 'cloud_scanner.contracts.QueueFactory.create', 'QueueFactory.create', (['queue_name'], {}), '(queue_name)\n', (495, 507), False, 'from cloud_scanner.contracts import CloudConfigReader, QueueFactory, StorageContainerFactory\n'), ((536, 568), 'cloud_scanner.contracts.StorageContainerFactory.create', 'Storag...
""" Do not modify this file. It is generated from the Swagger specification. Container module for JSONSchema definitions. This does not include inlined definitions. The pretty-printing functionality provided by the json module is superior to what is provided by pformat, hence the use of json.loads(). """ import json ...
[ "json.loads" ]
[((423, 2130), 'json.loads', 'json.loads', (['"""\n{\n "properties": {\n "_post_logout_redirect_uris": {\n "description": "New-line delimited list of post-logout redirect URIs",\n "type": "string"\n },\n "_redirect_uris": {\n "description": "New-line delimited li...
import logging import re import sqlite3 from django.core.management import CommandError from django.core.management.base import BaseCommand from sqlalchemy import inspect as sqlinspect from corehq.apps.userreports.models import StaticDataSourceConfiguration from corehq.apps.userreports.util import get_indicator_adapt...
[ "sqlalchemy.inspect", "django.core.management.CommandError", "corehq.sql_db.connections.connection_manager.get_engine", "re.findall", "sqlite3.connect", "corehq.apps.userreports.models.StaticDataSourceConfiguration.by_domain", "corehq.apps.userreports.util.get_indicator_adapter", "custom.icds_reports....
[((683, 710), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (700, 710), False, 'import logging\n'), ((2006, 2038), 'sqlite3.connect', 'sqlite3.connect', (['output_database'], {}), '(output_database)\n', (2021, 2038), False, 'import sqlite3\n'), ((2868, 2915), 'corehq.sql_db.connections.c...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Dict, List, Mapping, Optional, Tuple, Union from . import _...
[ "pulumi.get", "pulumi.getter", "pulumi.set" ]
[((791, 827), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""enableBatching"""'}), "(name='enableBatching')\n", (804, 827), False, 'import pulumi\n'), ((948, 979), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""sendAfter"""'}), "(name='sendAfter')\n", (961, 979), False, 'import pulumi\n'), ((892, 927), 'pulum...
from setuptools import setup if __name__ == "__main__": setup( name="mgit", setup_requires="setupmeta", versioning="dev", author="<NAME> <EMAIL>", keywords='multiple, git, repos', url="https://github.com/zsimic/mgit", entry_points={ "console_scri...
[ "setuptools.setup" ]
[((62, 943), 'setuptools.setup', 'setup', ([], {'name': '"""mgit"""', 'setup_requires': '"""setupmeta"""', 'versioning': '"""dev"""', 'author': '"""<NAME> <EMAIL>"""', 'keywords': '"""multiple, git, repos"""', 'url': '"""https://github.com/zsimic/mgit"""', 'entry_points': "{'console_scripts': ['mgit = mgit.cli:main']}"...
import numpy as np from mmdet.core.evaluation.mean_ap import eval_map, tpfp_default, tpfp_imagenet det_bboxes = np.array([ [0, 0, 10, 10], [10, 10, 20, 20], [32, 32, 38, 42], ]) gt_bboxes = np.array([[0, 0, 10, 20], [0, 10, 10, 19], [10, 10, 20, 20]]) gt_ignore = np.array([[5, 5, 10, 20], [6, 10...
[ "mmdet.core.evaluation.mean_ap.tpfp_imagenet", "numpy.array", "mmdet.core.evaluation.mean_ap.tpfp_default", "mmdet.core.evaluation.mean_ap.eval_map" ]
[((118, 180), 'numpy.array', 'np.array', (['[[0, 0, 10, 10], [10, 10, 20, 20], [32, 32, 38, 42]]'], {}), '([[0, 0, 10, 10], [10, 10, 20, 20], [32, 32, 38, 42]])\n', (126, 180), True, 'import numpy as np\n'), ((213, 274), 'numpy.array', 'np.array', (['[[0, 0, 10, 20], [0, 10, 10, 19], [10, 10, 20, 20]]'], {}), '([[0, 0,...
# System modules import re import uuid import requests from abc import ABCMeta from dataclasses import dataclass, field from typing import Dict # 3rd party modules from flask import abort, make_response from marshmallow import fields # local modules from config import ma from models.user import requires_login class...
[ "uuid.uuid4", "dataclasses.field", "requests.get", "flask.make_response", "dataclasses.dataclass", "marshmallow.fields.Nested" ]
[((721, 740), 'dataclasses.dataclass', 'dataclass', ([], {'eq': '(False)'}), '(eq=False)\n', (730, 740), False, 'from dataclasses import dataclass, field\n'), ((487, 544), 'marshmallow.fields.Nested', 'fields.Nested', (['"""RecipeBahanSchema"""'], {'default': '[]', 'many': '(True)'}), "('RecipeBahanSchema', default=[],...
import json from rest_framework import status from rest_framework.reverse import reverse from api.core.test_utils import APITestMixin class TestCategories(APITestMixin): def test_metadata_dict(self): """Test all items are exposed using metadata""" url = reverse("metadata") response = sel...
[ "rest_framework.reverse.reverse", "json.dumps" ]
[((278, 297), 'rest_framework.reverse.reverse', 'reverse', (['"""metadata"""'], {}), "('metadata')\n", (285, 297), False, 'from rest_framework.reverse import reverse\n'), ((628, 647), 'rest_framework.reverse.reverse', 'reverse', (['"""metadata"""'], {}), "('metadata')\n", (635, 647), False, 'from rest_framework.reverse...
from django.shortcuts import render from django.http import HttpResponse def projects(request): return render(request,'pro.html') # Create your views here.
[ "django.shortcuts.render" ]
[((110, 137), 'django.shortcuts.render', 'render', (['request', '"""pro.html"""'], {}), "(request, 'pro.html')\n", (116, 137), False, 'from django.shortcuts import render\n')]
# -*- coding: utf-8 -*- u"""Useful operations for unit tests :copyright: Copyright (c) 2015 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function from pykern import pkcollections from pykern import pkcompat fr...
[ "pykern.pkio.write_text", "pykern.pkcompat.from_bytes", "importlib.import_module", "pykern.pkio.mkdir_parent_only", "pykern.pkinspect.caller", "os.popen", "pykern.pkdebug.pkdexc", "os.environ.get", "inspect.currentframe", "pykern.pkio.read_text", "py.path.local", "pykern.pkdebug.pkdpretty", ...
[((945, 959), 're.compile', 're.compile', (['""""""'], {}), "('')\n", (955, 959), False, 'import re\n'), ((1626, 1643), 'pykern.pkdebug.pkdpretty', 'pkdpretty', (['actual'], {}), '(actual)\n', (1635, 1643), False, 'from pykern.pkdebug import pkdpretty\n'), ((1712, 1738), 'pykern.pkio.write_text', 'pkio.write_text', (['...
# Copyright 2017 <NAME>. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
[ "os.path.realpath" ]
[((739, 765), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (755, 765), False, 'import sys, os\n')]
import os from pathlib import Path import pytest from jina import __version__ as jina_version from jina.docker import hubapi from jina.docker.hubio import HubIO from jina.excepts import RuntimeFailToStart, HubBuilderError, ImageAlreadyExists from jina.executors import BaseExecutor from jina.flow import Flow from jina...
[ "os.path.abspath", "os.getcwd", "jina.parsers.set_pod_parser", "jina.parsers.hub.set_hub_build_parser", "jina.jaml.JAML.load", "os.environ.get", "pytest.raises", "pytest.mark.skipif", "jina.executors.BaseExecutor.load_config", "jina.helper.expand_dict", "jina.docker.hubio.HubIO", "jina.parsers...
[((2327, 2390), 'pytest.mark.skip', 'pytest.mark.skip', (['"""https://github.com/jina-ai/jina/issues/1641"""'], {}), "('https://github.com/jina-ai/jina/issues/1641')\n", (2343, 2390), False, 'import pytest\n'), ((2392, 2485), 'pytest.mark.skipif', 'pytest.mark.skipif', ([], {'condition': "('GITHUB_TOKEN' not in os.envi...
# # # ================================================================= # ================================================================= """P Database API Class for providing access to the Cinder Database""" from cinder.openstack.common.db import api as common_db _BACKEND_MAPPING = {'sqlalchemy': 'paxes_cinder.db...
[ "cinder.openstack.common.db.api.DBAPI" ]
[((345, 394), 'cinder.openstack.common.db.api.DBAPI', 'common_db.DBAPI', ([], {'backend_mapping': '_BACKEND_MAPPING'}), '(backend_mapping=_BACKEND_MAPPING)\n', (360, 394), True, 'from cinder.openstack.common.db import api as common_db\n')]
import uuid import arrow import django_filters from arrow.parser import ParserError from django.conf import settings from guardian.core import ObjectPermissionChecker from django.contrib.auth import get_user_model from django.conf import settings from django.http import JsonResponse from django.utils.translation import...
[ "arrow.get", "rest_framework.fields.IntegerField", "rest_framework.serializers.ChoiceField", "resources.models.utils.build_reservations_ical_file", "rest_framework.fields.BooleanField", "django.http.JsonResponse", "resources.models.Reservation", "resources.models.utils.generate_reservation_xlsx", "g...
[((2378, 2394), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (2392, 2394), False, 'from django.contrib.auth import get_user_model\n'), ((2620, 2672), 'rest_framework.serializers.ReadOnlyField', 'serializers.ReadOnlyField', ([], {'source': '"""get_display_name"""'}), "(source='get_display_na...
from __future__ import print_function import sys import datetime import time from tweaker.tweaker import DatabaseTweaker from config import config import redis print( str(datetime.datetime.today()) ) do_commit = ( input("Commit changes to database (y/n): ") == "y") if do_commit: print( "COMMITTING changes to data...
[ "redis.Redis", "datetime.datetime.today", "tweaker.tweaker.DatabaseTweaker.tweaker_from_connection", "time.sleep" ]
[((769, 786), 'redis.Redis', 'redis.Redis', ([], {'db': '(1)'}), '(db=1)\n', (780, 786), False, 'import redis\n'), ((175, 200), 'datetime.datetime.today', 'datetime.datetime.today', ([], {}), '()\n', (198, 200), False, 'import datetime\n'), ((2175, 2304), 'tweaker.tweaker.DatabaseTweaker.tweaker_from_connection', 'Data...
"""An assembler for the tiny virtual machine. (Initial, stripped down version.) This is a single-pass assembler with back-patching resolution. There are two approaches to "resolving" labels: (a) Two pass resolution: Run through the source code once to determine addresses, then run through a second time to actually...
[ "json.load", "argparse.ArgumentParser", "logging.basicConfig", "re.match", "json.dumps", "pathlib.Path", "configparser.ConfigParser", "argparse.FileType", "logging.getLogger", "re.compile" ]
[((749, 770), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (768, 770), False, 'import logging\n'), ((777, 804), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (794, 804), False, 'import logging\n'), ((17016, 17700), 're.compile', 're.compile', (['"""\n ((?P<label> \\...
# -*- coding: utf-8 -*- # pylint: disable=too-many-function-args,unexpected-keyword-arg import subprocess from sh import gitlint, echo # pylint: disable=no-name-in-module from qa.base import BaseTestCase, ustr class StdInTests(BaseTestCase): """ Integration tests for various STDIN scenarios for gitlint """ ...
[ "sh.echo", "subprocess.Popen", "qa.base.ustr" ]
[((818, 842), 'sh.echo', 'echo', (['u"""WIP: Pïpe test."""'], {}), "(u'WIP: Pïpe test.')\n", (822, 842), False, 'from sh import gitlint, echo\n'), ((1925, 1939), 'sh.echo', 'echo', (['"""-n"""', '""""""'], {}), "('-n', '')\n", (1929, 1939), False, 'from sh import gitlint, echo\n'), ((3024, 3125), 'subprocess.Popen', 's...
from .config import DefaultConfig as Config from .models import UserSetting, ChatHistory import telegram import logging import textwrap class Command: def __init__(self, name: str, func): self.name = name self.func = func class Queryer: command_delimiter = "\n" def __init__(self): ...
[ "textwrap.dedent", "logging.error" ]
[((1295, 1324), 'textwrap.dedent', 'textwrap.dedent', (['response[1:]'], {}), '(response[1:])\n', (1310, 1324), False, 'import textwrap\n'), ((2216, 2245), 'textwrap.dedent', 'textwrap.dedent', (['response[1:]'], {}), '(response[1:])\n', (2231, 2245), False, 'import textwrap\n'), ((7617, 7681), 'logging.error', 'loggin...
from copy import deepcopy from datetime import timedelta from typing import Dict from typing import List from typing import Tuple from typing import Union import numpy as np import pandas as pd import pytest from etna.transforms.timestamp import DateFlagsTransform WEEKEND_DAYS = (5, 6) SPECIAL_DAYS = [1, 4] SPECIAL_...
[ "copy.deepcopy", "pandas.date_range", "etna.transforms.timestamp.DateFlagsTransform", "pytest.raises", "datetime.timedelta", "pytest.mark.parametrize", "pandas.concat", "numpy.all" ]
[((4754, 5123), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""true_params"""', "(['day_number_in_week'], ['day_number_in_month'], ['week_number_in_year'],\n ['week_number_in_month'], ['month_number_in_year'], ['year_number'], [\n 'is_weekend'], ['day_number_in_week', 'day_number_in_month',\n 'wee...
import random from collections import deque import pickle import math q_table = {} # INITIAL_EPSILON = 0.1 INITIAL_EPSILON = 0.0001 FINAL_EPSILON = 0.0001 EPSILON = INITIAL_EPSILON EXPLORE = 4000000 LAMBDA = 0.8 ALPHA = 0.7 REWARD = 1 PENALTY = -1000 MEMORY_LENGTH = 50000 REWARD_MEMORY_LENGTH = 4 PENALTY_MEMORY_LEN...
[ "pickle.dump", "random.sample", "math.floor", "random.random", "pickle.load", "random.randrange", "collections.deque" ]
[((490, 497), 'collections.deque', 'deque', ([], {}), '()\n', (495, 497), False, 'from collections import deque\n'), ((514, 521), 'collections.deque', 'deque', ([], {}), '()\n', (519, 521), False, 'from collections import deque\n'), ((577, 608), 'math.floor', 'math.floor', (['(number / RESOLUTION)'], {}), '(number / RE...
from assemblyline_client.v4_client.common.utils import SEARCHABLE, ClientError, api_path class Facet(object): def __init__(self, connection): self._connection = connection def _do_facet(self, index, field, **kwargs): if index not in SEARCHABLE: raise ClientError("Index %s is not s...
[ "assemblyline_client.v4_client.common.utils.api_path", "assemblyline_client.v4_client.common.utils.ClientError" ]
[((741, 792), 'assemblyline_client.v4_client.common.utils.api_path', 'api_path', (['"""search"""', '"""facet"""', 'index', 'field'], {}), "('search', 'facet', index, field, **kwargs)\n", (749, 792), False, 'from assemblyline_client.v4_client.common.utils import SEARCHABLE, ClientError, api_path\n'), ((290, 344), 'assem...
from django.db import models # Create your models here, and outline what data to store in the application # Create a model that extends Django's model class, and add two charfields which only store strings. class Airport(models.Model): code = models.CharField(max_length=3) city = models.CharField(max_length=64...
[ "django.db.models.CharField", "django.db.models.IntegerField", "django.db.models.ManyToManyField", "django.db.models.ForeignKey" ]
[((248, 278), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(3)'}), '(max_length=3)\n', (264, 278), False, 'from django.db import models\n'), ((290, 321), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(64)'}), '(max_length=64)\n', (306, 321), False, 'from django.db impo...
from shapely.geometry.point import Point import datetime import numpy as np import os.path import netCDF4 as nc from ocgis.util.helpers import iter_array ## using points from |coords| adjust by |res| to provide bounds def make_bounds(coords,res): bnds = [] for g in coords.flat: bnds.append([g-res*0.5,...
[ "numpy.random.seed", "netCDF4.date2num", "ocgis.util.helpers.iter_array", "numpy.zeros", "datetime.datetime", "numpy.ma.array", "numpy.random.randint", "numpy.array", "numpy.arange", "datetime.timedelta", "shapely.geometry.point.Point" ]
[((343, 357), 'numpy.array', 'np.array', (['bnds'], {}), '(bnds)\n', (351, 357), True, 'import numpy as np\n'), ((597, 612), 'shapely.geometry.point.Point', 'Point', (['(-105)', '(40)'], {}), '(-105, 40)\n', (602, 612), False, 'from shapely.geometry.point import Point\n'), ((1791, 1812), 'datetime.timedelta', 'datetime...
# coding: utf-8 import pytest from jinja2 import nodes from jinja2schema.core import parse, infer from jinja2schema.visitors.stmt import visit_macro from jinja2schema.exceptions import MergeException, InvalidExpression from jinja2schema.model import Dictionary, Scalar, String, Number, Boolean from jinja2schema.macro i...
[ "jinja2schema.model.Boolean", "jinja2schema.model.Number", "jinja2schema.core.parse", "jinja2schema.core.infer", "jinja2schema.model.Dictionary", "pytest.raises", "jinja2schema.model.Scalar", "jinja2schema.visitors.stmt.visit_macro", "jinja2schema.model.String" ]
[((653, 679), 'jinja2schema.visitors.stmt.visit_macro', 'visit_macro', (['ast', 'macroses'], {}), '(ast, macroses)\n', (664, 679), False, 'from jinja2schema.visitors.stmt import visit_macro\n'), ((2287, 2302), 'jinja2schema.core.infer', 'infer', (['template'], {}), '(template)\n', (2292, 2302), False, 'from jinja2schem...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys #sys.path.append('/usr/local/lib/python2.7/dist-packages') from bluetooth import * import subprocess import time #sys.path.append('/home/pi/.local/lib/python2.7/site-packages') from wifi import Cell, Scheme import json import threading import uuid wpa...
[ "subprocess.Popen", "json.loads", "os.popen", "os.system", "time.sleep", "wifi.Cell.all", "uuid.getnode", "uuid.UUID" ]
[((416, 430), 'uuid.getnode', 'uuid.getnode', ([], {}), '()\n', (428, 430), False, 'import uuid\n'), ((515, 528), 'os.popen', 'os.popen', (['cmd'], {}), '(cmd)\n', (523, 528), False, 'import os\n'), ((831, 848), 'wifi.Cell.all', 'Cell.all', (['"""wlan0"""'], {}), "('wlan0')\n", (839, 848), False, 'from wifi import Cell...
import torch import torch.nn as nn from nets.MobileNetV2_unet import MobileNetV2_unet def _init_unet(state_dict): unet = MobileNetV2_unet(pre_trained=None) unet.load_state_dict(state_dict) return unet class ImgWrapNet(nn.Module): def __init__(self, state_dict, scale=255.): super().__init__(...
[ "torch.randn", "torch.load", "torch.cat", "nets.MobileNetV2_unet.MobileNetV2_unet" ]
[((128, 162), 'nets.MobileNetV2_unet.MobileNetV2_unet', 'MobileNetV2_unet', ([], {'pre_trained': 'None'}), '(pre_trained=None)\n', (144, 162), False, 'from nets.MobileNetV2_unet import MobileNetV2_unet\n'), ((510, 537), 'torch.cat', 'torch.cat', (['(x, x, x)'], {'dim': '(1)'}), '((x, x, x), dim=1)\n', (519, 537), False...
# -*- coding: utf-8 -*- from deprecation import deprecated from square.api_helper import APIHelper from square.http.api_response import ApiResponse from square.api.base_api import BaseApi from square.http.auth.o_auth_2 import OAuth2 class V1EmployeesApi(BaseApi): """A Controller to access Endpoints in the squar...
[ "square.api_helper.APIHelper.json_deserialize", "square.api_helper.APIHelper.append_url_with_query_parameters", "deprecation.deprecated", "square.api_helper.APIHelper.append_url_with_template_parameters", "square.api_helper.APIHelper.json_serialize", "square.http.auth.o_auth_2.OAuth2.apply", "square.htt...
[((17911, 17923), 'deprecation.deprecated', 'deprecated', ([], {}), '()\n', (17921, 17923), False, 'from deprecation import deprecated\n'), ((22491, 22503), 'deprecation.deprecated', 'deprecated', ([], {}), '()\n', (22501, 22503), False, 'from deprecation import deprecated\n'), ((24802, 24814), 'deprecation.deprecated'...
from movement import bezier3 import pyautogui import random from bot import randxy_move import time from password import get_pwd def main(): sand() def randxy_move(x_min,y_min,x_max,y_max): x = random.randint(x_min, x_max) y = random.randint(y_min, y_max) print("move to",x,y) return bezier3(x, ...
[ "pyautogui.position", "random.randint", "pyautogui.typewrite", "bot.randxy_move", "password.get_pwd", "time.sleep", "time.time", "random.random", "pyautogui.click", "movement.bezier3" ]
[((213, 241), 'random.randint', 'random.randint', (['x_min', 'x_max'], {}), '(x_min, x_max)\n', (227, 241), False, 'import random\n'), ((248, 276), 'random.randint', 'random.randint', (['y_min', 'y_max'], {}), '(y_min, y_max)\n', (262, 276), False, 'import random\n'), ((309, 322), 'movement.bezier3', 'bezier3', (['x', ...
''' Created on Apr 28, 2018 @author: <NAME> ''' from os import path, getcwd, listdir from PIL import Image # pip install pillow cwd = getcwd() cards_dir = cwd + r'\cards_png_large' cards_dir_smaller = cwd + r'\cards_png_smaller' first_file = listdir(cards_dir)[0] # get first...
[ "os.path.basename", "os.getcwd", "PIL.Image.open", "os.path.splitext", "os.path.join", "os.listdir" ]
[((161, 169), 'os.getcwd', 'getcwd', ([], {}), '()\n', (167, 169), False, 'from os import path, getcwd, listdir\n'), ((351, 383), 'os.path.join', 'path.join', (['cards_dir', 'first_file'], {}), '(cards_dir, first_file)\n', (360, 383), False, 'from os import path, getcwd, listdir\n'), ((390, 417), 'PIL.Image.open', 'Ima...
''' 3.1 将列表转换为字典 3.2 分页 --> 根据page和pagesize 进行分页并优雅输出 3.3 持久化数据 3.4 异常处理 3.5 优雅格式化输出 3.6 支持导出数据到csv --> 判断文件是否存在 --> 提示成功或失败 3.7 记录登陆日志 --> 登陆成功 --> log/login.log 登陆失败 --> log/loginFail.log 3.8 记录操作日志 --> add, update, delete, clear 进行记录 3.9 统计用户数量 3.10 清空用户 --> 临时清空 --> 可以reload加载 --> 永久清空 --> 直接修改文件永久清空 3.11 支持从cvs中导...
[ "os.mkdir", "logging.FileHandler", "os.path.exists", "os.system", "json.dumps", "logging.Formatter", "os.path.isfile", "prettytable.PrettyTable", "sys.exit", "configparser.ConfigParser", "datetime.datetime.now", "logging.getLogger" ]
[((3382, 3400), 'os.system', 'os.system', (['"""clear"""'], {}), "('clear')\n", (3391, 3400), False, 'import os\n'), ((10937, 10957), 'os.path.isfile', 'os.path.isfile', (['file'], {}), '(file)\n', (10951, 10957), False, 'import os\n'), ((14063, 14101), 'logging.getLogger', 'logging.getLogger', (['"""UserManagerSystem"...
import logging from monty.bot import bot from monty.constants import Client from monty.utils.extensions import walk_extensions log = logging.getLogger(__name__) for ext in walk_extensions(): bot.load_extension(ext) bot.run(Client.token)
[ "monty.utils.extensions.walk_extensions", "monty.bot.bot.load_extension", "monty.bot.bot.run", "logging.getLogger" ]
[((136, 163), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (153, 163), False, 'import logging\n'), ((177, 194), 'monty.utils.extensions.walk_extensions', 'walk_extensions', ([], {}), '()\n', (192, 194), False, 'from monty.utils.extensions import walk_extensions\n'), ((225, 246), 'monty....
from functools import wraps import pymysql.cursors from flask import flash, render_template, Blueprint, send_from_directory, request from flask_login import current_user, login_required import bigsql from .forms import PostForm, DeleteForm, CommentForm, LikeForm from .. import models from ..app import app, db from .....
[ "flask.flash", "flask.Blueprint", "flask.request.form.get", "functools.wraps", "flask.send_from_directory" ]
[((368, 411), 'flask.Blueprint', 'Blueprint', (['"""home"""', '__name__'], {'url_prefix': '"""/"""'}), "('home', __name__, url_prefix='/')\n", (377, 411), False, 'from flask import flash, render_template, Blueprint, send_from_directory, request\n'), ((498, 509), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # -------------------------------------------------------------------------- import fileinput import os import sys from setuptools import setup from...
[ "sys.stdout.write", "os.path.dirname", "torch.utils.cpp_extension.CUDAExtension", "fileinput.FileInput" ]
[((653, 678), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (668, 678), False, 'import os\n'), ((735, 778), 'fileinput.FileInput', 'fileinput.FileInput', (['filename'], {'inplace': '(True)'}), '(filename, inplace=True)\n', (754, 778), False, 'import fileinput\n'), ((1066, 1088), 'sys.stdout....
# ------------------------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # -------------------------------------------------------------------...
[ "InnerEye.ML.deep_learning_config.DatasetParams", "InnerEye.Azure.azure_runner.create_dataset_configs", "Tests.ML.util.get_default_azure_config", "InnerEye.Azure.azure_config.AzureConfig", "InnerEye.Common.common_util.is_linux", "pytest.raises", "pathlib.Path", "pathlib.PosixPath", "pytest.mark.para...
[((4671, 4791), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (["('first', 'extra', 'expected')", "[('', ['foo'], ['foo']), ('bar', ['foo'], ['bar', 'foo'])]"], {}), "(('first', 'extra', 'expected'), [('', ['foo'], [\n 'foo']), ('bar', ['foo'], ['bar', 'foo'])])\n", (4694, 4791), False, 'import pytest\n'), (...
# Copyright (c) 2017-present, Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
[ "unittest.main", "tensor_comprehensions.define", "torch.randn" ]
[((1528, 1543), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1541, 1543), False, 'import unittest\n'), ((1278, 1345), 'tensor_comprehensions.define', 'tc.define', (['LANG'], {'name': '"""convolution"""', 'constants': "{'sh': sH, 'sw': sW}"}), "(LANG, name='convolution', constants={'sh': sH, 'sw': sW})\n", (1287...
""" Integration tests that use the command-line entry points run_whatshap, run_haplotag etc. """ import os from collections import namedtuple from pytest import raises, fixture, mark import pysam from whatshap.cli.phase import run_whatshap from whatshap.cli import CommandLineError from whatshap.vcf import VcfReader, V...
[ "os.remove", "whatshap.vcf.VariantCallPhase", "whatshap.cli.phase.run_whatshap", "pysam.index", "pytest.fixture", "whatshap.vcf.VcfReader", "os.path.isfile", "pytest.raises", "whatshap.__main__.main", "pysam.view", "pytest.mark.parametrize" ]
[((1138, 1177), 'pytest.fixture', 'fixture', ([], {'params': "['whatshap', 'hapchat']"}), "(params=['whatshap', 'hapchat'])\n", (1145, 1177), False, 'from pytest import raises, fixture, mark\n'), ((3697, 3848), 'pytest.mark.parametrize', 'mark.parametrize', (['"""algorithm,expected_vcf"""', "[('whatshap', 'tests/data/p...
#!/usr/bin/env python # setup # Setup script for gtcal # # Author: <NAME> <<EMAIL>> # Created: Thu Mar 27 16:46:11 2014 -0400 # # Copyright (C) 2014 Georgetown University # For license information, see LICENSE.txt # # ID: setup.py [] <EMAIL> $ """ Setup script for gtcal """ ########################################...
[ "setuptools.setup", "setuptools.find_packages" ]
[((848, 918), 'setuptools.find_packages', 'find_packages', ([], {'where': '"""."""', 'exclude': "('tests', 'bin', 'docs', 'fixtures')"}), "(where='.', exclude=('tests', 'bin', 'docs', 'fixtures'))\n", (861, 918), False, 'from setuptools import find_packages\n'), ((1726, 1741), 'setuptools.setup', 'setup', ([], {}), '(*...
import unittest import os import platform import shutil from parameterized.parameterized import parameterized from conans.test.utils.tools import TestClient from conans.model.workspace import WORKSPACE_FILE from conans import tools import time from conans.util.files import load import re conanfile = """from conans ...
[ "time.sleep", "parameterized.parameterized.parameterized.expand", "re.search", "platform.system", "conans.test.utils.tools.TestClient", "os.path.join" ]
[((2353, 2394), 'parameterized.parameterized.parameterized.expand', 'parameterized.expand', (['[(True,), (False,)]'], {}), '([(True,), (False,)])\n', (2373, 2394), False, 'from parameterized.parameterized import parameterized\n'), ((2561, 2573), 'conans.test.utils.tools.TestClient', 'TestClient', ([], {}), '()\n', (257...
from BlackBoxAuditing.repairers.GeneralRepairer import Repairer from pandas import DataFrame from algorithms.Algorithm import Algorithm REPAIR_LEVEL_DEFAULT = 1.0 class FeldmanAlgorithm(Algorithm): def __init__(self, algorithm): Algorithm.__init__(self) self.model = algorithm self.name = '...
[ "pandas.DataFrame", "algorithms.Algorithm.Algorithm.__init__", "BlackBoxAuditing.repairers.GeneralRepairer.Repairer" ]
[((243, 267), 'algorithms.Algorithm.Algorithm.__init__', 'Algorithm.__init__', (['self'], {}), '(self)\n', (261, 267), False, 'from algorithms.Algorithm import Algorithm\n'), ((1881, 1933), 'BlackBoxAuditing.repairers.GeneralRepairer.Repairer', 'Repairer', (['data', 'index_to_repair', 'repair_level', '(False)'], {}), '...
import pygame pygame.init() def text(DISPLAYSURF,X,Y,size,color,text, anchor = "topleft", render = True): BASICFONT = pygame.font.Font('freesansbold.ttf', size) Text = BASICFONT.render(str(text), True, color) TextRect = Text.get_rect() exec("TextRect.%s = (X,Y)"%anchor) if render: DISPLAYSURF.bl...
[ "pygame.Rect", "pygame.init", "pygame.font.Font" ]
[((15, 28), 'pygame.init', 'pygame.init', ([], {}), '()\n', (26, 28), False, 'import pygame\n'), ((123, 165), 'pygame.font.Font', 'pygame.font.Font', (['"""freesansbold.ttf"""', 'size'], {}), "('freesansbold.ttf', size)\n", (139, 165), False, 'import pygame\n'), ((1166, 1221), 'pygame.Rect', 'pygame.Rect', (['pos[0]', ...
import requests from templates.text import TextTemplate from urlparse import urlparse def process(input, entities): output = {} try: url = entities['url'][0]['value'] if not urlparse(url).scheme: url = "https://" + url hostname = urlparse(url).hostname if hostname i...
[ "urlparse.urlparse", "templates.text.TextTemplate", "requests.get" ]
[((424, 480), 'requests.get', 'requests.get', (["('https://isitup.org/' + hostname + '.json')"], {}), "('https://isitup.org/' + hostname + '.json')\n", (436, 480), False, 'import requests\n'), ((276, 289), 'urlparse.urlparse', 'urlparse', (['url'], {}), '(url)\n', (284, 289), False, 'from urlparse import urlparse\n'), ...
import os import sys import subprocess import filecmp import glob from beschi.writer import Writer import beschi.writers CODE_OUTPUT_DIR = "out/generated" DATA_OUTPUT_DIR = "out/data" HARNESS_SRC_DIR = "test/_harnesses" HARNESS_BIN_DIR = "out/executables" ALL_WRITERS = beschi.writers.all_writers | beschi.writers.exp...
[ "os.unlink", "os.makedirs", "filecmp.clear_cache", "os.path.exists", "sys.stderr.write", "filecmp.cmp", "os.path.join", "subprocess.check_call" ]
[((564, 600), 'os.path.join', 'os.path.join', (['CODE_OUTPUT_DIR', 'label'], {}), '(CODE_OUTPUT_DIR, label)\n', (576, 600), False, 'import os\n'), ((621, 697), 'os.path.join', 'os.path.join', (['out_file_dir', 'f"""{output_name}{writer_class.default_extension}"""'], {}), "(out_file_dir, f'{output_name}{writer_class.def...
import numpy as np from scipy.cluster.hierarchy import fclusterdata def gen_cluster_index(x, window): return fclusterdata( x.reshape(-1, 1), window, criterion='distance', metric='euclidean', method='single' ) def cluster(x, window): x = np.sort(x) # used clus...
[ "numpy.sort", "numpy.array" ]
[((294, 304), 'numpy.sort', 'np.sort', (['x'], {}), '(x)\n', (301, 304), True, 'import numpy as np\n'), ((1555, 1566), 'numpy.array', 'np.array', (['x'], {}), '(x)\n', (1563, 1566), True, 'import numpy as np\n')]
import numpy as np class Vector: def __init__(self, x, y=None): if y is None: vec = x if isinstance(vec, Vector): self.x = vec.x self.y = vec.y else: self.x = vec[0] self.y = vec[1] else: ...
[ "numpy.dot", "numpy.array" ]
[((1013, 1039), 'numpy.array', 'np.array', (['[self.x, self.y]'], {}), '([self.x, self.y])\n', (1021, 1039), True, 'import numpy as np\n'), ((1052, 1082), 'numpy.array', 'np.array', (['[vector.x, vector.y]'], {}), '([vector.x, vector.y])\n', (1060, 1082), True, 'import numpy as np\n'), ((1102, 1114), 'numpy.dot', 'np.d...
from mock import Mock from startifact.regional_configuration_deleter import RegionalConfigurationDeleter def test(session: Mock) -> None: delete_parameter = Mock() ssm = Mock() ssm.delete_parameter = delete_parameter session.client = Mock(return_value=ssm) deleter = RegionalConfigurationDelete...
[ "mock.Mock" ]
[((164, 170), 'mock.Mock', 'Mock', ([], {}), '()\n', (168, 170), False, 'from mock import Mock\n'), ((182, 188), 'mock.Mock', 'Mock', ([], {}), '()\n', (186, 188), False, 'from mock import Mock\n'), ((255, 277), 'mock.Mock', 'Mock', ([], {'return_value': 'ssm'}), '(return_value=ssm)\n', (259, 277), False, 'from mock im...
import numpy as np import matplotlib.pyplot as plt import copy from matplotlib import rc #rc('font', **{'family':'serif','serif':['Palatino']}) #rc('text', usetex=True) tbox=[100] # プロットする最大編角 l=3.0; nx0=41; wn=3; ny=10 # 波長, 格子数/1波長, 波数, 横断方向格子数 b=0.3 # 河幅 xsize=20. # plotのサイズ ds=l/(nx0-1); dds=ds/...
[ "numpy.radians", "matplotlib.pyplot.show", "numpy.zeros", "numpy.sin", "numpy.arange", "numpy.cos", "matplotlib.pyplot.subplots" ]
[((416, 434), 'numpy.zeros', 'np.zeros', (['[nx + 1]'], {}), '([nx + 1])\n', (424, 434), True, 'import numpy as np\n'), ((439, 457), 'numpy.zeros', 'np.zeros', (['[nx + 1]'], {}), '([nx + 1])\n', (447, 457), True, 'import numpy as np\n'), ((464, 482), 'numpy.zeros', 'np.zeros', (['[nx + 1]'], {}), '([nx + 1])\n', (472,...
#!/usr/bin/python ######################################################################################################################## # # Copyright (c) 2014, Regents of the University of California # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permi...
[ "imp.find_module", "os.path.exists", "laygo.GridLayoutGenerator", "numpy.array", "bag.BagProject" ]
[((2111, 2127), 'numpy.array', 'np.array', (['[0, 0]'], {}), '([0, 0])\n', (2119, 2127), True, 'import numpy as np\n'), ((5242, 5258), 'numpy.array', 'np.array', (['[0, 0]'], {}), '([0, 0])\n', (5250, 5258), True, 'import numpy as np\n'), ((19834, 19892), 'laygo.GridLayoutGenerator', 'laygo.GridLayoutGenerator', ([], {...
# [REPOSITORY] : https://github.com/zievathustra/uu-rdms-harvest # [LICENSE] : This work is licensed under the Creative Commons Zero v1.0 Universal license. # To view a copy of this license, visit https://creativecommons.org/publicdomain/zero/1.0/. # [SOURCE#1] : Elsevier Python exam...
[ "os.makedirs", "json.loads", "os.walk", "os.path.exists", "traceback.format_exc", "requests.get", "bs4.BeautifulSoup", "configparser.ConfigParser", "datetime.datetime.now", "urllib3.disable_warnings", "urllib.parse.urlparse" ]
[((1450, 1477), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (1475, 1477), False, 'import configparser\n'), ((1641, 1667), 'urllib3.disable_warnings', 'urllib3.disable_warnings', ([], {}), '()\n', (1665, 1667), False, 'import urllib3\n'), ((3451, 3478), 'os.path.exists', 'os.path.exists',...
#!/usr/bin/env python import nltk import pandas as pd import numpy as np import os from gensim.models import Word2Vec from keras.utils import plot_model import matplotlib.pyplot as plt from keras.preprocessing.sequence import pad_sequences from keras.layers import Embedding from keras.layers import Dense from keras.la...
[ "keras.preprocessing.sequence.pad_sequences", "pandas.read_csv", "sklearn.model_selection.train_test_split", "sklearn.metrics.accuracy_score", "sklearn.metrics.f1_score", "matplotlib.pyplot.tight_layout", "sklearn.metrics.precision_recall_fscore_support", "gensim.models.Word2Vec.load", "nltk.word_to...
[((2085, 2096), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (2094, 2096), False, 'import os\n'), ((2178, 2226), 'pandas.read_csv', 'pd.read_csv', (['sentencePath'], {'index_col': '"""Sentence#"""'}), "(sentencePath, index_col='Sentence#')\n", (2189, 2226), True, 'import pandas as pd\n'), ((2563, 2594), 'gensim.models.W...
import datetime import pandas as pd import numpy as np #data import, from the HDF5-format: d = pd.read_hdf('dataproject/dataproject/Askers rod/data.h5', key='losses') d # for later reference we make lists of our options company_list = list(d.columns.levels[0]) attribute_list = list(d.columns.levels[1]) #### Plottin...
[ "bokeh.models.ColumnDataSource", "bokeh.plotting.figure", "pandas.read_hdf", "numpy.array", "bokeh.plotting.show" ]
[((96, 167), 'pandas.read_hdf', 'pd.read_hdf', (['"""dataproject/dataproject/Askers rod/data.h5"""'], {'key': '"""losses"""'}), "('dataproject/dataproject/Askers rod/data.h5', key='losses')\n", (107, 167), True, 'import pandas as pd\n'), ((589, 608), 'bokeh.models.ColumnDataSource', 'ColumnDataSource', (['d'], {}), '(d...
# -*- coding: utf-8 -*- from model.project import Project #import time import string import random def test_add_project(appl, db): project=Project(_name="testname99" + "".join([random.choice(string.digits) for i in range(7)])) #old_list = appl.project.get_project_list() #get projects l...
[ "random.choice" ]
[((183, 211), 'random.choice', 'random.choice', (['string.digits'], {}), '(string.digits)\n', (196, 211), False, 'import random\n')]
import random bingo = random.randint(1,10) s = ""; flag = False; for i in range(0,5,1) : i = int(input("숫자를 입력하세요 : ")); if bingo == i : s = "[빙고] 잘 하셨습니다."; flag = True; break; elif bingo > i : print("- 숫자가 너무 작습니다."); s = "- 5번의 기회를 모두 사용하셨습니다. 다시 시도하세요." ...
[ "random.randint" ]
[((23, 44), 'random.randint', 'random.randint', (['(1)', '(10)'], {}), '(1, 10)\n', (37, 44), False, 'import random\n')]
import re import time import icontract @icontract.ensure(lambda result: result > 0) def some_failing_function(x: int) -> int: # crosshair: on return x - 10 if __name__ == '__main__': pass
[ "icontract.ensure" ]
[((43, 86), 'icontract.ensure', 'icontract.ensure', (['(lambda result: result > 0)'], {}), '(lambda result: result > 0)\n', (59, 86), False, 'import icontract\n')]
# -*- coding: utf-8 -*- # Generated by Django 1.9.10 on 2016-11-03 04:44 from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ('radiusUser', '0001_initial'), ] op...
[ "django.db.models.TextField", "django.db.models.BigIntegerField", "django.db.models.CharField", "django.db.models.BooleanField", "django.db.models.AutoField", "django.db.models.IntegerField", "django.db.models.GenericIPAddressField", "django.db.models.DateTimeField" ]
[((437, 530), '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", (453, 530), False, 'from django.db import migrations, models\...
""" The objects in this module allow the usage of the MatchPy pattern matching library on SymPy expressions. """ import re from typing import List, Callable from sympy.core.sympify import _sympify from sympy.external import import_module from sympy.functions import (log, sin, cos, tan, cot, csc, sec, erf, gamma, upper...
[ "sympy.external.import_module", "matchpy.Operation.register", "sympy.utilities.decorator.doctest_depends_on", "matchpy.AssociativeOperation.register", "matchpy.expressions.functions.op_iter.register", "sympy.srepr", "matchpy.CommutativeOperation.register", "matchpy.expressions.functions.op_len.registe...
[((796, 820), 'sympy.external.import_module', 'import_module', (['"""matchpy"""'], {}), "('matchpy')\n", (809, 820), False, 'from sympy.external import import_module\n'), ((3376, 3416), 'sympy.utilities.decorator.doctest_depends_on', 'doctest_depends_on', ([], {'modules': "('matchpy',)"}), "(modules=('matchpy',))\n", (...
import scadnano as sc def create_design(): include_rot = False include_rot = True n = 'north' e = 'east' s = 'south' w = 'west' helices = [ sc.Helix(max_offset=20, group=n, grid_position=(0, 0)), # 0 sc.Helix(max_offset=21, group=n, grid_position=(1, 0)), # 1 sc.H...
[ "scadnano.Helix", "scadnano.Position3D", "scadnano.Design" ]
[((1908, 1961), 'scadnano.Design', 'sc.Design', ([], {'helices': 'helices', 'groups': 'groups', 'strands': '[]'}), '(helices=helices, groups=groups, strands=[])\n', (1917, 1961), True, 'import scadnano as sc\n'), ((178, 232), 'scadnano.Helix', 'sc.Helix', ([], {'max_offset': '(20)', 'group': 'n', 'grid_position': '(0, ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Command Line Interface module ----------------------------- # Type for help vedo -h # Some useful bash aliases: alias v='vedo ' alias vr='vedo --run ' # to search and run examples by name alias vs='vedo -i --search ' # to search for a ...
[ "vedo.plotter.Plotter", "vedo.utils.isSequence", "argparse.ArgumentParser", "Tkinter.Tk", "vedo.installdir.replace", "pathlib.Path", "vedo.colors.getColor", "vedo.utils.humansort", "os.path.isfile", "glob.glob", "platform.release", "vedo.applications.Slicer2DPlotter", "screeninfo.get_monitor...
[((2025, 2067), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'descr'}), '(description=descr)\n', (2048, 2067), False, 'import argparse\n'), ((6638, 6662), 'vedo.colors.printc', 'printc', (["('_' * 65)"], {'bold': '(0)'}), "('_' * 65, bold=0)\n", (6644, 6662), False, 'from vedo.colors impor...
from django.db import models class Reporter(models.Model): full_name = models.CharField(max_length=70) def __str__(self): return self.full_name class Article(models.Model): pub_date = models.DateField() headline = models.CharField(max_length=200) content = models.TextField() reporter ...
[ "django.db.models.CharField", "django.db.models.TextField", "django.db.models.ForeignKey", "django.db.models.DateField" ]
[((76, 107), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(70)'}), '(max_length=70)\n', (92, 107), False, 'from django.db import models\n'), ((207, 225), 'django.db.models.DateField', 'models.DateField', ([], {}), '()\n', (223, 225), False, 'from django.db import models\n'), ((241, 273), 'djan...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
[ "google.api_core.exceptions.AlreadyExists", "airflow.providers.google.cloud.operators.dataproc.DataprocSubmitSparkSqlJobOperator", "airflow.providers.google.cloud.operators.dataproc.DataprocSubmitPigJobOperator", "airflow.providers.google.cloud.operators.dataproc.DataprocSubmitHiveJobOperator", "airflow.pro...
[((4890, 4911), 'unittest.mock.MagicMock', 'mock.MagicMock', (['Retry'], {}), '(Retry)\n', (4904, 4911), False, 'from unittest import mock\n'), ((1609, 1653), 'inspect.signature', 'inspect.signature', (['ClusterGenerator.__init__'], {}), '(ClusterGenerator.__init__)\n', (1626, 1653), False, 'import inspect\n'), ((8146,...
from sympy.combinatorics.permutations import Permutation from sympy.combinatorics.named_groups import SymmetricGroup, AlternatingGroup, DihedralGroup from sympy.matrices import Matrix def test_pc_presentation(): Groups = [SymmetricGroup(3), SymmetricGroup(4), SymmetricGroup(9).sylow_subgroup(3), Symmetric...
[ "sympy.combinatorics.named_groups.DihedralGroup", "sympy.combinatorics.named_groups.AlternatingGroup", "sympy.combinatorics.named_groups.SymmetricGroup", "sympy.combinatorics.permutations.Permutation", "sympy.matrices.Matrix" ]
[((227, 244), 'sympy.combinatorics.named_groups.SymmetricGroup', 'SymmetricGroup', (['(3)'], {}), '(3)\n', (241, 244), False, 'from sympy.combinatorics.named_groups import SymmetricGroup, AlternatingGroup, DihedralGroup\n'), ((246, 263), 'sympy.combinatorics.named_groups.SymmetricGroup', 'SymmetricGroup', (['(4)'], {})...
import os from setuptools import setup, find_packages BASEDIR = os.path.abspath(os.path.dirname(__file__)) REPODIR = os.path.dirname(BASEDIR) README = open(os.path.join(REPODIR, 'README.md')).read() with open(os.path.join(REPODIR, 'requirements.txt')) as fobj: REQUIRES = list() DEPENDENCIES = list() for ...
[ "os.path.dirname", "os.path.join", "setuptools.find_packages" ]
[((119, 143), 'os.path.dirname', 'os.path.dirname', (['BASEDIR'], {}), '(BASEDIR)\n', (134, 143), False, 'import os\n'), ((82, 107), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (97, 107), False, 'import os\n'), ((212, 253), 'os.path.join', 'os.path.join', (['REPODIR', '"""requirements.txt"...
""" Default urlconf for reunition """ from django.conf import settings from django.conf.urls import include, patterns, url from django.conf.urls.static import static from django.contrib import admin from django.views.generic.base import TemplateView import reunition.views import reunition.apps.reunions.views sitem...
[ "django.contrib.admin.autodiscover", "django.views.generic.base.TemplateView.as_view", "django.conf.urls.include", "django.conf.urls.url", "django.conf.urls.static.static" ]
[((359, 379), 'django.contrib.admin.autodiscover', 'admin.autodiscover', ([], {}), '()\n', (377, 379), False, 'from django.contrib import admin\n'), ((542, 628), 'django.conf.urls.url', 'url', (['"""^accounts/login/$"""', 'reunition.views.login_signup_view'], {'name': '"""account_login"""'}), "('^accounts/login/$', reu...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2009-2011 <NAME> (<EMAIL>) # # 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 # #...
[ "time.sleep", "openravepy.misc.OpenRAVEGlobalArguments.addOptions", "optparse.OptionParser", "openravepy.misc.OpenRAVEGlobalArguments.parseAndCreateThreadedUser" ]
[((2508, 2606), 'optparse.OptionParser', 'OptionParser', ([], {'description': '"""Shows how to use different IK solutions for arms with few joints."""'}), "(description=\n 'Shows how to use different IK solutions for arms with few joints.')\n", (2520, 2606), False, 'from optparse import OptionParser\n'), ((2606, 264...
# ============================================================================ # FILE: _main.py # AUTHOR: <NAME> <Shougo.Matsu at g<EMAIL>> # License: MIT license # ============================================================================ import sys import io from importlib.util import find_spec if find_spec('pynv...
[ "sys.path.append", "deoplete.child.Child", "importlib.util.find_spec", "deoplete.util.error_tb", "neovim.attach" ]
[((305, 324), 'importlib.util.find_spec', 'find_spec', (['"""pynvim"""'], {}), "('pynvim')\n", (314, 324), False, 'from importlib.util import find_spec\n'), ((550, 594), 'neovim.attach', 'attach', (['"""tcp"""'], {'address': 'serveraddr', 'port': 'port'}), "('tcp', address=serveraddr, port=port)\n", (556, 594), False, ...
import torch from torch.distributions.relaxed_categorical import RelaxedOneHotCategorical class UtilsHelper: def calculate_gumbel_softmax(self, probs, tau, hard): """ Computes sampling from the Gumbel Softmax (GS) distribution Args: probs (torch.tensor): probabilities of shape [batch_s...
[ "torch.argmax", "torch.distributions.relaxed_categorical.RelaxedOneHotCategorical", "torch.zeros_like" ]
[((466, 502), 'torch.distributions.relaxed_categorical.RelaxedOneHotCategorical', 'RelaxedOneHotCategorical', (['tau', 'probs'], {}), '(tau, probs)\n', (490, 502), False, 'from torch.distributions.relaxed_categorical import RelaxedOneHotCategorical\n'), ((569, 588), 'torch.zeros_like', 'torch.zeros_like', (['y'], {}), ...
from nltk.corpus import cmudict def list_of_words(tokens): if len(tokens) > 1: return '{} and {}'.format(', '.join(tokens[:-1]), tokens[-1]) return tokens[0] def capitalise_first_letter(token): return token[0].upper() + token[1:] def add_indefinite_article(dictionary, phrase): tokens = tok...
[ "nltk.corpus.cmudict.dict" ]
[((712, 726), 'nltk.corpus.cmudict.dict', 'cmudict.dict', ([], {}), '()\n', (724, 726), False, 'from nltk.corpus import cmudict\n')]
"""Module containing code related to *sandman2* ORM models.""" # Standard library imports import datetime from decimal import Decimal # Third-party imports from sqlalchemy.inspection import inspect from flask_sqlalchemy import SQLAlchemy # pylint: disable=import-error,no-name-in-module from sqlalchemy.ext.automap im...
[ "sqlalchemy.ext.declarative.declarative_base", "sqlalchemy.ext.automap.automap_base", "flask_sqlalchemy.SQLAlchemy", "sqlalchemy.inspection.inspect" ]
[((400, 412), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {}), '()\n', (410, 412), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((4427, 4466), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', ([], {'cls': '(db.Model, Model)'}), '(cls=(db.Model, Model))\n', (4443, 4466), False, 'from sqla...
import pathogenseq as ps import argparse import csv def main(args): bcf = ps.bcf(args.bcf) bcf.get_mean_genotype() bcf.get_genesum() geno_file = bcf.prefix+".geno" genesum_file = bcf.prefix+".genesum" meta = {} for s in bcf.samples: meta[s] = {} for row in csv.DictReader(open(args.csv)): for pheno in row.k...
[ "argparse.ArgumentParser", "pathogenseq.run_cmd", "pathogenseq.get_random_file", "pathogenseq.bcf", "pathogenseq.log" ]
[((1285, 1404), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""TBProfiler pipeline"""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(description='TBProfiler pipeline', formatter_class=\n argparse.ArgumentDefaultsHelpFormatter)\n", (1308, 1404), False, 'import argpa...
# encoding: utf-8 """ Utilities for working with strings and text. """ #----------------------------------------------------------------------------- # Copyright (C) 2008-2009 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as...
[ "os.remove", "os.rename", "shutil.copy2", "os.path.exists", "re.search", "IPython.external.path.path", "re.compile" ]
[((13440, 13461), 're.compile', 're.compile', (['"""^(\\\\s+)"""'], {}), "('^(\\\\s+)')\n", (13450, 13461), False, 'import re\n'), ((11919, 11955), 'shutil.copy2', 'shutil.copy2', (['filename', 'bak_filename'], {}), '(filename, bak_filename)\n', (11931, 11955), False, 'import shutil\n'), ((13832, 13865), 're.compile', ...
from flask_caching import Cache from flask_debugtoolbar import DebugToolbarExtension from flask_migrate import Migrate from flask_session import Session from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() migrate = Migrate() cache = Cache(config={ "CACHE_TYPE": "redis", "CACHE_REDIS_DB": 1 }) toolbar = ...
[ "flask_caching.Cache", "flask_session.Session", "flask_sqlalchemy.SQLAlchemy", "flask_migrate.Migrate", "flask_debugtoolbar.DebugToolbarExtension" ]
[((200, 212), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {}), '()\n', (210, 212), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((223, 232), 'flask_migrate.Migrate', 'Migrate', ([], {}), '()\n', (230, 232), False, 'from flask_migrate import Migrate\n'), ((241, 299), 'flask_caching.Cache', 'Cache', ([], {'...
from argparse import Namespace from tqdm import tqdm import torch.cuda import torch.nn as nn import torch.optim as optim from sklearn.metrics import accuracy_score from torch.utils.data import DataLoader from dataset.review_dataset import ReviewDataset from model.review_classifier import ReviewClassifier # DataLoad...
[ "argparse.Namespace", "dataset.review_dataset.ReviewDataset.load_dataset_and_make_vectorize", "tqdm.tqdm", "torch.nn.BCEWithLogitsLoss", "torch.utils.data.DataLoader", "sklearn.metrics.accuracy_score" ]
[((926, 1190), 'argparse.Namespace', 'Namespace', ([], {'frequency_cutoff': '(25)', 'model_state_file': '"""model.pth"""', 'review_csv': '"""data/raw_split.csv"""', 'save_dir': '"""model_storage/ch3/yelp"""', 'vectorize_file': '"""vectorizer.json"""', 'batch_size': '(128)', 'early_stopping_criteria': '(5)', 'learning_r...
""" OpenEnergyMonitor Thermostat Support. This provides a climate component for the ESP8266 based thermostat sold by OpenEnergyMonitor. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/climate.oem/ """ import logging import requests import voluptuous as ...
[ "voluptuous.Optional", "voluptuous.Required", "voluptuous.Inclusive", "oemthermostat.Thermostat", "logging.getLogger", "voluptuous.Coerce" ]
[((817, 844), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (834, 844), False, 'import logging\n'), ((923, 946), 'voluptuous.Required', 'vol.Required', (['CONF_HOST'], {}), '(CONF_HOST)\n', (935, 946), True, 'import voluptuous as vol\n'), ((963, 1008), 'voluptuous.Optional', 'vol.Optiona...
from multiprocessing import Pool from functools import partial import pandas as pd import numpy as np from datetime import datetime from datetime import timedelta import logging import numpy as np logger = logging.getLogger(__name__) class AccountBalances: """ AccountBalances manages btc/usd balances used in run_b...
[ "pandas.DataFrame", "functools.partial", "datetime.datetime.strptime", "numpy.where", "multiprocessing.Pool", "pandas.DateOffset", "logging.getLogger" ]
[((206, 233), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (223, 233), False, 'import logging\n'), ((4277, 4296), 'pandas.DataFrame', 'pd.DataFrame', (['fills'], {}), '(fills)\n', (4289, 4296), True, 'import pandas as pd\n'), ((5180, 5221), 'datetime.datetime.strptime', 'datetime.strpti...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import torch import numpy as np class AverageMeter(object): """Computes and stores the average and current value""" def __init__(self): self.reset() def reset(self): s...
[ "numpy.load", "pickle.dump", "numpy.sum", "numpy.maximum", "numpy.argsort", "pathlib.Path", "pickle.load", "numpy.arange", "numpy.savetxt", "numpy.cumsum", "numpy.loadtxt", "torch.zeros", "numpy.stack", "json.dump", "numpy.save", "torch.clamp", "os.listdir", "numpy.concatenate", ...
[((1957, 1974), 'numpy.argsort', 'np.argsort', (['(-conf)'], {}), '(-conf)\n', (1967, 1974), True, 'import numpy as np\n'), ((3647, 3685), 'numpy.concatenate', 'np.concatenate', (['([0.0], recall, [1.0])'], {}), '(([0.0], recall, [1.0]))\n', (3661, 3685), True, 'import numpy as np\n'), ((3696, 3737), 'numpy.concatenate...
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-03-03 10:40 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('fpraktikum', '0020_auto_20180224_1019'), ] operations = [ migrations.AddField...
[ "django.db.models.TextField" ]
[((404, 482), 'django.db.models.TextField', 'models.TextField', ([], {'blank': '(True)', 'max_length': '(1000)', 'null': '(True)', 'verbose_name': '"""Notes"""'}), "(blank=True, max_length=1000, null=True, verbose_name='Notes')\n", (420, 482), False, 'from django.db import migrations, models\n')]
from simple_rest_client.api import API from . import resources def get_api_instance(api_root_url='https://swapi.co/api/', timeout=5): api = API(api_root_url=api_root_url, timeout=timeout) api.add_resource(resource_name='films', resource_class=resources.FilmsResource) api.add_resource(resource_name='peopl...
[ "simple_rest_client.api.API" ]
[((147, 194), 'simple_rest_client.api.API', 'API', ([], {'api_root_url': 'api_root_url', 'timeout': 'timeout'}), '(api_root_url=api_root_url, timeout=timeout)\n', (150, 194), False, 'from simple_rest_client.api import API\n'), ((827, 874), 'simple_rest_client.api.API', 'API', ([], {'api_root_url': 'api_root_url', 'time...
# -*- coding: utf-8 -*- import os import telebot import time import random import threading from emoji import emojize from telebot import types from pymongo import MongoClient import traceback import config token = os.environ['dickfind'] bot = telebot.TeleBot(token) mongo_client = MongoClient(os.environ['database']...
[ "pymongo.MongoClient", "threading.Timer", "random.randint", "telebot.types.InlineKeyboardButton", "random.choice", "time.sleep", "time.time", "traceback.format_exc", "telebot.types.InlineKeyboardMarkup", "telebot.TeleBot" ]
[((247, 269), 'telebot.TeleBot', 'telebot.TeleBot', (['token'], {}), '(token)\n', (262, 269), False, 'import telebot\n'), ((286, 321), 'pymongo.MongoClient', 'MongoClient', (["os.environ['database']"], {}), "(os.environ['database'])\n", (297, 321), False, 'from pymongo import MongoClient\n'), ((8429, 8457), 'telebot.ty...
#!/usr/bin/env python # -*- coding: utf-8 -*- #****************************************************************************** # $Id$ # # Project: GDAL # Purpose: Outputs GDAL GCPs as OGR points # Author: <NAME>, <even dot rouault at spatialys dot com> # #*********************************************************...
[ "osgeo.ogr.CreateGeometryFromWkt", "osgeo.ogr.GetDriverByName", "osgeo.ogr.FieldDefn", "sys.exit", "osgeo.gdal.Open", "osgeo.osr.SpatialReference" ]
[((2183, 2204), 'osgeo.gdal.Open', 'gdal.Open', (['in_dataset'], {}), '(in_dataset)\n', (2192, 2204), False, 'from osgeo import gdal\n'), ((1745, 1756), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (1753, 1756), False, 'import sys\n'), ((2343, 2368), 'osgeo.osr.SpatialReference', 'osr.SpatialReference', (['wkt'], {}...
""" Copyright 2020 The OneFlow Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agr...
[ "math.cos" ]
[((3330, 3377), 'math.cos', 'math.cos', (['(math.pi * self.last_step / self.T_max)'], {}), '(math.pi * self.last_step / self.T_max)\n', (3338, 3377), False, 'import math\n'), ((3398, 3451), 'math.cos', 'math.cos', (['(math.pi * (self.last_step - 1) / self.T_max)'], {}), '(math.pi * (self.last_step - 1) / self.T_max)\n'...
#!/usr/bin/env python3 import smbus import sys GEIGER_ADDR = 0x12 if len(sys.argv) == 1: print("Usage:\n%s {0/1}" % sys.argv[0]) sys.exit(1) brightness = int(sys.argv[1]) print("Brightness: %d" % brightness) bus = smbus.SMBus(4) bus.write_i2c_block_data(GEIGER_ADDR, 7, [brightness])
[ "sys.exit", "smbus.SMBus" ]
[((228, 242), 'smbus.SMBus', 'smbus.SMBus', (['(4)'], {}), '(4)\n', (239, 242), False, 'import smbus\n'), ((140, 151), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (148, 151), False, 'import sys\n')]
#!/usr/bin/env python3 # # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 import argparse import asyncio import json import logging import math import os import pathlib import re import subprocess import sys DESCRIPTION = "Configure and run all CBMC proofs in par...
[ "subprocess.run", "argparse.ArgumentParser", "logging.basicConfig", "json.loads", "logging.warning", "os.getcwd", "asyncio.create_subprocess_exec", "os.walk", "re.match", "os.cpu_count", "pathlib.Path", "logging.critical", "asyncio.Queue", "sys.exit" ]
[((2338, 2406), 'subprocess.run', 'subprocess.run', (['cmd'], {'universal_newlines': '(True)', 'stdout': 'subprocess.PIPE'}), '(cmd, universal_newlines=True, stdout=subprocess.PIPE)\n', (2352, 2406), False, 'import subprocess\n'), ((2860, 2981), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description':...
#!/usr/bin/python3 def starts_with_one_of(s, stringlist): # TODO: change to regexp so I can more easily express whole name ,startswith, word-boundary, and such for test in stringlist: if s.startswith(test): return True return False def categorize_cmd(cmd:str, merge_databases=False, mer...
[ "subprocess.Popen" ]
[((4603, 4702), 'subprocess.Popen', 'subprocess.Popen', (['"""ps --no-header -eo comm"""'], {'shell': '(True)', 'stdout': 'subprocess.PIPE', 'encoding': '"""u8"""'}), "('ps --no-header -eo comm', shell=True, stdout=subprocess.\n PIPE, encoding='u8')\n", (4619, 4702), False, 'import subprocess\n')]
import torch import torch.nn as nn import scipy.linalg import numpy as np from matplotlib.legend_handler import HandlerPathCollection from sklearn.utils import shuffle from models import PointCMLP EPSILON = 1e-8 def identity(x): # needed in this format to save the model properly return x def build_mlg...
[ "numpy.sum", "numpy.random.seed", "torch.argmax", "torch.cat", "numpy.mean", "numpy.linalg.norm", "numpy.sin", "sklearn.utils.shuffle", "numpy.random.randn", "numpy.transpose", "numpy.reshape", "numpy.linspace", "numpy.size", "numpy.ones_like", "numpy.cos", "numpy.squeeze", "numpy.co...
[((505, 592), 'models.PointCMLP', 'PointCMLP', (['input_shape', 'output_dim', 'hidden_layer_sizes', 'activation', 'bias'], {'version': '(1)'}), '(input_shape, output_dim, hidden_layer_sizes, activation, bias,\n version=1)\n', (514, 592), False, 'from models import PointCMLP\n'), ((811, 898), 'models.PointCMLP', 'Poi...
import sys import json import numpy as np def get_top1_from_ranker(path): with open(path, "r", encoding="utf-8") as f: scores = [float(line.strip()) for line in f.readlines()] top_id = np.argmax(scores) return top_id def get_ocr_result_by_id(path, top_id): with open(path, "r", encoding=...
[ "json.dump", "json.loads", "numpy.argmax" ]
[((404, 419), 'json.loads', 'json.loads', (['res'], {}), '(res)\n', (414, 419), False, 'import json\n'), ((207, 224), 'numpy.argmax', 'np.argmax', (['scores'], {}), '(scores)\n', (216, 224), True, 'import numpy as np\n'), ((509, 546), 'json.dump', 'json.dump', (['doc', 'f'], {'ensure_ascii': '(False)'}), '(doc, f, ensu...
"""Contains the Credit (coin play) mode code.""" from math import floor from mpf.core.mode import Mode class Credits(Mode): """Mode which manages the credits and prevents the game from starting without credits.""" __slots__ = ["data_manager", "earnings", "credit_units_per_game", "credit_unit", "pricing_ti...
[ "math.floor" ]
[((18794, 18850), 'math.floor', 'floor', (['(machine_credit_units / self.credit_units_per_game)'], {}), '(machine_credit_units / self.credit_units_per_game)\n', (18799, 18850), False, 'from math import floor\n')]
"""Query network instances of a device.""" from typing import Dict, List, Callable, Any import pytest from nornir.core.task import MultiResult, Result from nornir_napalm.plugins.tasks import napalm_get from nuts.helpers.result import AbstractHostResultExtractor, NutsResult from nuts.context import NornirNutsContext ...
[ "pytest.mark.nuts" ]
[((1441, 1488), 'pytest.mark.nuts', 'pytest.mark.nuts', (['"""network_instance,interfaces"""'], {}), "('network_instance,interfaces')\n", (1457, 1488), False, 'import pytest\n'), ((1729, 1785), 'pytest.mark.nuts', 'pytest.mark.nuts', (['"""network_instance,route_distinguisher"""'], {}), "('network_instance,route_distin...
from django.shortcuts import get_object_or_404 from rest_framework import generics, permissions as drf_permissions from rest_framework.exceptions import NotFound, ValidationError, PermissionDenied from api.base.exceptions import Gone from api.base import permissions as base_permissions from api.base.views import JSONA...
[ "framework.auth.core.Auth", "api.comments.serializers.CommentReport", "rest_framework.exceptions.PermissionDenied", "django.shortcuts.get_object_or_404", "api.base.exceptions.Gone", "rest_framework.exceptions.ValidationError" ]
[((1310, 1378), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['Comment'], {'guids___id': 'pk', 'root_target__isnull': '(False)'}), '(Comment, guids___id=pk, root_target__isnull=False)\n', (1327, 1378), False, 'from django.shortcuts import get_object_or_404\n'), ((6628, 6651), 'framework.auth.core.Auth', ...
import threading import matplotlib.pyplot as plt import matplotlib.animation as animation import infinc import time import math import socket import fcntl import os import errno import random import string import ssl from dotenv import load_dotenv load_dotenv() class SmartNetworkThermometer (threading.Thread): op...
[ "ssl.SSLContext", "socket.socket", "matplotlib.animation.FuncAnimation", "infinc.Human", "threading.Thread.__init__", "infinc.Simulator", "matplotlib.pyplot.subplots", "time.localtime", "matplotlib.pyplot.show", "matplotlib.pyplot.ylim", "matplotlib.pyplot.legend", "infinc.SmartHeater", "tim...
[((249, 262), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (260, 262), False, 'from dotenv import load_dotenv\n'), ((6855, 6910), 'infinc.Human', 'infinc.Human', ([], {'mass': '(8)', 'length': '(1.68)', 'temperature': '(36 + 273)'}), '(mass=8, length=1.68, temperature=36 + 273)\n', (6867, 6910), False, 'impor...
#!/usr/bin/env python from __future__ import print_function from builtins import str from builtins import object from dome9ApiV2Py import Dome9ApiClient import time import datetime from datetime import datetime as timeFunc import uuid import argparse import json import sys import calendar import pytz class FetchEntit...
[ "uuid.uuid4", "argparse.ArgumentParser", "dome9ApiV2Py.Dome9ApiClient", "time.sleep", "datetime.datetime.utcnow", "sys", "sys.exit" ]
[((7808, 7847), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '""""""'}), "(description='')\n", (7831, 7847), False, 'import argparse\n'), ((1842, 1916), 'dome9ApiV2Py.Dome9ApiClient', 'Dome9ApiClient', ([], {'apiKeyID': 'inputArgs.apiKeyID', 'apiSecret': 'inputArgs.secretKey'}), '(apiKeyID...
from django.shortcuts import render from django.contrib import messages from .forms import CassavaForm from .models import CassavaModel import pickle from keras import backend as K import joblib import numpy as np from sklearn import preprocessing from keras.preprocessing import image import pandas as pd from collec...
[ "numpy.argmax", "numpy.expand_dims", "keras.preprocessing.image.img_to_array", "keras.preprocessing.image.load_img", "django.shortcuts.render", "joblib.load", "keras.backend.clear_session" ]
[((1840, 1874), 'django.shortcuts.render', 'render', (['request', 'template', 'context'], {}), '(request, template, context)\n', (1846, 1874), False, 'from django.shortcuts import render\n'), ((459, 567), 'joblib.load', 'joblib.load', (['"""/Users/pro/Documents/python/MyDjangoProjects/Portfolio/cassavaapp/cassava_model...
from django.contrib import admin from egov_cms.models import * admin.site.register(PrisonStaffRoles) admin.site.register(Cell) admin.site.register(Prison) admin.site.register(PrisonStaff) admin.site.register(Officer) admin.site.register(RelationshipType) admin.site.register(NextOfKin) admin.site.register(Solicitor) ad...
[ "django.contrib.admin.site.register" ]
[((64, 101), 'django.contrib.admin.site.register', 'admin.site.register', (['PrisonStaffRoles'], {}), '(PrisonStaffRoles)\n', (83, 101), False, 'from django.contrib import admin\n'), ((102, 127), 'django.contrib.admin.site.register', 'admin.site.register', (['Cell'], {}), '(Cell)\n', (121, 127), False, 'from django.con...
import json from pkg_resources import resource_string from pedsnetcdms.sa_makers import make_models, Base DECLARATIVE_MODELS = json.loads(resource_string('pedsnetcdms.pedsnetcdm', 'models.json')) for model in make_models(DECLARATIVE_MODELS, (Base,)): globals()[model...
[ "pkg_resources.resource_string", "pedsnetcdms.sa_makers.make_models" ]
[((259, 299), 'pedsnetcdms.sa_makers.make_models', 'make_models', (['DECLARATIVE_MODELS', '(Base,)'], {}), '(DECLARATIVE_MODELS, (Base,))\n', (270, 299), False, 'from pedsnetcdms.sa_makers import make_models, Base\n'), ((139, 195), 'pkg_resources.resource_string', 'resource_string', (['"""pedsnetcdms.pedsnetcdm"""', '"...
from os import path as osp import pickle import tempfile import pytest from garage.experiment import Snapshotter configurations = [('all', { 'itr_1.pkl': 0, 'itr_2.pkl': 1 }), ('last', { 'params.pkl': 1 }), ('gap', { 'itr_2.pkl': 1 }), ('gap_and_last', { 'itr_2.pkl': 1, 'para...
[ "tempfile.TemporaryDirectory", "garage.experiment.Snapshotter", "os.path.exists", "pytest.raises", "pickle.load", "pytest.mark.parametrize", "os.path.join" ]
[((537, 594), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""mode, files"""', '[*configurations]'], {}), "('mode, files', [*configurations])\n", (560, 594), False, 'import pytest\n'), ((432, 461), 'tempfile.TemporaryDirectory', 'tempfile.TemporaryDirectory', ([], {}), '()\n', (459, 461), False, 'import tem...