code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from pid.abstract_pid import AbstractPID
from scipy import signal
class ExampleOnePID(AbstractPID):
def __init__(self):
super(ExampleOnePID, self).__init__(number_of_inputs=3, lim_min=0, lim_max=5)
def get_plant_transfer_function(self) -> signal.lti:
return signal.lti([4], [1, 0.5, 1])
d... | [
"scipy.signal.lti"
] | [((285, 313), 'scipy.signal.lti', 'signal.lti', (['[4]', '[1, 0.5, 1]'], {}), '([4], [1, 0.5, 1])\n', (295, 313), False, 'from scipy import signal\n')] |
# 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 agreed to ... | [
"rest_framework.serializers.CharField"
] | [((1862, 1903), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {'source': '"""link_self"""'}), "(source='link_self')\n", (1883, 1903), False, 'from rest_framework import serializers\n')] |
import pytest
from database.engine import postgresEngine
@pytest.mark.xfail(reason="“Using TDD,is not implemented")
def test_connection(params):
"""Check the connection to local database """
with postgresEngine(**params) as db:
engine, connect = db
sql_query = """
SELECT ... | [
"pytest.mark.xfail",
"database.engine.postgresEngine"
] | [((61, 118), 'pytest.mark.xfail', 'pytest.mark.xfail', ([], {'reason': '"""“Using TDD,is not implemented"""'}), "(reason='“Using TDD,is not implemented')\n", (78, 118), False, 'import pytest\n'), ((207, 231), 'database.engine.postgresEngine', 'postgresEngine', ([], {}), '(**params)\n', (221, 231), False, 'from database... |
import pandas as pd
import matplotlib.pyplot as plt
#import numpy as np
#from scipy.interpolate import interp1d
from matplotlib.pyplot import figure
font = {'family' : 'Times New Roman',
'size' : 28}
plt.rc('font', **font)
figure(num=None, figsize=(17, 5))
data = pd.read_csv('C:\\Users\\<NAME>\\D... | [
"matplotlib.pyplot.grid",
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.rc",
"matplotlib.pyplot.show"
] | [((221, 243), 'matplotlib.pyplot.rc', 'plt.rc', (['"""font"""'], {}), "('font', **font)\n", (227, 243), True, 'import matplotlib.pyplot as plt\n'), ((245, 278), 'matplotlib.pyplot.figure', 'figure', ([], {'num': 'None', 'figsize': '(17, 5)'}), '(num=None, figsize=(17, 5))\n', (251, 278), False, 'from matplotlib.pyplot ... |
def assign_latest_cp(args):
"""
From the given arguments checks the 'out_path' parameters.
Looks for a checkpoint assuming the checkpoint was saved in out_path
and the previous run was with the same training parameters.
Example:
If you run the program with these arguments;
"data... | [
"os.path.exists",
"os.listdir",
"argparse.Namespace",
"os.path.basename"
] | [((1543, 1569), 'os.path.exists', 'os.path.exists', (['ckpts_path'], {}), '(ckpts_path)\n', (1557, 1569), False, 'import os, argparse\n'), ((1915, 1941), 'argparse.Namespace', 'argparse.Namespace', ([], {}), '(**args)\n', (1933, 1941), False, 'import os, argparse\n'), ((1616, 1638), 'os.listdir', 'os.listdir', (['ckpts... |
from eggbort import Eggbort
def run_bot():
bot = Eggbort()
bot.run()
def main():
'''Launches Eggbort'''
run_bot()
if __name__ == '__main__':
main()
| [
"eggbort.Eggbort"
] | [((52, 61), 'eggbort.Eggbort', 'Eggbort', ([], {}), '()\n', (59, 61), False, 'from eggbort import Eggbort\n')] |
from apmserver import ElasticTest
from beat.beat import INTEGRATION_TESTS
import os
import json
import requests
import unittest
class Test(ElasticTest):
@unittest.skipUnless(INTEGRATION_TESTS, "integration test")
def test_load_docs_with_template_and_add_transaction(self):
"""
This test starts... | [
"requests.post",
"os.path.join",
"unittest.skipUnless"
] | [((161, 219), 'unittest.skipUnless', 'unittest.skipUnless', (['INTEGRATION_TESTS', '"""integration test"""'], {}), "(INTEGRATION_TESTS, 'integration test')\n", (180, 219), False, 'import unittest\n'), ((889, 947), 'unittest.skipUnless', 'unittest.skipUnless', (['INTEGRATION_TESTS', '"""integration test"""'], {}), "(INT... |
# -*- coding: UTF-8 -*-
import random
from flows.components import COMPLETE
class Linear(object):
"""
The `Linear` transition assumes that once an `Action` has completed,
the flow should transition to the next `Action` in the relevant
`Scaffold`'s `action_set`. If there are no more actions left, then
... | [
"random.choice"
] | [((2015, 2049), 'random.choice', 'random.choice', (['scaffold.action_set'], {}), '(scaffold.action_set)\n', (2028, 2049), False, 'import random\n')] |
import pytest
from polyswarmartifact import ArtifactType
from polyswarmartifact.exceptions import DecodeError
def test_file_artifact_type_from_lowercase_string():
# arrange
# act
artifact_type = ArtifactType.from_string('file')
# assert
assert artifact_type == ArtifactType.FILE
def test_file_art... | [
"polyswarmartifact.ArtifactType.FILE.decode_content",
"polyswarmartifact.ArtifactType.from_string",
"polyswarmartifact.ArtifactType.URL.decode_content",
"polyswarmartifact.ArtifactType.to_string",
"polyswarmartifact.ArtifactType",
"pytest.raises"
] | [((209, 241), 'polyswarmartifact.ArtifactType.from_string', 'ArtifactType.from_string', (['"""file"""'], {}), "('file')\n", (233, 241), False, 'from polyswarmartifact import ArtifactType\n'), ((400, 432), 'polyswarmartifact.ArtifactType.from_string', 'ArtifactType.from_string', (['"""FILE"""'], {}), "('FILE')\n", (424,... |
import base64
import binascii
import decimal
import json
import os
import platform
import sys
import urllib.parse as urlparse
from http.client import HTTP_PORT, HTTPConnection
DEFAULT_USER_AGENT = "AuthServiceProxy/0.1"
DEFAULT_HTTP_TIMEOUT = 30
# (un)hexlify to/from unicode, needed for Python3
unhexlify = binascii.... | [
"urllib.parse.urlparse",
"binascii.hexlify",
"json.dumps",
"os.path.join",
"http.client.HTTPConnection",
"base64.b64encode",
"os.path.dirname",
"platform.system",
"os.path.expanduser"
] | [((4106, 4136), 'urllib.parse.urlparse', 'urlparse.urlparse', (['service_url'], {}), '(service_url)\n', (4123, 4136), True, 'import urllib.parse as urlparse\n'), ((4630, 4693), 'http.client.HTTPConnection', 'HTTPConnection', (['self.__url.hostname'], {'port': 'port', 'timeout': 'timeout'}), '(self.__url.hostname, port=... |
"""Animation of a model increasing in voxel resolution."""
import fourier_feature_nets as ffn
import numpy as np
import scenepic as sp
def voxels_animation(voxels: ffn.OcTree, min_depth=4, num_frames=300,
up_dir=(0, 1, 0), forward_dir=(0, 0, -1),
fov_y_degrees=40, resolution... | [
"fourier_feature_nets.Resolution",
"numpy.unique",
"scenepic.Scene",
"numpy.array",
"numpy.linspace",
"fourier_feature_nets.orbit",
"fourier_feature_nets.ETABar",
"fourier_feature_nets.OcTree.load",
"scenepic.Shading"
] | [((1743, 1771), 'numpy.array', 'np.array', (['up_dir', 'np.float32'], {}), '(up_dir, np.float32)\n', (1751, 1771), True, 'import numpy as np\n'), ((1790, 1823), 'numpy.array', 'np.array', (['forward_dir', 'np.float32'], {}), '(forward_dir, np.float32)\n', (1798, 1823), True, 'import numpy as np\n'), ((1841, 1868), 'fou... |
'''
The MIT License (MIT)
Copyright (c) 2015 <NAME> - https://github.com/janglapuk/SPB-OpenCV-Recognizer
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 lim... | [
"pygubu.register_widget"
] | [((2612, 2731), 'pygubu.register_widget', 'register_widget', (['"""dictcomboboxwidget.dictcombobox"""', 'DictComboboxBuilder', '"""DictCombobox"""', "('ttk', 'Custom Controls')"], {}), "('dictcomboboxwidget.dictcombobox', DictComboboxBuilder,\n 'DictCombobox', ('ttk', 'Custom Controls'))\n", (2627, 2731), False, 'fr... |
"""Day 02"""
from strenum import StrEnum
from dataclasses import dataclass
class Direction(StrEnum):
FORWARD = 'forward'
DOWN = 'down'
UP = 'up'
@dataclass(init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=True)
class Command:
direction: Direction
distance: int
def run(filena... | [
"dataclasses.dataclass"
] | [((160, 249), 'dataclasses.dataclass', 'dataclass', ([], {'init': '(True)', 'repr': '(True)', 'eq': '(True)', 'order': '(False)', 'unsafe_hash': '(False)', 'frozen': '(True)'}), '(init=True, repr=True, eq=True, order=False, unsafe_hash=False,\n frozen=True)\n', (169, 249), False, 'from dataclasses import dataclass\n... |
from django.shortcuts import render, redirect
from django.views.decorators.http import require_POST
from django.contrib import messages
from my_homepage.contact_me.models import NewContact
from my_homepage.contact_me.forms import NewContactForm
from my_homepage.utils.my_utils import process_recaptcha
@require_POST
d... | [
"my_homepage.contact_me.forms.NewContactForm",
"django.contrib.messages.error",
"django.shortcuts.redirect",
"django.contrib.messages.success",
"my_homepage.utils.my_utils.process_recaptcha"
] | [((430, 466), 'my_homepage.contact_me.forms.NewContactForm', 'NewContactForm', (['(request.POST or None)'], {}), '(request.POST or None)\n', (444, 466), False, 'from my_homepage.contact_me.forms import NewContactForm\n'), ((530, 556), 'my_homepage.utils.my_utils.process_recaptcha', 'process_recaptcha', (['request'], {}... |
# -*- coding: utf-8 -*-
"""
Copyright [2009-2019] EMBL-European Bioinformatics Institute
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... | [
"rnacentral_pipeline.databases.genecards_suite.core.lookup.write",
"rnacentral_pipeline.databases.helpers.publications.reference",
"rnacentral_pipeline.databases.genecards_suite.genecards.parse",
"tempfile.NamedTemporaryFile",
"pytest.fixture"
] | [((1165, 1195), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (1179, 1195), False, 'import pytest\n'), ((1002, 1031), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', ([], {}), '()\n', (1029, 1031), False, 'import tempfile\n'), ((1048, 1123), 'rnacentral_pipelin... |
"""This script generates equations of motion that have a very large number of
operations. It then creates a parallelized and non-parallelized version and
compares the evaluation time."""
import timeit
import numpy as np
import sympy as sm
from pydy.models import n_link_pendulum_on_cart
from opty.utils import ufuncify... | [
"timeit.default_timer",
"sympy.Symbol",
"pydy.models.n_link_pendulum_on_cart",
"sympy.Matrix"
] | [((335, 376), 'pydy.models.n_link_pendulum_on_cart', 'n_link_pendulum_on_cart', (['(10)', '(False)', '(False)'], {}), '(10, False, False)\n', (358, 376), False, 'from pydy.models import n_link_pendulum_on_cart\n'), ((583, 621), 'sympy.Matrix', 'sm.Matrix', (['[(5.0) for u in sys.speeds]'], {}), '([(5.0) for u in sys.sp... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-24 13:50
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0002_auto_20170624_1046'),
]
operations = [
migrations.AlterModelOptions(
... | [
"django.db.migrations.AlterModelOptions"
] | [((289, 427), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""author"""', 'options': "{'ordering': ['name'], 'verbose_name': 'autor', 'verbose_name_plural':\n 'autores'}"}), "(name='author', options={'ordering': ['name'],\n 'verbose_name': 'autor', 'verbose_name_plural'... |
import pytest
import asyncio
import ucp
import time
async def talk_to_server(ip, port, timeout):
try:
ep = await ucp.get_endpoint(ip, port, timeout)
except TimeoutError:
pass
@pytest.mark.asyncio
async def test_timeout():
ucp.init()
ip = ucp.get_address()
await asyncio.gather(tal... | [
"ucp.init",
"ucp.get_address",
"ucp.get_endpoint",
"ucp.fin"
] | [((254, 264), 'ucp.init', 'ucp.init', ([], {}), '()\n', (262, 264), False, 'import ucp\n'), ((274, 291), 'ucp.get_address', 'ucp.get_address', ([], {}), '()\n', (289, 291), False, 'import ucp\n'), ((369, 378), 'ucp.fin', 'ucp.fin', ([], {}), '()\n', (376, 378), False, 'import ucp\n'), ((127, 162), 'ucp.get_endpoint', '... |
import subprocess
import os
import shlex
import boto3
import json
import datetime
import pandas as pd
import time
from subprocess import check_call
from prettytable import PrettyTable
# TODO: Ask user for creds
ec2_resource = boto3.resource('ec2', region_name = 'us-east-2')
ec2_client = boto3.client('ec2'... | [
"prettytable.PrettyTable",
"boto3.resource",
"boto3.client",
"time.sleep"
] | [((239, 285), 'boto3.resource', 'boto3.resource', (['"""ec2"""'], {'region_name': '"""us-east-2"""'}), "('ec2', region_name='us-east-2')\n", (253, 285), False, 'import boto3\n'), ((302, 346), 'boto3.client', 'boto3.client', (['"""ec2"""'], {'region_name': '"""us-east-2"""'}), "('ec2', region_name='us-east-2')\n", (314,... |
import numpy as np
import scipy.sparse as sp
import warnings
#import pdb
# Matrix-vector product wrapper
# A is a numpy 2d array or matrix, or a scipy matrix or sparse matrix.
# x is a numpy vector only.
# Compute A.dot(x) if t is False,
# A.transpose().dot(x) otherwise.
def mult(A, x, t=False):
if sp.isspa... | [
"numpy.abs",
"scipy.sparse.issparse",
"numpy.linalg.svd",
"numpy.diag",
"numpy.zeros",
"numpy.linalg.norm",
"warnings.warn",
"numpy.finfo",
"scipy.sparse.csr_matrix",
"numpy.random.randn"
] | [((312, 326), 'scipy.sparse.issparse', 'sp.issparse', (['A'], {}), '(A)\n', (323, 326), True, 'import scipy.sparse as sp\n'), ((977, 1051), 'warnings.warn', 'warnings.warn', (['"""Ill-conditioning encountered, result accuracy may be poor"""'], {}), "('Ill-conditioning encountered, result accuracy may be poor')\n", (990... |
"""
Django settings for omahelsinki project.
Generated by 'django-admin startproject' using Django 2.0.6.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref/settings/
"""
# Build ... | [
"subprocess.check_output",
"os.path.exists",
"sentry_sdk.integrations.django.DjangoIntegration",
"django.utils.translation.gettext_lazy",
"os.path.join",
"os.chmod",
"os.path.dirname",
"random.SystemRandom",
"os.path.abspath",
"environ.Env",
"imp.new_module"
] | [((576, 604), 'os.path.dirname', 'os.path.dirname', (['PROJECT_DIR'], {}), '(PROJECT_DIR)\n', (591, 604), False, 'import os\n'), ((612, 667), 'environ.Env', 'environ.Env', ([], {'DATABASE_URL': "(str, 'sqlite:///db.sqlite3')"}), "(DATABASE_URL=(str, 'sqlite:///db.sqlite3'))\n", (623, 667), False, 'import environ\n'), (... |
from controller import Robot, Motor, DistanceSensor, Camera, Emitter, GPS
import struct
import numpy as np
import cv2 as cv
timeStep = 32 # Set the time step for the simulation
max_velocity = 6.28 # Set a maximum velocity time constant
robot = Robot()
# Create an object to control the left wheel
whee... | [
"controller.Robot",
"cv2.threshold",
"struct.pack",
"cv2.contourArea",
"cv2.cvtColor",
"cv2.findContours",
"numpy.frombuffer",
"cv2.boundingRect"
] | [((262, 269), 'controller.Robot', 'Robot', ([], {}), '()\n', (267, 269), False, 'from controller import Robot, Motor, DistanceSensor, Camera, Emitter, GPS\n'), ((2295, 2330), 'cv2.cvtColor', 'cv.cvtColor', (['img', 'cv.COLOR_BGR2GRAY'], {}), '(img, cv.COLOR_BGR2GRAY)\n', (2306, 2330), True, 'import cv2 as cv\n'), ((243... |
__author__ = 'ziyan.yin'
__describe__ = ''
from calendar import timegm
from datetime import datetime
from typing import Mapping
import orjson
from . import jwk
from .exceptions import JWTError, JWTClaimsError, ExpiredSignatureError
from .jws import verify, sign, load, b64decode, b64encode
def encode(claims: dict, ... | [
"orjson.loads",
"datetime.datetime.utcnow",
"orjson.dumps"
] | [((2226, 2247), 'orjson.loads', 'orjson.loads', (['payload'], {}), '(payload)\n', (2238, 2247), False, 'import orjson\n'), ((3147, 3167), 'orjson.dumps', 'orjson.dumps', (['header'], {}), '(header)\n', (3159, 3167), False, 'import orjson\n'), ((3315, 3336), 'orjson.dumps', 'orjson.dumps', (['payload'], {}), '(payload)\... |
import torchvision
from torchvision.models.detection.faster_rcnn import FastRCNNPredictor
from torchvision.models.detection import FasterRCNN
from torchvision.models.detection.backbone_utils import resnet_fpn_backbone
# from : https://github.com/pytorch/vision/blob/master/torchvision/models/detection/faster_rcnn.py#L2... | [
"torchvision.models.detection.fasterrcnn_resnet50_fpn",
"torchvision.models.detection.backbone_utils.resnet_fpn_backbone",
"torchvision.models.detection.FasterRCNN",
"torchvision.models.detection.faster_rcnn.FastRCNNPredictor"
] | [((452, 521), 'torchvision.models.detection.fasterrcnn_resnet50_fpn', 'torchvision.models.detection.fasterrcnn_resnet50_fpn', ([], {'pretrained': '(True)'}), '(pretrained=True)\n', (504, 521), False, 'import torchvision\n'), ((863, 906), 'torchvision.models.detection.faster_rcnn.FastRCNNPredictor', 'FastRCNNPredictor',... |
import re
from IPython.display import Math, display
from . import MagicGlobals as G
__all__ = ["is_ipython", "latex_to_plain", "show", "latex_use_cdot"]
def is_ipython() -> bool:
import builtins
return hasattr(builtins, "__IPYTHON__")
def latex_to_plain(latex_string: str) -> str:
# assume latex str... | [
"IPython.display.Math",
"re.sub",
"IPython.display.display",
"re.compile"
] | [((432, 463), 're.compile', 're.compile', (['"""\\\\\\\\([a-zA-Z]+|,)"""'], {}), "('\\\\\\\\([a-zA-Z]+|,)')\n", (442, 463), False, 'import re\n'), ((523, 556), 're.sub', 're.sub', (['pattern', '""""""', 'latex_string'], {}), "(pattern, '', latex_string)\n", (529, 556), False, 'import re\n'), ((835, 845), 'IPython.displ... |
import random
from django.db.models import Count
from django.shortcuts import render
from badge.registry import BadgeCache
from dataset.models import Theme, ProxyDataset, Question
from quiz.models import Quiz
from user.models import User
def home_page(request):
all_datasets = ProxyDataset.objects.annotate(
... | [
"django.shortcuts.render",
"quiz.models.Quiz.objects.last",
"django.db.models.Count",
"user.models.User.objects.filter",
"badge.registry.BadgeCache.instance",
"dataset.models.Question.objects.order_by",
"dataset.models.Theme.get_displayed"
] | [((2184, 2232), 'user.models.User.objects.filter', 'User.objects.filter', ([], {'profile__is_registered': '(True)'}), '(profile__is_registered=True)\n', (2203, 2232), False, 'from user.models import User\n'), ((2392, 2440), 'django.shortcuts.render', 'render', (['request', '"""scores.html"""', "{'users': users}"], {}),... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: modeldb/versioning/Enums.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_data... | [
"google.protobuf.symbol_database.Default",
"google.protobuf.descriptor.FileDescriptor",
"google.protobuf.reflection.GeneratedProtocolMessageType",
"google.protobuf.descriptor.EnumValueDescriptor",
"google.protobuf.descriptor.Descriptor"
] | [((392, 418), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (416, 418), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((436, 1050), 'google.protobuf.descriptor.FileDescriptor', '_descriptor.FileDescriptor', ([], {'name': '"""modeldb/versioning/Enu... |
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.1.1
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# +
import csv
import glo... | [
"collections.Counter",
"collections.defaultdict",
"csv.reader",
"typing.NamedTuple",
"glob.glob"
] | [((491, 561), 'typing.NamedTuple', 'NamedTuple', (['"""Senator"""', "[('name', str), ('party', str), ('state', str)]"], {}), "('Senator', [('name', str), ('party', str), ('state', str)])\n", (501, 561), False, 'from typing import NamedTuple, DefaultDict, Dict, List, Tuple\n'), ((718, 735), 'collections.defaultdict', 'd... |
#!/usr/bin/python3
"""
Loop over a list of devies in a YAML file and print their OS version
sudo -H pip3 install napalm
example inventory.yml:
---
# required: hostname, os
# optional: username, password, timeout, optional_args
R1:
hostname: 192.168.223.2
os: ios
username: admin
password: <PASSWORD>
timeou... | [
"napalm.get_network_driver",
"getpass.getpass",
"yaml.load",
"argparse.ArgumentParser"
] | [((1033, 1218), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Loop over a list of devices in a YAML file and print the device firmware version"""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(description=\n 'Loop over a list of devices in a YAML file and print th... |
import json
import time
import requests
from requests.models import Response
import random
import pandas as pd
import csv
import openpyxl
#Pulls JSONs from URLs list and converts into a JSON array, then saves file
#random wait times to avoid rate limiting, remove if no rate limit
def test():
with op... | [
"time.sleep",
"requests.get",
"json.load",
"pandas.DataFrame",
"random.randint",
"json.dump"
] | [((2201, 2227), 'pandas.DataFrame', 'pd.DataFrame', (["data['info']"], {}), "(data['info'])\n", (2213, 2227), True, 'import pandas as pd\n'), ((479, 519), 'requests.get', 'requests.get', (['url'], {'allow_redirects': '(False)'}), '(url, allow_redirects=False)\n', (491, 519), False, 'import requests\n'), ((1942, 1962), ... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import scipy.io as sio
import numpy as np
import matplotlib.pyplot as plt
# In[2]:
a = sio.loadmat('time_1_4.mat')
cells = a['timedata']
# In[3]:
cells.shape
# In[4]:
t = np.linspace(0, 180/12, 181)
title_list = ['No delay', 'Half day delay (ddT=0)', 'Half d... | [
"scipy.io.loadmat",
"numpy.linspace",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.subplots_adjust"
] | [((141, 168), 'scipy.io.loadmat', 'sio.loadmat', (['"""time_1_4.mat"""'], {}), "('time_1_4.mat')\n", (152, 168), True, 'import scipy.io as sio\n'), ((233, 262), 'numpy.linspace', 'np.linspace', (['(0)', '(180 / 12)', '(181)'], {}), '(0, 180 / 12, 181)\n', (244, 262), True, 'import numpy as np\n'), ((679, 726), 'matplot... |
# File: update_label.py
# Desc: Update label above input box using user input name.
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.properties import ObjectProperty
from kivy.lang import Builder
# Designate our .kv design file
Builder.load_file('update_label.kv')
class MyLayout(Widget):
de... | [
"kivy.lang.Builder.load_file"
] | [((251, 287), 'kivy.lang.Builder.load_file', 'Builder.load_file', (['"""update_label.kv"""'], {}), "('update_label.kv')\n", (268, 287), False, 'from kivy.lang import Builder\n')] |
# -----------------------------------------------------------
# Exercise 06b: Mapping a Grid unto a Surface
# EDEK, University of Kassel
#
# (C) 2018 <NAME>
# Released under the Blue Oak Model License (BOML)
# -----------------------------------------------------------
__author__ = "<NAME>"
__version__ = "2018-12-11"
... | [
"Grasshopper.Kernel.Data.GH_Path",
"ghpythonlib.components.PolyLine",
"Rhino.Geometry.Surface.IsClosed",
"Rhino.Geometry.Interval",
"ghpythonlib.components.RemapNumbers",
"ghpythonlib.components.BoundarySurfaces",
"ghpythonlib.components.PlaneFit",
"ghpythonlib.components.Discontinuity"
] | [((794, 825), 'Rhino.Geometry.Surface.IsClosed', 'rg.Surface.IsClosed', (['Surface', '(0)'], {}), '(Surface, 0)\n', (813, 825), True, 'import Rhino.Geometry as rg\n'), ((856, 887), 'Rhino.Geometry.Surface.IsClosed', 'rg.Surface.IsClosed', (['Surface', '(1)'], {}), '(Surface, 1)\n', (875, 887), True, 'import Rhino.Geome... |
import click
from pprint import pprint
from .decorators import onlineChain, unlockWallet
from .main import main
@main.command()
@click.pass_context
@onlineChain
@click.argument("members", nargs=-1)
@click.option("--account", help="Account that takes this action", type=str)
@unlockWallet
def approvecommittee(ctx, memb... | [
"click.option",
"click.argument"
] | [((164, 199), 'click.argument', 'click.argument', (['"""members"""'], {'nargs': '(-1)'}), "('members', nargs=-1)\n", (178, 199), False, 'import click\n'), ((201, 275), 'click.option', 'click.option', (['"""--account"""'], {'help': '"""Account that takes this action"""', 'type': 'str'}), "('--account', help='Account tha... |
from itertools import islice
from re import compile
from snowddl.blueprint import TableBlueprint, TableColumn, DataType, BaseDataType
from snowddl.resolver.abc_schema_object_resolver import AbstractSchemaObjectResolver, ResolveResult, ObjectType
cluster_by_syntax_re = compile(r'^(\w+)?\((.*)\)$')
class TableResolve... | [
"snowddl.blueprint.DataType",
"re.compile"
] | [((271, 301), 're.compile', 'compile', (['"""^(\\\\w+)?\\\\((.*)\\\\)$"""'], {}), "('^(\\\\w+)?\\\\((.*)\\\\)$')\n", (278, 301), False, 'from re import compile\n'), ((9705, 9724), 'snowddl.blueprint.DataType', 'DataType', (["r['type']"], {}), "(r['type'])\n", (9713, 9724), False, 'from snowddl.blueprint import TableBlu... |
from aqt import gui_hooks
from aqt.utils import showWarning
opened = False
def startup():
global opened
if opened:
warning_text = "\n".join((
"Pokemanki does not support opening a second profile in one session.",
"Please close Anki and reopen it again to the desired profile."... | [
"aqt.utils.showWarning",
"aqt.gui_hooks.profile_did_open.append"
] | [((514, 556), 'aqt.gui_hooks.profile_did_open.append', 'gui_hooks.profile_did_open.append', (['startup'], {}), '(startup)\n', (547, 556), False, 'from aqt import gui_hooks\n'), ((386, 454), 'aqt.utils.showWarning', 'showWarning', (['warning_text'], {'title': '"""Pokemanki won\'t function properly"""'}), '(warning_text,... |
import grpc
import pytest
from uuid import uuid4
from multiprocessing import Event
from google.protobuf import json_format
from google.protobuf.empty_pb2 import Empty
from common.cryptographer import Cryptographer
from teos.watcher import Watcher
from teos.responder import Responder
from teos.gatekeeper import UserI... | [
"teos.internal_api.AppointmentAlreadyTriggered",
"common.cryptographer.Cryptographer.get_compressed_pk",
"teos.gatekeeper.UserInfo",
"teos.protobuf.appointment_pb2.Appointment",
"teos.protobuf.user_pb2.GetUserRequest",
"pytest.fixture",
"teos.responder.Responder",
"test.teos.unit.conftest.generate_key... | [((1486, 1504), 'test.teos.unit.conftest.generate_keypair', 'generate_keypair', ([], {}), '()\n', (1502, 1504), False, 'from test.teos.unit.conftest import generate_keypair, get_random_value_hex, mock_connection_refused_return, raise_invalid_parameter, raise_auth_failure, raise_not_enough_slots\n'), ((1515, 1555), 'com... |
import os
import csv
from xml.dom import minidom
import xml.etree.ElementTree as ET
'''
Script created by <NAME>
it reads a csv file and creates a PASCAL VOC format dataset file
'''
def read_csv(csv_file):
image = []
xmin = []
xmax = []
ymin = []
ymax = []
label = []
width = []
height ... | [
"os.path.exists",
"csv.DictReader",
"os.makedirs",
"xml.etree.ElementTree.tostring",
"xml.etree.ElementTree.Element",
"xml.etree.ElementTree.SubElement"
] | [((935, 959), 'xml.etree.ElementTree.Element', 'ET.Element', (['"""annotation"""'], {}), "('annotation')\n", (945, 959), True, 'import xml.etree.ElementTree as ET\n'), ((973, 1008), 'xml.etree.ElementTree.SubElement', 'ET.SubElement', (['annotation', '"""folder"""'], {}), "(annotation, 'folder')\n", (986, 1008), True, ... |
# Generated by Django 3.1.4 on 2020-12-29 12:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("shipping", "0025_auto_20201130_1122"),
]
operations = [
migrations.AddField(
model_name="shippingzone",
name="descri... | [
"django.db.models.TextField"
] | [((346, 374), 'django.db.models.TextField', 'models.TextField', ([], {'blank': '(True)'}), '(blank=True)\n', (362, 374), False, 'from django.db import migrations, models\n')] |
from time import time
import pandas as pd
import matplotlib.pyplot as plt
from mvmm.BaseGridSearch import BaseGridSearch
from mvmm.viz_utils import set_xaxis_int_ticks
def fit_and_score(estimator, X, parameters):
"""
Fits a mixture model on a dataset then comptues aic/bic scores.
Output
------
s... | [
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"pandas.DataFrame",
"time.time",
"mvmm.viz_utils.set_xaxis_int_ticks"
] | [((468, 474), 'time.time', 'time', ([], {}), '()\n', (472, 474), False, 'from time import time\n'), ((1867, 1895), 'pandas.DataFrame', 'pd.DataFrame', (['gs.param_grid_'], {}), '(gs.param_grid_)\n', (1879, 1895), True, 'import pandas as pd\n'), ((2036, 2076), 'matplotlib.pyplot.plot', 'plt.plot', (['n_components', 'bic... |
#!/usr/bin/env python3
# Extended from bwDB - CRUD library for sqlite 3 by <NAME> [http://bw.org/]
import sqlite3
import os
__version__ = '1.0.1'
class ArkDBSQLite:
kQUERY_PARAM_PLACE_HOLDER = '?'
def __init__(self, **kwargs):
"""
db = ArkDBSQLite ( [ table = ''] [, filename = ''] )
... | [
"sqlite3.connect",
"os.remove"
] | [((1231, 1264), 'sqlite3.connect', 'sqlite3.connect', (['self.dbfilename_'], {}), '(self.dbfilename_)\n', (1246, 1264), False, 'import sqlite3\n'), ((1423, 1455), 'os.remove', 'os.remove', (['f"""{self.dbfilename_}"""'], {}), "(f'{self.dbfilename_}')\n", (1432, 1455), False, 'import os\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import copy
import cv2 as cv
import cv_util
class CaptureDevice:
@classmethod
def set_args(cls, parser):
parser.add_argument("--device", type=int, default=0)
parser.add_argument("--width", help='cap width', type=int, default=960)
... | [
"cv2.flip",
"cv_util.draw_result_on_img",
"cv_util.CvFpsCalc",
"cv2.imshow",
"cv2.destroyAllWindows",
"cv2.VideoCapture",
"cv2.cvtColor",
"copy.deepcopy",
"cv2.waitKey"
] | [((548, 576), 'cv2.VideoCapture', 'cv.VideoCapture', (['args.device'], {}), '(args.device)\n', (563, 576), True, 'import cv2 as cv\n'), ((761, 793), 'cv_util.CvFpsCalc', 'cv_util.CvFpsCalc', ([], {'buffer_len': '(10)'}), '(buffer_len=10)\n', (778, 793), False, 'import cv_util\n'), ((1692, 1714), 'cv2.destroyAllWindows'... |
import tkinter as tk
import sys
import os
from . themes import Theme
from . themes import ThemeConfig as _tcfg
_THEME: _tcfg = Theme.LIGHT
class Main(tk.Tk):
def __init__(self, *args, **kwargs):
tk.Tk.__init__(self, *args, **kwargs)
Main.configure(self, bg=_THEME.background)
center_window... | [
"tkinter.Button.__init__",
"tkinter.Frame.__init__",
"tkinter.OptionMenu.__init__",
"tkinter.Text.__init__",
"tkinter.Label.__init__",
"tkinter.Toplevel.__init__",
"os.path.join",
"tkinter.Scrollbar.__init__",
"tkinter.Entry.__init__",
"tkinter.Checkbutton.__init__",
"tkinter.Tk.__init__",
"tk... | [((6852, 6879), 'tkinter.Tk.clipboard_clear', 'tk.Tk.clipboard_clear', (['main'], {}), '(main)\n', (6873, 6879), True, 'import tkinter as tk\n'), ((6884, 6922), 'tkinter.Tk.clipboard_append', 'tk.Tk.clipboard_append', (['main', 'cliptext'], {}), '(main, cliptext)\n', (6906, 6922), True, 'import tkinter as tk\n'), ((209... |
# import keyboard as Keyboard
# Keyboard.key = Keyboard.press_and_release
import os
if os.name == 'nt':
from _nt import get_volume_device
else:
raise NotImplementedError('Only available in Windows for the moment')
class Sound:
"""
Class Sound
:description: Based on the class written by Paradoxis ... | [
"_nt.get_volume_device"
] | [((500, 519), '_nt.get_volume_device', 'get_volume_device', ([], {}), '()\n', (517, 519), False, 'from _nt import get_volume_device\n'), ((718, 737), '_nt.get_volume_device', 'get_volume_device', ([], {}), '()\n', (735, 737), False, 'from _nt import get_volume_device\n'), ((978, 997), '_nt.get_volume_device', 'get_volu... |
import cv2
from skimage.feature import hog
from sklearn.decomposition import PCA
class FeatureSelection:
def __init__(self):
print("\n----------------------------------------------------------")
print("--------------P-R-O-C-E-S-S-I-N-G---D-A-T-A---------------")
print("-------------------... | [
"cv2.resize",
"cv2.threshold",
"sklearn.decomposition.PCA",
"cv2.cvtColor",
"skimage.feature.hog",
"cv2.imread"
] | [((754, 776), 'cv2.imread', 'cv2.imread', (['image_path'], {}), '(image_path)\n', (764, 776), False, 'import cv2\n'), ((792, 829), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_BGR2GRAY'], {}), '(img, cv2.COLOR_BGR2GRAY)\n', (804, 829), False, 'import cv2\n'), ((848, 908), 'cv2.resize', 'cv2.resize', (['gray', '(... |
import os
import cv2
class UtilsHelper:
path_to_temp_images = os.getcwd() + "/temp_images/"
path_to_test_images = os.getcwd() + "/test_images/"
use_test_images = False
@staticmethod
def load_images():
if UtilsHelper.use_test_images:
images = UtilsHelper.load_from_folder(Utils... | [
"os.listdir",
"os.path.join",
"os.getcwd"
] | [((69, 80), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (78, 80), False, 'import os\n'), ((125, 136), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (134, 136), False, 'import os\n'), ((869, 895), 'os.listdir', 'os.listdir', (['path_to_images'], {}), '(path_to_images)\n', (879, 895), False, 'import os\n'), ((926, 964), 'o... |
import re
import numpy as np
import pandas as pd
def sort_data(data):
new_data = []
for message in data:
if ' добавил(-а) ' in message or ' создал(-а) ' in message or message == '':
pass
else:
new_data.append(message)
return new_data
... | [
"pandas.DataFrame"
] | [((1121, 1199), 'pandas.DataFrame', 'pd.DataFrame', (["{'date': dates, 'time': times, 'author': authors, 'text': texts}"], {}), "({'date': dates, 'time': times, 'author': authors, 'text': texts})\n", (1133, 1199), True, 'import pandas as pd\n')] |
import config
from sqlalchemy import Column, Integer, String, DateTime, create_engine
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class DataSource(Base):
__tablename__ = 'datasource'
id = Column(Integer, primary_key=True)
update_time = Column(DateTime)
data = Co... | [
"sqlalchemy.create_engine",
"sqlalchemy.Column",
"sqlalchemy.ext.declarative.declarative_base"
] | [((150, 168), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', ([], {}), '()\n', (166, 168), False, 'from sqlalchemy.ext.declarative import declarative_base\n'), ((238, 271), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)'}), '(Integer, primary_key=True)\n', (244, 271), False, 'f... |
import platform, sublime, sublime_plugin
class AwesomeFooCommand(sublime_plugin.ApplicationCommand):
def run(self):
if "Darwin" in platform.platform():
print("Darwin")
else:
print("not supported")
class AwesomeBarCommand(sublime_plugin.ApplicationCommand):
d... | [
"sublime.platform",
"platform.platform"
] | [((150, 169), 'platform.platform', 'platform.platform', ([], {}), '()\n', (167, 169), False, 'import platform, sublime, sublime_plugin\n'), ((345, 363), 'sublime.platform', 'sublime.platform', ([], {}), '()\n', (361, 363), False, 'import platform, sublime, sublime_plugin\n'), ((416, 434), 'sublime.platform', 'sublime.p... |
import http.server
import socketserver
PORT = 8888
class Handler(http.server.SimpleHTTPRequestHandler):
pass
Handler.extensions_map['.wasm'] = 'application/wasm'
httpd = socketserver.TCPServer(("", PORT), Handler)
print(("serving at port"), PORT)
httpd.serve_forever()
| [
"socketserver.TCPServer"
] | [((178, 221), 'socketserver.TCPServer', 'socketserver.TCPServer', (["('', PORT)", 'Handler'], {}), "(('', PORT), Handler)\n", (200, 221), False, 'import socketserver\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__all__ = ["RegionEditor"]
import os
import sys
import cv2
import copy
import numpy as np
from functools import partial
from matplotlib.path import Path
from matplotlib.widgets import (
Button, Slider, RadioButtons, CheckButtons,
RectangleSelector, EllipseSelector... | [
"cv2.resize",
"numpy.logical_and",
"matplotlib.widgets.Button",
"numpy.array",
"numpy.zeros",
"pyutils.figure.Figure",
"cv2.cvtColor",
"matplotlib.pyplot.Rectangle",
"numpy.full",
"matplotlib.widgets.Slider",
"sys.path.append"
] | [((407, 427), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (422, 427), False, 'import sys\n'), ((1340, 1367), 'numpy.array', 'np.array', (['range_of_interest'], {}), '(range_of_interest)\n', (1348, 1367), True, 'import numpy as np\n'), ((1497, 1520), 'pyutils.figure.Figure', 'Figure', ([], {'figs... |
"""
@author: <NAME>
@contact: <EMAIL>
"""
import argparse
from ifpd import const, query
from ifpd.scripts import arguments as ap # type: ignore
from ifpd.exception import enable_rich_assert
from joblib import Parallel, delayed # type: ignore
import logging
import numpy as np # type: ignore
import os
import pandas a... | [
"ifpd.scripts.arguments.add_version_option",
"ifpd.query.ProbeFeatureTable",
"numpy.argsort",
"logging.info",
"os.path.isdir",
"os.mkdir",
"rich.logging.RichHandler",
"ifpd.query.OligoProbe",
"numpy.round",
"ifpd.query.OligoDatabase",
"logging.warning",
"os.path.isfile",
"ifpd.scripts.argume... | [((2881, 2910), 'ifpd.scripts.arguments.add_version_option', 'ap.add_version_option', (['parser'], {}), '(parser)\n', (2902, 2910), True, 'from ifpd.scripts import arguments as ap\n'), ((7375, 7463), 'numpy.logical_and', 'np.logical_and', (['(chromData.iloc[:, 0] >= chromStart)', '(chromData.iloc[:, 1] <= chromEnd)'], ... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from fairdiplomacy.selfplay.search_rollout import ReSearchRolloutBatch
from typing import Dict, Optional
import argparse
import collections
i... | [
"heyhi.conf_get",
"fairdiplomacy.selfplay.rollout.order_logits_to_action_logprobs",
"heyhi.maybe_init_requeue_handler",
"psutil.virtual_memory",
"torch.cuda.device_count",
"torch.cuda.is_available",
"attr.asdict",
"fairdiplomacy.utils.multiprocessing_spawn_context.get_multiprocessing_ctx",
"logging.... | [((1633, 1658), 'fairdiplomacy.utils.multiprocessing_spawn_context.get_multiprocessing_ctx', 'get_multiprocessing_ctx', ([], {}), '()\n', (1656, 1658), False, 'from fairdiplomacy.utils.multiprocessing_spawn_context import get_multiprocessing_ctx\n'), ((1730, 1750), 'pathlib.Path', 'pathlib.Path', (['"""ckpt"""'], {}), ... |
####
# Script that fixes sumstats for pheweb. Needs to replace header names and filter out unneeded columns
import os,importlib.util,gzip,sys,itertools,argparse
from utils import return_open_func,return_header,identify_separator,get_path_info,line_iterator,tmp_bash
from pathlib import Path
#IMPORT CONF UTIL FROM PHEW... | [
"utils.return_header",
"itertools.islice",
"argparse.ArgumentParser",
"pathlib.Path",
"gzip.open",
"os.rename",
"os.path.join",
"utils.tmp_bash",
"utils.return_open_func",
"os.path.realpath",
"utils.identify_separator",
"utils.get_path_info",
"utils.line_iterator"
] | [((342, 368), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (358, 368), False, 'import os, importlib.util, gzip, sys, itertools, argparse\n'), ((476, 528), 'os.path.join', 'os.path.join', (['pheweb_path', '"""pheweb"""', '"""conf_utils.py"""'], {}), "(pheweb_path, 'pheweb', 'conf_utils.py'... |
import pytest
from pytest_network import patched_connect, NetworkUsageException
def test_disable_network_fixture_raiese_exception(testdir):
testdir.makepyfile(
"""
import urllib.request
import pytest
def test_hello_default(disable_network):
with pytest.raises(Excepti... | [
"pytest_network.patched_connect",
"pytest.raises",
"pytest.mark.usefixtures"
] | [((515, 564), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""disable_network_addopt"""'], {}), "('disable_network_addopt')\n", (538, 564), False, 'import pytest\n'), ((982, 1031), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""disable_network_addopt"""'], {}), "('disable_network_addopt')\n", (... |
import TestDataCube
import TestShape
import TestSlice
import TestTimer
import TestNdArray
import TestMethods
import TestConstants
import TestCoordinates
import TestFilters
import TestImageProcessing
import TestLinalg
import TestRandom
import TestRotations
import TestPolynomial
import TestFFT
import TestUtils
import Tes... | [
"TestDataCube.doTest",
"TestTimer.doTest",
"TestRandom.doTest",
"TestDtypeInfo.doTest",
"TestUtils.doTest",
"TestShape.doTest",
"TestSlice.doTest",
"TestNdArray.doTest",
"TestPolynomial.doTest",
"TestFFT.doTest",
"TestConstants.doTest",
"TestFilters.doTest",
"TestMethods.doTest",
"TestRota... | [((432, 453), 'TestDataCube.doTest', 'TestDataCube.doTest', ([], {}), '()\n', (451, 453), False, 'import TestDataCube\n'), ((458, 476), 'TestShape.doTest', 'TestShape.doTest', ([], {}), '()\n', (474, 476), False, 'import TestShape\n'), ((481, 499), 'TestSlice.doTest', 'TestSlice.doTest', ([], {}), '()\n', (497, 499), F... |
import h5py # HDF5 support
import os
import glob
import numpy as n
from scipy.interpolate import interp1d
import astropy.io.fits as fits
from astropy.cosmology import FlatLambdaCDM
import astropy.units as u
cosmoMD = FlatLambdaCDM(H0=67.77*u.km/u.s/u.Mpc, Om0=0.307115, Ob0=0.048206)
def write_fits_lc(path_to_lc, ... | [
"numpy.log10",
"astropy.io.fits.PrimaryHDU",
"astropy.io.fits.HDUList",
"astropy.io.fits.Column",
"astropy.cosmology.FlatLambdaCDM",
"h5py.File",
"astropy.io.fits.Header",
"astropy.io.fits.BinTableHDU.from_columns",
"os.system"
] | [((221, 293), 'astropy.cosmology.FlatLambdaCDM', 'FlatLambdaCDM', ([], {'H0': '(67.77 * u.km / u.s / u.Mpc)', 'Om0': '(0.307115)', 'Ob0': '(0.048206)'}), '(H0=67.77 * u.km / u.s / u.Mpc, Om0=0.307115, Ob0=0.048206)\n', (234, 293), False, 'from astropy.cosmology import FlatLambdaCDM\n'), ((372, 398), 'h5py.File', 'h5py.... |
# Copyright (c) OpenMMLab. All rights reserved.
import torch
from torch.nn.parallel.distributed import _find_tensors
from mmgen.models.builder import MODELS
from ..common import set_requires_grad
from .static_translation_gan import StaticTranslationGAN
@MODELS.register_module()
class Pix2Pix(StaticTranslationGAN):
... | [
"mmgen.models.builder.MODELS.register_module",
"torch.nn.parallel.distributed._find_tensors",
"torch.cat"
] | [((257, 281), 'mmgen.models.builder.MODELS.register_module', 'MODELS.register_module', ([], {}), '()\n', (279, 281), False, 'from mmgen.models.builder import MODELS\n'), ((1569, 1656), 'torch.cat', 'torch.cat', (["(outputs[f'real_{source_domain}'], outputs[f'fake_{target_domain}'])", '(1)'], {}), "((outputs[f'real_{sou... |
from tulip import hybrid
import polytope
import scipy.io
"""
Contains functions that will read a .mat file exported by the MATLAB function
mpt2python and import it to either a PwaSysDyn or a LtiSysDyn.
<NAME>, June 2014
"""
def load(filename):
data = scipy.io.loadmat(filename)
islti = bool(data['islti'][0][... | [
"polytope.Polytope",
"tulip.hybrid.LtiSysDyn",
"tulip.hybrid.PwaSysDyn"
] | [((1212, 1247), 'polytope.Polytope', 'polytope.Polytope', (['domainA', 'domainB'], {}), '(domainA, domainB)\n', (1229, 1247), False, 'import polytope\n'), ((1259, 1290), 'polytope.Polytope', 'polytope.Polytope', (['UsetA', 'UsetB'], {}), '(UsetA, UsetB)\n', (1276, 1290), False, 'import polytope\n'), ((1302, 1359), 'tul... |
#!/usr/bin/env python3
''' Check if FASTQ input file is in valid format '''
import sys, logging, re
from common_tools.gzip_opener import *
from common_tools.exception_logger import *
def description():
''' Returns top-level docstring. Useful for providing
descriptions to sub-parsers after importin... | [
"logging.getLogger",
"sys._getframe",
"re.search"
] | [((496, 539), 'logging.getLogger', 'logging.getLogger', (['f"""{__name__}.{fun_name}"""'], {}), "(f'{__name__}.{fun_name}')\n", (513, 539), False, 'import sys, logging, re\n'), ((455, 470), 'sys._getframe', 'sys._getframe', ([], {}), '()\n', (468, 470), False, 'import sys, logging, re\n'), ((1487, 1541), 're.search', '... |
import numpy as np
import claude_low_level_library as low_level
import claude_top_level_library as top_level
def grid_lat(mul, xx, yy, rad):
return (mul * np.arccos(((xx**2 + yy**2)**0.5)/rad)*180.0/np.pi).flatten()
def grid_lon(xx, yy):
return (180.0 - np.arctan2(yy,xx)*180.0/np.pi).flatten()
def cos_mul_si... | [
"numpy.sin",
"numpy.arctan2",
"numpy.arccos",
"numpy.cos"
] | [((390, 420), 'numpy.sin', 'np.sin', (['(lon[j] * np.pi / 180.0)'], {}), '(lon[j] * np.pi / 180.0)\n', (396, 420), True, 'import numpy as np\n'), ((502, 532), 'numpy.cos', 'np.cos', (['(lon[j] * np.pi / 180.0)'], {}), '(lon[j] * np.pi / 180.0)\n', (508, 532), True, 'import numpy as np\n'), ((361, 391), 'numpy.cos', 'np... |
import sys
from cx_Freeze import setup, Executable
build_exe_options = {
'includes': [
'ninfs',
'ninfs.gui',
'ninfs.mount.cci',
'ninfs.mount.cdn',
'ninfs.mount.cia',
'ninfs.mount.exefs',
'ninfs.mount.nandctr',
'ninfs.mount.nandhac',
'ninfs.mou... | [
"cx_Freeze.Executable",
"cx_Freeze.setup"
] | [((1802, 1988), 'cx_Freeze.setup', 'setup', ([], {'name': '"""ninfs"""', 'version': 'version', 'description': '"""FUSE filesystem Python scripts for Nintendo console files"""', 'options': "{'build_exe': build_exe_options}", 'executables': 'executables'}), "(name='ninfs', version=version, description=\n 'FUSE filesys... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from hashlib import sha256
from .Varint import Varint
from .Varstr import Varstr
from .Netaddr import Netaddr
from .Timestamp import Timestamp
def dsha256(p: bytes) -> bytes:
"""
Calculate double sha256 hash
Parameters
----------
p : bytes
p... | [
"hashlib.sha256"
] | [((434, 443), 'hashlib.sha256', 'sha256', (['p'], {}), '(p)\n', (440, 443), False, 'from hashlib import sha256\n')] |
from aiogram.types import KeyboardButton, ReplyKeyboardMarkup
markup = ReplyKeyboardMarkup()
# markup.row(KeyboardButton("/led_on"), KeyboardButton("/led_off"))
markup.row(KeyboardButton("/work"), KeyboardButton("/rest"), KeyboardButton("🏡"))
markup.row(KeyboardButton("weather"), KeyboardButton("internet"), KeyboardB... | [
"aiogram.types.KeyboardButton",
"aiogram.types.ReplyKeyboardMarkup"
] | [((72, 93), 'aiogram.types.ReplyKeyboardMarkup', 'ReplyKeyboardMarkup', ([], {}), '()\n', (91, 93), False, 'from aiogram.types import KeyboardButton, ReplyKeyboardMarkup\n'), ((173, 196), 'aiogram.types.KeyboardButton', 'KeyboardButton', (['"""/work"""'], {}), "('/work')\n", (187, 196), False, 'from aiogram.types impor... |
import requests
import pandas as pd
import json
from io import StringIO
from FinanceTester._utils import (_convert_letter_to_num, _validate_dates)
class InvestingDailyReader:
def __init__(self, symbols, start=None, end=None, country=None):
self.symbols = symbols
start, end = _validate_dates(start, ... | [
"json.loads",
"requests.post",
"FinanceTester._utils._validate_dates",
"io.StringIO",
"pandas.to_datetime"
] | [((297, 324), 'FinanceTester._utils._validate_dates', '_validate_dates', (['start', 'end'], {}), '(start, end)\n', (312, 324), False, 'from FinanceTester._utils import _convert_letter_to_num, _validate_dates\n'), ((1271, 1317), 'requests.post', 'requests.post', (['url'], {'data': 'data', 'headers': 'headers'}), '(url, ... |
import json
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.utils import translation
from django.conf import settings
from mezzanine.core.models import CONTENT_STATUS_PUBLISHED
from pari.article.models import Article, get_archive_articles, get_all_article... | [
"pari.article.models.Article.articles.prefetch_related",
"json.loads",
"pari.article.models.Article.objects.prefetch_related",
"django.utils.translation.activate",
"pari.article.templatetags.article_filters.month_name",
"pari.article.models.get_all_articles",
"pari.article.models.get_archive_articles"
] | [((2163, 2206), 'pari.article.models.get_archive_articles', 'get_archive_articles', (['self.month', 'self.year'], {}), '(self.month, self.year)\n', (2183, 2206), False, 'from pari.article.models import Article, get_archive_articles, get_all_articles, ArticleCarouselImage\n'), ((2431, 2453), 'pari.article.templatetags.a... |
from itertools import cycle
from pyclarity_lims.entities import ReagentLot
from scripts.generate_hamilton_input_ntp import GenerateHamiltonInputNTP
from tests.test_common import TestEPP, FakeEntitiesMaker
class TestGenerateHamiltonInputNTP(TestEPP):
def setUp(self):
self.epp = GenerateHamiltonInputNTP... | [
"itertools.cycle",
"scripts.generate_hamilton_input_ntp.GenerateHamiltonInputNTP",
"tests.test_common.FakeEntitiesMaker"
] | [((296, 394), 'scripts.generate_hamilton_input_ntp.GenerateHamiltonInputNTP', 'GenerateHamiltonInputNTP', (["(self.default_argv + ['-i', 'a_file_location'] + ['-d', self.assets])"], {}), "(self.default_argv + ['-i', 'a_file_location'] + [\n '-d', self.assets])\n", (320, 394), False, 'from scripts.generate_hamilton_i... |
# coding: utf-8
from __future__ import with_statement
from fabric.api import task
REMOTE_URL = 'https://github.com/disko/fabtools.git'
@task
def git_require():
"""
Test high level git tools. These tests should also cover the low
level tools as all of them are called indirectly.
"""
from fabr... | [
"fabtools.files.owner",
"fabric.api.cd",
"fabtools.files.group",
"fabric.api.run",
"fabric.api.sudo",
"fabtools.require.git.working_copy",
"fabtools.files.is_dir",
"fabtools.files.md5sum",
"fabtools.require.user"
] | [((797, 833), 'fabtools.require.git.working_copy', 'require.git.working_copy', (['REMOTE_URL'], {}), '(REMOTE_URL)\n', (821, 833), False, 'from fabtools import require\n'), ((846, 864), 'fabtools.files.is_dir', 'is_dir', (['"""fabtools"""'], {}), "('fabtools')\n", (852, 864), False, 'from fabtools.files import group, i... |
'''
创建2个logger对象,分别发往不同的handler
'''
import logging
#创建logger
logger1 = logging.getLogger('mylogger1')
logger2 = logging.getLogger('mylogger2')
# 创建handler
handler1 = logging.FileHandler('study03.log') #写入日志文件
handler2 = logging.StreamHandler() #输出到控制台
#设置输出日志级别
logger1.setLevel(logging.DEBUG)
logger2.setLevel(lo... | [
"logging.getLogger",
"logging.Formatter",
"logging.StreamHandler",
"logging.FileHandler"
] | [((73, 103), 'logging.getLogger', 'logging.getLogger', (['"""mylogger1"""'], {}), "('mylogger1')\n", (90, 103), False, 'import logging\n'), ((114, 144), 'logging.getLogger', 'logging.getLogger', (['"""mylogger2"""'], {}), "('mylogger2')\n", (131, 144), False, 'import logging\n'), ((169, 203), 'logging.FileHandler', 'lo... |
import FWCore.ParameterSet.Config as cms
import EventFilter.RPCRawToDigi.rpcUnpackingModule_cfi
rpcunpacker = EventFilter.RPCRawToDigi.rpcUnpackingModule_cfi.rpcUnpackingModule.clone()
rpcunpacker.InputLabel = cms.InputTag("rawDataCollector")
rpcunpacker.doSynchro = cms.bool(True)
| [
"FWCore.ParameterSet.Config.bool",
"FWCore.ParameterSet.Config.InputTag"
] | [((212, 244), 'FWCore.ParameterSet.Config.InputTag', 'cms.InputTag', (['"""rawDataCollector"""'], {}), "('rawDataCollector')\n", (224, 244), True, 'import FWCore.ParameterSet.Config as cms\n'), ((269, 283), 'FWCore.ParameterSet.Config.bool', 'cms.bool', (['(True)'], {}), '(True)\n', (277, 283), True, 'import FWCore.Par... |
from datetime import datetime
import re
class Pull(object):
"""
"""
def __init__(self, *args, **kwargs):
self.args, self.kwargs = args, kwargs
@staticmethod
def oldest(objects):
# ['source']['repository']['name']
# "state": "OPEN",
# "created_on": "2014-08... | [
"datetime.datetime",
"re.findall"
] | [((1251, 1268), 'datetime.datetime', 'datetime', (['*result'], {}), '(*result)\n', (1259, 1268), False, 'from datetime import datetime\n'), ((1159, 1193), 're.findall', 're.findall', (['"""\\\\d{1,4}\\\\d{1,2}"""', 'dt'], {}), "('\\\\d{1,4}\\\\d{1,2}', dt)\n", (1169, 1193), False, 'import re\n')] |
from luigi.contrib.s3 import S3Target
from ob_pipelines.batch import BatchTask, LoggingTaskWrapper
from ob_pipelines.config import cfg
from ob_pipelines.entities.sample import Sample
from ob_pipelines.pipelines.xenograft.tasks.star_by_species import StarBySpecies
class DisambiguateHumanMouse(BatchTask, LoggingTaskWr... | [
"luigi.contrib.s3.S3Target",
"ob_pipelines.pipelines.xenograft.tasks.star_by_species.StarBySpecies"
] | [((789, 845), 'ob_pipelines.pipelines.xenograft.tasks.star_by_species.StarBySpecies', 'StarBySpecies', ([], {'sample_id': 'self.sample_id', 'species': '"""human"""'}), "(sample_id=self.sample_id, species='human')\n", (802, 845), False, 'from ob_pipelines.pipelines.xenograft.tasks.star_by_species import StarBySpecies\n'... |
import Core.Base.Pyscrds_modified as rcon
def Rcon_AdminWarn(server_rcon_info, server_name, steam_64id, warning_info):
conn = rcon.RconConnection(server=server_rcon_info[server_name]['Server_IP'],
port=server_rcon_info[server_name]['RCON_Port'],
passwo... | [
"Core.Base.Pyscrds_modified.RconConnection"
] | [((132, 314), 'Core.Base.Pyscrds_modified.RconConnection', 'rcon.RconConnection', ([], {'server': "server_rcon_info[server_name]['Server_IP']", 'port': "server_rcon_info[server_name]['RCON_Port']", 'password': "server_rcon_info[server_name]['Server_pw']"}), "(server=server_rcon_info[server_name]['Server_IP'], port\n ... |
#!/usr/bin/env python
# coding: utf-8
# Author: <NAME><br>
# Email: <EMAIL>
#
# # Molecular setup
#
# In this notebook you'll learn how to use BioSimSpace to write a robust and interoperable workflow node to generate a molecular system ready for simulation with AMBER. To do so, we'll read in a molecule f... | [
"BioSimSpace.Solvent.waterModels",
"BioSimSpace.Gateway.Node",
"BioSimSpace.Parameters.forceFields",
"BioSimSpace.Gateway.FileSet",
"BioSimSpace.IO.saveMolecules",
"BioSimSpace.Gateway.Length",
"BioSimSpace.Gateway.Float",
"BioSimSpace.Gateway.File"
] | [((736, 854), 'BioSimSpace.Gateway.Node', 'BSS.Gateway.Node', (['"""A node to parameterise and solvate a molecule ready for molecular simulation with AMBER."""'], {}), "(\n 'A node to parameterise and solvate a molecule ready for molecular simulation with AMBER.'\n )\n", (752, 854), True, 'import BioSimSpace as B... |
import socket
s = socket.socket()
print("Socket successfully created")
port = 44444
s.bind(('', port))
print ("socket binded to %s" % (port))
s.listen(5)
print ("socket is listening")
while True:
c, addr = s.accept()
print ('Got connection from {}'.format(addr))
c.send(b'Hello its me, rwi \n\n')
c.... | [
"socket.socket"
] | [((19, 34), 'socket.socket', 'socket.socket', ([], {}), '()\n', (32, 34), False, 'import socket\n')] |
import json
import tempfile
import unittest
from pathlib import Path
from timeeval_experiments.generator.algorithm_parsing import AlgorithmLoader, _parse_readme, _parse_manifest
from timeeval_experiments.generator.exceptions import MissingReadmeWarning, MissingManifestWarning, \
InvalidManifestWarning, AlgorithmMa... | [
"timeeval_experiments.generator.algorithm_parsing._parse_readme",
"tempfile.TemporaryDirectory",
"timeeval_experiments.generator.algorithm_parsing._parse_manifest",
"pathlib.Path",
"timeeval_experiments.generator.algorithm_parsing.AlgorithmLoader",
"json.dump"
] | [((844, 875), 'timeeval_experiments.generator.algorithm_parsing.AlgorithmLoader', 'AlgorithmLoader', (['self.repo_path'], {}), '(self.repo_path)\n', (859, 875), False, 'from timeeval_experiments.generator.algorithm_parsing import AlgorithmLoader, _parse_readme, _parse_manifest\n'), ((2750, 2779), 'tempfile.TemporaryDir... |
import setuptools
PACKAGE_NAME='ppline'
PACKAGE_AUTHOR='5x12'
PACKAGE_AUTHOR_EMAIL='<EMAIL>'
PACKAGE_DESCR='Pipeline framework.'
try:
from ppline.version import __version__ as version
except ImportError:
exec(f'from {PACKAGE_NAME}.version import __version__ as version')
with open('README.md', 'r') as f: long_... | [
"setuptools.find_packages"
] | [((696, 722), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (720, 722), False, 'import setuptools\n')] |
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
X = [1, 1, 2, 2]
Y = [3, 4, 4, 3]
Z = [1, 2, 1, 1]
ax.plot_trisurf(X, Y, Z)
plt.show() | [
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show"
] | [((105, 117), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (115, 117), True, 'import matplotlib.pyplot as plt\n'), ((243, 253), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (251, 253), True, 'import matplotlib.pyplot as plt\n')] |
from functools import partial
from textwrap import dedent
from io import StringIO
import pytest
import pandas.testing as pdtest
import numpy
import pandas
from wqio.utils import misc
from wqio.tests import helpers
@pytest.fixture
def basic_data():
testcsv = """\
Date,A,B,C,D
X,1,2,3,4
Y,5,6,7,8
... | [
"pandas.read_csv",
"wqio.utils.misc.expand_columns",
"wqio.utils.misc.categorize_columns",
"pandas.testing.assert_frame_equal",
"pandas.MultiIndex.from_tuples",
"numpy.arange",
"wqio.utils.misc.redefine_index_level",
"pandas.MultiIndex.from_product",
"textwrap.dedent",
"pandas.testing.assert_index... | [((1561, 1602), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""L1"""', "[0, 'loc']"], {}), "('L1', [0, 'loc'])\n", (1584, 1602), False, 'import pytest\n'), ((1604, 1647), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""L2"""', "[2, 'units']"], {}), "('L2', [2, 'units'])\n", (1627, 1647), False,... |
# coding=utf-8
# *** WARNING: this file was generated by crd2pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__all__ = [
'... | [
"pulumi.getter",
"pulumi.set",
"pulumi.get"
] | [((2387, 2426), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""analyzeImageCount"""'}), "(name='analyzeImageCount')\n", (2400, 2426), False, 'import pulumi\n'), ((2709, 2750), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""analyzeK8SResources"""'}), "(name='analyzeK8SResources')\n", (2722, 2750), False, 'impo... |
import numpy as np
from scipy import signal
from golem import DataSet
from golem.nodes import BaseNode
from psychic.utils import get_samplerate
class Filter(BaseNode):
def __init__(self, filt_design_func):
'''
Forward-backward filtering node. filt_design_func is a function that takes
the sample rate as a... | [
"psychic.utils.get_samplerate",
"numpy.clip",
"numpy.hstack",
"scipy.signal.filtfilt",
"numpy.sort",
"scipy.signal.lfilter",
"numpy.zeros",
"numpy.linspace",
"golem.DataSet",
"golem.nodes.BaseNode.__init__",
"numpy.atleast_1d"
] | [((388, 411), 'golem.nodes.BaseNode.__init__', 'BaseNode.__init__', (['self'], {}), '(self)\n', (405, 411), False, 'from golem.nodes import BaseNode\n'), ((490, 507), 'psychic.utils.get_samplerate', 'get_samplerate', (['d'], {}), '(d)\n', (504, 507), False, 'from psychic.utils import get_samplerate\n'), ((772, 797), 'g... |
from pathlib import Path
import configparser
from logger import logger
def change_config(**options):
"""takes arbitrary keyword arguments and
writes their values into the config"""
# overwrite values
for k, v in options.items():
config.set('root', k, v)
# write back, but without the mand... | [
"configparser.RawConfigParser",
"pathlib.Path"
] | [((865, 895), 'configparser.RawConfigParser', 'configparser.RawConfigParser', ([], {}), '()\n', (893, 895), False, 'import configparser\n'), ((775, 792), 'pathlib.Path', 'Path', (['"""../config"""'], {}), "('../config')\n", (779, 792), False, 'from pathlib import Path\n'), ((719, 733), 'pathlib.Path', 'Path', (['__file... |
# external modules
import unittest
import tempfile
import shutil
import numpy as num
# ANUGA modules
from anuga.shallow_water.shallow_water_domain import Domain
from anuga.coordinate_transforms.geo_reference import Geo_reference
from anuga.file.sww import Write_sww, SWW_file
from anuga.abstract_2d_finite_volumes.gene... | [
"anuga.abstract_2d_finite_volumes.mesh_factory.rectangular",
"numpy.allclose",
"unittest.makeSuite",
"anuga.file.netcdf.NetCDFFile",
"anuga.coordinate_transforms.geo_reference.Geo_reference",
"numpy.ascontiguousarray",
"anuga.abstract_2d_finite_volumes.generic_boundary_conditions.Transmissive_boundary",... | [((10409, 10447), 'unittest.makeSuite', 'unittest.makeSuite', (['Test_2Pts', '"""test_"""'], {}), "(Test_2Pts, 'test_')\n", (10427, 10447), False, 'import unittest\n'), ((10461, 10486), 'unittest.TextTestRunner', 'unittest.TextTestRunner', ([], {}), '()\n', (10484, 10486), False, 'import unittest\n'), ((2812, 2834), 'a... |
from django.contrib import admin
from cbe.party.models import Individual, Organisation
from sport.models import Competition
from compete.models import Team, TeamFixture,IndividualFixture, Fixture, Entry
from compete.models import EventTemplate, PointsEntry
from compete.models import Position, CompetitionRound
class... | [
"django.contrib.admin.site.register"
] | [((2396, 2421), 'django.contrib.admin.site.register', 'admin.site.register', (['Team'], {}), '(Team)\n', (2415, 2421), False, 'from django.contrib import admin\n'), ((2422, 2448), 'django.contrib.admin.site.register', 'admin.site.register', (['Entry'], {}), '(Entry)\n', (2441, 2448), False, 'from django.contrib import ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import datetime
class Migration(migrations.Migration):
dependencies = [
('cpovc_forms', '0021_auto_20190712_1506'),
]
operations = [
migrations.RenameField(
model_name='o... | [
"datetime.datetime",
"django.db.models.DateField",
"django.db.models.DateTimeField",
"django.db.migrations.RemoveField",
"django.db.migrations.RenameField",
"django.db.models.CharField"
] | [((271, 372), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""ovchivmanagement"""', 'old_name': '"""Adherence"""', 'new_name': '"""adherence"""'}), "(model_name='ovchivmanagement', old_name='Adherence',\n new_name='adherence')\n", (293, 372), False, 'from django.db import migrat... |
# -*- coding: utf-8 -*-
import datetime
from app import db
from sqlalchemy import UniqueConstraint, ForeignKey
class Account(db.Model):
# Is used to save accounting accounts
__tablename__ = 'acc_accounts'
id = db.Column(db.Integer, db.Identity(start=1), primary_key=True)
code = db.Column(db.String, n... | [
"app.db.Identity",
"sqlalchemy.ForeignKey",
"sqlalchemy.UniqueConstraint",
"datetime.datetime.now",
"app.db.Column",
"app.db.relationship"
] | [((298, 334), 'app.db.Column', 'db.Column', (['db.String'], {'nullable': '(False)'}), '(db.String, nullable=False)\n', (307, 334), False, 'from app import db\n'), ((346, 382), 'app.db.Column', 'db.Column', (['db.String'], {'nullable': '(False)'}), '(db.String, nullable=False)\n', (355, 382), False, 'from app import db\... |
import logging
from logging import Logger
class ClassWithLogger:
_created = False
_logger: Logger = None
_logger_base_name: str = "GreenJon902IsPog"
_logger_name_stack: list[str]
def _create_logger(self):
self._logger = logging.getLogger(self._logger_base_name)
self._created = Tr... | [
"logging.getLogger",
"logger.pop_logger_name",
"logger.set_logger_name",
"logger.push_logger_name",
"logger.log_info"
] | [((2989, 3031), 'logger.log_info', 'logger.log_info', (['"""I should be called Test"""'], {}), "('I should be called Test')\n", (3004, 3031), False, 'import logger\n'), ((3037, 3068), 'logger.set_logger_name', 'logger.set_logger_name', (['"""Test2"""'], {}), "('Test2')\n", (3059, 3068), False, 'import logger\n'), ((307... |
"""Validate integration translation files."""
import json
from typing import Dict
import voluptuous as vol
from voluptuous.humanize import humanize_error
from .model import Integration
def data_entry_schema(*, require_title: bool, require_step_title: bool):
"""Generate a data entry schema."""
step_title_cla... | [
"voluptuous.humanize.humanize_error",
"voluptuous.Required",
"voluptuous.Optional"
] | [((412, 438), 'voluptuous.Optional', 'vol.Optional', (['"""flow_title"""'], {}), "('flow_title')\n", (424, 438), True, 'import voluptuous as vol\n'), ((453, 473), 'voluptuous.Required', 'vol.Required', (['"""step"""'], {}), "('step')\n", (465, 473), True, 'import voluptuous as vol\n'), ((677, 698), 'voluptuous.Optional... |
"""
* @author 孟子喻
* @time 2020.6.2
* @file HMM.py
"""
import numpy as np
class HMM():
def __init__(self, A, B, Pi):
self.A = A # 状态转移概率矩阵
self.B = B # 观测概率矩阵
self.Pi = Pi # 初始状态序列
def forward(self, sequence, t):
"""计算前向概率
:param t 观测时间
... | [
"numpy.ones",
"numpy.argmax",
"numpy.max",
"numpy.sum",
"numpy.array",
"numpy.zeros"
] | [((2430, 2464), 'numpy.array', 'np.array', (['[0, 1, 0, 0, 1, 0, 1, 1]'], {}), '([0, 1, 0, 0, 1, 0, 1, 1])\n', (2438, 2464), True, 'import numpy as np\n'), ((2500, 2561), 'numpy.array', 'np.array', (['[[0.5, 0.1, 0.4], [0.3, 0.5, 0.2], [0.2, 0.2, 0.6]]'], {}), '([[0.5, 0.1, 0.4], [0.3, 0.5, 0.2], [0.2, 0.2, 0.6]])\n', ... |
"""Forms for the notifications app."""
# pylint: disable=no-init,unused-import
from django import forms
from django.forms import widgets
from django.forms.models import modelformset_factory
from open_connect.notifications.models import Subscription
class SubscriptionForm(forms.ModelForm):
"""Form for creating/e... | [
"django.forms.models.modelformset_factory",
"django.forms.widgets.RadioSelect",
"open_connect.notifications.models.Subscription.objects.filter"
] | [((709, 797), 'django.forms.models.modelformset_factory', 'modelformset_factory', (['Subscription'], {'form': 'SubscriptionForm', 'extra': '(0)', 'can_delete': '(False)'}), '(Subscription, form=SubscriptionForm, extra=0,\n can_delete=False)\n', (729, 797), False, 'from django.forms.models import modelformset_factory... |
#!/usr/bin/env python
# Author: <NAME> <<EMAIL>.> Reykjavik University
# Description: Create tsv version of phonemes and allow input from the command
# line
from fairseq_g2p import FairseqGraphemeToPhoneme as fs_g2p
def pron_to_tsv(prons):
"""
pron_to_tsv gives the IPA phonetic transcriptions of the given wor... | [
"fairseq_g2p.FairseqGraphemeToPhoneme",
"argparse.ArgumentParser"
] | [((572, 580), 'fairseq_g2p.FairseqGraphemeToPhoneme', 'fs_g2p', ([], {}), '()\n', (578, 580), True, 'from fairseq_g2p import FairseqGraphemeToPhoneme as fs_g2p\n'), ((923, 1010), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""\n Create grapheme to phoneme tsv"""'}), '(description=... |
"""Set advance pay to 0 if under threshold.
Revision ID: 1654373c7899
Revises: <KEY>
Create Date: 2015-03-27 08:15:43.051506
"""
# revision identifiers, used by Alembic.
from alembic import op
revision = '1654373c7899'
down_revision = u'<KEY>'
def upgrade():
op.execute("""UPDATE energyvalue SET advance_pay = ... | [
"alembic.op.execute"
] | [((269, 397), 'alembic.op.execute', 'op.execute', (['"""UPDATE energyvalue SET advance_pay = 0 WHERE year = 2014\n and advance_pay < 100000;"""'], {}), '(\n """UPDATE energyvalue SET advance_pay = 0 WHERE year = 2014\n and advance_pay < 100000;"""\n )\n', (279, 397), False, 'from... |
# Generated by Django 3.2.5 on 2021-08-05 13:01
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('home', '0015_auto_20210805_1254'),
]
operations = [
migrations.RenameModel(
old_name='Logs',
new_name='Log',
),
... | [
"django.db.migrations.RenameModel"
] | [((224, 279), 'django.db.migrations.RenameModel', 'migrations.RenameModel', ([], {'old_name': '"""Logs"""', 'new_name': '"""Log"""'}), "(old_name='Logs', new_name='Log')\n", (246, 279), False, 'from django.db import migrations\n')] |
import bpy
import bmesh
import operator
import mathutils
from mathutils import Vector
import imp
from . import op_modifier_apply
imp.reload(op_modifier_apply)
from . import modifiers
imp.reload(modifiers)
class Settings(bpy.types.PropertyGroup):
active: bpy.props.BoolProperty (
name="Active",
default=False
)... | [
"bpy.props.BoolProperty",
"imp.reload"
] | [((131, 160), 'imp.reload', 'imp.reload', (['op_modifier_apply'], {}), '(op_modifier_apply)\n', (141, 160), False, 'import imp\n'), ((186, 207), 'imp.reload', 'imp.reload', (['modifiers'], {}), '(modifiers)\n', (196, 207), False, 'import imp\n'), ((260, 312), 'bpy.props.BoolProperty', 'bpy.props.BoolProperty', ([], {'n... |
'''
Compute classification metrics for the preference learning models. Plot the predictions.
Created on 21 Oct 2016
@author: simpson
'''
import logging
import numpy as np
from matplotlib import pyplot as plt
from sklearn.metrics import f1_score, roc_auc_score, log_loss, accuracy_score
from scipy.stats import kendallt... | [
"numpy.log",
"sklearn.metrics.roc_auc_score",
"logging.info",
"numpy.arange",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"numpy.concatenate",
"numpy.round",
"scipy.stats.kendalltau",
"numpy.abs",
"matplotlib.pyplot.savefig",
"numpy.any",
"sklearn.metrics.accuracy_score",
"matplo... | [((840, 884), 'logging.info', 'logging.info', (['"""Task C2/C4, accuracy metrics"""'], {}), "('Task C2/C4, accuracy metrics')\n", (852, 884), False, 'import logging\n'), ((3421, 3474), 'logging.info', 'logging.info', (['"""Task C9/10, plotting accuracy metrics"""'], {}), "('Task C9/10, plotting accuracy metrics')\n", (... |
import yaml
import re
with open("test-data.yml") as f:
tests = yaml.load(f)
for test in tests:
pattern = re.compile(test["regex"])
against = test["against"]
matches = test.get("matches", None)
captures = test.get("captures", None)
replacement = test.get("replacement", None)
invalid_replace... | [
"re.sub",
"yaml.load",
"re.compile"
] | [((68, 80), 'yaml.load', 'yaml.load', (['f'], {}), '(f)\n', (77, 80), False, 'import yaml\n'), ((115, 140), 're.compile', 're.compile', (["test['regex']"], {}), "(test['regex'])\n", (125, 140), False, 'import re\n'), ((874, 911), 're.sub', 're.sub', (['pattern', 'replacement', 'against'], {}), '(pattern, replacement, a... |
from multiprocessing import cpu_count
import click
from loguru import logger
from reprobench.console.decorators import server_info, common, use_tunneling
from .manager import LocalManager
@click.command("local")
@click.option("-w", "--num-workers", type=int, default=cpu_count(), show_default=True)
@click.option(
... | [
"click.Choice",
"click.option",
"multiprocessing.cpu_count",
"click.Path",
"click.command"
] | [((194, 216), 'click.command', 'click.command', (['"""local"""'], {}), "('local')\n", (207, 216), False, 'import click\n'), ((405, 456), 'click.option', 'click.option', (['"""-r"""', '"""--repeat"""'], {'type': 'int', 'default': '(1)'}), "('-r', '--repeat', type=int, default=1)\n", (417, 456), False, 'import click\n'),... |
#!/usr/bin/env python3
import sys, winrm
def handle_args():
USAGE="Usage: %s {host} {user} {pass}" % (sys.argv[0])
if len(sys.argv) != 4:
print(USAGE)
sys.exit(-1)
WINRM_HOST=sys.argv[1]
WINRM_USER=sys.argv[2]
WINRM_PASS=sys.argv[3]
return WINRM_HOST, WINRM_USER, WINRM_PASS
def connect_to_serv... | [
"winrm.Session",
"sys.exit"
] | [((339, 368), 'winrm.Session', 'winrm.Session', (['h'], {'auth': '(u, p)'}), '(h, auth=(u, p))\n', (352, 368), False, 'import sys, winrm\n'), ((166, 178), 'sys.exit', 'sys.exit', (['(-1)'], {}), '(-1)\n', (174, 178), False, 'import sys, winrm\n'), ((451, 462), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (459, 462),... |
from absl import logging
import os
from lib import dataset
from libs import settings
import tensorflow as tf
def generate_tf_record(
data_dir,
raw_data=False,
tfrecord_path="serialized_dataset",
num_shards=8):
teacher_sett = settings.Settings(use_student_settings=False)
student_se... | [
"tensorflow.data.experimental.group_by_window",
"tensorflow.data.TFRecordDataset",
"tensorflow.data.Dataset.from_tensors",
"libs.settings.Settings",
"tensorflow.data.experimental.TFRecordWriter",
"tensorflow.io.parse_single_example",
"tensorflow.py_function",
"tensorflow.data.Options",
"tensorflow.i... | [((262, 307), 'libs.settings.Settings', 'settings.Settings', ([], {'use_student_settings': '(False)'}), '(use_student_settings=False)\n', (279, 307), False, 'from libs import settings\n'), ((325, 369), 'libs.settings.Settings', 'settings.Settings', ([], {'use_student_settings': '(True)'}), '(use_student_settings=True)\... |
# Lint as: python2, python3
# Copyright 2020 Google LLC
# 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
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law ... | [
"tensorflow.tile",
"tensorflow.equal",
"tensorflow.shape",
"tensorflow.pad",
"tensorflow.reduce_sum",
"tensorflow.compat.v1.reverse_v2",
"tensorflow.control_dependencies",
"tensorflow.ones_like",
"tensorflow.image.random_saturation",
"tensorflow.compat.v2.image.resize",
"tensorflow.cast",
"ten... | [((1731, 1752), 'tensorflow.random.uniform', 'tf.random.uniform', (['[]'], {}), '([])\n', (1748, 1752), True, 'import tensorflow as tf\n'), ((2040, 2073), 'tensorflow.less_equal', 'tf.less_equal', (['random_value', 'prob'], {}), '(random_value, prob)\n', (2053, 2073), True, 'import tensorflow as tf\n'), ((2086, 2133), ... |