code stringlengths 20 1.04M | apis list | extract_api stringlengths 75 9.94M |
|---|---|---|
import os
import sys
import unittest
from fprime.common.models.serialize.time_type import TimeType
filename = os.path.dirname(__file__)
fprime_path = os.path.join(filename, "../../../../../src")
sys.path.insert(0, fprime_path)
class TimeTypeTestCases(unittest.TestCase):
def setUp(self):
self.t0 = TimeTy... | [
"unittest.main",
"os.path.dirname",
"sys.path.insert",
"fprime.common.models.serialize.time_type.TimeType",
"os.path.join"
] | [((112, 137), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (127, 137), False, 'import os\n'), ((152, 196), 'os.path.join', 'os.path.join', (['filename', '"""../../../../../src"""'], {}), "(filename, '../../../../../src')\n", (164, 196), False, 'import os\n'), ((197, 228), 'sys.path.insert',... |
from vee.git import normalize_git_url
from . import *
class TestGitURLs(TestCase):
def test_scp_urls(self):
self.assertEqual(
normalize_git_url('<EMAIL>:path/to/repo'),
'<EMAIL>:path/to/repo'
)
self.assertEqual(
normalize_git_url('<EMAIL>:/path/to/repo... | [
"vee.git.normalize_git_url"
] | [((154, 195), 'vee.git.normalize_git_url', 'normalize_git_url', (['"""<EMAIL>:path/to/repo"""'], {}), "('<EMAIL>:path/to/repo')\n", (171, 195), False, 'from vee.git import normalize_git_url\n'), ((280, 322), 'vee.git.normalize_git_url', 'normalize_git_url', (['"""<EMAIL>:/path/to/repo"""'], {}), "('<EMAIL>:/path/to/rep... |
from collections import namedtuple
from .errors import ConfigurationError
from docker.utils.ports import build_port_bindings
class ServicePort(namedtuple('_ServicePort', 'target published protocol mode external_ip')):
def __new__(cls, target, published, *args, **kwargs):
try:
if target:
... | [
"docker.utils.ports.build_port_bindings",
"collections.namedtuple"
] | [((146, 218), 'collections.namedtuple', 'namedtuple', (['"""_ServicePort"""', '"""target published protocol mode external_ip"""'], {}), "('_ServicePort', 'target published protocol mode external_ip')\n", (156, 218), False, 'from collections import namedtuple\n'), ((1377, 1404), 'docker.utils.ports.build_port_bindings',... |
def main():
import sys
if len(sys.argv)!=4: #if the input arguments not 4, showing the usage.
print("Usage:python3 index_header_to_seq.py <coding_sequence.fasta> <list_of_header_name.txt> <outfile_header_to_sequence.fasta>")
sys.exit()
from collections import defaultdict # High-performance... | [
"collections.defaultdict",
"sys.exit"
] | [((502, 519), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (513, 519), False, 'from collections import defaultdict\n'), ((250, 260), 'sys.exit', 'sys.exit', ([], {}), '()\n', (258, 260), False, 'import sys\n')] |
"""Term object for LISC."""
from collections import namedtuple
###################################################################################################
###################################################################################################
Term = namedtuple('Term', ['label', 'search', 'inclusi... | [
"collections.namedtuple"
] | [((273, 340), 'collections.namedtuple', 'namedtuple', (['"""Term"""', "['label', 'search', 'inclusions', 'exclusions']"], {}), "('Term', ['label', 'search', 'inclusions', 'exclusions'])\n", (283, 340), False, 'from collections import namedtuple\n')] |
from enum import unique
from app import db, login
from flask_login import UserMixin
from datetime import datetime
from werkzeug.security import generate_password_hash,check_password_hash
@login.user_loader
def load_user(id):
return User.query.get(int(id))
class User(UserMixin,db.Model):
id=db.Column(db.Intege... | [
"werkzeug.security.check_password_hash",
"werkzeug.security.generate_password_hash",
"app.db.String",
"app.db.Column"
] | [((301, 340), 'app.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (310, 340), False, 'from app import db, login\n'), ((359, 372), 'app.db.String', 'db.String', (['(20)'], {}), '(20)\n', (368, 372), False, 'from app import db, login\n'), ((423, 437), 'app.db.Str... |
"""Finds the optimal Supracenter using particle swarm optimization and graphs and exports the data"""
import copy
import multiprocessing
import datetime
import numpy as np
from supra.Utils.pso import pso
import pyximport
pyximport.install(setup_args={'include_dirs':[np.get_include()]})
from supra.Supracenter.cyscan5... | [
"numpy.zeros_like",
"numpy.std",
"numpy.empty",
"supra.Supracenter.cyscan5.cyscan",
"numpy.zeros",
"copy.copy",
"numpy.isnan",
"supra.Supracenter.plot.outputWeather",
"supra.Utils.Classes.Position",
"numpy.mean",
"numpy.array",
"numpy.get_include",
"datetime.timedelta",
"numpy.dot",
"num... | [((1594, 1614), 'numpy.empty', 'np.empty', (['n_stations'], {}), '(n_stations)\n', (1602, 1614), True, 'import numpy as np\n'), ((1770, 1787), 'supra.Utils.Classes.Position', 'Position', (['(0)', '(0)', '(0)'], {}), '(0, 0, 0)\n', (1778, 1787), False, 'from supra.Utils.Classes import Position\n'), ((2103, 2123), 'numpy... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------------------------------------------- #
"""
Detect and automagically rip media from optical drives
The MIT License (MIT)
Copyright © 2020 by <NAME>.
Permission is hereby granted, free ... | [
"cdio.get_devices_with_cap",
"asyncio.get_event_loop",
"pyudev.Context",
"os.path.dirname",
"cdio.Device",
"shlex.split",
"os.popen",
"os.environ.get",
"pathlib.Path",
"os._exit",
"itertools.chain",
"re.search",
"configparser.ConfigParser",
"re.sub",
"pyudev.Monitor.from_netlink",
"sys... | [((2416, 2443), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (2441, 2443), False, 'import configparser\n'), ((2069, 2102), 'os.environ.get', 'os.environ.get', (['"""RIPPER_SETTINGS"""'], {}), "('RIPPER_SETTINGS')\n", (2083, 2102), False, 'import os\n'), ((2198, 2223), 'os.environ.get', 'o... |
# Universidade Federal de Viçosa - Campus Rio Paranaíba
# Sistemas de Informação - SIN392 Processamento Digital de Imagens
#
# Professor: <NAME>
# Autores:
# - MatheusRV (3929)
# - iguit0 (3902)
# - ThiagoMunich (3628)
#
# Segmentação – Limiarização - Limiarização utilizando o método de Otsu... | [
"skimage.filters.threshold_otsu",
"scipy.misc.imread"
] | [((774, 803), 'skimage.filters.threshold_otsu', 'filters.threshold_otsu', (['img_1'], {}), '(img_1)\n', (796, 803), False, 'from skimage import img_as_float, filters\n'), ((535, 551), 'scipy.misc.imread', 'misc.imread', (['arg'], {}), '(arg)\n', (546, 551), False, 'from scipy import misc\n')] |
# coding: utf-8
import sublime
import json
st_version = int(sublime.version())
if st_version > 3000:
from JoomlaPack.lib import *
else:
from lib import *
class Json(File):
'''
Represents a JSON file.
'''
def __init__(self, path, encoding='utf-8'):
File.__init__(self, path, encoding... | [
"sublime.version",
"json.dumps"
] | [((62, 79), 'sublime.version', 'sublime.version', ([], {}), '()\n', (77, 79), False, 'import sublime\n'), ((782, 830), 'json.dumps', 'json.dumps', (['data'], {'sort_keys': '(False)', 'indent': 'indent'}), '(data, sort_keys=False, indent=indent)\n', (792, 830), False, 'import json\n')] |
##
# This module includes methods that answer Connectwise Manage API requests with JSON objects.
# version = 0.1, author = bersfo, last updated = 10/03/2017
#
# currently supported API requests:
# GET https://{connectwiseSite}/v4_6_release/apis/3.0/company/companies
# GET https://{connectwiseSite}/v4_6_rele... | [
"arrow.get",
"datetime.timedelta",
"datetime.date.today",
"requests.get"
] | [((1401, 1516), 'requests.get', 'requests.get', (["(self.cwUrl + 'company/companies?pageSize=1000&conditions=type/id==1')"], {'headers': 'self.cwHeaders'}), "(self.cwUrl +\n 'company/companies?pageSize=1000&conditions=type/id==1', headers=self.\n cwHeaders)\n", (1413, 1516), False, 'import requests\n'), ((1745, 1... |
import json
import os
import tempfile
import threading
import time
from collections import OrderedDict, deque
from typing import Any, Deque, Dict, Iterator, List, Optional, Tuple, Union, cast
from redun.executors import aws_utils
from redun.executors.base import Executor, register_executor
from redun.executors.code_pa... | [
"redun.executors.scratch.parse_job_result",
"redun.executors.aws_utils.copy_to_s3",
"redun.executors.scratch.parse_job_error",
"os.walk",
"json.dumps",
"redun.executors.scratch.get_job_scratch_dir",
"os.path.join",
"redun.utils.pickle_dump",
"collections.deque",
"os.path.abspath",
"tempfile.Temp... | [((1150, 1438), 'redun.executors.aws_utils.JobStatus', 'aws_utils.JobStatus', ([], {'all': "['STARTING', 'RUNNING', 'STOPPING', 'SUCCEEDED', 'FAILED', 'ERROR',\n 'STOPPED', 'TIMEOUT']", 'inflight': "['STARTING', 'RUNNING', 'STOPPING']", 'pending': "['STARTING']", 'success': "['SUCCEEDED']", 'failure': "['FAILED', 'E... |
""" Parts of the U-Net model """
import torch
import torch.nn as nn
import torch.nn.functional as F
class DoubleConv(nn.Module):
"""(convolution => [BN] => ReLU) * 2"""
def __init__(self, in_channels, out_channels, mid_channels=None):
super().__init__()
if not mid_channels:
mid_c... | [
"torch.nn.ReLU",
"torch.nn.ConvTranspose2d",
"torch.nn.Conv2d",
"torch.cat",
"torch.nn.Upsample",
"torch.nn.BatchNorm2d",
"torch.nn.MaxPool2d",
"torch.nn.functional.pad"
] | [((1935, 2010), 'torch.nn.functional.pad', 'F.pad', (['x1', '[diffX // 2, diffX - diffX // 2, diffY // 2, diffY - diffY // 2]'], {}), '(x1, [diffX // 2, diffX - diffX // 2, diffY // 2, diffY - diffY // 2])\n', (1940, 2010), True, 'import torch.nn.functional as F\n'), ((2048, 2074), 'torch.cat', 'torch.cat', (['[x2, x1]... |
import io
import numpy as np
import pytest
from plateau.serialization.testing import BINARY_COLUMNS, get_dataframe_not_nested
class FakeStore:
def __init__(self):
self._brain = {}
def put(self, key, value):
self._brain[key] = value
def get(self, key):
return self._brain[key]
... | [
"io.BytesIO",
"pytest.fixture",
"plateau.serialization.testing.get_dataframe_not_nested",
"numpy.errstate"
] | [((451, 488), 'pytest.fixture', 'pytest.fixture', ([], {'params': 'BINARY_COLUMNS'}), '(params=BINARY_COLUMNS)\n', (465, 488), False, 'import pytest\n'), ((630, 658), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (644, 658), False, 'import pytest\n'), ((598, 626), 'plateau.seriali... |
import sys
import types
import traceback
import threading
import collections
import IPython.ipapi
import pyglet
from pyglet.gl import *
def call (function, args, kwargs, output=None):
''' WARNING: This can be only called from the OpenGL thread '''
try:
result = function(*args, **kwargs)
except:
... | [
"threading.Thread",
"traceback.print_exc",
"pyglet.app.run",
"pyglet.app.exit",
"threading.Lock",
"pyglet.image.load",
"pyglet.window.Window",
"pyglet.image.TileableTexture.create_for_image",
"pyglet.image.CheckerImagePattern",
"collections.deque",
"pyglet.clock.schedule_interval"
] | [((4026, 4042), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (4040, 4042), False, 'import threading\n'), ((4052, 4071), 'collections.deque', 'collections.deque', ([], {}), '()\n', (4069, 4071), False, 'import collections\n'), ((5185, 5236), 'pyglet.window.Window', 'pyglet.window.Window', ([], {'visible': '(Fal... |
import csv
import os
import sys
import time
from collections import defaultdict
def pluralize(n, w):
if n == 1:
return '%s %s' % (n, w)
else:
return '%s %ss' % (n, w)
def usage():
print("usage: python make_tests.py <template_directory> <test_directory>")
########## Main ##############
i... | [
"csv.reader",
"csv.writer",
"collections.defaultdict",
"time.localtime",
"os.path.join",
"os.listdir",
"sys.exit"
] | [((553, 577), 'os.listdir', 'os.listdir', (['TEMPLATE_DIR'], {}), '(TEMPLATE_DIR)\n', (563, 577), False, 'import os\n'), ((357, 368), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (365, 368), False, 'import sys\n'), ((456, 472), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (467, 472), False, 'f... |
# pylint: disable=redefined-outer-name
from datetime import date
from sqlalchemy.orm import clear_mappers
from unittest import mock
import pytest
from halo_app import bootstrap, view
from halo_app.app.context import HaloContext
from halo_app.domain import command
from halo_app.app import uow as unit_of_work
from halo_a... | [
"halo_app.domain.command.HaloCommand",
"halo_app.app.context.HaloContext",
"halo_app.domain.command.CreateBatch",
"datetime.date.today",
"halo_app.domain.command.Allocate",
"sqlalchemy.orm.clear_mappers",
"halo_app.infra.sql_uow.SqlAlchemyUnitOfWork",
"halo_app.view.allocations",
"halo_app.domain.co... | [((445, 457), 'datetime.date.today', 'date.today', ([], {}), '()\n', (455, 457), False, 'from datetime import date\n'), ((712, 727), 'sqlalchemy.orm.clear_mappers', 'clear_mappers', ([], {}), '()\n', (725, 727), False, 'from sqlalchemy.orm import clear_mappers\n'), ((792, 805), 'halo_app.app.context.HaloContext', 'Halo... |
# -*- coding: utf-8 -*-
import sys
import branca
from branca.colormap import (ColorMap, LinearColormap, StepColormap)
from branca.element import (
CssLink,
Div,
Element,
Figure,
Html,
IFrame,
JavascriptLink,
Link,
MacroElement,
)
from folium.features import (
Choropleth,
C... | [
"branca.__version__.split"
] | [((953, 982), 'branca.__version__.split', 'branca.__version__.split', (['"""."""'], {}), "('.')\n", (977, 982), False, 'import branca\n')] |
from collections import namedtuple
import numpy
import math
import re
#########################################################################################
# Place
fields = ['id',
'key',
'name',
'county',
'area_land',
'area_water',
'area_land_sqmi',
'area_water_sqmi',
'coor_lat',
'coor_long',
'p... | [
"numpy.true_divide",
"numpy.nan_to_num",
"math.sqrt",
"numpy.median",
"numpy.std",
"numpy.errstate",
"Place.places.places.column_notstr",
"collections.namedtuple"
] | [((1084, 1111), 'collections.namedtuple', 'namedtuple', (['"""Place"""', 'fields'], {}), "('Place', fields)\n", (1094, 1111), False, 'from collections import namedtuple\n'), ((7641, 7689), 'collections.namedtuple', 'namedtuple', (['"""PlaceVectorFull"""', 'pvf_subcomponents'], {}), "('PlaceVectorFull', pvf_subcomponent... |
import datetime
import os
import time
import torch
import torch.utils.data
import transforms as T
from torch import nn
import torchvision
import numpy as np
import scipy.io
import random
from PIL import Image
import matplotlib.image as mpimg
from tqdm import tqdm
from coco_utils import get_coco
import presets
import ut... | [
"numpy.random.seed",
"argparse.ArgumentParser",
"torch.utils.data.RandomSampler",
"transforms.Normalize",
"torch.device",
"utils.Iterator",
"utils.ConfusionMatrix",
"torch.no_grad",
"os.path.join",
"presets.SegmentationPresetTrain",
"torch.cuda.amp.autocast",
"torch.utils.data.DataLoader",
"... | [((724, 741), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (735, 741), False, 'import random\n'), ((783, 803), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (797, 803), True, 'import numpy as np\n'), ((804, 827), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (82... |
import PIL.ImageOps
import matplotlib.pyplot as plt
from PIL import Image, ImageEnhance
import math
img0_tuple = ("/Users/xumingfang/Documents/Temp/060-01.png",)
img1_tuple = ("/Users/xumingfang/Documents/Temp/060-02.png",)
img0 = Image.open(img0_tuple[0])
img1 = Image.open(img1_tuple[0])
img0 = img0.convert("L")
im... | [
"PIL.ImageEnhance.Sharpness",
"PIL.Image.open"
] | [((233, 258), 'PIL.Image.open', 'Image.open', (['img0_tuple[0]'], {}), '(img0_tuple[0])\n', (243, 258), False, 'from PIL import Image, ImageEnhance\n'), ((266, 291), 'PIL.Image.open', 'Image.open', (['img1_tuple[0]'], {}), '(img1_tuple[0])\n', (276, 291), False, 'from PIL import Image, ImageEnhance\n'), ((388, 417), 'P... |
# -*- coding: utf-8 -*-
from xutils.date_utils.enums import (TimeUnits,
Weekdays,
Months,
BizDayConventions)
from xutils.date_utils.date import Date
from xutils.date_utils.period import Period
from xutils.as... | [
"xutils.date_utils.date.Date",
"xutils.date_utils.period.Period",
"xutils.date_utils.date.Date.endOfMonth",
"xutils.date_utils.date.Date.westernStyle",
"time.localtime"
] | [((5701, 5717), 'xutils.date_utils.date.Date', 'Date', (['(2005)', '(1)', '(3)'], {}), '(2005, 1, 3)\n', (5705, 5717), False, 'from xutils.date_utils.date import Date\n'), ((5734, 5750), 'xutils.date_utils.date.Date', 'Date', (['(2005)', '(2)', '(7)'], {}), '(2005, 2, 7)\n', (5738, 5750), False, 'from xutils.date_utils... |
# import multiprocessing
import torch
from im2mesh.utils.libkdtree import KDTree
import numpy as np
import math
import pdb
class map2local(object):
''' Add new keys to the given input
Args:
s (float): the defined voxel size
pos_encoding (str): method for the positional encoding, linear|sin_cos
... | [
"im2mesh.utils.libkdtree.KDTree",
"torch.stack",
"torch.gather",
"torch.LongTensor",
"torch.remainder",
"numpy.asarray",
"torch.cat",
"torch.sin",
"torch.cos",
"torch.cuda.is_available",
"torch.div",
"numpy.linspace",
"torch.linspace",
"torch.gesv",
"torch.tensor",
"torch.transpose"
] | [((1099, 1123), 'torch.transpose', 'torch.transpose', (['p', '(2)', '(1)'], {}), '(p, 2, 1)\n', (1114, 1123), False, 'import torch\n'), ((1185, 1209), 'torch.transpose', 'torch.transpose', (['p', '(2)', '(1)'], {}), '(p, 2, 1)\n', (1200, 1209), False, 'import torch\n'), ((5646, 5662), 'numpy.asarray', 'np.asarray', (['... |
from flask import Flask
from flask_mail import Mail, Message
app = Flask(__name__)
app.config['MAIL_SERVER'] = 'smtp.qq.com' # 邮件服务器地址
app.config['MAIL_PORT'] = 25 # 邮件服务器端口
app.config['MAIL_USE_TLS'] = True # 启用 TLS
app.config['MAIL_USERNAME'] = "<EMAIL>"#os.environ.get('MAIL_USERNAME') or '<EMAIL>'
app.config['MA... | [
"flask.Flask",
"flask_mail.Mail",
"flask_mail.Message"
] | [((67, 82), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (72, 82), False, 'from flask import Flask\n'), ((405, 414), 'flask_mail.Mail', 'Mail', (['app'], {}), '(app)\n', (409, 414), False, 'from flask_mail import Mail, Message\n'), ((455, 510), 'flask_mail.Message', 'Message', (['"""Hi"""'], {'sender': '... |
import pandas as pd
import cv2
import numpy as np
from skimage.feature import local_binary_pattern
dataset_path = 'fer2013/fer2013_clean2.csv'
image_size = (48, 48)
# settings for LBP
radius = 1 # LBP算法中范围半径的取值
n_points = 8 * radius # 领域像素点数
# 载入数据
def load_fer2013():
data = pd.read_csv(dataset_p... | [
"pandas.read_csv",
"pandas.get_dummies",
"numpy.asarray",
"numpy.expand_dims"
] | [((299, 324), 'pandas.read_csv', 'pd.read_csv', (['dataset_path'], {}), '(dataset_path)\n', (310, 324), True, 'import pandas as pd\n'), ((852, 869), 'numpy.asarray', 'np.asarray', (['faces'], {}), '(faces)\n', (862, 869), True, 'import numpy as np\n'), ((883, 908), 'numpy.expand_dims', 'np.expand_dims', (['faces', '(-1... |
import pandas as pd
import matplotlib.pyplot as plt
from copy import deepcopy
col_names = ["versize", "query_time"]
TC_data_file = "./data_algo1.csv"
TC_data = pd.read_csv(TC_data_file, header=None, names=col_names)
# MC_data = []
# MC_data_file = ["stats_2_10.csv", "stats_2_20.csv", "stats_2_30.csv", "stats_2_40.... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"pandas.read_csv",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((163, 218), 'pandas.read_csv', 'pd.read_csv', (['TC_data_file'], {'header': 'None', 'names': 'col_names'}), '(TC_data_file, header=None, names=col_names)\n', (174, 218), True, 'import pandas as pd\n'), ((480, 535), 'pandas.read_csv', 'pd.read_csv', (['MC_data_file'], {'header': 'None', 'names': 'col_names'}), '(MC_da... |
from os import listdir
from os.path import isfile, join
import io
import django
from . import models
from .imports import doc_key, docs_schema
from . import ocr2
import re
from django.contrib.auth.models import User
from django.core.files import File
from core import logging
logger = logging.getLogger(__name__)
def ... | [
"django.core.files.File",
"django.contrib.auth.models.User.objects.get",
"core.logging.getLogger",
"os.path.join",
"os.listdir",
"re.sub"
] | [((286, 313), 'core.logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (303, 313), False, 'from core import logging\n'), ((547, 582), 'django.contrib.auth.models.User.objects.get', 'User.objects.get', ([], {'username': 'username'}), '(username=username)\n', (563, 582), False, 'from django.cont... |
import os
import unittest
import math
import numpy
import vtk, qt, ctk, slicer
import SimpleITK as sitk
from slicer.ScriptedLoadableModule import *
from slicer.util import VTKObservationMixin
import logging
#
# ImageStacks
#
class ImageStacks(ScriptedLoadableModule):
"""Uses ScriptedLoadableModule base class, avail... | [
"qt.QPushButton",
"qt.QApplication.restoreOverrideCursor",
"qt.QLineEdit",
"qt.QCheckBox",
"slicer.vtkMRMLScalarVolumeNode",
"qt.QTimer.singleShot",
"qt.QRadioButton",
"qt.QApplication.setOverrideCursor",
"numpy.linalg.norm",
"numpy.diag",
"slicer.util.vtkMatrixFromArray",
"slicer.util.setSlic... | [((2950, 2984), 'slicer.util.VTKObservationMixin.__init__', 'VTKObservationMixin.__init__', (['self'], {}), '(self)\n', (2978, 2984), False, 'from slicer.util import VTKObservationMixin\n'), ((3240, 3266), 'ctk.ctkCollapsibleButton', 'ctk.ctkCollapsibleButton', ([], {}), '()\n', (3264, 3266), False, 'import vtk, qt, ct... |
# Generated by Django 3.2.7 on 2021-11-26 17:24
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Component",
fields=[
... | [
"django.db.models.FileField",
"django.db.models.TextField",
"django.db.models.ManyToManyField",
"django.db.models.ForeignKey",
"django.db.models.BigAutoField",
"django.db.models.CharField",
"django.db.models.JSONField",
"django.db.models.DateTimeField",
"django.db.migrations.AlterUniqueTogether"
] | [((5619, 5710), 'django.db.migrations.AlterUniqueTogether', 'migrations.AlterUniqueTogether', ([], {'name': '"""component"""', 'unique_together': "{('name', 'version')}"}), "(name='component', unique_together={('name',\n 'version')})\n", (5649, 5710), False, 'from django.db import migrations, models\n'), ((5193, 528... |
'''
Example:
import datetime
from amara.lib.date import timezone, UTC
print datetime.datetime(2008, 10, 8, 19, 38, 8, 0, timezone('-0700')).isoformat()
import datetime
from amara.lib.date import timezone, UTC
print datetime.datetime(2008, 10, 8, 19, 38, 8, 0, UTC).isoformat()
If you need even more timezone mojo, try... | [
"datetime.timedelta"
] | [((635, 670), 'datetime.timedelta', 'datetime.timedelta', ([], {'seconds': 'seconds'}), '(seconds=seconds)\n', (653, 670), False, 'import datetime\n'), ((767, 788), 'datetime.timedelta', 'datetime.timedelta', (['(0)'], {}), '(0)\n', (785, 788), False, 'import datetime\n')] |
"""
Created on Sun Jul 08 05:03:01 2018
@Project Title: Learning and Summarizing Graphical Models using Eigen Analysis of Graph Laplacian: An Application in Analysis of Multiple Chronic Conditions
@Project: EAGL (Simplification Based Graph Summarization)
@author: <NAME>
"""
# Import Libraries
import networkx as... | [
"matplotlib.pyplot.title",
"numpy.absolute",
"numpy.matrix.sort",
"scipy.io.loadmat",
"networkx.draw_networkx_labels",
"networkx.bfs_tree",
"numpy.linalg.eig",
"networkx.to_numpy_matrix",
"matplotlib.pyplot.legend",
"numpy.min",
"scipy.sparse.csr_matrix",
"networkx.draw",
"matplotlib.pyplot.... | [((1203, 1221), 'scipy.sparse.csr_matrix', 'sp.csr_matrix', (['DAG'], {}), '(DAG)\n', (1216, 1221), True, 'from scipy import sparse as sp\n'), ((1297, 1312), 'networkx.DiGraph', 'nx.DiGraph', (['DAG'], {}), '(DAG)\n', (1307, 1312), True, 'import networkx as nx\n'), ((1665, 1689), 'networkx.to_numpy_matrix', 'nx.to_nump... |
from os import path
from codecs import open
from setuptools import setup, find_packages
from imp import load_source
here = path.abspath(path.dirname(__file__))
__version__ = "1.0.1"
# get dependencies
with open(path.join(here, 'requirements.txt'), encoding='utf-8') as f:
all_reqs = f.read().split('\n')
install_... | [
"os.path.dirname",
"os.path.join",
"setuptools.find_packages"
] | [((137, 159), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (149, 159), False, 'from os import path\n'), ((215, 250), 'os.path.join', 'path.join', (['here', '"""requirements.txt"""'], {}), "(here, 'requirements.txt')\n", (224, 250), False, 'from os import path\n'), ((1045, 1086), 'setuptools.fi... |
from struct import pack
from scapy.packet import Packet
from scapy.fields import XShortField
class GOOSE(Packet):
name = "GOOSE"
fields_desc = [
XShortField("appid", 0),
XShortField("length", 8),
XShortField("reserved1", 0),
XShortField("reserved2", 0),
]
def post_bui... | [
"scapy.fields.XShortField",
"struct.pack"
] | [((164, 187), 'scapy.fields.XShortField', 'XShortField', (['"""appid"""', '(0)'], {}), "('appid', 0)\n", (175, 187), False, 'from scapy.fields import XShortField\n'), ((197, 221), 'scapy.fields.XShortField', 'XShortField', (['"""length"""', '(8)'], {}), "('length', 8)\n", (208, 221), False, 'from scapy.fields import XS... |
import collections
from espnet.nets.pytorch_backend.e2e_asr_transformer import *
from espnet.nets.pytorch_backend.e2e_asr_transformer import E2E as SpeechTransformer
from espnet.nets.pytorch_backend.transformer.encoder import *
from espnet.nets.pytorch_backend.transformer.decoder import *
from espnet.nets.pytorch_backe... | [
"torch.mean",
"torch.nn.BCELoss",
"distances.MMD_loss",
"torch.nn.BatchNorm1d",
"torch.cat",
"torch.sigmoid",
"torch.nn.functional.adaptive_avg_pool1d",
"torch.max",
"torch.arange",
"torch.nn.Linear",
"ctc_aligner.CTCForcedAligner",
"distances.CORAL",
"torch.tensor"
] | [((669, 679), 'distances.MMD_loss', 'MMD_loss', ([], {}), '()\n', (677, 679), False, 'from distances import CORAL, MMD_loss\n'), ((1273, 1311), 'torch.nn.Linear', 'torch.nn.Linear', (['input_dim', 'hidden_dim'], {}), '(input_dim, hidden_dim)\n', (1288, 1311), False, 'import torch\n'), ((1330, 1362), 'torch.nn.BatchNorm... |
import cvxpy as cvx
import osqp
import numpy as np
#### file to calculate the rewards. Meant to be modular:
#### class Rewards should have several different functions by Dec 2019
class Reward():
def __init__(self, energy_use, prices, min_demand, max_demand):
"""
Args:
energy_use: list returned by Person cl... | [
"numpy.sum",
"cvxpy.Parameter",
"numpy.log",
"cvxpy.sum",
"numpy.array",
"cvxpy.Problem",
"cvxpy.Variable",
"numpy.dot",
"cvxpy.Minimize"
] | [((611, 631), 'numpy.array', 'np.array', (['energy_use'], {}), '(energy_use)\n', (619, 631), True, 'import numpy as np\n'), ((648, 664), 'numpy.array', 'np.array', (['prices'], {}), '(prices)\n', (656, 664), True, 'import numpy as np\n'), ((794, 812), 'numpy.sum', 'np.sum', (['energy_use'], {}), '(energy_use)\n', (800,... |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Purpose
Demonstrate basic queue operations in Amazon Simple Queue Service (Amazon SQS).
Learn how to create, get, and remove standard, FIFO, and dead-letter queues.
Usage is shown in the test/test_queue_wrap... | [
"boto3.resource",
"logging.getLogger"
] | [((485, 512), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (502, 512), False, 'import logging\n'), ((519, 540), 'boto3.resource', 'boto3.resource', (['"""sqs"""'], {}), "('sqs')\n", (533, 540), False, 'import boto3\n')] |
import socket
import sys
# Create a socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Ensure that you can restart your server quickly when it terminates
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
# Set the client socket's TCP "well-known port" number
well_known_port = 80
sock.bind((''... | [
"sys.stdout.write",
"socket.socket"
] | [((51, 100), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (64, 100), False, 'import socket\n'), ((648, 701), 'sys.stdout.write', 'sys.stdout.write', (["('Connected from %s:%d...' % address)"], {}), "('Connected from %s:%d...' % address)\n", ... |
#
# <NAME> 2021
#
from os import path
from typing import List, Dict
from datetime import datetime
from random import randrange
# ------ GENERAL -------------------------------------------------------------------------------------------------------
DATE_FORMAT: str = "%Y/%m/%d"
DATETIME_FORMAT: str = f"{DATE_FORMAT} ... | [
"os.path.dirname",
"datetime.datetime.now"
] | [((350, 364), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (362, 364), False, 'from datetime import datetime\n'), ((3925, 3947), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (3937, 3947), False, 'from os import path\n'), ((4159, 4181), 'os.path.dirname', 'path.dirname', (['__file... |
# Copyright 2021
#
# 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
# distr... | [
"django.urls.path"
] | [((763, 790), 'django.urls.path', 'path', (['""""""', 'home'], {'name': '"""home"""'}), "('', home, name='home')\n", (767, 790), False, 'from django.urls import path\n'), ((796, 842), 'django.urls.path', 'path', (['"""new/group"""', 'new_group'], {'name': '"""new_group"""'}), "('new/group', new_group, name='new_group')... |
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def hello_world ():
return 'Hello World!'
@app.route('/home')
@app.route('/index')
def index ():
return render_template('index.html')
@app.route('/about')
def about ():
person = {
"age": 23,
"name": "Musta... | [
"flask.Flask",
"flask.render_template"
] | [((48, 63), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (53, 63), False, 'from flask import Flask, render_template\n'), ((196, 225), 'flask.render_template', 'render_template', (['"""index.html"""'], {}), "('index.html')\n", (211, 225), False, 'from flask import Flask, render_template\n'), ((396, 440), ... |
import matsuba.config as cfg
from matsuba.errors import NoPermissionError
import extutil
# Access-control verbs for user_boards.authority.
# 2015 NOTE: I honestly don't remember if this ever completely worked, or if
# maybe I was in the midst of rewriting a previous system and got distracted
# by something. From the ... | [
"extutil.http_redirect"
] | [((1810, 1884), 'extutil.http_redirect', 'extutil.http_redirect', (["(cfg.SITE_BASEURL + cfg.MATSUBA_PATH + '?task=login')"], {}), "(cfg.SITE_BASEURL + cfg.MATSUBA_PATH + '?task=login')\n", (1831, 1884), False, 'import extutil\n')] |
import mysql.connector as mysql
from mysql.connector import Error
# define the connector function
# password <PASSWORD>
def connect_fetch():
""" function to connect and fetch rows in database"""
# create a variable for the connector object
conn = None
# collecting user input local
h... | [
"mysql.connector.connect"
] | [((590, 663), 'mysql.connector.connect', 'mysql.connect', ([], {'host': 'host', 'database': 'database', 'user': 'user', 'password': 'password'}), '(host=host, database=database, user=user, password=password)\n', (603, 663), True, 'import mysql.connector as mysql\n')] |
import requests
from JavPy.embed.BaseEmbed import BaseEmbed
from JavPy.embed.fvs_io import fvs_io
import json
from JavPy.utils.config import proxy
class playfinder_xyz(BaseEmbed):
@staticmethod
def decode(url):
video_id = url.split("#")[0].split("/v/").pop().split("/")[0]
rsp = requests.post(
... | [
"requests.post",
"JavPy.embed.fvs_io.fvs_io.decode",
"json.loads"
] | [((305, 419), 'requests.post', 'requests.post', (["('https://playfinder.xyz/api/source/%s' % video_id)", '"""{r: "", d: "smartshare.tv"}"""'], {'proxies': 'proxy'}), '(\'https://playfinder.xyz/api/source/%s\' % video_id,\n \'{r: "", d: "smartshare.tv"}\', proxies=proxy)\n', (318, 419), False, 'import requests\n'), (... |
import os
from pathlib import Path
DEFAULT_ROOT_PATH = Path(os.path.expanduser(os.getenv("TST_ROOT", "~/.tst/mainnet"))).resolve()
| [
"os.getenv"
] | [((80, 119), 'os.getenv', 'os.getenv', (['"""TST_ROOT"""', '"""~/.tst/mainnet"""'], {}), "('TST_ROOT', '~/.tst/mainnet')\n", (89, 119), False, 'import os\n')] |
# Generated by Django 3.1.3 on 2020-11-25 06:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Bidding', '0007_auto_20201125_1049'),
]
operations = [
migrations.AddField(
model_name='bidding',
name='new_bid_date... | [
"django.db.models.DateField",
"django.db.models.FloatField",
"django.db.models.EmailField"
] | [((341, 379), 'django.db.models.DateField', 'models.DateField', ([], {'default': '"""2000-10-05"""'}), "(default='2000-10-05')\n", (357, 379), False, 'from django.db import migrations, models\n'), ((506, 544), 'django.db.models.DateField', 'models.DateField', ([], {'default': '"""2000-10-05"""'}), "(default='2000-10-05... |
import function
# enter iterative function into the function.py file under f(x)
# enter initial guess
x0 = 1.5
# enter tolerance
tol = 0.000001
# enter the maximum number of iterations
N = 500
# do not change anything beneath this line
n = 0
while n<N:
n = n+1
x = function.f(x0)
if abs(x-x0)<tol:
... | [
"function.f"
] | [((278, 292), 'function.f', 'function.f', (['x0'], {}), '(x0)\n', (288, 292), False, 'import function\n')] |
"""
Common functions used in experiment pipelines
"""
import copy
import glob
import json
import logging
import os
import pprint
import time
from datetime import datetime
from typing import Callable
import numpy as np
from sklearn.externals import joblib
from sklearn.preprocessing import StandardScaler
from tqdm impor... | [
"datetime.datetime.strftime",
"sklearn.externals.joblib.dump",
"json.load",
"copy.deepcopy",
"numpy.concatenate",
"sklearn.preprocessing.StandardScaler",
"numpy.std",
"time.perf_counter",
"datetime.datetime.now",
"numpy.all",
"numpy.percentile",
"pprint.PrettyPrinter",
"numpy.mean",
"pprin... | [((389, 416), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (406, 416), False, 'import logging\n'), ((422, 444), 'pprint.PrettyPrinter', 'pprint.PrettyPrinter', ([], {}), '()\n', (442, 444), False, 'import pprint\n'), ((3762, 3787), 'os.path.join', 'os.path.join', (['save_dir', 't'], {})... |
import argparse
from pathlib import Path
from pprint import pprint
import sys
import os
import torch
from tilse.data.timelines import GroundTruth as TilseGroundTruth
from tilse.data.timelines import Timeline as TilseTimeline
from tilse.evaluation import rouge
# r = Rouge155('/datasets/home/08/008/whogan/.local/lib/pyt... | [
"news_tls.clust.ClusteringTimelineGenerator",
"news_tls.utils.load_pkl",
"argparse.ArgumentParser",
"tilse.data.timelines.GroundTruth",
"news_tls.data.truncate_timelines",
"news_tls.utils.print_tl",
"news_tls.data.get_input_time_span",
"tilse.evaluation.rouge.TimelineRougeEvaluator",
"news_tls.summa... | [((2706, 2767), 'tilse.evaluation.rouge.TimelineRougeEvaluator', 'rouge.TimelineRougeEvaluator', ([], {'measures': "['rouge_1', 'rouge_2']"}), "(measures=['rouge_1', 'rouge_2'])\n", (2734, 2767), False, 'from tilse.evaluation import rouge\n'), ((4850, 4869), 'pprint.pprint', 'pprint', (['avg_results'], {}), '(avg_resul... |
from cloudmesh.configuration.Config import Config
class RestConfig(object):
config = Config().data["cloudmesh"]
MONGO_HOST = config["data"]["mongo"]["MONGO_HOST"]
MONGO_USERNAME = config["data"]["mongo"]["MONGO_USERNAME"]
MONGO_PASSWORD = config["data"]["mongo"]["MONGO_PASSWORD"]
MONGO_PORT = conf... | [
"cloudmesh.configuration.Config.Config"
] | [((91, 99), 'cloudmesh.configuration.Config.Config', 'Config', ([], {}), '()\n', (97, 99), False, 'from cloudmesh.configuration.Config import Config\n')] |
#
# Copyright (c) 2013-2014 <NAME> <<EMAIL>>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIM... | [
"logging.getLogger"
] | [((1666, 1693), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1683, 1693), False, 'import logging\n')] |
import ibis
from ibis.expr import datatypes as dt
def test_whole_schema():
customers = ibis.table(
[
('cid', 'int64'),
('mktsegment', 'string'),
(
'address',
(
'struct<city: string, street: string, '
... | [
"ibis.schema",
"ibis.expr.datatypes.Struct.from_tuples",
"ibis.expr.datatypes.Array",
"ibis.expr.datatypes.int64",
"ibis.table",
"ibis.expr.datatypes.Decimal"
] | [((93, 1217), 'ibis.table', 'ibis.table', (['[(\'cid\', \'int64\'), (\'mktsegment\', \'string\'), (\'address\',\n \'struct<city: string, street: string, street_number: int32, zip: int16>\'\n ), (\'phone_numbers\', \'array<string>\'), (\'orders\',\n """array<struct<\n oid: int64,\... |
# -*- coding: utf-8 -*-
"""
database simple functions. Pass query and where needed values and get result back
"""
from loguru import logger
from core.db_setup import database
async def fetch_one_db(query):
try:
logger.debug(query)
result = await database.fetch_one(query)
logger.debug(re... | [
"core.db_setup.database.execute",
"core.db_setup.database.fetch_one",
"core.db_setup.database.fetch_all",
"loguru.logger.critical",
"loguru.logger.debug"
] | [((228, 247), 'loguru.logger.debug', 'logger.debug', (['query'], {}), '(query)\n', (240, 247), False, 'from loguru import logger\n'), ((305, 325), 'loguru.logger.debug', 'logger.debug', (['result'], {}), '(result)\n', (317, 325), False, 'from loguru import logger\n'), ((481, 500), 'loguru.logger.debug', 'logger.debug',... |
# Copyright 2015 Oursky 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 in writing, ... | [
"unittest.mock.patch",
"json.dumps"
] | [((1294, 1338), 'unittest.mock.patch', 'patch', (['"""skygear.transmitter.http.run_simple"""'], {}), "('skygear.transmitter.http.run_simple')\n", (1299, 1338), False, 'from unittest.mock import ANY, patch\n'), ((1640, 1697), 'unittest.mock.patch', 'patch', (['"""skygear.transmitter.http.HttpTransport.call_func"""'], {}... |
import logging
import re
logger = logging.getLogger('biliup')
class BatchCheckBase:
def __init__(self, pattern_id, urls):
self.usr_dict = {}
self.usr_list = []
self.pattern_id = pattern_id
for url in urls:
self.get_id(url)
def get_id(self, url):
m = re.mat... | [
"re.search",
"re.match",
"logging.getLogger"
] | [((35, 62), 'logging.getLogger', 'logging.getLogger', (['"""biliup"""'], {}), "('biliup')\n", (52, 62), False, 'import logging\n'), ((314, 344), 're.match', 're.match', (['self.pattern_id', 'url'], {}), '(self.pattern_id, url)\n', (322, 344), False, 'import re\n'), ((622, 646), 're.search', 're.search', (['pattern', 't... |
"""
This is a setup.py script generated by py2applet
Usage:
python setup.py py2app
"""
from setuptools import setup
import PyQt5
APP = ['pyRotateDisplayMainMac.py']
OPTIONS = {'argv_emulation': False, 'iconfile':'app_name.icns', 'plist': {'CFBundleShortVersionString':'1.0',"LSUIElement":True}}
QTDIR = r'/opt/lo... | [
"setuptools.setup"
] | [((1110, 1232), 'setuptools.setup', 'setup', ([], {'app': 'APP', 'name': '"""pyRotateDisplay"""', 'data_files': 'DATA_FILES', 'options': "{'py2app': OPTIONS}", 'setup_requires': "['py2app']"}), "(app=APP, name='pyRotateDisplay', data_files=DATA_FILES, options={\n 'py2app': OPTIONS}, setup_requires=['py2app'])\n", (1... |
import pytest
from hypothesis import given, assume, example
from hypothesis.strategies import text, dictionaries
from sentenai.api.stream import Stream
from sentenai.historiQL import StreamPath
from sentenai.hql import V
def stream(name, *filters):
return Stream(None, name, {}, None, True... | [
"hypothesis.example",
"pytest.raises",
"sentenai.api.stream.Stream",
"hypothesis.strategies.text",
"hypothesis.assume"
] | [((1698, 1718), 'hypothesis.example', 'example', ([], {'path': '"""name"""'}), "(path='name')\n", (1705, 1718), False, 'from hypothesis import given, assume, example\n'), ((1720, 1740), 'hypothesis.example', 'example', ([], {'path': '"""meta"""'}), "(path='meta')\n", (1727, 1740), False, 'from hypothesis import given, ... |
import numpy as np
def basic_statistics(values):
return {'avg': np.average(values),
'std': np.std(values),
'var': np.var(values),
'median': np.median(values),
'n': len(values)
} | [
"numpy.std",
"numpy.average",
"numpy.var",
"numpy.median"
] | [((70, 88), 'numpy.average', 'np.average', (['values'], {}), '(values)\n', (80, 88), True, 'import numpy as np\n'), ((109, 123), 'numpy.std', 'np.std', (['values'], {}), '(values)\n', (115, 123), True, 'import numpy as np\n'), ((144, 158), 'numpy.var', 'np.var', (['values'], {}), '(values)\n', (150, 158), True, 'import... |
import datetime
from imap_tools import EmailAddress
DATA = dict(
subject='Meet the new MacBook Pro family. Now includes 13-inch.',
from_='<EMAIL>',
to=('<EMAIL>',),
cc=(),
bcc=(),
reply_to=(),
date=datetime.datetime(2009, 6, 11, 23, 25, 2, tzinfo=datetime.timezone(datetime.timedelta(-1, 612... | [
"datetime.timedelta",
"imap_tools.EmailAddress"
] | [((1158, 1209), 'imap_tools.EmailAddress', 'EmailAddress', (['"""Apple"""', '"""<EMAIL>"""', '"""Apple <<EMAIL>>"""'], {}), "('Apple', '<EMAIL>', 'Apple <<EMAIL>>')\n", (1170, 1209), False, 'from imap_tools import EmailAddress\n'), ((1226, 1264), 'imap_tools.EmailAddress', 'EmailAddress', (['""""""', '"""<EMAIL>"""', '... |
# -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
"""
Tests for collectionseditor.py
"""
# Standard library imports
import copy
try:
from unittest.mock import Mock
except ImportError:
from mock import Mock # Python 2
# Third party imports
import... | [
"pandas.DataFrame",
"spyder.widgets.variableexplorer.collectionseditor.CollectionsModel",
"spyder.widgets.variableexplorer.collectionseditor.CollectionsEditorTableView",
"copy.copy",
"pytest.main",
"spyder.widgets.variableexplorer.tests.test_dataframeeditor.generate_pandas_indexes",
"mock.Mock"
] | [((988, 994), 'mock.Mock', 'Mock', ([], {}), '()\n', (992, 994), False, 'from mock import Mock\n'), ((1199, 1231), 'pandas.DataFrame', 'pandas.DataFrame', (["['foo', 'bar']"], {}), "(['foo', 'bar'])\n", (1215, 1231), False, 'import pandas\n'), ((1245, 1289), 'spyder.widgets.variableexplorer.collectionseditor.Collection... |
import logging
_logger = logging.getLogger(__name__)
_logger.setLevel(logging.DEBUG)
### EXPORTS
from .shared._spoof import get_path as path
# To support deprecations
def createCursor(*args, **kwargs):
from .pyppeteer import create_cursor
_logger.warning(
"""DEPRECATION WARNING: 'createCursor' has ... | [
"logging.getLogger"
] | [((26, 53), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (43, 53), False, 'import logging\n')] |
from bxcommon.utils.object_hash import Sha256Hash
from bxgateway import eth_constants
from bxgateway.messages.eth.protocol.block_bodies_eth_protocol_message import BlockBodiesEthProtocolMessage
from bxgateway.messages.eth.protocol.block_headers_eth_protocol_message import BlockHeadersEthProtocolMessage
from bxgateway.m... | [
"bxcommon.utils.object_hash.Sha256Hash",
"bxgateway.messages.eth.protocol.block_bodies_eth_protocol_message.BlockBodiesEthProtocolMessage.from_body_bytes",
"bxgateway.messages.eth.protocol.block_headers_eth_protocol_message.BlockHeadersEthProtocolMessage.from_header_bytes"
] | [((1082, 1110), 'bxcommon.utils.object_hash.Sha256Hash', 'Sha256Hash', (['block_hash_bytes'], {}), '(block_hash_bytes)\n', (1092, 1110), False, 'from bxcommon.utils.object_hash import Sha256Hash\n'), ((1689, 1716), 'bxcommon.utils.object_hash.Sha256Hash', 'Sha256Hash', (['block_hashes[0]'], {}), '(block_hashes[0])\n', ... |
from backtester.executionSystem.simple_execution_system import SimpleExecutionSystem
import pandas as pd
class PairExecutionSystem(SimpleExecutionSystem):
def __init__(self, pair, pairRatio, pairEnter_threshold=0.7, pairExit_threshold=0.55, pairLongLimit=10, pairShortLimit=10, pairCapitalUsageLimit=0, pairLotSize... | [
"pandas.DataFrame"
] | [((1358, 1410), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': '[currentPrediction]', 'index': '[time]'}), '(data=[currentPrediction], index=[time])\n', (1370, 1410), True, 'import pandas as pd\n')] |
from __future__ import absolute_import
from __future__ import unicode_literals
from corehq.util.couch import stale_ok
def update_analytics_indexes():
from .models import Application
Application.get_db().view('exports_forms_by_app/view', limit=1).all()
def get_exports_by_application(domain):
from .models... | [
"corehq.util.couch.stale_ok"
] | [((515, 525), 'corehq.util.couch.stale_ok', 'stale_ok', ([], {}), '()\n', (523, 525), False, 'from corehq.util.couch import stale_ok\n')] |
from flickrapi import FlickrAPI
import json, os, sys,urllib
import io
class API_adapter(object):
def __init__(self):
'''
Load Oauth keys
'''
FLICKR_PUBLIC = ''
FLICKR_SECRET = ''
self.GoogleAPIkey = ''
self.flickr = FlickrAPI(FLICKR_PUBLIC, FLICKR_SECRET, f... | [
"urllib.urlopen",
"flickrapi.FlickrAPI",
"json.loads"
] | [((279, 340), 'flickrapi.FlickrAPI', 'FlickrAPI', (['FLICKR_PUBLIC', 'FLICKR_SECRET'], {'format': '"""parsed-json"""'}), "(FLICKR_PUBLIC, FLICKR_SECRET, format='parsed-json')\n", (288, 340), False, 'from flickrapi import FlickrAPI\n'), ((774, 795), 'urllib.urlopen', 'urllib.urlopen', (['MyUrl'], {}), '(MyUrl)\n', (788,... |
import disnake
from disnake.ext import commands
from glob import glob
import asyncio
class System(commands.Cog):
"""commands involved in working with a discord bot"""
def __init__(self, bot:commands.Bot):
self.bot = bot
if not bot.config.getboolean('extensions', 'auth', fallback=False):
raise Excepti... | [
"glob.glob",
"disnake.ext.commands.command",
"disnake.ext.commands.cooldown"
] | [((368, 386), 'disnake.ext.commands.command', 'commands.command', ([], {}), '()\n', (384, 386), False, 'from disnake.ext import commands\n'), ((3066, 3084), 'disnake.ext.commands.command', 'commands.command', ([], {}), '()\n', (3082, 3084), False, 'from disnake.ext import commands\n'), ((3088, 3111), 'disnake.ext.comma... |
# Copyright 2008-2014 Nokia Solutions and Networks
#
# 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 l... | [
"os.path.isabs",
"os.path.splitdrive",
"robot.errors.DataError",
"os.path.basename",
"os.path.isdir",
"os.path.dirname",
"os.getcwdu",
"os.path.isfile",
"os.path.normpath",
"os.path.join",
"os.listdir"
] | [((1919, 1941), 'os.path.normpath', 'os.path.normpath', (['path'], {}), '(path)\n', (1935, 1941), False, 'import os\n'), ((2332, 2351), 'os.path.isabs', 'os.path.isabs', (['path'], {}), '(path)\n', (2345, 2351), False, 'import os\n'), ((2692, 2712), 'os.path.isfile', 'os.path.isfile', (['base'], {}), '(base)\n', (2706,... |
import random
print(random.randrange(7,16)) | [
"random.randrange"
] | [((20, 43), 'random.randrange', 'random.randrange', (['(7)', '(16)'], {}), '(7, 16)\n', (36, 43), False, 'import random\n')] |
import os
from subprocess import call
def resize_image(img_path, resize='28x28', grayscale=True, output_prefix='resized.'):
"""
Resizes and image using ImageMagick
:param str img_path: Path to image
:param str resize: Resize w x h in pixels
:param bool grayscale: If True, image will be greyscale
... | [
"os.path.split",
"os.path.join",
"subprocess.call"
] | [((443, 466), 'os.path.split', 'os.path.split', (['img_path'], {}), '(img_path)\n', (456, 466), False, 'import os\n'), ((695, 738), 'os.path.join', 'os.path.join', (['dirname', '(output_prefix + name)'], {}), '(dirname, output_prefix + name)\n', (707, 738), False, 'import os\n'), ((743, 771), 'subprocess.call', 'call',... |
# -*- coding: utf-8 -*-
from application.services.logistic import logistic_provider_dispatcher
import application.models as Models
import application.services.jobs as Jobs
from application.services.noti import noti_order
from configs.enum import ORDER_STATUS, COIN_TYPE, ORDER_TYPE
import configs.signals as Signals
d... | [
"configs.signals.payment_received.send",
"application.services.logistic.logistic_provider_dispatcher",
"application.services.jobs.order_stat.update_user_stats",
"configs.signals.item_bought.send",
"application.services.noti.noti_order"
] | [((572, 632), 'application.services.jobs.order_stat.update_user_stats', 'Jobs.order_stat.update_user_stats', ([], {'user_id': 'order.customer_id'}), '(user_id=order.customer_id)\n', (605, 632), True, 'import application.services.jobs as Jobs\n'), ((637, 674), 'application.services.noti.noti_order', 'noti_order', (['ord... |
"""
More plotting examples
----------------------
Here some examples to showcase several plotting scenarios.
"""
##############################################################################
# Import
import numpy as np
import matplotlib.pyplot as plt
from probeinterface import Probe, ProbeGroup
from probeinterfac... | [
"probeinterface.plotting.plot_probe",
"matplotlib.pyplot.show",
"probeinterface.generate_multi_columns_probe",
"probeinterface.Probe",
"probeinterface.generate_linear_probe",
"matplotlib.pyplot.figure",
"numpy.random.rand",
"matplotlib.pyplot.subplots"
] | [((559, 573), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (571, 573), True, 'import matplotlib.pyplot as plt\n'), ((584, 614), 'probeinterface.generate_multi_columns_probe', 'generate_multi_columns_probe', ([], {}), '()\n', (612, 614), False, 'from probeinterface import generate_multi_columns_probe,... |
import pytest
from model_mommy import mommy
from rest_framework import status
@pytest.fixture
def create_agency_data(db):
# Create agency - submission relationship
# Create AGENCY AND TopTier AGENCY
ttagency1 = mommy.make(
"references.ToptierAgency",
name="tta_name",
toptier_code=... | [
"model_mommy.mommy.make"
] | [((226, 360), 'model_mommy.mommy.make', 'mommy.make', (['"""references.ToptierAgency"""'], {'name': '"""tta_name"""', 'toptier_code': '"""100"""', 'abbreviation': '"""tta_abrev"""', 'justification': '"""test.com/cj"""'}), "('references.ToptierAgency', name='tta_name', toptier_code='100',\n abbreviation='tta_abrev', ... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
'''json2mysql
convert json table schema to mysql query
'''
import json
import sys
def main():
args = sys.argv
if len(args) < 1:
print('{} filename'.format(args[0]))
quit()
schema = load_schema(args[1])
tables = []
for table in schema['... | [
"json.load"
] | [((478, 490), 'json.load', 'json.load', (['f'], {}), '(f)\n', (487, 490), False, 'import json\n')] |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | [
"google.cloud.pubsublite.internal.wire.make_publisher.make_publisher",
"google.cloud.pubsublite.internal.wire.pubsub_context.pubsub_context",
"google.cloud.pubsublite.cloudpubsub.internal.async_publisher_impl.AsyncSinglePublisherImpl"
] | [((2935, 2979), 'google.cloud.pubsublite.cloudpubsub.internal.async_publisher_impl.AsyncSinglePublisherImpl', 'AsyncSinglePublisherImpl', (['underlying_factory'], {}), '(underlying_factory)\n', (2959, 2979), False, 'from google.cloud.pubsublite.cloudpubsub.internal.async_publisher_impl import AsyncSinglePublisherImpl\n... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hhlregistrations', '0008_auto_20150412_2257'),
]
operations = [
migrations.AlterModelOptions(
name='event',
... | [
"django.db.migrations.RemoveField",
"django.db.models.CharField",
"django.db.migrations.AlterModelOptions"
] | [((260, 401), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""event"""', 'options': "{'verbose_name': 'event', 'verbose_name_plural': 'events', 'ordering': [\n '-end_date']}"}), "(name='event', options={'verbose_name': 'event',\n 'verbose_name_plural': 'events', 'orderi... |
# Title: 파괴된 도시
# Link: https://www.acmicpc.net/problem/18231
import sys
sys.setrecursionlimit(10 ** 6)
read_list_int = lambda: list(map(int, sys.stdin.readline().strip().split(' ')))
read_single_int = lambda: int(sys.stdin.readline().strip())
def solution(n: int, m: int, childs: list, k: int, destr... | [
"sys.setrecursionlimit",
"sys.stdin.readline"
] | [((82, 112), 'sys.setrecursionlimit', 'sys.setrecursionlimit', (['(10 ** 6)'], {}), '(10 ** 6)\n', (103, 112), False, 'import sys\n'), ((229, 249), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n', (247, 249), False, 'import sys\n'), ((156, 176), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n',... |
import math
import numpy as np
from tqdm import tqdm
from scalesim.scale_config import scale_config as cfg
class systolic_compute_is:
def __init__(self):
# Params set by user
self.config = cfg()
self.ifmap_op_mat = np.zeros((1, 1))
self.ofmap_op_mat = np.zeros((1, 1))
self... | [
"tqdm.tqdm",
"numpy.flip",
"math.ceil",
"numpy.transpose",
"numpy.zeros",
"numpy.ones",
"scalesim.scale_config.scale_config",
"numpy.concatenate"
] | [((15532, 15548), 'numpy.zeros', 'np.zeros', (['(1, 1)'], {}), '((1, 1))\n', (15540, 15548), True, 'import numpy as np\n'), ((211, 216), 'scalesim.scale_config.scale_config', 'cfg', ([], {}), '()\n', (214, 216), True, 'from scalesim.scale_config import scale_config as cfg\n'), ((246, 262), 'numpy.zeros', 'np.zeros', ([... |
import csv
def csv_reader(file_location):
with open(file_location, mode='r') as csv_file:
data = [line for line in csv.DictReader(csv_file)]
for row in data:
try:
row['Lat'] = float(row['Lat'])
row['Long'] = float(row['Long'])
r... | [
"csv.DictReader"
] | [((134, 158), 'csv.DictReader', 'csv.DictReader', (['csv_file'], {}), '(csv_file)\n', (148, 158), False, 'import csv\n')] |
import logging
import json
import service.config as conf
from flask import Flask
from flask import jsonify
from flask import request
from service.client import Client
from service.factory import ServiceFactory
app = Flask(__name__)
logger = logging.getLogger("gunicorn.error")
app.logger.handlers = logger.handlers
ap... | [
"flask.request.data.decode",
"flask.Flask",
"json.dumps",
"flask.jsonify",
"service.client.Client",
"logging.getLogger"
] | [((218, 233), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (223, 233), False, 'from flask import Flask\n'), ((243, 278), 'logging.getLogger', 'logging.getLogger', (['"""gunicorn.error"""'], {}), "('gunicorn.error')\n", (260, 278), False, 'import logging\n'), ((376, 397), 'service.client.Client', 'Client'... |
from __future__ import absolute_import
import autograd.numpy.numpy_extra as ne
ne.take.defjvp(lambda g, ans, gvs, vs, A, idx: ne.take(g, idx))
ne.untake.defjvp(lambda g, ans, gvs, vs, x, idx, template : ne.untake(g, idx, template))
| [
"autograd.numpy.numpy_extra.untake",
"autograd.numpy.numpy_extra.take"
] | [((128, 143), 'autograd.numpy.numpy_extra.take', 'ne.take', (['g', 'idx'], {}), '(g, idx)\n', (135, 143), True, 'import autograd.numpy.numpy_extra as ne\n'), ((205, 232), 'autograd.numpy.numpy_extra.untake', 'ne.untake', (['g', 'idx', 'template'], {}), '(g, idx, template)\n', (214, 232), True, 'import autograd.numpy.nu... |
from localpackage.game import game
from fastapi import FastAPI
import json
app=FastAPI()
@app.post("/Multiplier/")
def Multiplier(request):
"""Responds to any HTTP request.
Args:
request (flask.Request): HTTP request object.
Returns:
The response text or any set of values that can be turn... | [
"localpackage.game.game",
"json.loads",
"json.dumps",
"fastapi.FastAPI"
] | [((81, 90), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (88, 90), False, 'from fastapi import FastAPI\n'), ((5639, 5666), 'localpackage.game.game', 'game', ([], {'attributes': 'attributes'}), '(attributes=attributes)\n', (5643, 5666), False, 'from localpackage.game import game\n'), ((1249, 1273), 'json.loads', 'jso... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from flask import Flask, render_template, request, redirect
import sys, os, traceback
current_directory = os.path.dirname(os.path.realpath(__file__))
app = Flask(__name__)
@app.route("/")
@app.route("/index")
def index():
try:
return render_template('index.h... | [
"flask.request.headers.getlist",
"sys.version.split",
"os.path.realpath",
"flask.Flask",
"traceback.format_exc",
"flask.render_template",
"sys.exc_info",
"requests.get",
"os.path.split"
] | [((203, 218), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (208, 218), False, 'from flask import Flask, render_template, request, redirect\n'), ((169, 195), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (185, 195), False, 'import sys, os, traceback\n'), ((1143, 1185), 'flask... |
"""
Simple water flow example using ANUGA: Water flowing down a channel.
It was called "steep_slope" in an old validation test.
"""
import sys
#------------------------------------------------------------------------------
# Import necessary modules
#--------------------------------------------------------------------... | [
"anuga.Domain",
"anuga.finalize",
"anuga.rectangular_cross",
"anuga.get_args",
"anuga.Transmissive_boundary",
"anuga.distribute",
"anuga.Reflective_boundary",
"anuga.Dirichlet_boundary"
] | [((935, 951), 'anuga.get_args', 'anuga.get_args', ([], {}), '()\n', (949, 951), False, 'import anuga\n'), ((2185, 2203), 'anuga.distribute', 'distribute', (['domain'], {}), '(domain)\n', (2195, 2203), False, 'from anuga import myid, finalize, distribute\n'), ((2432, 2467), 'anuga.Transmissive_boundary', 'anuga.Transmis... |
# encoding: utf-8
"""
@author: <NAME>
@contact: <EMAIL>
@version: 1.0
@file: trainer
@time: 2020/12/17 20:13
@desc: Trainer for biaf
"""
import os
import argparse
import pytorch_lightning as pl
import torch
from pytorch_lightning.callbacks import ModelCheckpoint, LearningRateMonitor, early_stopping
from torch.utils.... | [
"argparse.Namespace",
"pytorch_lightning.seed_everything",
"argparse.ArgumentParser",
"torch.utils.data.RandomSampler",
"torch.device",
"transformers.configuration_auto.AutoConfig.from_pretrained",
"os.path.join",
"pytorch_lightning.Trainer.add_argparse_args",
"torch.utils.data.DataLoader",
"torch... | [((10571, 10595), 'pytorch_lightning.seed_everything', 'pl.seed_everything', (['(1234)'], {}), '(1234)\n', (10589, 10595), True, 'import pytorch_lightning as pl\n'), ((10658, 10670), 'parser.utils.get_parser.get_parser', 'get_parser', ([], {}), '()\n', (10668, 10670), False, 'from parser.utils.get_parser import get_par... |
#=====================================================#
# Pygame template - skeleton for a new pygame project #
#=====================================================#
# libaries
import pygame
import random
# Constants
WIDTH = 800
HEIGHT = 800
FPS = 60
SPEEDY = 3
SPEEDX = 3
# Colors in RGB
BL... | [
"pygame.Surface",
"pygame.event.get",
"pygame.display.set_mode",
"pygame.mixer.init",
"pygame.Rect",
"pygame.init",
"pygame.display.flip",
"pygame.sprite.Group",
"pygame.sprite.Sprite.__init__",
"pygame.display.set_caption",
"pygame.time.Clock",
"pygame.key.get_pressed"
] | [((5059, 5072), 'pygame.init', 'pygame.init', ([], {}), '()\n', (5070, 5072), False, 'import pygame\n'), ((5074, 5093), 'pygame.mixer.init', 'pygame.mixer.init', ([], {}), '()\n', (5091, 5093), False, 'import pygame\n'), ((5121, 5161), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(WIDTH, HEIGHT)'], {}), '((... |
from http import HTTPStatus
from robot_server.service.errors import ErrorDef, ErrorCreateDef
class CalibrationError(ErrorDef):
NO_PIPETTE_ON_MOUNT = ErrorCreateDef(
status_code=HTTPStatus.FORBIDDEN,
title='No Pipette Attached',
format_string='No pipette present on {mount} mount')
NO_P... | [
"robot_server.service.errors.ErrorCreateDef"
] | [((156, 291), 'robot_server.service.errors.ErrorCreateDef', 'ErrorCreateDef', ([], {'status_code': 'HTTPStatus.FORBIDDEN', 'title': '"""No Pipette Attached"""', 'format_string': '"""No pipette present on {mount} mount"""'}), "(status_code=HTTPStatus.FORBIDDEN, title=\n 'No Pipette Attached', format_string='No pipett... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-09-01 08:59
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='NewsLe... | [
"django.db.models.TextField",
"django.db.models.CharField",
"django.db.models.AutoField",
"django.db.models.ImageField",
"django.db.models.IntegerField"
] | [((371, 464), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (387, 464), False, 'from django.db import migrations, models\... |
# -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappé and contributors
# For license information, please see license.txt
import os
import re
import shlex
import time
from subprocess import PIPE, STDOUT, Popen, check_output
import vmraid
from chair_manager.chair_manager.utils import (
safe_decode,
verify_whitelisted... | [
"os.remove",
"shlex.split",
"time.sleep",
"os.path.isfile",
"re.findall",
"vmraid.throw",
"chair_manager.chair_manager.utils.verify_whitelisted_call",
"os.path.join",
"vmraid.whitelist",
"vmraid.publish_realtime"
] | [((4775, 4793), 'vmraid.whitelist', 'vmraid.whitelist', ([], {}), '()\n', (4791, 4793), False, 'import vmraid\n'), ((5088, 5106), 'vmraid.whitelist', 'vmraid.whitelist', ([], {}), '()\n', (5104, 5106), False, 'import vmraid\n'), ((3426, 3444), 'vmraid.whitelist', 'vmraid.whitelist', ([], {}), '()\n', (3442, 3444), Fals... |
from rest_framework import exceptions
from rest_framework_simplejwt.serializers import TokenObtainSerializer
from rest_framework_simplejwt.settings import api_settings as simplejwt_api_settings
from rest_framework_simplejwt.tokens import RefreshToken
from ..models import User
class EuphroRefreshToken(RefreshToken):
... | [
"rest_framework_simplejwt.settings.api_settings.USER_AUTHENTICATION_RULE",
"rest_framework.exceptions.AuthenticationFailed"
] | [((906, 964), 'rest_framework_simplejwt.settings.api_settings.USER_AUTHENTICATION_RULE', 'simplejwt_api_settings.USER_AUTHENTICATION_RULE', (['self.user'], {}), '(self.user)\n', (953, 964), True, 'from rest_framework_simplejwt.settings import api_settings as simplejwt_api_settings\n'), ((984, 1082), 'rest_framework.exc... |
# This is a script to migrate the switchport configuration of one organization to another.
#
# The script can be used to export switchport configuration of a source org to a file and
# import it to a destination org. The script will look for the exact same network names and
# device serial numbers, as they were ... | [
"json.dump",
"json.load",
"getopt.getopt",
"json.dumps",
"requests.get",
"sys.exit"
] | [((3532, 3684), 'requests.get', 'requests.get', (['"""https://dashboard.meraki.com/api/v0/organizations"""'], {'headers': "{'X-Cisco-Meraki-API-Key': p_apikey, 'Content-Type': 'application/json'}"}), "('https://dashboard.meraki.com/api/v0/organizations', headers={\n 'X-Cisco-Meraki-API-Key': p_apikey, 'Content-Type'... |
import socket
from datetime import datetime, timedelta
from time import time
from collections import deque, defaultdict
from typing import Dict, Tuple, List, Optional, Union
from pathlib import Path
import numpy as np
import tensorflow as tf
try:
import wandb
WANDB = True
except ImportError:
WANDB = False
... | [
"wandb.log",
"numpy.average",
"collections.deque",
"time.time",
"collections.defaultdict",
"telegram.Bot",
"pathlib.Path",
"socket.gethostname",
"numpy.array",
"datetime.datetime.now",
"numpy.unique"
] | [((1578, 1584), 'time.time', 'time', ([], {}), '()\n', (1582, 1584), False, 'from time import time\n'), ((3722, 3751), 'collections.deque', 'deque', ([], {'maxlen': 'self.avg_window'}), '(maxlen=self.avg_window)\n', (3727, 3751), False, 'from collections import deque, defaultdict\n'), ((3781, 3810), 'collections.deque'... |
from setuptools import setup, find_packages
config = {
'description' : 'BLE wrapper around Mac-OS and Linux BLE libraries',
'author' : '<NAME>',
'url' : 'github.com/ubirch/ubirch-ble-tool',
'email' : '<EMAIL>',
'download_url' : 'https://github.com/ubirch/ubirch-ble-tool.git',
'version' : '0.0.1',
'license' : 'A... | [
"setuptools.setup",
"setuptools.find_packages"
] | [((415, 430), 'setuptools.setup', 'setup', ([], {}), '(**config)\n', (420, 430), False, 'from setuptools import setup, find_packages\n'), ((350, 365), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (363, 365), False, 'from setuptools import setup, find_packages\n')] |
'''
Utility functions
'''
import sys
import json
import cPickle as pkl
import numpy
# batch preparation
def prepare_data(seqs_x, seqs_y, n_factors, maxlen=None):
# x: a list of sentences
lengths_x = [len(s) for s in seqs_x]
lengths_y = [len(s) for s in seqs_y]
if maxlen is not None:
new_seqs_... | [
"json.load",
"numpy.zeros",
"cPickle.load",
"numpy.max",
"numpy.array",
"sys.exit"
] | [((2383, 2414), 'numpy.array', 'numpy.array', (['seq'], {'dtype': '"""int64"""'}), "(seq, dtype='int64')\n", (2394, 2414), False, 'import numpy\n'), ((954, 974), 'numpy.max', 'numpy.max', (['lengths_x'], {}), '(lengths_x)\n', (963, 974), False, 'import numpy\n'), ((994, 1014), 'numpy.max', 'numpy.max', (['lengths_y'], ... |
import climsoft_api.api.climsoftuser.schema as climsoft_user_schema
import fastapi
from climsoft_api.api import deps
from climsoft_api.services import climsoftuser_service
from climsoft_api.utils.response import get_success_response, \
get_error_response, get_success_response_for_query
from fastapi import APIRouter... | [
"climsoft_api.services.climsoftuser_service.query",
"climsoft_api.services.climsoftuser_service.delete",
"logging.basicConfig",
"climsoft_api.api.climsoftuser.schema.ClimsoftUserResponse.schema",
"climsoft_api.services.climsoftuser_service.update",
"climsoft_api.services.climsoftuser_service.get",
"clim... | [((514, 525), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (523, 525), False, 'from fastapi import APIRouter, Depends\n'), ((536, 563), 'logging.getLogger', 'logging.getLogger', (['__file__'], {}), '(__file__)\n', (553, 563), False, 'import logging\n'), ((564, 603), 'logging.basicConfig', 'logging.basicConfig', ... |
# file to configure flask, loaded into our flask application
# using the line: app.config.from_pyfile("config.py") in website.py
from os import environ
# These variables be available to your application to use.
# Things that may be different on different computers, like a path to a file,
# should go in here. This is a... | [
"os.environ.get"
] | [((1122, 1147), 'os.environ.get', 'environ.get', (['"""SECRET_KEY"""'], {}), "('SECRET_KEY')\n", (1133, 1147), False, 'from os import environ\n')] |
# -*- coding: utf-8 -*-
from pybuilder.core import use_plugin
from pybuilder.core import init
from pybuilder.core import Author
use_plugin('python.core')
use_plugin('python.unittest')
use_plugin('python.flake8')
use_plugin('python.coverage')
use_plugin('python.distutils')
use_plugin('pypi:pybuilder_radon')
use_plugi... | [
"pybuilder.core.Author",
"pybuilder.core.use_plugin"
] | [((131, 156), 'pybuilder.core.use_plugin', 'use_plugin', (['"""python.core"""'], {}), "('python.core')\n", (141, 156), False, 'from pybuilder.core import use_plugin\n'), ((157, 186), 'pybuilder.core.use_plugin', 'use_plugin', (['"""python.unittest"""'], {}), "('python.unittest')\n", (167, 186), False, 'from pybuilder.c... |
from __future__ import annotations
import ast
from typing import Iterable
from tokenize_rt import Offset
from tokenize_rt import Token
from pyupgrade._ast_helpers import ast_to_offset
from pyupgrade._ast_helpers import has_starargs
from pyupgrade._data import register
from pyupgrade._data import State
from pyupgrade... | [
"pyupgrade._token_helpers.find_open_paren",
"pyupgrade._token_helpers.find_closing_bracket",
"pyupgrade._data.register",
"pyupgrade._ast_helpers.has_starargs",
"pyupgrade._string_helpers.is_codec",
"pyupgrade._ast_helpers.ast_to_offset"
] | [((674, 692), 'pyupgrade._data.register', 'register', (['ast.Call'], {}), '(ast.Call)\n', (682, 692), False, 'from pyupgrade._data import register\n'), ((576, 606), 'pyupgrade._token_helpers.find_open_paren', 'find_open_paren', (['tokens', '(i + 1)'], {}), '(tokens, i + 1)\n', (591, 606), False, 'from pyupgrade._token_... |
from os.path import join, isdir
from os import makedirs, listdir
import argparse
import yaml
import pandas as pd
import tqdm
from utils.data_augmentation import aug_image, save_augmentations
#import time
from shutil import copyfile
def select_data(data):
'''
Add here the image selection rule to receive data au... | [
"os.listdir",
"tqdm.tqdm",
"argparse.ArgumentParser",
"os.makedirs",
"pandas.read_csv",
"os.path.isdir",
"utils.data_augmentation.aug_image",
"yaml.safe_load",
"utils.data_augmentation.save_augmentations",
"os.path.join",
"pandas.concat",
"sys.exit"
] | [((630, 655), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (653, 655), False, 'import argparse\n'), ((3160, 3191), 'pandas.read_csv', 'pd.read_csv', (['input_csv_filepath'], {}), '(input_csv_filepath)\n', (3171, 3191), True, 'import pandas as pd\n'), ((3563, 3582), 'tqdm.tqdm', 'tqdm.tqdm', (... |
from collections import namedtuple
PhraseContainer = namedtuple('PhraseContainer', ('value'))
class Node:
def __init__(self):
self.childs = dict()
self.top_phrases = []
def __repr__(self):
return f'{self.childs}; {self.top_phrases}'
class Trie:
TOP_PHRASES_PER_PR... | [
"collections.namedtuple"
] | [((53, 91), 'collections.namedtuple', 'namedtuple', (['"""PhraseContainer"""', '"""value"""'], {}), "('PhraseContainer', 'value')\n", (63, 91), False, 'from collections import namedtuple\n')] |
"""
Django settings for flaviabernardes project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR,... | [
"os.path.dirname",
"os.path.join"
] | [((2112, 2143), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""media"""'], {}), "(BASE_DIR, 'media')\n", (2124, 2143), False, 'import os\n'), ((2215, 2257), 'os.path.join', 'os.path.join', (['MEDIA_ROOT', 'UPLOAD_TO', '"""cms"""'], {}), "(MEDIA_ROOT, UPLOAD_TO, 'cms')\n", (2227, 2257), False, 'import os\n'), ((363, ... |
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# T... | [
"unittest.TextTestRunner",
"unittest.TestLoader",
"Interface.Implements.implements"
] | [((1811, 1832), 'unittest.TestLoader', 'unittest.TestLoader', ([], {}), '()\n', (1830, 1832), False, 'import unittest, sys\n'), ((1154, 1170), 'Interface.Implements.implements', 'implements', (['C', 'I'], {}), '(C, I)\n', (1164, 1170), False, 'from Interface.Implements import implements\n'), ((1575, 1591), 'Interface.I... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.