code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # # Copyright © 2018 Dell Inc. or its subsidiaries. All rights reserved. # Dell, EMC, and other trademarks are trademarks of Dell Inc. or its subsidiaries. # Other trademarks may be trademarks of their respective owners. # # Licensed under the Apache License, Ver...
[ "omsdk.http.sdkhttpep.HttpEndPoint" ]
[((1437, 1483), 'omsdk.http.sdkhttpep.HttpEndPoint', 'HttpEndPoint', (['ipaddr', 'creds', 'pOptions', 'headers'], {}), '(ipaddr, creds, pOptions, headers)\n', (1449, 1483), False, 'from omsdk.http.sdkhttpep import HttpEndPoint, HttpEndPointOptions\n')]
import pymysql # Conectar con base de datos conexion = pymysql.connect(host="localhost", port="3306", user="inventario2019", password="<PASSWORD>.", database="inventario2019", ) #curs...
[ "pymysql.connect" ]
[((56, 180), 'pymysql.connect', 'pymysql.connect', ([], {'host': '"""localhost"""', 'port': '"""3306"""', 'user': '"""inventario2019"""', 'password': '"""<PASSWORD>."""', 'database': '"""inventario2019"""'}), "(host='localhost', port='3306', user='inventario2019',\n password='<PASSWORD>.', database='inventario2019')...
from __future__ import print_function, division from PIL import Image from torchvision.transforms import ToTensor, ToPILImage, Compose, Normalize import numpy as np import random import tarfile import io import os import pandas as pd import torch from torch.utils.data import Dataset # %% custom dataset class Places...
[ "numpy.copy", "numpy.ceil", "tarfile.open", "torchvision.transforms.ToPILImage", "pandas.read_csv", "io.BytesIO", "os.path.join", "random.seed", "numpy.array", "numpy.random.randint", "torch.tensor", "random.random", "torchvision.transforms.ToTensor", "torchvision.transforms.Compose" ]
[((1046, 1089), 'pandas.read_csv', 'pd.read_csv', (['txt_path'], {'sep': '""" """', 'index_col': '(0)'}), "(txt_path, sep=' ', index_col=0)\n", (1057, 1089), True, 'import pandas as pd\n'), ((1255, 1265), 'torchvision.transforms.ToTensor', 'ToTensor', ([], {}), '()\n', (1263, 1265), False, 'from torchvision.transforms ...
#!/usr/bin/env python ''' python -m spacy download en_core_web_md spacy has a number of models and languages https://spacy.io/usage/models ''' import spacy spacy.load('en_core_web_md') nlp = spacy.load('en_core_web_md') # process a sentence using the model doc = nlp("This is some text that I am processing with...
[ "spacy.load" ]
[((163, 191), 'spacy.load', 'spacy.load', (['"""en_core_web_md"""'], {}), "('en_core_web_md')\n", (173, 191), False, 'import spacy\n'), ((199, 227), 'spacy.load', 'spacy.load', (['"""en_core_web_md"""'], {}), "('en_core_web_md')\n", (209, 227), False, 'import spacy\n')]
# -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-03-19 21:47 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('inventario', '0006_auto_20160319_1726'), ] operatio...
[ "django.db.migrations.AlterModelOptions", "django.db.models.ForeignKey" ]
[((335, 503), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""requisicionarticulo"""', 'options': "{'verbose_name': 'Requisición de piscina', 'verbose_name_plural':\n 'Requesiciones de piscina'}"}), "(name='requisicionarticulo', options={\n 'verbose_name': 'Requisición ...
# -*- coding: utf-8 -*- import json import logging import azure.functions as func from __app__.commons.blockblob import AzureStorageBlockBlob from __app__.commons.faceapi import AzureCognitiveFaceAPI from __app__.commons.config import Config from __app__.commons.cosmosdb import AssetDB, UserDB config = Config() """ P...
[ "__app__.commons.cosmosdb.AssetDB.gen_random_id", "azure.functions.HttpResponse", "json.dumps", "__app__.commons.config.Config", "__app__.commons.cosmosdb.UserDB", "__app__.commons.blockblob.AzureStorageBlockBlob", "logging.info" ]
[((305, 313), '__app__.commons.config.Config', 'Config', ([], {}), '()\n', (311, 313), False, 'from __app__.commons.config import Config\n'), ((474, 532), 'logging.info', 'logging.info', (['"""createperson function processed a request."""'], {}), "('createperson function processed a request.')\n", (486, 532), False, 'i...
from dsynth.view_datasets.tless import TlessMultiviewDataset from dsynth import MultiviewWarper import numpy as np def test_tless_dataset(): dataset = TlessMultiviewDataset(obj_id=2, unit_test=True) ibr = MultiviewWarper(dataset) R = np.reshape(dataset[1].cam_R, (3,3)).astype(np.float32) t = np.float...
[ "dsynth.MultiviewWarper", "numpy.reshape", "numpy.float32", "dsynth.view_datasets.tless.TlessMultiviewDataset" ]
[((156, 203), 'dsynth.view_datasets.tless.TlessMultiviewDataset', 'TlessMultiviewDataset', ([], {'obj_id': '(2)', 'unit_test': '(True)'}), '(obj_id=2, unit_test=True)\n', (177, 203), False, 'from dsynth.view_datasets.tless import TlessMultiviewDataset\n'), ((214, 238), 'dsynth.MultiviewWarper', 'MultiviewWarper', (['da...
import unittest from katas.kyu_6.which_are_in import in_array class InArrayTestCase(unittest.TestCase): def test_equals(self): self.assertEqual(in_array( ['live', 'arp', 'strong'], ['lively', 'alive', 'harp', 'sharp', 'armstrong']), ['arp', 'live', 'strong'])
[ "katas.kyu_6.which_are_in.in_array" ]
[((159, 249), 'katas.kyu_6.which_are_in.in_array', 'in_array', (["['live', 'arp', 'strong']", "['lively', 'alive', 'harp', 'sharp', 'armstrong']"], {}), "(['live', 'arp', 'strong'], ['lively', 'alive', 'harp', 'sharp',\n 'armstrong'])\n", (167, 249), False, 'from katas.kyu_6.which_are_in import in_array\n')]
import types import sqlite3 from collections import namedtuple from functools import reduce import numpy from glue.lal import LIGOTimeGPS from glue.ligolw import ligolw, lsctables, table, ilwd from glue.ligolw.utils import process def assign_id(row, i): row.simulation_id = ilwd.ilwdchar("sim_inspiral_table:sim_...
[ "glue.ligolw.ligolw.LIGO_LW", "glue.ligolw.table.get_next_id", "collections.namedtuple", "numpy.sqrt", "sqlite3.connect", "numpy.random.random", "glue.ligolw.utils.write_filename", "glue.ligolw.table.get_table", "glue.ligolw.ligolw.Document", "glue.ligolw.table.RowType", "numpy.exp", "numpy.ar...
[((282, 337), 'glue.ligolw.ilwd.ilwdchar', 'ilwd.ilwdchar', (["('sim_inspiral_table:sim_inspiral:%d' % i)"], {}), "('sim_inspiral_table:sim_inspiral:%d' % i)\n", (295, 337), False, 'from glue.ligolw import ligolw, lsctables, table, ilwd\n'), ((2121, 2169), 'numpy.array', 'numpy.array', (['[sampdict[k] for k in keys]', ...
"""Deploys a Cloud Foundry application using a manifest """ from __future__ import print_function import os import sys import json import cf_api from cf_api.deploy_manifest import Deploy from getpass import getpass print('----------') # cloud_controller_url = 'https://api.changeme.com' cloud_controller_url = raw_inpu...
[ "cf_api.deploy_manifest.Deploy.parse_manifest", "getpass.getpass", "cf_api.new_cloud_controller", "sys.exit", "os.path.abspath" ]
[((502, 627), 'cf_api.new_cloud_controller', 'cf_api.new_cloud_controller', (['cloud_controller_url'], {'client_id': '"""cf"""', 'client_secret': '""""""', 'username': 'username', 'password': 'password'}), "(cloud_controller_url, client_id='cf',\n client_secret='', username=username, password=password)\n", (529, 627...
from datetime import date from django.db import models from accounts.models import Account class CleaningRoster(models.Model): """ Model representing a randomly-selected roster for the room's cleaning """ # Date where the people were selected date = models.DateField(auto_now_add=True) clean...
[ "datetime.date.today", "django.db.models.DateField", "django.db.models.ManyToManyField" ]
[((274, 309), 'django.db.models.DateField', 'models.DateField', ([], {'auto_now_add': '(True)'}), '(auto_now_add=True)\n', (290, 309), False, 'from django.db import models\n'), ((326, 357), 'django.db.models.ManyToManyField', 'models.ManyToManyField', (['Account'], {}), '(Account)\n', (348, 357), False, 'from django.db...
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import itertools import logging import os from collections import defaultdict from dataclasses import dataclass from typing import Dict, Iterable, Set, Type from pants.backend.python.targ...
[ "logging.getLogger", "dataclasses.dataclass", "os.path.split", "pants.engine.unions.UnionRule", "itertools.chain.from_iterable", "pants.base.specs.MaybeEmptyDescendantAddresses", "collections.defaultdict", "pants.engine.rules.collect_rules", "pants.engine.fs.PathGlobs", "pants.core.goals.tailor.Pu...
[((943, 970), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (960, 970), False, 'import logging\n'), ((974, 996), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (983, 996), False, 'from dataclasses import dataclass\n'), ((1770, 1786), 'collections.def...
import torch from ..kernels import mask as mask_cuda class OpMask(torch.autograd.Function): @staticmethod def forward(ctx, x : torch.Tensor, mask : torch.Tensor, value : float) -> torch.Tensor: assert x.is_contiguous() and x.is_cuda and x.dtype == torch.float16 and x.ndim == 3 assert mask.is_co...
[ "torch.cuda.current_stream", "torch.scalar_tensor" ]
[((2281, 2339), 'torch.scalar_tensor', 'torch.scalar_tensor', (['value'], {'device': 'x.device', 'dtype': 'x.dtype'}), '(value, device=x.device, dtype=x.dtype)\n', (2300, 2339), False, 'import torch\n'), ((2083, 2110), 'torch.cuda.current_stream', 'torch.cuda.current_stream', ([], {}), '()\n', (2108, 2110), False, 'imp...
import random import time import requests from urllib.parse import urlparse import os import ctypes import time as t import shutil from datetime import datetime from screeninfo import get_monitors from infi.systray import SysTrayIcon if not os.path.exists(os.getcwd()+"\Image"): os.mkdir("Image") mratio = get_moni...
[ "ctypes.windll.user32.SystemParametersInfoW", "random.choice", "urllib.parse.urlparse", "shutil.copyfileobj", "os.path.splitext", "time.sleep", "requests.get", "os.getcwd", "datetime.datetime.now", "os.mkdir", "infi.systray.SysTrayIcon", "screeninfo.get_monitors" ]
[((2293, 2307), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (2305, 2307), False, 'from datetime import datetime\n'), ((2476, 2539), 'infi.systray.SysTrayIcon', 'SysTrayIcon', (['"""icon.ico"""', '"""Auto Wallpaper Updater"""', 'menu_options'], {}), "('icon.ico', 'Auto Wallpaper Updater', menu_options)\n"...
import numpy as np import fcl import torch # R = np.array([[0.0, -1.0, 0.0], # [1.0, 0.0, 0.0], # [0.0, 0.0, 1.0]]) R = np.array([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]) T = np.array([1.0, 1.865, 0]) g1 = fcl.Box(1,2,3) t1 = fcl.Transform() o1 = ...
[ "fcl.Cylinder", "fcl.update", "matplotlib.pyplot.show", "fcl.Transform", "fcl.collide", "torch.stack", "fcl.CollisionObject", "numpy.array", "matplotlib.pyplot.scatter", "fcl.CollisionRequest", "torch.zeros_like", "fcl.Box", "torch.linspace", "fcl.CollisionResult" ]
[((151, 212), 'numpy.array', 'np.array', (['[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]'], {}), '([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]])\n', (159, 212), True, 'import numpy as np\n'), ((247, 272), 'numpy.array', 'np.array', (['[1.0, 1.865, 0]'], {}), '([1.0, 1.865, 0])\n', (255, 272), True, 'impor...
# -*- coding: utf-8 -*- """ router structs module. """ from werkzeug.routing import Map from pyrin.core.structs import DTO class CoreURLMap(Map): """ core url map class. this extends the `Map` class to add some functionalities to it. """ def __init__(self, rules=None, default_subdomain="", cha...
[ "pyrin.core.structs.DTO" ]
[((2878, 2883), 'pyrin.core.structs.DTO', 'DTO', ([], {}), '()\n', (2881, 2883), False, 'from pyrin.core.structs import DTO\n')]
import torch import torch.nn as nn from torch import autograd from Configs import Global_Config def calc_Dw_loss(probs: torch.Tensor, label: int): labels = torch.full((probs.size(0),), label, dtype=torch.float, device=Global_Config.device) criterion = nn.BCELoss() adversarial_loss = criterion(probs, labe...
[ "torch.nn.BCELoss" ]
[((262, 274), 'torch.nn.BCELoss', 'nn.BCELoss', ([], {}), '()\n', (272, 274), True, 'import torch.nn as nn\n')]
# GENERATED FILE - DO NOT EDIT THIS FILE UNLESS YOU ARE A WIZZARD #pylint: skip-file from heat.engine import properties from heat.engine import constraints from heat.engine import attributes from heat.common.i18n import _ from avi.heat.avi_resource import AviResource from avi.heat.avi_resource import AviNestedResource...
[ "heat.common.i18n._" ]
[((490, 495), 'heat.common.i18n._', '_', (['""""""'], {}), "('')\n", (491, 495), False, 'from heat.common.i18n import _\n'), ((637, 642), 'heat.common.i18n._', '_', (['""""""'], {}), "('')\n", (638, 642), False, 'from heat.common.i18n import _\n'), ((782, 841), 'heat.common.i18n._', '_', (['"""(Introduced in: 17.2.2) P...
from typing import List import torch import torch.nn as nn import torch.nn.functional as F from . import pointnet2_utils class StackSAModuleMSG(nn.Module): def __init__(self, *, radii: List[float], nsamples: List[int], mlps: List[List[int]], use_xyz: bool = True, pool_method='max_pool'): ...
[ "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.init.constant_", "torch.nn.ModuleList", "torch.nn.Sequential", "torch.nn.init.kaiming_normal_", "torch.nn.Conv2d", "torch.sum", "torch.nn.Linear", "torch.clamp", "torch.cat" ]
[((763, 778), 'torch.nn.ModuleList', 'nn.ModuleList', ([], {}), '()\n', (776, 778), True, 'import torch.nn as nn\n'), ((799, 814), 'torch.nn.ModuleList', 'nn.ModuleList', ([], {}), '()\n', (812, 814), True, 'import torch.nn as nn\n'), ((3674, 3709), 'torch.cat', 'torch.cat', (['new_features_list'], {'dim': '(1)'}), '(n...
# Generated by Django 2.2.10 on 2020-09-09 08:24 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('engine', '0024_change_shape_type_choices'), ] operations = [ migrations.AddField( model_name='job', name='version',...
[ "django.db.models.PositiveIntegerField" ]
[((339, 377), 'django.db.models.PositiveIntegerField', 'models.PositiveIntegerField', ([], {'default': '(0)'}), '(default=0)\n', (366, 377), False, 'from django.db import migrations, models\n'), ((504, 542), 'django.db.models.PositiveIntegerField', 'models.PositiveIntegerField', ([], {'default': '(1)'}), '(default=1)\n...
"""User endpoints.""" from django.conf import settings from django.contrib.auth import authenticate, login from django.contrib.sites.shortcuts import get_current_site from django.core.mail import send_mail from django.template import loader from django.template.loader import render_to_string from django.utils.encoding ...
[ "api_v1.utils.tokens.account_activation_token.make_token", "api_v1.serializers.user.UsersSerializer", "api_v1.models.User.objects.all", "django.contrib.auth.login", "api_v1.utils.tokens.account_activation_token.check_token", "rest_framework.response.Response", "api_v1.models.User.objects.get", "django...
[((911, 929), 'api_v1.models.User.objects.all', 'User.objects.all', ([], {}), '()\n', (927, 929), False, 'from api_v1.models import Role, User\n'), ((1366, 1400), 'api_v1.serializers.user.UsersSerializer', 'UsersSerializer', ([], {'data': 'request.data'}), '(data=request.data)\n', (1381, 1400), False, 'from api_v1.seri...
# -*- coding: utf-8 -*- import librosa.display import librosa as lb import os import numpy as np import pickle import matplotlib.pyplot as plt import time import multiprocessing import itertools import sys from collections import OrderedDict from more_itertools import unique_everseen from scipy.stats import skew from ...
[ "librosa.feature.poly_features", "librosa.feature.zero_crossing_rate", "multiprocessing.cpu_count", "numpy.array", "librosa.feature.spectral_centroid", "librosa.feature.spectral_bandwidth", "librosa.feature.spectral_contrast", "librosa.load", "numpy.arange", "numpy.mean", "itertools.repeat", "...
[((881, 900), 'numpy.array', 'np.array', (['splittime'], {}), '(splittime)\n', (889, 900), True, 'import numpy as np\n'), ((1169, 1188), 'numpy.array', 'np.array', (['splitfreq'], {}), '(splitfreq)\n', (1177, 1188), True, 'import numpy as np\n'), ((7649, 7670), 'librosa.effects.hpss', 'lb.effects.hpss', (['song'], {}),...
import requests import pandas as pd import pandas.io.json import json import ast city_name = '深圳市' # city_name = '成都市' # city_name = '北京市' # anyone using this code needs to get their own keys from amap.com api_key_web_service = open('../api_key_web_service.txt', encoding='utf-8').read() # Web Service (Web服务) api_key_...
[ "json.loads", "requests.post", "json.dumps", "requests.get", "ast.literal_eval", "pandas.DataFrame" ]
[((817, 853), 'requests.get', 'requests.get', ([], {'url': 'URL', 'params': 'PARAMS'}), '(url=URL, params=PARAMS)\n', (829, 853), False, 'import requests\n'), ((1455, 1491), 'requests.get', 'requests.get', ([], {'url': 'URL', 'params': 'PARAMS'}), '(url=URL, params=PARAMS)\n', (1467, 1491), False, 'import requests\n'),...
import json import os from api_swgoh_help import api_swgoh_help, settings from env import get_env from initialise_data_structures import initialise_data_structures from texttable import Texttable from data_lookups import mod_set_stats, mod_slots, unit_stats, primary_stat_names_map saved_data = initialise_data_structur...
[ "texttable.Texttable", "api_swgoh_help.api_swgoh_help", "json.dump", "initialise_data_structures.initialise_data_structures", "api_swgoh_help.settings", "os.path.isfile", "json.load", "env.get_env" ]
[((296, 324), 'initialise_data_structures.initialise_data_structures', 'initialise_data_structures', ([], {}), '()\n', (322, 324), False, 'from initialise_data_structures import initialise_data_structures\n'), ((631, 640), 'env.get_env', 'get_env', ([], {}), '()\n', (638, 640), False, 'from env import get_env\n'), ((10...
import streamlit as st from streamlit_yellowbrick import st_yellowbrick def run_regression(): with st.sidebar.form(key="regression_form"): regression_visualizers = st.multiselect( "Choose Regression Visualizers", [ "Residuals Plot", "Prediction Erro...
[ "streamlit.checkbox", "yellowbrick.datasets.load_concrete", "yellowbrick.regressor.PredictionError", "yellowbrick.regressor.AlphaSelection", "streamlit.markdown", "sklearn.linear_model.LassoCV", "sklearn.linear_model.Lasso", "streamlit.beta_columns", "sklearn.model_selection.train_test_split", "ye...
[((6089, 6104), 'yellowbrick.datasets.load_concrete', 'load_concrete', ([], {}), '()\n', (6102, 6104), False, 'from yellowbrick.datasets import load_concrete\n'), ((6182, 6236), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'y'], {'test_size': '(0.2)', 'random_state': '(42)'}), '(X, y, test_siz...
# Generated by Django 2.2.20 on 2021-05-06 13:45 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("curation_portal", "0008_add_flags")] operations = [ migrations.AddField( model_name="curationresult", name="flag_low_pext", ...
[ "django.db.models.BooleanField" ]
[((334, 368), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)'}), '(default=False)\n', (353, 368), False, 'from django.db import migrations, models\n'), ((518, 552), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)'}), '(default=False)\n', (537, 552), F...
import pytest as pt from dataclass_tools.tools import deserialize_dataclass from gl_hsc_scantling.elements import StructuralElement from .exp_output import ExpStiffenerElement, ExpStiffenerSection from .fixtures_laminates import * from .fixtures_stiffener_sections import * from .fixtures_vessel import * @pt.fixture ...
[ "dataclass_tools.tools.deserialize_dataclass" ]
[((1161, 1301), 'dataclass_tools.tools.deserialize_dataclass', 'deserialize_dataclass', ([], {'dct': 'stiffener_bottom_01_input', 'dataclass': 'StructuralElement', 'build_instance': '(True)', 'dict_of_collections': 'collections'}), '(dct=stiffener_bottom_01_input, dataclass=\n StructuralElement, build_instance=True,...
from django.contrib.auth.decorators import login_required from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse, Http404 from django.core.exceptions import PermissionDenied from django.db import transaction from django.db.models import Count, Sum, F, Func from datetime import date...
[ "django.shortcuts.render", "django.core.exceptions.PermissionDenied", "postgresqleu.util.request.get_int_or_error", "datetime.datetime.utcnow", "django.db.models.Count", "django.http.HttpResponse", "django.shortcuts.get_object_or_404", "json.dumps", "postgresqleu.util.db.exec_to_dict", "django.db....
[((4615, 4655), 'postgresqleu.util.request.get_int_or_error', 'get_int_or_error', (['request.POST', '"""slotid"""'], {}), "(request.POST, 'slotid')\n", (4631, 4655), False, 'from postgresqleu.util.request import get_int_or_error\n'), ((4668, 4707), 'postgresqleu.util.request.get_int_or_error', 'get_int_or_error', (['re...
from rest_framework import authentication from chat.models import Users from .serializers import UsersSerializer from rest_framework import viewsets class UsersViewSet(viewsets.ModelViewSet): serializer_class = UsersSerializer authentication_classes = ( authentication.SessionAuthentication, au...
[ "chat.models.Users.objects.all" ]
[((375, 394), 'chat.models.Users.objects.all', 'Users.objects.all', ([], {}), '()\n', (392, 394), False, 'from chat.models import Users\n')]
from flask import Flask, render_template, jsonify, request, session, Blueprint, redirect, flash from flask_restful import reqparse, abort, Api, Resource from flask_login import login_required, logout_user, current_user, login_user, LoginManager from google.cloud import datastore import datetime from flask_admin import ...
[ "flask.render_template", "flask_login.LoginManager", "flask.request.args.get", "flask.Flask", "session.db_session.query", "forms.LoginForm", "flask.jsonify", "flask_restful.reqparse.RequestParser", "flask.flash", "models.OrderItem", "google.cloud.datastore.Client", "flask_admin.Admin", "flas...
[((773, 791), 'google.cloud.datastore.Client', 'datastore.Client', ([], {}), '()\n', (789, 791), False, 'from google.cloud import datastore\n'), ((800, 815), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (805, 815), False, 'from flask import Flask, render_template, jsonify, request, session, Blueprint, re...
# -*- coding: utf-8 -*- """ Overall wrapper class for AMBER """ import tensorflow as tf from keras import backend as K try: from tensorflow import Session except ImportError: from tensorflow.compat.v1 import Session tf.compat.v1.disable_eager_execution() import os from . import getter class Amber: ...
[ "os.path.join", "tensorflow.compat.v1.disable_eager_execution", "keras.backend.set_session", "tensorflow.compat.v1.Session" ]
[((232, 270), 'tensorflow.compat.v1.disable_eager_execution', 'tf.compat.v1.disable_eager_execution', ([], {}), '()\n', (268, 270), True, 'import tensorflow as tf\n'), ((1114, 1123), 'tensorflow.compat.v1.Session', 'Session', ([], {}), '()\n', (1121, 1123), False, 'from tensorflow.compat.v1 import Session\n'), ((1149, ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Aug 30 10:45:11 2021 This script was used to change the filenames of already generated prompts, that had repetitions of over 10 character. @author: tavastm1 """ import re import os path = 'prompts/GamesAsArt/' #file_start= 'thinking_game_' # ...
[ "os.rename", "os.listdir", "re.compile" ]
[((470, 486), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (480, 486), False, 'import os\n'), ((1352, 1368), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (1362, 1368), False, 'import os\n'), ((746, 769), 're.compile', 're.compile', (['"""(.+?)\\\\1+"""'], {}), "('(.+?)\\\\1+')\n", (756, 769), Fals...
import os from io import StringIO from django.conf import settings from django.core.management import call_command from django.core.management.base import CommandError from django.test import TestCase class PipelineTestCase(TestCase): def setUp(self): self.file_path = os.path.join(settings.STATIC_ROOT, "...
[ "os.path.isfile", "io.StringIO", "os.path.join", "os.remove" ]
[((284, 338), 'os.path.join', 'os.path.join', (['settings.STATIC_ROOT', '"""staticfiles.json"""'], {}), "(settings.STATIC_ROOT, 'staticfiles.json')\n", (296, 338), False, 'import os\n'), ((350, 380), 'os.path.isfile', 'os.path.isfile', (['self.file_path'], {}), '(self.file_path)\n', (364, 380), False, 'import os\n'), (...
import numpy as np from PIL import Image from skimage import color from skimage.feature import hog from pelops.features.feature_producer import FeatureProducer class HOGFeatureProducer(FeatureProducer): def __init__(self, chip_producer, image_size=(224,224), cells=(16, 16), orientations=8, histogram_bins_per_ch...
[ "numpy.histogram", "numpy.array", "numpy.concatenate", "numpy.full", "skimage.feature.hog" ]
[((907, 972), 'numpy.full', 'np.full', ([], {'shape': '(3 * self.histogram_bins_per_channel)', 'fill_value': '(-1)'}), '(shape=3 * self.histogram_bins_per_channel, fill_value=-1)\n', (914, 972), True, 'import numpy as np\n'), ((1798, 1935), 'skimage.feature.hog', 'hog', (['img'], {'orientations': 'self.orientations', '...
import numpy as np arr = np.random.choice([6, 8, 3, 1, 5], p=[0.0, 0.5, 0.2, 0.2, 0.1], size=(100)) print(arr) arr = np.random.choice([6, 8, 3, 1, 5], p=[0.0, 0.5, 0.2, 0.2, 0.1], size=100) print(arr) arr = np.random.choice([6, 8, 3, 1, 5], p=[0.0, 0.5, 0.2, 0.2, 0.1], size=(5, 10)) print(arr)
[ "numpy.random.choice" ]
[((28, 100), 'numpy.random.choice', 'np.random.choice', (['[6, 8, 3, 1, 5]'], {'p': '[0.0, 0.5, 0.2, 0.2, 0.1]', 'size': '(100)'}), '([6, 8, 3, 1, 5], p=[0.0, 0.5, 0.2, 0.2, 0.1], size=100)\n', (44, 100), True, 'import numpy as np\n'), ((121, 193), 'numpy.random.choice', 'np.random.choice', (['[6, 8, 3, 1, 5]'], {'p': ...
import toolbox as tb from structures import IP, IS from statistics import Statistics from kanji import Kanji S = Statistics()
[ "statistics.Statistics" ]
[((114, 126), 'statistics.Statistics', 'Statistics', ([], {}), '()\n', (124, 126), False, 'from statistics import Statistics\n')]
#!/usr/bin/python3 # get_connection_meta.py: get connection metadata import sys import mysql.connector import cookbook try: conn = cookbook.connect() except mysql.connector.Error as e: print("Error code: %s" % e.errno) print("Error message: %s" % e.msg) sys.exit(1) try: #@ _CURRENT_DATABASE_ cursor = conn....
[ "cookbook.connect", "sys.exit" ]
[((135, 153), 'cookbook.connect', 'cookbook.connect', ([], {}), '()\n', (151, 153), False, 'import cookbook\n'), ((264, 275), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (272, 275), False, 'import sys\n'), ((690, 701), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (698, 701), False, 'import sys\n')]
from utils.initLog import initLog def main_function(): logger = initLog('dev', '/home/kuan/DL_template') logger.critical('CRITICAL') logger.fatal('FATAL') logger.error('ERROR') logger.warning('WARNING') logger.info('INFO') logger.debug('DEBUG') if __name__ == '__main__': main_function()
[ "utils.initLog.initLog" ]
[((68, 108), 'utils.initLog.initLog', 'initLog', (['"""dev"""', '"""/home/kuan/DL_template"""'], {}), "('dev', '/home/kuan/DL_template')\n", (75, 108), False, 'from utils.initLog import initLog\n')]
import asyncio import asyncssh import sys import os import crypt from importlib.util import find_spec class MySSHServerSession(asyncssh.SSHServerSession): def __init__(self): self._input = '' self._data = None self.devtype = 'iosxr' self.run_as_shell = False self.prompt = '...
[ "importlib.util.find_spec", "crypt.crypt", "asyncio.get_event_loop", "asyncssh.listen" ]
[((3295, 3319), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (3317, 3319), False, 'import asyncio\n'), ((3166, 3265), 'asyncssh.listen', 'asyncssh.listen', (['""""""', '(10000)'], {'server_factory': 'MySSHServer', 'server_host_keys': "['/tmp/ssh_host_key']"}), "('', 10000, server_factory=MySSHS...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # The MIT License (MIT) # # Grove Base Hat for the Raspberry Pi, used to connect grove sensors. # Copyright (C) 2018 Seeed Technology Co.,Ltd. ''' This is the code for - `Grove - Sound Sensor <https://www.seeedstudio.com/Grove-Sound-Sensor-p-752.html>`_ Examples: ...
[ "time.sleep", "grove.helper.SlotHelper", "grove.adc.ADC" ]
[((1323, 1349), 'grove.helper.SlotHelper', 'SlotHelper', (['SlotHelper.ADC'], {}), '(SlotHelper.ADC)\n', (1333, 1349), False, 'from grove.helper import SlotHelper\n'), ((999, 1004), 'grove.adc.ADC', 'ADC', ([], {}), '()\n', (1002, 1004), False, 'from grove.adc import ADC\n'), ((1522, 1537), 'time.sleep', 'time.sleep', ...
""" Adding simple implementations or interfaces to some data types that are missing from the standard library. """ import lazy_import from .graph_common import (Edge, EdgeExistedError, InvariantError, Node, NodeIndexError) lattice = lazy_import.lazy_module("seutil.ds.lattice") trie = lazy_...
[ "lazy_import.lazy_module" ]
[((263, 307), 'lazy_import.lazy_module', 'lazy_import.lazy_module', (['"""seutil.ds.lattice"""'], {}), "('seutil.ds.lattice')\n", (286, 307), False, 'import lazy_import\n'), ((315, 356), 'lazy_import.lazy_module', 'lazy_import.lazy_module', (['"""seutil.ds.trie"""'], {}), "('seutil.ds.trie')\n", (338, 356), False, 'imp...
"""Support for MQTT platform config setup.""" from __future__ import annotations import voluptuous as vol from homeassistant.const import ( CONF_CLIENT_ID, CONF_DISCOVERY, CONF_PASSWORD, CONF_PORT, CONF_PROTOCOL, CONF_USERNAME, Platform, ) from homeassistant.helpers import config_validatio...
[ "voluptuous.Inclusive", "voluptuous.Any", "voluptuous.Range", "voluptuous.Optional", "voluptuous.Coerce", "voluptuous.All", "voluptuous.In" ]
[((1880, 1958), 'voluptuous.All', 'vol.All', (['cv.ensure_list', '[alarm_control_panel_platform.PLATFORM_SCHEMA_MODERN]'], {}), '(cv.ensure_list, [alarm_control_panel_platform.PLATFORM_SCHEMA_MODERN])\n', (1887, 1958), True, 'import voluptuous as vol\n'), ((2046, 2118), 'voluptuous.All', 'vol.All', (['cv.ensure_list', ...
import aiohttp import discord from discord.ext import commands class Silphroad(commands.Cog): """ Commands related to Silphroad. """ def __init__(self, bot): self.bot = bot @commands.command( aliases=["Silphcard", "Scard", "scard", "s-card", "S-card", "silph", "Silph", "Silphroad...
[ "aiohttp.ClientSession", "discord.Colour.orange", "discord.Colour.dark_red", "discord.ext.commands.command" ]
[((206, 331), 'discord.ext.commands.command', 'commands.command', ([], {'aliases': "['Silphcard', 'Scard', 'scard', 's-card', 'S-card', 'silph', 'Silph',\n 'Silphroad', 'silphroad']"}), "(aliases=['Silphcard', 'Scard', 'scard', 's-card', 'S-card',\n 'silph', 'Silph', 'Silphroad', 'silphroad'])\n", (222, 331), Fal...
from zope.interface import implementer from rtmlparse.irtml import ITemplate from rtmlparse.elements import * @implementer(ITemplate) class SimplePhotometry(object): name = "SimplePhotometry" type = Setup def __init__(self, element=None, rtml=None): # define our elements self.setup = None...
[ "zope.interface.implementer" ]
[((113, 135), 'zope.interface.implementer', 'implementer', (['ITemplate'], {}), '(ITemplate)\n', (124, 135), False, 'from zope.interface import implementer\n')]
""" 某些网络数据在一定周期内不会发生变化。如股票代码列表。如果在 同一个会话中,使用funtools的cache机制,可以避免多次下载同 一数据。但计划任务程序中,由于每次运行会话不同,如果需要使 用网络数据,就需要多次从网络下载。数据代理类使用本地文件持 久化存储,在特点时点自动更新,确保数据时效性,同时减少网络 下载,提高运行效率。 数据代理主要用于计划任务程序。适用于每天变动,但在24小时内, 数据一直为静态的网络数据采集。如股票列表等。 也可用于频繁访问,但单次查询需要较长时间的数据提取。 读取代理数据,直接使用类的`read`方法,少数需要进一步转换。 好处: 1、避免当天重复下载同一网络数据 ...
[ "pandas.tseries.offsets.Week", "os.path.exists", "logbook.Logger", "pandas.tseries.offsets.Minute", "hashlib.md5", "pandas.tseries.offsets.MonthBegin", "cnswd.utils.data_root", "pickle.load", "pandas.tseries.offsets.BDay", "os.path.getmtime", "pandas.isnull", "pickle.dump", "pandas.tseries.o...
[((745, 769), 'logbook.Logger', 'logbook.Logger', (['__name__'], {}), '(__name__)\n', (759, 769), False, 'import logbook\n'), ((782, 803), 'cnswd.utils.data_root', 'data_root', (['"""webcache"""'], {}), "('webcache')\n", (791, 803), False, 'from cnswd.utils import data_root\n'), ((1211, 1216), 'hashlib.md5', 'md5', ([]...
import setuptools setuptools.setup( name="nix-cage", version="0.1", description="Sandboxed environments with bwarp and nix-shell", scripts=["nix-cage"], )
[ "setuptools.setup" ]
[((19, 157), 'setuptools.setup', 'setuptools.setup', ([], {'name': '"""nix-cage"""', 'version': '"""0.1"""', 'description': '"""Sandboxed environments with bwarp and nix-shell"""', 'scripts': "['nix-cage']"}), "(name='nix-cage', version='0.1', description=\n 'Sandboxed environments with bwarp and nix-shell', scripts...
""" Example of a simple genetic algorithm based on DeepNEAT Miikkulainen, Risto, et al. "Evolving deep neural networks." Artificial Intelligence in the Age of Neural Networks and Brain Computing. Academic Press, 2019. 293-312. """ import time import traceback import numpy as np import...
[ "nord.neural_nets.LocalEvaluator", "nord.design.metaheuristics.genetics.neat.Innovation", "numpy.random.choice", "numpy.argmax", "nord.utils.assure_reproducibility", "nord.design.metaheuristics.genetics.neat.Genome", "traceback.print_exc", "time.time" ]
[((503, 527), 'nord.utils.assure_reproducibility', 'assure_reproducibility', ([], {}), '()\n', (525, 527), False, 'from nord.utils import assure_reproducibility\n'), ((1248, 1291), 'nord.neural_nets.LocalEvaluator', 'LocalEvaluator', (['torch.optim.Adam', '{}', '(False)'], {}), '(torch.optim.Adam, {}, False)\n', (1262,...
import sys import os import random import re import time import torch from torch.autograd import Variable from torch import optim import torch.nn as nn from static_model import StaticModel from dyna_model import DynamicModel from data_utils import * def init_command_line(argv): from argparse import Arg...
[ "argparse.ArgumentParser", "torch.load", "torch.nn.NLLLoss", "torch.autograd.Variable", "time.time" ]
[((366, 387), 'argparse.ArgumentParser', 'ArgumentParser', (['usage'], {}), '(usage)\n', (380, 387), False, 'from argparse import ArgumentParser\n'), ((4348, 4359), 'time.time', 'time.time', ([], {}), '()\n', (4357, 4359), False, 'import time\n'), ((5335, 5347), 'torch.nn.NLLLoss', 'nn.NLLLoss', ([], {}), '()\n', (5345...
""" Handles the operation of the options menu. @author: RichardFlanagan - A00193644 @version: 16 April 2014 """ import pygame import sys class OptionsMenu(): def __init__(self, params, debugParam): """ Initialize variables. @param params: The list of parameter objects. """ ...
[ "pygame.quit", "pygame.event.get", "pygame.display.flip", "pygame.mouse.get_pos", "pygame.mouse.set_visible", "sys.exit", "pygame.image.load", "pygame.font.SysFont" ]
[((580, 610), 'pygame.mouse.set_visible', 'pygame.mouse.set_visible', (['(True)'], {}), '(True)\n', (604, 610), False, 'import pygame\n'), ((1383, 1428), 'pygame.image.load', 'pygame.image.load', (['"""../res/images/b_back.png"""'], {}), "('../res/images/b_back.png')\n", (1400, 1428), False, 'import pygame\n'), ((5113,...
# Copyright 2020 The HuggingFace Team. 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...
[ "torch.tensor", "torch.zeros_like", "torch.bernoulli" ]
[((4070, 4116), 'torch.zeros_like', 'torch.zeros_like', (['targets'], {'dtype': 'torch.float64'}), '(targets, dtype=torch.float64)\n', (4086, 4116), False, 'import torch\n'), ((3520, 3554), 'torch.tensor', 'torch.tensor', (['v'], {'dtype': 'torch.int64'}), '(v, dtype=torch.int64)\n', (3532, 3554), False, 'import torch\...
#!flask/bin/python import flask.ext.whooshalchemy from flask import Flask from flask_bootstrap import Bootstrap from flask_appconfig import AppConfig from flask.ext.sqlalchemy import SQLAlchemy from app.config import SQLALCHEMY_DATABASE_URI, SECRET_KEY, WHOOSH_BASE app = Flask(__name__) AppConfig(app) Bootstrap(a...
[ "flask_bootstrap.Bootstrap", "flask.ext.sqlalchemy.SQLAlchemy", "flask_appconfig.AppConfig", "flask.Flask" ]
[((278, 293), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (283, 293), False, 'from flask import Flask\n'), ((294, 308), 'flask_appconfig.AppConfig', 'AppConfig', (['app'], {}), '(app)\n', (303, 308), False, 'from flask_appconfig import AppConfig\n'), ((309, 323), 'flask_bootstrap.Bootstrap', 'Bootstrap'...
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-06-15 15:08 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('projects', '0047_auto_20160614_1201'), ] operations = [ migrations.AlterMode...
[ "django.db.migrations.AlterModelOptions", "django.db.models.IntegerField" ]
[((300, 482), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""projecttemplate"""', 'options': "{'ordering': ['order', 'name'], 'verbose_name': 'project template',\n 'verbose_name_plural': 'project templates'}"}), "(name='projecttemplate', options={'ordering': [\n 'order...
import os import sys from copy import copy from contextlib import contextmanager from subprocess import Popen, PIPE @contextmanager def cd(path): old_dir = os.getcwd() os.chdir(path) try: yield finally: os.chdir(old_dir) @contextmanager def sysargs(args): sys_a...
[ "os.chdir", "subprocess.Popen", "copy.copy", "os.getcwd" ]
[((171, 182), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (180, 182), False, 'import os\n'), ((188, 202), 'os.chdir', 'os.chdir', (['path'], {}), '(path)\n', (196, 202), False, 'import os\n'), ((326, 340), 'copy.copy', 'copy', (['sys.argv'], {}), '(sys.argv)\n', (330, 340), False, 'from copy import copy\n'), ((251, 268...
import pymysql import pandas as pd import pickle import numpy as np import databaseInfo as db databaseName = 'root' databasePasswd = '<PASSWORD>' def user_info_query(user_id): conn = pymysql.connect(host=db.databaseAddress, user=db.databaseLoginName, password=db.databasePasswd, database=db.databaseName) cur =...
[ "pandas.read_sql", "numpy.zeros", "pymysql.connect", "numpy.reshape" ]
[((189, 314), 'pymysql.connect', 'pymysql.connect', ([], {'host': 'db.databaseAddress', 'user': 'db.databaseLoginName', 'password': 'db.databasePasswd', 'database': 'db.databaseName'}), '(host=db.databaseAddress, user=db.databaseLoginName,\n password=db.databasePasswd, database=db.databaseName)\n', (204, 314), False...
""" This file download the latest data for Myanmar """ import pandas as pd from autumn.settings import INPUT_DATA_PATH from pathlib import Path INPUT_DATA_PATH = Path(INPUT_DATA_PATH) COVID_MMR_TESTING_CSV = INPUT_DATA_PATH / "covid_mmr" / "cases.csv" URL = "https://docs.google.com/spreadsheets/d/1VeUof9_-s0bsndo8t...
[ "pandas.read_csv", "pathlib.Path" ]
[((164, 185), 'pathlib.Path', 'Path', (['INPUT_DATA_PATH'], {}), '(INPUT_DATA_PATH)\n', (168, 185), False, 'from pathlib import Path\n'), ((458, 474), 'pandas.read_csv', 'pd.read_csv', (['URL'], {}), '(URL)\n', (469, 474), True, 'import pandas as pd\n')]
""" Dual Doppler Lobe Utility ------------------------------------------------------ Example for using the utily to plot up dual doppler lobes. Can easily be used on cartopy maps using code-block:: python tiler = Stamen('terrain-background') mercator = tiler.crs fig = plt.figure() ax = fig.add_subplot...
[ "matplotlib.pyplot.text", "matplotlib.pyplot.figure", "radtraq.utils.calculate_dual_dop_lobes", "matplotlib.pyplot.show" ]
[((611, 652), 'radtraq.utils.calculate_dual_dop_lobes', 'radtraq.utils.calculate_dual_dop_lobes', (['d'], {}), '(d)\n', (649, 652), False, 'import radtraq\n'), ((660, 672), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (670, 672), True, 'import matplotlib.pyplot as plt\n'), ((887, 897), 'matplotlib.pyplot...
import json import os import time def get_cache_path(): home = os.path.expanduser("~") return home + '/package_list.cdncache' def time_has_passed(last_time, time_now): time_is_blank = time_now is None or last_time is None if time_is_blank: return time_is_blank time_difference = int(time.t...
[ "json.dumps", "time.time", "os.path.expanduser" ]
[((68, 91), 'os.path.expanduser', 'os.path.expanduser', (['"""~"""'], {}), "('~')\n", (86, 91), False, 'import os\n'), ((314, 325), 'time.time', 'time.time', ([], {}), '()\n', (323, 325), False, 'import time\n'), ((722, 745), 'json.dumps', 'json.dumps', (['packageList'], {}), '(packageList)\n', (732, 745), False, 'impo...
#!/usr/bin/python # Classification (U) """Program: gitmerge_get_untracked.py Description: Unit testing of gitmerge.get_untracked in git_class.py. Usage: test/unit/git_class/gitmerge_get_untracked.py Arguments: """ # Libraries and Global Variables # Standard import sys import os if sys.vers...
[ "unittest.main", "collections.namedtuple", "git_class.GitMerge", "os.getcwd" ]
[((457, 468), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (466, 468), False, 'import os\n'), ((3309, 3324), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3322, 3324), False, 'import unittest\n'), ((2254, 2346), 'git_class.GitMerge', 'git_class.GitMerge', (['self.repo_name', 'self.git_dir', 'self.url', 'self.bran...
# # locally sensitive hashing code # from collections import defaultdict import numpy as np import xxhash import sys import pyximport pyximport.install() sys.path.insert(0, 'tools') import simcore as csimcore # k-shingles: pairs of adjacent k-length substrings (in order) def shingle(s, k=2): k = min(len(s), k) ...
[ "sys.path.insert", "xxhash.xxh64_intdigest", "pyximport.install", "numpy.uint64", "collections.defaultdict" ]
[((136, 155), 'pyximport.install', 'pyximport.install', ([], {}), '()\n', (153, 155), False, 'import pyximport\n'), ((156, 183), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""tools"""'], {}), "(0, 'tools')\n", (171, 183), False, 'import sys\n'), ((469, 494), 'xxhash.xxh64_intdigest', 'xxhash.xxh64_intdigest', (['x...
# GPLv3 License # # Copyright (C) 2020 Ubisoft # # This program 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 2 of the License, or # (at your option) any later version. # # This program is dis...
[ "logging.getLogger", "bpy.utils.register_classes_factory", "bpy.props.StringProperty", "bpy.props.BoolProperty", "bpy.props.CollectionProperty", "bpy.props.FloatProperty", "os.environ.get", "bpy.props.EnumProperty", "mixer.bl_panels.draw_preferences_ui", "mixer.local_data.get_data_directory", "r...
[((1097, 1124), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1114, 1124), False, 'import logging\n'), ((7963, 8006), 'bpy.utils.register_classes_factory', 'bpy.utils.register_classes_factory', (['classes'], {}), '(classes)\n', (7997, 8006), False, 'import bpy\n'), ((1159, 1174), 'rando...
#!/usr/bin/env python import colorsys import math import time import unicornhathd print("""Ubercorn rainbow 2x1 An example of how to use a 2-wide by 1-tall pair of Ubercorn matrices. Press Ctrl+C to exit! """) unicornhathd.brightness(0.6) # Enable addressing for Ubercorn matrices unicornhathd.enable_addressing...
[ "unicornhathd.show", "unicornhathd.set_pixel", "unicornhathd.brightness", "math.pow", "time.sleep", "unicornhathd.enable_addressing", "colorsys.hsv_to_rgb", "math.sin", "math.cos", "unicornhathd.setup_buffer", "unicornhathd.off", "unicornhathd.setup_display" ]
[((218, 246), 'unicornhathd.brightness', 'unicornhathd.brightness', (['(0.6)'], {}), '(0.6)\n', (241, 246), False, 'import unicornhathd\n'), ((290, 322), 'unicornhathd.enable_addressing', 'unicornhathd.enable_addressing', ([], {}), '()\n', (320, 322), False, 'import unicornhathd\n'), ((372, 405), 'unicornhathd.setup_bu...
#!/usr/bin/env python from __future__ import print_function import numpy as np import cv2 as cv from tests_common import NewOpenCVTests class Bindings(NewOpenCVTests): def test_inheritance(self): bm = cv.StereoBM_create() bm.getPreFilterCap() # from StereoBM bm.getBlockSize() # from Ster...
[ "cv2.StereoBM_create", "cv2.redirectError", "tests_common.NewOpenCVTests.bootstrap", "cv2.imshow", "cv2.ml.Boost_create" ]
[((1341, 1367), 'tests_common.NewOpenCVTests.bootstrap', 'NewOpenCVTests.bootstrap', ([], {}), '()\n', (1365, 1367), False, 'from tests_common import NewOpenCVTests\n'), ((217, 237), 'cv2.StereoBM_create', 'cv.StereoBM_create', ([], {}), '()\n', (235, 237), True, 'import cv2 as cv\n'), ((346, 366), 'cv2.ml.Boost_create...
import json import re import requests import urlparse class Investigate(object): BASE_URL = 'https://investigate.api.opendns.com/' SUPPORTED_DNS_TYPES = [ "A", "NS", "MX", "TXT", "CNAME", ] IP_PATTERN = re.compile(r'(\d{1,3}\.){3}\d{1,3}') DOMAIN_ERR = Valu...
[ "urlparse.urljoin", "json.dumps", "re.compile" ]
[((261, 299), 're.compile', 're.compile', (['"""(\\\\d{1,3}\\\\.){3}\\\\d{1,3}"""'], {}), "('(\\\\d{1,3}\\\\.){3}\\\\d{1,3}')\n", (271, 299), False, 'import re\n'), ((2566, 2620), 'urlparse.urljoin', 'urlparse.urljoin', (["self._uris['categorization']", 'domain'], {}), "(self._uris['categorization'], domain)\n", (2582,...
from .models.type_validator import TypeValidator from .models.typed_list import TypedList from utils.star_class_map import spectral_class_map, oddity_map from config import NMSConfig class StarClass(object): config = TypeValidator(dict) spectral_class_str = TypeValidator(str) spectral_class = TypeValidat...
[ "config.NMSConfig" ]
[((457, 468), 'config.NMSConfig', 'NMSConfig', ([], {}), '()\n', (466, 468), False, 'from config import NMSConfig\n')]
"""Classes related to the ancient-auth authenticator module.""" import calendar from datetime import datetime, timedelta from ancientsolutions.crypttools import rsa, x509 from Crypto.PublicKey import RSA from os.path import exists try: from urlparse import urlparse, urljoin, parse_qs except Exception as e: f...
[ "os.path.exists", "ancientsolutions.crypttools.rsa.UnwrapRSAKey", "token_pb2.TokenCookie", "token_cookie.TokenCookieCodec", "datetime.timedelta", "datetime.datetime.now", "ancientsolutions.crypttools.x509.parse_certificate", "token_cookie.NoKeyException", "token_cookie.AuthTokenResponseCodec", "ur...
[((3228, 3251), 'token_pb2.TokenCookie', 'token_pb2.TokenCookie', ([], {}), '()\n', (3249, 3251), False, 'import token_pb2\n'), ((4021, 4044), 'token_pb2.TokenCookie', 'token_pb2.TokenCookie', ([], {}), '()\n', (4042, 4044), False, 'import token_pb2\n'), ((5690, 5718), 'token_pb2.AuthTokenRequest', 'token_pb2.AuthToken...
""" File: sample_generator.py Author: Nrupatunga Email: <EMAIL> Github: https://github.com/nrupatunga Description: Generating samples from single frame """ import sys import cv2 import numpy as np from loguru import logger try: from goturn.helper.BoundingBox import BoundingBox from goturn.helper.image_proc i...
[ "goturn.helper.image_io._is_pil_image", "goturn.helper.draw_util.draw.bbox", "goturn.helper.image_proc.cropPadImage", "goturn.helper.BoundingBox.BoundingBox", "numpy.asarray", "loguru.logger.error", "goturn.helper.vis_utils.Visualizer", "cv2.cvtColor", "sys.exit", "numpy.concatenate", "cv2.resiz...
[((498, 564), 'loguru.logger.error', 'logger.error', (['"""Please run $source settings.sh from root directory"""'], {}), "('Please run $source settings.sh from root directory')\n", (510, 564), False, 'from loguru import logger\n'), ((569, 580), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (577, 580), False, 'import ...
# -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: from __future__ import print_function, division, absolute_import, unicode_literals import os.path as op def hcp_workflow(name='Evaluation_HCP', settings={}, map_me...
[ "nipype.algorithms.mesh.ComputeMeshWarp", "nipype.pipeline.engine.Workflow", "nipype.interfaces.utility.Merge", "nipype.algorithms.misc.AddCSVRow", "nipype.interfaces.utility.Split", "os.path.join", "nipype.workflows.dmri.fsl.artifacts.sdc_fmb", "evaluation.map_energy", "os.path.dirname", "nipype....
[((1099, 1121), 'nipype.pipeline.engine.Workflow', 'pe.Workflow', ([], {'name': 'name'}), '(name=name)\n', (1110, 1121), True, 'from nipype.pipeline import engine as pe\n'), ((1147, 1203), 'nipype.interfaces.utility.IdentityInterface', 'niu.IdentityInterface', ([], {'fields': "['subject_id', 'data_dir']"}), "(fields=['...
from telegram.ext import Updater, CommandHandler, RegexHandler, MessageHandler, Filters, CallbackQueryHandler from config import settings, command as cmd from src import bot import logging updater = Updater(token=settings.BOT_TOKEN) dispatcher = updater.dispatcher bot = bot.ScheduleBot() # ********* BASE DISPATCH **...
[ "logging.basicConfig", "logging.getLogger", "telegram.ext.RegexHandler", "src.bot.ScheduleBot", "telegram.ext.MessageHandler", "telegram.ext.CallbackQueryHandler", "telegram.ext.CommandHandler", "telegram.ext.Updater" ]
[((200, 233), 'telegram.ext.Updater', 'Updater', ([], {'token': 'settings.BOT_TOKEN'}), '(token=settings.BOT_TOKEN)\n', (207, 233), False, 'from telegram.ext import Updater, CommandHandler, RegexHandler, MessageHandler, Filters, CallbackQueryHandler\n'), ((272, 289), 'src.bot.ScheduleBot', 'bot.ScheduleBot', ([], {}), ...
import argparse import os from ..common_util.misc import makedirs from ..video_inpainting import create_padded_masked_video_dataset def main(frames_dataset_path, masks_dataset_path, final_dataset_path): dataset = create_padded_masked_video_dataset(frames_dataset_path, masks_dataset_path) for i in range(len(d...
[ "os.path.join", "argparse.ArgumentParser" ]
[((590, 615), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (613, 615), False, 'import argparse\n'), ((406, 450), 'os.path.join', 'os.path.join', (['final_dataset_path', 'video_name'], {}), '(final_dataset_path, video_name)\n', (418, 450), False, 'import os\n')]
import os import h5py import numpy as np import pandas as pd import multiprocessing as mp class Scaler: def __init__(self, mean=None, std=None): self.mean = mean self.std = std def fit(self, data): self.mean = np.mean(data) self.std = np.std(data) def set_mean(self, mean): self.mean = me...
[ "numpy.mean", "numpy.reshape", "h5py.File", "numpy.array", "numpy.isnan", "multiprocessing.Pool", "numpy.std", "pandas.DataFrame", "numpy.fromstring" ]
[((562, 586), 'h5py.File', 'h5py.File', (['filename', '"""r"""'], {}), "(filename, 'r')\n", (571, 586), False, 'import h5py\n'), ((758, 782), 'h5py.File', 'h5py.File', (['filename', '"""w"""'], {}), "(filename, 'w')\n", (767, 782), False, 'import h5py\n'), ((897, 938), 'numpy.fromstring', 'np.fromstring', (['s'], {'dty...
from django.conf import settings from sklearn.svm import SVC from systems.plugins.index import BaseProvider from systems.remote_ai.tfidf_trainer import TfidfTrainer class Provider(BaseProvider('remote_ai_model', 'tdidf_svc')): def tfidf_processor_class(self): return TfidfTrainer def init_model(sel...
[ "sklearn.svm.SVC", "systems.plugins.index.BaseProvider" ]
[((183, 227), 'systems.plugins.index.BaseProvider', 'BaseProvider', (['"""remote_ai_model"""', '"""tdidf_svc"""'], {}), "('remote_ai_model', 'tdidf_svc')\n", (195, 227), False, 'from systems.plugins.index import BaseProvider\n'), ((431, 521), 'sklearn.svm.SVC', 'SVC', ([], {'probability': '(True)', 'kernel': 'self.fiel...
# -*- coding: utf-8 -*- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ### Alias : cx_Freeze & PyInstaller builder & Last Modded : 2022.01.10. ### Coded with Python 3.10 Grammar by IRACK000 # PyInstaller 3.10.0 빌드 오류 해결 관련 # https://github.com/pyinstaller/pyinstaller/issues/6301 """"""""...
[ "os.rename", "platform.system", "src.main.cli.apis.check_py_version", "os.system", "os.remove" ]
[((842, 860), 'src.main.cli.apis.check_py_version', 'check_py_version', ([], {}), '()\n', (858, 860), False, 'from src.main.cli.apis import check_py_version\n'), ((2155, 2194), 'os.system', 'os.system', (['f"""{py} -m pip install wheel"""'], {}), "(f'{py} -m pip install wheel')\n", (2164, 2194), False, 'import os\n'), ...
# -*- coding: utf-8 -*- """ lantz.drivers.aeroflex.a2023a ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Implements the drivers for an signal generator. Sources:: - Aeroflex 2023a Manual. :copyright: 2015 by Lantz Authors, see AUTHORS for more details. :license: BSD, see LICENSE for more details. ""...
[ "lantz.core.Feat", "argparse.ArgumentParser", "lantz.ui.app.start_test_app", "lantz.core.mfeats.QuantityFeat", "lantz.core.Action", "lantz.core.mfeats.BoolFeat" ]
[((741, 827), 'lantz.core.mfeats.QuantityFeat', 'QuantityFeat', (["('CFRQ?', ':CFRQ:VALUE {0:f};{_}')", '"""CFRQ:VALUE {0:f}HZ"""'], {'units': '"""Hz"""'}), "(('CFRQ?', ':CFRQ:VALUE {0:f};{_}'), 'CFRQ:VALUE {0:f}HZ',\n units='Hz')\n", (753, 827), False, 'from lantz.core.mfeats import BoolFeat, QuantityFeat, Quantity...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #AUTHOR: <NAME> #DATE: Wed Apr 3 16:15:13 2019 #VERSION: #PYTHON_VERSION: 3.6 ''' DESCRIPTION ''' import numpy as np import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation from neural_network import neural_network stimuli = np.random.rand(6, 11) ...
[ "matplotlib.pyplot.subplots", "neural_network.neural_network", "numpy.random.rand", "matplotlib.pyplot.show" ]
[((298, 319), 'numpy.random.rand', 'np.random.rand', (['(6)', '(11)'], {}), '(6, 11)\n', (312, 319), True, 'import numpy as np\n'), ((324, 371), 'neural_network.neural_network', 'neural_network', ([], {'stimuli': 'stimuli', 'threshold': '(0.05)'}), '(stimuli=stimuli, threshold=0.05)\n', (338, 371), False, 'from neural_...
import pkg_resources import sys import logging import click import confight from docker_volume_nest.defaults import DEFAULTS from docker_volume_nest.util import exec_command from .service import serve_app logger = logging.getLogger(__name__) def get_version(): return pkg_resources.get_distribution('docker_vol...
[ "logging.getLogger", "click.argument", "click.option", "click.group", "confight.load_app", "sys.exit", "docker_volume_nest.util.exec_command", "pkg_resources.get_distribution" ]
[((218, 245), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (235, 245), False, 'import logging\n'), ((448, 544), 'click.option', 'click.option', (['"""--app-name"""', '"""config"""'], {'default': '"""docker_volume_nest"""', 'callback': 'cb_load_config'}), "('--app-name', 'config', defaul...
import pytest from numerous.engine.variables import _VariableFactory, VariableType, VariableDescription from tests.test_equations import * @pytest.fixture def constant(): var_desc = VariableDescription(tag='test_derivative', initial_value=0, type=VariableType.CONSTANT) ret...
[ "numerous.engine.variables.VariableDescription", "numerous.engine.variables._VariableFactory._create_from_variable_desc_unbound", "pytest.raises" ]
[((190, 282), 'numerous.engine.variables.VariableDescription', 'VariableDescription', ([], {'tag': '"""test_derivative"""', 'initial_value': '(0)', 'type': 'VariableType.CONSTANT'}), "(tag='test_derivative', initial_value=0, type=\n VariableType.CONSTANT)\n", (209, 282), False, 'from numerous.engine.variables import...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion import mkt.webapps.models import mkt.translations.models import mkt.translations.fields class Migration(migrations.Migration): dependencies = [ ('translations', '__fi...
[ "django.db.models.BooleanField", "django.db.models.AutoField", "django.db.models.DateTimeField", "django.db.models.URLField", "django.db.models.CharField" ]
[((464, 557), 'django.db.models.AutoField', 'models.AutoField', ([], {'verbose_name': '"""ID"""', 'serialize': '(False)', 'auto_created': '(True)', 'primary_key': '(True)'}), "(verbose_name='ID', serialize=False, auto_created=True,\n primary_key=True)\n", (480, 557), False, 'from django.db import models, migrations\...
# Copyright 2019 <NAME>, <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 ...
[ "first.first", "re.split", "re.findall" ]
[((1456, 1482), 're.split', 're.split', (['"""\\\\s+"""', 'cli_text'], {}), "('\\\\s+', cli_text)\n", (1464, 1482), False, 'import re\n'), ((1824, 1850), 're.split', 're.split', (['"""\\\\s+"""', 'cli_text'], {}), "('\\\\s+', cli_text)\n", (1832, 1850), False, 'import re\n'), ((3123, 3137), 'first.first', 'first', (['o...
# encoding: UTF-8 """ 定时服务,可无人值守运行,实现每日自动下载更新历史行情数据到数据库中。 """ from DataService.tushareData import * from datetime import datetime if __name__ == '__main__': taskCompletedDate = None # 生成一个随机的任务下载时间,用于避免所有用户在同一时间访问数据服务器 taskTime = datetime.now().replace(hour=17, minute=30, second=0) # 进入主循环 ...
[ "datetime.datetime.now" ]
[((345, 359), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (357, 359), False, 'from datetime import datetime\n'), ((251, 265), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (263, 265), False, 'from datetime import datetime\n')]
"""System utilities.""" import socket import sys import os import csv import yaml import torch import torchvision import random import numpy as np import datetime import hydra from omegaconf import OmegaConf, open_dict import logging def system_startup(process_idx, local_group_size, cfg): """Decide and prin...
[ "logging.getLogger", "omegaconf.open_dict", "csv.DictWriter", "torch.as_tensor", "torch.cuda.device_count", "torch.cuda.is_available", "torch.distributed.get_rank", "sys.version.split", "datetime.timedelta", "torchvision.utils.save_image", "hydra.utils.get_original_cwd", "numpy.asarray", "os...
[((502, 576), 'torch.multiprocessing.set_sharing_strategy', 'torch.multiprocessing.set_sharing_strategy', (['cfg.case.impl.sharing_strategy'], {}), '(cfg.case.impl.sharing_strategy)\n', (544, 576), False, 'import torch\n'), ((1314, 1339), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (1337, 13...
import pkg_resources import os.path from PIL import ImageFont def available(): """ Returns list of available font names. """ names = [] for f in pkg_resources.resource_listdir('ev3dev.fonts', ''): name, ext = os.path.splitext(os.path.basename(f)) if ext == '.pil': names....
[ "PIL.ImageFont.load", "pkg_resources.resource_listdir" ]
[((166, 216), 'pkg_resources.resource_listdir', 'pkg_resources.resource_listdir', (['"""ev3dev.fonts"""', '""""""'], {}), "('ev3dev.fonts', '')\n", (196, 216), False, 'import pkg_resources\n'), ((763, 787), 'PIL.ImageFont.load', 'ImageFont.load', (['pil_file'], {}), '(pil_file)\n', (777, 787), False, 'from PIL import I...
#!flask/bin/python import os, pymongo import models from flask import Flask, jsonify, abort, request, make_response, url_for app = Flask(__name__) # Error Handler for 400: Bad Request @app.errorhandler(400) def not_found(error): return make_response(jsonify( { 'error': 'Bad request' } ), 400) # E...
[ "models.get_doco", "os.getenv", "flask.Flask", "models.init_db", "models.get_documents", "models.new_doco", "models.update_doco", "models.search", "flask.request.json.get", "flask.abort", "flask.jsonify" ]
[((141, 156), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (146, 156), False, 'from flask import Flask, jsonify, abort, request, make_response, url_for\n'), ((5001, 5017), 'models.init_db', 'models.init_db', ([], {}), '()\n', (5015, 5017), False, 'import models\n'), ((616, 638), 'models.get_documents', '...
import os import sys from keystone import * sys.path.append("./../../util/script/") import shellcode def gen_oepinit_code32(): ks = Ks(KS_ARCH_X86, KS_MODE_32) code_str = f""" // for relative address, get the base of addr push ebx; call getip; lea ebx, [eax-6]; // get the ...
[ "sys.path.append", "shellcode.extract_coff", "shellcode.write_shellcode_header" ]
[((49, 88), 'sys.path.append', 'sys.path.append', (['"""./../../util/script/"""'], {}), "('./../../util/script/')\n", (64, 88), False, 'import sys\n'), ((6363, 6399), 'shellcode.extract_coff', 'shellcode.extract_coff', (['libwinpepath'], {}), '(libwinpepath)\n', (6385, 6399), False, 'import shellcode\n'), ((6897, 6950)...
# -*- encoding: utf-8 -*- # pylint: disable=E0203,E1101,C0111 """ @file @brief Runtime operator. """ from scipy.special import erf # pylint: disable=E0611 from ._op import OpRunUnaryNum class Erf(OpRunUnaryNum): def __init__(self, onnx_node, desc=None, **options): OpRunUnaryNum.__init__(self, onnx_node,...
[ "scipy.special.erf" ]
[((519, 525), 'scipy.special.erf', 'erf', (['x'], {}), '(x)\n', (522, 525), False, 'from scipy.special import erf\n'), ((577, 590), 'scipy.special.erf', 'erf', (['x'], {'out': 'x'}), '(x, out=x)\n', (580, 590), False, 'from scipy.special import erf\n')]
from gstat_classroom.index import app app.run_server(debug=True)
[ "gstat_classroom.index.app.run_server" ]
[((39, 65), 'gstat_classroom.index.app.run_server', 'app.run_server', ([], {'debug': '(True)'}), '(debug=True)\n', (53, 65), False, 'from gstat_classroom.index import app\n')]
import pprint import os class ServerProps: def __init__(self, filepath): self.filepath = filepath self.props = self._parse() def _parse(self): """Loads and parses the file speified in self.filepath""" with open(self.filepath) as fp: line = fp.readline() ...
[ "os.path.exists", "pprint.pprint", "os.remove" ]
[((992, 1017), 'pprint.pprint', 'pprint.pprint', (['self.props'], {}), '(self.props)\n', (1005, 1017), False, 'import pprint\n'), ((1866, 1891), 'os.path.exists', 'os.path.exists', (['""".header"""'], {}), "('.header')\n", (1880, 1891), False, 'import os\n'), ((343, 368), 'os.path.exists', 'os.path.exists', (['""".head...
import numpy as np # laser = [0.1, 0.2, 0.3, 0.4, 0.5] # laser_arr = np.array(laser) # result = np.count_nonzero(laser_arr >= 0.2) import math radian = math.radians(90) con_d = math.degrees(radian) print(radian,':::',con_d)
[ "math.degrees", "math.radians" ]
[((155, 171), 'math.radians', 'math.radians', (['(90)'], {}), '(90)\n', (167, 171), False, 'import math\n'), ((181, 201), 'math.degrees', 'math.degrees', (['radian'], {}), '(radian)\n', (193, 201), False, 'import math\n')]
from morle.utils.files import full_path import morle.shared as shared from collections import defaultdict import hfst import os.path import sys import tqdm import types def seq_to_transducer(alignment, weight=0.0, type=None, alphabet=None): if type is None: type=shared.config['FST'].getint('transducer_typ...
[ "hfst.HfstTransducer", "morle.utils.files.full_path", "hfst.HfstInputStream", "hfst.HfstBasicTransition", "hfst.HfstBasicTransducer" ]
[((333, 359), 'hfst.HfstBasicTransducer', 'hfst.HfstBasicTransducer', ([], {}), '()\n', (357, 359), False, 'import hfst\n'), ((1799, 1828), 'hfst.HfstTransducer', 'hfst.HfstTransducer', (['tr', 'type'], {}), '(tr, type)\n', (1818, 1828), False, 'import hfst\n'), ((4477, 4513), 'hfst.HfstBasicTransducer', 'hfst.HfstBasi...
"""Tests for the array sorting algorithms in array_sorts""" import pytest from src.array_sorts import bubble_sort, selection_sort, insertion_sort @pytest.mark.parametrize("func", [ bubble_sort, selection_sort, insertion_sort ]) @pytest.mark.parametrize("array_to_sort,expected_sorted_array", [ ([], []),...
[ "pytest.mark.parametrize" ]
[((148, 226), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""func"""', '[bubble_sort, selection_sort, insertion_sort]'], {}), "('func', [bubble_sort, selection_sort, insertion_sort])\n", (171, 226), False, 'import pytest\n'), ((242, 632), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""array_to...
#!/usr/bin/env python # Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import os import json from util import build_path def read_json(filename): with open(filename) as json_file: return json.load(json_file) def write_json(filename, data): with open(filename, 'w') as outfile...
[ "json.load", "os.path.exists", "util.build_path", "json.dump" ]
[((575, 608), 'os.path.exists', 'os.path.exists', (['current_data_file'], {}), '(current_data_file)\n', (589, 608), False, 'import os\n'), ((616, 645), 'os.path.exists', 'os.path.exists', (['all_data_file'], {}), '(all_data_file)\n', (630, 645), False, 'import os\n'), ((390, 402), 'util.build_path', 'build_path', ([], ...
""" Modified from https://github.com/microsoft/Swin-Transformer/blob/main/main.py """ import os import time import argparse import datetime import numpy as np import oneflow as flow import oneflow.backends.cudnn as cudnn from flowvision.loss.cross_entropy import ( LabelSmoothingCrossEntropy, SoftTargetCrossEn...
[ "flowvision.loss.cross_entropy.SoftTargetCrossEntropy", "utils.reduce_tensor", "flowvision.utils.metrics.accuracy", "argparse.ArgumentParser", "oneflow.env.get_rank", "flowvision.utils.metrics.AverageMeter", "oneflow.nn.CrossEntropyLoss", "models.build_model", "data.build_loader", "oneflow.no_grad...
[((9189, 9203), 'oneflow.no_grad', 'flow.no_grad', ([], {}), '()\n', (9201, 9203), True, 'import oneflow as flow\n'), ((10709, 10723), 'oneflow.no_grad', 'flow.no_grad', ([], {}), '()\n', (10721, 10723), True, 'import oneflow as flow\n'), ((754, 868), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""Flowvisi...
# Generated by Django 2.2.26 on 2022-01-17 03:54 from django.conf import settings from django.db import migrations from tahoe_sites import zd_helpers class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('organizations', '0011_histor...
[ "django.db.migrations.swappable_dependency", "tahoe_sites.zd_helpers.get_unique_together" ]
[((223, 280), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (254, 280), False, 'from django.db import migrations\n'), ((546, 602), 'tahoe_sites.zd_helpers.get_unique_together', 'zd_helpers.get_unique_together', (["('us...
from fairseq.models.transformer_lm import * from torch.nn import CrossEntropyLoss from typing import Any, Dict, List, Optional, Tuple from torch import Tensor class TransformerLanguageModelWrapper(TransformerLanguageModel): @classmethod def build_model(cls, args, task): """Build a new model instance....
[ "torch.nn.CrossEntropyLoss" ]
[((5478, 5496), 'torch.nn.CrossEntropyLoss', 'CrossEntropyLoss', ([], {}), '()\n', (5494, 5496), False, 'from torch.nn import CrossEntropyLoss\n')]
#!/usr/bin/env python3 -B try: import mido except: quit("missing module: mido") import sys import math class MidiToData: def main(self): self.parseArgs() self.processFile() def parseArgs(self): if len(sys.argv) < 2: quit("midi2data <filename> <format> <columns> [<offset> = 0] [<track> = 1]") try: ...
[ "mido.MidiFile", "math.floor" ]
[((336, 362), 'mido.MidiFile', 'mido.MidiFile', (['sys.argv[1]'], {}), '(sys.argv[1])\n', (349, 362), False, 'import mido\n'), ((1901, 1923), 'math.floor', 'math.floor', (['(pitch / 12)'], {}), '(pitch / 12)\n', (1911, 1923), False, 'import math\n')]
"""Tests for the logix_driver.py file. The Logix Driver is beholden to the CIPDriver interface. Only tests which bind it to that interface should be allowed here. Tests binding to another interface such as Socket are an anti-pattern. There are quite a few methods in the LogixDriver which are difficult to read or test...
[ "pycomm3.logix_driver.LogixDriver", "pycomm3.packets.ResponsePacket", "pytest.mark.skip", "pytest.mark.parametrize", "unittest.mock.patch.object", "unittest.mock.patch" ]
[((3633, 3728), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""identity"""', '[IDENTITY_CLX_V20, IDENTITY_CLX_V21, IDENTITY_CLX_V32]'], {}), "('identity', [IDENTITY_CLX_V20, IDENTITY_CLX_V21,\n IDENTITY_CLX_V32])\n", (3656, 3728), False, 'import pytest\n'), ((4622, 4675), 'pytest.mark.parametrize', 'pyt...
# import json import copy import itertools import multiprocessing import os import sys import time from functools import partial import numpy as np from numpy import linalg from tqdm import tqdm import rmsd import quantum import clockwork import merge import similarity_fchl19 as sim from chemhelp import cheminfo fro...
[ "clockwork.generate_torsion_combinations", "similarity_fchl19.get_representation", "quantum.optmize_conformation", "chemhelp.cheminfo.convert_atom", "communication.rediscomm.Taskqueue", "chemhelp.cheminfo.sdfstr_to_molobj", "numpy.array", "copy.deepcopy", "numpy.linalg.norm", "rdkit.Chem.rdMolTran...
[((528, 562), 'joblib.Memory', 'joblib.Memory', (['cachedir'], {'verbose': '(0)'}), '(cachedir, verbose=0)\n', (541, 562), False, 'import joblib\n'), ((653, 681), 'os.path.expanduser', 'os.path.expanduser', (['filepath'], {}), '(filepath)\n', (671, 681), False, 'import os\n'), ((726, 779), 'rdkit.Chem.ChemicalForceFiel...
from sys import argv from os.path import exists script, from_file, to_file = argv print("Copying from %s to %s"%(from_file,to_file)) # we could do these two on one lines too, how? input = open(from_file) indata = input.read() print ("The input file is %d bytes long"% len(indata)) print ("Does the output...
[ "os.path.exists" ]
[((339, 354), 'os.path.exists', 'exists', (['to_file'], {}), '(to_file)\n', (345, 354), False, 'from os.path import exists\n')]
from django.db import models class Category(models.Model): name = models.CharField(max_length=255) description = models.CharField(max_length=255, null=True, default='') class Meta: verbose_name = "Category" verbose_name_plural = "Categories" def __str__(self): return self.name...
[ "django.db.models.ManyToManyField", "django.db.models.CharField" ]
[((71, 103), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)'}), '(max_length=255)\n', (87, 103), False, 'from django.db import models\n'), ((122, 177), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(255)', 'null': '(True)', 'default': '""""""'}), "(max_length=255, ...
from __future__ import unicode_literals from __future__ import print_function from fnmatch import fnmatch import sys from unittest.suite import _call_if_exists, _DebugResult, _isnotsuite, TestSuite from unittest import util import unittest from io import StringIO from green.config import default_args from green.outpu...
[ "green.output.GreenStream", "unittest.util.strclass", "fnmatch.fnmatch", "unittest.suite._call_if_exists", "unittest.suite._isnotsuite", "io.StringIO" ]
[((3672, 3711), 'unittest.suite._call_if_exists', '_call_if_exists', (['result', '"""_setupStdout"""'], {}), "(result, '_setupStdout')\n", (3687, 3711), False, 'from unittest.suite import _call_if_exists, _DebugResult, _isnotsuite, TestSuite\n'), ((5213, 5252), 'unittest.suite._call_if_exists', '_call_if_exists', (['re...
"""Persistence abstraction. Limits persistence interactions - all persisted data goes through this layer. """ from django.contrib.auth.models import User from spudblog.models import Blog, Post ###### API def get_blogs(user_id=None): if user_id: return Blog.objects.filter(author_id=user_id).order_by('dat...
[ "spudblog.models.Blog.objects.filter", "spudblog.models.Post", "spudblog.models.Post.objects.get", "spudblog.models.Blog.objects.get", "django.contrib.auth.models.User.objects.order_by", "spudblog.models.Blog", "spudblog.models.Blog.objects.order_by" ]
[((526, 559), 'django.contrib.auth.models.User.objects.order_by', 'User.objects.order_by', (['"""username"""'], {}), "('username')\n", (547, 559), False, 'from django.contrib.auth.models import User\n'), ((818, 846), 'spudblog.models.Blog.objects.get', 'Blog.objects.get', ([], {'id': 'blog_id'}), '(id=blog_id)\n', (834...