code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
"""Lighting channels module for Zigbee Home Automation."""
from __future__ import annotations
from contextlib import suppress
from zigpy.zcl.clusters import lighting
from .. import registries
from ..const import REPORT_CONFIG_DEFAULT
from .base import ClientChannel, ZigbeeChannel
@registries.ZIGBEE_CHANNEL_REGISTR... | [
"contextlib.suppress"
] | [((1482, 1500), 'contextlib.suppress', 'suppress', (['KeyError'], {}), '(KeyError)\n', (1490, 1500), False, 'from contextlib import suppress\n')] |
"""Classes to represent Packet Filter's queueing schedulers and statistics."""
import pf._struct
from pf._base import PFObject
from pf.constants import *
from pf._utils import rate2str
__all__ = ["ServiceCurve",
"FlowQueue",
"PFQueue",
"PFQueueStats"]
class ServiceCurve(PFObject):
... | [
"pf._utils.rate2str"
] | [((1594, 1606), 'pf._utils.rate2str', 'rate2str', (['bw'], {}), '(bw)\n', (1602, 1606), False, 'from pf._utils import rate2str\n')] |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
# Export this package's modules as members:
from ._enums import *
from .environment import *
from .environment_setting import *
from .gallery_image imp... | [
"pulumi.ResourceOptions",
"pulumi.runtime.register_resource_module"
] | [((2259, 2361), 'pulumi.runtime.register_resource_module', 'pulumi.runtime.register_resource_module', (['"""azure-native"""', '"""labservices/v20181015"""', '_module_instance'], {}), "('azure-native',\n 'labservices/v20181015', _module_instance)\n", (2298, 2361), False, 'import pulumi\n'), ((1382, 1413), 'pulumi.Res... |
'''
(c) Copyright 2013 Telefonica, I+D. Printed in Spain (Europe). All Rights
Reserved.
The copyright to the software program(s) is property of Telefonica I+D.
The program(s) may be used and or copied only with the express written
consent of Telefonica I+D or in accordance with the terms and conditions
stipulated in t... | [
"commons.json_schema_validator.schema_reader.SchemaField",
"users.serializers.UserCollectionSerializer",
"mock.patch.object",
"commons.json_schema_validator.schema_reader.SchemaReader",
"mock.MagicMock"
] | [((790, 828), 'mock.MagicMock', 'MagicMock', ([], {'name': '"""mock_schema_instance"""'}), "(name='mock_schema_instance')\n", (799, 828), False, 'from mock import MagicMock, patch\n'), ((1156, 1189), 'mock.MagicMock', 'MagicMock', ([], {'name': '"""mock_get_schema"""'}), "(name='mock_get_schema')\n", (1165, 1189), Fals... |
''' User views '''
from datetime import timedelta
from flask import request, jsonify, make_response, redirect, json, render_template
from flask_jwt_extended import (create_access_token, jwt_required)
from flask_restful import Resource
from flask_login import login_user, current_user
from sqlalchemy.exc import Integrit... | [
"flask.render_template",
"src.db.session.commit",
"flask_login.login_user",
"flask_jwt_extended.create_access_token",
"flask.redirect",
"src.db.session.add",
"src.db.session.rollback",
"datetime.timedelta",
"src.api.add_resource",
"flask.jsonify"
] | [((2986, 3050), 'src.api.add_resource', 'api.add_resource', (['UserLoginResource', '"""/login/"""'], {'endpoint': '"""login"""'}), "(UserLoginResource, '/login/', endpoint='login')\n", (3002, 3050), False, 'from src import db, api\n'), ((3051, 3124), 'src.api.add_resource', 'api.add_resource', (['UserRegisterResource',... |
import numpy as np
from sklearn.model_selection import RandomizedSearchCV, GridSearchCV
from sklearn.metrics import roc_auc_score
from sklearn.model_selection import StratifiedKFold
from sklearn.model_selection import KFold
import scipy.stats as sts
import xgboost as xgb
from xiter import *
import pandas as pd
import a... | [
"scipy.stats.randint",
"argparse.ArgumentParser",
"scipy.stats.uniform",
"numpy.array",
"datetime.datetime.now",
"pandas.DataFrame",
"sklearn.model_selection.KFold",
"xgboost.XGBClassifier"
] | [((727, 752), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (750, 752), False, 'import argparse\n'), ((2254, 2324), 'xgboost.XGBClassifier', 'xgb.XGBClassifier', ([], {'objective': '"""binary:logistic"""', 'tree_method': '"""gpu_hist"""'}), "(objective='binary:logistic', tree_method='gpu_hist'... |
import random
import json
import gym
from gym import spaces
import pandas as pd
import numpy as np
MAX_ACCOUNT_BALANCE = 2147483647
MAX_NUM_SHARES = 2147483647
MAX_SHARE_PRICE = 5000
MAX_VOLUME = 1000e8
MAX_AMOUNT = 3e10
MAX_OPEN_POSITIONS = 5
MAX_STEPS = 20000
MAX_DAY_CHANGE = 1
INITIAL_ACCOUNT_BALANCE = 10000
DATA... | [
"numpy.append",
"numpy.array",
"gym.spaces.Box"
] | [((1340, 1415), 'gym.spaces.Box', 'spaces.Box', ([], {'low': '(0)', 'high': '(1)', 'shape': '(DATA_HIS_PERIOD + 1, 6)', 'dtype': 'np.float16'}), '(low=0, high=1, shape=(DATA_HIS_PERIOD + 1, 6), dtype=np.float16)\n', (1350, 1415), False, 'from gym import spaces\n'), ((1501, 2047), 'numpy.array', 'np.array', (["[self.df.... |
import json
import os
import pathlib
import time
from tqdm import tqdm
from aggregator import aggregate
from download import DOWNLOAD_PATH, download_files, unzip_files
from tqdm.contrib.concurrent import process_map
def main():
start = time.time()
# print("Downloading files...")
# download_files()
#... | [
"tqdm.contrib.concurrent.process_map",
"os.listdir",
"pathlib.Path",
"tqdm.tqdm",
"os.path.join",
"json.dumps",
"aggregator.aggregate",
"os.path.isfile",
"json.load",
"time.time"
] | [((243, 254), 'time.time', 'time.time', ([], {}), '()\n', (252, 254), False, 'import time\n'), ((410, 435), 'os.listdir', 'os.listdir', (['DOWNLOAD_PATH'], {}), '(DOWNLOAD_PATH)\n', (420, 435), False, 'import os\n'), ((839, 850), 'time.time', 'time.time', ([], {}), '()\n', (848, 850), False, 'import time\n'), ((1265, 1... |
from PIL import Image
import os, glob
import numpy as np
from sklearn import model_selection
classes = ["car", "bycycle", "motorcycle", "pedestrian"]
num_class = len(classes)
image_size = 50
# 画像の読み込み
X = []
Y = []
for index, classlabel in enumerate(classes):
photos_dir = "./" + classlabel
files = glob.glob... | [
"PIL.Image.open",
"sklearn.model_selection.train_test_split",
"numpy.asarray",
"numpy.array",
"numpy.save",
"glob.glob"
] | [((623, 634), 'numpy.array', 'np.array', (['X'], {}), '(X)\n', (631, 634), True, 'import numpy as np\n'), ((639, 650), 'numpy.array', 'np.array', (['Y'], {}), '(Y)\n', (647, 650), True, 'import numpy as np\n'), ((687, 725), 'sklearn.model_selection.train_test_split', 'model_selection.train_test_split', (['X', 'Y'], {})... |
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
# Copyright (c) 2016, <NAME> <<EMAIL>>
# All rights reserved.
# See LICENSE.txt
# Copyright (c) 2004 <NAME> (http://www.owlfish.com/)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are pe... | [
"logging.basicConfig",
"os.path.exists",
"simpletal.simpleTALES.Context",
"logging.config.fileConfig",
"simpletal.simpleTAL.compileHTMLTemplate",
"unittest.main",
"io.StringIO"
] | [((1938, 1967), 'os.path.exists', 'os.path.exists', (['"""logging.ini"""'], {}), "('logging.ini')\n", (1952, 1967), False, 'import os\n'), ((1974, 2014), 'logging.config.fileConfig', 'logging.config.fileConfig', (['"""logging.ini"""'], {}), "('logging.ini')\n", (1999, 2014), False, 'import logging\n'), ((2025, 2046), '... |
from pathlib import Path
from typing import List
from fasta_reader import FASTAItem, FASTAWriter, read_fasta
__all__ = ["downsample"]
def downsample(infile: Path, outfile: Path, size: int, random):
targets: List[FASTAItem] = list(read_fasta(infile))
if size > len(targets):
raise ValueError("Size is ... | [
"fasta_reader.FASTAWriter",
"fasta_reader.read_fasta"
] | [((238, 256), 'fasta_reader.read_fasta', 'read_fasta', (['infile'], {}), '(infile)\n', (248, 256), False, 'from fasta_reader import FASTAItem, FASTAWriter, read_fasta\n'), ((436, 456), 'fasta_reader.FASTAWriter', 'FASTAWriter', (['outfile'], {}), '(outfile)\n', (447, 456), False, 'from fasta_reader import FASTAItem, FA... |
import os
from pymongo import MongoClient
from dotenv import load_dotenv
def database_entry(data):
try:
load_dotenv()
mongo_string = os.getenv('MONGODB_AUTH_URI')
client = MongoClient(mongo_string)
database = client[os.getenv('MONGODB_DB')]
col = database['users']
c... | [
"pymongo.MongoClient",
"os.getenv",
"dotenv.load_dotenv"
] | [((118, 131), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (129, 131), False, 'from dotenv import load_dotenv\n'), ((155, 184), 'os.getenv', 'os.getenv', (['"""MONGODB_AUTH_URI"""'], {}), "('MONGODB_AUTH_URI')\n", (164, 184), False, 'import os\n'), ((202, 227), 'pymongo.MongoClient', 'MongoClient', (['mongo_s... |
# -*- coding: utf-8 -*-
import unittest
from src.graph import Graph
from src.maximum_cut import maximum_cut, maximum_cut_for_bipartite_graph
class MaximumCut(unittest.TestCase):
def test_maximum_cut_for_bipartite_graphs(self):
""" Given the following bipartite graph.
(a)-----(b)
... | [
"src.graph.Graph.build",
"src.maximum_cut.maximum_cut_for_bipartite_graph",
"src.maximum_cut.maximum_cut"
] | [((480, 579), 'src.graph.Graph.build', 'Graph.build', ([], {'edges': "[('a', 'b'), ('a', 'c'), ('d', 'e'), ('f', 'e'), ('f', 'g')]", 'directed': '(False)'}), "(edges=[('a', 'b'), ('a', 'c'), ('d', 'e'), ('f', 'e'), ('f',\n 'g')], directed=False)\n", (491, 579), False, 'from src.graph import Graph\n'), ((655, 689), '... |
from pymongo import MongoClient
def displayGroup(results):
for result in results:
print (result)
def firstIsALastIsVowel(collection):
key = {'first' : True, "last" : True}
cond = {'first' : 'a', 'last' :
{'$in' : ["a","e","i","o","u"]}}
initial = {'count' : 0}
red... | [
"pymongo.MongoClient"
] | [((1199, 1240), 'pymongo.MongoClient', 'MongoClient', (['"""mongodb://localhost:27017/"""'], {}), "('mongodb://localhost:27017/')\n", (1210, 1240), False, 'from pymongo import MongoClient\n')] |
# Copyright 2020 Toyota Research Institute. All rights reserved.
from packnet_sfm.utils.image import flip_lr, interpolate_scales
from packnet_sfm.utils.misc import filter_dict
from packnet_sfm.utils.types import is_tensor, is_list, is_numpy
def flip(tensor, flip_fn):
"""
Flip tensors or list of tensors base... | [
"packnet_sfm.utils.types.is_list",
"packnet_sfm.utils.image.interpolate_scales",
"packnet_sfm.utils.misc.filter_dict",
"packnet_sfm.utils.types.is_numpy",
"packnet_sfm.utils.types.is_tensor"
] | [((3118, 3203), 'packnet_sfm.utils.misc.filter_dict', 'filter_dict', (['batch', "['rgb', 'rgb_context', 'input_depth', 'input_depth_context']"], {}), "(batch, ['rgb', 'rgb_context', 'input_depth', 'input_depth_context']\n )\n", (3129, 3203), False, 'from packnet_sfm.utils.misc import filter_dict\n'), ((3307, 3341), ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_orthoexon
----------------------------------
Tests for `orthoexon` module.
"""
import os
import pytest
@pytest.fixture
def exon_id_with_quotes():
return "'ENSE00001229068.1'"
@pytest.fixture
def exon_id():
return "ENSE00001229068.1"
def test_separate_... | [
"orthoexon.util.translate",
"os.path.join",
"orthoexon.util.separate",
"orthoexon.util.splitend",
"orthoexon.util.splitstart"
] | [((406, 435), 'orthoexon.util.separate', 'separate', (['exon_id_with_quotes'], {}), '(exon_id_with_quotes)\n', (414, 435), False, 'from orthoexon.util import separate\n'), ((573, 590), 'orthoexon.util.separate', 'separate', (['exon_id'], {}), '(exon_id)\n', (581, 590), False, 'from orthoexon.util import separate\n'), (... |
#
# This file is part of LiteX-Boards.
#
# Copyright (c) 2021 <NAME> <<EMAIL>>
# SPDX-License-Identifier: BSD-2-Clause
# Board diagram/pinout:
# https://user-images.githubusercontent.com/1450143/133655492-532d5e9a-0635-4889-85c9-68683d06cae0.png
# http://dl.sipeed.com/TANG/Nano/HDK/Tang-NANO-2704(Schematic).pdf
from ... | [
"litex.build.gowin.platform.GowinPlatform.__init__",
"litex.build.openfpgaloader.OpenFPGALoader",
"litex.build.gowin.platform.GowinPlatform.do_finalize"
] | [((1481, 1592), 'litex.build.gowin.platform.GowinPlatform.__init__', 'GowinPlatform.__init__', (['self', '"""GW1N-LV1QN48C6/I5"""', '_io', '_connectors'], {'toolchain': '"""gowin"""', 'devicename': '"""GW1N-1"""'}), "(self, 'GW1N-LV1QN48C6/I5', _io, _connectors,\n toolchain='gowin', devicename='GW1N-1')\n", (1503, 1... |
import torch
from torch.distributions.kl import kl_divergence
from torch.nn.utils.convert_parameters import (vector_to_parameters,
parameters_to_vector)
from rl_utils.optimization import conjugate_gradient
from rl_utils.torch_utils import (weighted_mean, detach_distributi... | [
"rl_utils.torch_utils.weighted_mean",
"rl_utils.optimization.conjugate_gradient",
"torch.nn.utils.convert_parameters.parameters_to_vector",
"rl_utils.torch_utils.weighted_normalize",
"torch.stack",
"torch.sqrt",
"torch.exp",
"torch.distributions.kl.kl_divergence",
"torch.sum",
"rl_utils.torch_util... | [((1968, 2021), 'rl_utils.torch_utils.weighted_normalize', 'weighted_normalize', (['advantages'], {'weights': 'episodes.mask'}), '(advantages, weights=episodes.mask)\n', (1986, 2021), False, 'from rl_utils.torch_utils import weighted_mean, detach_distribution, weighted_normalize\n'), ((8994, 9021), 'torch.nn.utils.conv... |
from datetime import timedelta
from dateutil.relativedelta import relativedelta
from django.core.management.base import BaseCommand, CommandError
from django.utils import timezone
from ...models import Request
DURATION_OPTIONS = {
'hours': lambda amount: timezone.now() - timedelta(hours=amount),
'days': lamb... | [
"django.utils.timezone.now",
"datetime.timedelta",
"dateutil.relativedelta.relativedelta"
] | [((262, 276), 'django.utils.timezone.now', 'timezone.now', ([], {}), '()\n', (274, 276), False, 'from django.utils import timezone\n'), ((279, 302), 'datetime.timedelta', 'timedelta', ([], {'hours': 'amount'}), '(hours=amount)\n', (288, 302), False, 'from datetime import timedelta\n'), ((331, 345), 'django.utils.timezo... |
from __future__ import absolute_import, division, print_function
from builtins import (bytes, str, open, super, range,
zip, round, input, int, pow, object, map, zip)
__author__ = "<NAME>"
import numpy as np
from astropy import wcs
from bokeh.layouts import row, widgetbox,gridplot
from bokeh... | [
"bokeh.models.ColorBar",
"bokeh.layouts.row",
"bokeh.plotting.figure",
"bokeh.layouts.widgetbox",
"bokeh.embed.components",
"bokeh.models.LinearColorMapper",
"numpy.column_stack",
"bokeh.layouts.gridplot",
"builtins.zip",
"numpy.isnan",
"bokeh.models.Slider",
"bokeh.models.LabelSet",
"astrop... | [((1396, 1547), 'bokeh.plotting.figure', 'figure', ([], {'plot_width': 'w', 'plot_height': 'h', 'x_range': '(0, c * 0.5)', 'y_range': '(0, r * 0.5)', 'tools': "['pan,box_zoom,box_select,wheel_zoom,reset,save,crosshair']"}), "(plot_width=w, plot_height=h, x_range=(0, c * 0.5), y_range=(0, r * \n 0.5), tools=['pan,box... |
from pathlib import Path
from testaid.pathlist import PathList
def test_testaid_unit_pathlist_roles_blacklist(testvars_roles_blacklist):
assert testvars_roles_blacklist is not None
def test_testaid_unit_pathlist_roles_whitelist(testvars_roles_whitelist):
assert testvars_roles_whitelist is not None
def tes... | [
"testaid.pathlist.PathList",
"pathlib.Path"
] | [((774, 802), 'testaid.pathlist.PathList', 'PathList', (['my_pathstring', 'msd'], {}), '(my_pathstring, msd)\n', (782, 802), False, 'from testaid.pathlist import PathList\n'), ((675, 686), 'pathlib.Path', 'Path', (['file3'], {}), '(file3)\n', (679, 686), False, 'from pathlib import Path\n'), ((688, 699), 'pathlib.Path'... |
"""
AJAX for SQLite Viewer plugin
"""
from yapsy.IPlugin import IPlugin
from flask import Response, jsonify
import json
import logging
import sqlite3
class FaSqliteAjax(IPlugin):
def __init__(self):
self.display_name = 'SQLite Ajax'
self.popularity = 0
self.cache = True
self.fast ... | [
"yapsy.IPlugin.IPlugin.activate",
"sqlite3.connect",
"json.dumps",
"yapsy.IPlugin.IPlugin.deactivate",
"yapsy.IPlugin.IPlugin.__init__",
"logging.error"
] | [((364, 386), 'yapsy.IPlugin.IPlugin.__init__', 'IPlugin.__init__', (['self'], {}), '(self)\n', (380, 386), False, 'from yapsy.IPlugin import IPlugin\n'), ((420, 442), 'yapsy.IPlugin.IPlugin.activate', 'IPlugin.activate', (['self'], {}), '(self)\n', (436, 442), False, 'from yapsy.IPlugin import IPlugin\n'), ((493, 517)... |
import math
from constants import Constants
from utils import vector2d
from wpilib import SmartDashboard as Dash
from autonomous import pursuitpoint
class PurePursuit():
"""An implementation of the Pure Pursuit path tracking algorithm."""
def __init__(self, path):
self.path = path
self.pursui... | [
"autonomous.pursuitpoint.PursuitPoint",
"wpilib.SmartDashboard.putNumber",
"utils.vector2d.Vector2D",
"math.sqrt",
"math.hypot",
"wpilib.SmartDashboard.putNumberArray"
] | [((546, 565), 'utils.vector2d.Vector2D', 'vector2d.Vector2D', ([], {}), '()\n', (563, 565), False, 'from utils import vector2d\n'), ((6145, 6186), 'utils.vector2d.Vector2D', 'vector2d.Vector2D', (['l_velocity', 'r_velocity'], {}), '(l_velocity, r_velocity)\n', (6162, 6186), False, 'from utils import vector2d\n'), ((681... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Filename: DensityPeaks.py
# @Author: <NAME>
# @Time: 5/3/22 09:55
# @Version: 4.0
import math
from collections import defaultdict
import numpy as np
import pandas as pd
from sklearn.neighbors import KNeighborsClassifier, NearestNeighbors
from sklearn.... | [
"sklearn.semi_supervised.SelfTrainingClassifier",
"scipy.spatial.distance.squareform",
"sklearn.preprocessing.LabelEncoder",
"numpy.triu_indices",
"pandas.DataFrame",
"scipy.spatial.distance.pdist",
"sklearn.neighbors.KNeighborsClassifier",
"numpy.max",
"numpy.argsort",
"numpy.array",
"collectio... | [((2864, 2909), 'scipy.spatial.distance.pdist', 'pdist', (['self.data'], {'metric': 'self.distance_metric'}), '(self.data, metric=self.distance_metric)\n', (2869, 2909), False, 'from scipy.spatial.distance import pdist, squareform\n'), ((2936, 2963), 'scipy.spatial.distance.squareform', 'squareform', (['distance_matrix... |
"""
# Definition for a Node.
"""
class TreeNode(object):
def __init__(self, val, children):
self.val = val
self.children = children
class Solution(object):
def levelOrder(self, root):
"""
:type root: Node
:rtype: List[List[int]]
"""
if root is None:
... | [
"Queue.Queue"
] | [((388, 395), 'Queue.Queue', 'Queue', ([], {}), '()\n', (393, 395), False, 'from Queue import Queue\n')] |
from django.db import models
from vaccine_card.vaccination.models import Vaccine
class State(models.Model):
name = models.CharField(max_length=20, verbose_name='Nome')
class Meta:
verbose_name = 'Unidade Federativa'
def __str__(self):
return self.name
class City(models.Model):
nam... | [
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.db.models.DateTimeField",
"django.db.models.PositiveSmallIntegerField",
"django.db.models.CharField"
] | [((122, 174), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(20)', 'verbose_name': '"""Nome"""'}), "(max_length=20, verbose_name='Nome')\n", (138, 174), False, 'from django.db import models\n'), ((324, 376), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(50)', 'verbose_... |
import os
import numpy as np
import pytest
import easyidp
from easyidp.core.objects import ReconsProject, Points
from easyidp.io import metashape
module_path = os.path.join(easyidp.__path__[0], "io/tests")
def test_init_reconsproject():
attempt1 = ReconsProject("agisoft")
assert attempt1.software == "metash... | [
"easyidp.test_full_path",
"numpy.testing.assert_array_almost_equal",
"easyidp.core.objects.Points",
"easyidp.core.objects.ReconsProject",
"numpy.asarray",
"os.path.join",
"easyidp.io.metashape.open_project",
"pytest.raises"
] | [((162, 207), 'os.path.join', 'os.path.join', (['easyidp.__path__[0]', '"""io/tests"""'], {}), "(easyidp.__path__[0], 'io/tests')\n", (174, 207), False, 'import os\n'), ((256, 280), 'easyidp.core.objects.ReconsProject', 'ReconsProject', (['"""agisoft"""'], {}), "('agisoft')\n", (269, 280), False, 'from easyidp.core.obj... |
#!/usr/bin/env python
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.slider import Slider
from kivy.graphics import Color, Bezier, Line
class BezierTest(FloatLayout):
def __init__(self, points=[], loop=False, *args, **kwargs):
super(BezierTest, self).__init__(*args, *... | [
"kivy.uix.slider.Slider",
"kivy.graphics.Line",
"kivy.graphics.Bezier",
"math.radians",
"math.cos",
"kivy.graphics.Color",
"math.sin"
] | [((921, 987), 'kivy.uix.slider.Slider', 'Slider', ([], {'y': '(0)', 'pos_hint': "{'x': 0.3}", 'size_hint': '(0.7, None)', 'height': '(50)'}), "(y=0, pos_hint={'x': 0.3}, size_hint=(0.7, None), height=50)\n", (927, 987), False, 'from kivy.uix.slider import Slider\n'), ((1077, 1144), 'kivy.uix.slider.Slider', 'Slider', (... |
#!/usr/bin/env python
# encoding: utf-8
import sys
reload(sys)
sys.setdefaultencoding("utf-8") | [
"sys.setdefaultencoding"
] | [((65, 96), 'sys.setdefaultencoding', 'sys.setdefaultencoding', (['"""utf-8"""'], {}), "('utf-8')\n", (87, 96), False, 'import sys\n')] |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from config import CONFIG
import json
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt # pylint: disable=g-import-not-at-top
import io
import math
import os
import time
from absl i... | [
"tensorflow.unstack",
"tensorflow.train.Checkpoint",
"tensorflow.tile",
"tensorflow.split",
"io.BytesIO",
"absl.logging.info",
"time.sleep",
"tensorflow.config.experimental.list_logical_devices",
"numpy.array",
"tensorflow.config.experimental.set_visible_devices",
"config.CONFIG.items",
"tenso... | [((406, 427), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (420, 427), False, 'import matplotlib\n'), ((591, 632), 'tensorflow.unstack', 'tf.unstack', (['frames'], {'num': 'num_steps', 'axis': '(1)'}), '(frames, num=num_steps, axis=1)\n', (601, 632), True, 'import tensorflow as tf\n'), ((656, 6... |
import copy
import time
from collections import defaultdict
import cloudpickle
import numpy as np
import pandas as pd
import woodwork as ww
from sklearn.model_selection import BaseCrossValidator
from .pipeline_search_plots import PipelineSearchPlots
from evalml.automl.automl_algorithm import IterativeAlgorithm
from ... | [
"evalml.pipelines.ModeBaselineMulticlassPipeline",
"pandas.option_context",
"evalml.exceptions.PipelineNotFoundError",
"copy.deepcopy",
"evalml.pipelines.utils.make_pipeline",
"evalml.objectives.get_non_core_objectives",
"evalml.utils.logger.get_logger",
"numpy.arange",
"evalml.utils.logger.log_subt... | [((1498, 1518), 'evalml.utils.logger.get_logger', 'get_logger', (['__file__'], {}), '(__file__)\n', (1508, 1518), False, 'from evalml.utils.logger import get_logger, log_subtitle, log_title, time_elapsed, update_pipeline\n'), ((9426, 9473), 'evalml.objectives.get_objective', 'get_objective', (['objective'], {'return_in... |
import graphene
from graphql_jwt.decorators import setup_jwt_cookie
from . import mixins, types
from .decorators import social_auth
class SocialAuthMutation(mixins.SocialAuthMixin, graphene.Mutation):
social = graphene.Field(types.SocialType)
class Meta:
abstract = True
class Arguments:
... | [
"graphene.String",
"graphene.Field"
] | [((217, 249), 'graphene.Field', 'graphene.Field', (['types.SocialType'], {}), '(types.SocialType)\n', (231, 249), False, 'import graphene\n'), ((332, 362), 'graphene.String', 'graphene.String', ([], {'required': '(True)'}), '(required=True)\n', (347, 362), False, 'import graphene\n'), ((378, 408), 'graphene.String', 'g... |
#!/usr/bin/env python3
import os
import argparse
import logging
import isce
import isceobj
from components.stdproc.stdproc import crossmul
from iscesys.ImageUtil.ImageUtil import ImageUtil as IU
def createParser():
'''
Command Line Parser.
'''
parser = argparse.ArgumentParser( description='Generat... | [
"argparse.ArgumentParser",
"isceobj.createImage",
"isceobj.createAmpImage",
"os.path.dirname",
"isceobj.createSlcImage",
"components.stdproc.stdproc.crossmul.createcrossmul",
"isceobj.createIntImage",
"iscesys.ImageUtil.ImageUtil.ImageUtil.copyAttributes"
] | [((275, 368), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Generate offset field between two Sentinel swaths"""'}), "(description=\n 'Generate offset field between two Sentinel swaths')\n", (298, 368), False, 'import argparse\n'), ((1151, 1175), 'isceobj.createSlcImage', 'isceobj.cr... |
# Copyright (c) 2014-present PlatformIO <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | [
"platformio.package.manager.core.get_core_package_dir",
"click.echo",
"click.launch",
"platformio.commands.home.rpc.handlers.piocore.PIOCoreRPC",
"platformio.commands.home.rpc.handlers.os.OSRPC",
"starlette.routing.Route",
"platformio.commands.home.rpc.handlers.account.AccountRPC",
"platformio.command... | [((2105, 2151), 'starlette.responses.PlainTextResponse', 'PlainTextResponse', (['"""Server has been shutdown!"""'], {}), "('Server has been shutdown!')\n", (2122, 2151), False, 'from starlette.responses import PlainTextResponse\n'), ((2194, 2285), 'starlette.responses.PlainTextResponse', 'PlainTextResponse', (['"""Prot... |
# Copyright 2015 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Messages for the Machine Provider API."""
# pylint: disable=unused-wildcard-import, wildcard-import
from protorpc import messages
from compo... | [
"protorpc.messages.StringField",
"protorpc.messages.MessageField",
"protorpc.messages.IntegerField",
"protorpc.messages.EnumField"
] | [((650, 688), 'protorpc.messages.StringField', 'messages.StringField', (['(1)'], {'required': '(True)'}), '(1, required=True)\n', (670, 688), False, 'from protorpc import messages\n'), ((738, 768), 'protorpc.messages.EnumField', 'messages.EnumField', (['Backend', '(2)'], {}), '(Backend, 2)\n', (756, 768), False, 'from ... |
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | [
"tensorflow.compat.v2.compat.v1.summary.FileWriter",
"tensorflow.compat.v2.compat.v1.Graph",
"tensorboard.data.provider.RunTagFilter",
"six.moves.xrange",
"tensorflow.compat.v2.summary.write",
"tensorboard.compat.proto.summary_pb2.SummaryMetadata",
"tensorboard.plugins.image.summary_v2.image",
"tensor... | [((1874, 1902), 'tensorflow.compat.v1.enable_eager_execution', 'tf1.enable_eager_execution', ([], {}), '()\n', (1900, 1902), True, 'import tensorflow.compat.v1 as tf1\n'), ((21426, 21440), 'tensorflow.compat.v2.test.main', 'tf.test.main', ([], {}), '()\n', (21438, 21440), True, 'import tensorflow.compat.v2 as tf\n'), (... |
import pyredner
import numpy as np
import torch
cam = pyredner.Camera(position = torch.tensor([0.0, 0.0, -5.0]),
look_at = torch.tensor([0.0, 0.0, 0.0]),
up = torch.tensor([0.0, 1.0, 0.0]),
fov = torch.tensor([45.0]), # in degree
c... | [
"pyredner.get_device",
"pyredner.Scene.load_state_dict",
"pyredner.Scene",
"torch.tensor",
"pyredner.RenderFunction.serialize_scene"
] | [((1526, 1577), 'pyredner.Scene', 'pyredner.Scene', (['cam', 'shapes', 'materials', 'area_lights'], {}), '(cam, shapes, materials, area_lights)\n', (1540, 1577), False, 'import pyredner\n'), ((1625, 1673), 'pyredner.Scene.load_state_dict', 'pyredner.Scene.load_state_dict', (['scene_state_dict'], {}), '(scene_state_dict... |
from typing import Callable, AnyStr, Optional
from zlib import compress as default_compress, decompress as default_decompress
from .cache import Cache
from ..constants import NOT_FOUND
class CacheCompressionDecorator(Cache):
def __init__(
self,
cache: Cache,
compress: Optional[Callable[[s... | [
"zlib.decompress"
] | [((1403, 1427), 'zlib.decompress', 'default_decompress', (['data'], {}), '(data)\n', (1421, 1427), True, 'from zlib import compress as default_compress, decompress as default_decompress\n')] |
"""Mobjects representing vector fields."""
__all__ = [
"VectorField",
"ArrowVectorField",
"StreamLines",
]
import itertools as it
import random
from math import ceil, floor
from typing import Callable, Iterable, Optional, Sequence, Tuple, Type
import numpy as np
from colour import Color
from PIL import I... | [
"numpy.clip",
"math.ceil",
"random.shuffle",
"math.floor",
"numpy.random.random",
"itertools.product",
"numpy.array",
"numpy.zeros",
"numpy.apply_along_axis",
"numpy.linspace",
"numpy.random.seed",
"numpy.linalg.norm",
"random.random",
"numpy.arange"
] | [((13292, 13313), 'numpy.zeros', 'np.zeros', (['(ph, pw, 3)'], {}), '((ph, pw, 3))\n', (13300, 13313), True, 'import numpy as np\n'), ((13332, 13364), 'numpy.linspace', 'np.linspace', (['(-fw / 2)', '(fw / 2)', 'pw'], {}), '(-fw / 2, fw / 2, pw)\n', (13343, 13364), True, 'import numpy as np\n'), ((13383, 13415), 'numpy... |
"""
This library allows the conversion of python 3.7's :mod:`dataclasses`
to :mod:`marshmallow` schemas.
It takes a python class, and generates a marshmallow schema for it.
Simple example::
from marshmallow import Schema
from marshmallow_dataclass import dataclass
@dataclass
class Point:
x:flo... | [
"inspect.getmembers",
"dataclasses.fields",
"marshmallow.Schema.TYPE_MAPPING.get",
"marshmallow_enum.EnumField",
"marshmallow.utils.is_iterable_but_not_string",
"dataclasses.dataclass",
"marshmallow.fields.Nested",
"marshmallow.fields.Raw",
"doctest.testmod",
"typing_inspect.get_args",
"typing_i... | [((1344, 1357), 'typing.TypeVar', 'TypeVar', (['"""_U"""'], {}), "('_U')\n", (1351, 1357), False, 'from typing import Any, Callable, Dict, List, Mapping, Optional, Set, Tuple, Type, TypeVar, Union, cast, overload\n'), ((8956, 9002), 'functools.lru_cache', 'lru_cache', ([], {'maxsize': 'MAX_CLASS_SCHEMA_CACHE_SIZE'}), '... |
import sys
import typing
import numpy as np
def solve(
n: int,
g: np.array,
) -> typing.NoReturn:
indeg = np.zeros(
n,
dtype=np.int64,
)
for v in g[:, 1]:
indeg[v] += 1
g = g[g[:, 0].argsort()]
i = np.searchsorted(
g[:, 0],
np.arange(n + 1)
)
q = [
v for v in range(n)
if... | [
"numba.pycc.CC",
"numpy.zeros",
"my_module.solve",
"sys.stdin.read",
"numpy.arange"
] | [((115, 142), 'numpy.zeros', 'np.zeros', (['n'], {'dtype': 'np.int64'}), '(n, dtype=np.int64)\n', (123, 142), True, 'import numpy as np\n'), ((347, 374), 'numpy.zeros', 'np.zeros', (['n'], {'dtype': 'np.int64'}), '(n, dtype=np.int64)\n', (355, 374), True, 'import numpy as np\n'), ((791, 802), 'my_module.solve', 'solve'... |
import os
import tempfile
def hasOnePointInside(bigRect, minRect): # хотя бы одна точка лежит внутри
minY, minX, maxY, maxX = bigRect
y1, x1, y2, x2 = minRect
a = (minY <= y1 <= maxY)
b = (minX <= x1 <= maxX)
c = (minY <= y2 <= maxY)
d = (minX <= x2 <= maxX)
return a or b or c or d
d... | [
"PIL.Image.open",
"matplotlib.pyplot.savefig",
"os.path.split",
"os.getcwd",
"tempfile.NamedTemporaryFile",
"matplotlib.pyplot.subplots"
] | [((1618, 1633), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)'], {}), '(1)\n', (1630, 1633), True, 'import matplotlib.pyplot as plt\n'), ((2025, 2054), 'tempfile.NamedTemporaryFile', 'tempfile.NamedTemporaryFile', ([], {}), '()\n', (2052, 2054), False, 'import tempfile\n'), ((2107, 2124), 'matplotlib.pyplot.save... |
from goopylib.objects.GraphicsObject import GraphicsObject
from goopylib.styles import *
class BBox(GraphicsObject):
# Internal base class for objects represented by bounding box
# (opposite corners) Line segment is a degenerate case.
resizing_objects = []
def __init__(self, p1, p2, bounds=None, fi... | [
"goopylib.objects.GraphicsObject.GraphicsObject.resizing_objects.add",
"goopylib.objects.GraphicsObject.GraphicsObject.resizing_objects.remove",
"goopylib.objects.GraphicsObject.GraphicsObject.__init__"
] | [((1010, 1107), 'goopylib.objects.GraphicsObject.GraphicsObject.__init__', 'GraphicsObject.__init__', (['self'], {'options': '()', 'cursor': 'cursor', 'layer': 'layer', 'bounds': 'bounds', 'tag': 'tag'}), '(self, options=(), cursor=cursor, layer=layer,\n bounds=bounds, tag=tag)\n', (1033, 1107), False, 'from goopyli... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Make sure that generic functions work exactly as we expect.'''
# IMPORT STANDARD LIBRARIES
import unittest
# IMPORT WAYS LIBRARIES
from ways import common
class ParseTestCase(unittest.TestCase):
'''Test generic parsing-related functions.'''
def test_workin... | [
"ways.common.expand_string"
] | [((644, 679), 'ways.common.expand_string', 'common.expand_string', (['pattern', 'text'], {}), '(pattern, text)\n', (664, 679), False, 'from ways import common\n'), ((953, 994), 'ways.common.expand_string', 'common.expand_string', (['format_string', 'shot'], {}), '(format_string, shot)\n', (973, 994), False, 'from ways ... |
import os, sys
import random
import string
try:
# Make Python2 work like Python3
input = raw_input
except NameError:
# On Python3; already using input
pass
letters = string.ascii_letters
numbers = string.digits
punctuation = string.punctuation
def generate(password_length, at_least_one_letter, at_lea... | [
"random.choice",
"random.shuffle"
] | [((1951, 1977), 'random.shuffle', 'random.shuffle', (['characters'], {}), '(characters)\n', (1965, 1977), False, 'import random\n'), ((1283, 1305), 'random.choice', 'random.choice', (['letters'], {}), '(letters)\n', (1296, 1305), False, 'import random\n'), ((1404, 1426), 'random.choice', 'random.choice', (['numbers'], ... |
# forms are not just about display, instead they are more of validation
# wtf forms protect our site against csrf attacks
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, TextAreaField
from wtforms.validators import (DataRequired, Regexp, ValidationError, Email,
Length, EqualTo... | [
"wtforms.validators.Email",
"wtforms.validators.ValidationError",
"wtforms.validators.EqualTo",
"models.User.select",
"wtforms.validators.Length",
"wtforms.validators.Regexp",
"wtforms.validators.DataRequired"
] | [((450, 504), 'wtforms.validators.ValidationError', 'ValidationError', (['"""User with this name already exists."""'], {}), "('User with this name already exists.')\n", (465, 504), False, 'from wtforms.validators import DataRequired, Regexp, ValidationError, Email, Length, EqualTo\n'), ((605, 660), 'wtforms.validators.... |
"""
A Testcase to remove mon from
when I/O's are happening.
Polarion-ID- OCS-355
"""
import logging
import pytest
from ocs_ci.ocs import ocp, constants
from ocs_ci.framework.testlib import tier4, ManageTest
from ocs_ci.framework import config
from ocs_ci.ocs.resources import pod
from tests.helpers import run_io_with... | [
"logging.getLogger",
"ocs_ci.ocs.resources.pod.get_ceph_tools_pod",
"tests.helpers.run_io_with_rados_bench",
"tests.helpers.delete_cephblockpool",
"ocs_ci.ocs.cluster.CephCluster",
"ocs_ci.utility.retry.retry",
"pytest.mark.polarion_id",
"pytest.skip",
"ocs_ci.ocs.ocp.OCP"
] | [((499, 526), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (516, 526), False, 'import logging\n'), ((530, 565), 'ocs_ci.utility.retry.retry', 'retry', (['CephHealthException', '(8)', '(3)', '(1)'], {}), '(CephHealthException, 8, 3, 1)\n', (535, 565), False, 'from ocs_ci.utility.retry im... |
'''
Unit tests table.py.
:see: http://docs.python.org/lib/minimal-example.html for an intro to unittest
:see: http://agiletesting.blogspot.com/2005/01/python-unit-testing-part-1-unittest.html
:see: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/305292
'''
from __future__ import absolute_import
from statsmodel... | [
"numpy.testing.assert_equal",
"statsmodels.iolib.table.Cell",
"statsmodels.iolib.table.default_latex_fmt.copy",
"statsmodels.iolib.table.default_html_fmt.copy",
"statsmodels.compat.python.zip",
"statsmodels.iolib.table.SimpleTable"
] | [((619, 643), 'statsmodels.iolib.table.default_latex_fmt.copy', 'default_latex_fmt.copy', ([], {}), '()\n', (641, 643), False, 'from statsmodels.iolib.table import default_latex_fmt\n'), ((656, 679), 'statsmodels.iolib.table.default_html_fmt.copy', 'default_html_fmt.copy', ([], {}), '()\n', (677, 679), False, 'from sta... |
from abc import ABC, abstractmethod
from contextlib import contextmanager
from uuid import uuid4
import pytest
from sqlalchemy import (
delete,
select,
UniqueConstraint,
)
class AbstractBaseTest(ABC):
@pytest.fixture
def cls_(self):
"""
Return class under test.
Assumptions... | [
"sqlalchemy.select",
"sqlalchemy.delete",
"uuid.uuid4"
] | [((4284, 4291), 'uuid.uuid4', 'uuid4', ([], {}), '()\n', (4289, 4291), False, 'from uuid import uuid4\n'), ((2669, 2680), 'sqlalchemy.select', 'select', (['cls'], {}), '(cls)\n', (2675, 2680), False, 'from sqlalchemy import delete, select, UniqueConstraint\n'), ((1366, 1379), 'sqlalchemy.delete', 'delete', (['table'], ... |
from calendar import setfirstweekday
stopped_in_user_file = True
setfirstweekday(15) | [
"calendar.setfirstweekday"
] | [((65, 84), 'calendar.setfirstweekday', 'setfirstweekday', (['(15)'], {}), '(15)\n', (80, 84), False, 'from calendar import setfirstweekday\n')] |
import os
import sys
import pandas as pd
from datetime import datetime
from settings import RAW_DATA_DIR, DataV3, DATA_V3_SUBVERSION
from src.features.helpers.processing import add_missing_timestamp_values
from src.features.helpers.processing_v3 import get_closest_players, get_players_and_ball_indices, calculate_distan... | [
"settings.DataV3",
"src.features.helpers.processing_v3.normalize_according_to_play_direction",
"pandas.read_csv",
"src.features.helpers.processing_v4.calculate_team_sitation",
"src.features.helpers.processing_v3.check_group_event",
"os.path.join",
"src.features.helpers.processing_v3.get_players_and_ball... | [((519, 545), 'settings.DataV3', 'DataV3', (['DATA_V3_SUBVERSION'], {}), '(DATA_V3_SUBVERSION)\n', (525, 545), False, 'from settings import RAW_DATA_DIR, DataV3, DATA_V3_SUBVERSION\n'), ((3598, 3645), 'src.features.helpers.processing_v3.normalize_according_to_play_direction', 'normalize_according_to_play_direction', ([... |
import streamlit as st
import tensorflow as tf
import numpy
from utils.get_owm_data import get_open_weather_map_data
from utils.get_date import get_date_list_for_gmt
import plotly.graph_objects as go
from plotly import tools
import plotly.offline as py
import plotly.express as px
def app():
st.title("LSTM Model")
... | [
"streamlit.markdown",
"utils.get_owm_data.get_open_weather_map_data",
"plotly.graph_objects.Scatter",
"plotly.graph_objects.Figure",
"tensorflow.keras.models.load_model",
"streamlit.subheader",
"streamlit.plotly_chart",
"utils.get_date.get_date_list_for_gmt",
"streamlit.title"
] | [((296, 318), 'streamlit.title', 'st.title', (['"""LSTM Model"""'], {}), "('LSTM Model')\n", (304, 318), True, 'import streamlit as st\n'), ((322, 362), 'streamlit.subheader', 'st.subheader', (['"""What does LSTM model do?"""'], {}), "('What does LSTM model do?')\n", (334, 362), True, 'import streamlit as st\n'), ((364... |
# -*- coding: utf-8 -*-
import os
ROOT = os.path.abspath(os.path.dirname(__file__))
path = lambda *args: os.path.join(ROOT, *args)
""" Template for local settings of the FST webservice (fst_web)
Please edit this file and replace all generic values with values suitable to
your particular installation.
"""
# NOTE! Al... | [
"os.path.dirname",
"os.path.join"
] | [((1505, 1531), 'os.path.join', 'os.path.join', (['"""/dokument/"""'], {}), "('/dokument/')\n", (1517, 1531), False, 'import os\n'), ((1776, 1834), 'os.path.join', 'os.path.join', (['"""http://127.0.0.1:8000"""', 'FST_INSTANCE_PREFIX'], {}), "('http://127.0.0.1:8000', FST_INSTANCE_PREFIX)\n", (1788, 1834), False, 'impo... |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | [
"google.appengine.ext.ndb.Key",
"webapp2.WSGIApplication",
"cgi.escape",
"google.appengine.ext.ndb.DateTimeProperty",
"google.appengine.ext.ndb.StringProperty"
] | [((2721, 2905), 'webapp2.WSGIApplication', 'webapp2.WSGIApplication', (["[('/', MainHandler), ('/GetUser/', GetUser), ('/HasData/', HasData), (\n '/chrome-sync/command/', PostData), ('/GetSyncData/', GetSyncData)]"], {'debug': '(True)'}), "([('/', MainHandler), ('/GetUser/', GetUser), (\n '/HasData/', HasData), (... |
# Comet VOEvent Broker.
from twisted.application.internet import ClientService
from comet.protocol.subscriber import VOEventSubscriberFactory
__all__ = ["makeSubscriberService"]
def makeSubscriberService(endpoint, local_ivo, validators, handlers, filters):
"""Create a reconnecting VOEvent subscriber service.
... | [
"twisted.application.internet.ClientService",
"comet.protocol.subscriber.VOEventSubscriberFactory"
] | [((1300, 1366), 'comet.protocol.subscriber.VOEventSubscriberFactory', 'VOEventSubscriberFactory', (['local_ivo', 'validators', 'handlers', 'filters'], {}), '(local_ivo, validators, handlers, filters)\n', (1324, 1366), False, 'from comet.protocol.subscriber import VOEventSubscriberFactory\n'), ((1381, 1413), 'twisted.ap... |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import base64
import json
import os
import re
import shutil
import zlib
from StringIO import StringIO
try:
# Create a block to work around evil sys.m... | [
"json.loads",
"email.Message.Message",
"twisted.internet.reactor.connectTCP",
"re.compile",
"twisted.python.log.msg",
"email.Utils.formatdate",
"json.dumps",
"base64.b64decode",
"buildbot.schedulers.trysched.TryBase.startService",
"master.try_job_base.BadJobfile",
"twisted.internet.defer.Deferre... | [((1143, 1177), 're.compile', 're.compile', (['"""^[a-zA-Z][\\\\w-]+\\\\w$"""'], {}), "('^[a-zA-Z][\\\\w-]+\\\\w$')\n", (1153, 1177), False, 'import re\n'), ((4697, 4801), 'master.try_job_base.BadJobfile', 'BadJobfile', (['"""Cannot translate --remote-patches from tryjob v.2 to v.3. Please run repo sync."""'], {}), "(... |
# Copyright 2018 <NAME> LLC, <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | [
"os.path.basename"
] | [((1572, 1598), 'os.path.basename', 'os.path.basename', (['filename'], {}), '(filename)\n', (1588, 1598), False, 'import os\n')] |
from matplotlib import colors
import numpy as np
class SaveOutput:
def __init__(self):
self.outputs = []
def __call__(self, module, module_in, module_out):
self.outputs.append(module_out)
def clear(self):
self.outputs = []
class MidpointNormalize(colors.Normalize):
def __init... | [
"matplotlib.colors.Normalize.__init__",
"numpy.interp"
] | [((417, 466), 'matplotlib.colors.Normalize.__init__', 'colors.Normalize.__init__', (['self', 'vmin', 'vmax', 'clip'], {}), '(self, vmin, vmax, clip)\n', (442, 466), False, 'from matplotlib import colors\n'), ((737, 759), 'numpy.interp', 'np.interp', (['value', 'x', 'y'], {}), '(value, x, y)\n', (746, 759), True, 'impor... |
import pytest
from copy import deepcopy
from gefest.core.structure.point import Point
from gefest.core.structure.polygon import Polygon
from gefest.core.structure.structure import Structure
from gefest.core.algs.postproc.resolve_errors import *
from gefest.core.algs.geom.validation import *
# marking length and width... | [
"gefest.core.structure.point.Point",
"gefest.core.structure.structure.Structure",
"copy.deepcopy"
] | [((1059, 1094), 'gefest.core.structure.structure.Structure', 'Structure', (['[unclosed_triangle_poly]'], {}), '([unclosed_triangle_poly])\n', (1068, 1094), False, 'from gefest.core.structure.structure import Structure\n'), ((1319, 1346), 'gefest.core.structure.structure.Structure', 'Structure', (['[incorrect_poly]'], {... |
from unittest.mock import MagicMock, Mock
from i3ipc.aio import Con
import i3_live_tree.tree_serializer # noqa: F401
class MockConSerializer(Mock, Con):
"""Mock a generic i3ipc.aio.Con for serialization purposes
This Mock is meant to ease testing of i3ipc.aio.Con serialization methods,
which are mokey... | [
"unittest.mock.Mock.__init__"
] | [((821, 857), 'unittest.mock.Mock.__init__', 'Mock.__init__', (['self', '*args'], {}), '(self, *args, **kwargs)\n', (834, 857), False, 'from unittest.mock import MagicMock, Mock\n')] |
import token
from tokenize import tokenize
from brownie import Contract, chain
from brownie.exceptions import ContractNotFound
from cachetools.func import ttl_cache
from .utils.cache import memory
from .utils.multicall2 import fetch_multicall
from .interfaces.ERC20 import ERC20ABI
import ypricemagic.magic
import yprice... | [
"brownie.Contract",
"cachetools.func.ttl_cache"
] | [((3709, 3729), 'cachetools.func.ttl_cache', 'ttl_cache', ([], {'ttl': '(36000)'}), '(ttl=36000)\n', (3718, 3729), False, 'from cachetools.func import ttl_cache\n'), ((5725, 5743), 'cachetools.func.ttl_cache', 'ttl_cache', ([], {'ttl': '(600)'}), '(ttl=600)\n', (5734, 5743), False, 'from cachetools.func import ttl_cach... |
from typing import Tuple
import torch
from torch.autograd import Function
import torch.nn as nn
from metrics.pointops import pointops_cuda
import numpy as np
class FurthestSampling(Function):
@staticmethod
def forward(ctx, xyz, m):
"""
input: xyz: (b, n, 3) and n > m, m: int32
outpu... | [
"metrics.pointops.pointops_cuda.gathering_backward_cuda",
"torch.cuda.LongTensor",
"metrics.pointops.pointops_cuda.featuregather_forward_cuda",
"metrics.pointops.pointops_cuda.nearestneighbor_cuda",
"metrics.pointops.pointops_cuda.gathering_forward_cuda",
"torch.sqrt",
"metrics.pointops.pointops_cuda.la... | [((12487, 12517), 'torch.clamp', 'torch.clamp', (['dist', '(0.0)', 'np.inf'], {}), '(dist, 0.0, np.inf)\n', (12498, 12517), False, 'import torch\n'), ((425, 451), 'torch.cuda.IntTensor', 'torch.cuda.IntTensor', (['b', 'm'], {}), '(b, m)\n', (445, 451), False, 'import torch\n'), ((516, 576), 'metrics.pointops.pointops_c... |
from layout import Shape, Widget
from flash.text.engine import TextBlock, TextElement
@package('layout')
class Poly(Shape):
__slots__ = ('fillcolor', 'sequence')
def __init__(self, name, fillcolor, seq, states):
super().__init__(name, states)
self.fillcolor = fillcolor
self.sequence = s... | [
"flash.text.engine.TextBlock",
"flash.text.engine.TextElement"
] | [((1479, 1490), 'flash.text.engine.TextBlock', 'TextBlock', ([], {}), '()\n', (1488, 1490), False, 'from flash.text.engine import TextBlock, TextElement\n'), ((1512, 1547), 'flash.text.engine.TextElement', 'TextElement', (['self.text', 'self.format'], {}), '(self.text, self.format)\n', (1523, 1547), False, 'from flash.... |
import csv
import math
import numpy as np
import pandas
import scipy.optimize
import sys
import argparse
def ineq_constraint_1(v):
return np.array([vi for vi in v])
def ineq_constraint_2(v):
return np.array([-vi + 30 for vi in v])
class WeightAverage:
def __init__(self, mean, csv):
self.df = ... | [
"math.ceil",
"argparse.ArgumentParser",
"math.floor",
"pandas.read_csv",
"numpy.array"
] | [((144, 170), 'numpy.array', 'np.array', (['[vi for vi in v]'], {}), '([vi for vi in v])\n', (152, 170), True, 'import numpy as np\n'), ((210, 244), 'numpy.array', 'np.array', (['[(-vi + 30) for vi in v]'], {}), '([(-vi + 30) for vi in v])\n', (218, 244), True, 'import numpy as np\n'), ((2690, 2744), 'argparse.Argument... |
import tkinter as tk
import tkinter.messagebox
from Control import Control
class View:
def __init__(self, control : Control.Control):
self.control = control
# Init Window
self.root = tk.Tk()
self.root.title(u"Header File Generator")
self.root.geometry("700x800")
se... | [
"tkinter.Entry",
"tkinter.Button",
"tkinter.Tk",
"tkinter.Label",
"tkinter.Frame"
] | [((213, 220), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (218, 220), True, 'import tkinter as tk\n'), ((338, 357), 'tkinter.Frame', 'tk.Frame', (['self.root'], {}), '(self.root)\n', (346, 357), True, 'import tkinter as tk\n'), ((402, 439), 'tkinter.Label', 'tk.Label', (['self.config_frame'], {'width': '(20)'}), '(self.co... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module that contains the command line app.
Why does this file exist, and why not put this in __main__?
You might be tempted to import things from __main__ later, but that will cause
problems: the code will get executed twice:
- When you run `python -m nibetaser... | [
"argparse.ArgumentParser",
"os.makedirs",
"nipype.config.update_config",
"os.path.join",
"yaml.load",
"multiprocessing.cpu_count",
"os.getcwd",
"os.path.abspath"
] | [((1046, 1154), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""NiBetaSeries BIDS arguments"""', 'formatter_class': 'RawTextHelpFormatter'}), "(description='NiBetaSeries BIDS arguments',\n formatter_class=RawTextHelpFormatter)\n", (1069, 1154), False, 'import argparse\n'), ((7853, 7883... |
from django.test import TestCase
from django.test import Client
class RegisterTestCase(TestCase):
def test_register(self):
c = Client()
# on success redirects to /
response = c.post('/accounts/register/', {
'username': 'asdas',
'password1': '<PASSWORD>',
... | [
"django.test.Client"
] | [((141, 149), 'django.test.Client', 'Client', ([], {}), '()\n', (147, 149), False, 'from django.test import Client\n')] |
#
# Modified by <NAME>
# Contact: <EMAIL>
#
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
OneNet Transformer class.
Copy-paste from torch.nn.Transformer with modifications:
* positional encodings are passed in MHattention
* extra LN at the end of encoder is removed
* decoder re... | [
"torch.nn.init.constant_",
"torch.nn.init.xavier_uniform_",
"torch.stack",
"torch.nn.Conv2d",
"math.log",
"torch.meshgrid",
"torch.no_grad",
"torch.zeros_like",
"torch.arange"
] | [((2938, 2953), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (2951, 2953), False, 'import torch\n'), ((1206, 1279), 'torch.nn.Conv2d', 'nn.Conv2d', (['self.d_model', 'self.d_model'], {'kernel_size': '(3)', 'stride': '(1)', 'padding': '(1)'}), '(self.d_model, self.d_model, kernel_size=3, stride=1, padding=1)\n', ... |
"""
Module holds all stuff regarding Grinder tool usage
Copyright 2015 BlazeMeter Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless require... | [
"bzt.utils.FileReader",
"re.compile",
"bzt.utils.unzip",
"os.path.join",
"bzt.utils.get_full_path",
"bzt.modules.console.ExecutorWidget",
"bzt.ToolError",
"os.path.basename",
"bzt.TaurusConfigError",
"bzt.utils.shutdown_process",
"time.time",
"bzt.six.iteritems",
"os.remove"
] | [((10071, 10134), 're.compile', 're.compile', (['"""worker\\\\.(\\\\S+) (.+) -> (\\\\S+) (.+), (\\\\d+) bytes"""'], {}), "('worker\\\\.(\\\\S+) (.+) -> (\\\\S+) (.+), (\\\\d+) bytes')\n", (10081, 10134), False, 'import re\n'), ((5650, 5716), 'os.path.join', 'os.path.join', (['self.engine.artifacts_dir', "(self.exec_id ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import pytest
import json
from kafkacli.formatter import Formatter
sampleJson = json.loads('{"a":"s", "b":1}')
def test_print_default(capsys):
Formatter().print(sampleJson)
captured = capsys.readouterr()
assert captured.out == '{"a": "s", "b": 1}\n... | [
"kafkacli.formatter.Formatter",
"json.loads"
] | [((138, 168), 'json.loads', 'json.loads', (['"""{"a":"s", "b":1}"""'], {}), '(\'{"a":"s", "b":1}\')\n', (148, 168), False, 'import json\n'), ((207, 218), 'kafkacli.formatter.Formatter', 'Formatter', ([], {}), '()\n', (216, 218), False, 'from kafkacli.formatter import Formatter\n'), ((359, 382), 'kafkacli.formatter.Form... |
import libtcodpy as libtcod
from random import randint
nSquares = 30
nTiles = nSquares * 2 + 1
SCREEN_WIDTH = nTiles
SCREEN_HEIGHT = nTiles
libtcod.console_set_custom_font("cp437_12x12.png", libtcod.FONT_LAYOUT_ASCII_INROW)
libtcod.console_init_root(SCREEN_WIDTH, SCREEN_HEIGHT, 'pyMazeBacktrack', False, li... | [
"libtcodpy.console_put_char_ex",
"libtcodpy.console_init_root",
"libtcodpy.console_wait_for_keypress",
"libtcodpy.console_flush",
"libtcodpy.console_set_custom_font",
"random.randint"
] | [((152, 240), 'libtcodpy.console_set_custom_font', 'libtcod.console_set_custom_font', (['"""cp437_12x12.png"""', 'libtcod.FONT_LAYOUT_ASCII_INROW'], {}), "('cp437_12x12.png', libtcod.\n FONT_LAYOUT_ASCII_INROW)\n", (183, 240), True, 'import libtcodpy as libtcod\n'), ((237, 347), 'libtcodpy.console_init_root', 'libtc... |
#####################################################################
##
## gradefiles-send.py
##
## Script to send grade files by email to enrolled students; the
## input grade file names should correspond to the user names of
## the students.
##
##
from email.mime.text import MIMEText # For creating a message... | [
"subprocess.Popen",
"os.path.exists",
"os.walk",
"email.mime.text.MIMEText"
] | [((1925, 1943), 'os.walk', 'os.walk', (['"""./data/"""'], {}), "('./data/')\n", (1932, 1943), False, 'import os\n'), ((679, 692), 'email.mime.text.MIMEText', 'MIMEText', (['txt'], {}), '(txt)\n', (687, 692), False, 'from email.mime.text import MIMEText\n'), ((908, 955), 'subprocess.Popen', 'Popen', (["['/usr/sbin/sendm... |
#!/usr/bin/env python
import os
import os.path
import yaml
import time
import random
import multiprocessing
import RPi.GPIO as GPIO
from talk import say
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
from adafruit_servokit import ServoKit
Motor1 = {'EN': 27, 'input1': 19, 'input2': 16}
Motor2 = {'EN': 22, 'input1': 2... | [
"random.randrange",
"yaml.dump",
"RPi.GPIO.setup",
"RPi.GPIO.output",
"multiprocessing.Process",
"RPi.GPIO.setwarnings",
"adafruit_servokit.ServoKit",
"os.path.join",
"talk.say",
"RPi.GPIO.PWM",
"yaml.load",
"time.sleep",
"RPi.GPIO.setmode"
] | [((154, 177), 'RPi.GPIO.setwarnings', 'GPIO.setwarnings', (['(False)'], {}), '(False)\n', (170, 177), True, 'import RPi.GPIO as GPIO\n'), ((178, 200), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BCM'], {}), '(GPIO.BCM)\n', (190, 200), True, 'import RPi.GPIO as GPIO\n'), ((434, 461), 'RPi.GPIO.PWM', 'GPIO.PWM', (["Motor... |
from uuid import uuid4
from sqlalchemy import Index, Column, Text, Table, ForeignKey
from sqlalchemy.orm import object_session
from onegov.core.orm import Base
from onegov.core.orm.types import UUID
spoken_association_table = Table(
'spoken_lang_association',
Base.metadata,
Column(
'translator_i... | [
"sqlalchemy.orm.object_session",
"sqlalchemy.ForeignKey",
"sqlalchemy.Column",
"sqlalchemy.Index"
] | [((1180, 1225), 'sqlalchemy.Column', 'Column', (['UUID'], {'primary_key': '(True)', 'default': 'uuid4'}), '(UUID, primary_key=True, default=uuid4)\n', (1186, 1225), False, 'from sqlalchemy import Index, Column, Text, Table, ForeignKey\n'), ((1237, 1265), 'sqlalchemy.Column', 'Column', (['Text'], {'nullable': '(False)'}... |
"""
tt URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vi... | [
"django.urls.include",
"django.contrib.auth.views.LogoutView.as_view",
"django.conf.urls.static.static",
"django.contrib.auth.views.LoginView.as_view",
"django.urls.path"
] | [((1026, 1057), 'django.urls.path', 'path', (['"""admin/"""', 'admin.site.urls'], {}), "('admin/', admin.site.urls)\n", (1030, 1057), False, 'from django.urls import path, include\n'), ((1099, 1154), 'django.urls.path', 'path', (['"""register/"""', 'user_views.register'], {'name': '"""register"""'}), "('register/', use... |
import os
import click
os.environ["GIT_PYTHON_REFRESH"] = "quiet"
@click.group()
def git():
pass
| [
"click.group"
] | [((71, 84), 'click.group', 'click.group', ([], {}), '()\n', (82, 84), False, 'import click\n')] |
import glob
import os
def main():
os.chdir("F:/Downloads")
extensions = ["*.jpg_large", "*.png_large", "*.jpg_orig"]
file_list = list()
for extension in extensions:
file_list = file_list + glob.glob(extension)
for file in file_list:
for extension in extensions:
new_ex... | [
"os.chdir",
"os.rename",
"glob.glob"
] | [((40, 64), 'os.chdir', 'os.chdir', (['"""F:/Downloads"""'], {}), "('F:/Downloads')\n", (48, 64), False, 'import os\n'), ((216, 236), 'glob.glob', 'glob.glob', (['extension'], {}), '(extension)\n', (225, 236), False, 'import glob\n'), ((486, 511), 'os.rename', 'os.rename', (['file', 'new_name'], {}), '(file, new_name)\... |
# Copyright 2015-2018 Capital One Services, 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 ... | [
"azure_common.arm_template"
] | [((1248, 1289), 'azure_common.arm_template', 'arm_template', (['"""route-table-and-vnet.json"""'], {}), "('route-table-and-vnet.json')\n", (1260, 1289), False, 'from azure_common import BaseTest, arm_template\n'), ((1812, 1853), 'azure_common.arm_template', 'arm_template', (['"""route-table-and-vnet.json"""'], {}), "('... |
# Copyright 2016 Intel Corporation
# Copyright 2017 Wind River
# 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 applica... | [
"logging.getLogger",
"sawtooth_sdk.processor.exceptions.InvalidTransaction",
"json.dumps",
"sawtooth_sdk.processor.exceptions.InternalError"
] | [((1207, 1234), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1224, 1234), False, 'import logging\n'), ((10040, 10085), 'sawtooth_sdk.processor.exceptions.InvalidTransaction', 'InvalidTransaction', (['"""Artifact ID is required"""'], {}), "('Artifact ID is required')\n", (10058, 10085),... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
STEP 2
Takes the list of urls in the json files and downloads the html files to local drive
Start with: scrapy runspider ReviewsCollector.py
"""
import scrapy
import json
class ReviewsCollector(scrapy.Spider):
def start_requests(self):
with open("data/b... | [
"json.load",
"scrapy.Request"
] | [((362, 374), 'json.load', 'json.load', (['f'], {}), '(f)\n', (371, 374), False, 'import json\n'), ((482, 585), 'scrapy.Request', 'scrapy.Request', ([], {'url': "item['url']", 'headers': "{'Referer': 'http://www.google.com/'}", 'callback': 'self.parse'}), "(url=item['url'], headers={'Referer':\n 'http://www.google.c... |
"""
homeassistant.components.device_tracker.owntracks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
OwnTracks platform for the device tracker.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.owntracks/
"""
import json
import logging
im... | [
"logging.getLogger",
"json.loads",
"homeassistant.components.mqtt.subscribe"
] | [((1410, 1476), 'homeassistant.components.mqtt.subscribe', 'mqtt.subscribe', (['hass', 'LOCATION_TOPIC', 'owntracks_location_update', '(1)'], {}), '(hass, LOCATION_TOPIC, owntracks_location_update, 1)\n', (1424, 1476), True, 'import homeassistant.components.mqtt as mqtt\n'), ((731, 750), 'json.loads', 'json.loads', (['... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Created by Roger on 2019-09-10
# Mostly by AllenNLP
import logging
import math
from typing import Any, Dict, List, Optional, Tuple
import torch
import torch.nn.functional as F
from allennlp.data import Vocabulary
from allennlp.models.model import Model
from allennlp.mod... | [
"logging.getLogger",
"src.metrics.mention_f1.TopSpanMentionTypeF1",
"allennlp.nn.util.bucket_values",
"torch.nn.Dropout",
"allennlp.nn.util.get_range_vector",
"math.floor",
"allennlp.training.metrics.Average",
"allennlp.modules.Pruner",
"allennlp.models.model.Model.register",
"allennlp.nn.util.get... | [((1105, 1132), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1122, 1132), False, 'import logging\n'), ((1168, 1214), 'allennlp.models.model.Model.register', 'Model.register', (['"""end-to-end-event-coreference"""'], {}), "('end-to-end-event-coreference')\n", (1182, 1214), False, 'from ... |
import math
from sys import exit
# итак, n - приблизительное число элементов в массиве, P - вероятность ложноположительного ответа, тогда размер
# структуры m = -(nlog2P) / ln2 (2 - основание), количество хеш-функций будет равно -log2P
# хеш-функции используются вида: (((i + 1)*x + p(i+1)) mod M) mod m,где - x - ключ,... | [
"math.log",
"math.ceil",
"math.log2",
"sys.exit"
] | [((4309, 4315), 'sys.exit', 'exit', ([], {}), '()\n', (4313, 4315), False, 'from sys import exit\n'), ((1048, 1067), 'math.ceil', 'math.ceil', (['(size / 8)'], {}), '(size / 8)\n', (1057, 1067), False, 'import math\n'), ((1830, 1842), 'math.log2', 'math.log2', (['p'], {}), '(p)\n', (1839, 1842), False, 'import math\n')... |
import sqlite3
con = sqlite3.connect(":memory:")
# enable extension loading
con.enable_load_extension(True)
# Load the fulltext search extension
con.execute("select load_extension('./fts3.so')")
# alternatively you can load the extension using an API call:
# con.load_extension("./fts3.so")
# disable extension load... | [
"sqlite3.connect"
] | [((22, 49), 'sqlite3.connect', 'sqlite3.connect', (['""":memory:"""'], {}), "(':memory:')\n", (37, 49), False, 'import sqlite3\n')] |
# Lint as: python3
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | [
"lingvo.compat.train.Saver",
"lingvo.compat.logging.info",
"lingvo.compat.compat.v1.get_collection",
"lingvo.compat.graph_util.extract_sub_graph",
"re.search",
"lingvo.core.py_utils.UpdateFpropDtype",
"lingvo.compat.io.gfile.GFile",
"lingvo.compat.get_variable_scope",
"lingvo.compat.executing_eagerl... | [((1968, 2135), 'collections.namedtuple', 'collections.namedtuple', (['"""InferenceDeviceOptions"""', "['device', 'retain_device_placement', 'var_options', 'gen_init_op',\n 'dtype_override', 'fprop_dtype_override']"], {}), "('InferenceDeviceOptions', ['device',\n 'retain_device_placement', 'var_options', 'gen_ini... |
# pylint: disable=no-self-use,invalid-name
import numpy as np
from numpy.testing import assert_almost_equal
import torch
from allennlp.common import Params
from allennlp.data import Vocabulary
from allennlp.modules.token_embedders import BagOfWordCountsTokenEmbedder
from allennlp.common.testing import AllenNlpTestCase
... | [
"allennlp.common.Params",
"allennlp.data.Vocabulary",
"torch.from_numpy",
"numpy.array",
"allennlp.modules.token_embedders.BagOfWordCountsTokenEmbedder.from_params"
] | [((484, 496), 'allennlp.data.Vocabulary', 'Vocabulary', ([], {}), '()\n', (494, 496), False, 'from allennlp.data import Vocabulary\n'), ((755, 765), 'allennlp.common.Params', 'Params', (['{}'], {}), '({})\n', (761, 765), False, 'from allennlp.common import Params\n'), ((785, 852), 'allennlp.modules.token_embedders.BagO... |
import argparse
import logging
import multiprocessing as mp
import logging
import os
from detectron2.evaluation import inference_context
import torch
import torch.distributed as dist
import torch.multiprocessing as mp
from detectron2.utils.collect_env import collect_env_info
from detectron2.utils.logger import setup_lo... | [
"logging.getLogger",
"os.listdir",
"argparse.ArgumentParser",
"pathlib.Path",
"fvcore.common.file_io.PathManager.open",
"pyvista.wrap",
"os.mkdir",
"torch.multiprocessing.set_start_method",
"torchvision.transforms.ToTensor",
"glob.glob",
"shapenet.config.config.get_shapenet_cfg",
"shapenet.uti... | [((840, 865), 'logging.getLogger', 'logging.getLogger', (['"""demo"""'], {}), "('demo')\n", (857, 865), False, 'import logging\n'), ((899, 917), 'shapenet.config.config.get_shapenet_cfg', 'get_shapenet_cfg', ([], {}), '()\n', (915, 917), False, 'from shapenet.config.config import get_shapenet_cfg\n'), ((1059, 1111), 'a... |
from django.contrib import admin
from django.contrib.auth.models import Group
from accounts.models import EmailUser
from shared.admin import ExportCsvMixin
# no need for groups - we only have regular users and superusers
admin.site.unregister(Group)
@admin.register(EmailUser)
class EmailUserAdmin(ExportCsvMixin, adm... | [
"django.contrib.admin.site.unregister",
"django.contrib.admin.register"
] | [((223, 251), 'django.contrib.admin.site.unregister', 'admin.site.unregister', (['Group'], {}), '(Group)\n', (244, 251), False, 'from django.contrib import admin\n'), ((254, 279), 'django.contrib.admin.register', 'admin.register', (['EmailUser'], {}), '(EmailUser)\n', (268, 279), False, 'from django.contrib import admi... |
import requests
import urllib.request
import os.path
import shutil
import csv
def main():
with open("data.csv") as i: #Open the data.csv file
instances = i.readlines() #Write them into memory
instances = [x.strip() for x in instances] #Strip any weird issues from writing
instances.sort() #Sort t... | [
"shutil.copyfile",
"requests.get"
] | [((1115, 1191), 'requests.get', 'requests.get', (["('https://%s/api/v1/custom_emojis' % name)"], {'allow_redirects': '(True)'}), "('https://%s/api/v1/custom_emojis' % name, allow_redirects=True)\n", (1127, 1191), False, 'import requests\n'), ((2940, 2989), 'shutil.copyfile', 'shutil.copyfile', (['(path + name)', "('emo... |
import get_data_ours
import get_data_akiba
import get_data_NearLinear
import get_data_LinearTime
import os
import matplotlib.pyplot as plt
# graphs = ["uk-2002", "arabic-2005", "gsh-2015-tpd", "uk-2005", "it-2004", "sk-2005", "uk-2007-05", "webbase-2001", "asia.osm", "road_usa", "europe.osm", "rgg_n26_s0", "RHG-10000... | [
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"get_data_ours.getOurTimeAndSizeUltrafast",
"get_data_LinearTime.getLinearTimeTimeAndSize",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
"get_data_akiba.getAkibaTimeAndSize",
... | [((4378, 4401), 'matplotlib.pyplot.rc', 'plt.rc', (['"""font"""'], {'size': '(14)'}), "('font', size=14)\n", (4384, 4401), True, 'import matplotlib.pyplot as plt\n'), ((4408, 4438), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(3.2, 2.4)'}), '(figsize=(3.2, 2.4))\n', (4418, 4438), True, 'import matplotli... |
# Generated by Django 2.1.5 on 2019-03-26 11:35
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | [
"django.db.models.OneToOneField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.migrations.swappable_dependency",
"django.db.models.CharField"
] | [((247, 304), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (278, 304), False, 'from django.db import migrations, models\n'), ((435, 528), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)... |
from my_collection import logger
if __name__ == "__main__":
logger.now().debug("debug1")
logger.now().debug("debug2")
logger.now().info("hello1")
logger.now().info("hello2")
logger.now().with_field("key", "val").error("with field1")
logger.now().with_field("key", "val").error("with field2")
| [
"my_collection.logger.now"
] | [((65, 77), 'my_collection.logger.now', 'logger.now', ([], {}), '()\n', (75, 77), False, 'from my_collection import logger\n'), ((98, 110), 'my_collection.logger.now', 'logger.now', ([], {}), '()\n', (108, 110), False, 'from my_collection import logger\n'), ((131, 143), 'my_collection.logger.now', 'logger.now', ([], {}... |
import unittest
from .helpers import StubBoard, StubPiece, C, WHITE, BLACK
class TestBishopGenerate(unittest.TestCase):
def get_bishop(self, board, team, position):
from chess.models import Bishop
return Bishop(board, team, position)
def compare_list(self, expected, results):
compared ... | [
"unittest.main",
"chess.models.Bishop"
] | [((2640, 2655), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2653, 2655), False, 'import unittest\n'), ((225, 254), 'chess.models.Bishop', 'Bishop', (['board', 'team', 'position'], {}), '(board, team, position)\n', (231, 254), False, 'from chess.models import Bishop\n')] |
from lib.fmd.namedentity import NamedEntity
from lib.fmd.decorators import Action, ListStage, GetStage
from lib.exceptions.workflow import EntryException
@Action(ListStage.DATAGATHERING)
def list_records(context, output):
output = []
if hasattr(context, 'filter'):
context.log.debug('Using filter [%s]'... | [
"lib.fmd.decorators.Action",
"lib.fmd.namedentity.NamedEntity"
] | [((156, 187), 'lib.fmd.decorators.Action', 'Action', (['ListStage.DATAGATHERING'], {}), '(ListStage.DATAGATHERING)\n', (162, 187), False, 'from lib.fmd.decorators import Action, ListStage, GetStage\n'), ((449, 480), 'lib.fmd.namedentity.NamedEntity', 'NamedEntity', (['"""records"""', 'entries'], {}), "('records', entri... |
#!/usr/bin/env python3
# Author: <NAME> <<EMAIL>>
# This example steps you through using resty & restAssured to save pickled/serialized
# data as a blob and then later re-using it in after deserialization.
# Sample usage might be in collaborative computing ie publish results from an expensive
# computation on one mach... | [
"Serializer.BinarySerializer",
"Serializer.JSONSerializer",
"entrails.cloudPassage.CloudPassageHandler"
] | [((427, 456), 'Serializer.BinarySerializer', 'Serializer.BinarySerializer', ([], {}), '()\n', (454, 456), False, 'import Serializer\n'), ((466, 493), 'Serializer.JSONSerializer', 'Serializer.JSONSerializer', ([], {}), '()\n', (491, 493), False, 'import Serializer\n'), ((916, 937), 'entrails.cloudPassage.CloudPassageHan... |
# dataframe: a data-frame implementation using method piping
#
# Copyright (C) 2016 <NAME>
#
# This file is part of dataframe.
#
# dataframe is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of ... | [
"itertools.chain"
] | [((1534, 1567), 'itertools.chain', 'chain', (['vals[:3]', '"""..."""', 'vals[-3:]'], {}), "(vals[:3], '...', vals[-3:])\n", (1539, 1567), False, 'from itertools import chain\n')] |
import warnings
import cupy
from cupy_backends.cuda.api import runtime
from cupy.cuda import device
from cupyx.jit import _cuda_types
from cupyx.jit._internal_types import BuiltinFunc
from cupyx.jit._internal_types import Data
from cupyx.jit._internal_types import Constant
from cupyx.jit._internal_types import Range
... | [
"cupyx.jit._internal_types.Data.init",
"cupyx.jit._compile._astype_scalar",
"cupy_backends.cuda.api.runtime.runtimeGetVersion",
"cupyx.jit._internal_types.Range",
"cupyx.jit._compile._call_ufunc",
"cupyx.jit._cuda_types.Tuple",
"cupyx.jit._cuda_types.SharedMem",
"cupyx.jit._compile._indexing",
"cupy... | [((3099, 3119), 'cupyx.jit._internal_types.Data.init', 'Data.init', (['stop', 'env'], {}), '(stop, env)\n', (3108, 3119), False, 'from cupyx.jit._internal_types import Data\n'), ((3136, 3157), 'cupyx.jit._internal_types.Data.init', 'Data.init', (['start', 'env'], {}), '(start, env)\n', (3145, 3157), False, 'from cupyx.... |
#!/home/a.ghaderi/.conda/envs/envjm/bin/python
# Model 2
import pystan
import pandas as pd
import numpy as np
import sys
sys.path.append('../../')
import utils
parts = 1
data = utils.get_data() #loading dateset
data = data[data['participant']==parts]
mis = np.where((data['n200lat']<.101)|(data['n200lat']>.... | [
"numpy.where",
"utils.get_data",
"numpy.concatenate",
"numpy.random.uniform",
"sys.path.append",
"pystan.StanModel"
] | [((122, 147), 'sys.path.append', 'sys.path.append', (['"""../../"""'], {}), "('../../')\n", (137, 147), False, 'import sys\n'), ((180, 196), 'utils.get_data', 'utils.get_data', ([], {}), '()\n', (194, 196), False, 'import utils\n'), ((683, 724), 'pystan.StanModel', 'pystan.StanModel', ([], {'model_code': 'model_wiener'... |
# -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
from frappe.contacts.address_and_contact import load_address_and_contact
class Member(Docum... | [
"frappe.contacts.address_and_contact.load_address_and_contact"
] | [((395, 425), 'frappe.contacts.address_and_contact.load_address_and_contact', 'load_address_and_contact', (['self'], {}), '(self)\n', (419, 425), False, 'from frappe.contacts.address_and_contact import load_address_and_contact\n')] |
import logging
from pydantic import BaseModel, Field
from typing import List
from .similar import important_words
from .server import app
_MAX_LENGTH = 2000
logger = logging.getLogger(__name__)
class ImportantWordsResponse(BaseModel):
important_words: List[str] = Field(..., description="List of lemmas")
cla... | [
"logging.getLogger",
"pydantic.Field"
] | [((170, 197), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (187, 197), False, 'import logging\n'), ((274, 314), 'pydantic.Field', 'Field', (['...'], {'description': '"""List of lemmas"""'}), "(..., description='List of lemmas')\n", (279, 314), False, 'from pydantic import BaseModel, Fie... |