code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import src.constants as constants
import src.response as response
import src.validation as validation
from datetime import datetime as dt
from fastjsonschema import JsonSchemaException
from flask import Flask, request
from json import dumps
from logging import getLogger
from math import ceil
from operator import itemg... | [
"logging.getLogger",
"src.validation.validate",
"fastjsonschema.JsonSchemaException",
"math.ceil",
"flask.Flask",
"datetime.datetime.strptime",
"json.dumps",
"src.response.ok",
"src.response.error",
"re.findall"
] | [((407, 426), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (416, 426), False, 'from logging import getLogger\n'), ((462, 477), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (467, 477), False, 'from flask import Flask, request\n'), ((1199, 1217), 'src.response.ok', 'response.ok', (... |
#!/usr/bin/python3 -u
import logging
import os
import sys
import time
import struct
from typing import Tuple, Any
from configparser import ConfigParser
from argparse import ArgumentParser, Namespace
from collections.abc import Mapping
from pathlib import Path
from attiny_i2c import ATTiny
#from attiny_i2c_new import A... | [
"logging.getLogger",
"configparser.ConfigParser",
"argparse.ArgumentParser",
"logging.debug",
"pathlib.Path",
"logging.Handler.__init__",
"logging.warning",
"time.sleep",
"os.path.isfile",
"attiny_i2c.ATTiny",
"os.system",
"logging.info",
"logging.error"
] | [((2305, 2394), 'attiny_i2c.ATTiny', 'ATTiny', (['config[Config.I2C_BUS]', 'config[Config.I2C_ADDRESS]', '_time_const', '_num_retries'], {}), '(config[Config.I2C_BUS], config[Config.I2C_ADDRESS], _time_const,\n _num_retries)\n', (2311, 2394), False, 'from attiny_i2c import ATTiny\n'), ((2849, 2882), 'logging.info', ... |
#-------by HYH -------#
import sys
sys.path.append('D:\\Python File\\robot\\P13')
import P13
import numpy as np
x=np.array([7,38,4,23,18])
x2=np.square(x)
x2mu=P13.compMean(x2)
xmu=P13.compMean(x)
xvar=P13.compVariance(x)
print('The Variance of X \t=%s \n'%xvar)
print('E[X^2]-E[X]^2 \t\t=%s \n'%(x2mu-np.square(xmu))) | [
"P13.compVariance",
"P13.compMean",
"numpy.square",
"numpy.array",
"sys.path.append"
] | [((35, 81), 'sys.path.append', 'sys.path.append', (['"""D:\\\\Python File\\\\robot\\\\P13"""'], {}), "('D:\\\\Python File\\\\robot\\\\P13')\n", (50, 81), False, 'import sys\n'), ((114, 142), 'numpy.array', 'np.array', (['[7, 38, 4, 23, 18]'], {}), '([7, 38, 4, 23, 18])\n', (122, 142), True, 'import numpy as np\n'), ((1... |
#! /usr/bin/python3
#
# Copyright (c) 2017 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
"""
Create and remove network tunnels to the target via the server
--------------------------------------------------------------
"""
import pprint
from . import msgid_c
import commonl
from . import tc
class tunne... | [
"commonl.argparser_add_aka"
] | [((13009, 13071), 'commonl.argparser_add_aka', 'commonl.argparser_add_aka', (['argsp', '"""tunnel-rm"""', '"""tunnel-remove"""'], {}), "(argsp, 'tunnel-rm', 'tunnel-remove')\n", (13034, 13071), False, 'import commonl\n'), ((13076, 13138), 'commonl.argparser_add_aka', 'commonl.argparser_add_aka', (['argsp', '"""tunnel-r... |
from boto import boto3
def upload_file(file_name, bucket):
obj_name=file_name
s3_client = boto3.client('s3')
response = s3_client.upload_file(file_name, bucket, obj_name)
return response
def download_file(file_name,bucket):
s3=boto3.resource('s3')
output = f'downloads/{file_name}'
s3.Bu... | [
"boto.boto3.resource",
"boto.boto3.client"
] | [((102, 120), 'boto.boto3.client', 'boto3.client', (['"""s3"""'], {}), "('s3')\n", (114, 120), False, 'from boto import boto3\n'), ((252, 272), 'boto.boto3.resource', 'boto3.resource', (['"""s3"""'], {}), "('s3')\n", (266, 272), False, 'from boto import boto3\n'), ((401, 419), 'boto.boto3.client', 'boto3.client', (['""... |
# ETL:
# Extract: selecting the right data and obtaining it
# Transform: data cleansing is applied to that data while it sits in a staging area
# Loading: loading of the transformed data into the data store or a data warehouse
import numpy as np
import pandas as pd
import re
from scripts.utils_date_features import *... | [
"re.findall",
"pandas.merge",
"pandas.to_datetime",
"pandas.read_csv"
] | [((570, 638), 'pandas.read_csv', 'pd.read_csv', (['"""../data/effectifs_ecolesnantes.csv"""'], {'header': '(0)', 'sep': '""";"""'}), "('../data/effectifs_ecolesnantes.csv', header=0, sep=';')\n", (581, 638), True, 'import pandas as pd\n'), ((730, 803), 'pandas.read_csv', 'pd.read_csv', (['"""../data/appariement_ecoles_... |
from wsgiref.simple_server import make_server
import traceback
import base64
from io import BytesIO
from PIL import Image
from api import get_result
import json
import os
def base64_to_image(base64_str):
byte_data = base64.b64decode(base64_str)
image_data = BytesIO(byte_data)
img = Image.open(image_data)
... | [
"PIL.Image.open",
"json.dumps",
"io.BytesIO",
"base64.b64decode",
"api.get_result",
"traceback.print_exc",
"wsgiref.simple_server.make_server"
] | [((222, 250), 'base64.b64decode', 'base64.b64decode', (['base64_str'], {}), '(base64_str)\n', (238, 250), False, 'import base64\n'), ((268, 286), 'io.BytesIO', 'BytesIO', (['byte_data'], {}), '(byte_data)\n', (275, 286), False, 'from io import BytesIO\n'), ((297, 319), 'PIL.Image.open', 'Image.open', (['image_data'], {... |
# coding=utf-8
import logging
import pytest
from conftest import (
address, message
)
from mock import patch
from rfc5424logging import Rfc5424SysLogHandler
@pytest.mark.parametrize("handler_kwargs,expected", [
(
{'address': address, "utc_timestamp": True},
b'<14>1 2000-01-01T11:11:11.111111... | [
"mock.patch.object",
"pytest.mark.parametrize",
"rfc5424logging.Rfc5424SysLogHandler",
"logging.info"
] | [((166, 535), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""handler_kwargs,expected"""', "[({'address': address, 'utc_timestamp': True},\n b'<14>1 2000-01-01T11:11:11.111111+00:00 testhostname root 111 - - \\xef\\xbb\\xbfThis is an interesting message'\n ), ({'address': address},\n b'<14>1 2000-0... |
import nltk, re, pprint
from nltk import word_tokenize
from urllib import request
url = "http://www.gutenberg.org/files/2554/2554-0.txt"
response = request.urlopen(url)
raw = response.read().decode('utf8')
print(type(raw))
print(len(raw))
print(raw[:75])
tokens = word_tokenize(raw)
print(type(tokens))
print(tokens[:1... | [
"urllib.request.urlopen",
"nltk.word_tokenize"
] | [((149, 169), 'urllib.request.urlopen', 'request.urlopen', (['url'], {}), '(url)\n', (164, 169), False, 'from urllib import request\n'), ((266, 284), 'nltk.word_tokenize', 'word_tokenize', (['raw'], {}), '(raw)\n', (279, 284), False, 'from nltk import word_tokenize\n')] |
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from genera_tablas import Club
from genera_tablas import Jugador
from configuracion import cadena_base_datos
import csv
engine = create_engine(cadena_base_datos)
Session = sessionmaker(bind=engine)
session = Session()
archivo_club = open... | [
"sqlalchemy.orm.sessionmaker",
"sqlalchemy.create_engine",
"csv.reader"
] | [((210, 242), 'sqlalchemy.create_engine', 'create_engine', (['cadena_base_datos'], {}), '(cadena_base_datos)\n', (223, 242), False, 'from sqlalchemy import create_engine\n'), ((254, 279), 'sqlalchemy.orm.sessionmaker', 'sessionmaker', ([], {'bind': 'engine'}), '(bind=engine)\n', (266, 279), False, 'from sqlalchemy.orm ... |
"""
See also:
https://github.com/danieljtait/jax_xla_adventures/blob/master/pybind11_register_custom_call/test.py
"""
import numpy as np
from jaxlib import xla_client
from . import _signal
for _name, _value in _signal.registrations().items():
xla_client.register_custom_call_target(_name, _value, platform="cpu")
de... | [
"jaxlib.xla_client.register_custom_call_target",
"numpy.frombuffer",
"numpy.dtype"
] | [((247, 316), 'jaxlib.xla_client.register_custom_call_target', 'xla_client.register_custom_call_target', (['_name', '_value'], {'platform': '"""cpu"""'}), "(_name, _value, platform='cpu')\n", (285, 316), False, 'from jaxlib import xla_client\n'), ((579, 594), 'numpy.dtype', 'np.dtype', (['dtype'], {}), '(dtype)\n', (58... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | [
"tests.ut.python.utils.mock_net.Net",
"mindspore.dataset.GeneratorDataset",
"mindspore.nn.SoftmaxCrossEntropyWithLogits",
"mindspore.context.set_context",
"mindspore.train.Model",
"mindarmour.privacy.evaluation.MembershipInference",
"numpy.random.randint",
"numpy.random.randn"
] | [((896, 940), 'mindspore.context.set_context', 'context.set_context', ([], {'mode': 'context.GRAPH_MODE'}), '(mode=context.GRAPH_MODE)\n', (915, 940), True, 'import mindspore.context as context\n'), ((1549, 1554), 'tests.ut.python.utils.mock_net.Net', 'Net', ([], {}), '()\n', (1552, 1554), False, 'from tests.ut.python.... |
from __future__ import annotations
from typing import *
from dataclasses import dataclass, field, replace
from collections import defaultdict
from contextlib import contextmanager
from flask import jsonify, request
from flask.wrappers import Response
from sorcery import spell, no_spells # type: ignore
import abc
impor... | [
"sorcery.no_spells",
"json.dumps",
"dataclasses.dataclass",
"flask.request.cookies.get",
"collections.defaultdict",
"dataclasses.replace",
"dataclasses.field",
"flask.jsonify"
] | [((738, 752), 'sorcery.no_spells', 'no_spells', (['lhs'], {}), '(lhs)\n', (747, 752), False, 'from sorcery import spell, no_spells\n'), ((806, 828), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (815, 828), False, 'from dataclasses import dataclass, field, replace\n'), ((1199, 122... |
from typing import Any, BinaryIO, Dict, List, Optional, TextIO, Tuple, Type, TypeVar, cast
import attr
from ..models.historical_deployment_change import HistoricalDeploymentChange
from ..models.historical_deployment_metadata import HistoricalDeploymentMetadata
from ..types import UNSET, Unset
T = TypeVar("T", bound=... | [
"attr.s",
"attr.ib",
"typing.TypeVar"
] | [((301, 348), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {'bound': '"""HistoricalDeploymentDelta"""'}), "('T', bound='HistoricalDeploymentDelta')\n", (308, 348), False, 'from typing import Any, BinaryIO, Dict, List, Optional, TextIO, Tuple, Type, TypeVar, cast\n'), ((352, 377), 'attr.s', 'attr.s', ([], {'auto_attribs':... |
import numpy as np
import os
from os import path as osp
import pybullet as p
import pybullet_data as pb_data
from pybullet_utils import bullet_client
current_file_path = osp.abspath(__file__)
def get_ycb_file_path(object_name: str):
""" Return the abspath of the urdf file given the object name (be aware of the u... | [
"os.path.dirname",
"numpy.array",
"pybullet.getQuaternionFromEuler",
"numpy.random.uniform",
"os.path.abspath"
] | [((172, 193), 'os.path.abspath', 'osp.abspath', (['__file__'], {}), '(__file__)\n', (183, 193), True, 'from os import path as osp\n'), ((442, 472), 'os.path.dirname', 'osp.dirname', (['current_file_path'], {}), '(current_file_path)\n', (453, 472), True, 'from os import path as osp\n'), ((1162, 1209), 'numpy.array', 'np... |
import json
import boto3
from datetime import datetime
from base_wrapper import BaseWrapper
import time
import os
region = os.environ['AWS_REGION']
def get_code_path():
return "/" + "/".join(__file__.split('/')[:-1])
class GlueWrapper(BaseWrapper):
"""
This class handles all anonymization for tabular d... | [
"datetime.datetime.now",
"json.dumps",
"boto3.client",
"time.sleep"
] | [((818, 932), 'boto3.client', 'boto3.client', (['"""glue"""', 'region'], {'aws_access_key_id': 'aws_access_key_id', 'aws_secret_access_key': 'aws_secret_access_key'}), "('glue', region, aws_access_key_id=aws_access_key_id,\n aws_secret_access_key=aws_secret_access_key)\n", (830, 932), False, 'import boto3\n'), ((100... |
#!/usr/bin/env python3
import numpy as np
from matplotlib import pyplot as plt
import collections
def PolyCoefficients(x, coeffs):
""" Returns a polynomial for ``x`` values for the ``coeffs`` provided.
The coefficients must be in ascending order (``x**0`` to ``x**o``).
"""
o = len(coeffs)
# prin... | [
"matplotlib.pyplot.title",
"numpy.linspace",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show"
] | [((1626, 1636), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1634, 1636), True, 'from matplotlib import pyplot as plt\n'), ((1352, 1379), 'matplotlib.pyplot.subplot', 'plt.subplot', (['(4)', '(3)', 'position'], {}), '(4, 3, position)\n', (1363, 1379), True, 'from matplotlib import pyplot as plt\n'), ((1591,... |
import cherrypy
import jsonschema
from girder.api import access
from girder import events, plugin
from girder.exceptions import RestException, ValidationException
from girder.models.setting import Setting
from girder.utility.setting_utilities import validator
from netaddr import AddrFormatError, IPAddress, IPNetwork
P... | [
"girder.exceptions.RestException",
"netaddr.IPAddress",
"girder.models.setting.Setting",
"jsonschema.validate",
"girder.events.bind",
"girder.exceptions.ValidationException",
"girder.utility.setting_utilities.validator",
"netaddr.IPNetwork"
] | [((467, 502), 'girder.utility.setting_utilities.validator', 'validator', (['PLUGIN_SETTING_WHITELIST'], {}), '(PLUGIN_SETTING_WHITELIST)\n', (476, 502), False, 'from girder.utility.setting_utilities import validator\n'), ((1035, 1072), 'netaddr.IPAddress', 'IPAddress', (['cherrypy.request.remote.ip'], {}), '(cherrypy.r... |
# Demo of a naive cart-pole control algorithm
import gym
import numpy as np
def naive_policy(obsv):
# The cart-pole simulator has four states: x, x_dot, theta, theta_dot
# In the simulator, action = 1 accelerates right, action = 0 accelerates left
theta = obsv[2]
# If the angle is positive (clockwise d... | [
"numpy.max",
"numpy.mean",
"gym.make",
"numpy.min"
] | [((483, 506), 'gym.make', 'gym.make', (['"""CartPole-v0"""'], {}), "('CartPole-v0')\n", (491, 506), False, 'import gym\n'), ((1038, 1053), 'numpy.mean', 'np.mean', (['totals'], {}), '(totals)\n', (1045, 1053), True, 'import numpy as np\n'), ((1067, 1081), 'numpy.min', 'np.min', (['totals'], {}), '(totals)\n', (1073, 10... |
#!/usr/bin/env python3
# -*- CoDing: utf-8 -*-
"""
Created on May 22 2019
Last Update May 22 2019
@author: simonvanvliet
Department of Zoology
University of Britisch Columbia
<EMAIL>
This recreates the data and figure for figure 2
By default data is loaded unless parameters have changes, to rerun model set override_... | [
"mls_general_code.calc_timescale",
"pathlib.Path",
"mls_general_code.set_fig_size_cm",
"matplotlib.cycler",
"joblib.Parallel",
"numpy.nanmean",
"numpy.linspace",
"matplotlib.style.use",
"matplotlib.pyplot.figure",
"matplotlib.rc",
"numpy.vstack",
"matplotlib.pyplot.tight_layout",
"datetime.d... | [((681, 700), 'pathlib.Path', 'Path', (['"""Data_Paper/"""'], {}), "('Data_Paper/')\n", (685, 700), False, 'from pathlib import Path\n'), ((714, 736), 'pathlib.Path', 'Path', (['"""Figures_Paper/"""'], {}), "('Figures_Paper/')\n", (718, 736), False, 'from pathlib import Path\n'), ((1597, 1627), 'mls_general_code.calc_t... |
# Flask configurations
import os
import sys
sys.path.append(os.path.dirname(__file__)+'/AI')
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
| [
"os.path.dirname"
] | [((60, 85), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (75, 85), False, 'import os\n')] |
import airbnb
import airbnb_secrets
import csv
items=1
output_filename="airbnb_chapelhill.csv"
# Set CSV Header & line format
csv_header = ['City','Latitude','Longitude','Type','Bathrooms','Bedrooms','Public Address','Localized City','Source']
api = airbnb.Api()
# api = airbnb.Api(airbnb_secrets.login, airbnb_secrets... | [
"airbnb.Api",
"csv.writer"
] | [((252, 264), 'airbnb.Api', 'airbnb.Api', ([], {}), '()\n', (262, 264), False, 'import airbnb\n'), ((337, 389), 'airbnb.Api', 'airbnb.Api', ([], {'access_token': 'airbnb_secrets.access_token'}), '(access_token=airbnb_secrets.access_token)\n', (347, 389), False, 'import airbnb\n'), ((454, 494), 'csv.writer', 'csv.writer... |
"""
# Copyright 2020 <NAME>, Inc. 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
Author: <NAME>, <EMAIL>
Status: Active
"""... | [
"dgl.batch",
"torch.Tensor"
] | [((1926, 1948), 'dgl.batch', 'dgl.batch', (['batch_graph'], {}), '(batch_graph)\n', (1935, 1948), False, 'import dgl\n'), ((2017, 2046), 'torch.Tensor', 'torch.Tensor', (['batch_label_ids'], {}), '(batch_label_ids)\n', (2029, 2046), False, 'import torch\n'), ((1570, 1602), 'torch.Tensor', 'torch.Tensor', (["sample['nod... |
from utils.models import LinkedListNode
def merge_two_sorted_lists(l1: LinkedListNode, l2: LinkedListNode) -> LinkedListNode:
temp_head = tail = LinkedListNode(data=0)
while l1 and l2:
if l1.data < l2.data:
tail.next = l1
l1 = l1.next
else:
tail.next = l2
... | [
"utils.models.LinkedListNode"
] | [((151, 173), 'utils.models.LinkedListNode', 'LinkedListNode', ([], {'data': '(0)'}), '(data=0)\n', (165, 173), False, 'from utils.models import LinkedListNode\n'), ((595, 613), 'utils.models.LinkedListNode', 'LinkedListNode', (['(11)'], {}), '(11)\n', (609, 613), False, 'from utils.models import LinkedListNode\n'), ((... |
# encoding: utf-8
from datetime import date, datetime, time
import motor.motor_asyncio
import numpy as np
import pandas as pd
from dateutil.relativedelta import relativedelta
from rqalpha.const import INSTRUMENT_TYPE
from rqalpha.model.instrument import Instrument
from rqalpha.utils.datetime_func import convert_date_t... | [
"dateutil.relativedelta.relativedelta",
"rqalpha.mod.rqalpha_mod_fxdayu_source.data_source.common.CacheMixin.__init__",
"rqalpha.mod.rqalpha_mod_fxdayu_source.utils.asyncio.get_asyncio_event_loop",
"rqalpha.mod.rqalpha_mod_fxdayu_source.utils.converter.DataFrameConverter.empty",
"numpy.searchsorted",
"dat... | [((5985, 6006), 'rqalpha.utils.py2.lru_cache', 'lru_cache', ([], {'maxsize': '(10)'}), '(maxsize=10)\n', (5994, 6006), False, 'from rqalpha.utils.py2 import lru_cache\n'), ((1346, 1369), 'rqalpha.mod.rqalpha_mod_fxdayu_source.share.mongo_handler.MongoHandler', 'MongoHandler', (['mongo_url'], {}), '(mongo_url)\n', (1358... |
import discord
from discord.ext import commands
from discord.commands import slash_command
class Help(commands.Cog):
def __init__(self, bot):
self.bot = bot
@slash_command(description="List all the bot commands")
async def help(self, ctx):
help_embed = discord.Embed(title='BRUHbot all commands', description=... | [
"discord.Embed",
"discord.commands.slash_command"
] | [((165, 219), 'discord.commands.slash_command', 'slash_command', ([], {'description': '"""List all the bot commands"""'}), "(description='List all the bot commands')\n", (178, 219), False, 'from discord.commands import slash_command\n'), ((264, 410), 'discord.Embed', 'discord.Embed', ([], {'title': '"""BRUHbot all comm... |
#!/usr/bin/env python3
from collections import MutableMapping
from bisect import bisect_left, insort_left
from .idstr import idstr
class ListStash(MutableMapping):
"""Simple data structure to hold the stash.
Stash must support a dictionary-like interface mapping positions to
bytes objects. In addition, m... | [
"bisect.insort_left",
"bisect.bisect_left"
] | [((786, 822), 'bisect.bisect_left', 'bisect_left', (['self._store', "(key, b'')"], {}), "(self._store, (key, b''))\n", (797, 822), False, 'from bisect import bisect_left, insort_left\n'), ((1105, 1143), 'bisect.bisect_left', 'bisect_left', (['self._store', "(start, b'')"], {}), "(self._store, (start, b''))\n", (1116, 1... |
import flask
from flask_sqlalchemy import SQLAlchemy
import logging
from sqlalchemy import desc
from sqlalchemy.sql import func
app = flask.Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///subji.db"
db = SQLAlchemy(app)
logger = logging.getLogger()
logging.basicConfig(filename="system.log",
... | [
"logging.getLogger",
"flask_sqlalchemy.SQLAlchemy",
"logging.basicConfig",
"flask.Flask"
] | [((135, 156), 'flask.Flask', 'flask.Flask', (['__name__'], {}), '(__name__)\n', (146, 156), False, 'import flask\n'), ((223, 238), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', (['app'], {}), '(app)\n', (233, 238), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((249, 268), 'logging.getLogger', 'logging.getLogger'... |
"""Test the parse_nftoken_id util."""
from __future__ import annotations
from unittest import TestCase
from xrpl import XRPLException
from xrpl.utils.parse_nftoken_id import parse_nftoken_id
class TestParseNFTokenID(TestCase):
"""Test parse_nftoken_id."""
def test_parse_nftoken_id_successful(self: TestPars... | [
"xrpl.utils.parse_nftoken_id.parse_nftoken_id"
] | [((442, 466), 'xrpl.utils.parse_nftoken_id.parse_nftoken_id', 'parse_nftoken_id', (['nft_id'], {}), '(nft_id)\n', (458, 466), False, 'from xrpl.utils.parse_nftoken_id import parse_nftoken_id\n'), ((881, 905), 'xrpl.utils.parse_nftoken_id.parse_nftoken_id', 'parse_nftoken_id', (['"""ABCD"""'], {}), "('ABCD')\n", (897, 9... |
# Generated by Django 2.2.19 on 2021-12-10 16:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('retention_dashboard', '0012_auto_20211208_1901'),
]
operations = [
migrations.AddField(
model_name='datapoint',
nam... | [
"django.db.models.CharField",
"django.db.models.BooleanField"
] | [((355, 396), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(2)', 'null': '(True)'}), '(max_length=2, null=True)\n', (371, 396), False, 'from django.db import migrations, models\n'), ((516, 550), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)'}), '(default=Fal... |
from datetime import date
from django.forms import CharField, DateInput, Form
from django.utils import translation
from .base import WidgetTest
class DateInputTest(WidgetTest):
widget = DateInput()
def test_render_none(self):
self.check_html(
self.widget, "date", None, html='<input type... | [
"django.forms.DateInput",
"django.utils.translation.override",
"datetime.date",
"django.forms.CharField"
] | [((194, 205), 'django.forms.DateInput', 'DateInput', ([], {}), '()\n', (203, 205), False, 'from django.forms import CharField, DateInput, Form\n'), ((1446, 1475), 'django.utils.translation.override', 'translation.override', (['"""de-at"""'], {}), "('de-at')\n", (1466, 1475), False, 'from django.utils import translation... |
from enum import Enum, unique
from pprint import pprint
from argsloader.units import cdict, cvalue, number, enum, yesno, onoff, positive, interval
@unique
class PolicyType(Enum):
DDPG = 1
@unique
class ActionSpaceType(Enum):
CONTINUOUS = 1
HYBRID = 2
config_loader = cdict(dict(
# (str) RL policy ... | [
"argsloader.units.onoff",
"argsloader.units.positive.int",
"argsloader.units.enum",
"argsloader.units.yesno",
"argsloader.units.number",
"argsloader.units.interval.LR"
] | [((397, 413), 'argsloader.units.enum', 'enum', (['PolicyType'], {}), '(PolicyType)\n', (401, 413), False, 'from argsloader.units import cdict, cvalue, number, enum, yesno, onoff, positive, interval\n'), ((694, 701), 'argsloader.units.yesno', 'yesno', ([], {}), '()\n', (699, 701), False, 'from argsloader.units import cd... |
# -*- coding: utf-8 -*-
# Hikari Examples - A collection of examples for Hikari.
#
# To the extent possible under law, the author(s) have dedicated all copyright
# and related and neighboring rights to this software to the public domain worldwide.
# This software is distributed without any warranty.
#
# You should have... | [
"logging.getLogger",
"rillrate.prime.Slider",
"hikari.GatewayBot",
"rillrate.prime.Selector",
"rillrate.install"
] | [((3790, 3838), 'hikari.GatewayBot', 'hikari.GatewayBot', ([], {'token': "os.environ['BOT_TOKEN']"}), "(token=os.environ['BOT_TOKEN'])\n", (3807, 3838), False, 'import hikari\n'), ((1751, 1781), 'logging.getLogger', 'logging.getLogger', (['"""dashboard"""'], {}), "('dashboard')\n", (1768, 1781), False, 'import logging\... |
import itertools
import logging
import os
import geopandas as gpd
import numpy as np
import pandas as pd
import tqdm
from scipy.spatial import KDTree
from shapely.geometry import LineString, Point, Polygon
from delft3dfmpy.converters import hydamo_to_dflowrr
from delft3dfmpy.core import checks, geometry
from delft... | [
"logging.getLogger",
"delft3dfmpy.io.drrreader.PavedIO",
"delft3dfmpy.io.drrreader.OpenwaterIO",
"delft3dfmpy.io.drrreader.ExternalForcingsIO",
"delft3dfmpy.io.drrreader.UnpavedIO",
"delft3dfmpy.io.drrreader.GreenhouseIO"
] | [((489, 516), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (506, 516), False, 'import logging\n'), ((1429, 1463), 'delft3dfmpy.io.drrreader.ExternalForcingsIO', 'drrreader.ExternalForcingsIO', (['self'], {}), '(self)\n', (1457, 1463), False, 'from delft3dfmpy.io import drrreader\n'), ((... |
import os
import urllib.request
import uuid
import camelot
from streamline.models import Table_PDF
HEADERS = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36"
}
def download_pdf(url, save_path=None):
"""
Simple scrip... | [
"streamline.models.Table_PDF.objects.filter",
"os.path.join",
"uuid.uuid4",
"streamline.models.Table_PDF.objects.create",
"camelot.read_pdf"
] | [((543, 576), 'os.path.join', 'os.path.join', (['save_path', 'pdf_name'], {}), '(save_path, pdf_name)\n', (555, 576), False, 'import os\n'), ((915, 985), 'camelot.read_pdf', 'camelot.read_pdf', (['pdf_path'], {'pages': 'pages', 'flavor': '"""stream"""', 'edge_tol': '(100)'}), "(pdf_path, pages=pages, flavor='stream', e... |
"""
restart_script.py
Copyright 2016 University of Melbourne.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed t... | [
"fourdvar.datadef.UnknownData",
"fourdvar._transform.transform",
"fourdvar.datadef.PhysicalData.from_file",
"os.path.join",
"fourdvar.user_driver.post_process",
"fourdvar.user_driver.cleanup",
"os.path.isfile",
"fourdvar.user_driver.minim"
] | [((1203, 1267), 'os.path.join', 'os.path.join', (['archive_defn.archive_path', 'archive_defn.experiment'], {}), '(archive_defn.archive_path, archive_defn.experiment)\n', (1215, 1267), False, 'import os\n'), ((1735, 1760), 'os.path.isfile', 'os.path.isfile', (['init_path'], {}), '(init_path)\n', (1749, 1760), False, 'im... |
# Tests for subclasses of Immutable
#
# Written by <NAME>
#
import unittest
from immutable import Immutable, ImmutableTuple
class Test1(Immutable):
def __init__(self, a, b):
self.a = a
self.b = b
class Test2(Test1):
def __init__(self, a, b, c):
Test1.__init__(self, a, b)
se... | [
"unittest.main",
"unittest.TestSuite",
"immutable.ImmutableTuple",
"unittest.TestLoader"
] | [((3354, 3375), 'unittest.TestLoader', 'unittest.TestLoader', ([], {}), '()\n', (3373, 3375), False, 'import unittest\n'), ((3384, 3404), 'unittest.TestSuite', 'unittest.TestSuite', ([], {}), '()\n', (3402, 3404), False, 'import unittest\n'), ((3506, 3521), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3519, 352... |
import pytest
from meiga import Result, Error
@pytest.mark.unit
def test_should_create_a_success_result_with_a_true_bool():
result = Result(success=True)
assert result.is_success
assert result.value is True
@pytest.mark.unit
def test_should_create_a_success_result_with_a_false_bool():
result = Res... | [
"meiga.Result",
"meiga.Error",
"pytest.raises"
] | [((140, 160), 'meiga.Result', 'Result', ([], {'success': '(True)'}), '(success=True)\n', (146, 160), False, 'from meiga import Result, Error\n'), ((317, 338), 'meiga.Result', 'Result', ([], {'success': '(False)'}), '(success=False)\n', (323, 338), False, 'from meiga import Result, Error\n'), ((496, 516), 'meiga.Result'... |
import os
from pathlib import Path
import gensim.downloader as api
from gensim.models import Word2Vec
import spacy
from yasmin.constants import SPACY_MODEL_NAME
from yasmin.core import WSD
from yasmin.helpers import custom_tokenizer, hash_types, make_type_matrix
model_path = str(Path(__file__).parents[1] /
... | [
"yasmin.helpers.hash_types",
"pathlib.Path",
"spacy.load",
"gensim.models.Word2Vec.load",
"os.path.isfile",
"gensim.downloader.load",
"gensim.models.Word2Vec",
"yasmin.helpers.make_type_matrix",
"yasmin.core.WSD"
] | [((379, 405), 'os.path.isfile', 'os.path.isfile', (['model_path'], {}), '(model_path)\n', (393, 405), False, 'import os\n'), ((694, 756), 'spacy.load', 'spacy.load', (['SPACY_MODEL_NAME'], {'create_make_doc': 'custom_tokenizer'}), '(SPACY_MODEL_NAME, create_make_doc=custom_tokenizer)\n', (704, 756), False, 'import spac... |
#!/usr/bin/env python3
"""
Created on Mon Jan 29 06:47:58 2018
@author: Swathi
"""
'''
Create a program that will play the “cows and bulls” game with the user. The game works like this:
Randomly generate a 4-digit number. Ask the user to guess a 4-digit number. For every digit that the user guessed correctly in the
... | [
"random.randint"
] | [((1102, 1140), 'random.randint', 'random.randint', (['range_start', 'range_end'], {}), '(range_start, range_end)\n', (1116, 1140), False, 'import random\n')] |
# Generated by Django 2.0.6 on 2018-06-03 04:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0004_auto_20180601_2005'),
]
operations = [
migrations.AlterField(
model_name='sharednotebook',
name='create... | [
"django.db.models.DateTimeField"
] | [((345, 402), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'default': '"""2018-05-27 04:49:28+00:00"""'}), "(default='2018-05-27 04:49:28+00:00')\n", (365, 402), False, 'from django.db import migrations, models\n'), ((536, 593), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'default... |
import numpy
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import math
from itertools import cycle
SIZE_X = 128
I1 = 128
J1 = 128
H = 1/8##?
U = numpy.zeros((I1,J1))
F = numpy.zeros((I1,J1))
B = numpy.zeros((I1,J1))
for I in range(0,I1):
for J in range(0,J1):
# U[I,J] = 10
# ... | [
"matplotlib.pyplot.imshow",
"numpy.copyto",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.cla",
"math.sqrt",
"math.cos",
"numpy.zeros",
"math.fabs",
"numpy.linalg.norm",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.draw",
"matplotlib.pyplot.subplot"
] | [((175, 196), 'numpy.zeros', 'numpy.zeros', (['(I1, J1)'], {}), '((I1, J1))\n', (186, 196), False, 'import numpy\n'), ((200, 221), 'numpy.zeros', 'numpy.zeros', (['(I1, J1)'], {}), '((I1, J1))\n', (211, 221), False, 'import numpy\n'), ((225, 246), 'numpy.zeros', 'numpy.zeros', (['(I1, J1)'], {}), '((I1, J1))\n', (236, ... |
"""
WWW URL Configuration
"""
from django.conf.urls import url, include
from www.views import home
urlpatterns = [
# Home page
url(r'^$', home, name='home'),
url(r'^auth/', include('authorization.urls')),
url(r'^article/', include('article.urls')),
url(r'^assortment/', include('assortment.url... | [
"django.conf.urls.include",
"django.conf.urls.url"
] | [((139, 167), 'django.conf.urls.url', 'url', (['"""^$"""', 'home'], {'name': '"""home"""'}), "('^$', home, name='home')\n", (142, 167), False, 'from django.conf.urls import url, include\n'), ((190, 219), 'django.conf.urls.include', 'include', (['"""authorization.urls"""'], {}), "('authorization.urls')\n", (197, 219), F... |
from django.db import models
from adminsortable.models import SortableMixin
from django.template.defaultfilters import slugify
class CV(SortableMixin):
order = models.PositiveIntegerField(
default=0, editable=False, db_index=True)
publish = models.BooleanField(default=False)
name = models.CharFiel... | [
"django.db.models.DateField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.db.models.BooleanField",
"django.template.defaultfilters.slugify",
"django.db.models.SlugField",
"django.db.models.PositiveIntegerField",
"django.db.models.CharField... | [((166, 235), 'django.db.models.PositiveIntegerField', 'models.PositiveIntegerField', ([], {'default': '(0)', 'editable': '(False)', 'db_index': '(True)'}), '(default=0, editable=False, db_index=True)\n', (193, 235), False, 'from django.db import models\n'), ((259, 293), 'django.db.models.BooleanField', 'models.Boolean... |
'''
Module handles mapping input files of varying types (tif, bag) to conventions
implemented within mdes-grid-checks such as the mapping of band numbers
to what they represent
'''
from enum import Enum
from osgeo import gdal
from typing import Tuple, List, Type
import os
import os.path
from pathlib import Path
from ... | [
"osgeo.gdal.Open",
"ausseabed.qajson.model.QajsonInputs",
"ausseabed.qajson.model.QajsonCheck",
"pathlib.Path",
"ausseabed.qajson.model.QajsonDataLevel",
"os.path.splitext",
"os.path.join",
"os.path.isfile",
"ausseabed.qajson.utils.latest_schema_version",
"ausseabed.qajson.model.QajsonFile",
"au... | [((2507, 2528), 'osgeo.gdal.Open', 'gdal.Open', (['input_file'], {}), '(input_file)\n', (2516, 2528), False, 'from osgeo import gdal\n'), ((3957, 3978), 'osgeo.gdal.Open', 'gdal.Open', (['input_file'], {}), '(input_file)\n', (3966, 3978), False, 'from osgeo import gdal\n'), ((4088, 4117), 'osgeo.gdal.Open', 'gdal.Open'... |
from django.conf.urls import patterns, url
urlpatterns= patterns('Mantenimientos.views',
url(r'^auten/', 'autentificar', name="autentificar"),
url(r'^inicio/', 'Inicio_view'),
url(r'^AgregarHeart_ajax/', 'AgregarHeart_ajax_view'),
url(r'^Bienvenida/', 'Bienvenida_view'),
)
"""... | [
"django.conf.urls.url"
] | [((99, 150), 'django.conf.urls.url', 'url', (['"""^auten/"""', '"""autentificar"""'], {'name': '"""autentificar"""'}), "('^auten/', 'autentificar', name='autentificar')\n", (102, 150), False, 'from django.conf.urls import patterns, url\n'), ((161, 191), 'django.conf.urls.url', 'url', (['"""^inicio/"""', '"""Inicio_view... |
# -*- coding: utf-8 -*-
import zipfile
import os
def UNZipfile():
fr=open("E:\\campus big data\\Datadirectory.txt","r")
fr_s=fr.read()
log_files_list =fr_s.split("\n")
for item in log_files_list:
#for循环遍历目录
fi=open(item+'\\zip_file_path.txt','r')
filename=fi.read().split("\n")
... | [
"zipfile.ZipFile"
] | [((470, 498), 'zipfile.ZipFile', 'zipfile.ZipFile', (['filename[x]'], {}), '(filename[x])\n', (485, 498), False, 'import zipfile\n')] |
# Generated by Django 3.1.1 on 2020-10-05 17:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('post_it', '0002_auto_20201002_1725'),
]
operations = [
migrations.AddField(
model_name='post_it',
name='zindex',
... | [
"django.db.models.IntegerField"
] | [((335, 365), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'default': '(0)'}), '(default=0)\n', (354, 365), False, 'from django.db import migrations, models\n')] |
from chatlib import (
__version__ as version,
__author__ as author
)
from setuptools import setup
from pathlib import Path
readme_path = Path(__file__).parent.joinpath("README.md")
with open(readme_path) as f:
readme_contents = f.read()
setup(
name="pychatlib",
version=version,
description="Pr... | [
"setuptools.setup",
"pathlib.Path"
] | [((251, 718), 'setuptools.setup', 'setup', ([], {'name': '"""pychatlib"""', 'version': 'version', 'description': '"""Provides functionality to read messaging/chat application exports."""', 'url': '"""https://github.com/lahdjirayhan/pychatlib"""', 'license': '"""BSD 3-clause"""', 'author': 'author', 'packages': "['chatl... |
import cv2
faceCascade = cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_frontalface_default.xml")
img = cv2.imread(r'C:\Users\Jeevan\PycharmProjects\CartoonMaking\Resources\Sample.jpeg')
img = cv2.resize(img, (800, 600))
imgGray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # converting image into grayscal... | [
"cv2.rectangle",
"cv2.imshow",
"cv2.waitKey",
"cv2.cvtColor",
"cv2.CascadeClassifier",
"cv2.resize",
"cv2.imread"
] | [((28, 116), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (["(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml')"], {}), "(cv2.data.haarcascades +\n 'haarcascade_frontalface_default.xml')\n", (49, 116), False, 'import cv2\n'), ((120, 217), 'cv2.imread', 'cv2.imread', (['"""C:\\\\Users\\\\Jeevan\\\\P... |
#!/usr/bin/python
# ---------------------------------------------------------------------------
# WRW 3 Mar 2022 - Make a sanatized copy of birdland.conf in birdland.conf.proto
# I got tired changing birdland.conf and then having to edit it for the proto version.
# Source is ~/.birdland/birdland.conf or birdland.... | [
"click.option",
"datetime.datetime.today",
"click.command",
"pathlib.Path"
] | [((703, 718), 'click.command', 'click.command', ([], {}), '()\n', (716, 718), False, 'import click\n'), ((720, 790), 'click.option', 'click.option', (['"""-c"""', '"""--confdir"""'], {'help': '"""Use alternate config directory"""'}), "('-c', '--confdir', help='Use alternate config directory')\n", (732, 790), False, 'im... |
import time
from tkinter import *
from collections import deque
user_command_root = Tk()
user_command_root.title("TP3DS User Command")
user_command_root.geometry('350x640')
user_command_root.configure(background='black')
user_command_root.resizable(width=FALSE, height=FALSE)
text_font = ("", "20")
command_window_hei... | [
"collections.deque"
] | [((847, 854), 'collections.deque', 'deque', ([], {}), '()\n', (852, 854), False, 'from collections import deque\n'), ((878, 885), 'collections.deque', 'deque', ([], {}), '()\n', (883, 885), False, 'from collections import deque\n'), ((906, 913), 'collections.deque', 'deque', ([], {}), '()\n', (911, 913), False, 'from c... |
from objects.modulebase import ModuleBase
from objects.permissions import PermissionEmbedLinks, PermissionExternalEmojis
from utils.funcs import find_user, _get_last_user_message_timestamp
from datetime import datetime
import discord
STATUS_EMOTES = {
'online': '<:online:427209268240973854>',
'idle': ... | [
"datetime.datetime.fromtimestamp",
"utils.funcs.find_user",
"discord.Colour.gold",
"datetime.datetime.now",
"objects.permissions.PermissionEmbedLinks",
"objects.permissions.PermissionExternalEmojis",
"utils.funcs._get_last_user_message_timestamp"
] | [((1012, 1034), 'objects.permissions.PermissionEmbedLinks', 'PermissionEmbedLinks', ([], {}), '()\n', (1032, 1034), False, 'from objects.permissions import PermissionEmbedLinks, PermissionExternalEmojis\n'), ((1184, 1216), 'utils.funcs.find_user', 'find_user', (['args[1:]', 'ctx.message'], {}), '(args[1:], ctx.message)... |
# 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 pulumi
import pulumi.runtime
from .. import utilities, tables
class GetAccountResult(object):
"""
A collection of value... | [
"pulumi.runtime.invoke"
] | [((9956, 10026), 'pulumi.runtime.invoke', 'pulumi.runtime.invoke', (['"""azure:storage/getAccount:getAccount"""', '__args__'], {}), "('azure:storage/getAccount:getAccount', __args__)\n", (9977, 10026), False, 'import pulumi\n')] |
# coding:utf-8
from flask_wtf import Form
from wtforms import StringField, PasswordField, BooleanField, SubmitField, ValidationError, TextAreaField, SelectField
from wtforms.validators import DataRequired, Email
from flask_pagedown.fields import PageDownField
from .models import Category
class LoginForm(Form):
em... | [
"wtforms.validators.Email",
"wtforms.BooleanField",
"wtforms.SubmitField",
"wtforms.StringField",
"flask_pagedown.fields.PageDownField",
"wtforms.validators.DataRequired"
] | [((473, 492), 'wtforms.BooleanField', 'BooleanField', (['"""记住我"""'], {}), "('记住我')\n", (485, 492), False, 'from wtforms import StringField, PasswordField, BooleanField, SubmitField, ValidationError, TextAreaField, SelectField\n'), ((506, 523), 'wtforms.SubmitField', 'SubmitField', (['"""登录"""'], {}), "('登录')\n", (517,... |
# Copyright 2021 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0
"""
This script contains test cases, verifying the core authentication components
of the plugin, like authentication cache, configurations, etc.
"""
import json
import os
from time import time
from unittest.mock import patch
from pytest_httpserver.pyt... | [
"vdk.plugin.control_api_auth.base_auth.AuthenticationCache",
"vdk.plugin.control_api_auth.base_auth.AuthenticationCacheSerDe.serialize",
"json.dumps",
"vdk.plugin.control_api_auth.base_auth.AuthenticationCacheSerDe.deserialize",
"vdk.plugin.control_api_auth.base_auth.BaseAuth",
"vdk.plugin.control_api_aut... | [((701, 722), 'vdk.plugin.control_api_auth.base_auth.AuthenticationCache', 'AuthenticationCache', ([], {}), '()\n', (720, 722), False, 'from vdk.plugin.control_api_auth.base_auth import AuthenticationCache\n'), ((740, 781), 'vdk.plugin.control_api_auth.base_auth.AuthenticationCacheSerDe.serialize', 'AuthenticationCache... |
# Generated by Django 3.0.3 on 2020-02-07 20:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('coingate', '0004_auto_20200207_1959'),
]
operations = [
migrations.AddField(
model_name='payment',
name='token',
... | [
"django.db.models.CharField"
] | [((335, 380), 'django.db.models.CharField', 'models.CharField', ([], {'default': '(234)', 'max_length': '(100)'}), '(default=234, max_length=100)\n', (351, 380), False, 'from django.db import migrations, models\n')] |
#coding=utf-8
#coding=utf-8
'''
Created on 2017年5月22日
@author: ethan
'''
from django.shortcuts import render_to_response
from django.http import HttpResponse
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from doraemon.project.pagefactory.project_portal_pagework... | [
"doraemon.project.pagefactory.project_portal_pageworker.ProjectPortalPageWorker"
] | [((443, 475), 'doraemon.project.pagefactory.project_portal_pageworker.ProjectPortalPageWorker', 'ProjectPortalPageWorker', (['request'], {}), '(request)\n', (466, 475), False, 'from doraemon.project.pagefactory.project_portal_pageworker import ProjectPortalPageWorker\n')] |
#!/usr/bin/env python3
import os
import importlib
import shutil
import sys
from common import clone_repo_src, run_command, check_root_dir, create_dirs
def setup_stp():
curr_dir = os.getcwd()
deps = importlib.import_module("solver-deps")
deps.setup_minisat()
deps.setup_cms()
the_repo = clone_rep... | [
"os.path.exists",
"common.run_command",
"common.clone_repo_src",
"importlib.import_module",
"common.check_root_dir",
"common.create_dirs",
"os.getcwd",
"os.chdir",
"os.mkdir",
"shutil.rmtree"
] | [((186, 197), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (195, 197), False, 'import os\n'), ((210, 248), 'importlib.import_module', 'importlib.import_module', (['"""solver-deps"""'], {}), "('solver-deps')\n", (233, 248), False, 'import importlib\n'), ((311, 414), 'common.clone_repo_src', 'clone_repo_src', (['"""STP v2... |
import os
from django.conf import settings
from django.db import models
from django.utils import timezone
from datetime import datetime, timedelta
from uuid import uuid4
def get_image_path(instance, filename):
ymd_path = datetime.now().strftime('%Y/%m/%d')
uuid_name = uuid4().hex
return '/'.join(['image_f... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.models.ManyToManyField",
"os.path.join",
"django.db.models.DateTimeField",
"django.db.models.BooleanField",
"uuid.uuid4",
"datetime.datetime.now",
"django.db.models.PositiveIntegerField",
"dj... | [((395, 501), 'django.db.models.ForeignKey', 'models.ForeignKey', (['settings.AUTH_USER_MODEL'], {'on_delete': 'models.SET_NULL', 'null': '(True)', 'verbose_name': '"""작성자"""'}), "(settings.AUTH_USER_MODEL, on_delete=models.SET_NULL, null\n =True, verbose_name='작성자')\n", (412, 501), False, 'from django.db import mod... |
import cv2
import numpy as np
import chili_tag_detector as ctd
import sys
import time
from behaviours.box_detection.utils import calculate_angle_and_distance
#from utils import calculate_angle_and_distance
#1227^2 + 136^2 = sqrt(1524025) = 1309.83 1234.51
#900^2 +136^2 = sqrt(828496) = 910.21 1004.99
#600^2 + 136^2 =... | [
"chili_tag_detector.detect",
"behaviours.box_detection.utils.calculate_angle_and_distance",
"cv2.VideoCapture"
] | [((1073, 1090), 'chili_tag_detector.detect', 'ctd.detect', (['frame'], {}), '(frame)\n', (1083, 1090), True, 'import chili_tag_detector as ctd\n'), ((1682, 1950), 'cv2.VideoCapture', 'cv2.VideoCapture', (['"""nvcamerasrc ! video/x-raw(memory:NVMM), width=(int)640, height=(int)480,format=(string)I420, framerate=(fractio... |
# -*- coding: utf-8 -*-
import logging
from django.test.client import Client
from mock import patch
from networkapi.api_network.tasks import delete_networkv6
from networkapi.api_network.tasks import undeploy_networkv6
from networkapi.ip.models import NetworkIPv6
from networkapi.test.test_case import NetworkApiTestCas... | [
"logging.getLogger",
"mock.patch",
"django.test.client.Client",
"networkapi.usuario.models.Usuario",
"networkapi.api_network.tasks.undeploy_networkv6",
"networkapi.api_network.tasks.delete_networkv6",
"networkapi.ip.models.NetworkIPv6"
] | [((375, 402), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (392, 402), False, 'import logging\n'), ((567, 627), 'mock.patch', 'patch', (['"""networkapi.api_network.facade.v3.delete_networkipv6"""'], {}), "('networkapi.api_network.facade.v3.delete_networkipv6')\n", (572, 627), False, 'fr... |
import sys
import inspect
import textwrap
from collections import OrderedDict, UserString
from PyQt5 import QtCore, QtGui
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import *
# source for the accordion = https://stackoverflow.com/questions/32476006/how-to-make-an-expandable-collapsa... | [
"inspect.isclass",
"collections.OrderedDict",
"PyQt5.QtCore.QParallelAnimationGroup",
"PyQt5.QtCore.QPropertyAnimation"
] | [((1418, 1431), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (1429, 1431), False, 'from collections import OrderedDict, UserString\n'), ((5135, 5154), 'collections.OrderedDict', 'OrderedDict', (['styles'], {}), '(styles)\n', (5146, 5154), False, 'from collections import OrderedDict, UserString\n'), ((789... |
"""empty message
Revision ID: <KEY>
Revises: <KEY>
Create Date: 2021-06-23 17:11:22.666814
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "<KEY>"
down_revision = "<KEY>"
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated ... | [
"sqlalchemy.Boolean",
"alembic.op.drop_column",
"alembic.op.create_index",
"alembic.op.drop_index"
] | [((460, 568), 'alembic.op.drop_index', 'op.drop_index', (['"""idx_task_validation_validator_status_composite"""'], {'table_name': '"""task_invalidation_history"""'}), "('idx_task_validation_validator_status_composite', table_name=\n 'task_invalidation_history')\n", (473, 568), False, 'from alembic import op\n'), ((7... |
import os
import csv
from parse import *
from query import *
from utils import *
from index import *
import time
def get_user_query():
print('\nEnter SELECT-FROM-WHERE query:\n')
valid_query = False
while valid_query == False:
user_query = input('query > ')
# Query vali... | [
"time.time"
] | [((3740, 3751), 'time.time', 'time.time', ([], {}), '()\n', (3749, 3751), False, 'import time\n'), ((4290, 4301), 'time.time', 'time.time', ([], {}), '()\n', (4299, 4301), False, 'import time\n')] |
from django.urls import path
from . import views
urlpatterns = [
path("hello-world/", views.index),
path('', views.PokemonList.as_view()),
path('<int:pk>/', views.PokemonOneList.as_view()),
# v2
path("v2/", views.PokemonGetAll),
path("v2/<int:pk>/", views.PokemonGetOne),
path("v2/pokemon",... | [
"django.urls.path"
] | [((70, 103), 'django.urls.path', 'path', (['"""hello-world/"""', 'views.index'], {}), "('hello-world/', views.index)\n", (74, 103), False, 'from django.urls import path\n'), ((217, 249), 'django.urls.path', 'path', (['"""v2/"""', 'views.PokemonGetAll'], {}), "('v2/', views.PokemonGetAll)\n", (221, 249), False, 'from dj... |
import os
from celery import Celery
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "storefront.settings")
celery = Celery("storefront")
celery.config_from_object("django.conf:settings", namespace="CELERY")
celery.autodiscover_tasks()
| [
"os.environ.setdefault",
"celery.Celery"
] | [((38, 108), 'os.environ.setdefault', 'os.environ.setdefault', (['"""DJANGO_SETTINGS_MODULE"""', '"""storefront.settings"""'], {}), "('DJANGO_SETTINGS_MODULE', 'storefront.settings')\n", (59, 108), False, 'import os\n'), ((119, 139), 'celery.Celery', 'Celery', (['"""storefront"""'], {}), "('storefront')\n", (125, 139),... |
from helita.sim import rh15d
import matplotlib.pyplot as plt
import numpy as np
import os
import warnings # ignore tedious warnings
warnings.filterwarnings("ignore")
##############################################################
def load_rh_data(folder, print_attributes=False):
# reset IPython kernel
tr... | [
"IPython.get_ipython",
"numpy.mean",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylabel",
"numpy.where",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"rh_kmean.create_kmean_from_data",
"matplotlib.pyplot.close",
"numpy.array",
"helita.sim.rh15d.Rh15dout",
"numpy.random.randint",
"n... | [((136, 169), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (159, 169), False, 'import warnings\n'), ((609, 631), 'helita.sim.rh15d.Rh15dout', 'rh15d.Rh15dout', (['folder'], {}), '(folder)\n', (623, 631), False, 'from helita.sim import rh15d\n'), ((1312, 1324), 'os.walk',... |
from django import forms
class HomeForm(forms.Form):
your_text = forms.CharField(label='Text To Process', max_length=2000, widget = forms.Textarea)
class CountForm(forms.Form):
your_text = forms.CharField(label='Text To Process', max_length=2000, widget = forms.Textarea) | [
"django.forms.CharField"
] | [((70, 155), 'django.forms.CharField', 'forms.CharField', ([], {'label': '"""Text To Process"""', 'max_length': '(2000)', 'widget': 'forms.Textarea'}), "(label='Text To Process', max_length=2000, widget=forms.Textarea\n )\n", (85, 155), False, 'from django import forms\n'), ((200, 285), 'django.forms.CharField', 'fo... |
from django.contrib import admin
from .models import Contact
class ContactAdmin(admin.ModelAdmin):
list_display = ('id', 'email_address', 'subject', 'created_on')
list_display_links = ('id', 'email_address')
search_fields = ('name_first', 'name_last', 'email_address')
list_per_page = 25
adm... | [
"django.contrib.admin.site.register"
] | [((317, 359), 'django.contrib.admin.site.register', 'admin.site.register', (['Contact', 'ContactAdmin'], {}), '(Contact, ContactAdmin)\n', (336, 359), False, 'from django.contrib import admin\n')] |
import getpass
import os
import sys
import math
from io import StringIO
import shutil
import datetime
from os.path import splitext
from difflib import unified_diff
import pytest
from astropy.io import fits
from astropy.io.fits import FITSDiff
from astropy.utils.data import conf
import numpy as np
import stwcs
from st... | [
"math.sqrt",
"astropy.utils.data.conf.reset",
"difflib.unified_diff",
"stwcs.wcsutil.HSTWCS",
"astropy.io.fits.FITSDiff",
"ci_watson.artifactory_helpers.get_bigdata",
"astropy.io.fits.open",
"getpass.getuser",
"pytest.fixture",
"sys.stdout.writelines",
"ci_watson.hst_helpers.ref_from_image",
"... | [((635, 646), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (644, 646), False, 'import os\n'), ((984, 1012), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (998, 1012), False, 'import pytest\n'), ((8054, 8076), 'os.environ.get', 'os.environ.get', (['refstr'], {}), '(refstr)\n', (8068... |
import cv2
from settings import *
from src.solving_objects.MyHoughLines import *
from src.solving_objects.MyHoughPLines import *
def line_intersection(my_line1, my_line2):
line1 = [[my_line1[0], my_line1[1]], [my_line1[2], my_line1[3]]]
line2 = [[my_line2[0], my_line2[1]], [my_line2[2], my_line2[3]]]
xdi... | [
"cv2.getPerspectiveTransform",
"cv2.arcLength",
"cv2.line",
"cv2.imshow",
"cv2.contourArea",
"cv2.morphologyEx",
"cv2.circle",
"cv2.HoughLines",
"cv2.adaptiveThreshold",
"cv2.warpPerspective",
"cv2.cvtColor",
"cv2.approxPolyDP",
"cv2.findContours",
"cv2.bitwise_not",
"cv2.GaussianBlur",
... | [((2739, 2790), 'cv2.HoughLines', 'cv2.HoughLines', (['edges', '(1)', '(np.pi / 180)', 'thresh_hough'], {}), '(edges, 1, np.pi / 180, thresh_hough)\n', (2753, 2790), False, 'import cv2\n'), ((6642, 6661), 'cv2.imread', 'cv2.imread', (['im_path'], {}), '(im_path)\n', (6652, 6661), False, 'import cv2\n'), ((6666, 6686), ... |
import math
import numpy as np
'''
This is v1 code using the old input format! If you are new please look at v2
'''
'''
Hi! You can use this code as a template to create your own bot. Also if you don't mind writing a blurb
about your bot's strategy you can put it as a comment here. I'd appreciate it, especially if I... | [
"math.cos",
"numpy.zeros",
"math.sin",
"math.atan2"
] | [((1070, 1082), 'numpy.zeros', 'np.zeros', (['(38)'], {}), '(38)\n', (1078, 1082), True, 'import numpy as np\n'), ((1095, 1107), 'numpy.zeros', 'np.zeros', (['(12)'], {}), '(12)\n', (1103, 1107), True, 'import numpy as np\n'), ((5959, 5999), 'math.sin', 'math.sin', (['(bluePitch * URotationToRadians)'], {}), '(bluePitc... |
import numpy as np
import matplotlib.pyplot as plt
from gym.spaces import Discrete, Box
from tfg.games import GameEnv, WHITE, BLACK
class ConnectN(GameEnv):
def __init__(self, n=4, rows=6, cols=7):
if rows < n and cols < n:
raise ValueError("invalid board shape and number to connect")
... | [
"numpy.multiply",
"matplotlib.pyplot.Circle",
"matplotlib.pyplot.gca",
"numpy.fliplr",
"matplotlib.pyplot.gcf",
"gym.spaces.Discrete",
"gym.spaces.Box",
"numpy.diag",
"numpy.zeros",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.xlim",
"numpy.arange"
] | [((5606, 5615), 'matplotlib.pyplot.gca', 'plt.gca', ([], {}), '()\n', (5613, 5615), True, 'import matplotlib.pyplot as plt\n'), ((5764, 5783), 'matplotlib.pyplot.xlim', 'plt.xlim', (['[0, cols]'], {}), '([0, cols])\n', (5772, 5783), True, 'import matplotlib.pyplot as plt\n'), ((5788, 5807), 'matplotlib.pyplot.ylim', 'p... |
import torch
import torch.nn as nn
from enum import Enum
from numpy import pi
from . import util
class Metric(Enum):
HESSIAN = 1
SOFTABS = 2
JACOBIAN_DIAG = 3
def collect_gradients(log_prob, params):
if isinstance(log_prob, tuple):
log_prob[0].backward()
params_list = list(log_prob[1... | [
"torch.ones_like",
"torch.rand",
"torch.exp",
"torch.tensor",
"torch.autograd.grad",
"torch.zeros_like",
"torch.FloatTensor",
"torch.inverse",
"torch.dot"
] | [((2782, 2801), 'torch.tensor', 'torch.tensor', (['[rho]'], {}), '([rho])\n', (2794, 2801), False, 'import torch\n'), ((3331, 3351), 'torch.exp', 'torch.exp', (['x_new_bar'], {}), '(x_new_bar)\n', (3340, 3351), False, 'import torch\n'), ((491, 528), 'torch.autograd.grad', 'torch.autograd.grad', (['log_prob', 'params'],... |
import threading
from collections import MutableMapping
from time import time
from .utils.cache_doublylinkedlist import DoublylinkedList
from .utils.cache_node import DoublylinkedListNode
from .utils.cache_thread import RLock
class LRUCache(MutableMapping):
"""Timed Least Recently Used (LRU) cache implementatio... | [
"threading.Timer",
"time.time"
] | [((4623, 4667), 'threading.Timer', 'threading.Timer', (['self.timeout', 'self._cleanup'], {}), '(self.timeout, self._cleanup)\n', (4638, 4667), False, 'import threading\n'), ((3802, 3808), 'time.time', 'time', ([], {}), '()\n', (3806, 3808), False, 'from time import time\n')] |
from django import forms
from .models import CartItem
class AddToCartForm(forms.ModelForm):
class Meta:
model = CartItem
fields = [
'quantity'
]
widgets = {
'quantity': forms.NumberInput(attrs={'class': 'full-width'})
}
| [
"django.forms.NumberInput"
] | [((231, 279), 'django.forms.NumberInput', 'forms.NumberInput', ([], {'attrs': "{'class': 'full-width'}"}), "(attrs={'class': 'full-width'})\n", (248, 279), False, 'from django import forms\n')] |
from django.db import models
class Car(models.Model):
mark = models.CharField(max_length=128)
model = models.CharField(max_length=128)
colour = models.CharField(max_length=128)
gov_number = models.CharField(max_length=128)
class Owner(models.Model):
first_name = models.CharField(max_length=128)
... | [
"django.db.models.DateField",
"django.db.models.IntegerField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.db.models.CharField"
] | [((66, 98), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(128)'}), '(max_length=128)\n', (82, 98), False, 'from django.db import models\n'), ((111, 143), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(128)'}), '(max_length=128)\n', (127, 143), False, 'from django.db im... |
# further developed by <NAME>, <NAME>, <NAME> and <NAME>
import random
import sort_task_set
import math
import numpy
import task
USet=[]
PSet=[]
possiblePeriods = [1, 2, 5, 10, 50, 100, 200, 1000]
def init():
global USet,PSet
USet=[]
PSet=[]
def taskGeneration_rounded( numTasks, uTotal ):
random.se... | [
"sort_task_set.sort",
"task.Task",
"numpy.random.random",
"math.pow",
"task.setPriority",
"random.seed",
"random.random",
"sort_task_set.sortEvent"
] | [((311, 324), 'random.seed', 'random.seed', ([], {}), '()\n', (322, 324), False, 'import random\n'), ((491, 504), 'random.seed', 'random.seed', ([], {}), '()\n', (502, 504), False, 'import random\n'), ((2860, 2898), 'sort_task_set.sort', 'sort_task_set.sort', (['allTasks', '"""period"""'], {}), "(allTasks, 'period')\n"... |
import gym
import tensorflow as tf
from rl.agent import util
class A3CModel(tf.keras.Model):
def __init__(self, env):
super().__init__()
self.action_is_continuous, self.action_size, self.action_low, self.action_high = util.parse_env(
env
)
# Policy (actor) layer
... | [
"rl.agent.util.parse_env",
"tensorflow.keras.layers.Dense",
"tensorflow.variable_scope"
] | [((242, 261), 'rl.agent.util.parse_env', 'util.parse_env', (['env'], {}), '(env)\n', (256, 261), False, 'from rl.agent import util\n'), ((345, 389), 'tensorflow.keras.layers.Dense', 'tf.keras.layers.Dense', (['(32)'], {'activation': '"""relu"""'}), "(32, activation='relu')\n", (366, 389), True, 'import tensorflow as tf... |
from datetime import datetime
from typing import Optional
import pytz
from core.controllers.discord.utils.command_helper import send
from core.controllers.discord.utils.MGCert import Level, MGCertificate
from mgylabs.db.models import DiscordUser
import discord
from discord import app_commands
from discord.ext import ... | [
"pytz.timezone",
"core.controllers.discord.utils.command_helper.send",
"discord.app_commands.AppCommandError",
"discord.app_commands.Choice",
"core.controllers.discord.utils.MGCert.MGCertificate.verify",
"discord.app_commands.context_menu",
"datetime.datetime.utcnow",
"mgylabs.db.models.DiscordUser.ge... | [((4293, 4342), 'discord.app_commands.context_menu', 'app_commands.context_menu', ([], {'name': '"""Show local time"""'}), "(name='Show local time')\n", (4318, 4342), False, 'from discord import app_commands\n'), ((4344, 4391), 'core.controllers.discord.utils.MGCert.MGCertificate.verify', 'MGCertificate.verify', ([], {... |
"""VTC user app serializer"""
from rest_framework import serializers
from .models import CustomUser, VideoLink
class CustomUserSerializer(serializers.ModelSerializer):
"""
CustomUserSerializer class
A `ModelSerializer` is just a regular `Serializer`, except that:
* A set of default fields ... | [
"rest_framework.serializers.ValidationError",
"rest_framework.serializers.SerializerMethodField"
] | [((968, 1017), 'rest_framework.serializers.SerializerMethodField', 'serializers.SerializerMethodField', ([], {'read_only': '(True)'}), '(read_only=True)\n', (1001, 1017), False, 'from rest_framework import serializers\n'), ((1643, 1702), 'rest_framework.serializers.ValidationError', 'serializers.ValidationError', (['""... |
import sys
import pylink
from time import sleep
from threading import Thread, Event, Condition
import logging
import re
if sys.version_info < (3, 0):
import Queue as queue
# __class__ = instance.__class__
else:
import queue
from avatar2.archs.arm import ARM
from avatar2.targets import TargetStates
from av... | [
"logging.getLogger",
"pylink.JLink",
"threading.Thread.__init__",
"time.sleep",
"threading.Event",
"avatar2.message.UpdateStateMessage"
] | [((818, 825), 'threading.Event', 'Event', ([], {}), '()\n', (823, 825), False, 'from threading import Thread, Event, Condition\n'), ((905, 919), 'pylink.JLink', 'pylink.JLink', ([], {}), '()\n', (917, 919), False, 'import pylink\n'), ((1198, 1219), 'threading.Thread.__init__', 'Thread.__init__', (['self'], {}), '(self)... |
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import poisson
from scipy.stats import uniform
from scipy.stats import norm
# Data
data = np.array([0.3120639, 0.5550930, 0.2493114, 0.9785842])
# Grid.
mus = np.linspace(0, 1, num=100)
sigmas = np.linspace(0, 1, num=100)
x = []
y = []
z = []
# Gri... | [
"numpy.array",
"numpy.linspace",
"scipy.stats.uniform.pdf",
"scipy.stats.norm.pdf",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.show"
] | [((159, 212), 'numpy.array', 'np.array', (['[0.3120639, 0.555093, 0.2493114, 0.9785842]'], {}), '([0.3120639, 0.555093, 0.2493114, 0.9785842])\n', (167, 212), True, 'import numpy as np\n'), ((229, 255), 'numpy.linspace', 'np.linspace', (['(0)', '(1)'], {'num': '(100)'}), '(0, 1, num=100)\n', (240, 255), True, 'import n... |
from f5.bigip import ManagementRoot
from f5.cluster.cluster_manager import ClusterManager
a = ManagementRoot('10.190.20.202', 'admin', 'admin')
b = ManagementRoot('10.190.20.203', 'admin', 'admin')
c = ManagementRoot('10.190.20.204', 'admin', 'admin')
cm = ClusterManager([a, b], 'testing_cluster', 'Common', 'sync-fai... | [
"f5.cluster.cluster_manager.ClusterManager",
"f5.bigip.ManagementRoot"
] | [((95, 144), 'f5.bigip.ManagementRoot', 'ManagementRoot', (['"""10.190.20.202"""', '"""admin"""', '"""admin"""'], {}), "('10.190.20.202', 'admin', 'admin')\n", (109, 144), False, 'from f5.bigip import ManagementRoot\n'), ((149, 198), 'f5.bigip.ManagementRoot', 'ManagementRoot', (['"""10.190.20.203"""', '"""admin"""', '... |
from django import forms
from tracker_app.models import CustUser
class AddTicket(forms.Form):
title = forms.CharField(max_length=200)
description = forms.CharField(widget=forms.Textarea)
class EditTicket(forms.Form):
title = forms.CharField(max_length=200)
description = forms.CharField(widget=for... | [
"tracker_app.models.CustUser.objects.all",
"django.forms.CharField"
] | [((110, 141), 'django.forms.CharField', 'forms.CharField', ([], {'max_length': '(200)'}), '(max_length=200)\n', (125, 141), False, 'from django import forms\n'), ((160, 198), 'django.forms.CharField', 'forms.CharField', ([], {'widget': 'forms.Textarea'}), '(widget=forms.Textarea)\n', (175, 198), False, 'from django imp... |
from seleniumbase import BaseCase
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from parameterized import parameterized
import pytest
from utilities import utilities
from utilities import gmail
from utilities.Authority import Authority
from utilities.Role import Role
from c... | [
"utilities.Authority.Authority",
"utilities.Role.Role",
"utilities.utilities.str_to_list",
"time.sleep"
] | [((3542, 3548), 'utilities.Role.Role', 'Role', ([], {}), '()\n', (3546, 3548), False, 'from utilities.Role import Role\n'), ((1818, 1832), 'time.sleep', 'time.sleep', (['(10)'], {}), '(10)\n', (1828, 1832), False, 'import time\n'), ((3859, 3894), 'utilities.utilities.str_to_list', 'utilities.str_to_list', (['service_li... |
import pygame
from constants import *
from Main import *
from typing import *
class Welcome:
"""
This is the class that controls our basic welcome page, what this method does
is to ask the user to press the start button to start the game
"""
def __init__(self) -> None:
"""
This me... | [
"pygame.init",
"pygame.event.get",
"pygame.display.set_mode",
"pygame.time.Clock",
"pygame.display.set_caption",
"pygame.image.load",
"pygame.font.Font",
"pygame.display.update"
] | [((388, 401), 'pygame.init', 'pygame.init', ([], {}), '()\n', (399, 401), False, 'import pygame\n'), ((638, 657), 'pygame.time.Clock', 'pygame.time.Clock', ([], {}), '()\n', (655, 657), False, 'import pygame\n'), ((857, 870), 'pygame.init', 'pygame.init', ([], {}), '()\n', (868, 870), False, 'import pygame\n'), ((887, ... |
## testing RigidMassInfo
# a difficulty is to test the orientatoin of the summed up rigid frame since it is not deterministic (axis swapping is expected)
# it is indirectly tested with test where the resultant sum is symmetric (a cube) so that the inertia is equal on all axis
import os
import numpy
from SofaTest.Macr... | [
"numpy.array",
"SofaPython.Quaternion.rotate",
"SofaPython.Quaternion.inv",
"SofaPython.mass.RigidMassInfo"
] | [((479, 499), 'SofaPython.mass.RigidMassInfo', 'mass.RigidMassInfo', ([], {}), '()\n', (497, 499), False, 'from SofaPython import mass\n'), ((710, 730), 'SofaPython.mass.RigidMassInfo', 'mass.RigidMassInfo', ([], {}), '()\n', (728, 730), False, 'from SofaPython import mass\n'), ((958, 978), 'SofaPython.mass.RigidMassIn... |
# -*- coding: utf-8 -*-
# @Author: <NAME>
# @Date: 2021-02-25 20:08:54
# @Last Modified by: <NAME>
# @Last Modified time: 2021-02-25 20:08:57
import os
import logging
from monitoring.adapters import SPI_CLK, SPI_MISO, SPI_MOSI
from monitoring.constants import LOG_ADSENSOR
# check if running on Raspberry
if os.un... | [
"logging.getLogger",
"monitoring.adapters.mock.MCP3008.DoubleAlertMCP3008",
"os.uname"
] | [((855, 886), 'logging.getLogger', 'logging.getLogger', (['LOG_ADSENSOR'], {}), '(LOG_ADSENSOR)\n', (872, 886), False, 'import logging\n'), ((315, 325), 'os.uname', 'os.uname', ([], {}), '()\n', (323, 325), False, 'import os\n'), ((1369, 1549), 'monitoring.adapters.mock.MCP3008.DoubleAlertMCP3008', 'MCP3008', ([], {'ch... |
"""
https://www.ncbi.nlm.nih.gov/books/NBK25497/
"""
import os
import sys
import json
import time
import textwrap
import datetime
import click
import prettytable
from dateutil.parser import parse as date_parse
from impact_factor import ImpactFactor
from simple_googletrans import GoogleTrans
from simple_loggers i... | [
"prettytable.PrettyTable",
"textwrap.dedent",
"simple_loggers.SimpleLogger",
"simple_googletrans.GoogleTrans",
"time.sleep",
"os.path.isfile",
"pypubmed.util.xml_parser.parse",
"webrequests.WebRequest.get_response",
"pypubmed.core.article.Article",
"impact_factor.ImpactFactor",
"os.path.expandus... | [((839, 861), 'simple_loggers.SimpleLogger', 'SimpleLogger', (['"""Eutils"""'], {}), "('Eutils')\n", (851, 861), False, 'from simple_loggers import SimpleLogger\n'), ((871, 885), 'impact_factor.ImpactFactor', 'ImpactFactor', ([], {}), '()\n', (883, 885), False, 'from impact_factor import ImpactFactor\n'), ((1085, 1121)... |
import matplotlib.pyplot as plt
import numpy as np
import torch
weights = torch.load('RN_epoch_350.pth')
W = weights['rl.pool.weight'].cpu()
# filter out virtually-zero weights
# 20 pieces is too much for 12 set size, W[:, 1] and W[:, -2] are always 0
# So, we don't want to plot these because they are always approx... | [
"matplotlib.pyplot.xticks",
"torch.load",
"matplotlib.pyplot.axhline",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show"
] | [((77, 107), 'torch.load', 'torch.load', (['"""RN_epoch_350.pth"""'], {}), "('RN_epoch_350.pth')\n", (87, 107), False, 'import torch\n'), ((704, 714), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (712, 714), True, 'import matplotlib.pyplot as plt\n'), ((525, 550), 'matplotlib.pyplot.subplot', 'plt.subplot', ... |
# -*- coding: utf-8-*-
# 树莓派状态插件
import os
from robot import logging
from robot.sdk.AbstractPlugin import AbstractPlugin
logger = logging.getLogger(__name__)
class Plugin(AbstractPlugin):
SLUG = "pi_status"
def getCPUtemperature(self):
result = 0.0
try:
tempFile = open("/sys/clas... | [
"os.popen",
"robot.logging.getLogger"
] | [((131, 158), 'robot.logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (148, 158), False, 'from robot import logging\n'), ((551, 567), 'os.popen', 'os.popen', (['"""free"""'], {}), "('free')\n", (559, 567), False, 'import os\n'), ((760, 779), 'os.popen', 'os.popen', (['"""df -h /"""'], {}), "... |
import pytest
import os
import contextlib
import shutil
from transform.pfam.pfam_to_proteins import transform
@pytest.fixture
def data_path(request):
return os.path.join(request.fspath.dirname, 'source/pfam/homo_sapiens.json')
def test_simple(helpers, emitter_directory, data_path):
protein_structure_file =... | [
"shutil.rmtree",
"os.path.join",
"contextlib.suppress",
"transform.pfam.pfam_to_proteins.transform"
] | [((164, 233), 'os.path.join', 'os.path.join', (['request.fspath.dirname', '"""source/pfam/homo_sapiens.json"""'], {}), "(request.fspath.dirname, 'source/pfam/homo_sapiens.json')\n", (176, 233), False, 'import os\n'), ((321, 387), 'os.path.join', 'os.path.join', (['emitter_directory', '"""ProteinStructure.Vertex.json.gz... |
import os
import sys
import shutil
import typing as t
import tarfile
import platform
import subprocess
from pathlib import Path
import conda_pack
import virtualenv
from loguru import logger
from starwhale.utils import console, is_linux, is_darwin, is_windows
from starwhale.consts import (
ENV_VENV,
ENV_CONDA,... | [
"starwhale.utils.is_linux",
"loguru.logger.warning",
"virtualenv.cli_run",
"os.path.exists",
"starwhale.utils.error.FormatError",
"starwhale.utils.is_windows",
"starwhale.utils.is_darwin",
"starwhale.utils.console.print",
"pathlib.Path",
"platform.system",
"os.path.expanduser",
"conda_pack.pac... | [((2341, 2356), 'starwhale.utils.process.check_call', 'check_call', (['cmd'], {}), '(cmd)\n', (2351, 2356), False, 'from starwhale.utils.process import check_call\n'), ((2779, 2830), 'starwhale.utils.process.check_call', 'check_call', (['cmd'], {'shell': '(True)', 'executable': '"""/bin/bash"""'}), "(cmd, shell=True, e... |
# -*- coding: utf-8 -*-
"""
Created on Fri May 1 11:51:08 2020
@author: <NAME> <<EMAIL>>
"""
#%% Load Basic Libraries
from numpy import *
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sn
import os
os.environ['PYTHONHASHSEED']=str(1)
#%% Load Sci-Kit Utitilies
from sklearn.model_selection impo... | [
"sklearn.metrics.f1_score",
"pandas.read_csv",
"pandas.DataFrame",
"sklearn.model_selection.train_test_split",
"sklearn.decomposition.PCA",
"matplotlib.pyplot.plot",
"sklearn.metrics.precision_score",
"sklearn.metrics.recall_score",
"keras.models.Sequential",
"sklearn.metrics.roc_auc_score",
"ke... | [((781, 811), 'matplotlib.pyplot.rc', 'plt.rc', (['"""font"""'], {'family': '"""serif"""'}), "('font', family='serif')\n", (787, 811), True, 'import matplotlib.pyplot as plt\n'), ((812, 843), 'matplotlib.pyplot.rc', 'plt.rc', (['"""xtick"""'], {'labelsize': '"""10"""'}), "('xtick', labelsize='10')\n", (818, 843), True,... |
from psana import dgramchunk, dgram
import legion
import os
@legion.task
def do_chunk(view):
config = dgram.Dgram()
offset = 0
while offset < len(view):
d = dgram.Dgram(config=config, view=view, offset=offset)
offset += memoryview(d).shape[0]
@legion.task(top_level=True)
def main():
fd... | [
"os.open",
"psana.dgramchunk.DgramChunk",
"legion.task",
"psana.dgram.Dgram"
] | [((274, 301), 'legion.task', 'legion.task', ([], {'top_level': '(True)'}), '(top_level=True)\n', (285, 301), False, 'import legion\n'), ((107, 120), 'psana.dgram.Dgram', 'dgram.Dgram', ([], {}), '()\n', (118, 120), False, 'from psana import dgramchunk, dgram\n'), ((323, 392), 'os.open', 'os.open', (['"""/reg/d/psdm/xpp... |
from typing import Tuple, Any, Dict, Optional, List
import numpy
import numpy as np
from plotly import graph_objects
from plotly.subplots import make_subplots
from plotly.tools import DEFAULT_PLOTLY_COLORS
from phi import math, field
from phi.field import SampledField, PointCloud, Grid, StaggeredGrid
from phi.geom im... | [
"numpy.clip",
"numpy.array",
"numpy.isfinite",
"numpy.nanmin",
"phi.field.unstack",
"plotly.graph_objects.scatter.Line",
"plotly.graph_objects.scatter.Marker",
"phi.vis._plot_util.down_sample_curve",
"numpy.max",
"numpy.stack",
"plotly.graph_objects.Scatter",
"numpy.vstack",
"numpy.concatena... | [((15019, 15052), 'numpy.clip', 'numpy.clip', (['cm_arr[:, 1:]', '(0)', '(255)'], {}), '(cm_arr[:, 1:], 0, 255)\n', (15029, 15052), False, 'import numpy\n'), ((18446, 18472), 'numpy.concatenate', 'np.concatenate', (['curves', '(-2)'], {}), '(curves, -2)\n', (18460, 18472), True, 'import numpy as np\n'), ((1204, 1275), ... |
# Copyright (c) 2017 Cisco Systems
# 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 require... | [
"neutron_lib.context.get_admin_context",
"mock.patch",
"gbpservice.neutron.services.apic_aim.l3_plugin.ApicL3Plugin"
] | [((1847, 1917), 'mock.patch', 'mock.patch', (['"""neutron.quota.resource.TrackedResource._db_event_handler"""'], {}), "('neutron.quota.resource.TrackedResource._db_event_handler')\n", (1857, 1917), False, 'import mock\n'), ((2011, 2115), 'mock.patch', 'mock.patch', (['"""neutron.db.securitygroups_db.SecurityGroupDbMixi... |
from datetime import datetime
import json
import logging
from multiprocessing.queues import Empty
from multiprocessing import Process, Queue
import random
import re
import requests
import pickle
import sys
import time
import threading
import traceback
from sleekxmpp import ClientXMPP
from sleekxmpp.exceptions import I... | [
"will.acl.is_acl_allowed",
"logging.getLogger",
"logging.debug",
"pickle.dumps",
"multiprocessing.Process",
"time.sleep",
"will.abstractions.Person",
"logging.info",
"logging.error",
"logging.warn",
"json.dumps",
"json.loads",
"random.choice",
"sleekxmpp.ClientXMPP.__init__",
"will.utils... | [((1883, 2036), 'logging.warn', 'logging.warn', (['"""mixin.internal_roster has been deprecated. Please use mixin.people instead. internal_roster will be removed at the end of 2017"""'], {}), "(\n 'mixin.internal_roster has been deprecated. Please use mixin.people instead. internal_roster will be removed at the en... |