code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | [
"pgsmo.utils.templating.get_template_path"
] | [((1368, 1468), 'pgsmo.utils.templating.get_template_path', 'templating.get_template_path', (['self._mxin_template_root', '"""create.sql"""', 'self._mxin_server_version'], {}), "(self._mxin_template_root, 'create.sql', self.\n _mxin_server_version)\n", (1396, 1468), True, 'import pgsmo.utils.templating as templating... |
# -*- coding: utf-8 -*-
"""This is a generated class and is not intended for modification!
"""
from datetime import datetime
from infobip.util.models import DefaultObject, serializable
from infobip.api.model.omni.Destination import Destination
from infobip.api.model.omni.send.ParsecoData import ParsecoData
from infob... | [
"infobip.util.models.serializable"
] | [((859, 910), 'infobip.util.models.serializable', 'serializable', ([], {'name': '"""destinations"""', 'type': 'Destination'}), "(name='destinations', type=Destination)\n", (871, 910), False, 'from infobip.util.models import DefaultObject, serializable\n'), ((1380, 1426), 'infobip.util.models.serializable', 'serializabl... |
import dataclasses
import cefconsole
from wecs.core import System
from wecs.core import and_filter
from wecs.core import Component
class WECSSubconsole(cefconsole.Subconsole):
name = "WECS"
package = 'wecs'
template_dir = 'templates'
html = "wecs.html"
funcs = {
'refresh_wecs_matrix': 'r... | [
"wecs.core.and_filter",
"wecs.core.Component",
"dataclasses.fields"
] | [((3789, 3800), 'wecs.core.Component', 'Component', ([], {}), '()\n', (3798, 3800), False, 'from wecs.core import Component\n'), ((3916, 3943), 'wecs.core.and_filter', 'and_filter', (['[WatchedEntity]'], {}), '([WatchedEntity])\n', (3926, 3943), False, 'from wecs.core import and_filter\n'), ((3220, 3256), 'dataclasses.... |
from sqlalchemy import Column, Integer, String, Numeric, func, distinct, Boolean
from app import db
class Rais(db.Model):
__tablename__ = 'rais'
region = Column(String(1), primary_key=True)
mesoregion = Column(String(4), primary_key=True)
microregion = Column(String(5), primary_key=True)
state = C... | [
"sqlalchemy.func.count",
"sqlalchemy.func.sum",
"sqlalchemy.Numeric",
"sqlalchemy.String",
"sqlalchemy.func.avg",
"sqlalchemy.distinct",
"sqlalchemy.Column"
] | [((1142, 1175), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)'}), '(Integer, primary_key=True)\n', (1148, 1175), False, 'from sqlalchemy import Column, Integer, String, Numeric, func, distinct, Boolean\n'), ((1186, 1201), 'sqlalchemy.Column', 'Column', (['Integer'], {}), '(Integer)\n', (1192, 120... |
import logging
from unittest import TestCase
from foxylib.tools.collections.collections_tool import DictTool
from foxylib.tools.log.foxylib_logger import FoxylibLogger
from foxylib.tools.nlp.matcher.fulltext_matcher import FulltextMatcher
from foxylib.tools.string.string_tool import str2lower
class TestFulltextMatch... | [
"foxylib.tools.log.foxylib_logger.FoxylibLogger.attach_stderr2loggers",
"foxylib.tools.nlp.matcher.fulltext_matcher.FulltextMatcher.Config"
] | [((384, 434), 'foxylib.tools.log.foxylib_logger.FoxylibLogger.attach_stderr2loggers', 'FoxylibLogger.attach_stderr2loggers', (['logging.DEBUG'], {}), '(logging.DEBUG)\n', (419, 434), False, 'from foxylib.tools.log.foxylib_logger import FoxylibLogger\n'), ((585, 629), 'foxylib.tools.nlp.matcher.fulltext_matcher.Fulltext... |
from scipy import signal
import matplotlib.pyplot as plt
import numpy as np
import pyqtgraph
import PyQt5.QtGui as qtg
import matplotlib
from matplotlib.figure import Figure
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg, FigureCanvas
from matplotlib.backends.backend_qt5agg import NavigationToolbar2Q... | [
"matplotlib.backends.backend_qt5agg.NavigationToolbar2QT",
"numpy.sqrt",
"matplotlib.pyplot.ylabel",
"scipy.signal.spectrogram",
"matplotlib.pyplot.pcolormesh",
"numpy.sin",
"numpy.arange",
"matplotlib.pyplot.xlabel",
"pyqtgraph.ImageItem",
"numpy.max",
"numpy.exp",
"PyQt5.QtGui.QVBoxLayout",
... | [((344, 368), 'matplotlib.use', 'matplotlib.use', (['"""Qt5Agg"""'], {}), "('Qt5Agg')\n", (358, 368), False, 'import matplotlib\n'), ((1485, 1502), 'numpy.exp', 'np.exp', (['(-time / 5)'], {}), '(-time / 5)\n', (1491, 1502), True, 'import numpy as np\n'), ((1533, 1558), 'scipy.signal.spectrogram', 'signal.spectrogram',... |
from django import forms
from django.conf import settings
from django.http import HttpResponse, HttpResponseRedirect, Http404
from account.models import *
from . import templater
from uuid import *
from datetime import *
from django.core.mail import EmailMultiAlternatives, EmailMessage, send_mail
def process_request(r... | [
"django.core.mail.EmailMultiAlternatives",
"django.forms.ValidationError",
"django.forms.TextInput"
] | [((1122, 1188), 'django.core.mail.EmailMultiAlternatives', 'EmailMultiAlternatives', (['subject', 'text_content', 'from_email', '[email]'], {}), '(subject, text_content, from_email, [email])\n', (1144, 1188), False, 'from django.core.mail import EmailMultiAlternatives, EmailMessage, send_mail\n'), ((1606, 1681), 'djang... |
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this open-source project.
""" Define the functions to load data. """
import os
import json
import argparse
import numpy as np
def load_data(data_dir, interval=100, data_type='2D'):
music_data, d... | [
"numpy.tile",
"os.listdir",
"os.path.join",
"argparse.ArgumentTypeError",
"numpy.array"
] | [((360, 380), 'os.listdir', 'os.listdir', (['data_dir'], {}), '(data_dir)\n', (370, 380), False, 'import os\n'), ((465, 494), 'os.path.join', 'os.path.join', (['data_dir', 'fname'], {}), '(data_dir, fname)\n', (477, 494), False, 'import os\n'), ((1518, 1538), 'os.listdir', 'os.listdir', (['data_dir'], {}), '(data_dir)\... |
"""
folder == paquete
Un paquete agrupa modulos
"""
#from paquete.modulo import objeto
from animales.aves import Pinguino
pinguino = Pinguino()
pinguino.nadar()
| [
"animales.aves.Pinguino"
] | [((134, 144), 'animales.aves.Pinguino', 'Pinguino', ([], {}), '()\n', (142, 144), False, 'from animales.aves import Pinguino\n')] |
import sqlite3
import databasesetting
import os.path
conn = sqlite3.connect(databasesetting.db_path)
curr = conn.cursor()
curr.execute("""DROP TABLE matches;""")
sql_command = """
CREATE TABLE matches (
matchID VARCHAR(20),
homeTeam VARCHAR(50),
AwayTeam VARCHAR(50),
MatchDate DATETIME,
result VARCHAR(20),
MatchRo... | [
"sqlite3.connect"
] | [((62, 102), 'sqlite3.connect', 'sqlite3.connect', (['databasesetting.db_path'], {}), '(databasesetting.db_path)\n', (77, 102), False, 'import sqlite3\n')] |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from allauth.socialaccount.tests import OAuth2TestsMixin
from allauth.tests import MockedResponse, TestCase
from .provider import StravaProvider
class StravaTests(OAuth2TestsMixin, TestCase):
provider_id = StravaProvider.id
def get_mocked_resp... | [
"allauth.tests.MockedResponse"
] | [((347, 1155), 'allauth.tests.MockedResponse', 'MockedResponse', (['(200)', '"""{\n "id": 32641234,\n "username": null,\n "resource_state": 2,\n "firstname": "georges",\n "lastname": "camembert",\n "city": "London",\n ... |
import numpy as np
from sklearn.metrics import mean_squared_error
from neuraxle.hyperparams.distributions import RandInt
from neuraxle.hyperparams.space import HyperparameterSpace
from neuraxle.metaopt.callbacks import MetricCallback
from neuraxle.metaopt.deprecated import RandomSearch, HyperparamsJSONRepository, Auto... | [
"neuraxle.metaopt.deprecated.KFoldCrossValidationWrapper",
"neuraxle.metaopt.deprecated.HyperparamsJSONRepository",
"neuraxle.steps.numpy.MultiplyByN",
"neuraxle.metaopt.random.ValidationSplitWrapper",
"neuraxle.hyperparams.distributions.RandInt"
] | [((2306, 2436), 'neuraxle.metaopt.random.ValidationSplitWrapper', 'ValidationSplitWrapper', (['pipeline'], {'test_size': '(0.2)', 'scoring_function': 'mean_squared_error', 'run_validation_split_in_test_mode': '(False)'}), '(pipeline, test_size=0.2, scoring_function=\n mean_squared_error, run_validation_split_in_test... |
# pylint: disable=no-self-use,invalid-name
import numpy
from allennlp.common.testing.test_case import AllenNlpTestCase
from allennlp.data.fields import ArrayField, ListField
class TestArrayField(AllenNlpTestCase):
def test_get_padding_lengths_correctly_returns_ordered_shape(self):
shape = [3, 4, 5, 6]
... | [
"numpy.ones",
"allennlp.data.fields.ArrayField",
"numpy.array",
"numpy.zeros",
"allennlp.data.fields.ListField",
"numpy.testing.assert_array_equal"
] | [((335, 353), 'numpy.zeros', 'numpy.zeros', (['shape'], {}), '(shape)\n', (346, 353), False, 'import numpy\n'), ((376, 393), 'allennlp.data.fields.ArrayField', 'ArrayField', (['array'], {}), '(array)\n', (386, 393), False, 'from allennlp.data.fields import ArrayField, ListField\n'), ((653, 670), 'numpy.ones', 'numpy.on... |
from src import geometry_profiles as gp
import typing
import numpy as np
class LightProfile(gp.GeometryProfile):
def __init__(
self,
centre: typing.Tuple[float, float] = (0.0, 0.0),
axis_ratio: float = 1.0,
angle: float = 0.0,
normalization: float = 0.1,
... | [
"numpy.exp"
] | [((2831, 2918), 'numpy.exp', 'np.exp', (['(-7.66924 * ((grid_elliptical_radii / self.radius) ** (1.0 / 7.66924) - 1.0))'], {}), '(-7.66924 * ((grid_elliptical_radii / self.radius) ** (1.0 / 7.66924) -\n 1.0))\n', (2837, 2918), True, 'import numpy as np\n'), ((4536, 4623), 'numpy.exp', 'np.exp', (['(-1.67838 * ((grid... |
from abc import ABC, abstractmethod
from copy import deepcopy
import numpy as np
import tensorflow as tf
# source: http://geomalgorithms.com/a06-_intersect-2.html
# source: https://www.erikrotteveel.com/python/three-dimensional-ray-tracing-in-python/
gpu_phy_devices = tf.config.list_physical_devices('GPU')
try:
f... | [
"tensorflow.meshgrid",
"tensorflow.shape",
"tensorflow.reduce_sum",
"tensorflow.logical_not",
"tensorflow.linalg.cross",
"tensorflow.config.list_physical_devices",
"tensorflow.math.atan2",
"copy.deepcopy",
"tensorflow.ones_like",
"tensorflow.cast",
"tensorflow.tensordot",
"tensorflow.not_equal... | [((271, 309), 'tensorflow.config.list_physical_devices', 'tf.config.list_physical_devices', (['"""GPU"""'], {}), "('GPU')\n", (302, 309), True, 'import tensorflow as tf\n'), ((523, 558), 'tensorflow.constant', 'tf.constant', (['np.pi'], {'dtype': 'precision'}), '(np.pi, dtype=precision)\n', (534, 558), True, 'import te... |
from typing import Optional, TypeVar, Callable, Iterable, Hashable, List
from collections import namedtuple
T = TypeVar('T')
KeyFunc = Callable[[T], Hashable]
def iter_dedup(seq: Iterable[T], key: Optional[KeyFunc] = None) -> Iterable[T]:
"""
Remove duplicates from a sequence (list, tuple, stream etc.) of... | [
"collections.namedtuple",
"typing.TypeVar"
] | [((115, 127), 'typing.TypeVar', 'TypeVar', (['"""T"""'], {}), "('T')\n", (122, 127), False, 'from typing import Optional, TypeVar, Callable, Iterable, Hashable, List\n'), ((1294, 1409), 'collections.namedtuple', 'namedtuple', (['"""DuplicateItemInfo"""', "['duplicate_item', 'duplicate_item_pos', 'original_item', 'origi... |
import numpy as np
import xlwings as xw
"""
To activate a function in the excel file, press "Import Functions"
in the xlwings tab
"""
@xw.func
def get_crack_width(c_nom_tension, c_nom_compression, c_dur, moment, \
is_shear_present, shear_bar_diameter, \
rf_diameter_first_layer = 0, rf_spacing_first_layer = 0,... | [
"numpy.log",
"numpy.sqrt"
] | [((8361, 8419), 'numpy.sqrt', 'np.sqrt', (['((A_s * E_s) ** 2 + 2 * b * A_s * E_s * E_ceff * d)'], {}), '((A_s * E_s) ** 2 + 2 * b * A_s * E_s * E_ceff * d)\n', (8368, 8419), True, 'import numpy as np\n'), ((12865, 12891), 'numpy.log', 'np.log', (['(1 + self.f_cm / 10)'], {}), '(1 + self.f_cm / 10)\n', (12871, 12891), ... |
#Añadir un modulo a nuestro programa
import modulo
modulo.saludar("Guido") | [
"modulo.saludar"
] | [((53, 76), 'modulo.saludar', 'modulo.saludar', (['"""Guido"""'], {}), "('Guido')\n", (67, 76), False, 'import modulo\n')] |
import torch
import torch.nn as nn
import numpy as np
import FrEIA.framework as Ff
from .. import InvertibleArchitecture
__all__ = ['beta_0', 'beta_1', 'beta_2', 'beta_4', 'beta_8', 'beta_16', 'beta_32', 'beta_inf']
model_base_url = 'https://heibox.uni-heidelberg.de/seafhttp/files/6f91503d-7459-4080-b10a-e979f8b3d2... | [
"torch.optim.SGD",
"FrEIA.framework.ReversibleGraphNet",
"numpy.sqrt",
"torch.log_softmax",
"torch.mean",
"FrEIA.framework.OutputNode",
"torch.load",
"torch.eye",
"FrEIA.framework.InputNode",
"torch.argmax",
"torch.hub.load_state_dict_from_url",
"torch.mm",
"torch.sum",
"torch.logsumexp",
... | [((2890, 2976), 'torch.optim.SGD', 'torch.optim.SGD', (['self.optimizer_params', 'self.lr'], {'momentum': '(0.9)', 'weight_decay': '(1e-05)'}), '(self.optimizer_params, self.lr, momentum=0.9, weight_decay=\n 1e-05)\n', (2905, 2976), False, 'import torch\n'), ((3735, 3791), 'FrEIA.framework.ReversibleGraphNet', 'Ff.R... |
from blocklint.main import main
main()
| [
"blocklint.main.main"
] | [((32, 38), 'blocklint.main.main', 'main', ([], {}), '()\n', (36, 38), False, 'from blocklint.main import main\n')] |
import pytest
from emrichen import Template
HASHES = {
'MD5': '8b1a9953c4611296a827abf8c47804d7',
'SHA1': 'f7ff9e8b7bb2e09b70935a5d785e0cc5d9d0abf0',
'SHA256': '185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969',
}
@pytest.mark.parametrize('h', sorted(HASHES.items()), ids=sorted(HASHES))
... | [
"emrichen.Template.parse"
] | [((372, 406), 'emrichen.Template.parse', 'Template.parse', (['f"""!{algo} "Hello\\""""'], {}), '(f\'!{algo} "Hello"\')\n', (386, 406), False, 'from emrichen import Template\n')] |
import os
import unittest
from os.path import splitext
from list_files.physical_data import PhysicalData
from list_files.physical_data import PhysicalDataFake
class Filename:
"""
class about the filename of a file
"""
def __init__(self, new_physical):
self.physical = new_physical
def... | [
"list_files.physical_data.PhysicalDataFake"
] | [((3026, 3069), 'list_files.physical_data.PhysicalDataFake', 'PhysicalDataFake', (['"""nome1.txt"""', '"""C:\\\\path\\\\"""'], {}), "('nome1.txt', 'C:\\\\path\\\\')\n", (3042, 3069), False, 'from list_files.physical_data import PhysicalDataFake\n'), ((3094, 3137), 'list_files.physical_data.PhysicalDataFake', 'PhysicalD... |
import numpy as np
from skimage.morphology import label
from scipy.sparse import csr_matrix
from scipy.spatial import cKDTree as KDTree
import pandas as pd
import itertools
from tqdm import tqdm
def compute_M(data):
cols = np.arange(data.size)
return csr_matrix((cols, (data.ravel(), cols)),
... | [
"pandas.Series",
"numpy.mean",
"numpy.multiply",
"numpy.unique",
"numpy.amin",
"numpy.array",
"numpy.zeros",
"numpy.unravel_index",
"numpy.vstack",
"numpy.nanmax",
"pandas.DataFrame",
"numpy.all",
"numpy.amax",
"numpy.arange"
] | [((237, 257), 'numpy.arange', 'np.arange', (['data.size'], {}), '(data.size)\n', (246, 257), True, 'import numpy as np\n'), ((650, 728), 'pandas.DataFrame', 'pd.DataFrame', ([], {'columns': "['cycle', 'ch', 'x', 'y', 'z', 'Intensities_window_5x5']"}), "(columns=['cycle', 'ch', 'x', 'y', 'z', 'Intensities_window_5x5'])\... |
#!/usr/bin/env python
"""Clone an Oracle DB Using python"""
### usage: ./cloneOracle.py -v mycluster \
# -u myuser \
# -d mydomain.net \
# -ss oracleprod.mydomain.net \
# -ts oracledev.mydomain.net \
# ... | [
"time.sleep",
"argparse.ArgumentParser"
] | [((692, 717), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (715, 717), False, 'import argparse\n'), ((11519, 11527), 'time.sleep', 'sleep', (['(1)'], {}), '(1)\n', (11524, 11527), False, 'from time import sleep\n')] |
from unittest import TestCase
import numpy as np
from pyecsca.sca import Trace, welch_ttest, student_ttest, ks_test
class TTestTests(TestCase):
def setUp(self):
self.a = Trace(np.array([20, 80], dtype=np.dtype("i1")))
self.b = Trace(np.array([30, 42], dtype=np.dtype("i1")))
self.c = Tra... | [
"pyecsca.sca.welch_ttest",
"pyecsca.sca.ks_test",
"pyecsca.sca.student_ttest",
"numpy.array",
"numpy.dtype"
] | [((829, 880), 'pyecsca.sca.welch_ttest', 'welch_ttest', (['[a, b]', '[b, c]'], {'dof': '(True)', 'p_value': '(True)'}), '([a, b], [b, c], dof=True, p_value=True)\n', (840, 880), False, 'from pyecsca.sca import Trace, welch_ttest, student_ttest, ks_test\n'), ((492, 539), 'pyecsca.sca.welch_ttest', 'welch_ttest', (['[sel... |
# coding: utf-8
"""
The MIT License
Copyright (c) 2009 Marici, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modi... | [
"datetime.datetime.now",
"django.contrib.admin.site.register"
] | [((1246, 1291), 'django.contrib.admin.site.register', 'admin.site.register', (['models.Image', 'ImageAdmin'], {}), '(models.Image, ImageAdmin)\n', (1265, 1291), False, 'from django.contrib import admin\n'), ((1346, 1405), 'django.contrib.admin.site.register', 'admin.site.register', (['models.MarkupSyntax', 'MarkupSynta... |
# MIT License
#
# Copyright (c) 2018 Image & Vision Computing Lab, Institute of Information Science, Academia Sinica
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, inc... | [
"tensorflow.nn.conv2d",
"tensorflow.nn.embedding_lookup",
"tensorflow.nn.max_pool",
"tensorflow.contrib.layers.flatten",
"tensorflow.variable_scope",
"tensorflow.Variable",
"tensorflow.constant",
"tensorflow.matmul",
"tensorflow.reshape"
] | [((5570, 5626), 'tensorflow.nn.conv2d', 'tf.nn.conv2d', (['x', 'W'], {'strides': '[1, 1, 1, 1]', 'padding': '"""SAME"""'}), "(x, W, strides=[1, 1, 1, 1], padding='SAME')\n", (5582, 5626), True, 'import tensorflow as tf\n'), ((5657, 5732), 'tensorflow.nn.max_pool', 'tf.nn.max_pool', (['x'], {'ksize': '[1, 2, 2, 1]', 'st... |
"""Support for Mojio Platform."""
import logging
from mojio_sdk.api import API
import requests
import voluptuous as vol
from homeassistant.components.device_tracker import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_CLIENT_ID,
CONF_CLIENT_SECRET,
CONF_DOMAIN,
CONF_PASSWORD,
CONF_USERNAM... | [
"logging.getLogger",
"voluptuous.Required",
"voluptuous.Optional",
"voluptuous.All"
] | [((451, 478), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (468, 478), False, 'import logging\n'), ((562, 589), 'voluptuous.Required', 'vol.Required', (['CONF_USERNAME'], {}), '(CONF_USERNAME)\n', (574, 589), True, 'import voluptuous as vol\n'), ((610, 637), 'voluptuous.Required', 'vol.... |
#!/usr/bin/env python
"""
Description: A script to get Tenant IDs using the Azure CLI
from Azure logins provided in a csv file with specific headers.
There is an optional flag if a certain type of csv file
is used, which collects Azure logins into teams.
"""
import csv
import argparse
import os
import json
from col... | [
"json.loads",
"csv.DictReader",
"argparse.ArgumentParser",
"json.dumps",
"inflect.engine",
"os.popen",
"collections.defaultdict"
] | [((527, 543), 'inflect.engine', 'inflect.engine', ([], {}), '()\n', (541, 543), False, 'import inflect\n'), ((3863, 3897), 'json.dumps', 'json.dumps', (['teaminfolist'], {'indent': '(4)'}), '(teaminfolist, indent=4)\n', (3873, 3897), False, 'import json\n'), ((4003, 4028), 'argparse.ArgumentParser', 'argparse.ArgumentP... |
import numpy as np
import pandas as pd
import argparse
def check_smiles_match(data,screen):
return (data['SMILES'].values==screen['SMILES'].values).all()
def apply_screen(data,col_name,selection_type,selection_thresh,keep):
data = data.sort_values(col_name,ascending=True)
if selection_type=='Fraction':
... | [
"pandas.DataFrame",
"argparse.ArgumentParser",
"pandas.read_csv"
] | [((920, 945), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (943, 945), False, 'import argparse\n'), ((1696, 1721), 'pandas.read_csv', 'pd.read_csv', (['args.molfile'], {}), '(args.molfile)\n', (1707, 1721), True, 'import pandas as pd\n'), ((1821, 1851), 'pandas.read_csv', 'pd.read_csv', (['ar... |
import math
import torch
from torch import Tensor
from torch.nn import Module
class PositionalEncoding(Module):
"""Positional encoder.
Args:
d_model (int, default=1): Dimension of the model.
max_length (int, default=100): Maximum length of the sequence
encoding ({"linear"}): Method o... | [
"torch.linspace",
"torch.empty",
"torch.cat",
"math.log"
] | [((2602, 2627), 'torch.cat', 'torch.cat', (['(input, p)', '(-2)'], {}), '((input, p), -2)\n', (2611, 2627), False, 'import torch\n'), ((1943, 1991), 'torch.empty', 'torch.empty', (['(self.max_length, 2 * self.d_model)'], {}), '((self.max_length, 2 * self.d_model))\n', (1954, 1991), False, 'import torch\n'), ((1775, 179... |
import copy
from util.common import daily_schedules_to_weekly_schedules
class Config(object):
def __init__(self, payment_ratio=0.3, waiting_time_threshold=1./12.):
self.intersections = [
(0,0), (0,2), (0,6), (0,8), (0,12), (0,14),
(2,0), (2,2), (2,6), (2,7), (2,8) , (2,12), (2,14)... | [
"copy.copy",
"util.common.daily_schedules_to_weekly_schedules"
] | [((1220, 1278), 'util.common.daily_schedules_to_weekly_schedules', 'daily_schedules_to_weekly_schedules', (['self.driver_schedules'], {}), '(self.driver_schedules)\n', (1255, 1278), False, 'from util.common import daily_schedules_to_weekly_schedules\n'), ((974, 1001), 'copy.copy', 'copy.copy', (['schedule_3am_1pm'], {}... |
from flask import request, Blueprint
from flask_cors import cross_origin
from server.apis.api_init import auth, backstageInfo, blockOfBeings, blockOfTimes, blockOfGarbage, mainNodeManager, vote
from server.utils.message import HttpMessage
from server.config import Allow_Url_List
backstage = Blueprint('backstage', __na... | [
"server.apis.api_init.blockOfGarbage.revocationGarbageBlockQueueByBlockId",
"server.apis.api_init.backstageInfo.modifyIndexNotice",
"server.apis.api_init.blockOfTimes.addTimesBlockQueue",
"server.apis.api_init.mainNodeManager.getApplicationFormByDBId",
"flask_cors.cross_origin",
"server.apis.api_init.vote... | [((293, 325), 'flask.Blueprint', 'Blueprint', (['"""backstage"""', '__name__'], {}), "('backstage', __name__)\n", (302, 325), False, 'from flask import request, Blueprint\n'), ((389, 425), 'flask_cors.cross_origin', 'cross_origin', ([], {'origins': 'Allow_Url_List'}), '(origins=Allow_Url_List)\n', (401, 425), False, 'f... |
#!/usr/bin/env python
# coding: utf-8
# # Data Analysis
# This module will explore the stage of data analysis using the lens of a bias-aware methodology. We will make use of Jupyter notebooks to aid our exploratory data analysis, in order to understand how social, cognitive, and statistical biases interact and affect ... | [
"numpy.array",
"numpy.linspace",
"numpy.random.seed",
"matplotlib.pyplot.ion",
"numpy.logspace",
"numpy.random.randn",
"matplotlib.pyplot.subplots"
] | [((1216, 1225), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (1223, 1225), True, 'import matplotlib.pyplot as plt\n'), ((1281, 1305), 'numpy.random.seed', 'np.random.seed', (['(19680801)'], {}), '(19680801)\n', (1295, 1305), True, 'import numpy as np\n'), ((1728, 1757), 'matplotlib.pyplot.subplots', 'plt.subpl... |
from classes import Stock, format
import numpy as np
import os
from datetime import date, timedelta
from dateutil.parser import parse
import sys
# datapath = 'formated/SZ#002673.json'
datapath = 'formated/SH#600007.json'
# datapath = 'formated/SZ#000553.json'
# amount = float(10000)
stock = Stock()
def getFiles(dir... | [
"dateutil.parser.parse",
"os.walk",
"os.path.join",
"datetime.timedelta",
"datetime.date",
"sys.stdout.flush",
"classes.Stock",
"numpy.arange",
"sys.stdout.write"
] | [((294, 301), 'classes.Stock', 'Stock', ([], {}), '()\n', (299, 301), False, 'from classes import Stock, format\n'), ((384, 400), 'os.walk', 'os.walk', (['dirname'], {}), '(dirname)\n', (391, 400), False, 'import os\n'), ((837, 853), 'datetime.date', 'date', (['(2016)', '(1)', '(1)'], {}), '(2016, 1, 1)\n', (841, 853),... |
from distutils.core import setup
from entmax import __version__
setup(name='entmax',
version=__version__,
url="https://github.com/deep-spin/entmax",
author="<NAME>, <NAME>, <NAME>",
author_email="<EMAIL>",
description=("The entmax mapping and its loss, a family of sparse "
... | [
"distutils.core.setup"
] | [((65, 415), 'distutils.core.setup', 'setup', ([], {'name': '"""entmax"""', 'version': '__version__', 'url': '"""https://github.com/deep-spin/entmax"""', 'author': '"""<NAME>, <NAME>, <NAME>"""', 'author_email': '"""<EMAIL>"""', 'description': '"""The entmax mapping and its loss, a family of sparse alternatives to soft... |
# -*- coding: utf-8 -*-
"""
We have two special characters. The first character can be represented by
one bit 0. The second character can be represented by two bits (10 or 11).
Now given a string represented by several bits. Return whether the last
character must be a one-bit character or not. The given string will al... | [
"doctest.testmod"
] | [((1487, 1516), 'doctest.testmod', 'doctest.testmod', ([], {'verbose': '(True)'}), '(verbose=True)\n', (1502, 1516), False, 'import doctest\n')] |
"""
.. module:: Residue
:synopsis: This module implements the Residue class.
"""
# Third-party modules
import numpy as np
# Local modules
from src.atom import Atom
class Residue:
"""
.. class:: Residue
This class groups informations about a residue.
Attributes:
name (str): Name of the... | [
"numpy.einsum",
"src.atom.Atom"
] | [((495, 505), 'src.atom.Atom', 'Atom', (['"""CA"""'], {}), "('CA')\n", (499, 505), False, 'from src.atom import Atom\n'), ((529, 539), 'src.atom.Atom', 'Atom', (['"""CB"""'], {}), "('CB')\n", (533, 539), False, 'from src.atom import Atom\n'), ((562, 571), 'src.atom.Atom', 'Atom', (['"""C"""'], {}), "('C')\n", (566, 571... |
# Copyright 2020 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 applica... | [
"tensorflow.keras.layers.Input",
"os.path.getsize",
"tensorflow.keras.layers.Reshape",
"tensorflow.keras.layers.Conv2D",
"tensorflow_model_optimization.python.core.common.keras.compression.algorithms.weight_clustering.optimize",
"tensorflow.keras.losses.SparseCategoricalCrossentropy",
"os.scandir",
"t... | [((1009, 1060), 'tensorflow.keras.layers.Input', 'tf.keras.layers.Input', ([], {'shape': '(28, 28)', 'name': '"""input"""'}), "(shape=(28, 28), name='input')\n", (1030, 1060), True, 'import tensorflow as tf\n'), ((1568, 1612), 'tensorflow.keras.Model', 'tf.keras.Model', ([], {'inputs': '[i]', 'outputs': '[output]'}), '... |
from dataschema import Type, TypeSpec, IterSpec, DictSpec, Reference
from .utils import parse_time_interval
lowercase_string_list = IterSpec(Type(str, lambda s: s.lower()))
optional_lowercase_string_list = lowercase_string_list.copy(optional=True, default=list)
optional_string = TypeSpec(str, optional=True)
optional_b... | [
"dataschema.IterSpec",
"dataschema.Type",
"dataschema.Reference",
"dataschema.DictSpec",
"dataschema.TypeSpec"
] | [((281, 309), 'dataschema.TypeSpec', 'TypeSpec', (['str'], {'optional': '(True)'}), '(str, optional=True)\n', (289, 309), False, 'from dataschema import Type, TypeSpec, IterSpec, DictSpec, Reference\n'), ((339, 382), 'dataschema.TypeSpec', 'TypeSpec', (['bool'], {'optional': '(True)', 'default': '(True)'}), '(bool, opt... |
'''
test_core.py: Python testing for core functions for
Singularity in Python,
including defaults, utils, and shell functions.
Copyright (c) 2016-2017, <NAME>. All rights reserved.
"Singularity" Copyright (c) 2016, The Regents of the University of California,
through Lawrence Berkeley Nat... | [
"sutils.extract_tar",
"tarfile.open",
"sutils.clean_path",
"sutils.read_file",
"sutils.write_singularity_infos",
"sutils.run_command",
"sys.path.append",
"os.remove",
"os.path.exists",
"sutils.write_file",
"shell.get_image_uri",
"os.mkdir",
"sutils.write_json",
"glob.glob",
"shell.remove... | [((1144, 1165), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (1159, 1165), False, 'import sys\n'), ((30397, 30424), 'tarfile.open', 'tarfile.open', (['archive', 'mode'], {}), '(archive, mode)\n', (30409, 30424), False, 'import tarfile\n'), ((1712, 1730), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ... |
import numpy
import ipdb
import util
import dtw
def score(model, orig_mat, list_of_random_startend):
list_of_gen_mat = []
for idx, tup in enumerate(list_of_random_startend):
now_start = tup[0].copy()
now_end = tup[1].copy()
list_of_gen_mat.append(
util.generalize_via_dmp(no... | [
"util.generalize_via_dmp",
"numpy.linalg.norm"
] | [((294, 344), 'util.generalize_via_dmp', 'util.generalize_via_dmp', (['now_start', 'now_end', 'model'], {}), '(now_start, now_end, model)\n', (317, 344), False, 'import util\n'), ((515, 546), 'numpy.linalg.norm', 'numpy.linalg.norm', (['(x - y)'], {'ord': '(2)'}), '(x - y, ord=2)\n', (532, 546), False, 'import numpy\n'... |
import moai.nn.convolution as mic
import torch
__all__ = [
"StridedConv2d",
]
class StridedConv2d(torch.nn.Module): #TODO: Add optional activation as well?
def __init__(self,
features: int,
kernel_size: int=3,
conv_type: str="conv2d",
stride: int=2,
padding: int=1
... | [
"moai.nn.convolution.make_conv_op"
] | [((390, 550), 'moai.nn.convolution.make_conv_op', 'mic.make_conv_op', ([], {'kernel_size': 'kernel_size', 'dilation': '(1)', 'groups': '(1)', 'conv_type': 'conv_type', 'in_channels': 'features', 'out_channels': 'features', 'bias': '(False)', 'stride': '(2)'}), '(kernel_size=kernel_size, dilation=1, groups=1, conv_type=... |
import tempfile
from collections import deque
from suls.mealymachine import MealyMachine, MealyState
from pathlib import Path
def get_state_cover_set(fsm):
alphabet = fsm.get_alphabet()
states = fsm.get_states()
initial_state = fsm.initial_state
paths = []
to_visit = deque([((), initial_state)])
... | [
"collections.deque",
"pathlib.Path",
"suls.mealymachine.MealyState",
"tempfile.mktemp",
"suls.mealymachine.MealyMachine"
] | [((290, 318), 'collections.deque', 'deque', (['[((), initial_state)]'], {}), '([((), initial_state)])\n', (295, 318), False, 'from collections import deque\n'), ((1353, 1363), 'pathlib.Path', 'Path', (['path'], {}), '(path)\n', (1357, 1363), False, 'from pathlib import Path\n'), ((1798, 1813), 'suls.mealymachine.MealyS... |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | [
"plano.stop_process",
"plano.enable_logging",
"plano.flush",
"plano.make_temp_file",
"plano.start_process",
"plano.random_port",
"plano.read",
"plano.join",
"time.localtime",
"traceback.print_exc",
"plano.sleep",
"plano.read_lines",
"plano.call",
"plano.exit",
"plano.write",
"plano.mak... | [((3763, 3795), 'plano.make_dir', '_plano.make_dir', (['self.output_dir'], {}), '(self.output_dir)\n', (3778, 3795), True, 'import plano as _plano\n'), ((8418, 8438), 'plano.random_port', '_plano.random_port', ([], {}), '()\n', (8436, 8438), True, 'import plano as _plano\n'), ((8945, 9014), 'plano.join', '_plano.join',... |
import logging
from OTLMOW.ModelGenerator.AbstractDatatypeCreator import AbstractDatatypeCreator
from OTLMOW.ModelGenerator.OSLOCollector import OSLOCollector
from OTLMOW.ModelGenerator.OSLODatatypePrimitive import OSLODatatypePrimitive
class OTLPrimitiveDatatypeCreator(AbstractDatatypeCreator):
def __init__(sel... | [
"logging.info"
] | [((402, 468), 'logging.info', 'logging.info', (['"""Created an instance of OTLPrimitiveDatatypeCreator"""'], {}), "('Created an instance of OTLPrimitiveDatatypeCreator')\n", (414, 468), False, 'import logging\n')] |
# pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
import logging
from typing import AsyncIterator, Dict, Union
import aioredis
import pytest
import tenacity
from models_library.settings.redis import RedisConfig
from tenacity.before_sleep import before_sleep_log
fr... | [
"logging.getLogger",
"aioredis.create_redis_pool",
"tenacity.stop.stop_after_delay",
"tenacity.wait.wait_fixed",
"tenacity.before_sleep.before_sleep_log",
"pytest.fixture"
] | [((488, 515), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (505, 515), False, 'import logging\n'), ((519, 551), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (533, 551), False, 'import pytest\n'), ((1050, 1082), 'pytest.fixture', 'pytest.... |
"""
core for project 9
:author: <NAME> <<EMAIL>>
:license: CC0
"""
from . import util, view
class Project9:
_size = {
'x': 9,
'y': 9
}
_pos = {
'x': 0,
'y': 0
}
_wall_touched = False
def __init__(self, size_x=9, size_y=9):
self.set_size(size_x, size_y)... | [
"math.ceil"
] | [((2072, 2099), 'math.ceil', 'math.ceil', (['((size_x - 1) / 2)'], {}), '((size_x - 1) / 2)\n', (2081, 2099), False, 'import math\n'), ((2114, 2141), 'math.ceil', 'math.ceil', (['((size_y - 1) / 2)'], {}), '((size_y - 1) / 2)\n', (2123, 2141), False, 'import math\n')] |
from collections import deque
import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objects as go
from src.layout import *
from src.model import Model, generate_features
# Models
gbr = Model(name='gbr').load()
mlp = Model(name='... | [
"plotly.graph_objects.Bar",
"src.model.generate_features",
"collections.deque",
"dash_bootstrap_components.Tooltip",
"dash.dependencies.Output",
"dash.dependencies.Input",
"dash.Dash",
"dash_html_components.P",
"src.model.Model",
"dash_html_components.Div",
"dash_core_components.Graph"
] | [((437, 452), 'collections.deque', 'deque', ([], {'maxlen': '(2)'}), '(maxlen=2)\n', (442, 452), False, 'from collections import deque\n'), ((569, 662), 'dash.Dash', 'dash.Dash', ([], {'name': '__name__', 'external_stylesheets': '[dbc.themes.FLATLY]', 'meta_tags': '[meta_tags]'}), '(name=__name__, external_stylesheets=... |
import webview
import threading
"""
This example demonstrates how to create a pywebview windows using QT (normally GTK is preferred)
"""
if __name__ == '__main__':
webview.config.use_qt = True
# Create a non-resizable webview window with 800x600 dimensions
# webview.create_window("Simple browser", "http:... | [
"webview.load_html"
] | [((343, 386), 'webview.load_html', 'webview.load_html', (['"""<h1>Master Window</h1>"""'], {}), "('<h1>Master Window</h1>')\n", (360, 386), False, 'import webview\n')] |
from django.http.response import JsonResponse
from django.views.generic.base import View, TemplateView
from django.views.decorators.csrf import csrf_exempt
from PIL import Image, ImageFilter
from tesserocr import PyTessBaseAPI
class OcrFormView(TemplateView):
template_name = 'documents/ocr_form.html'
ocr_form_vi... | [
"PIL.Image.open",
"tesserocr.PyTessBaseAPI",
"django.http.response.JsonResponse"
] | [((691, 729), 'django.http.response.JsonResponse', 'JsonResponse', (["{'utf8_text': utf8_text}"], {}), "({'utf8_text': utf8_text})\n", (703, 729), False, 'from django.http.response import JsonResponse\n'), ((429, 444), 'tesserocr.PyTessBaseAPI', 'PyTessBaseAPI', ([], {}), '()\n', (442, 444), False, 'from tesserocr impo... |
from os import listdir
from os.path import isfile, join
import tensorflow as tf
def get_image(path, height, width, preprocess_fn):
png = path.lower().endswith('png')
img_bytes = tf.read_file(path)
image = tf.image.decode_png(img_bytes, channels=3) if png else tf.image.decode_jpeg(img_bytes, channels=3)
... | [
"tensorflow.image.decode_png",
"os.listdir",
"os.path.join",
"tensorflow.WholeFileReader",
"tensorflow.train.batch",
"tensorflow.train.string_input_producer",
"tensorflow.read_file",
"tensorflow.image.decode_jpeg"
] | [((188, 206), 'tensorflow.read_file', 'tf.read_file', (['path'], {}), '(path)\n', (200, 206), True, 'import tensorflow as tf\n'), ((705, 782), 'tensorflow.train.string_input_producer', 'tf.train.string_input_producer', (['filenames'], {'shuffle': 'shuffle', 'num_epochs': 'epochs'}), '(filenames, shuffle=shuffle, num_ep... |
# -*- encoding:utf8 -*-
from akilib import AKI_GPIO_SG12864ASLB
#akilibからAKI_GPIO_SG12864ASLBライブラリの使用を宣言
from PIL import Image, ImageDraw,ImageFont
#画像描画ライブラリ PILを使用する宣言
g = AKI_GPIO_SG12864ASLB(13,12,11,10,9,8,7,6,5,4,3,2,1,0)
#EdisonとSG12864ASLBの信号の宣言
g.SetUp()
#SG12864ASLBを初期化する関数
g.Clear()
#画面をまっさらにする
g.Test()
#テスト... | [
"PIL.ImageFont.truetype",
"akilib.AKI_GPIO_SG12864ASLB"
] | [((174, 240), 'akilib.AKI_GPIO_SG12864ASLB', 'AKI_GPIO_SG12864ASLB', (['(13)', '(12)', '(11)', '(10)', '(9)', '(8)', '(7)', '(6)', '(5)', '(4)', '(3)', '(2)', '(1)', '(0)'], {}), '(13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)\n', (194, 240), False, 'from akilib import AKI_GPIO_SG12864ASLB\n'), ((343, 377), 'PIL.ImageF... |
from datetime import datetime, timedelta
from random import randint, choice
from re import findall
from typing import Tuple, List
from peewee import DoesNotExist
from vk_api.keyboard import VkKeyboard, VkKeyboardColor
from InitConfig import Config
from MySQLStorage import Users_communities, Weeks, Days, Subjects, Les... | [
"MySQLStorage.Subjects.select",
"MySQLStorage.Users_communities.select",
"random.choice",
"datetime.datetime.min.time",
"MySQLStorage.Weeks.get",
"MySQLStorage.Users_communities.create",
"MySQLStorage.Lesson_start_end.select",
"vk_api.keyboard.VkKeyboard",
"MySQLStorage.Users_tasks.select",
"datet... | [((1732, 1757), 'vk_api.keyboard.VkKeyboard', 'VkKeyboard', ([], {'one_time': '(True)'}), '(one_time=True)\n', (1742, 1757), False, 'from vk_api.keyboard import VkKeyboard, VkKeyboardColor\n'), ((5345, 5359), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (5357, 5359), False, 'from datetime import datetime,... |
import pygame
import math
import random
pygame.init()
# Referenced Code
# Overall program inspired by game 'Orbit' made by HIGHKEY Games
# petercollingridge
# https://github.com/petercollingridge/code-for-blog/blob/master/pygame%20physics%20simulation/particle_tutorial_7.py
########################
# Variables
####... | [
"pygame.init",
"pygame.quit",
"math.cos",
"pygame.display.quit",
"math.hypot",
"pygame.time.set_timer",
"pygame.time.get_ticks",
"pygame.display.set_mode",
"pygame.display.flip",
"pygame.mouse.get_pos",
"pygame.draw.rect",
"pygame.font.init",
"random.randint",
"pygame.Rect",
"math.atan2"... | [((40, 53), 'pygame.init', 'pygame.init', ([], {}), '()\n', (51, 53), False, 'import pygame\n'), ((1102, 1118), 'math.hypot', 'math.hypot', (['x', 'y'], {}), '(x, y)\n', (1112, 1118), False, 'import math\n'), ((1896, 1940), 'pygame.Rect', 'pygame.Rect', (['(0)', '(0)', 'screenWidth', 'screenHeight'], {}), '(0, 0, scree... |
import math, time
import o80
from handle_contacts import MUJOCO_ID, ROBOT_SEGMENT_ID, BALL_SEGMENT_ID
from handle_contacts import get_robot_contact_handle
handle = get_robot_contact_handle()
ball = handle.frontends[BALL_SEGMENT_ID]
robot = handle.frontends[ROBOT_SEGMENT_ID]
handle.reset_contact(BALL_SEGMENT_ID)
de... | [
"handle_contacts.get_robot_contact_handle",
"o80.Duration_us.milliseconds"
] | [((165, 191), 'handle_contacts.get_robot_contact_handle', 'get_robot_contact_handle', ([], {}), '()\n', (189, 191), False, 'from handle_contacts import get_robot_contact_handle\n'), ((705, 738), 'o80.Duration_us.milliseconds', 'o80.Duration_us.milliseconds', (['(200)'], {}), '(200)\n', (733, 738), False, 'import o80\n'... |
# Copyright 2019 Intel Corporation
#
# 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 wri... | [
"logging.getLogger",
"json.loads",
"json.dumps",
"connectors.ethereum.direct_registry_bridge.sync_contract_and_lmdb",
"os.path.dirname",
"connectors.ethereum.ethereum_worker_registry_list_impl.EthereumWorkerRegistryListImpl.EthereumDirectRegistry",
"shared_kv.shared_kv_interface.KvStorage"
] | [((1029, 1056), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1046, 1056), False, 'import logging\n'), ((1373, 1398), 'json.dumps', 'json.dumps', (['registry_info'], {}), '(registry_info)\n', (1383, 1398), False, 'import json\n'), ((1959, 2030), 'connectors.ethereum.direct_registry_brid... |
# flake8: noqa
import torch
from torch.utils.data import DataLoader, TensorDataset
from catalyst.contrib.nn.schedulers.onecycle import OneCycleLRWithWarmup
from catalyst.dl import Callback, CallbackOrder, SupervisedRunner
class LRCheckerCallback(Callback):
def __init__(self, init_lr_value: float, final_lr_value:... | [
"catalyst.dl.SupervisedRunner",
"torch.nn.CrossEntropyLoss",
"torch.utils.data.TensorDataset",
"torch.randint",
"catalyst.contrib.nn.schedulers.onecycle.OneCycleLRWithWarmup",
"torch.nn.Linear",
"torch.utils.data.DataLoader",
"torch.rand"
] | [((923, 960), 'torch.rand', 'torch.rand', (['num_samples', 'num_features'], {}), '(num_samples, num_features)\n', (933, 960), False, 'import torch\n'), ((969, 1008), 'torch.randint', 'torch.randint', (['(0)', '(5)'], {'size': '[num_samples]'}), '(0, 5, size=[num_samples])\n', (982, 1008), False, 'import torch\n'), ((10... |
import tests.hakoblog # noqa: F401
from hakoblog.db import DB
from hakoblog.model.user import User
from hakoblog.loader.user import UserLoader
from tests.util import random_string, create_user
def test_find_by_name():
db = DB()
user = create_user()
found_user = UserLoader.find_by_name(db, user.name)
... | [
"tests.util.create_user",
"hakoblog.loader.user.UserLoader.find_by_name",
"tests.util.random_string",
"hakoblog.db.DB"
] | [((232, 236), 'hakoblog.db.DB', 'DB', ([], {}), '()\n', (234, 236), False, 'from hakoblog.db import DB\n'), ((249, 262), 'tests.util.create_user', 'create_user', ([], {}), '()\n', (260, 262), False, 'from tests.util import random_string, create_user\n'), ((281, 319), 'hakoblog.loader.user.UserLoader.find_by_name', 'Use... |
import os
import logging
import pytest
import json
from pathlib import Path
from pytest import fixture, raises
from test.cl_node.contract_address import contract_address
from test.cl_node.common import testing_root_path, HELLO_NAME_CONTRACT
from test.cl_node.casperlabs_accounts import Account, GENESIS_ACCOUNT
from test... | [
"casperlabs_client.ABI.account",
"pytest.fixture",
"test.cl_node.wait.wait_for_genesis_block",
"casperlabs_client.ABI.optional_value",
"os.remove",
"json.dumps",
"test.cl_node.casperlabs_accounts.GENESIS_ACCOUNT.public_key_binary_file",
"test.cl_node.cli.CLI",
"test.cl_node.common.testing_root_path"... | [((6570, 6647), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""define_contract, call_contract"""', 'ffi_test_contracts'], {}), "('define_contract, call_contract', ffi_test_contracts)\n", (6593, 6647), False, 'import pytest\n'), ((6890, 6980), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""wasm... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Usage:
# python seodashboard/main.py
import yaml
import MySQLdb
from flask import Flask, render_template, request
app = Flask(__name__, template_folder='.', static_folder='static', static_url_path='/static')
db = None
default_page_length = 50
def fetch_latest_run_i... | [
"flask.request.args.get",
"flask.Flask"
] | [((172, 263), 'flask.Flask', 'Flask', (['__name__'], {'template_folder': '"""."""', 'static_folder': '"""static"""', 'static_url_path': '"""/static"""'}), "(__name__, template_folder='.', static_folder='static',\n static_url_path='/static')\n", (177, 263), False, 'from flask import Flask, render_template, request\n'... |
import pytest
from pygml.basics import (
parse_coordinates, parse_poslist, parse_pos, swap_coordinate_xy,
swap_coordinates_xy
)
def test_parse_coordinates():
# basic test
result = parse_coordinates('12.34 56.7,89.10 11.12')
assert result == [(12.34, 56.7), (89.10, 11.12)]
# ignore some white... | [
"pygml.basics.parse_pos",
"pygml.basics.parse_coordinates",
"pygml.basics.swap_coordinates_xy",
"pygml.basics.swap_coordinate_xy",
"pygml.basics.parse_poslist",
"pytest.raises"
] | [((199, 242), 'pygml.basics.parse_coordinates', 'parse_coordinates', (['"""12.34 56.7,89.10 11.12"""'], {}), "('12.34 56.7,89.10 11.12')\n", (216, 242), False, 'from pygml.basics import parse_coordinates, parse_poslist, parse_pos, swap_coordinate_xy, swap_coordinates_xy\n'), ((339, 384), 'pygml.basics.parse_coordinates... |
# -*- coding: UTF-8 -*-
# Copyright 2016-2018 Rumma & Ko Ltd
# License: BSD, see LICENSE for more details.
"""
A library of `invoke
<http://docs.pyinvoke.org/en/latest/index.html>`__ tasks. See
:doc:`/invlib`.
.. autosummary::
:toctree:
tasks
utils
"""
from __future__ import print_function
from __future__ ... | [
"importlib.import_module",
"invoke.Collection.from_module",
"unipath.Path",
"atelier.projects.get_project_from_tasks"
] | [((946, 976), 'unipath.Path', 'Path', (["globals_dict['__file__']"], {}), "(globals_dict['__file__'])\n", (950, 976), False, 'from unipath import Path\n'), ((1235, 1276), 'atelier.projects.get_project_from_tasks', 'get_project_from_tasks', (['tasks_file.parent'], {}), '(tasks_file.parent)\n', (1257, 1276), False, 'from... |
# -*- coding: utf-8 -*-
import logging
from odoo import api, models, fields, _
from odoo.exceptions import UserError, Warning
import pandas as pd
pd.set_option("max_colwidth", 4096) # 设置最大列宽
pd.set_option("display.max_columns", 30) # 设置最大列数
pd.set_option("expand_frame_repr", False) # 当列太多时不换行
import time
from o... | [
"logging.getLogger",
"odoo._",
"pandas.DataFrame",
"odoo.fields.Selection",
"odoo.fields.Float",
"pandas.set_option",
"odoo.fields.Many2one",
"odoo.api.onchange",
"odoo.fields.Text",
"odoo.api.depends",
"time.time",
"odoo.fields.Char",
"odoo.fields.Boolean"
] | [((150, 185), 'pandas.set_option', 'pd.set_option', (['"""max_colwidth"""', '(4096)'], {}), "('max_colwidth', 4096)\n", (163, 185), True, 'import pandas as pd\n'), ((196, 236), 'pandas.set_option', 'pd.set_option', (['"""display.max_columns"""', '(30)'], {}), "('display.max_columns', 30)\n", (209, 236), True, 'import p... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import models
from math import exp
from collections import namedtuple
class LossNetwork(torch.nn.Module):
'''
This has to receive a tensor between 0 and 1, normalized by Image mean and SD
'''
def __init__(se... | [
"torch.nn.functional.conv2d",
"torch.abs",
"collections.namedtuple",
"torch.log",
"torch.mean",
"torch.nn.Sequential",
"torch.nn.L1Loss",
"torch.max",
"torch.nn.MSELoss",
"torch.sum",
"torch.nn.functional.threshold",
"torch.nn.functional.pad",
"torchvision.models.resnet50"
] | [((1682, 1709), 'torch.nn.L1Loss', 'nn.L1Loss', ([], {'reduction': '"""mean"""'}), "(reduction='mean')\n", (1691, 1709), True, 'import torch.nn as nn\n'), ((1794, 1822), 'torch.nn.MSELoss', 'nn.MSELoss', ([], {'reduction': '"""mean"""'}), "(reduction='mean')\n", (1804, 1822), True, 'import torch.nn as nn\n'), ((2193, 2... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""PYStructure
Usage:
pystructure.py SRC_PATH [-o FILE | --output=FILE]
Options:
-o FILE --output=FILE Save result to output file.
-h --help Show help information.
--version Show version.
"""
import os
from colle... | [
"os.path.exists",
"collections.OrderedDict",
"ast.literal_eval",
"ast.parse",
"docopt.docopt"
] | [((11275, 11311), 'docopt.docopt', 'docopt', (['__doc__'], {'version': '__VERSION__'}), '(__doc__, version=__VERSION__)\n', (11281, 11311), False, 'from docopt import docopt\n'), ((909, 922), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (920, 922), False, 'from collections import OrderedDict\n'), ((11391... |
import sys
import os
import asyncio
import configparser
import logging
import logging.handlers
from random import randint
config = configparser.ConfigParser()
config.read(os.path.join(os.path.dirname(__file__), 'samples.ini'))
if config['DEFAULT'].getboolean('Local'):
sys.path.insert(0, 'src')
from iotc import I... | [
"logging.getLogger",
"sys.path.insert",
"configparser.ConfigParser",
"os.path.join",
"os.path.dirname",
"asyncio.sleep",
"random.randint"
] | [((132, 159), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (157, 159), False, 'import configparser\n'), ((275, 300), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""src"""'], {}), "(0, 'src')\n", (290, 300), False, 'import sys\n'), ((185, 210), 'os.path.dirname', 'os.path.dirname', (['... |
# Copyright 2021-present, Nike, Inc.
# All rights reserved.
#
# This source code is licensed under the Apache-2.0 license found in
# the LICENSE file in the root directory of this source tree.
from dependency_injector import containers, providers
from knockoff.utilities.importlib_utils import resolve_package_name
fr... | [
"dependency_injector.providers.Factory",
"dependency_injector.providers.Configuration"
] | [((511, 536), 'dependency_injector.providers.Configuration', 'providers.Configuration', ([], {}), '()\n', (534, 536), False, 'from dependency_injector import containers, providers\n'), ((559, 636), 'dependency_injector.providers.Factory', 'providers.Factory', (['resolve_package_name', 'config.tempdb.setup_teardown.pack... |
#pragma pylint: disable=fixme,line-too-long,missing-docstring,invalid-name,no-member,dangerous-default-value,protected-access,unused-import,assignment-from-no-return,redefined-outer-name
import sys
import math
from ctypes import sizeof, c_float, c_void_p, c_uint, string_at
from OpenGL.GL import * #pylint: disable=... | [
"numpy.identity",
"sys.exit",
"numpy.cross",
"math.tan",
"imgui.color_edit3",
"math.radians",
"numpy.ascontiguousarray",
"numpy.array",
"numpy.dot",
"numpy.linalg.inv",
"math.cos",
"numpy.vstack",
"numpy.linalg.norm",
"numpy.matrix",
"math.sin"
] | [((501, 535), 'numpy.array', 'np.array', (['[x, y]'], {'dtype': 'np.float32'}), '([x, y], dtype=np.float32)\n', (509, 535), True, 'import numpy as np\n'), ((728, 765), 'numpy.array', 'np.array', (['[x, y, z]'], {'dtype': 'np.float32'}), '([x, y, z], dtype=np.float32)\n', (736, 765), True, 'import numpy as np\n'), ((681... |
# Copyright (c) 2021, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is also distributed with certain software (including
#... | [
"io.BytesIO",
"certifi.where",
"datetime.timedelta",
"os.remove",
"os.path.exists",
"os.listdir",
"os.chmod",
"mds_plugin.core.prompt_for_list_item",
"io.StringIO",
"os.path.expanduser",
"mds_plugin.configuration.get_current_bucket_name",
"os.path.getsize",
"time.strptime",
"mds_plugin.cor... | [((4095, 4130), 'mysqlsh.plugin_manager.plugin_function', 'plugin_function', (['"""mds.list.buckets"""'], {}), "('mds.list.buckets')\n", (4110, 4130), False, 'from mysqlsh.plugin_manager import plugin_function\n'), ((6306, 6339), 'mysqlsh.plugin_manager.plugin_function', 'plugin_function', (['"""mds.get.bucket"""'], {}... |
import math
import numpy as np
import pandas as pd
from typing import Tuple
from backlight.datasource.marketdata import MarketData
from backlight.positions import calculate_positions
from backlight.positions.positions import Positions
from backlight.metrics.evaluation_metrics import (
calculate_pl,
calculate_s... | [
"backlight.metrics.evaluation_metrics.calculate_pl",
"backlight.metrics.evaluation_metrics.calculate_drawdown",
"pandas.Timedelta",
"backlight.metrics.evaluation_metrics.calculate_sharpe"
] | [((801, 819), 'pandas.Timedelta', 'pd.Timedelta', (['"""1D"""'], {}), "('1D')\n", (813, 819), True, 'import pandas as pd\n'), ((1053, 1076), 'backlight.metrics.evaluation_metrics.calculate_pl', 'calculate_pl', (['positions'], {}), '(positions)\n', (1065, 1076), False, 'from backlight.metrics.evaluation_metrics import c... |
# -----------------------------------------------------------------------------
# Copyright (c) 2020, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
# -----------------------------------------------------------------------------
#
# Configuration file override for the Sphinx documentation... | [
"os.path.join",
"os.path.dirname",
"os.path.isdir",
"os.path.abspath",
"sys.path.append"
] | [((909, 930), 'sys.path.append', 'sys.path.append', (['"""./"""'], {}), "('./')\n", (924, 930), False, 'import sys\n'), ((668, 693), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (683, 693), False, 'import os\n'), ((731, 757), 'os.path.dirname', 'os.path.dirname', (['root_path'], {}), '(root... |
"""Auth models."""
from datetime import datetime, timedelta
import secrets
from typing import Dict, List, NamedTuple, Optional
import uuid
import attr
from homeassistant.util import dt as dt_util
from . import permissions as perm_mdl
from .const import GROUP_ID_ADMIN
TOKEN_TYPE_NORMAL = "normal"
TOKEN_TYPE_SYSTEM =... | [
"secrets.token_hex",
"attr.s",
"uuid.uuid4",
"attr.validators.in_",
"attr.ib"
] | [((396, 414), 'attr.s', 'attr.s', ([], {'slots': '(True)'}), '(slots=True)\n', (402, 414), False, 'import attr\n'), ((639, 657), 'attr.s', 'attr.s', ([], {'slots': '(True)'}), '(slots=True)\n', (645, 657), False, 'import attr\n'), ((2346, 2364), 'attr.s', 'attr.s', ([], {'slots': '(True)'}), '(slots=True)\n', (2352, 23... |
#!/usr/bin/env python3
# Developed by <NAME> and <NAME>
# This file is covered by the LICENSE file in the root of this project.
# Brief: A custom keras padding layer.
# pad([1 2 3 4], 2) -> [3, 4, 1, 2, 3, 4, 1]
import numpy as np
from keras.layers import Layer
from keras.models import Sequential
import keras.ba... | [
"numpy.array",
"keras.backend.backend",
"keras.backend.concatenate",
"keras.models.Sequential"
] | [((1975, 1987), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (1985, 1987), False, 'from keras.models import Sequential\n'), ((2760, 2772), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (2770, 2772), False, 'from keras.models import Sequential\n'), ((1117, 1128), 'keras.backend.backend', 'K.ba... |
# -*- coding: utf-8 -*-
import os
import json
from .third_party import source_utils
from .utils import database, decode
def _get_json(filename):
json_path = os.path.join(os.path.dirname(__file__), filename)
with open(json_path) as json_result:
return json.load(json_result)
urls = _get_json('urls.jso... | [
"json.load",
"os.path.dirname",
"json.loads",
"json.dumps"
] | [((177, 202), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (192, 202), False, 'import os\n'), ((270, 292), 'json.load', 'json.load', (['json_result'], {}), '(json_result)\n', (279, 292), False, 'import json\n'), ((2301, 2334), 'json.loads', 'json.loads', (["cache_result['value']"], {}), "(c... |
import text_display
import pygame
from config import DISPLAY_HEIGHT, DISPLAY_WIDTH, default_font_size
from typing import Tuple
class Player_Car_Info:
""" A class containing the information and text surfaces for the player
car. Such information includes position, velocity, acceleration, angle,
and... | [
"text_display.Text",
"pygame.event.get"
] | [((619, 644), 'text_display.Text', 'text_display.Text', (['screen'], {}), '(screen)\n', (636, 644), False, 'import text_display\n'), ((674, 699), 'text_display.Text', 'text_display.Text', (['screen'], {}), '(screen)\n', (691, 699), False, 'import text_display\n'), ((733, 758), 'text_display.Text', 'text_display.Text', ... |
"""
Collection of helper methods which can be used as to interface metrics.
"""
import multiprocessing as mp
from typing import Any, Callable, List, Mapping, Optional, Tuple, Type, Union
import pandas as pd
from .. import utils
from .correlation import cramers_v, kruskal_wallis, pearson
from .distance import Binomia... | [
"pandas.concat",
"multiprocessing.cpu_count"
] | [((6688, 6764), 'pandas.concat', 'pd.concat', (['series_list'], {'axis': '(1)', 'keys': '[series.name for series in series_list]'}), '(series_list, axis=1, keys=[series.name for series in series_list])\n', (6697, 6764), True, 'import pandas as pd\n'), ((6304, 6318), 'multiprocessing.cpu_count', 'mp.cpu_count', ([], {})... |
import urllib.parse
from typing import cast
import pytest
from django.db.utils import IntegrityError
from django.utils import timezone
from rest_framework import status
from ee.models.license import License, LicenseManager
from ee.models.property_definition import EnterprisePropertyDefinition
from posthog.models impo... | [
"posthog.models.EventProperty.objects.create",
"posthog.models.Tag.objects.create",
"ee.models.property_definition.EnterprisePropertyDefinition.objects.all",
"django.utils.timezone.datetime",
"typing.cast",
"pytest.raises",
"ee.models.property_definition.EnterprisePropertyDefinition.objects.create",
"... | [((590, 700), 'ee.models.property_definition.EnterprisePropertyDefinition.objects.create', 'EnterprisePropertyDefinition.objects.create', ([], {'team': 'self.team', 'name': '"""a timestamp"""', 'property_type': '"""DateTime"""'}), "(team=self.team, name=\n 'a timestamp', property_type='DateTime')\n", (633, 700), Fal... |
import os.path
from algs.DQN.dqn_agent import DQN
from algs.agent import Agent
from configs.config_phaser import *
import torch
import numpy as np
import random
class METADQNAgent(Agent):
def __init__(self, conf_path, round_number, inter_name,
list_traffic_name=None):
super().__init__(con... | [
"torch.load",
"torch.Tensor",
"numpy.max",
"torch.nn.MSELoss",
"numpy.array",
"numpy.vstack",
"torch.save",
"algs.DQN.dqn_agent.DQN",
"random.random"
] | [((1336, 1360), 'algs.DQN.dqn_agent.DQN', 'DQN', (['self.__conf_traffic'], {}), '(self.__conf_traffic)\n', (1339, 1360), False, 'from algs.DQN.dqn_agent import DQN\n'), ((1385, 1403), 'torch.nn.MSELoss', 'torch.nn.MSELoss', ([], {}), '()\n', (1401, 1403), False, 'import torch\n'), ((1790, 1811), 'torch.load', 'torch.lo... |
# heavily inspired by https://www.nodebox.net/code/index.php/Landslide
from __future__ import print_function
import sys, os
import pprint
pp = pprint.pprint
kwdbg = 0
kwlog = 0
# need a different name for nodebox
import random as rnd
import libgradient
import imagewells
loadImageWell = imagewells.loadImageWell
i... | [
"os.path.exists",
"random.choice",
"random.shuffle",
"photobot.scaleLayerToHeight",
"random.seed",
"photobot.canvas",
"photobot.placeImage",
"os.path.abspath",
"random.random"
] | [((1619, 1643), 'photobot.canvas', 'pb.canvas', (['WIDTH', 'HEIGHT'], {}), '(WIDTH, HEIGHT)\n', (1628, 1643), True, 'import photobot as pb\n'), ((2981, 3051), 'photobot.placeImage', 'pb.placeImage', (['c', 'bgimage', 'x', 'y', 'W', '"""Image 1"""'], {'width': '(True)', 'height': '(True)'}), "(c, bgimage, x, y, W, 'Imag... |
import requests
import json
import cloudscraper
import re
import sys
from bs4 import BeautifulSoup
mode = input('''Select mode:
- Email: email
- Username: username
- Email by password: <PASSWORD>
- Username by password: elogin
- Phone (BETA): phone
- Domain (BETA): domain
- Email by hash: hash
''').lower()
tr... | [
"cloudscraper.create_scraper",
"requests.post",
"bs4.BeautifulSoup",
"sys.exit"
] | [((1146, 1175), 'cloudscraper.create_scraper', 'cloudscraper.create_scraper', ([], {}), '()\n', (1173, 1175), False, 'import cloudscraper\n'), ((1236, 1259), 'bs4.BeautifulSoup', 'BeautifulSoup', (['response'], {}), '(response)\n', (1249, 1259), False, 'from bs4 import BeautifulSoup\n'), ((1429, 1475), 'requests.post',... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Build credits / models section for the about page"""
import os
import glob
import shutil
from progress.bar import Bar
from PIL import Image
import bplrh_helpers.tools
def reset(config):
models_path = config['plr']['main_folder_path'] + config['plr']['models_folde... | [
"os.path.exists",
"PIL.Image.open",
"os.path.isdir",
"os.mkdir",
"os.path.basename",
"shutil.rmtree",
"glob.glob"
] | [((436, 457), 'os.mkdir', 'os.mkdir', (['models_path'], {}), '(models_path)\n', (444, 457), False, 'import os\n'), ((336, 363), 'os.path.exists', 'os.path.exists', (['models_path'], {}), '(models_path)\n', (350, 363), False, 'import os\n'), ((368, 394), 'os.path.isdir', 'os.path.isdir', (['models_path'], {}), '(models_... |
import os
from typing import List
from fastapi import Depends, FastAPI, HTTPException
from sqlalchemy.orm import Session
from . import crud, models, schemas
from .cmds import BtoIrCmd, CameraCmd
from .config import MODEL_FILE, INPUT_SIZE
from .database import SessionLocal, engine
from .predictor import Predictor
mo... | [
"fastapi.HTTPException",
"fastapi.Depends"
] | [((696, 711), 'fastapi.Depends', 'Depends', (['get_db'], {}), '(get_db)\n', (703, 711), False, 'from fastapi import Depends, FastAPI, HTTPException\n'), ((1151, 1166), 'fastapi.Depends', 'Depends', (['get_db'], {}), '(get_db)\n', (1158, 1166), False, 'from fastapi import Depends, FastAPI, HTTPException\n'), ((1361, 137... |
# -*- coding: utf-8 -*-
import datetime
from django import forms
#from pug.nlp import util
class GetLagForm(forms.Form):
mn = forms.CharField(max_length=512, required=False,
label='Model Numbers',
initial='',
help_text='e.g. "LC40, LC5, LC60E79U"',
#widget=forms.TextInput(attrs={... | [
"django.forms.HiddenInput",
"django.forms.CharField",
"django.forms.DateField",
"django.forms.ChoiceField",
"datetime.date"
] | [((134, 260), 'django.forms.CharField', 'forms.CharField', ([], {'max_length': '(512)', 'required': '(False)', 'label': '"""Model Numbers"""', 'initial': '""""""', 'help_text': '"""e.g. "LC40, LC5, LC60E79U\\""""'}), '(max_length=512, required=False, label=\'Model Numbers\',\n initial=\'\', help_text=\'e.g. "LC40, L... |
from django.db import models
from django.core.validators import MinLengthValidator, RegexValidator
from django.db.models import CASCADE
from django.contrib.auth.models import User
#from patient.models import PatientInfo
from django.db.models.signals import post_save
from django.db.models import signals
from djan... | [
"django.db.models.OneToOneField",
"django.db.models.TextField",
"django.db.models.signals.post_delete.connect",
"django.db.models.IntegerField",
"django.core.validators.RegexValidator",
"django.db.models.ForeignKey",
"django.db.models.FileField",
"django.db.models.DateTimeField",
"django.db.models.I... | [((1255, 1287), 'django.dispatch.receiver', 'receiver', (['post_save'], {'sender': 'User'}), '(post_save, sender=User)\n', (1263, 1287), False, 'from django.dispatch import receiver\n'), ((1431, 1463), 'django.dispatch.receiver', 'receiver', (['post_save'], {'sender': 'User'}), '(post_save, sender=User)\n', (1439, 1463... |
from setuptools import setup, find_packages
__version__ = "1.0.a"
setup(name='dfw',
description='Implementation of the Deep Frank Wolfe (DFW) algorithm',
author='<NAME>',
packages=find_packages(),
license="GNU General Public License",
url='https://github.com/oval-group/dfw',
versio... | [
"setuptools.find_packages"
] | [((200, 215), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (213, 215), False, 'from setuptools import setup, find_packages\n')] |
# Copyright (c) 2020, NVIDIA CORPORATION. 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 appli... | [
"nemo.utils.logging.info",
"argparse.ArgumentParser",
"nemo.collections.asr.models.label_models.ExtractSpeakerEmbeddingsModel.from_pretrained",
"nemo.utils.logging.warning",
"torch.cuda.is_available",
"pytorch_lightning.Trainer",
"nemo.collections.asr.models.label_models.ExtractSpeakerEmbeddingsModel.re... | [((1694, 1710), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (1708, 1710), False, 'from argparse import ArgumentParser\n'), ((2380, 2409), 'torch.set_grad_enabled', 'torch.set_grad_enabled', (['(False)'], {}), '(False)\n', (2402, 2409), False, 'import torch\n'), ((3034, 3077), 'pytorch_lightning.Train... |
from pathlib import Path
from zipfile import ZipFile
import requests
class Taxonomy():
TAXONOMIES = {
"2013": "https://www.fsa.go.jp/search/20130821/editaxonomy2013New.zip",
"2014": "https://www.fsa.go.jp/search/20140310/1c.zip",
"2015": "https://www.fsa.go.jp/search/20150310/1c.zip",
... | [
"zipfile.ZipFile",
"requests.get",
"pathlib.Path"
] | [((1563, 1611), 'requests.get', 'requests.get', (['self.TAXONOMIES[year]'], {'stream': '(True)'}), '(self.TAXONOMIES[year], stream=True)\n', (1575, 1611), False, 'import requests\n'), ((1791, 1818), 'zipfile.ZipFile', 'ZipFile', (['taxonomy_file', '"""r"""'], {}), "(taxonomy_file, 'r')\n", (1798, 1818), False, 'from zi... |
"""
Tests for the poly module
"""
from smath2018b.poly import square
def test_square():
assert square(4) == 16
| [
"smath2018b.poly.square"
] | [((101, 110), 'smath2018b.poly.square', 'square', (['(4)'], {}), '(4)\n', (107, 110), False, 'from smath2018b.poly import square\n')] |
import matplotlib.pyplot as plt
import numpy as np
import os,glob,sys,importlib,pickle#,scipy,coolbox,pybedtools,
# from tqdm import tqdm
from scipy.stats import rankdata
import pandas as pd
import networkx as nx
import seaborn as sns
from joblib import delayed, wrap_non_picklable_objects
from pathlib import Path
impor... | [
"sys.path.insert",
"pandas.read_csv",
"numpy.array",
"seaborn.violinplot",
"networkx.convert_matrix.to_pandas_edgelist",
"numpy.arange",
"numpy.divide",
"pandas.unique",
"numpy.repeat",
"numpy.histogramdd",
"seaborn.despine",
"pathlib.Path",
"extremal_bi.calculate_Fitness",
"networkx.from_... | [((561, 605), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""./nestedness_analysis/"""'], {}), "(1, './nestedness_analysis/')\n", (576, 605), False, 'import os, glob, sys, importlib, pickle\n'), ((917, 1022), 'pandas.read_csv', 'pd.read_csv', (["('data/gcn/cc_' + patt + '.txt')"], {'index_col': '(False)', 'sep': '"... |
import sys
sys.path.append('..')
import unittest
import numpy as np
from ddt import ddt, data, unpack
from anytree import AnyNode as Node
# Local import
from runPolicyInMujoco import evaluateMeanEpisodeLength, SampleTrajectory
@ddt
class TestRunPolicyIn1DEnv(unittest.TestCase):
@data(([[(3, 1), (4, 1), (5, 1), (... | [
"runPolicyInMujoco.evaluateMeanEpisodeLength",
"sys.path.append",
"ddt.data"
] | [((11, 32), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (26, 32), False, 'import sys\n'), ((287, 452), 'ddt.data', 'data', (['([[(3, 1), (4, 1), (5, 1), (6, -1)]], 4)', '([[]], 0)', '([[(3, 1), (4, 1), (5, 1), (6, -1)], [(3, 1), (4, 1), (5, 1)], [(3, 1), (4,\n 1)], [(3, 1)], []], 2)'], {}),... |
"""
This module runs the homework's solution on a given testfile
Computer Systems Architecture Course
Assignment 1
March 2020
"""
import sys
from json import loads
from tema.producer import Producer
from tema.consumer import Consumer
from tema.marketplace import Marketplace
from tema.product import Product, Coffee, ... | [
"tema.marketplace.Marketplace",
"tema.consumer.Consumer",
"tema.producer.Producer"
] | [((1624, 1667), 'tema.marketplace.Marketplace', 'Marketplace', ([], {}), "(**market_config['marketplace'])\n", (1635, 1667), False, 'from tema.marketplace import Marketplace\n'), ((1722, 1787), 'tema.producer.Producer', 'Producer', ([], {'marketplace': 'marketplace', 'daemon': '(True)'}), '(**p_market_config, marketpla... |
import json
import os
import shutil
from pathlib import Path
import git
from . import app
from .exceptions import RepoNotFound
repos_dir = Path(app.config['REPOS_DIR'])
class Repository:
def __init__(self, name):
"""
Create a Repository backed by a brand new repo in REPOS_DIR
Args:
... | [
"json.load",
"json.dump",
"git.Repo",
"pathlib.Path"
] | [((142, 171), 'pathlib.Path', 'Path', (["app.config['REPOS_DIR']"], {}), "(app.config['REPOS_DIR'])\n", (146, 171), False, 'from pathlib import Path\n'), ((757, 767), 'git.Repo', 'git.Repo', ([], {}), '()\n', (765, 767), False, 'import git\n'), ((1609, 1628), 'git.Repo', 'git.Repo', (['self.path'], {}), '(self.path)\n'... |
# Generated by Django 2.1.7 on 2019-11-28 18:50
from django.conf import settings
import django.contrib.auth.models
import django.contrib.auth.validators
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migr... | [
"django.db.models.EmailField",
"django.db.models.OneToOneField",
"django.db.models.DateField",
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.models.ManyToManyField",
"django.db.models.BooleanField",
"django.db.models.SlugField",
"django.db.models.AutoField",
"django.db... | [((10207, 10298), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'through': '"""id.UserTermAndCondition"""', 'to': 'settings.AUTH_USER_MODEL'}), "(through='id.UserTermAndCondition', to=settings.\n AUTH_USER_MODEL)\n", (10229, 10298), False, 'from django.db import migrations, models\n'), ((10417,... |
import numpy as np
def dtw(series_1, series_2, norm_func = np.linalg.norm):
matrix = np.zeros((len(series_1) + 1, len(series_2) + 1))
matrix[0,:] = np.inf
matrix[:,0] = np.inf
matrix[0,0] = 0
for i, vec1 in enumerate(series_1):
for j, vec2 in enumerate(series_2):
cost = norm_func(vec1 - vec2)
matrix[i + 1... | [
"numpy.argmin"
] | [((901, 949), 'numpy.argmin', 'np.argmin', (['[option_diag, option_up, option_left]'], {}), '([option_diag, option_up, option_left])\n', (910, 949), True, 'import numpy as np\n')] |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import url, include
from appxs.account.views.role import list_role, edit_role, add_role, del_role
from ..apps import app_name
urlpatterns = [
url(r'^add/$', add_role, name='add'),
url(r'^list/$', list_role, name... | [
"django.conf.urls.url"
] | [((246, 281), 'django.conf.urls.url', 'url', (['"""^add/$"""', 'add_role'], {'name': '"""add"""'}), "('^add/$', add_role, name='add')\n", (249, 281), False, 'from django.conf.urls import url, include\n'), ((289, 327), 'django.conf.urls.url', 'url', (['"""^list/$"""', 'list_role'], {'name': '"""list"""'}), "('^list/$', ... |
"""Intermediate representation of modules."""
from typing import List, Tuple, Dict
from mypyc.common import JsonDict
from mypyc.ir.ops import DeserMaps
from mypyc.ir.rtypes import RType, deserialize_type
from mypyc.ir.func_ir import FuncIR, FuncDecl, format_func
from mypyc.ir.class_ir import ClassIR
class ModuleIR:... | [
"mypyc.ir.class_ir.ClassIR",
"mypyc.ir.func_ir.format_func",
"mypyc.ir.func_ir.FuncDecl.get_name_from_json",
"mypyc.ir.class_ir.ClassIR.deserialize",
"mypyc.ir.rtypes.deserialize_type",
"mypyc.ir.func_ir.FuncIR.deserialize"
] | [((2404, 2444), 'mypyc.ir.class_ir.ClassIR', 'ClassIR', (["cls['name']", "cls['module_name']"], {}), "(cls['name'], cls['module_name'])\n", (2411, 2444), False, 'from mypyc.ir.class_ir import ClassIR\n'), ((2786, 2817), 'mypyc.ir.func_ir.FuncIR.deserialize', 'FuncIR.deserialize', (['method', 'ctx'], {}), '(method, ctx)... |
"""
latestposts module
"""
class LatestPosts:
"""LatestPosts Class
With `LatestPosts` object, you can use the following properties and methods:
- latestposts.ids
- latestposts.articles
- latestposts.fetch_articles()
Note:
`LatestPosts` class is NOT intended to be use... | [
"medium_api._article.Article"
] | [((1317, 1433), 'medium_api._article.Article', 'Article', ([], {'article_id': 'article_id', 'get_resp': 'self.__get_resp', 'fetch_articles': 'self.__fetch_articles', 'save_info': '(False)'}), '(article_id=article_id, get_resp=self.__get_resp, fetch_articles=\n self.__fetch_articles, save_info=False)\n', (1324, 1433)... |
"""This module includes integration tests for the debug mode switch."""
# Copyright (c) 2021 http://reportportal.io .
# 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... | [
"pytest.mark.parametrize",
"six.moves.mock.patch",
"tests.helpers.utils.run_pytest_tests",
"tests.helpers.utils.DEFAULT_VARIABLES.items"
] | [((786, 819), 'six.moves.mock.patch', 'mock.patch', (['REPORT_PORTAL_SERVICE'], {}), '(REPORT_PORTAL_SERVICE)\n', (796, 819), False, 'from six.moves import mock\n'), ((821, 940), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (["['mode', 'expected_mode']", "[('DEFAULT', 'DEFAULT'), ('DEBUG', 'DEBUG'), (None, 'DE... |
from typing import List, Tuple, TypedDict
from .bootstrap.item.loot import Loot
User = TypedDict(
"User",
{
"userID": int,
"username": str,
"membership": str,
"displayName": str,
"title": str,
"experience": int,
"level": int,
"teamID": int,
... | [
"typing.TypedDict"
] | [((89, 637), 'typing.TypedDict', 'TypedDict', (['"""User"""', "{'userID': int, 'username': str, 'membership': str, 'displayName': str,\n 'title': str, 'experience': int, 'level': int, 'teamID': int,\n 'lookingForTeam': bool, 'carID': int, 'carHueAngle': int, 'totalCars':\n int, 'nitros': int, 'nitrosUsed': int... |