code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# -*- coding: utf-8 -*-
"""
A simple general csv dataset wrapper for pylearn2.
Can do automatic one-hot encoding based on labels present in a file.
"""
__authors__ = "<NAME>"
__copyright__ = "Copyright 2013, <NAME>"
__credits__ = ["<NAME>", "<NAME>"]
__license__ = "3-clause BSD"
__maintainer__ = "?"
__email__ = "<EMAIL... | [
"pylearn2.utils.string_utils.preprocess",
"numpy.array",
"numpy.loadtxt",
"pandas.read_csv"
] | [((4090, 4111), 'pylearn2.utils.string_utils.preprocess', 'preprocess', (['self.path'], {}), '(self.path)\n', (4100, 4111), False, 'from pylearn2.utils.string_utils import preprocess\n'), ((4533, 4555), 'pandas.read_csv', 'pd.read_csv', (['self.path'], {}), '(self.path)\n', (4544, 4555), True, 'import pandas as pd\n'),... |
# -*- coding: utf-8 -*-
'''
The Saltutil runner is used to sync custom types to the Master. See the
:mod:`saltutil module <salt.modules.saltutil>` for documentation on
managing updates to minions.
.. versionadded:: 2016.3.0
'''
from __future__ import absolute_import, print_function, unicode_literals
# Import python l... | [
"logging.getLogger"
] | [((392, 419), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (409, 419), False, 'import logging\n')] |
# Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
'''
This is intended to be a lightweight license class for verifying subscriptions, and parsing subscription data
from entitlement certificates.
The Licenser class can do the following:
- Parse an Entitlement cert to generate license
'''
import base64
import... | [
"logging.getLogger",
"configparser.ConfigParser",
"zipfile.ZipFile",
"django.utils.translation.gettext_lazy",
"io.BytesIO",
"awx.main.models.Host.objects.active_count",
"copy.deepcopy",
"os.path.exists",
"awx.main.models.HostMetric.objects.only",
"dateutil.parser.parse",
"collections.namedtuple"... | [((941, 968), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (958, 968), False, 'import logging\n'), ((1036, 1063), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (1061, 1063), False, 'import configparser\n'), ((1158, 1170), 'io.BytesIO', 'io.BytesIO', ([], {}... |
import keras
import tensorflow as tf
from keras import layers
from keras import models
from keras import optimizers
from keras.preprocessing.image import ImageDataGenerator
import matplotlib.pyplot as plt
import tensorflowjs as tfjs
model = tf.keras.models.Sequential()
model.add(tf.keras.layers.Conv2D(32, (3, 3), acti... | [
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.MaxPooling2D",
"tensorflow.keras.layers.Flatten",
"matplotlib.pyplot.plot",
"tensorflow.keras.layers.Dropout",
"tensorflowjs.converters.save_keras_model",
"keras.preprocessing.image.ImageDataGenerator",
"matplotlib.pyplot.figure",
"tensorflo... | [((242, 270), 'tensorflow.keras.models.Sequential', 'tf.keras.models.Sequential', ([], {}), '()\n', (268, 270), True, 'import tensorflow as tf\n'), ((1278, 1445), 'keras.preprocessing.image.ImageDataGenerator', 'ImageDataGenerator', ([], {'rescale': '(1.0 / 255)', 'rotation_range': '(40)', 'width_shift_range': '(0.2)',... |
import datetime
def _beforeDawn( hour ):
EARLY = 5
return hour < EARLY
def nextDaylightDate():
today = datetime.date.today()
hour = datetime.datetime.today().hour
if _beforeDawn( hour ):
return today
else:
return today + datetime.timedelta( 1 )
| [
"datetime.datetime.today",
"datetime.date.today",
"datetime.timedelta"
] | [((117, 138), 'datetime.date.today', 'datetime.date.today', ([], {}), '()\n', (136, 138), False, 'import datetime\n'), ((150, 175), 'datetime.datetime.today', 'datetime.datetime.today', ([], {}), '()\n', (173, 175), False, 'import datetime\n'), ((263, 284), 'datetime.timedelta', 'datetime.timedelta', (['(1)'], {}), '(1... |
import re
import io
import json
import asyncio
from urllib import request
from functools import partial
from datetime import datetime
from collections import OrderedDict
import discord
from discord.ext import commands
import matplotlib.pyplot as plt
from matplotlib.ticker import StrMethodFormatter
from .utils import ... | [
"collections.OrderedDict",
"matplotlib.ticker.StrMethodFormatter",
"discord.ext.commands.dm_only",
"re.compile",
"discord.utils.find",
"io.BytesIO",
"datetime.datetime.now",
"discord.ext.commands.check",
"matplotlib.pyplot.subplots",
"datetime.datetime.fromisoformat",
"asyncio.sleep",
"io.Stri... | [((416, 476), 're.compile', 're.compile', (['"""(?<=event-date : )(\\\\d{,2})/(\\\\d{,2})/(\\\\d{4})"""'], {}), "('(?<=event-date : )(\\\\d{,2})/(\\\\d{,2})/(\\\\d{4})')\n", (426, 476), False, 'import re\n'), ((492, 531), 're.compile', 're.compile', (['"""(?<=event-state : )(\\\\S+)"""'], {}), "('(?<=event-state : )(\\... |
"""
Library Model Access
"""
import logging
from django.core.exceptions import ObjectDoesNotExist
from ozpcenter import models
import ozpcenter.api.listing.model_access as listing_model_access
import ozpcenter.api.notification.model_access as notification_model_access
import ozpcenter.model_access as generic_model_ac... | [
"ozpcenter.api.listing.model_access.get_listing_by_id",
"ozpcenter.models.ApplicationLibraryEntry.objects.filter",
"ozpcenter.models.ApplicationLibraryEntry",
"ozpcenter.models.ApplicationLibraryEntry.objects.for_user",
"ozpcenter.api.notification.model_access.get_notification_by_id_mailbox",
"ozpcenter.m... | [((2539, 2581), 'ozpcenter.model_access.get_profile', 'generic_model_access.get_profile', (['username'], {}), '(username)\n', (2571, 2581), True, 'import ozpcenter.model_access as generic_model_access\n'), ((2596, 2656), 'ozpcenter.api.listing.model_access.get_listing_by_id', 'listing_model_access.get_listing_by_id', (... |
"""
Версия телеграмм бота с использованием библиотеки Telethon
"""
import os
# pip3 install python-dotenv
from dotenv import load_dotenv
# pip3 install Telethon
from telethon import TelegramClient, events, connection, Button
import asyncio
import logging
# import re
from i_utils import run_cmd
from sqlitelib.sqliteu... | [
"logging.basicConfig",
"os.path.exists",
"logging.getLogger",
"sqlitelib.sqliteutils.User",
"os.getenv",
"dotenv.load_dotenv",
"os.path.dirname",
"sqlitelib.sqliteutils.SettingUser",
"telethon.Button.text",
"i_utils.run_cmd",
"telethon.TelegramClient",
"telethon.events.NewMessage"
] | [((457, 571), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s"""', 'level': 'logging.WARNING'}), "(format=\n '[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s', level=logging.\n WARNING)\n", (476, 571), False, 'import logging\n'), ((845, 872... |
#coding=utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import argparse
import numpy as np
import PIL.Image as Image
import tensorflow as tf
import retrain as retrain
from count_ops import load_graph
from sklearn.decomposition... | [
"numpy.mean",
"os.listdir",
"sklearn.decomposition.PCA",
"tensorflow.placeholder",
"tensorflow.train.Saver",
"tensorflow.Session",
"os.path.join",
"numpy.stack",
"numpy.array",
"nets.nets_factory.get_network_fn",
"sys.path.append",
"xlsxwriter.Workbook",
"tensorflow.get_default_graph"
] | [((450, 570), 'sys.path.append', 'sys.path.append', (['"""/home/deepl/PHICOMM/FoodAI/FoodAi/tensorflow/tensorflow_models/models/research/PHICOMM/slim"""'], {}), "(\n '/home/deepl/PHICOMM/FoodAI/FoodAi/tensorflow/tensorflow_models/models/research/PHICOMM/slim'\n )\n", (465, 570), False, 'import sys\n'), ((628, 644... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
class myVGG16(nn.Module):
def __init__(self, num_output,inp_size):
"""
Model Definition
"""
super(myVGG16, self).__init__()
feature_size = int(inp_size/16)
self.features =... | [
"torch.nn.ReLU",
"torch.nn.Dropout",
"torch.nn.init.constant_",
"torch.nn.init.kaiming_normal_",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.Linear",
"torch.nn.init.normal_"
] | [((348, 400), 'torch.nn.Conv2d', 'nn.Conv2d', (['(3)', '(64)'], {'kernel_size': '(3)', 'stride': '(1)', 'padding': '(1)'}), '(3, 64, kernel_size=3, stride=1, padding=1)\n', (357, 400), True, 'import torch.nn as nn\n'), ((414, 435), 'torch.nn.ReLU', 'nn.ReLU', ([], {'inplace': '(True)'}), '(inplace=True)\n', (421, 435),... |
from app import db , login_manager
from flask_login import UserMixin
from datetime import datetime
@login_manager.user_loader
def load_user(user_id):
return User.query.get(int(user_id))
class User(db.Model,UserMixin):
__tablename__ = 'users'
id = db.Column(db.Integer , primary_key = True)
time = db.C... | [
"app.db.String",
"app.db.Column"
] | [((262, 301), 'app.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (271, 301), False, 'from app import db, login_manager\n'), ((316, 360), 'app.db.Column', 'db.Column', (['db.DateTime'], {'default': 'datetime.now'}), '(db.DateTime, default=datetime.now)\n', (325... |
import json
import requests
class Actions(object):
__module__ = 'trello'
def __init__(self, apikey, token=None):
self._apikey = apikey
self._token = token
def get(self, idAction, display=None, entities=None, fields=None, member=None, member_fields=None, memberCreator=None, memberCreator_f... | [
"json.loads"
] | [((711, 732), 'json.loads', 'json.loads', (['resp.text'], {}), '(resp.text)\n', (721, 732), False, 'import json\n'), ((976, 997), 'json.loads', 'json.loads', (['resp.text'], {}), '(resp.text)\n', (986, 997), False, 'import json\n'), ((1261, 1282), 'json.loads', 'json.loads', (['resp.text'], {}), '(resp.text)\n', (1271,... |
import logging
import urllib.parse
from collections import defaultdict
import dask.array as da
import dask.dataframe as dd
import lightgbm
import numpy as np
import pandas as pd
from dask import delayed
from dask.distributed import wait, default_client, get_worker
from lightgbm.basic import _safe_call, _LIB
from toolz... | [
"logging.getLogger",
"dask.distributed.get_worker",
"pandas.Series",
"dask.distributed.default_client",
"lightgbm.basic._LIB.LGBM_NetworkFree",
"dask.distributed.wait",
"numpy.array",
"sparse.concatenate",
"toolz.assoc",
"collections.defaultdict",
"toolz.first",
"numpy.concatenate",
"pandas.... | [((484, 511), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (501, 511), False, 'import logging\n'), ((3251, 3262), 'dask.distributed.wait', 'wait', (['parts'], {}), '(parts)\n', (3255, 3262), False, 'from dask.distributed import wait, default_client, get_worker\n'), ((3565, 3582), 'colle... |
import math
speed = float(input())
fuel = float(input())
time_spend = 3
distance = 384400
time = math.ceil(distance * 2) / speed
time = time + time_spend
overall_fuel = (fuel * distance * 2) / 100
print(math.ceil(time))
print(math.ceil(overall_fuel))
| [
"math.ceil"
] | [((98, 121), 'math.ceil', 'math.ceil', (['(distance * 2)'], {}), '(distance * 2)\n', (107, 121), False, 'import math\n'), ((204, 219), 'math.ceil', 'math.ceil', (['time'], {}), '(time)\n', (213, 219), False, 'import math\n'), ((227, 250), 'math.ceil', 'math.ceil', (['overall_fuel'], {}), '(overall_fuel)\n', (236, 250),... |
#!/usr/bin/python
import re
def validateHost(ip, port, parser):
# Check for correct Port address.
# up to (65535).
port_pattern = re.compile(
"^0*(?:6553[0-5]|655[0-2]\d|65[0-4]\d{2}|6[0-4]\d{3}|[1-5]\d{4}|[1-9]\d{1,3}|\d)$")
check_port = port_pattern.match(port)
# Check for correct IP ad... | [
"re.compile"
] | [((145, 255), 're.compile', 're.compile', (['"""^0*(?:6553[0-5]|655[0-2]\\\\d|65[0-4]\\\\d{2}|6[0-4]\\\\d{3}|[1-5]\\\\d{4}|[1-9]\\\\d{1,3}|\\\\d)$"""'], {}), "(\n '^0*(?:6553[0-5]|655[0-2]\\\\d|65[0-4]\\\\d{2}|6[0-4]\\\\d{3}|[1-5]\\\\d{4}|[1-9]\\\\d{1,3}|\\\\d)$'\n )\n", (155, 255), False, 'import re\n'), ((375, ... |
from openql import openql as ql
import os
curdir = os.path.dirname(__file__)
output_dir = os.path.join(curdir, 'visualizer_example_output')
ql.set_option('output_dir', output_dir)
ql.set_option('optimize', 'no')
ql.set_option('scheduler', 'ASAP')
#ql.set_option('log_level', 'LOG_DEBUG')
ql.set_option('log_level', 'LO... | [
"openql.openql.Program",
"os.path.join",
"openql.openql.Compiler",
"os.path.dirname",
"openql.openql.Kernel",
"openql.openql.set_option"
] | [((52, 77), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (67, 77), False, 'import os\n'), ((91, 140), 'os.path.join', 'os.path.join', (['curdir', '"""visualizer_example_output"""'], {}), "(curdir, 'visualizer_example_output')\n", (103, 140), False, 'import os\n'), ((142, 181), 'openql.openq... |
__author__ = 'igor'
import numpy as np
from pandas.io.parsers import read_csv
from sklearn.utils import shuffle
import os
F_TRAIN = 'data/training.csv'
F_TEST = 'data/test.csv'
def load(test=False, cols=None):
'''
如果test为真则读取test数据,否则读取训练数据
'''
fname = F_TEST if test else F_TRAIN
df = read_csv(os... | [
"sklearn.utils.shuffle",
"numpy.fromstring",
"numpy.vstack",
"os.path.expanduser"
] | [((318, 343), 'os.path.expanduser', 'os.path.expanduser', (['fname'], {}), '(fname)\n', (336, 343), False, 'import os\n'), ((605, 634), 'numpy.vstack', 'np.vstack', (["df['Image'].values"], {}), "(df['Image'].values)\n", (614, 634), True, 'import numpy as np\n'), ((948, 978), 'sklearn.utils.shuffle', 'shuffle', (['X', ... |
from kazoo.client import KazooClient
import threading
import time
import random
import json
import logging
class RangerClient(threading.Thread):
def __init__(self, zk_hosts, namespace, service_name, endpoint, protocol='http', refresh_interval=2):
threading.Thread.__init__(self)
self.namespace = na... | [
"logging.getLogger",
"threading.Thread.__init__",
"json.loads",
"kazoo.client.KazooClient",
"time.sleep"
] | [((261, 292), 'threading.Thread.__init__', 'threading.Thread.__init__', (['self'], {}), '(self)\n', (286, 292), False, 'import threading\n'), ((557, 590), 'logging.getLogger', 'logging.getLogger', (['"""RangerClient"""'], {}), "('RangerClient')\n", (574, 590), False, 'import logging\n'), ((609, 652), 'kazoo.client.Kazo... |
"""
Module: tfrecords
Tfrecords creation and reader for improved performance across multi-gpu
There were a tradeoffs made in this repo. It would be natural to save the generated prepreprocessed image to tfrecord from the generator. This results in enormous (100x) files.
"""
import tensorflow as tf
import os
import cs... | [
"tensorflow.unstack",
"tensorflow.train.Int64List",
"numpy.array",
"tensorflow.io.FixedLenFeature",
"tensorflow.cast",
"pandas.concat",
"os.mkdir",
"pandas.DataFrame",
"tensorflow.stack",
"tensorflow.io.TFRecordWriter",
"tensorflow.subtract",
"deepforest.preprocess.compute_windows",
"tensorf... | [((1942, 1958), 'numpy.array', 'np.array', (['raster'], {}), '(raster)\n', (1950, 1958), True, 'import numpy as np\n'), ((2390, 2456), 'deepforest.preprocess.compute_windows', 'preprocess.compute_windows', (['numpy_image', 'patch_size', 'patch_overlap'], {}), '(numpy_image, patch_size, patch_overlap)\n', (2416, 2456), ... |
# a robot with put/get items interface
import struct
MOTOR_ID = 0x01
ODOMETRY_ID = 0x06
LASER_ID = 0x07
GYRO_ID = 0x0A
class Robot:
def __init__(self, get, put, annot=None, term=LASER_ID):
"provide input and output methods"
self.get = get
self.put = put
self.term = term
... | [
"struct.unpack"
] | [((2425, 2452), 'struct.unpack', 'struct.unpack', (['""">hhh"""', 'data'], {}), "('>hhh', data)\n", (2438, 2452), False, 'import struct\n'), ((1892, 1938), 'struct.unpack', 'struct.unpack', (["('>' + 'H' * 271)", 'data[:2 * 271]'], {}), "('>' + 'H' * 271, data[:2 * 271])\n", (1905, 1938), False, 'import struct\n')] |
# PROGRAMMER: <NAME>
# DATE CREATED: 6/1/2020
# FILE PURPOSE: Predict the image using a pretrained model
#
#imports python modules
from time import time, sleep
import sys
#imports functions created for this program
from get_arguments import get_train_args
from get_arguments import get_predict_args
import helper
fro... | [
"pandas.Series",
"torch.nn.ReLU",
"torch.nn.Dropout",
"torch.load",
"helper.labelMapping",
"helper.process_image",
"torch.exp",
"torchvision.models.alexnet",
"torchvision.models.resnet18",
"torch.tensor",
"torch.cuda.is_available",
"torch.nn.Linear",
"torch.nn.LogSoftmax",
"torch.no_grad",... | [((752, 758), 'time.time', 'time', ([], {}), '()\n', (756, 758), False, 'from time import time, sleep\n'), ((808, 826), 'get_arguments.get_predict_args', 'get_predict_args', ([], {}), '()\n', (824, 826), False, 'from get_arguments import get_predict_args\n'), ((1261, 1267), 'time.time', 'time', ([], {}), '()\n', (1265,... |
import tensorflow as tf
import tensorflow.keras as keras
from tensorflow.keras import layers
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.metrics import auc,precision_recall_curve,roc_curve,confusion_matrix
import os,sys
import pickle
def draw_ROC(y_true,y_pred):
fpr,tpr,_... | [
"pandas.read_csv",
"matplotlib.pyplot.ylabel",
"tensorflow.keras.losses.MeanSquaredError",
"sklearn.metrics.auc",
"tensorflow.keras.layers.BatchNormalization",
"numpy.array",
"tensorflow.keras.callbacks.EarlyStopping",
"sklearn.metrics.roc_curve",
"tensorflow.keras.layers.Dense",
"numpy.arange",
... | [((9766, 9780), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (9778, 9780), True, 'import matplotlib.pyplot as plt\n'), ((10178, 10188), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (10186, 10188), True, 'import matplotlib.pyplot as plt\n'), ((10223, 10237), 'matplotlib.pyplot.subplots', 'p... |
from enum import IntEnum
from sqlalchemy import Integer, VARCHAR, BOOLEAN, TIMESTAMP, Column
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.sql import func
from sqlalchemy.orm import validates
Base = declarative_base()
class ImageUseType(IntEnum):
UseTypeGeneral = 1
UseTypeUserIcon ... | [
"sqlalchemy.VARCHAR",
"sqlalchemy.sql.func.now",
"sqlalchemy.orm.validates",
"sqlalchemy.TIMESTAMP",
"sqlalchemy.ext.declarative.declarative_base",
"sqlalchemy.Column"
] | [((227, 245), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', ([], {}), '()\n', (243, 245), False, 'from sqlalchemy.ext.declarative import declarative_base\n'), ((496, 529), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)'}), '(Integer, primary_key=True)\n', (502, 529), False, 'f... |
from datetime import date
__version__ = "0.0.1"
__author__ = "<NAME>"
__author_email__ = "<EMAIL>"
__copyright__ = u"Copyright (c) 2017-{}, {} <{}>".format(
date.today().year, __author__, __author_email__
)
__website__ = "https://benvial.github.io/ferromtm"
__license__ = license = "MIT"
__status__ = "Development S... | [
"datetime.date.today"
] | [((162, 174), 'datetime.date.today', 'date.today', ([], {}), '()\n', (172, 174), False, 'from datetime import date\n')] |
import redis
class Redis:
@classmethod
def setex(cls, name, time, value):
r = redis.StrictRedis(host='127.0.0.1', port=6379, db=0)
r.setex(name, time, value)
@classmethod
def get(cls, name):
r = redis.StrictRedis(host='127.0.0.1', port=6379, db=0)
value = r.get(name)
... | [
"redis.StrictRedis"
] | [((96, 148), 'redis.StrictRedis', 'redis.StrictRedis', ([], {'host': '"""127.0.0.1"""', 'port': '(6379)', 'db': '(0)'}), "(host='127.0.0.1', port=6379, db=0)\n", (113, 148), False, 'import redis\n'), ((238, 290), 'redis.StrictRedis', 'redis.StrictRedis', ([], {'host': '"""127.0.0.1"""', 'port': '(6379)', 'db': '(0)'}),... |
from math import prod
from itertools import combinations
weights = tuple(map(int, open('input').read().splitlines()))
def solve(nb_group):
targeted_weight = sum(weights) // nb_group
i = 0
valid_combinations = None
while not valid_combinations:
i += 1
valid_combinations = tuple(
... | [
"itertools.combinations"
] | [((355, 379), 'itertools.combinations', 'combinations', (['weights', 'i'], {}), '(weights, i)\n', (367, 379), False, 'from itertools import combinations\n')] |
import typing
import dataclasses as dc
from .raw_client import RawClient
T = typing.TypeVar('T')
@dc.dataclass
class ApiStorage:
_client: RawClient
_apis: typing.Dict[typing.Type[typing.Any], typing.Any] = dc.field(default_factory=dict)
def get_api(self, api_type: typing.Type[T]) -> T:
if not i... | [
"dataclasses.field",
"typing.TypeVar"
] | [((79, 98), 'typing.TypeVar', 'typing.TypeVar', (['"""T"""'], {}), "('T')\n", (93, 98), False, 'import typing\n'), ((218, 248), 'dataclasses.field', 'dc.field', ([], {'default_factory': 'dict'}), '(default_factory=dict)\n', (226, 248), True, 'import dataclasses as dc\n')] |
import nextcord
import bot.decorators as decorators
import bot.utils as utils
class Hangman:
def __init__(self, client):
self.client = client
self.color = utils.colors['purple']
self.description = 'A guessing game for two or more players'
self.default_deletion_time = 24
@deco... | [
"bot.utils.reset_message_view",
"bot.utils.random_color",
"bot.utils.delete_button",
"bot.utils.UtilityEmbed",
"bot.utils.delta_seconds_timestamp"
] | [((418, 457), 'bot.utils.UtilityEmbed', 'utils.UtilityEmbed', ([], {'embed': 'msg.embeds[0]'}), '(embed=msg.embeds[0])\n', (436, 457), True, 'import bot.utils as utils\n'), ((1494, 1533), 'bot.utils.UtilityEmbed', 'utils.UtilityEmbed', ([], {'embed': 'msg.embeds[0]'}), '(embed=msg.embeds[0])\n', (1512, 1533), True, 'im... |
#### import the simple module from the paraview
from paraview.simple import *
from paraview.vtk.numpy_interface import dataset_adapter as dsa
paraview.simple._DisableFirstRenderCameraReset()
#smarttinylabfoam = FindSource('Smarttinylab.foam')
#By not selecting something, do we retain the user selection??
# create a ... | [
"paraview.vtk.numpy_interface.dataset_adapter.WrapDataObject"
] | [((488, 511), 'paraview.vtk.numpy_interface.dataset_adapter.WrapDataObject', 'dsa.WrapDataObject', (['Raw'], {}), '(Raw)\n', (506, 511), True, 'from paraview.vtk.numpy_interface import dataset_adapter as dsa\n')] |
import numpy
from PIL import Image
import scipy.ndimage
import sys
path = sys.argv[1]
region = sys.argv[2]
x_start = int(sys.argv[3])
y_start = int(sys.argv[4])
x_end = int(sys.argv[5])
y_end = int(sys.argv[6])
out_fname = sys.argv[7]
x_len = x_end - x_start
y_len = y_end - y_start
merged_im = numpy.zeros((x_len * 4... | [
"numpy.zeros"
] | [((298, 357), 'numpy.zeros', 'numpy.zeros', (['(x_len * 4096, y_len * 4096, 3)'], {'dtype': '"""uint8"""'}), "((x_len * 4096, y_len * 4096, 3), dtype='uint8')\n", (309, 357), False, 'import numpy\n')] |
#!/usr/bin/python
from modules.questions_downloader import questions_downloader
from modules.questions_scrape import questions_scrape
from modules.store_json import store_json
from modules.images_downloader import images_downloader
from modules.pdf_downloader import pdf_downloader
from modules.pdf_images_scraper impor... | [
"modules.images_downloader.images_downloader",
"modules.questions_downloader.questions_downloader",
"modules.images_filter.images_filter",
"modules.questions_scrape.questions_scrape",
"modules.pdf_images_scraper.pdf_images_scraper",
"modules.pdf_downloader.pdf_downloader",
"modules.store_json.store_json... | [((1188, 1214), 'modules.questions_scrape.questions_scrape', 'questions_scrape', (['base_url'], {}), '(base_url)\n', (1204, 1214), False, 'from modules.questions_scrape import questions_scrape\n'), ((1387, 1444), 'modules.pdf_images_scraper.pdf_images_scraper', 'pdf_images_scraper', (['download_directory', 'images_outp... |
# Copyright 2014 SAP AG or an SAP affiliate company.
#
# 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... | [
"logging.getLogger",
"struct.calcsize",
"struct.pack",
"codecs.lookup",
"time.localtime",
"atexit.register"
] | [((1315, 1342), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1332, 1342), False, 'import logging\n'), ((15337, 15366), 'atexit.register', 'atexit.register', (['self.__del__'], {}), '(self.__del__)\n', (15352, 15366), False, 'import atexit\n'), ((12269, 12282), 'struct.calcsize', 'calcs... |
#!/usr/bin/env python
import rospy
from flexbe_core import EventState, Logger
from flexbe_core.proxy import ProxyServiceCaller
from sensor_msgs.msg import PointCloud2
from armada_flexbe_utilities.srv import ConcatenatePointCloud, ConcatenatePointCloudResponse, ConcatenatePointCloudRequest
class concatenatePointClou... | [
"flexbe_core.Logger.loginfo",
"flexbe_core.proxy.ProxyServiceCaller",
"rospy.wait_for_service"
] | [((1746, 1789), 'rospy.wait_for_service', 'rospy.wait_for_service', (['self._service_topic'], {}), '(self._service_topic)\n', (1768, 1789), False, 'import rospy\n'), ((1822, 1886), 'flexbe_core.proxy.ProxyServiceCaller', 'ProxyServiceCaller', (['{self._service_topic: ConcatenatePointCloud}'], {}), '({self._service_topi... |
from django.test import TestCase
from django.urls import resolve, reverse
from . import views
from django.contrib.staticfiles import finders
from .models import Projects
from .forms import ProjectForm
from django.core.files.uploadedfile import SimpleUploadedFile
class TestProjectsUrl(TestCase):
def test_project_... | [
"django.urls.resolve",
"django.core.files.uploadedfile.SimpleUploadedFile",
"django.contrib.staticfiles.finders.find",
"django.urls.reverse"
] | [((355, 378), 'django.urls.reverse', 'reverse', (['"""viewprojects"""'], {}), "('viewprojects')\n", (362, 378), False, 'from django.urls import resolve, reverse\n'), ((506, 527), 'django.urls.reverse', 'reverse', (['"""addproject"""'], {}), "('addproject')\n", (513, 527), False, 'from django.urls import resolve, revers... |
from fnmatch import fnmatch
import regex as re
from dbcog.models.enum_types import AwokenSkills
from dbcog.models.monster_model import MonsterModel
from dbcog.token_mappings import AWAKENING_TOKENS, AWOKEN_SKILL_MAP, BOOL_MONSTER_ATTRIBUTE_ALIASES, \
BOOL_MONSTER_ATTRIBUTE_NAMES, \
NUMERIC_MONSTER_ATTRIBUTE_A... | [
"regex.search",
"regex.escape",
"dbcog.token_mappings.NUMERIC_MONSTER_ATTRIBUTE_ALIASES.items",
"dbcog.token_mappings.BOOL_MONSTER_ATTRIBUTE_ALIASES.items",
"regex.fullmatch",
"dbcog.token_mappings.STRING_MONSTER_ATTRIBUTE_ALIASES.items",
"fnmatch.fnmatch",
"dbcog.models.enum_types.AwokenSkills",
"d... | [((1747, 1785), 'regex.fullmatch', 're.fullmatch', (['self.RE_MATCH', 'fullvalue'], {}), '(self.RE_MATCH, fullvalue)\n', (1759, 1785), True, 'import regex as re\n'), ((513, 525), 'regex.escape', 're.escape', (['t'], {}), '(t)\n', (522, 525), True, 'import regex as re\n'), ((2469, 2493), 'dbcog.token_mappings.AWOKEN_SKI... |
from typing import List
from django import forms
from django.contrib.auth import get_user_model
from django.contrib.auth.models import User
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from bookmarks.utils import unique
from bookmarks.validators impo... | [
"bookmarks.utils.unique",
"django.contrib.auth.get_user_model",
"django.db.models.TextField",
"django.forms.CharField",
"django.db.models.ManyToManyField",
"django.db.models.BooleanField",
"django.forms.Textarea",
"django.db.models.DateTimeField",
"django.db.models.CharField",
"bookmarks.validator... | [((382, 413), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(64)'}), '(max_length=64)\n', (398, 413), False, 'from django.db import models\n'), ((431, 453), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {}), '()\n', (451, 453), False, 'from django.db import models\n'), ((1051, ... |
import re
from app.models import Deck, Card, Collection
def parse_paste(txt, col_type=Deck):
# Parse text chunk for card names and card quantities
# Returns dict of name : {qty: int}
# Standard formatting is qty card_name
# blank line
# sideboard
if col_type != Deck:
board = None
... | [
"re.compile"
] | [((365, 428), 're.compile', 're.compile', (['"""(?P<qty>\\\\d{1,2})\\\\s+(?P<name>(\\\\w|\\\\s+)+)(\\\\n|$)"""'], {}), "('(?P<qty>\\\\d{1,2})\\\\s+(?P<name>(\\\\w|\\\\s+)+)(\\\\n|$)')\n", (375, 428), False, 'import re\n')] |
#!/usr/bin/env python
# coding=utf-8
# Copyright © 2016 ButenkoMS. All rights reserved. Contacts: <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lice... | [
"cengal.code_flow_control.ResultExistence",
"collections.deque",
"cengal.code_inspection.set_profiler",
"cengal.code_flow_control.ResultCache"
] | [((1623, 1642), 'cengal.code_inspection.set_profiler', 'set_profiler', (['(False)'], {}), '(False)\n', (1635, 1642), False, 'from cengal.code_inspection import set_profiler\n'), ((3977, 3990), 'cengal.code_flow_control.ResultCache', 'ResultCache', ([], {}), '()\n', (3988, 3990), False, 'from cengal.code_flow_control im... |
import click
from pathlib import Path
from pathfinder.utils import phybeast_prepare_metadata_file
@click.command()
@click.option(
"--meta_data", "-m", default="input_alignment.fasta", type=Path,
help="Input meta data file, tab-delimited, includes: name, date columns.",
)
@click.option(
"--prep", "-p", de... | [
"click.option",
"click.command",
"pathfinder.utils.phybeast_prepare_metadata_file"
] | [((102, 117), 'click.command', 'click.command', ([], {}), '()\n', (115, 117), False, 'import click\n'), ((119, 281), 'click.option', 'click.option', (['"""--meta_data"""', '"""-m"""'], {'default': '"""input_alignment.fasta"""', 'type': 'Path', 'help': '"""Input meta data file, tab-delimited, includes: name, date column... |
""" Manager Module """
import inspect
from masonite.exceptions import (DriverNotFound,
MissingContainerBindingNotFound,
UnacceptableDriverType)
class Manager:
"""Base Manager Class
"""
config = None
driver_prefix = None
def __in... | [
"inspect.isclass"
] | [((2334, 2357), 'inspect.isclass', 'inspect.isclass', (['driver'], {}), '(driver)\n', (2349, 2357), False, 'import inspect\n')] |
#!/usr/bin/env python
# Copyright JS Foundation and other contributors, http://js.foundation
#
# 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.... | [
"os.path.exists",
"os.path.isabs",
"argparse.ArgumentParser",
"os.makedirs",
"subprocess.Popen",
"os.path.join",
"multiprocessing.cpu_count",
"shutil.rmtree",
"os.path.isfile",
"subprocess.call",
"sys.exit",
"os.uname"
] | [((981, 991), 'os.uname', 'os.uname', ([], {}), '()\n', (989, 991), False, 'import os\n'), ((1278, 1317), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'add_help': '(False)'}), '(add_help=False)\n', (1301, 1317), False, 'import argparse\n'), ((1828, 2141), 'argparse.ArgumentParser', 'argparse.ArgumentPars... |
# Auto generated by generator.py. Delete this line if you make modification.
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
XPATH = {
'name' : "//div[@id='page']/div[2]/table/tbody/tr/td[3]/table[1]/tbody/tr[2]/td[2]/table/tbody/tr/td[2]/h1",
'price' : "//div[@id='page']/div[2]... | [
"scrapy.linkextractors.LinkExtractor"
] | [((872, 934), 'scrapy.linkextractors.LinkExtractor', 'LinkExtractor', ([], {'allow': "['/[a-zA-Z0-9-]+_product_\\\\d+_\\\\d+.html']"}), "(allow=['/[a-zA-Z0-9-]+_product_\\\\d+_\\\\d+.html'])\n", (885, 934), False, 'from scrapy.linkextractors import LinkExtractor\n'), ((960, 1017), 'scrapy.linkextractors.LinkExtractor',... |
from matplotlib import pyplot as plt
import unittest
from optimism.JaxConfig import *
from optimism.phasefield import PhaseFieldThresholdPlastic
from optimism import TensorMath
from optimism.phasefield.MaterialPointSimulator import MaterialPointSimulator
plotting=False
E = 10.0
nu = 0.25
# Gc goes here in order
l = 1... | [
"optimism.phasefield.PhaseFieldThresholdPlastic.energy_density",
"optimism.phasefield.PhaseFieldThresholdPlastic.compute_state_new",
"matplotlib.pyplot.savefig",
"unittest.main",
"optimism.phasefield.PhaseFieldThresholdPlastic.make_initial_state",
"optimism.phasefield.MaterialPointSimulator.MaterialPointS... | [((461, 524), 'optimism.phasefield.PhaseFieldThresholdPlastic.make_properties', 'PhaseFieldThresholdPlastic.make_properties', (['E', 'nu', 'Gc', 'l', 'Y0', 'H'], {}), '(E, nu, Gc, l, Y0, H)\n', (503, 524), False, 'from optimism.phasefield import PhaseFieldThresholdPlastic\n'), ((619, 743), 'optimism.phasefield.PhaseFie... |
from flask_socketio import SocketIO
from flask import Flask, render_template, request
from time import sleep
from threading import Thread, Event
from flask_autoindex import AutoIndex
import logging
import os
import getpass
import sys
from shongololo import start_up as SU
from shongololo import sys_admin as SA
from shon... | [
"flask.render_template",
"shongololo.sys_admin.mk_numbered_nd",
"flask.Flask",
"shongololo.sys_admin.close_sensors",
"flask_socketio.SocketIO",
"time.sleep",
"shongololo.sys_admin.find_devices",
"sys.exit",
"getpass.getuser",
"shongololo.start_up.start_up",
"shongololo.sys_admin.if_mk_dir",
"s... | [((456, 473), 'getpass.getuser', 'getpass.getuser', ([], {}), '()\n', (471, 473), False, 'import getpass\n'), ((778, 793), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (783, 793), False, 'from flask import Flask, render_template, request\n'), ((847, 860), 'flask_socketio.SocketIO', 'SocketIO', (['app'], ... |
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class BibloiConfig(AppConfig): # Our app config class
name = 'pergamum.bibloi'
verbose_name = _("Articles Database")
| [
"django.utils.translation.ugettext_lazy"
] | [((196, 218), 'django.utils.translation.ugettext_lazy', '_', (['"""Articles Database"""'], {}), "('Articles Database')\n", (197, 218), True, 'from django.utils.translation import ugettext_lazy as _\n')] |
# -*- coding: utf-8 -*-
try:
import json
except ImportError:
import simplejson as json
import copy
from eclcli.common import command
from eclcli.common import utils
from eclcli.i18n import _ # noqa
class ListOperation(command.Lister):
def get_parser(self, prog_name):
parser = super(ListOperatio... | [
"simplejson.dumps",
"simplejson.loads",
"eclcli.common.utils.get_item_properties",
"copy.deepcopy"
] | [((858, 880), 'copy.deepcopy', 'copy.deepcopy', (['columns'], {}), '(columns)\n', (871, 880), False, 'import copy\n'), ((2390, 2410), 'simplejson.loads', 'json.loads', (['req_body'], {}), '(req_body)\n', (2400, 2410), True, 'import simplejson as json\n'), ((2520, 2557), 'eclcli.common.utils.get_item_properties', 'utils... |
"""
Contains useful graphic generators. Currently, effect measure plots and functional form assessment plots
are implemented. Uses matplotlib to generate graphics. Future inclusions include forest plots
Contents:
Functional form assessment- func_form_plot()
Forest plot/ effect measure plot- EffectMeasurePlot()
... | [
"matplotlib.ticker.NullFormatter",
"numpy.log",
"statsmodels.api.families.family.Binomial",
"matplotlib.ticker.ScalarFormatter",
"statsmodels.formula.api.glm",
"scipy.stats.norm.cdf",
"statsmodels.api.families.family.Gaussian",
"pandas.qcut",
"numpy.where",
"numpy.max",
"numpy.linspace",
"matp... | [((16314, 16323), 'matplotlib.pyplot.gca', 'plt.gca', ([], {}), '()\n', (16321, 16323), True, 'import matplotlib.pyplot as plt\n'), ((18833, 18861), 'pandas.concat', 'pd.concat', (['[rf, fff]'], {'axis': '(1)'}), '([rf, fff], axis=1)\n', (18842, 18861), True, 'import pandas as pd\n'), ((20839, 20848), 'matplotlib.pyplo... |
import smart_imports
smart_imports.all()
V = lexicon_relations.VARIABLE
KEYS = [('ACTION_EVENT_HABIT_IN_PLACE_AGGRESSIVE_ARTIFACT', 40000, 'Дневник: В городе, черты, агрессивность (артефакт)', relations.LEXICON_GROUP.ACTION_EVENT,
'События при посещении города агрессивным героем (артефакт)',
[V.... | [
"smart_imports.all"
] | [((23, 42), 'smart_imports.all', 'smart_imports.all', ([], {}), '()\n', (40, 42), False, 'import smart_imports\n')] |
import math
import cloudpickle
import torch
import numpy as np
from collections import OrderedDict
def save_checkpoint(state, filename='checkpoint.pkl'):
data = cloudpickle.dumps(state)
with open(filename, 'wb') as fi:
fi.write(data)
def load_checkpoint(filename='checkpoint.pkl'):
with open(fil... | [
"cloudpickle.dumps",
"cloudpickle.load",
"numpy.max"
] | [((168, 192), 'cloudpickle.dumps', 'cloudpickle.dumps', (['state'], {}), '(state)\n', (185, 192), False, 'import cloudpickle\n'), ((964, 978), 'numpy.max', 'np.max', (['values'], {}), '(values)\n', (970, 978), True, 'import numpy as np\n'), ((355, 375), 'cloudpickle.load', 'cloudpickle.load', (['fi'], {}), '(fi)\n', (3... |
# coding: utf-8
"""
Accounting Extension
These APIs allow you to interact with HubSpot's Accounting Extension. It allows you to: * Specify the URLs that HubSpot will use when making webhook requests to your external accounting system. * Respond to webhook calls made to your external accounting system by HubSp... | [
"six.iteritems",
"hubspot.crm.extensions.accounting.configuration.Configuration",
"re.search"
] | [((3946, 3979), 'six.iteritems', 'six.iteritems', (['self.openapi_types'], {}), '(self.openapi_types)\n', (3959, 3979), False, 'import six\n'), ((1397, 1412), 'hubspot.crm.extensions.accounting.configuration.Configuration', 'Configuration', ([], {}), '()\n', (1410, 1412), False, 'from hubspot.crm.extensions.accounting.... |
# cython: language_level=3
# -*- coding: utf-8 -*-
# *****************************************************************************
# Copyright (c) 2016-2020, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the fo... | [
"numpy.median",
"time.perf_counter",
"dpctl.device_context",
"os.path.abspath",
"numpy.dtype"
] | [((2004, 2023), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (2021, 2023), False, 'import time\n'), ((2076, 2095), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (2093, 2095), False, 'import time\n'), ((2152, 2171), 'numpy.median', 'numpy.median', (['times'], {}), '(times)\n', (2164, 2171), ... |
import numpy as np
import pytest
from vispy.color import Colormap as VispyColormap
from napari.utils.colormaps import Colormap
from napari.utils.colormaps.colormap_utils import (
_MATPLOTLIB_COLORMAP_NAMES,
_VISPY_COLORMAPS_ORIGINAL,
_VISPY_COLORMAPS_TRANSLATIONS,
AVAILABLE_COLORMAPS,
_increment_un... | [
"napari.utils.colormaps.colormap_utils._increment_unnamed_colormap",
"pytest.mark.filterwarnings",
"numpy.random.rand",
"napari.utils.colormaps.Colormap",
"numpy.testing.assert_almost_equal",
"numpy.array",
"napari.utils.colormaps.colormap_utils.AVAILABLE_COLORMAPS.keys",
"pytest.raises",
"numpy.ran... | [((3373, 3422), 'pytest.mark.filterwarnings', 'pytest.mark.filterwarnings', (['"""ignore::UserWarning"""'], {}), "('ignore::UserWarning')\n", (3399, 3422), False, 'import pytest\n'), ((3953, 4002), 'pytest.mark.filterwarnings', 'pytest.mark.filterwarnings', (['"""ignore::UserWarning"""'], {}), "('ignore::UserWarning')\... |
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 21 10:43:03 2020
@author: danish
"""
import cv2 # for capturing videos
import math # for mathematical operations
import pandas as pd
from keras.preprocessing import image # for preprocessing the images
from glob import glob
from tqdm import tqdm
import os
import ... | [
"keras.preprocessing.image.img_to_array",
"cv2.imwrite",
"os.makedirs",
"math.floor",
"numpy.array",
"shutil.rmtree",
"pandas.DataFrame",
"glob.glob",
"keras.preprocessing.image.load_img"
] | [((740, 754), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (752, 754), True, 'import pandas as pd\n'), ((1528, 1566), 'os.makedirs', 'os.makedirs', (['frames_dir'], {'exist_ok': '(True)'}), '(frames_dir, exist_ok=True)\n', (1539, 1566), False, 'import os\n'), ((3390, 3404), 'pandas.DataFrame', 'pd.DataFrame', ... |
# Copyright 1999-2021 Alibaba Group Holding 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 a... | [
"numpy.dtype",
"pytest.raises"
] | [((2325, 2348), 'pytest.raises', 'pytest.raises', (['KeyError'], {}), '(KeyError)\n', (2338, 2348), False, 'import pytest\n'), ((2749, 2772), 'pytest.raises', 'pytest.raises', (['KeyError'], {}), '(KeyError)\n', (2762, 2772), False, 'import pytest\n'), ((3020, 3045), 'pytest.raises', 'pytest.raises', (['ValueError'], {... |
from time import time
from numba import njit, prange
import numpy as np
import pandas as pd
from functools import reduce
from math import sqrt
def factors(n):
step = 2 if n % 2 else 1
return sum(sorted(list(set(reduce(list.__add__,
([i, n // i] for i in range(1, int(sqrt(n)) + 1, step) i... | [
"numba.prange",
"time.time",
"math.sqrt"
] | [((667, 673), 'time.time', 'time', ([], {}), '()\n', (671, 673), False, 'from time import time\n'), ((698, 714), 'numba.prange', 'prange', (['(1)', '(10001)'], {}), '(1, 10001)\n', (704, 714), False, 'from numba import njit, prange\n'), ((915, 921), 'time.time', 'time', ([], {}), '()\n', (919, 921), False, 'from time i... |
"""Implementation of core scheduling algorithms using Gurobi."""
import logging
import os
from collections import defaultdict
from gurobipy import *
import numpy as np
import shelve
import astropy.units as u
import pandas as pd
from collections import defaultdict
from .constants import TIME_BLOCK_SIZE, EXPOSURE_TIME, ... | [
"logging.getLogger",
"pandas.Series",
"numpy.where",
"pandas.merge",
"numpy.sum",
"collections.defaultdict",
"pandas.melt"
] | [((567, 594), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (584, 594), False, 'import logging\n'), ((692, 710), 'collections.defaultdict', 'defaultdict', (['float'], {}), '(float)\n', (703, 710), False, 'from collections import defaultdict\n'), ((1527, 1637), 'pandas.melt', 'pd.melt', (... |
# -*- coding: utf-8 -*-
"""
Created on Sun Oct 3 16:30:52 2021
@author: jakubicek
"""
import os
import numpy as np
import numpy.matlib
import matplotlib.pyplot as plt
# import pandas as pd
# from pathlib import Path
import torch.optim as optim
import glob
import torch.nn as nn
import torch.nn.functional as F
# fro... | [
"torch.nn.ReLU",
"torch.nn.Dropout",
"torch.nn.CrossEntropyLoss",
"numpy.array",
"torch.nn.BatchNorm1d",
"torch.squeeze",
"torch.nn.functional.softmax",
"numpy.arange",
"torch.nn.MaxPool1d",
"numpy.mean",
"torch.nn.LSTM",
"matplotlib.pyplot.plot",
"loaders.Load_cut_gen_h5",
"os.path.normpa... | [((5185, 5260), 'torch.optim.lr_scheduler.StepLR', 'optim.lr_scheduler.StepLR', (['optimizer'], {'step_size': '(30)', 'gamma': '(0.1)', 'verbose': '(True)'}), '(optimizer, step_size=30, gamma=0.1, verbose=True)\n', (5210, 5260), True, 'import torch.optim as optim\n'), ((5419, 5437), 'numpy.array', 'np.array', (['lbl_li... |
import json
import time
from sqlalchemy import insert
from sqlalchemy.sql.expression import bindparam
from autocnet.io.db.model import Points, Measures
from autocnet.utils.serializers import object_hook
from autocnet.transformation.spatial import reproject, og2oc
def watch_insert_queue(queue, queue_name, counter_nam... | [
"autocnet.io.db.model.Measures.__table__.update",
"autocnet.transformation.spatial.og2oc",
"sqlalchemy.insert",
"sqlalchemy.sql.expression.bindparam",
"time.sleep",
"autocnet.transformation.spatial.reproject"
] | [((8879, 8901), 'time.sleep', 'time.sleep', (['sleep_time'], {}), '(sleep_time)\n', (8889, 8901), False, 'import time\n'), ((5259, 5281), 'time.sleep', 'time.sleep', (['sleep_time'], {}), '(sleep_time)\n', (5269, 5281), False, 'import time\n'), ((3434, 3550), 'autocnet.transformation.spatial.reproject', 'reproject', ([... |
import pytest
from eth_utils import (
ValidationError,
)
from eth2._utils import bls
from eth2.beacon.constants import (
GWEI_PER_ETH,
)
from eth2.beacon.enums import (
SignatureDomain,
)
from eth2.beacon.types.blocks import BeaconBlock
from eth2.beacon.types.proposal_signed_data import (
ProposalSig... | [
"eth2.beacon.state_machines.forks.serenity.validation.validate_serenity_proposer_signature",
"tests.eth2.beacon.helpers.mock_validator_record",
"tests.eth2.beacon.test_helpers.get_sample_shard_committees_at_slots",
"eth2.beacon.types.states.BeaconState",
"eth2.beacon.types.blocks.BeaconBlock",
"eth2._util... | [((1785, 1826), 'eth2.beacon.types.blocks.BeaconBlock', 'BeaconBlock', ([], {}), '(**sample_beacon_block_params)\n', (1796, 1826), False, 'from eth2.beacon.types.blocks import BeaconBlock\n'), ((1924, 2013), 'eth2.beacon.types.proposal_signed_data.ProposalSignedData', 'ProposalSignedData', (['state.slot', 'beacon_chain... |
import json
from flask import Flask, jsonify, request
from bot import add, remove, active
app = Flask(__name__)
@app.route("/")
def hello():
return jsonify({'response': 'This is the Barakis API'})
@app.route("/start", methods=['POST'])
def start():
response = json.loads(request.data)
if add(
r... | [
"json.loads",
"flask.Flask",
"bot.remove",
"bot.add",
"bot.active",
"flask.jsonify"
] | [((98, 113), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (103, 113), False, 'from flask import Flask, jsonify, request\n'), ((156, 204), 'flask.jsonify', 'jsonify', (["{'response': 'This is the Barakis API'}"], {}), "({'response': 'This is the Barakis API'})\n", (163, 204), False, 'from flask import Fla... |
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
extensions = Extension(name='tree_collection',
sources=['py_wrapper.pyx',
'../src/ProblemParser.cc',
'../src/MinSqTr... | [
"distutils.extension.Extension",
"distutils.core.setup"
] | [((130, 285), 'distutils.extension.Extension', 'Extension', ([], {'name': '"""tree_collection"""', 'sources': "['py_wrapper.pyx', '../src/ProblemParser.cc', '../src/MinSqTree.cc',\n '../src/newick.cc']", 'language': '"""c++"""'}), "(name='tree_collection', sources=['py_wrapper.pyx',\n '../src/ProblemParser.cc', '... |
#from __future__ import print_function
#from six.moves import range
from math import log
import numpy as np
class MDLP(object):
'''
Entropy-based Minimum description length principle.
'''
def discretize_feature(self, x, binning):
'''
Discretize a feature x with respective to the given ... | [
"numpy.unique",
"numpy.log",
"math.log",
"numpy.argsort",
"numpy.array",
"numpy.append"
] | [((564, 584), 'numpy.array', 'np.array', (['x_discrete'], {}), '(x_discrete)\n', (572, 584), True, 'import numpy as np\n'), ((1090, 1106), 'numpy.array', 'np.array', (['values'], {}), '(values)\n', (1098, 1106), True, 'import numpy as np\n'), ((1619, 1635), 'numpy.log', 'np.log', (['variable'], {}), '(variable)\n', (16... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the PyMVPA package for the
# copyright and license terms.
#
### ### ### ### ###... | [
"mvpa2.misc.stats.compute_ts_boxplot_stats",
"mvpa2.misc.plot.timeseries_boxplot",
"pylab.subplot",
"pylab.xticks",
"pylab.savefig",
"pylab.xlabel",
"numpy.logical_not",
"pylab.figure",
"numpy.array",
"numpy.rad2deg",
"pylab.ylabel",
"pylab.show"
] | [((3992, 4238), 'mvpa2.misc.plot.timeseries_boxplot', 'timeseries_boxplot', (["stats[0]['median']"], {'mean': "stats[0]['mean']", 'std': "stats[0]['std']", 'n': "stats[0]['n']", 'min': "stats[0]['min']", 'max': "stats[0]['max']", 'p25': "stats[0]['p25']", 'p75': "stats[0]['p75']", 'outlierd': 'stats[1]', 'segment_sizes... |
from enum import Enum
from functools import total_ordering
from Utils import File, Time
from IPython.display import HTML, display
import tabulate
class LogOutput(Enum):
CONSOLE = 0
FILE = 1
BOTH = 2
@total_ordering
class LogLevel(Enum):
DEBUG = 0
FINE = 1
INFO = 2
WARNING = 3
ERROR ... | [
"tabulate.tabulate",
"Utils.File.create_directory",
"Utils.Time.get_timestamp"
] | [((2627, 2658), 'Utils.File.create_directory', 'File.create_directory', (['Log.path'], {}), '(Log.path)\n', (2648, 2658), False, 'from Utils import File, Time\n'), ((719, 789), 'tabulate.tabulate', 'tabulate.tabulate', (['data'], {'headers': '"""firstrow"""', 'tablefmt': '"""html"""'}), "(data, headers='firstrow', tabl... |
import sys
import time
import numpy as np
import pandas as pd
import tweepy as twp
from tweepy.streaming import StreamListener
import config
auth = twp.OAuthHandler(config.TWITTER_KEY, config.TWITTER_SECRET)
auth.secure = True
auth.set_access_token(config.TWITTER_ACCESS_TOKEN,
conf... | [
"tweepy.API",
"time.sleep",
"pandas.read_csv",
"tweepy.OAuthHandler"
] | [((161, 220), 'tweepy.OAuthHandler', 'twp.OAuthHandler', (['config.TWITTER_KEY', 'config.TWITTER_SECRET'], {}), '(config.TWITTER_KEY, config.TWITTER_SECRET)\n', (177, 220), True, 'import tweepy as twp\n'), ((355, 368), 'tweepy.API', 'twp.API', (['auth'], {}), '(auth)\n', (362, 368), True, 'import tweepy as twp\n'), ((3... |
from __future__ import annotations
from typing import Union
import torch
def sample_nnoise(
size: tuple[int],
device: Union[torch.device, str],
mean: float=0.,
std: float=1.
) -> torch.Tensor:
return torch.empty(size, device=device).normal_(mean, std)
def sample_unoise(
size: tuple[int],
... | [
"torch.no_grad",
"torch.empty"
] | [((480, 495), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (493, 495), False, 'import torch\n'), ((223, 255), 'torch.empty', 'torch.empty', (['size'], {'device': 'device'}), '(size, device=device)\n', (234, 255), False, 'import torch\n'), ((424, 456), 'torch.empty', 'torch.empty', (['size'], {'device': 'device'}... |
from __future__ import print_function
import os
import shutil
import sys
import tempfile
import unittest
import pandas as pd
import pyspark
import pytest
import sklearn.datasets
from sklearn.neighbors import KNeighborsClassifier
from mlflow.pyfunc import load_pyfunc, spark_udf
from mlflow.pyfunc.spark_model_cache im... | [
"sklearn.neighbors.KNeighborsClassifier",
"os.path.join",
"mlflow.pyfunc.load_pyfunc",
"pyspark.sql.SparkSession.builder.config",
"tempfile.mkdtemp",
"mlflow.pyfunc.spark_udf",
"shutil.rmtree",
"pandas.DataFrame",
"mlflow.pyfunc.spark_model_cache.SparkModelCache.get_or_load",
"mlflow.pyfunc.spark_... | [((665, 723), 'mlflow.pyfunc.spark_udf', 'spark_udf', (['spark', 'model_path', 'run_id'], {'result_type': '"""double"""'}), "(spark, model_path, run_id, result_type='double')\n", (674, 723), False, 'from mlflow.pyfunc import load_pyfunc, spark_udf\n'), ((941, 990), 'tempfile.mkdtemp', 'tempfile.mkdtemp', (['"""mlflow-s... |
import tabula
import pandas as pd
# src = input("type the file name with extension: ")
# page = input("type the page information you want to get: ")
# debug
df = tabula.read_pdf("41589_2021_868_MOESM1_ESM.pdf", pages = "16-17")
# df = tabula.read_pdf(f"{src}", pages = f"{page}")
res = pd.DataFrame()
for i in range(... | [
"tabula.read_pdf",
"pandas.DataFrame"
] | [((164, 227), 'tabula.read_pdf', 'tabula.read_pdf', (['"""41589_2021_868_MOESM1_ESM.pdf"""'], {'pages': '"""16-17"""'}), "('41589_2021_868_MOESM1_ESM.pdf', pages='16-17')\n", (179, 227), False, 'import tabula\n'), ((290, 304), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (302, 304), True, 'import pandas as pd\... |
import pytest
import pyteal as pt
from .compile_asserts import assert_new_v_old
def user_guide_snippet_dynamic_scratch_var() -> pt.Expr:
"""
The user guide docs use the test to illustrate `pt.DynamicScratchVar` usage. pt.If the test breaks, then the user guide docs must be updated along with the test.
... | [
"pyteal.ScratchVar",
"pyteal.DynamicScratchVar",
"pytest.mark.parametrize",
"pytest.raises",
"pyteal.Subroutine",
"pyteal.Int"
] | [((1585, 1650), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""snippet"""', 'USER_GUIDE_SNIPPETS_COPACETIC'], {}), "('snippet', USER_GUIDE_SNIPPETS_COPACETIC)\n", (1608, 1650), False, 'import pytest\n'), ((333, 366), 'pyteal.ScratchVar', 'pt.ScratchVar', (['pt.TealType.uint64'], {}), '(pt.TealType.uint64)\... |
#!/usr/bin/env python3
""" usage: passthrough-serial
"""
import pygame
# coding: utf-8
py_map={
pygame.K_LCTRL:"KEY_LEFT_CTRL",
pygame.K_LSHIFT:"KEY_LEFT_SHIFT",
pygame.K_LALT:"KEY_LEFT_ALT",
pygame.K_LSUPER:"KEY_LEFT_GUI",
pygame.K_RCTRL:"KEY_RIGHT_CTRL",
pygame.K_RSHIFT:"KEY_RIGHT_SHIFT",
... | [
"pygame.init",
"pygame.event.get",
"pygame.display.set_mode",
"struct.pack",
"serial.Serial",
"docopt.docopt"
] | [((2336, 2351), 'docopt.docopt', 'docopt', (['__doc__'], {}), '(__doc__)\n', (2342, 2351), False, 'from docopt import docopt\n'), ((2455, 2468), 'pygame.init', 'pygame.init', ([], {}), '()\n', (2466, 2468), False, 'import sys, pygame\n'), ((2555, 2590), 'serial.Serial', 'serial.Serial', (['"""/dev/ttyUSB0"""', '(9600)'... |
from secml.testing import CUnitTest
from secml.array import CArray
from secml.data import CDataset
from secml.ml.features import CPreProcess
from secml.optim.function import CFunction
from secml.figure import CFigure
from secml.core.constants import eps
class CClassifierTestCases(CUnitTest):
"""Unittests interfa... | [
"secml.testing.CUnitTest.main",
"secml.ml.features.CPreProcess.create_chain",
"secml.figure.CFigure",
"secml.ml.features.CPreProcess.create",
"secml.optim.function.CFunction"
] | [((15509, 15525), 'secml.testing.CUnitTest.main', 'CUnitTest.main', ([], {}), '()\n', (15523, 15525), False, 'from secml.testing import CUnitTest\n'), ((5043, 5081), 'secml.figure.CFigure', 'CFigure', ([], {'width': '(8)', 'height': '(4)', 'fontsize': '(8)'}), '(width=8, height=4, fontsize=8)\n', (5050, 5081), False, '... |
# This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more informations
# Copyright (C) <NAME> <<EMAIL>>
# This program is published under a GPLv2 license
"""
Classes related to the EAP protocol.
"""
from __future__ import absolute_import
from __future__ import print_function
import struct
fro... | [
"scapy.compat.chb",
"scapy.fields.XIntField",
"scapy.fields.PacketField",
"scapy.fields.StrLenField",
"scapy.fields.XStrField",
"scapy.fields.PacketListField",
"scapy.fields.IntField",
"scapy.fields.XStrFixedLenField",
"scapy.utils.issubtype",
"scapy.fields.XStrLenField",
"scapy.fields.LenField"... | [((22447, 22484), 'scapy.packet.bind_layers', 'bind_layers', (['Ether', 'EAPOL'], {'type': '(34958)'}), '(Ether, EAPOL, type=34958)\n', (22458, 22484), False, 'from scapy.packet import Packet, Padding, bind_layers\n'), ((22485, 22547), 'scapy.packet.bind_layers', 'bind_layers', (['Ether', 'EAPOL'], {'dst': '"""01:80:c2... |
import unittest
from pyEpiabm.routine import AbstractPopulationFactory
class TestPopConfig(unittest.TestCase):
"""Test the 'ToyPopConfig' class.
"""
def test_make_pop(self):
"""Tests for a make population method.
"""
with self.assertRaises(NotImplementedError):
Abstrac... | [
"unittest.main",
"pyEpiabm.routine.AbstractPopulationFactory.make_pop"
] | [((383, 398), 'unittest.main', 'unittest.main', ([], {}), '()\n', (396, 398), False, 'import unittest\n'), ((313, 349), 'pyEpiabm.routine.AbstractPopulationFactory.make_pop', 'AbstractPopulationFactory.make_pop', ([], {}), '()\n', (347, 349), False, 'from pyEpiabm.routine import AbstractPopulationFactory\n')] |
# 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 in writing, software
# distributed unde... | [
"senlin.engine.environment.global_env",
"copy.deepcopy"
] | [((772, 793), 'copy.deepcopy', 'copy.deepcopy', (['params'], {}), '(params)\n', (785, 793), False, 'import copy\n'), ((1002, 1026), 'senlin.engine.environment.global_env', 'environment.global_env', ([], {}), '()\n', (1024, 1026), False, 'from senlin.engine import environment\n')] |
# -*- coding: utf-8 -*-
from classytags.arguments import Argument
from classytags.core import Tag, Options
from django import template
from django.template.defaultfilters import safe
register = template.Library()
class RenderPlaceholder(Tag):
name = 'render_placeholder'
options = Options(
Argument('p... | [
"classytags.arguments.Argument",
"django.template.Library"
] | [((195, 213), 'django.template.Library', 'template.Library', ([], {}), '()\n', (211, 213), False, 'from django import template\n'), ((309, 332), 'classytags.arguments.Argument', 'Argument', (['"""placeholder"""'], {}), "('placeholder')\n", (317, 332), False, 'from classytags.arguments import Argument\n'), ((342, 389), ... |
'''
Module with various helpers functions.
'''
import os
import re
import subprocess
import time
import socket
from urllib.parse import urlparse
class GitError(Exception):
pass
def get_git_head_branch(path):
'''
Return the git HEAD branch name by reading from .git/HEAD file.
'''
try:
head... | [
"urllib.parse.urlparse",
"subprocess.Popen",
"os.path.join",
"socket.gethostname",
"re.search"
] | [((1055, 1075), 'socket.gethostname', 'socket.gethostname', ([], {}), '()\n', (1073, 1075), False, 'import socket\n'), ((1239, 1252), 'urllib.parse.urlparse', 'urlparse', (['url'], {}), '(url)\n', (1247, 1252), False, 'from urllib.parse import urlparse\n'), ((1820, 1892), 'subprocess.Popen', 'subprocess.Popen', (['args... |
from bpl_lib.transactions.Transaction import Transaction
from bpl_lib.helpers.Constants import TRANSACTION_TYPE
from bpl_lib.helpers.Util import unhexlify
from bpl_lib.crypto.Keys import Keys
class SecondSignature(Transaction):
def __init__(self, fee, _error_use_class_method=True):
"""
Creates a S... | [
"bpl_lib.helpers.Util.unhexlify",
"bpl_lib.crypto.Keys.Keys"
] | [((2063, 2111), 'bpl_lib.helpers.Util.unhexlify', 'unhexlify', (["self._asset['signature']['publicKey']"], {}), "(self._asset['signature']['publicKey'])\n", (2072, 2111), False, 'from bpl_lib.helpers.Util import unhexlify\n'), ((1249, 1261), 'bpl_lib.crypto.Keys.Keys', 'Keys', (['secret'], {}), '(secret)\n', (1253, 126... |
import os
import logging
# Environment Variables
##Supresses tensorflow warnings and errors, change to 2 to show errors
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # FATAL
logging.getLogger('tensorflow').setLevel(logging.FATAL)
from thesis.models.ResNet50 import resnet50_compile
from thesis.data import data_... | [
"logging.getLogger",
"thesis.data.data_reader_augmentation_train",
"thesis.models.ResNet50.resnet50_compile"
] | [((368, 443), 'thesis.data.data_reader_augmentation_train', 'data_reader_augmentation_train', (['"""data/i2a2-brasil-pneumonia-classification"""'], {}), "('data/i2a2-brasil-pneumonia-classification')\n", (398, 443), False, 'from thesis.data import data_reader_augmentation_train\n'), ((455, 473), 'thesis.models.ResNet50... |
import time
import mock
from cacheorm.backends import MemcachedBackend, RedisBackend, SimpleBackend
from cacheorm.types import to_bytes
def test_general_flow_set_get_delete(backend):
import pickle
key = "foo"
values = ("foo.test", "", 1, pickle.dumps({"test": "foo"}))
year_ttl = 365 * 24 * 60 * 60
... | [
"cacheorm.types.to_bytes",
"pickle.dumps",
"cacheorm.backends.RedisBackend",
"time.sleep",
"cacheorm.backends.SimpleBackend",
"mock.patch.object",
"cacheorm.backends.MemcachedBackend"
] | [((2021, 2042), 'time.sleep', 'time.sleep', (['(1.1 * ttl)'], {}), '(1.1 * ttl)\n', (2031, 2042), False, 'import time\n'), ((2210, 2231), 'time.sleep', 'time.sleep', (['(1.1 * ttl)'], {}), '(1.1 * ttl)\n', (2220, 2231), False, 'import time\n'), ((2672, 2687), 'time.sleep', 'time.sleep', (['(1.1)'], {}), '(1.1)\n', (268... |
# 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 json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class GetRes... | [
"pulumi.InvokeOptions",
"pulumi.runtime.invoke"
] | [((3386, 3408), 'pulumi.InvokeOptions', 'pulumi.InvokeOptions', ([], {}), '()\n', (3406, 3408), False, 'import pulumi\n'), ((3499, 3585), 'pulumi.runtime.invoke', 'pulumi.runtime.invoke', (['"""azure:core/getResources:getResources"""', '__args__'], {'opts': 'opts'}), "('azure:core/getResources:getResources', __args__,\... |
import argparse
import sys, os
parser = argparse.ArgumentParser()
parser.add_argument('pyqlabpath', help='path to PyQLab directory')
parser.add_argument('nbrSegments', type=int, help='nbrSegments')
args = parser.parse_args()
sys.path.append(args.pyqlabpath)
from Libraries import instrumentLib
if 'X6' not in instrumen... | [
"argparse.ArgumentParser",
"Libraries.instrumentLib.write_to_file",
"Libraries.instrumentLib.instrDict.keys",
"sys.exit",
"sys.path.append"
] | [((40, 65), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (63, 65), False, 'import argparse\n'), ((226, 258), 'sys.path.append', 'sys.path.append', (['args.pyqlabpath'], {}), '(args.pyqlabpath)\n', (241, 258), False, 'import sys, os\n'), ((420, 449), 'Libraries.instrumentLib.write_to_file', 'i... |
import unittest
import hypothesis.strategies as st
from hypothesis import given
from four_sum import Solution
class Test(unittest.TestCase):
def test_1(self):
solution = Solution()
expected = set(
[tuple(sorted(i)) for i in [[-2, -1, 1, 2], [-2, 0, 0, 2], [-1, 0, 0, 1]]]
)
... | [
"unittest.main",
"four_sum.Solution",
"hypothesis.strategies.integers"
] | [((841, 856), 'unittest.main', 'unittest.main', ([], {}), '()\n', (854, 856), False, 'import unittest\n'), ((184, 194), 'four_sum.Solution', 'Solution', ([], {}), '()\n', (192, 194), False, 'from four_sum import Solution\n'), ((585, 595), 'four_sum.Solution', 'Solution', ([], {}), '()\n', (593, 595), False, 'from four_... |
#################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"). ... | [
"launch.LaunchDescription",
"launch_ros.actions.Node"
] | [((1350, 1369), 'launch.LaunchDescription', 'LaunchDescription', ([], {}), '()\n', (1367, 1369), False, 'from launch import LaunchDescription\n'), ((1398, 1606), 'launch_ros.actions.Node', 'Node', ([], {'package': '"""object_detection_pkg"""', 'namespace': '"""object_detection_pkg"""', 'executable': '"""object_detectio... |
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 7 12:06:34 2018
@author: mdb99
"""
import unittest
from inc import inc
# import inc
class MyTest(unittest.TestCase):
def test_my_function(self):
self.assertEqual(inc(0), 1)
self.assertEqual(inc(100), 101)
self.assertEqual(inc(1)... | [
"unittest.main",
"inc.inc"
] | [((453, 468), 'unittest.main', 'unittest.main', ([], {}), '()\n', (466, 468), False, 'import unittest\n'), ((236, 242), 'inc.inc', 'inc', (['(0)'], {}), '(0)\n', (239, 242), False, 'from inc import inc\n'), ((273, 281), 'inc.inc', 'inc', (['(100)'], {}), '(100)\n', (276, 281), False, 'from inc import inc\n'), ((314, 32... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
from PyQt5 import QtCore, QtGui
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import QLabel
from src.rightClickHelper.tool.regTool import systemDir
from src.rightClickHelper.tool.systemTool import SystemTool
class DragLabel(QLabel):
s_pathChange = Q... | [
"PyQt5.QtGui.QPixmap",
"PyQt5.QtCore.pyqtSignal",
"src.rightClickHelper.tool.systemTool.SystemTool.getIcon",
"re.search"
] | [((319, 360), 'PyQt5.QtCore.pyqtSignal', 'QtCore.pyqtSignal', (['str'], {'name': '"""pathChange"""'}), "(str, name='pathChange')\n", (336, 360), False, 'from PyQt5 import QtCore, QtGui\n'), ((1486, 1523), 're.search', 're.search', (['"""\\\\..*,-?\\\\d+$"""', 'self.path'], {}), "('\\\\..*,-?\\\\d+$', self.path)\n", (14... |
import json
from behave import *
from mock import MagicMock
from app.component.led import LED
from app.component.modifier.blinker import Blinker
from app.component.resolver.led_resolver import BlinkingApproachingResolver
APPROACHING_IN = str(60*1)
APPROACHING_OUT = str(60*3)
PIN = 6
PINS = [0,1,2,3,4,5]
STOP_ID = 112... | [
"json.dumps",
"mock.MagicMock",
"app.component.resolver.led_resolver.BlinkingApproachingResolver",
"app.component.led.LED"
] | [((960, 988), 'mock.MagicMock', 'MagicMock', ([], {'return_value': 'None'}), '(return_value=None)\n', (969, 988), False, 'from mock import MagicMock\n'), ((1002, 1044), 'app.component.resolver.led_resolver.BlinkingApproachingResolver', 'BlinkingApproachingResolver', (['PINS', 'shifter'], {}), '(PINS, shifter)\n', (1029... |
# Generated from .\C.g4 by ANTLR 4.9.2
from antlr4 import *
from io import StringIO
import sys
if sys.version_info[1] > 5:
from typing import TextIO
else:
from typing.io import TextIO
def serializedATN():
with StringIO() as buf:
buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2x")
... | [
"io.StringIO"
] | [((225, 235), 'io.StringIO', 'StringIO', ([], {}), '()\n', (233, 235), False, 'from io import StringIO\n')] |
#!/usr/bin/env python
import os
import tarfile
import unittest
from flexmock import flexmock
from appscale.datastore.backup import backup_recovery_helper
class FakeTar():
def __init__(self):
self.add_count = 0
def add(self, name):
self.add_count += 1
def close(self):
pass
class TestBRHelper(unit... | [
"appscale.datastore.backup.backup_recovery_helper.mkdir",
"appscale.datastore.backup.backup_recovery_helper.tar_backup_files",
"appscale.datastore.backup.backup_recovery_helper.remove",
"appscale.datastore.backup.backup_recovery_helper.delete_secondary_backup",
"appscale.datastore.backup.backup_recovery_hel... | [((3622, 3637), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3635, 3637), False, 'import unittest\n'), ((535, 589), 'appscale.datastore.backup.backup_recovery_helper.delete_local_backup_file', 'backup_recovery_helper.delete_local_backup_file', (['"""foo"""'], {}), "('foo')\n", (582, 589), False, 'from appscale.... |
# -*- coding:utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
INSTALLED_APPS = (
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.sitemaps",
"django.contrib.admin",
"django.contrib.staticfiles",
"django.contrib.me... | [
"os.path.dirname"
] | [((1907, 1932), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1922, 1932), False, 'import os\n')] |
from modules.object_detection import ObjectDetector
from modules.color_detection import ColorDetector
from modules.text_detection import TextDetector
from modules.scene_classification import SceneClassifier
from collections import Counter
import cv2
def create_knowledge_graph(frame):
"""
create a knowledge gr... | [
"cv2.rectangle",
"modules.scene_classification.SceneClassifier.predict",
"modules.text_detection.TextDetector.detect",
"collections.Counter",
"modules.object_detection.ObjectDetector.predict",
"modules.color_detection.ColorDetector.find_color"
] | [((1218, 1247), 'modules.object_detection.ObjectDetector.predict', 'ObjectDetector.predict', (['frame'], {}), '(frame)\n', (1240, 1247), False, 'from modules.object_detection import ObjectDetector\n'), ((1266, 1282), 'collections.Counter', 'Counter', (['classes'], {}), '(classes)\n', (1273, 1282), False, 'from collecti... |
# -*- encoding: utf-8 -*-
########################################################################
# test/xslt/borrowed/uo_20010503.py
# From original 4Suite cvs:
#This source doc used to bomb cDomlette just on parse, as Uche found out
import os
from amara.lib import iri
from amara.test.xslt.xslt_support import _run... | [
"amara.test.xslt.xslt_support._run_xml",
"os.linesep.replace",
"os.path.dirname",
"os.path.abspath",
"amara.lib.iri.absolutize"
] | [((356, 381), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (371, 381), False, 'import os\n'), ((1758, 1791), 'os.linesep.replace', 'os.linesep.replace', (["'\\r'", '""" """'], {}), "('\\r', ' ')\n", (1776, 1791), False, 'import os\n'), ((1881, 2395), 'amara.test.xslt.xslt_support._r... |
""" Django ORM based store.
Notes:
- Each of the functions defined below must return a json serializable
object, json_response, or valid HttpResponse object
- A json_response creates an HttpResponse object given parameters:
- content: string with the contents of the response
- status: st... | [
"logging.getLogger",
"common.response.json_response",
"random.choice",
"uuid.uuid4"
] | [((533, 570), 'logging.getLogger', 'logging.getLogger', (["('newt.' + __name__)"], {}), "('newt.' + __name__)\n", (550, 570), False, 'import logging\n'), ((3445, 3514), 'common.response.json_response', 'json_response', ([], {'status': '"""ERROR"""', 'status_code': '(501)', 'error': '"""Unimplemented"""'}), "(status='ER... |
from ray import tune
def get_config():
return {
# === Environment ===
"env": "Navigation",
"env_config": tune.grid_search(
[
{"deceleration_zones": None},
{"deceleration_zones": {"center": [[0.0, 0.0]], "decay": [2.0]}},
]
),
... | [
"ray.tune.grid_search"
] | [((135, 254), 'ray.tune.grid_search', 'tune.grid_search', (["[{'deceleration_zones': None}, {'deceleration_zones': {'center': [[0.0, 0.0\n ]], 'decay': [2.0]}}]"], {}), "([{'deceleration_zones': None}, {'deceleration_zones': {\n 'center': [[0.0, 0.0]], 'decay': [2.0]}}])\n", (151, 254), False, 'from ray import tu... |
from base import GAETestCase
from config.template_middleware import TemplateResponse
from routes.courses import new
from tekton.gae.middleware.redirect import RedirectResponse
from student.student_model import Course
__author__ = 'samara'
class NewTeste(GAETestCase):
def test_sucesso(self):
resposta = ne... | [
"routes.courses.new.salvar",
"student.student_model.Course.query"
] | [((318, 340), 'routes.courses.new.salvar', 'new.salvar', ([], {'name': '"""bla"""'}), "(name='bla')\n", (328, 340), False, 'from routes.courses import new\n'), ((653, 665), 'routes.courses.new.salvar', 'new.salvar', ([], {}), '()\n', (663, 665), False, 'from routes.courses import new\n'), ((470, 484), 'student.student_... |
def test_bounds():
from pyvmmonitor_core.math_utils import Bounds
bounds = Bounds()
assert not bounds.is_valid()
bounds.add_point((10, 10))
assert bounds.is_valid()
assert bounds.width == 0
assert bounds.height == 0
bounds.add_point((0, 0))
assert bounds.nodes == ((0, 0)... | [
"pyvmmonitor_core.math_utils.Bounds"
] | [((85, 93), 'pyvmmonitor_core.math_utils.Bounds', 'Bounds', ([], {}), '()\n', (91, 93), False, 'from pyvmmonitor_core.math_utils import Bounds\n')] |
'''
Created on Mar 7, 2011
@author: johnsalvatier
'''
from __future__ import division
import numpy as np
import theano.tensor as tt
from .special import gammaln
def bound(logp, *conditions, **kwargs):
"""
Bounds a log probability density with several conditions.
Parameters
----------
logp : fl... | [
"theano.tensor.lt",
"theano.tensor.sqrt",
"theano.tensor.all",
"theano.tensor.log",
"theano.tensor.eq"
] | [((1432, 1443), 'theano.tensor.eq', 'tt.eq', (['x', '(0)'], {}), '(x, 0)\n', (1437, 1443), True, 'import theano.tensor as tt\n'), ((1926, 1937), 'theano.tensor.lt', 'tt.lt', (['x', '(5)'], {}), '(x, 5)\n', (1931, 1937), True, 'import theano.tensor as tt\n'), ((2372, 2383), 'theano.tensor.lt', 'tt.lt', (['x', '(5)'], {}... |
from tool.runners.python import SubmissionPy
from collections import deque
class DivSubmission(SubmissionPy):
OFFSETS = [(0, 1), (0, -1), (-1, 1), (-1, 0), (-1, -1), (1, 1), (1, 0), (1, -1)]
def run(self, s):
"""
:param s: input in string format
:return: solution flag
"""
... | [
"collections.deque"
] | [((802, 809), 'collections.deque', 'deque', ([], {}), '()\n', (807, 809), False, 'from collections import deque\n')] |
import json
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
import dash
import dash_bio
import dash_html_components as html
from dash_bio.utils import xyz_reader
from common_features import simple_app_layout, simple_app_callback
_data = None
with ope... | [
"json.dumps",
"dash_bio.Speck",
"selenium.webdriver.common.action_chains.ActionChains",
"common_features.simple_app_callback",
"dash.Dash"
] | [((578, 597), 'dash.Dash', 'dash.Dash', (['__name__'], {}), '(__name__)\n', (587, 597), False, 'import dash\n'), ((945, 974), 'selenium.webdriver.common.action_chains.ActionChains', 'ActionChains', (['dash_duo.driver'], {}), '(dash_duo.driver)\n', (957, 974), False, 'from selenium.webdriver.common.action_chains import ... |
from configparser import ConfigParser, NoOptionError, NoSectionError
TOKEN = "TOKEN"
def load_config(section, name, default=None):
try:
conf = ConfigParser()
conf.read("settings.ini")
return conf.get(section, name)
except (NoOptionError, NoSectionError):
return default
| [
"configparser.ConfigParser"
] | [((157, 171), 'configparser.ConfigParser', 'ConfigParser', ([], {}), '()\n', (169, 171), False, 'from configparser import ConfigParser, NoOptionError, NoSectionError\n')] |
from math import floor, ceil
from decimal import Decimal
from vnpy.app.cta_strategy import (
CtaTemplate,
StopOrder,
TickData,
BarData,
TradeData,
OrderData,
BarGenerator,
ArrayManager,
)
class GridStrategy(CtaTemplate):
author = "Billy"
grid_start = 102
grid_price = 0.2
... | [
"math.ceil",
"vnpy.app.cta_strategy.BarGenerator",
"math.floor"
] | [((775, 800), 'vnpy.app.cta_strategy.BarGenerator', 'BarGenerator', (['self.on_bar'], {}), '(self.on_bar)\n', (787, 800), False, 'from vnpy.app.cta_strategy import CtaTemplate, StopOrder, TickData, BarData, TradeData, OrderData, BarGenerator, ArrayManager\n'), ((1368, 1392), 'math.ceil', 'ceil', (['(-self.current_grid)... |