code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
import sys import os from datetime import datetime import traceback import time from pathlib import Path import h5py import pickle import nept import scipy import numpy as np import pandas as pd from fooof import FOOOF # cwd = Path(os.getcwd()) # pkg_dir = cwd.parent # sys.path.append(str(pkg_dir)) import Utils.rob...
[ "pickle.dump", "numpy.sum", "scipy.signal.welch", "numpy.abs", "numpy.argmax", "numpy.empty", "matplotlib.pyplot.subplot2grid", "numpy.floor", "numpy.ones", "numpy.around", "pathlib.Path", "matplotlib.pyplot.figure", "numpy.arange", "numpy.histogram", "sys.exc_info", "numpy.mean", "p...
[((391, 434), 'seaborn.set', 'sns.set', ([], {'style': '"""whitegrid"""', 'palette': '"""muted"""'}), "(style='whitegrid', palette='muted')\n", (398, 434), True, 'import seaborn as sns\n'), ((1238, 1254), 'pathlib.Path', 'Path', (["task['sp']"], {}), "(task['sp'])\n", (1242, 1254), False, 'from pathlib import Path\n'),...
# Generated by Django 3.2.3 on 2022-01-24 01:28 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('congress', '0013_auto_20220121_1356'), ] operations = [ migrations.AlterField( model_name='congressperson', name='fu...
[ "django.db.models.CharField", "django.db.models.IntegerField" ]
[((347, 393), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(1000)', 'unique': '(True)'}), '(max_length=1000, unique=True)\n', (363, 393), False, 'from django.db import migrations, models\n'), ((526, 579), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'blank': '(True)', 'default...
from application import app from application.database import db, redis_db import json import os def write_price_data_to_file(file_name="csv_for_charts/current_prices.dat", data=None): if data: chart_header = "@ " prices_list = [] for coin_id in data.keys(): if len(list(data.key...
[ "application.database.redis_db.get", "os.system", "json.loads" ]
[((1864, 2025), 'os.system', 'os.system', (['f"""termgraph ~/sourceCode/python/coin_watcher/csv_for_charts/current_prices.dat --color {chart_colors} --title "Biểu đồ giá crypto hiện tại\\""""'], {}), '(\n f\'termgraph ~/sourceCode/python/coin_watcher/csv_for_charts/current_prices.dat --color {chart_colors} --title "...
""" Core infrastructure for working with remote storage resources. See `docs/storage_dev_guide.md` for more information and best practices for using this module to work with remote storage resources. This module currently provides clients for the following storage resources: - S3 buckets via the `boto3` package - Goo...
[ "os.remove", "boto3.client", "logging.getLogger", "os.path.isfile", "google.cloud.storage.Client", "urlparse.quote", "os.environ.pop", "eta.core.utils.ensure_basedir", "googleapiclient.discovery.build", "os.path.join", "eta.core.utils.list_files", "boto3.Session", "requests.adapters.HTTPAdap...
[((2108, 2135), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2125, 2135), False, 'import logging\n'), ((2662, 2686), 'os.path.exists', 'os.path.exists', (['filepath'], {}), '(filepath)\n', (2676, 2686), False, 'import os\n'), ((3211, 3234), 'os.path.exists', 'os.path.exists', (['dirpat...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Tue Oct 3 22:57:34 2017 @author: nam """ import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data # Getting inputs, and outputs(in one-hot vector form) mnist = input_data.read_data_sets("/tmp/data/", one_hot = True) # Defining...
[ "tensorflow.nn.relu", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.global_variables_initializer", "tensorflow.argmax", "tensorflow.Session", "tensorflow.placeholder", "tensorflow.matmul", "tensorflow.cast", "tensorflow.random_normal", "tensorflow.examples.tutorials.mnist.input_da...
[((253, 306), 'tensorflow.examples.tutorials.mnist.input_data.read_data_sets', 'input_data.read_data_sets', (['"""/tmp/data/"""'], {'one_hot': '(True)'}), "('/tmp/data/', one_hot=True)\n", (278, 306), False, 'from tensorflow.examples.tutorials.mnist import input_data\n'), ((545, 581), 'tensorflow.placeholder', 'tf.plac...
from datetime import datetime, timedelta import logging import os import requests import shutil import uuid import re from flask import * from flask_security import current_user, login_required from flask_wtf import FlaskForm from werkzeug.exceptions import Forbidden from wtforms import fields, validators, widgets fr...
[ "dtech_instagram.db.db.session.query", "dtech_instagram.views.ajax.save_file", "wtforms.validators.DataRequired", "os.path.join", "dtech_instagram.models.Post", "datetime.timedelta", "dtech_instagram.db.db.session.delete", "dtech_instagram.InstagramAPI.Instagram", "werkzeug.exceptions.Forbidden", ...
[((619, 646), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (636, 646), False, 'import logging\n'), ((1874, 1913), 'dtech_instagram.app.app.route', 'app.route', (['"""/upload"""'], {'methods': "('POST',)"}), "('/upload', methods=('POST',))\n", (1883, 1913), False, 'from dtech_instagram.a...
""" Wisconsin Autonomous - https://www.wisconsinautonomous.org Copyright (c) 2021 wisconsinautonomous.org All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file at the top level of the repo """ from abc import abstractmethod # Abstract Base Class # WA ...
[ "wa_simulator.utils._load_json", "wa_simulator.core.WAVector", "wa_simulator.utils._WAStaticAttribute", "wa_simulator.core.WAQuaternion.from_z_rotation", "numpy.clip", "numpy.sin", "numpy.tan", "numpy.cos", "numpy.interp" ]
[((1120, 1140), 'wa_simulator.utils._load_json', '_load_json', (['filename'], {}), '(filename)\n', (1130, 1140), False, 'from wa_simulator.utils import _load_json, _WAStaticAttribute, get_wa_data_file\n'), ((4498, 4557), 'wa_simulator.utils._WAStaticAttribute', '_WAStaticAttribute', (['"""_GO_KART_MODEL_FILE"""', 'get_...
import dash # CSS applied to the dashboard external_css = [ # Normalize the CSS "https://cdnjs.cloudflare.com/ajax/libs/normalize/7.0.0/normalize.min.css", # Fonts "https://fonts.googleapis.com/css?family=Open+Sans|Roboto", "https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.c...
[ "dash.Dash" ]
[((418, 472), 'dash.Dash', 'dash.Dash', (['__name__'], {'external_stylesheets': 'external_css'}), '(__name__, external_stylesheets=external_css)\n', (427, 472), False, 'import dash\n')]
# This file was automatically generated by SWIG (http://www.swig.org). # Version 3.0.12 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. """ This module gives access to some functions of the spams C++ library. The functions defined here should not be ca...
[ "_spams_wrap.lassoD", "_spams_wrap.readGroupStruct", "_spams_wrap.omp", "_spams_wrap.proximalFlat", "_spams_wrap.somp", "_spams_wrap.parse_line", "_spams_wrap.sparseProject", "_spams_wrap.mult", "_spams_wrap.XAt", "_spams_wrap.groupStructOfString", "_spams_wrap.alltrainDL", "_spams_wrap.proxim...
[((3135, 3157), '_spams_wrap.m_ones', '_spams_wrap.m_ones', (['nb'], {}), '(nb)\n', (3153, 3157), False, 'import _spams_wrap\n'), ((3217, 3242), '_spams_wrap.skip_space', '_spams_wrap.skip_space', (['s'], {}), '(s)\n', (3239, 3242), False, 'import _spams_wrap\n'), ((3319, 3353), '_spams_wrap.parse_line', '_spams_wrap.p...
import openpyxl import os from .models import words class load_excel(object): def __init__(self, filedir = ""): try: self.wb = openpyxl.load_workbook(filedir) except Exception as e: print(e.args) def get_content(self, Product): try: sheetnames = ...
[ "os.path.dirname", "os.path.join", "openpyxl.load_workbook" ]
[((1691, 1716), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1706, 1716), False, 'import os\n'), ((1731, 1770), 'os.path.join', 'os.path.join', (['Base_dir', '"""static\\\\words"""'], {}), "(Base_dir, 'static\\\\words')\n", (1743, 1770), False, 'import os\n'), ((152, 183), 'openpyxl.load_w...
# Copyright 2021 The Petuum 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 applicable...
[ "unittest.main", "texar.torch.data.data.data_iterators.DataIterator", "iu_xray_data.IU_XRay_Dataset", "numpy.sum", "numpy.ones_like", "evaluation_metrics.HammingLoss", "evaluation_metrics.MultiLabelF1", "numpy.zeros", "models.cv_model.MLCTrainer", "sklearn.metrics.roc_auc_score", "evaluation_met...
[((6509, 6524), 'unittest.main', 'unittest.main', ([], {}), '()\n', (6522, 6524), False, 'import unittest\n'), ((2203, 2232), 'iu_xray_data.IU_XRay_Dataset', 'IU_XRay_Dataset', (['data_hparams'], {}), '(data_hparams)\n', (2218, 2232), False, 'from iu_xray_data import IU_XRay_Dataset\n'), ((2295, 2316), 'texar.torch.dat...
# Copyright 2017 Netflix, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
[ "security_monkey.auditor.Entity" ]
[((1725, 1764), 'security_monkey.auditor.Entity', 'Entity', ([], {'category': '"""account"""', 'value': '"""all"""'}), "(category='account', value='all')\n", (1731, 1764), False, 'from security_monkey.auditor import Auditor, Entity\n'), ((2121, 2232), 'security_monkey.auditor.Entity', 'Entity', ([], {'category': '"""ac...
import os import tensorflow as tf import argparse import tokenization from run_classifier import SstProcessor, file_based_input_fn_builder, model_fn_builder, file_based_convert_examples_to_features import tensorflow as tf from tensorflow.python import keras as keras from tensorflow.python.keras.layers import Conv1D fro...
[ "tensorflow.python.keras.layers.Dense", "tensorflow.one_hot", "argparse.ArgumentParser", "tensorflow.data.TFRecordDataset", "tensorflow.python.keras.models.Model", "tensorflow.python.keras.layers.MaxPooling1D", "tensorflow.python.keras.layers.Flatten", "cPickle.load", "tensorflow.python.keras.layers...
[((1133, 1181), 'tensorflow.parse_single_example', 'tf.parse_single_example', (['proto', 'keys_to_features'], {}), '(proto, keys_to_features)\n', (1156, 1181), True, 'import tensorflow as tf\n'), ((1355, 1388), 'tensorflow.data.TFRecordDataset', 'tf.data.TFRecordDataset', (['filepath'], {}), '(filepath)\n', (1378, 1388...
import os import sys base = os.path.dirname(os.path.abspath(__file__)) sys.path.append(base) import hydra import omegaconf from attacks.pgd import PgdAttack class AttackBuilder(object): SUPPORTED_ATTACK = 'pgd'.split() def __init__(self, name): if name not in self.SUPPORTED_ATTACK: rai...
[ "sys.path.append", "os.path.abspath", "torch.utils.data.DataLoader", "attacks.utils.Denormalizer", "hydra.utils.get_original_cwd", "attacks.utils.accuracy", "attacks.pgd.PgdAttack", "torchvision.utils.save_image", "hydra.main", "submodules.ModelBuilder.model_builder.ModelBuilder", "logging.getLo...
[((72, 93), 'sys.path.append', 'sys.path.append', (['base'], {}), '(base)\n', (87, 93), False, 'import sys\n'), ((549, 591), 'hydra.main', 'hydra.main', ([], {'config_path': '"""./conf/test.yaml"""'}), "(config_path='./conf/test.yaml')\n", (559, 591), False, 'import hydra\n'), ((45, 70), 'os.path.abspath', 'os.path.abs...
# -*- encoding:utf-8 -*- """ 选股示例因子:价格选股因子 """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from .ABuPickStockBase import AbuPickStockBase, reversed_result from ..TLineBu.ABuTL import AbuTLine from ..CoreBu.ABuEnv import EMarketDat...
[ "numpy.array" ]
[((1076, 1100), 'numpy.array', 'np.array', (['shift_distance'], {}), '(shift_distance)\n', (1084, 1100), True, 'import numpy as np\n'), ((3289, 3312), 'numpy.array', 'np.array', (['cmp_top_array'], {}), '(cmp_top_array)\n', (3297, 3312), True, 'import numpy as np\n')]
import random def six(d, Nnode, MaxSize=1e99): """ find a cyclic path in the given digraph. d: digraph (networkx.DiGraph) """ head = random.randint(0, Nnode - 1) path = [head] while True: nexts = list(d.successors(head)) next = random.choice(nexts) if next in path: ...
[ "random.choice", "random.randint" ]
[((155, 183), 'random.randint', 'random.randint', (['(0)', '(Nnode - 1)'], {}), '(0, Nnode - 1)\n', (169, 183), False, 'import random\n'), ((274, 294), 'random.choice', 'random.choice', (['nexts'], {}), '(nexts)\n', (287, 294), False, 'import random\n')]
# Basically want to test that FOR_NETCONS statement works when # the NetCons connecting to ForNetConTest instances are created # in random order. import os import pytest from neuron import h pc = h.ParallelContext() h.dt = 1.0/32 class Cell(): def __init__(self, gid): self.soma = h.Section(name="soma", cell=sel...
[ "neuron.h.Vector", "neuron.h.finitialize", "neuron.h.NetCon", "os.environ.get", "neuron.h.Random", "neuron.h.ParallelContext", "neuron.h.CVode", "neuron.h.Section" ]
[((197, 216), 'neuron.h.ParallelContext', 'h.ParallelContext', ([], {}), '()\n', (214, 216), False, 'from neuron import h\n'), ((1226, 1236), 'neuron.h.Vector', 'h.Vector', ([], {}), '()\n', (1234, 1236), False, 'from neuron import h\n'), ((1250, 1260), 'neuron.h.Vector', 'h.Vector', ([], {}), '()\n', (1258, 1260), Fal...
import networkx as nx import nltk import os, re import pandas as pd from collections import Counter import matplotlib.pyplot as plt afi_files = [f for f in os.listdir(os.getcwd()) if f[:2]=="af" and f.endswith(".txt")] #find all the AFI text files print(afi_files) #afi = open(afi_files[0], encoding='latin') ...
[ "os.getcwd", "networkx.Graph", "os.path.splitext", "networkx.degree", "re.compile" ]
[((380, 454), 're.compile', 're.compile', (['"""AIR FORCE INSTRUCTION ?[0-9]+-? ?[0-9]+"""'], {'flags': 're.IGNORECASE'}), "('AIR FORCE INSTRUCTION ?[0-9]+-? ?[0-9]+', flags=re.IGNORECASE)\n", (390, 454), False, 'import os, re\n'), ((471, 531), 're.compile', 're.compile', (['"""\\\\afi-? ?[0-9]+-? ?[0-9]+"""'], {'flags...
from random import random file = raw_input("Nome do arquivo: ") size = input("Tamanho da instancia: ") step = input("Quantidade de passos: ") with open('examples/' + str(file), 'w') as inst: inst.write(str(size) + " " + str(step) + "\n") data = "" for i in range(0, int(size)): for j in range(...
[ "random.random" ]
[((350, 358), 'random.random', 'random', ([], {}), '()\n', (356, 358), False, 'from random import random\n')]
import csv from django.core.management.base import BaseCommand, CommandError from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.db import transaction from api.models import Country class Command(BaseCommand): help = "update the sovereign country and disputed status for all the...
[ "api.models.Country.objects.get" ]
[((1325, 1370), 'api.models.Country.objects.get', 'Country.objects.get', ([], {'name': 'name', 'record_type': '(1)'}), '(name=name, record_type=1)\n', (1344, 1370), False, 'from api.models import Country\n'), ((1818, 1877), 'api.models.Country.objects.get', 'Country.objects.get', ([], {'iso': 'sovereign_state_iso', 're...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.contrib.auth.models import User class Blog(models.Model): user = models.ForeignKey(User, null=True) title = models.CharField(max_length=100) post = models.TextField(max_length=2222) created_at = m...
[ "django.db.models.ForeignKey", "django.db.models.TextField", "django.db.models.CharField", "django.db.models.DateTimeField" ]
[((177, 211), 'django.db.models.ForeignKey', 'models.ForeignKey', (['User'], {'null': '(True)'}), '(User, null=True)\n', (194, 211), False, 'from django.db import models\n'), ((224, 256), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (240, 256), False, 'from djan...
import json from textwrap import dedent class TestSetBootactionArgs: def test_no_args(self, host): result = host.run('stack set bootaction args') assert result.rc == 255 assert result.stderr == dedent('''\ error - "action" argument is required {action} {args=string} [os=string] [type=string] ''') def...
[ "textwrap.dedent", "json.loads" ]
[((203, 322), 'textwrap.dedent', 'dedent', (['"""\t\t\terror - "action" argument is required\n\t\t\t{action} {args=string} [os=string] [type=string]\n\t\t"""'], {}), '(\n """\t\t\terror - "action" argument is required\n\t\t\t{action} {args=string} [os=string] [type=string]\n\t\t"""\n )\n', (209, 322), False, 'fro...
import matplotlib.pyplot as plt import numpy as np import cv2 from os import path from math import floor import os cwd = os.getcwd() dirname = path.join(cwd, path.dirname(__file__)) class DIP: def bilinear_insert(self, img, gain_x=1.5, gain_y=1.5): H, W, C = img.shape gain_h = round(H*gain_x) ...
[ "os.getcwd", "os.path.dirname", "os.path.join", "numpy.arange" ]
[((123, 134), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (132, 134), False, 'import os\n'), ((160, 182), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (172, 182), False, 'from os import path\n'), ((739, 778), 'os.path.join', 'path.join', (['dirname', '"""./imori_out25.jpg"""'], {}), "(dirname,...
import os import cv2 import numpy as np from keras.utils import np_utils from keras.models import Sequential from keras.layers import Dense, Conv2D, MaxPooling2D, Flatten, Dropout from sklearn.model_selection import train_test_split X = [] y = [] data_path = "./data" for number in os.listdir(data_path): for img_n...
[ "cv2.cvtColor", "sklearn.model_selection.train_test_split", "numpy.asarray", "keras.layers.MaxPooling2D", "keras.layers.Dropout", "keras.layers.Flatten", "keras.utils.np_utils.to_categorical", "keras.layers.Dense", "keras.layers.Conv2D", "keras.models.Sequential", "os.path.join", "os.listdir" ...
[((284, 305), 'os.listdir', 'os.listdir', (['data_path'], {}), '(data_path)\n', (294, 305), False, 'import os\n'), ((613, 626), 'numpy.asarray', 'np.asarray', (['X'], {}), '(X)\n', (623, 626), True, 'import numpy as np\n'), ((678, 691), 'numpy.asarray', 'np.asarray', (['y'], {}), '(y)\n', (688, 691), True, 'import nump...
# http://www.pythonchallenge.com/pc/hex/copper.html __author__ = 'Administrator' import urllib.request from io import BytesIO from PIL import Image,ImageSequence def opener(username, password): # User Name & Password password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm() top_level_url =...
[ "PIL.Image.new", "PIL.ImageSequence.Iterator" ]
[((1039, 1072), 'PIL.Image.new', 'Image.new', (['im.mode', '(200, 200)', '(0)'], {}), '(im.mode, (200, 200), 0)\n', (1048, 1072), False, 'from PIL import Image, ImageSequence\n'), ((1290, 1323), 'PIL.Image.new', 'Image.new', (['im.mode', '(200, 200)', '(0)'], {}), '(im.mode, (200, 200), 0)\n', (1299, 1323), False, 'fro...
from zenoh_service.core.zenoh_net import ZenohNet from zenoh_service.zenoh_net_publisher import ZenohNetPublisher import sys import time from datetime import datetime import numpy as np import cv2 import simplejson as json from enum import Enum import logging import argparse # from hurry.filesize import size as fsize f...
[ "cv2.resize", "argparse.ArgumentParser", "cv2.waitKey", "nanocamera.Camera", "cv2.imshow", "logging.getLogger", "time.time", "cv2.VideoCapture", "pycore.extras.functions.humanbytes", "cv2.imencode", "numpy.vstack", "cv2.resizeWindow", "cv2.destroyAllWindows", "datetime.datetime.now", "ze...
[((674, 736), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Zenoh Publisher example"""'}), "(description='Zenoh Publisher example')\n", (697, 736), False, 'import argparse\n'), ((2016, 2043), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2033, 2043), Fal...
import pymongo import os import datetime # 디버깅을 위한 코드, 추후에 전체 수정 필요 t = datetime.datetime.now() filter_list = ["페미","냄져","한남"] #확장 필요 db_name = 'pookle' ip = 'localhost' port = 27017 def db_manage(mode, coll_name = None, doc = None, is_first = None): db = db_access() if coll_name != None and mode != "renewal_date"...
[ "pymongo.MongoClient", "datetime.datetime.now" ]
[((73, 96), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (94, 96), False, 'import datetime\n'), ((1206, 1235), 'pymongo.MongoClient', 'pymongo.MongoClient', (['ip', 'port'], {}), '(ip, port)\n', (1225, 1235), False, 'import pymongo\n')]
from futile.logging import get_logger from base64 import b64encode, b64decode logger = get_logger(__name__) try: from ujson import loads, dumps except ImportError: try: from simplejson import loads, dumps except ImportError: logger.warning("Neither ujson nor simplejson packages are availab...
[ "futile.logging.get_logger", "base64.b64decode", "pickle.dumps" ]
[((88, 108), 'futile.logging.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (98, 108), False, 'from futile.logging import get_logger\n'), ((824, 840), 'pickle.dumps', 'pickle', (['value', '(2)'], {}), '(value, 2)\n', (830, 840), True, 'from pickle import loads as unpickle, dumps as pickle\n'), ((888, 90...
# Copyright 2020, The TensorFlow Federated Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
[ "tensorflow_federated.python.core.impl.context_stack.set_default_context.set_default_context", "tensorflow_federated.python.core.impl.compiler.building_blocks.ComputationBuildingBlock.from_proto", "absl.logging.debug", "tensorflow_federated.python.core.impl.computation_impl.ComputationImpl.get_proto", "tens...
[((1482, 1530), 'tensorflow_federated.python.core.impl.computation_impl.ComputationImpl.get_proto', 'computation_impl.ComputationImpl.get_proto', (['comp'], {}), '(comp)\n', (1524, 1530), False, 'from tensorflow_federated.python.core.impl import computation_impl\n'), ((1562, 1620), 'tensorflow_federated.python.core.imp...
from sqlalchemy import func from sqlalchemy.sql.expression import label from wtforms.validators import Required from wikimetrics.utils import thirty_days_ago, today from wikimetrics.models import Page, Revision, Archive from wikimetrics.forms.fields import CommaSeparatedIntegerListField, BetterBooleanField from timese...
[ "wikimetrics.models.Archive.ar_namespace.in_", "wikimetrics.forms.fields.CommaSeparatedIntegerListField", "wikimetrics.models.Page.page_namespace.in_", "sqlalchemy.sql.expression.label", "sqlalchemy.func.count", "wikimetrics.forms.fields.BetterBooleanField" ]
[((1789, 1879), 'wikimetrics.forms.fields.BetterBooleanField', 'BetterBooleanField', ([], {'default': '(True)', 'description': '"""Count revisions made on deleted pages"""'}), "(default=True, description=\n 'Count revisions made on deleted pages')\n", (1807, 1879), False, 'from wikimetrics.forms.fields import CommaS...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import csv import numpy as np import os import sys from observations.util import maybe_download_and_extract def softbacks(path): """Measurements on a Selection of Paperback Books ...
[ "observations.util.maybe_download_and_extract", "os.path.expanduser", "os.path.join" ]
[((1007, 1031), 'os.path.expanduser', 'os.path.expanduser', (['path'], {}), '(path)\n', (1025, 1031), False, 'import os\n'), ((1180, 1267), 'observations.util.maybe_download_and_extract', 'maybe_download_and_extract', (['path', 'url'], {'save_file_name': '"""softbacks.csv"""', 'resume': '(False)'}), "(path, url, save_f...
"""Multiprocessing ready entry points for sample analysis. """ from bcbio import structural, utils, chipseq from bcbio.bam import callable from bcbio.ngsalign import alignprep from bcbio.pipeline import (disambiguate, lane, qcsummary, sample, shared, variation, rnaseq) from bcbio.variation i...
[ "bcbio.pipeline.lane.process_alignment", "bcbio.pipeline.sample.merge_sample", "bcbio.ngsalign.alignprep.create_inputs", "bcbio.pipeline.shared.combine_bam", "bcbio.pipeline.qcsummary.pipeline_summary", "bcbio.variation.vcfutils.combine_variant_files", "bcbio.variation.coverage.summary", "bcbio.pipeli...
[((519, 543), 'bcbio.pipeline.lane.process_lane', 'lane.process_lane', (['*args'], {}), '(*args)\n', (536, 543), False, 'from bcbio.pipeline import disambiguate, lane, qcsummary, sample, shared, variation, rnaseq\n'), ((594, 615), 'bcbio.pipeline.lane.trim_lane', 'lane.trim_lane', (['*args'], {}), '(*args)\n', (608, 61...
import unittest from petsc4py import PETSc import os from PetscBinaryIO import * class TestPetscBinaryIO(unittest.TestCase): def setUp(self): try: os.remove('test.dat') except OSError: pass try: os.remove('test.dat.info') except OSError: ...
[ "unittest.main", "petsc4py.PETSc.Viewer", "os.remove", "petsc4py.PETSc.Mat", "petsc4py.PETSc.Vec", "petsc4py.PETSc.IS" ]
[((2958, 2973), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2971, 2973), False, 'import unittest\n'), ((2991, 3012), 'os.remove', 'os.remove', (['"""test.dat"""'], {}), "('test.dat')\n", (3000, 3012), False, 'import os\n'), ((3063, 3089), 'os.remove', 'os.remove', (['"""test.dat.info"""'], {}), "('test.dat.inf...
# Generated by Django 3.1.3 on 2022-02-24 09:11 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Shop', fields=[ ...
[ "django.db.models.CharField", "django.db.models.ForeignKey", "django.db.models.BooleanField", "django.db.models.AutoField", "django.db.models.DateTimeField" ]
[((333, 426), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (349, 426), False, 'from django.db import migrations, models\...
import logging import requests from django.http import Http404, HttpResponse, HttpResponseBadRequest, HttpResponseForbidden, JsonResponse from django.shortcuts import get_object_or_404 from django.urls import reverse from django.utils.cache import patch_response_headers from django.views.generic import View from gis...
[ "giscube.utils.get_service_wms_bbox", "giscube.views_utils.web_map_view", "django.http.HttpResponse", "django.utils.cache.patch_response_headers", "giscube.tilecache.image.tile_cache_image", "django.http.HttpResponseBadRequest", "giscube.tilecache.caches.GiscubeServiceCache", "django.http.JsonResponse...
[((657, 684), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (674, 684), False, 'import logging\n'), ((793, 851), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['Service'], {'name': 'service_name', 'active': '(True)'}), '(Service, name=service_name, active=True)\n', (810, 85...
# -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
[ "oslo_limit.limit.ProjectClaim", "oslo_limit.limit.Enforcer", "uuid.uuid4" ]
[((904, 949), 'oslo_limit.limit.ProjectClaim', 'limit.ProjectClaim', (['resource_name', 'project_id'], {}), '(resource_name, project_id)\n', (922, 949), False, 'from oslo_limit import limit\n'), ((1268, 1332), 'oslo_limit.limit.ProjectClaim', 'limit.ProjectClaim', (['resource_name', 'project_id'], {'quantity': 'quantit...
import locale import logging import os import wx from flask_restful import Resource from orangeshare import Config class GetDataFrame(wx.Frame): def __init__(self, parent, id, title, orange_share, newer_version): """ :param newer_version: The new available version of orangeshare :param o...
[ "os.path.dirname", "wx.CheckBox", "wx.GridBagSizer", "logging.info", "wx.Button", "wx.Frame.__init__", "wx.App", "wx.Font", "locale.setlocale", "orangeshare.Config.get_config" ]
[((378, 473), 'wx.Frame.__init__', 'wx.Frame.__init__', (['self', 'parent', 'id', 'title'], {'style': '(wx.DEFAULT_FRAME_STYLE ^ wx.RESIZE_BORDER)'}), '(self, parent, id, title, style=wx.DEFAULT_FRAME_STYLE ^\n wx.RESIZE_BORDER)\n', (395, 473), False, 'import wx\n'), ((956, 999), 'wx.CheckBox', 'wx.CheckBox', (['sel...
import numpy as np from vec_io import fvecs_read from sorter import parallel_sort from lsh import SRP from transform import spherical_transform, simple_lsh def intersect(gs, ids): rc = np.mean([ len(np.intersect1d(g, list(id))) for g, id in zip(gs, ids)]) return rc def recalls(index, q_, gt)...
[ "numpy.random.uniform", "numpy.random.seed", "sorter.parallel_sort", "vec_io.fvecs_read", "transform.spherical_transform", "numpy.linalg.norm", "lsh.SRP" ]
[((1078, 1096), 'vec_io.fvecs_read', 'fvecs_read', (['x_path'], {}), '(x_path)\n', (1088, 1096), False, 'from vec_io import fvecs_read\n'), ((1208, 1227), 'numpy.random.seed', 'np.random.seed', (['(808)'], {}), '(808)\n', (1222, 1227), True, 'import numpy as np\n'), ((1236, 1261), 'numpy.random.uniform', 'np.random.uni...
"""Support remote entity for Xiaomi Miot.""" import logging import time from functools import partial from homeassistant.const import * # noqa: F401 from homeassistant.components import remote from homeassistant.components.remote import ( DOMAIN as ENTITY_DOMAIN, RemoteEntity, ) from miio.chuangmi_ir import ...
[ "miio.chuangmi_ir.ChuangmiIr", "functools.partial", "logging.getLogger", "time.sleep" ]
[((699, 726), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (716, 726), False, 'import logging\n'), ((2312, 2335), 'miio.chuangmi_ir.ChuangmiIr', 'ChuangmiIr', (['host', 'token'], {}), '(host, token)\n', (2322, 2335), False, 'from miio.chuangmi_ir import ChuangmiIr, DeviceException\n'), ...
from xml.dom.minidom import parse, parseString dom = parse("eat100.xml") stimuli = dom.getElementsByTagName('stimulus') words = dict() for i in range(100): stim_word = str(stimuli[i].attributes['word'].value) responses = stimuli[i].getElementsByTagName('response') response_words = [] for response in responses: ...
[ "xml.dom.minidom.parse" ]
[((54, 73), 'xml.dom.minidom.parse', 'parse', (['"""eat100.xml"""'], {}), "('eat100.xml')\n", (59, 73), False, 'from xml.dom.minidom import parse, parseString\n')]
from rb.core.lang import Lang from rb.utils.downloader import download_aoa import csv from copy import deepcopy from typing import Dict class AgeOfAcquisition(): def __init__(self, lang: Lang): self.lang = lang download_aoa(lang) self.aoa_dict = self.read_aoa_file() """ Functi...
[ "copy.deepcopy", "csv.reader", "rb.utils.downloader.download_aoa" ]
[((236, 254), 'rb.utils.downloader.download_aoa', 'download_aoa', (['lang'], {}), '(lang)\n', (248, 254), False, 'from rb.utils.downloader import download_aoa\n'), ((778, 813), 'csv.reader', 'csv.reader', (['csv_file'], {'delimiter': '""","""'}), "(csv_file, delimiter=',')\n", (788, 813), False, 'import csv\n'), ((1012...
from __future__ import absolute_import from datetime import datetime from flexmock import flexmock import pony.tasks from tests.test_base import BaseTest class SendReportSummaryTest(BaseTest): def setUp(self): super(SendReportSummaryTest, self).setUp() self.bot.storage.set('report', {}) ...
[ "datetime.datetime.utcnow", "flexmock.flexmock" ]
[((2687, 2704), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (2702, 2704), False, 'from datetime import datetime\n'), ((2951, 2968), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (2966, 2968), False, 'from datetime import datetime\n'), ((3047, 3064), 'datetime.datetime.utcnow', 'd...
from sqlalchemy import Column, Unicode, Integer, ForeignKey from ..db.baseclass import Requirement class Hardware_Requirement(Requirement): doc_prefix = Column(Unicode(10), nullable=False, default="HWRS") system_requirement_id = Column( Integer, ForeignKey("system_requirement.id"), nullable=False ...
[ "sqlalchemy.ForeignKey", "sqlalchemy.Unicode" ]
[((168, 179), 'sqlalchemy.Unicode', 'Unicode', (['(10)'], {}), '(10)\n', (175, 179), False, 'from sqlalchemy import Column, Unicode, Integer, ForeignKey\n'), ((266, 301), 'sqlalchemy.ForeignKey', 'ForeignKey', (['"""system_requirement.id"""'], {}), "('system_requirement.id')\n", (276, 301), False, 'from sqlalchemy impo...
#!/usr/bin/env python """Trivial example scheduler :Authors: <NAME>, Jr. :Organization: Fermi National Accelerator Laboratory """ __docformat__ = "restructuredtext en" import json import os import posix import datetime import logging import json import time import datetime from collections import OrderedDict from a...
[ "json.dump", "os.chmod", "json.load", "argparse.ArgumentParser", "logging.basicConfig", "time.time", "collections.OrderedDict" ]
[((2655, 2729), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s %(message)s"""', 'level': 'logging.DEBUG'}), "(format='%(asctime)s %(message)s', level=logging.DEBUG)\n", (2674, 2729), False, 'import logging\n'), ((2768, 2809), 'argparse.ArgumentParser', 'ArgumentParser', (['"""Simple sampl...
# -*- coding: utf-8 -*- # # Copyright 2018 <NAME>. 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 ...
[ "tensorflow.constant_initializer", "tensorflow.get_variable_scope", "tensorflow.nn.sigmoid_cross_entropy_with_logits", "tensorflow.train.AdamOptimizer", "tensorflow.nn.bidirectional_dynamic_rnn", "tensorflow.get_variable", "tensorflow.subtract", "os.path.dirname", "tensorflow.concat", "tensorflow....
[((7710, 7768), 'tensorflow.data.Dataset.from_tensor_slices', 'tf.data.Dataset.from_tensor_slices', (['(sent1, sent2, labels)'], {}), '((sent1, sent2, labels))\n', (7744, 7768), True, 'import tensorflow as tf\n'), ((8056, 8081), 'lesson12.general_utils.load_data', 'general_utils.load_data', ([], {}), '()\n', (8079, 808...
# -*- coding: utf-8 -*- """ Create my own style of colorbar """ __title__ = "Replace Hex Colors" __author__ = "<NAME>" __version__ = "1.1(19.02.2018)" __email__ = "<EMAIL>" #============================================================================== # modules import numpy as np import matplotlib ...
[ "ipdb.set_trace", "matplotlib.colors.BoundaryNorm", "numpy.array", "numpy.arange", "matplotlib.colors.ListedColormap" ]
[((2074, 2109), 'matplotlib.colors.ListedColormap', 'mpl.colors.ListedColormap', (['cmaplist'], {}), '(cmaplist)\n', (2099, 2109), True, 'import matplotlib as mpl\n'), ((2243, 2282), 'matplotlib.colors.BoundaryNorm', 'mpl.colors.BoundaryNorm', (['bounds', 'cmap.N'], {}), '(bounds, cmap.N)\n', (2266, 2282), True, 'impor...
import pytest from kiali_qe.tests import DistributedTracingPageTest BOOKINFO = 'bookinfo' @pytest.mark.skip(reason="https://issues.jboss.org/browse/OSSM-91") @pytest.mark.p_atomic @pytest.mark.p_ro_group6 def test_search_traces(kiali_client, openshift_client, browser): tests = DistributedTracingPageTest( ...
[ "pytest.mark.skip", "kiali_qe.tests.DistributedTracingPageTest" ]
[((95, 161), 'pytest.mark.skip', 'pytest.mark.skip', ([], {'reason': '"""https://issues.jboss.org/browse/OSSM-91"""'}), "(reason='https://issues.jboss.org/browse/OSSM-91')\n", (111, 161), False, 'import pytest\n'), ((286, 396), 'kiali_qe.tests.DistributedTracingPageTest', 'DistributedTracingPageTest', ([], {'kiali_clie...
import unittest import pymongo import test.factories as factories from src.stocks import mongo from src.infrastructure import json class MongoTest(unittest.TestCase): DB_HOST = "localhost" DB_PORT = 27017 TEST_DB_NAME = "test_stockreader_db" def setUp(self): self.mongo = mongo.Mongo(self.DB_...
[ "pymongo.MongoClient", "src.infrastructure.json.json_keys_to_lower_and_snake_case", "test.factories.get_stock_list", "src.stocks.mongo.Mongo", "test.factories.get_stock_current_data", "test.factories.get_stock_historical_data_array" ]
[((300, 358), 'src.stocks.mongo.Mongo', 'mongo.Mongo', (['self.DB_HOST', 'self.DB_PORT', 'self.TEST_DB_NAME'], {}), '(self.DB_HOST, self.DB_PORT, self.TEST_DB_NAME)\n', (311, 358), False, 'from src.stocks import mongo\n'), ((407, 428), 'pymongo.MongoClient', 'pymongo.MongoClient', ([], {}), '()\n', (426, 428), False, '...
import enum import os from dataclasses import dataclass, field from typing import List, Optional, Union from dothttp import DotHttpException @dataclass class Allhttp: pass @dataclass class NameWrap: name: str base: Optional[str] = None @dataclass class UrlWrap: method: str url: str @datacla...
[ "dataclasses.field", "os.path.splitext", "dothttp.DotHttpException" ]
[((2175, 2209), 'dataclasses.field', 'field', ([], {'default_factory': '(lambda : [])'}), '(default_factory=lambda : [])\n', (2180, 2209), False, 'from dataclasses import dataclass, field\n'), ((10650, 10676), 'os.path.splitext', 'os.path.splitext', (['filename'], {}), '(filename)\n', (10666, 10676), False, 'import os\...
from setuptools import setup, find_packages setup( name='athinaweb', version='0.97', packages=find_packages(), scripts=['manage.py'], install_requires=['gitpython', 'Django>=3.0', 'djangorestframework', 'python-dateutil', 'gunicorn', 'django-registration', ...
[ "setuptools.find_packages" ]
[((107, 122), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (120, 122), False, 'from setuptools import setup, find_packages\n')]
# -*- coding: utf-8 -*- import re import os extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode', 'sphinxcontrib.napoleon' ] if os.getenv('SPELLCHECK'): extensions += 'sphinxcontrib.spelling'...
[ "os.environ.get", "os.path.dirname", "sphinx_py3doc_enhanced_theme.get_html_theme_path", "os.getenv" ]
[((253, 276), 'os.getenv', 'os.getenv', (['"""SPELLCHECK"""'], {}), "('SPELLCHECK')\n", (262, 276), False, 'import os\n'), ((624, 659), 'os.environ.get', 'os.environ.get', (['"""READTHEDOCS"""', 'None'], {}), "('READTHEDOCS', None)\n", (638, 659), False, 'import os\n'), ((959, 1009), 'sphinx_py3doc_enhanced_theme.get_h...
import sys import math lines = open(sys.argv[1], 'r') for line in lines: line = line.replace('\n', '').replace('\r', '') if len(line) > 0: numbers = [int(x) for x in line.split(' ')][1::] sums = [sum([math.fabs(numbers[i] - numbers[j]) for j in range(len(numbers)) if i != j]) for i in r...
[ "math.fabs" ]
[((234, 268), 'math.fabs', 'math.fabs', (['(numbers[i] - numbers[j])'], {}), '(numbers[i] - numbers[j])\n', (243, 268), False, 'import math\n')]
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import json import random from typing import List, Optional, Tuple import cv2 import numpy as np import torchvision.transforms as T from detectron2.config import CfgNode from detectron2.data.transforms import Transform, Tra...
[ "json.loads", "numpy.amin", "random.uniform", "numpy.ceil", "numpy.float32", "numpy.ones", "detectron2.data.transforms.NoOpTransform", "torchvision.transforms.functional._get_inverse_affine_matrix", "numpy.amax", "numpy.linalg.inv", "cv2.getAffineTransform", "numpy.array", "numpy.random.choi...
[((6971, 6990), 'json.loads', 'json.loads', (['arg_str'], {}), '(arg_str)\n', (6981, 6990), False, 'import json\n'), ((1468, 1497), 'numpy.ones', 'np.ones', (['(1, coords.shape[1])'], {}), '((1, coords.shape[1]))\n', (1475, 1497), True, 'import numpy as np\n'), ((1515, 1540), 'numpy.vstack', 'np.vstack', (['(coords, on...
#!/usr/bin/python import qitensor.benchmark_cy as bc #print "random_channels" #bc.random_channels() print("orbit") bc.orbit()
[ "qitensor.benchmark_cy.orbit" ]
[((117, 127), 'qitensor.benchmark_cy.orbit', 'bc.orbit', ([], {}), '()\n', (125, 127), True, 'import qitensor.benchmark_cy as bc\n')]
import FWCore.ParameterSet.Config as cms from TrackingTools.MaterialEffects.MaterialPropagator_cfi import MaterialPropagator MaterialPropagatorParabolicMF = MaterialPropagator.clone( SimpleMagneticField = 'ParabolicMf', ComponentName = 'PropagatorWithMaterialParabolicMf' ) from TrackingTools.MaterialEff...
[ "TrackingTools.MaterialEffects.OppositeMaterialPropagator_cfi.OppositeMaterialPropagator.clone", "TrackingTools.MaterialEffects.MaterialPropagator_cfi.MaterialPropagator.clone" ]
[((158, 273), 'TrackingTools.MaterialEffects.MaterialPropagator_cfi.MaterialPropagator.clone', 'MaterialPropagator.clone', ([], {'SimpleMagneticField': '"""ParabolicMf"""', 'ComponentName': '"""PropagatorWithMaterialParabolicMf"""'}), "(SimpleMagneticField='ParabolicMf', ComponentName=\n 'PropagatorWithMaterialParab...
""" Upwork Earnings """ import logging.config import pandas as pd import yaml from datetime import datetime from pathlib import Path from helpers.helper_functions import timing @timing def main_function(config, logger): """ Main function """ logger.info("Main function") # Read input data df = pd.r...
[ "pandas.read_csv", "pathlib.Path", "datetime.datetime.now" ]
[((316, 346), 'pandas.read_csv', 'pd.read_csv', ([], {}), "(**config['input'])\n", (327, 346), True, 'import pandas as pd\n'), ((602, 639), 'pathlib.Path', 'Path', (["config['output']['folder_path']"], {}), "(config['output']['folder_path'])\n", (606, 639), False, 'from pathlib import Path\n'), ((703, 747), 'pathlib.Pa...
# Generated by Django 3.1.12 on 2021-09-09 14:23 import pkgutil from django.db import connection from django.db import migrations from django.db import models def add_aws_views(apps, schema_editor): """Create the AWS Materialized views from files.""" version = "_20210910" views = { f"sql/views/{v...
[ "django.db.migrations.RunPython", "pkgutil.get_data", "django.db.connection.cursor", "django.db.models.DecimalField" ]
[((1446, 1481), 'django.db.migrations.RunPython', 'migrations.RunPython', (['add_aws_views'], {}), '(add_aws_views)\n', (1466, 1481), False, 'from django.db import migrations\n'), ((877, 954), 'pkgutil.get_data', 'pkgutil.get_data', (['"""reporting.provider.aws"""', 'f"""{base_path}{view}{version}.sql"""'], {}), "('rep...
import argparse import importlib import os from django.contrib.contenttypes.models import ContentType from django.core.management.base import BaseCommand from django_excel_to_model.field_tools import get_valid_excel_field_name from django_excel_to_model.file_readers.csv_reader import CsvFile from django_excel_to_model...
[ "argparse.ArgumentParser", "django_excel_to_model.management.commands.utils.bulk_inserter.BulkInserter", "os.path.basename", "importlib.import_module", "django.contrib.contenttypes.models.ContentType.objects.get", "django_excel_to_model.field_tools.get_valid_excel_field_name", "django.contrib.contenttyp...
[((4553, 4596), 'django.contrib.contenttypes.models.ContentType.objects.get', 'ContentType.objects.get', ([], {'pk': 'content_type_id'}), '(pk=content_type_id)\n', (4576, 4596), False, 'from django.contrib.contenttypes.models import ContentType\n'), ((1241, 1291), 'importlib.import_module', 'importlib.import_module', (...
import random async def lotteryPick(guild): return random.choice(guild.members)
[ "random.choice" ]
[((57, 85), 'random.choice', 'random.choice', (['guild.members'], {}), '(guild.members)\n', (70, 85), False, 'import random\n')]
# -*- coding: utf-8 -*- # Copyright © 2016 <NAME> # # 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, modify, mer...
[ "IPython.config.Config", "IPython.nbconvert.exporters.HTMLExporter" ]
[((1798, 1838), 'IPython.config.Config', 'Config', (["self.site.config['IPYNB_CONFIG']"], {}), "(self.site.config['IPYNB_CONFIG'])\n", (1804, 1838), False, 'from IPython.config import Config\n'), ((1861, 1883), 'IPython.nbconvert.exporters.HTMLExporter', 'HTMLExporter', ([], {'config': 'c'}), '(config=c)\n', (1873, 188...
#!/usr/bin/env python import Tkinter as Tk root=Tk.Tk() l=Tk.Label(root, width=10, height=2, text="Hello!!", ) def print_click(event): print("Right button Clicked\n") l.bind("<Button-2>", print_click) l.pack() root.mainloop()
[ "Tkinter.Label", "Tkinter.Tk" ]
[((49, 56), 'Tkinter.Tk', 'Tk.Tk', ([], {}), '()\n', (54, 56), True, 'import Tkinter as Tk\n'), ((60, 110), 'Tkinter.Label', 'Tk.Label', (['root'], {'width': '(10)', 'height': '(2)', 'text': '"""Hello!!"""'}), "(root, width=10, height=2, text='Hello!!')\n", (68, 110), True, 'import Tkinter as Tk\n')]
from secrets import IEX_CLOUD_API_TOKEN as iex_tkn import pandas as pd import requests from statistics import mean from scipy import stats import math stocks_file = 'sp_500_stocks.csv' api_url = "https://sandbox.iexapis.com/stable/" def get_stocks_info(stocks): symbol_strings = [] for chunk in list(chunks(st...
[ "pandas.DataFrame", "pandas.read_csv", "math.floor", "statistics.mean", "requests.get", "scipy.stats.percentileofscore" ]
[((2066, 2084), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {}), '(data)\n', (2078, 2084), True, 'import pandas as pd\n'), ((4595, 4616), 'pandas.read_csv', 'pd.read_csv', (['filename'], {}), '(filename)\n', (4606, 4616), True, 'import pandas as pd\n'), ((2733, 2807), 'scipy.stats.percentileofscore', 'stats.percenti...
# -*- coding: iso-8859-1 -*- # # Copyright (C) 2011 <NAME> <<EMAIL>> # All rights reserved. # # Copyright (C) 2006 <NAME> <<EMAIL>> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http...
[ "trac.wiki.api.WikiSystem", "trac.util.html.TracHTMLSanitizer", "genshi.core.Markup", "trac.util.compat.sorted", "genshi.core.Stream", "re.match", "re.escape", "genshi.builder.tag.kbd", "genshi.builder.tag.td" ]
[((1117, 1133), 'genshi.core.Markup', 'Markup', (['"""&nbsp;"""'], {}), "('&nbsp;')\n", (1123, 1133), False, 'from genshi.core import Markup, Stream\n'), ((1776, 1819), 'genshi.builder.tag.td', 'tag.td', (['rendered', 'nbsp'], {'style': '"""border:none"""'}), "(rendered, nbsp, style='border:none')\n", (1782, 1819), Fal...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'workspace_spliter.ui' # # Created: Tue Mar 24 13:44:48 2015 # by: PyQt4 UI code generator 4.11.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 exc...
[ "PyQt4.QtGui.QGroupBox", "PyQt4.QtGui.QApplication.translate", "PyQt4.QtGui.QLineEdit", "PyQt4.QtGui.QGridLayout", "PyQt4.QtCore.QMetaObject.connectSlotsByName", "PyQt4.QtGui.QIcon", "PyQt4.QtGui.QToolButton", "PyQt4.QtGui.QDialogButtonBox" ]
[((492, 556), 'PyQt4.QtGui.QApplication.translate', 'QtGui.QApplication.translate', (['context', 'text', 'disambig', '_encoding'], {}), '(context, text, disambig, _encoding)\n', (520, 556), False, 'from PyQt4 import QtCore, QtGui\n'), ((928, 941), 'PyQt4.QtGui.QIcon', 'QtGui.QIcon', ([], {}), '()\n', (939, 941), False,...
#!/usr/bin/env python """Quick total hack to transform the LC-maintained webpage with bib-1 error definitions into a Python dictionary. Needs a tiny bit of by-hand postprocessing. File ends up in bib1msg.py, which is part of the distribution, so you shouldn't ever need to run this. """ from __future__ import print_fu...
[ "htmllib.HTMLParser.__init__", "formatter.NullFormatter" ]
[((1329, 1354), 'formatter.NullFormatter', 'formatter.NullFormatter', ([], {}), '()\n', (1352, 1354), False, 'import formatter\n'), ((524, 555), 'htmllib.HTMLParser.__init__', 'HTMLParser.__init__', (['self', 'form'], {}), '(self, form)\n', (543, 555), False, 'from htmllib import HTMLParser\n')]
import logging from queue import Empty from multiprocessing import Pool, cpu_count from serial.tools import list_ports from serial import SerialException from protoSBN1.protoSBN1 import ProtoSBN1Packet from protoSBN1.protoSBN1_serial import ProtoSBN1SerialPortComm from protoSBN1.protoSBN1_operand import ProtoSBN1Operan...
[ "multiprocessing.cpu_count", "serial.tools.list_ports.comports", "protoSBN1.protoSBN1_serial.ProtoSBN1SerialPortComm" ]
[((1872, 1917), 'protoSBN1.protoSBN1_serial.ProtoSBN1SerialPortComm', 'ProtoSBN1SerialPortComm', (['port_name', 'baud_rate'], {}), '(port_name, baud_rate)\n', (1895, 1917), False, 'from protoSBN1.protoSBN1_serial import ProtoSBN1SerialPortComm\n'), ((606, 729), 'protoSBN1.protoSBN1_serial.ProtoSBN1SerialPortComm', 'Pro...
from django.shortcuts import render from django.http import HttpResponse from django.views import View from .forms import Myform,RegisterForm from .models import User class IndexView(View): def get(self,request): form = Myform() return render(request,'index.html',context={'form':form}) def post...
[ "django.shortcuts.render", "django.http.HttpResponse" ]
[((257, 310), 'django.shortcuts.render', 'render', (['request', '"""index.html"""'], {'context': "{'form': form}"}), "(request, 'index.html', context={'form': form})\n", (263, 310), False, 'from django.shortcuts import render\n'), ((803, 857), 'django.shortcuts.render', 'render', (['request', '"""signup.html"""'], {'co...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import...
[ "pulumi.get", "pulumi.getter", "pulumi.ResourceOptions", "pulumi.set" ]
[((2759, 2793), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""accessConfig"""'}), "(name='accessConfig')\n", (2772, 2793), False, 'import pulumi\n'), ((3939, 3975), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""softwareConfig"""'}), "(name='softwareConfig')\n", (3952, 3975), False, 'import pulumi\n'), ((442...
from src.pre_process import pre_process def test_comments_and_directives(): with open("test/pre_process/main.c") as input_file: with open("test/pre_process/main.solved.c") as output_file: input_text = input_file.read() output_text = output_file.read() assert pre_process...
[ "src.pre_process.pre_process" ]
[((309, 332), 'src.pre_process.pre_process', 'pre_process', (['input_text'], {}), '(input_text)\n', (320, 332), False, 'from src.pre_process import pre_process\n')]
import logging import warnings import numpy as np import pandas as pd from scipy import integrate, stats from scipy.interpolate import InterpolatedUnivariateSpline from .util import log_err_func def cal_chi_square(f_hat_array, f_array): chi_square = np.sum((f_hat_array - f_array) ** 2 / f_hat_array) return...
[ "numpy.zeros_like", "numpy.sum", "scipy.interpolate.InterpolatedUnivariateSpline", "numpy.log", "warnings.filterwarnings", "numpy.ones_like", "numpy.polyval", "scipy.stats.gaussian_kde", "numpy.isfinite", "logging.info", "numpy.arange", "numpy.sqrt" ]
[((259, 309), 'numpy.sum', 'np.sum', (['((f_hat_array - f_array) ** 2 / f_hat_array)'], {}), '((f_hat_array - f_array) ** 2 / f_hat_array)\n', (265, 309), True, 'import numpy as np\n'), ((417, 451), 'scipy.interpolate.InterpolatedUnivariateSpline', 'InterpolatedUnivariateSpline', (['x', 'y'], {}), '(x, y)\n', (445, 451...
# -*- coding: utf-8 -*- # Copyright: (c) 2018, Ansible Project # Copyright: (c) 2018, <NAME> <<EMAIL>> # Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) from __future__ import absolute_import, division, print_function __metaclass__ = type import traceback REQU...
[ "ansible.module_utils._text.to_native", "requests.Session", "ansible.module_utils.basic.missing_required_lib", "com.vmware.vapi.std_client.DynamicID", "vmware.vapi.lib.connect.get_requests_connector", "vmware.vapi.security.session.create_session_security_context", "com.vmware.cis_client.Session", "tra...
[((432, 454), 'traceback.format_exc', 'traceback.format_exc', ([], {}), '()\n', (452, 454), False, 'import traceback\n'), ((639, 661), 'traceback.format_exc', 'traceback.format_exc', ([], {}), '()\n', (659, 661), False, 'import traceback\n'), ((1105, 1127), 'traceback.format_exc', 'traceback.format_exc', ([], {}), '()\...
# -*- encoding:utf-8 -*- """策略验证工具图形可视化""" from __future__ import print_function from __future__ import absolute_import from __future__ import division import ipywidgets as widgets from ..WidgetBu.ABuWGBase import WidgetBase from ..WidgetBu.ABuWGGridSearch import WidgetGridSearch from ..WidgetBu.ABuWGCrossVal import...
[ "ipywidgets.VBox", "ipywidgets.Tab" ]
[((580, 593), 'ipywidgets.Tab', 'widgets.Tab', ([], {}), '()\n', (591, 593), True, 'import ipywidgets as widgets\n'), ((803, 833), 'ipywidgets.VBox', 'widgets.VBox', (['[sub_widget_tab]'], {}), '([sub_widget_tab])\n', (815, 833), True, 'import ipywidgets as widgets\n')]
'''Compiles the information into a CSV for making radar plot''' # Standard library imports import json from collections import Counter # Categories compile results for CATEGORIES = 'Adult Arts Business Computers Games Health Home Kids_and_Teens \ News Recreation Reference Regional Science Shopping Soci...
[ "collections.Counter" ]
[((1082, 1096), 'collections.Counter', 'Counter', (['cdn1s'], {}), '(cdn1s)\n', (1089, 1096), False, 'from collections import Counter\n'), ((1099, 1113), 'collections.Counter', 'Counter', (['cdn2s'], {}), '(cdn2s)\n', (1106, 1113), False, 'from collections import Counter\n')]
""" countTxtTop15.py author: GlennGorgoth date: Nov 4, 2020 Imports a .txt file and counts all occurances of each word. Returns the top 15 words, with their respective count. """ from hashmap import HashMap # Change TEXT to the path of the file you want to count TEXT = 'AliceInWonderland.txt' def clean_line(raw_li...
[ "hashmap.HashMap" ]
[((1010, 1019), 'hashmap.HashMap', 'HashMap', ([], {}), '()\n', (1017, 1019), False, 'from hashmap import HashMap\n')]
import pygame import sys import random import math pygame.init() pygame.key.set_repeat(1, 1) window = pygame.display.set_mode((600, 600)) NodeRad = 5 NodeDiam = NodeRad * 2 EConst = 200 SConst = 0.1 SLen = 5 Damp = 0.5 TimeStep = 0.8 class Graph(object): def __init__(self, surface): self.surface = surface self....
[ "pygame.draw.line", "pygame.draw.circle", "math.sqrt", "random.uniform", "pygame.event.get", "pygame.display.set_mode", "pygame.init", "pygame.display.flip", "pygame.key.set_repeat", "pygame.time.Clock", "sys.exit" ]
[((52, 65), 'pygame.init', 'pygame.init', ([], {}), '()\n', (63, 65), False, 'import pygame\n'), ((66, 93), 'pygame.key.set_repeat', 'pygame.key.set_repeat', (['(1)', '(1)'], {}), '(1, 1)\n', (87, 93), False, 'import pygame\n'), ((103, 138), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(600, 600)'], {}), '(...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu May 13 10:36:07 2021 @author: liang """ from flask import Flask,request,make_response from flask_cors import CORS import tensorflow as tf import json from split_flow import split from rec_predict import RecPredictHandler #from recall_main import get_...
[ "flask_cors.CORS", "utils.load_fea_main.loadalldata", "utils.db_utils.build_redis_connect", "flask.Flask", "json.dumps", "tensorflow.compat.v1.Session", "tensorflow.compat.v1.ConfigProto", "flask.request.get_json", "rec_predict.RecPredictHandler" ]
[((571, 597), 'tensorflow.compat.v1.ConfigProto', 'tf.compat.v1.ConfigProto', ([], {}), '()\n', (595, 597), True, 'import tensorflow as tf\n'), ((644, 679), 'tensorflow.compat.v1.Session', 'tf.compat.v1.Session', ([], {'config': 'config'}), '(config=config)\n', (664, 679), True, 'import tensorflow as tf\n'), ((829, 859...
from urllib.parse import parse_qsl, quote, urlparse import requests from bs4 import BeautifulSoup as bs from bs4.element import Tag from django.conf import settings from requests.exceptions import RequestException import magic mime = magic.Magic(mime=True) RATIO_16_9 = 16 / 9 RATIO_10_1 = 10 RATIO_1_1 = 1 def is_n...
[ "requests.head", "magic.Magic", "urllib.parse.quote", "requests.get", "bs4.BeautifulSoup", "urllib.parse.parse_qsl", "urllib.parse.urlparse" ]
[((237, 259), 'magic.Magic', 'magic.Magic', ([], {'mime': '(True)'}), '(mime=True)\n', (248, 259), False, 'import magic\n'), ((1162, 1181), 'urllib.parse.urlparse', 'urlparse', (['video_url'], {}), '(video_url)\n', (1170, 1181), False, 'from urllib.parse import parse_qsl, quote, urlparse\n'), ((1228, 1252), 'urllib.par...
import unittest from abc import ABCMeta from ip_to_mac_mapper import IpToMacMapper class AbstractTest(unittest.TestCase): __metaclass__ = ABCMeta def setUp(self): self.mockedMapping = IpToMacMapper().set_all({ '192.168.56.101': '08:00:27:B0:A1:AB', '192.168.56.102': '08:00:27...
[ "ip_to_mac_mapper.IpToMacMapper" ]
[((204, 219), 'ip_to_mac_mapper.IpToMacMapper', 'IpToMacMapper', ([], {}), '()\n', (217, 219), False, 'from ip_to_mac_mapper import IpToMacMapper\n')]
#!/usr/bin/env python """ A simple python script for parsing CASTEP (http://www.castep.org/) output files especially for ELNES calculations. This includes some functions for reading .cell, .castep, .bands, and .eels_mat files, calculating excitation energy, and forming core-loss spectra with Gaussian smearing. Copyri...
[ "numpy.abs", "numpy.array", "numpy.exp", "numpy.sqrt", "os.path.join", "numpy.prod", "re.compile" ]
[((3729, 3794), 're.compile', 're.compile', (['f"""Atomic calculation performed for {element}{suffix}"""'], {}), "(f'Atomic calculation performed for {element}{suffix}')\n", (3739, 3794), False, 'import re\n'), ((3807, 3886), 're.compile', 're.compile', (['"""Converged in \\\\d+ iterations to an ae energy of ([\\\\d\\\...
from django.core.management.commands import showmigrations from django.db import DEFAULT_DB_ALIAS from django.db.migrations.loader import MigrationLoader from django.db.migrations.recorder import MigrationRecorder class Command(showmigrations.Command): help = "Shows the most recently applied migration for each ap...
[ "django.db.migrations.loader.MigrationLoader", "django.db.migrations.recorder.MigrationRecorder" ]
[((1349, 1376), 'django.db.migrations.loader.MigrationLoader', 'MigrationLoader', (['connection'], {}), '(connection)\n', (1364, 1376), False, 'from django.db.migrations.loader import MigrationLoader\n'), ((1607, 1636), 'django.db.migrations.recorder.MigrationRecorder', 'MigrationRecorder', (['connection'], {}), '(conn...
import torch import torch.utils.data as data import numpy as np import math from pycocotools.coco import COCO import os from PIL import Image from maskrcnn_benchmark.structures.bounding_box import BoxList from maskrcnn_benchmark.structures.segmentation_mask import SegmentationMask class KITTIDataset(data.Dataset): ...
[ "maskrcnn_benchmark.structures.bounding_box.BoxList", "PIL.Image.open", "maskrcnn_benchmark.structures.segmentation_mask.SegmentationMask", "pycocotools.coco.COCO", "torch.as_tensor", "torch.tensor" ]
[((497, 516), 'pycocotools.coco.COCO', 'COCO', (['self.ann_file'], {}), '(self.ann_file)\n', (501, 516), False, 'from pycocotools.coco import COCO\n'), ((1758, 1779), 'torch.tensor', 'torch.tensor', (['classes'], {}), '(classes)\n', (1770, 1779), False, 'import torch\n'), ((1895, 1941), 'maskrcnn_benchmark.structures.s...
import random # Test data numbers = [14175, 15055, 16616, 17495, 18072, 19390, 19731, 22161, 23320, 23717, 26343, 28725, 29127, 32257, 40020, 41867, 43155, 46298, 56734, 57176, 58306, 61848, 65825, 66042, 68634, 69189, 72936, 74287, 74537, 81942, 82027, 82623, 82802, 82988, 904...
[ "random.randint" ]
[((5818, 5838), 'random.randint', 'random.randint', (['(0)', '(1)'], {}), '(0, 1)\n', (5832, 5838), False, 'import random\n')]
import tensorflow as tf x = tf.constant(3.0) y = tf.constant(2.0) z = tf.constant(5.0) h = x + y g = h * z with tf.Session() as sess: print(sess.run(x)) # 3 print(sess.run(h)) # 5 print(h.eval()) # 5 print(sess.run(g)) # 25 print(sess.run([g, h])) # 25, 5
[ "tensorflow.Session", "tensorflow.constant" ]
[((31, 47), 'tensorflow.constant', 'tf.constant', (['(3.0)'], {}), '(3.0)\n', (42, 47), True, 'import tensorflow as tf\n'), ((53, 69), 'tensorflow.constant', 'tf.constant', (['(2.0)'], {}), '(2.0)\n', (64, 69), True, 'import tensorflow as tf\n'), ((75, 91), 'tensorflow.constant', 'tf.constant', (['(5.0)'], {}), '(5.0)\...
from PyQt5.QtCore import QUrl from PyQt5.QtGui import QColor from PyQt5.QtWidgets import QFileDialog from typing import List from src.model.point import Point from src.model.line import Line from src.model.polygon import Polygon import os.path class WavefrontOBJ: def __init__(self): self.path = None ...
[ "src.model.point.Point", "PyQt5.QtWidgets.QFileDialog.getSaveFileName", "PyQt5.QtCore.QUrl.fromLocalFile" ]
[((3685, 3714), 'PyQt5.QtWidgets.QFileDialog.getSaveFileName', 'QFileDialog.getSaveFileName', ([], {}), '()\n', (3712, 3714), False, 'from PyQt5.QtWidgets import QFileDialog\n'), ((3790, 3821), 'PyQt5.QtCore.QUrl.fromLocalFile', 'QUrl.fromLocalFile', (['filename[0]'], {}), '(filename[0])\n', (3808, 3821), False, 'from ...
import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() with open('requirements.txt') as requirements_file: install_requirements = requirements_file.read().splitlines() setup( name="azurectx", version="0.0.2", author="<NAME>", ...
[ "os.path.dirname" ]
[((87, 112), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (102, 112), False, 'import os\n')]
from typing import Tuple import torch import torch.nn as nn from paccmann_sets.models.decoders.decoder_sets_ae import DecoderSetsAE from paccmann_sets.models.encoders.encoder_sets_ae import EncoderSetsAE class SetsAE(nn.Module): def __init__( self, device: torch.device = torch. device('c...
[ "paccmann_sets.models.encoders.encoder_sets_ae.EncoderSetsAE", "torch.cuda.is_available", "paccmann_sets.models.decoders.decoder_sets_ae.DecoderSetsAE" ]
[((758, 781), 'paccmann_sets.models.encoders.encoder_sets_ae.EncoderSetsAE', 'EncoderSetsAE', ([], {}), '(**params)\n', (771, 781), False, 'from paccmann_sets.models.encoders.encoder_sets_ae import EncoderSetsAE\n'), ((806, 829), 'paccmann_sets.models.decoders.decoder_sets_ae.DecoderSetsAE', 'DecoderSetsAE', ([], {}), ...
from collections import defaultdict, deque, namedtuple from pprint import pprint test = False def parse(): with open(f"../input/{'test_' if test else ''}day12.txt") as f: lines = [x.strip() for x in f.readlines()] graph = defaultdict(set) for line in lines: start, end = line.split("-") ...
[ "collections.defaultdict", "pprint.pprint" ]
[((241, 257), 'collections.defaultdict', 'defaultdict', (['set'], {}), '(set)\n', (252, 257), False, 'from collections import defaultdict, deque, namedtuple\n'), ((1360, 1371), 'pprint.pprint', 'pprint', (['fin'], {}), '(fin)\n', (1366, 1371), False, 'from pprint import pprint\n')]
############################################################### # _ _ _ _ _ # | |__ (_) ___ _ __ __ _ _ __| |_(_) ___| | ___ # | '_ \| |/ _ \| '_ \ / _` | '__| __| |/ __| |/ _ \ # | |_) | | (_) | |_) | (_| | | | |_| | (__| | __/ # |_.__/|_|\___/| .__/ \__,_|_| \__|_|\___|_|\___...
[ "pandas.read_csv", "os.system", "sys.exit" ]
[((2849, 2874), 'pandas.read_csv', 'read_csv', (['parameters_file'], {}), '(parameters_file)\n', (2857, 2874), False, 'from pandas import read_csv\n'), ((2981, 3003), 'os.system', 'system', (['"""rm -rf CASE*"""'], {}), "('rm -rf CASE*')\n", (2987, 3003), False, 'from os import system\n'), ((3123, 3156), 'os.system', '...
from __future__ import absolute_import from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from sentry.api.base import Endpoint, DEFAULT_AUTHENTICATION from clims.utils import single_or_default from clims.api.serializers.models.work_definition import WorkDefinitionSeria...
[ "clims.api.serializers.models.workunit.WorkUnitSerializer", "clims.api.serializers.models.work_definition.WorkDefinitionSerializer", "rest_framework.response.Response", "clims.utils.single_or_default" ]
[((929, 964), 'clims.utils.single_or_default', 'single_or_default', (['work_definitions'], {}), '(work_definitions)\n', (946, 964), False, 'from clims.utils import single_or_default\n'), ((1585, 1598), 'rest_framework.response.Response', 'Response', (['ret'], {}), '(ret)\n', (1593, 1598), False, 'from rest_framework.re...
# Copyright The PyTorch Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
[ "flash.data.data_utils.labels_from_categorical_csv", "pathlib.Path", "flash.vision.ImageClassificationData.from_folders", "numpy.random.randint", "os.path.splitext", "torch.rand", "flash.vision.ImageClassificationData.from_filepaths", "os.path.join", "torchvision.transforms.ToTensor" ]
[((876, 897), 'torch.rand', 'torch.rand', (['(3)', '(64)', '(64)'], {}), '(3, 64, 64)\n', (886, 897), False, 'import torch\n'), ((1051, 1233), 'flash.vision.ImageClassificationData.from_filepaths', 'ImageClassificationData.from_filepaths', ([], {'train_filepaths': "['a', 'b']", 'train_labels': '[0, 1]', 'train_transfor...
import pandas as pd import os import subprocess task_names = ['CoLA', 'MNLI-m', 'MNLI-mm', 'MRPC', 'SST-2', 'STS-B', 'QQP', 'QNLI', 'RTE', 'WNLI'] tsv = pd.DataFrame({"id": [x for x in range(1104)], "label": ["1"]*1104}) tsv.to_csv(f"TestResult/AX.tsv", sep='\t',index=False) for task in task_names: print(task) ...
[ "pandas.DataFrame", "os.path.join" ]
[((1502, 1544), 'pandas.DataFrame', 'pd.DataFrame', (["{'id': ids, 'label': labels}"], {}), "({'id': ids, 'label': labels})\n", (1514, 1544), True, 'import pandas as pd\n'), ((1053, 1086), 'os.path.join', 'os.path.join', (['data_dir', 'data_file'], {}), '(data_dir, data_file)\n', (1065, 1086), False, 'import os\n')]
import fresnel def _get_default_material(solid=0): """Return a default material type. 2D shapes should use ``solid=1`` to remove lighting effects. """ return fresnel.material.Material( solid=solid, color=(0, 0, 0), primitive_color_mix=1, roughness=0.3, specular...
[ "fresnel.material.Material" ]
[((177, 312), 'fresnel.material.Material', 'fresnel.material.Material', ([], {'solid': 'solid', 'color': '(0, 0, 0)', 'primitive_color_mix': '(1)', 'roughness': '(0.3)', 'specular': '(0.5)', 'spec_trans': '(0)', 'metal': '(0)'}), '(solid=solid, color=(0, 0, 0), primitive_color_mix\n =1, roughness=0.3, specular=0.5, ...
from .exceptions import CommandNotFound, RunTimeError from .utils import singleton import shlex @singleton class CommandManager: def __init__(self): self.commands = dict() def register(self, name, cmd): self.commands[name] = cmd def run_command(self, name, root, *args, **kwargs): ...
[ "shlex.split" ]
[((1031, 1052), 'shlex.split', 'shlex.split', (['cmd_line'], {}), '(cmd_line)\n', (1042, 1052), False, 'import shlex\n')]
import pandas as pd import pytz from pandas_market_calendars.exchange_calendar_cme_agriculture import CMEAgricultureExchangeCalendar def test_time_zone(): assert CMEAgricultureExchangeCalendar().tz == pytz.timezone('America/Chicago') assert CMEAgricultureExchangeCalendar().name == 'CME_Agriculture' def tes...
[ "pandas_market_calendars.exchange_calendar_cme_agriculture.CMEAgricultureExchangeCalendar", "pandas.Timestamp", "pytz.timezone" ]
[((819, 851), 'pandas_market_calendars.exchange_calendar_cme_agriculture.CMEAgricultureExchangeCalendar', 'CMEAgricultureExchangeCalendar', ([], {}), '()\n', (849, 851), False, 'from pandas_market_calendars.exchange_calendar_cme_agriculture import CMEAgricultureExchangeCalendar\n'), ((1228, 1260), 'pandas_market_calend...
#!/usr/bin/env python3 """ Measure the overhead of a logging call doing nothing. """ import io import logging import six from six.moves import xrange import pyperf FORMAT = 'important: %s' MESSAGE = 'some important information to be logged' def bench_logging_silent(loops, logger, stream): # micro-optimization:...
[ "io.StringIO", "io.BytesIO", "logging.StreamHandler", "pyperf.Runner", "six.moves.xrange", "pyperf.perf_counter", "logging.getLogger" ]
[((377, 390), 'six.moves.xrange', 'xrange', (['loops'], {}), '(loops)\n', (383, 390), False, 'from six.moves import xrange\n'), ((400, 421), 'pyperf.perf_counter', 'pyperf.perf_counter', ([], {}), '()\n', (419, 421), False, 'import pyperf\n'), ((892, 907), 'pyperf.Runner', 'pyperf.Runner', ([], {}), '()\n', (905, 907),...
# Copyright (C) 2020-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import sys from argparse import ArgumentParser import extractor def parse_args(argv): """ Parse and process arguments for frames-extractor tool """ parser = ArgumentParser(description='Frames-extractor toolkit', allow_...
[ "argparse.ArgumentParser" ]
[((259, 333), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""Frames-extractor toolkit"""', 'allow_abbrev': '(False)'}), "(description='Frames-extractor toolkit', allow_abbrev=False)\n", (273, 333), False, 'from argparse import ArgumentParser\n')]
"""This module provides functionality to interact with user data in database.""" import logging import bcrypt from asyncpg import exceptions from sqlalchemy import func from sqlalchemy.orm import relationship from sqlalchemy.exc import SQLAlchemyError from app.db import db from app.models import BaseModelMixin, pars...
[ "bcrypt.checkpw", "bcrypt.gensalt", "app.utils.errors.DatabaseError", "sqlalchemy.func.now", "app.models.parse_status", "app.db.db.String", "sqlalchemy.orm.relationship", "app.db.db.Column", "app.utils.errors.DBNoResultFoundError", "logging.getLogger" ]
[((405, 432), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (422, 432), False, 'import logging\n'), ((580, 639), 'app.db.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)', 'autoincrement': '(True)'}), '(db.Integer, primary_key=True, autoincrement=True)\n', (589, 639), Fa...
#!/usr/bin/env python3 import datetime as dt import json import os from pathlib import Path import pip._vendor.requests as requests from app import Config, Database class Vk: last_res_path = Path('last_res.txt') error_path = Path('error.txt') def __init__(self, vk_config): self.vk_config = vk_c...
[ "json.load", "app.Config", "pip._vendor.requests.get", "app.Database", "pathlib.Path", "datetime.datetime.fromtimestamp" ]
[((199, 219), 'pathlib.Path', 'Path', (['"""last_res.txt"""'], {}), "('last_res.txt')\n", (203, 219), False, 'from pathlib import Path\n'), ((237, 254), 'pathlib.Path', 'Path', (['"""error.txt"""'], {}), "('error.txt')\n", (241, 254), False, 'from pathlib import Path\n'), ((3557, 3565), 'app.Config', 'Config', ([], {})...
#!/usr/bin/env/python import cv2 import time import sys from omnicv import fisheyeImgConv img_path = sys.argv[1] dice = int(sys.argv[2]) equiRect = cv2.imread(img_path) inShape = equiRect.shape[:2] mapper = fisheyeImgConv() # Uncomment any of the given block to run desired example """ # For single image in horio...
[ "omnicv.fisheyeImgConv", "cv2.waitKey", "time.time", "cv2.imread", "cv2.imshow" ]
[((151, 171), 'cv2.imread', 'cv2.imread', (['img_path'], {}), '(img_path)\n', (161, 171), False, 'import cv2\n'), ((211, 227), 'omnicv.fisheyeImgConv', 'fisheyeImgConv', ([], {}), '()\n', (225, 227), False, 'from omnicv import fisheyeImgConv\n'), ((542, 553), 'time.time', 'time.time', ([], {}), '()\n', (551, 553), Fals...
# -*- coding: utf-8 -*- # Generated by Django 1.11.11 on 2019-06-17 06:42 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('goods', '0002_auto_20190327_0415'), ] operations ...
[ "django.db.models.ForeignKey" ]
[((441, 580), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'django.db.models.deletion.PROTECT', 'related_name': '"""specs"""', 'to': '"""goods.SPUSpecification"""', 'verbose_name': '"""规格名称"""'}), "(on_delete=django.db.models.deletion.PROTECT, related_name\n ='specs', to='goods.SPUSpecifica...