code
stringlengths
22
1.05M
apis
listlengths
1
3.31k
extract_api
stringlengths
75
3.25M
from Experiments import test_knapsack_weighted, test_knapsack_unit """ Example Dnl experiments on weighted and unit knapsack problems. Test boolean (boolean array): determines the variations of dnl used. The order is [Exhaustive, Exhaustive_max, Dnl, dnl_max, dnl_greedy]. exhaustive, dnl and dnl_greedy are used in t...
[ "Experiments.test_knapsack_weighted", "Experiments.test_knapsack_unit" ]
[((613, 883), 'Experiments.test_knapsack_weighted', 'test_knapsack_weighted', ([], {'max_step_size_magnitude': '(0)', 'min_step_size_magnitude': '(-1)', 'capacities': 'capacities', 'epoch_limit': '(3)', 'kfolds': 'kfolds', 'test_boolean': '[0, 0, 0, 0, 1]', 'core_number': '(8)', 'is_shuffle': '(False)', 'learning_rate'...
from io import StringIO from django.core.management import call_command from django.core.management.base import CommandError from django.test import TestCase from flags.state import flag_enabled class EnableFlagTestCase(TestCase): def test_enable_flag(self): out = StringIO() self.assertFalse(fla...
[ "io.StringIO", "flags.state.flag_enabled", "django.core.management.call_command" ]
[((281, 291), 'io.StringIO', 'StringIO', ([], {}), '()\n', (289, 291), False, 'from io import StringIO\n'), ((350, 400), 'django.core.management.call_command', 'call_command', (['"""enable_flag"""', '"""DB_FLAG"""'], {'stdout': 'out'}), "('enable_flag', 'DB_FLAG', stdout=out)\n", (362, 400), False, 'from django.core.ma...
from PDA import PDA import math EMPTY_STRING = '' def int_to_bin(x): return x.__format__('b') def s_2(x): return int_to_bin(x).count('1') def base_b(n,b): s = EMPTY_STRING while n > 0: s += str(n % b) n //= b return s[::-1] def s_b(n,b): count = 0 while n > 0: ...
[ "PDA.PDA", "math.log2", "math.log" ]
[((1425, 1501), 'PDA.PDA', 'PDA', (['states', 'alphabet', 'stack_alphabet', 'start_state', 'start_stack', 'transitions'], {}), '(states, alphabet, stack_alphabet, start_state, start_stack, transitions)\n', (1428, 1501), False, 'from PDA import PDA\n'), ((2196, 2272), 'PDA.PDA', 'PDA', (['states', 'alphabet', 'stack_alp...
from django.contrib.auth.models import AbstractUser from django.db import models # Create your models here. class CustomUser(AbstractUser): date_of_birth = models.DateField(blank=True, null=True)
[ "django.db.models.DateField" ]
[((161, 200), 'django.db.models.DateField', 'models.DateField', ([], {'blank': '(True)', 'null': '(True)'}), '(blank=True, null=True)\n', (177, 200), False, 'from django.db import models\n')]
# Copyright © 2019 Province of British Columbia # # 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 agr...
[ "tests.utilities.base_test.get_payment_request", "json.dumps", "pay_api.utils.util.current_local_time", "tests.utilities.base_test.get_claims", "pay_api.utils.util.get_week_start_and_end_date", "datetime.timedelta", "pay_api.models.BcolPaymentAccount.find_by_id", "pay_api.models.payment_account.Paymen...
[((1706, 1772), 'pay_api.models.BcolPaymentAccount.find_by_id', 'BcolPaymentAccount.find_by_id', (['payment.invoices[0].bcol_account_id'], {}), '(payment.invoices[0].bcol_account_id)\n', (1735, 1772), False, 'from pay_api.models import BcolPaymentAccount\n'), ((1807, 1857), 'pay_api.models.payment_account.PaymentAccoun...
# -*- coding: utf-8 -*- import os import pandas as pd from progressbar import Bar, ETA, FileTransferSpeed, ProgressBar, Percentage, RotatingMarker from six.moves.urllib.request import urlretrieve def load_datasets(path=os.path.join(os.path.dirname(__file__), 'datasets.csv')): datasets = pd.read_csv(path) ret...
[ "os.path.exists", "pandas.read_csv", "os.makedirs", "os.path.join", "progressbar.RotatingMarker", "os.path.dirname", "progressbar.Percentage", "six.moves.urllib.request.urlretrieve", "progressbar.ETA", "progressbar.FileTransferSpeed", "progressbar.ProgressBar" ]
[((295, 312), 'pandas.read_csv', 'pd.read_csv', (['path'], {}), '(path)\n', (306, 312), True, 'import pandas as pd\n'), ((952, 980), 'progressbar.ProgressBar', 'ProgressBar', ([], {'widgets': 'widgets'}), '(widgets=widgets)\n', (963, 980), False, 'from progressbar import Bar, ETA, FileTransferSpeed, ProgressBar, Percen...
import requests from flask import ( Blueprint, session, current_app, abort, jsonify, make_response, redirect, request, url_for, render_template, g, ) import urllib.parse as urlparse bp = Blueprint("auth", __name__) from app.helpers import req_helper from app.helpers import...
[ "flask.render_template", "flask.request.args.get", "app.helpers.google_api_helper.get_user_data", "app.helpers.oauth_helper.get_oauth_client_msft", "app.models.util.token.destroy_token", "app.models.util.user.get_or_create_user", "flask.redirect", "app.helpers.session_helper.retirieve_token", "app.h...
[((233, 260), 'flask.Blueprint', 'Blueprint', (['"""auth"""', '__name__'], {}), "('auth', __name__)\n", (242, 260), False, 'from flask import Blueprint, session, current_app, abort, jsonify, make_response, redirect, request, url_for, render_template, g\n'), ((1506, 1538), 'app.helpers.session_helper.retirieve_token', '...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2021 Tianmian Tech. 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/LI...
[ "kernel.components.featurecalculation.base.calculation_info_sync.Promoter", "kernel.protobuf.generated.feature_calculation_meta_pb2.IVPercentileCalculationMeta", "common.python.utils.log_utils.get_logger", "kernel.components.featurecalculation.base.calculation_info_sync.Provider", "kernel.components.feature...
[((1871, 1893), 'common.python.utils.log_utils.get_logger', 'log_utils.get_logger', ([], {}), '()\n', (1891, 1893), False, 'from common.python.utils import log_utils\n'), ((3151, 3183), 'kernel.components.featurecalculation.base.calculation_info_sync.Promoter', 'calculation_info_sync.Promoter', ([], {}), '()\n', (3181,...
from tkinter import * import tkinter.messagebox from random import * import datetime now = datetime.datetime.now() def dayandnight(): if now.strftime("%X") > '16:45:39': return 'black' elif now.strftime("%X") < '15:40:00': return 'white' def dayand(): if now.strftime("%X") > '16:45:39': return 'white' ...
[ "datetime.datetime.now" ]
[((93, 116), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (114, 116), False, 'import datetime\n'), ((1612, 1635), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (1633, 1635), False, 'import datetime\n')]
import esphome.codegen as cg from esphome.components import text_sensor import esphome.config_validation as cv from esphome.const import CONF_ICON, CONF_ID, ICON_TIMELAPSE from . import ATORCH_DL24_COMPONENT_SCHEMA, CONF_ATORCH_DL24_ID DEPENDENCIES = ["atorch_dl24"] CODEOWNERS = ["@syssi"] CONF_RUNTIME_FORMATTED = ...
[ "esphome.codegen.new_Pvariable", "esphome.codegen.get_variable", "esphome.config_validation.Optional", "esphome.components.text_sensor.register_text_sensor", "esphome.config_validation.declare_id", "esphome.config_validation.GenerateID" ]
[((456, 491), 'esphome.config_validation.Optional', 'cv.Optional', (['CONF_RUNTIME_FORMATTED'], {}), '(CONF_RUNTIME_FORMATTED)\n', (467, 491), True, 'import esphome.config_validation as cv\n'), ((769, 813), 'esphome.codegen.get_variable', 'cg.get_variable', (['config[CONF_ATORCH_DL24_ID]'], {}), '(config[CONF_ATORCH_DL...
# -*- coding: utf-8 -*- """ This module contains a method for determining the highest concentration recorded by passed dataframes within the testing period (including sensor and/or reference data). ================================================================================ @Author: | <NAME>, NSSC Contractor (O...
[ "numpy.isnan" ]
[((2235, 2246), 'numpy.isnan', 'np.isnan', (['i'], {}), '(i)\n', (2243, 2246), True, 'import numpy as np\n')]
from __future__ import print_function import os.path import tempfile import shutil from pype9.cmd import convert import ninemlcatalog from nineml import read from lxml import etree import yaml if __name__ == '__main__': from pype9.utils.testing import DummyTestCase as TestCase # @UnusedImport else: from unitte...
[ "nineml.read", "lxml.etree.parse", "yaml.load", "tempfile.mkdtemp", "shutil.rmtree" ]
[((427, 445), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (443, 445), False, 'import tempfile\n'), ((479, 505), 'shutil.rmtree', 'shutil.rmtree', (['self.tmpdir'], {}), '(self.tmpdir)\n', (492, 505), False, 'import shutil\n'), ((1157, 1170), 'nineml.read', 'read', (['in_path'], {}), '(in_path)\n', (1161, ...
import torch import misc.utils as utils from misc.rewards import init_scorer, get_self_critical_reward def to_contiguous(tensor): if tensor.is_contiguous(): return tensor else: return tensor.contiguous() class LossWrapper(torch.nn.Module): def __init__(self, model, opt): super(LossWr...
[ "misc.utils.LabelSmoothing", "torch.sum", "misc.utils.LanguageModelCriterion" ]
[((454, 505), 'misc.utils.LabelSmoothing', 'utils.LabelSmoothing', ([], {'smoothing': 'opt.label_smoothing'}), '(smoothing=opt.label_smoothing)\n', (474, 505), True, 'import misc.utils as utils\n'), ((544, 574), 'misc.utils.LanguageModelCriterion', 'utils.LanguageModelCriterion', ([], {}), '()\n', (572, 574), True, 'im...
import random import sys class Card: def __init__(self, suit, value, face, ace): self.suit = suit self.value = value self.face = face self.ace = ace class Deck: def __init__(self): # Create a List to Hold all of the Cards in our Deck self.card = [] # Fil...
[ "random.randint" ]
[((3851, 3872), 'random.randint', 'random.randint', (['(0)', '(51)'], {}), '(0, 51)\n', (3865, 3872), False, 'import random\n'), ((3908, 3929), 'random.randint', 'random.randint', (['(0)', '(51)'], {}), '(0, 51)\n', (3922, 3929), False, 'import random\n')]
import unittest import json from typing import Any from src.shapeandshare.dicebox.config.dicebox_config import DiceboxConfig from src.shapeandshare.dicebox.factories.network_factory import NetworkFactory class DiceboxNetworkTest(unittest.TestCase): """ The basic class that inherits unittest.TestCase """ ...
[ "src.shapeandshare.dicebox.config.dicebox_config.DiceboxConfig", "json.load", "src.shapeandshare.dicebox.factories.network_factory.NetworkFactory", "unittest.TextTestRunner" ]
[((6522, 6547), 'unittest.TextTestRunner', 'unittest.TextTestRunner', ([], {}), '()\n', (6545, 6547), False, 'import unittest\n'), ((1573, 1622), 'src.shapeandshare.dicebox.config.dicebox_config.DiceboxConfig', 'DiceboxConfig', ([], {'config_file': 'self.local_config_file'}), '(config_file=self.local_config_file)\n', (...
"""Off-loaded private stuff from `vtec.py`.""" # pylint: disable=too-many-arguments from datetime import timedelta import itertools import pandas as pd from pyiem.util import LOG # When a VTEC product has an infinity time 000000T0000Z, we need some value # for the database to make things logically work. We arb pick ...
[ "pandas.DataFrame", "datetime.timedelta", "itertools.permutations" ]
[((432, 456), 'datetime.timedelta', 'timedelta', ([], {'hours': '(21 * 24)'}), '(hours=21 * 24)\n', (441, 456), False, 'from datetime import timedelta\n'), ((5712, 5730), 'pandas.DataFrame', 'pd.DataFrame', (['rows'], {}), '(rows)\n', (5724, 5730), True, 'import pandas as pd\n'), ((6793, 6831), 'itertools.permutations'...
from flask import render_template from app.web.blue_print import web # run code in different file from app.web import littlered_bbc from app.web import index @web.app_errorhandler(404) def not_found(e): # AOP 思想 return render_template('404.html'), 404
[ "flask.render_template", "app.web.blue_print.web.app_errorhandler" ]
[((162, 187), 'app.web.blue_print.web.app_errorhandler', 'web.app_errorhandler', (['(404)'], {}), '(404)\n', (182, 187), False, 'from app.web.blue_print import web\n'), ((230, 257), 'flask.render_template', 'render_template', (['"""404.html"""'], {}), "('404.html')\n", (245, 257), False, 'from flask import render_templ...
# 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.set", "pulumi.InvokeOptions", "pulumi.runtime.invoke" ]
[((2254, 2295), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""replicationPolicies"""'}), "(name='replicationPolicies')\n", (2267, 2295), False, 'import pulumi\n'), ((877, 915), 'pulumi.set', 'pulumi.set', (['__self__', '"""bucket"""', 'bucket'], {}), "(__self__, 'bucket', bucket)\n", (887, 915), False, 'import pu...
# Copyright 2019-2020 The ASReview 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 appl...
[ "asreview.models.deprecated._moved_warning" ]
[((1320, 1421), 'asreview.models.deprecated._moved_warning', '_moved_warning', (['_MaxQuery', '"""asreview.models.query.MaxQuery"""', '"""asreview.query_strategies.MaxQuery"""'], {}), "(_MaxQuery, 'asreview.models.query.MaxQuery',\n 'asreview.query_strategies.MaxQuery')\n", (1334, 1421), False, 'from asreview.models...
# coding:utf-8 import csv from bs4 import BeautifulSoup import requests if __name__ == '__main__': user_agent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1' headers = {'User-Agent': user_agent} r = requests.get('ht...
[ "bs4.BeautifulSoup", "csv.writer", "requests.get" ]
[((304, 355), 'requests.get', 'requests.get', (['"""http://seputu.com/"""'], {'headers': 'headers'}), "('http://seputu.com/', headers=headers)\n", (316, 355), False, 'import requests\n'), ((367, 403), 'bs4.BeautifulSoup', 'BeautifulSoup', (['r.text', '"""html.parser"""'], {}), "(r.text, 'html.parser')\n", (380, 403), F...
#!/usr/bin/env python # encoding: utf-8 """ File: insert_probe_names_to_sqlite.py Author: <NAME> Created by <NAME> on 19 July 2012 09:07 PDT (-0700) Copyright (c) 2012 <NAME>. All rights reserved. Description: """ import re import sqlite3 import argparse from collections import defaultdict from Bio import SeqIO i...
[ "collections.defaultdict", "sqlite3.connect", "argparse.ArgumentParser" ]
[((394, 452), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Program description"""'}), "(description='Program description')\n", (417, 452), False, 'import argparse\n'), ((1086, 1110), 'sqlite3.connect', 'sqlite3.connect', (['args.db'], {}), '(args.db)\n', (1101, 1110), False, 'import sq...
# This script takes as an argument the path to the folder which # contains folders of images. # It is assumed that name of each folder with images is # the label for the images, that is all the images in each folder belong # to the the same class, and the name of that class is the name of the folder. # Images are assum...
[ "os.listdir", "os.path.join", "numpy.array", "scipy.misc.imread", "scipy.misc.imresize", "numpy.save" ]
[((2311, 2333), 'numpy.array', 'np.array', (['folder_names'], {}), '(folder_names)\n', (2319, 2333), True, 'import numpy as np\n'), ((3448, 3467), 'numpy.save', 'np.save', (['f', 'X_train'], {}), '(f, X_train)\n', (3455, 3467), True, 'import numpy as np\n'), ((3468, 3487), 'numpy.save', 'np.save', (['f', 'y_train'], {}...
from keras.models import * from keras.layers import * from keras.optimizers import * #from keras import backend as keras import logging import tensorflow.compat.v1.logging as tf_logging # to stop tensorflow from displaying depracetion messages tf_logging.set_verbosity(tf_logging.ERROR) logger = logging.getLogger(__nam...
[ "logging.getLogger", "tensorflow.compat.v1.logging.set_verbosity" ]
[((244, 286), 'tensorflow.compat.v1.logging.set_verbosity', 'tf_logging.set_verbosity', (['tf_logging.ERROR'], {}), '(tf_logging.ERROR)\n', (268, 286), True, 'import tensorflow.compat.v1.logging as tf_logging\n'), ((297, 324), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (314, 324), Fal...
''' Helper class and functions for loading SUN RGB-D objects Author: <NAME> Date: October 2017 Modified by <NAME> ''' import os import sys import numpy as np import pickle import argparse from PIL import Image BASE_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(BASE_DIR) import sunrgbd_utils as u...
[ "numpy.array", "numpy.arctan2", "sys.path.append", "sunrgbd_utils.random_shift_box2d", "os.path.exists", "argparse.ArgumentParser", "sunrgbd_utils.compute_box_3d", "sunrgbd_object.sunrgbd_object", "numpy.random.choice", "pickle.load", "numpy.floor", "numpy.median", "pickle.dump", "numpy.un...
[((268, 293), 'sys.path.append', 'sys.path.append', (['BASE_DIR'], {}), '(BASE_DIR)\n', (283, 293), False, 'import sys\n'), ((241, 266), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (256, 266), False, 'import os\n'), ((557, 597), 'numpy.zeros', 'np.zeros', (['coord.shape[0]'], {'dtype': 'np...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Common Python library imports # Pip package imports from marshmallow import pre_load, post_dump, post_load, validates_schema, ValidationError # Internal package imports from backend.extensions.api import api from backend.api import OneOfSchema, validates, ValidationErro...
[ "backend.extensions.api.api.serializer" ]
[((1162, 1187), 'backend.extensions.api.api.serializer', 'api.serializer', ([], {'many': '(True)'}), '(many=True)\n', (1176, 1187), False, 'from backend.extensions.api import api\n')]
import copy import numpy as np import pandas as pd from sklearn.model_selection import train_test_split class DataFrame(object): """Minimal pd.DataFrame analog for handling n-dimensional numpy matrices with additional support for shuffling, batching, and train/test splitting. Args: columns: Lis...
[ "sklearn.model_selection.train_test_split", "numpy.random.randint", "numpy.concatenate", "copy.copy", "numpy.arange", "numpy.random.shuffle" ]
[((1114, 1136), 'numpy.arange', 'np.arange', (['self.length'], {}), '(self.length)\n', (1123, 1136), True, 'import numpy as np\n'), ((1383, 1410), 'numpy.random.shuffle', 'np.random.shuffle', (['self.idx'], {}), '(self.idx)\n', (1400, 1410), True, 'import numpy as np\n'), ((1468, 1491), 'numpy.random.randint', 'np.rand...
from program_synthesis.karel.dataset import executor from program_synthesis.karel.dataset import parser_for_synthesis branch_types = {'if', 'ifElse', 'while'} stmt_types = {'move', 'turnLeft', 'turnRight', 'putMarker', 'pickMarker'} class CoverageMeasurer(object): def __init__(self, code): self.parser = p...
[ "program_synthesis.karel.dataset.executor.KarelExecutor", "program_synthesis.karel.dataset.parser_for_synthesis.KarelForSynthesisParser" ]
[((319, 380), 'program_synthesis.karel.dataset.parser_for_synthesis.KarelForSynthesisParser', 'parser_for_synthesis.KarelForSynthesisParser', ([], {'build_tree': '(True)'}), '(build_tree=True)\n', (363, 380), False, 'from program_synthesis.karel.dataset import parser_for_synthesis\n'), ((422, 446), 'program_synthesis.k...
#! /usr/bin/env python3 # coding=utf-8 ''' Loads a saved pytorch model checkpoint and an image and prints the most likely image class and it's associated probability. If provided, uses a category to name json file to map categories to names and print the names as well. SPECS: - Allows users to print out the top K cla...
[ "PIL.Image.open", "argparse.ArgumentParser", "torch.load", "torch.exp", "numpy.array", "json.load", "torch.autograd.Variable", "torch.FloatTensor", "os.path.relpath" ]
[((1022, 1061), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '""""""'}), "(description='')\n", (1045, 1061), False, 'import argparse\n'), ((2041, 2078), 'os.path.relpath', 'os.path.relpath', (['args.checkpoint_path'], {}), '(args.checkpoint_path)\n', (2056, 2078), False, 'import os\n'), ((...
import QUANTAXIS as QA #QA.QA_Setting.client=QA.QAUtil.QA_util_sql_mongo_setting(QA.QA_Setting.QA_util_sql_mongo_ip,QA.QA_Setting.QA_util_sql_mongo_port) market=QA.QA_Market() bid=QA.QA_QAMarket_bid.bid market.market_make_deal(bid,QA.QA_Setting.client)
[ "QUANTAXIS.QA_Market" ]
[((161, 175), 'QUANTAXIS.QA_Market', 'QA.QA_Market', ([], {}), '()\n', (173, 175), True, 'import QUANTAXIS as QA\n')]
from utils import parse_data, extract_gpa_data, merge_gpa_data from mysql_engine import loadEngine, MySQLEngine import pathlib import numpy as np import json from tqdm import tqdm def upload_courses(file_path: str, engine: MySQLEngine): """ Uploads all the courses to the MySQL database. :param self: ...
[ "utils.parse_data", "mysql_engine.loadEngine", "json.load", "utils.extract_gpa_data", "utils.merge_gpa_data" ]
[((468, 489), 'utils.parse_data', 'parse_data', (['file_path'], {}), '(file_path)\n', (478, 489), False, 'from utils import parse_data, extract_gpa_data, merge_gpa_data\n'), ((650, 677), 'utils.extract_gpa_data', 'extract_gpa_data', (['file_path'], {}), '(file_path)\n', (666, 677), False, 'from utils import parse_data,...
import fnmatch import file_dir_dialog as fdd import pandas as pd import msgbox import time from datetime import date from read_config_functions import * import xlwings as xw import os class New_Excel_WB: def __init__(self): self.wb = xw.Book() def df_to_excel(self, df, path): ...
[ "os.path.getsize", "file_dir_dialog.get_directory", "os.path.splitext", "os.path.join", "os.getcwd", "os.path.isdir", "fnmatch.fnmatch", "msgbox.show_error", "os.startfile", "os.path.getmtime", "datetime.date.today", "xlwings.Book", "msgbox.show_message", "os.walk" ]
[((1544, 1562), 'os.walk', 'os.walk', (['directory'], {}), '(directory)\n', (1551, 1562), False, 'import os\n'), ((3476, 3494), 'os.walk', 'os.walk', (['directory'], {}), '(directory)\n', (3483, 3494), False, 'import os\n'), ((261, 270), 'xlwings.Book', 'xw.Book', ([], {}), '()\n', (268, 270), True, 'import xlwings as ...
"""Demo using test environment for grpc testing""" import logging from google.protobuf import json_format from framework.config import settings from tests.base_test import BaseTestCase from utils.channel_factory import get_channel from utils.builders.grpc_builders import build_number_from_file, build_number_from_dic...
[ "logging.getLogger", "services.doubler.doubler_pb2.Number", "services.doubler.doubler_pb2_grpc.DoublerStub", "utils.builders.grpc_builders.build_number_from_dict", "utils.builders.grpc_builders.build_number_from_file", "utils.channel_factory.get_channel", "google.protobuf.json_format.MessageToJson" ]
[((436, 463), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (453, 463), False, 'import logging\n'), ((721, 817), 'utils.channel_factory.get_channel', 'get_channel', (["settings['doubler_grpc_host']", "settings['doubler_grpc_port']"], {'metadata': 'METADATA'}), "(settings['doubler_grpc_ho...
import os import torch import numpy as np class IoUAverager: def __init__(self, nCls, eps=1e-5): self.nCls = nCls self.eps = eps self.shape_ious = [[] for _ in range(self.nCls)] def clear(self): self.shape_ious = [[] for _ in range(self.nCls)] def update(self, outputs, tru...
[ "numpy.mean", "numpy.prod", "numpy.logical_and", "os.path.join", "numpy.logical_or", "numpy.bitwise_and", "numpy.sum", "numpy.zeros", "torch.argmax" ]
[((1053, 1065), 'numpy.mean', 'np.mean', (['res'], {}), '(res)\n', (1060, 1065), True, 'import numpy as np\n'), ((1821, 1861), 'numpy.zeros', 'np.zeros', (['(self.nCls, 4)'], {'dtype': 'np.int32'}), '((self.nCls, 4), dtype=np.int32)\n', (1829, 1861), True, 'import numpy as np\n'), ((1983, 2023), 'numpy.zeros', 'np.zero...
import os import requests import sys import hashlib import tarfile def check_version(remote_ver, local_ver): '用于判断服务器上是否有新版本的软件,有返回True,否则返回False' if not os.path.exists(local_ver): return True # 如果本地版本文件不存在则返回True r = requests.get(remote_ver) with open(local_ver) as fobj: version = fo...
[ "os.path.exists", "tarfile.open", "hashlib.md5", "os.symlink", "requests.get", "os.chdir", "os.unlink", "sys.exit" ]
[((241, 265), 'requests.get', 'requests.get', (['remote_ver'], {}), '(remote_ver)\n', (253, 265), False, 'import requests\n'), ((471, 492), 'requests.get', 'requests.get', (['md5_url'], {}), '(md5_url)\n', (483, 492), False, 'import requests\n'), ((501, 514), 'hashlib.md5', 'hashlib.md5', ([], {}), '()\n', (512, 514), ...
""" The module provides utility functions to load tree object from files """ import os import sys from cached_property import cached_property from . import source from .compat.types import basestr from .tree import Tree, flatten class Loader(object): """ Configuration tree loader :param Walker walk: W...
[ "os.listdir", "os.path.join", "os.path.splitext", "os.path.isfile", "os.path.dirname", "os.path.isdir", "os.path.basename", "sys.path.append", "os.path.relpath" ]
[((12284, 12318), 'os.path.join', 'os.path.join', (['self.path', 'self.name'], {}), '(self.path, self.name)\n', (12296, 12318), False, 'import os\n'), ((12378, 12407), 'os.path.isfile', 'os.path.isfile', (['self.fullpath'], {}), '(self.fullpath)\n', (12392, 12407), False, 'import os\n'), ((12466, 12494), 'os.path.isdir...
# Copyright (c) 2021 MobileCoin. All rights reserved. import attr import uuid import logging from collections import defaultdict from typing import Optional, Iterator, List from decimal import Decimal from django.utils import timezone from signald.types import Payment as SignalPayment, Message as SignalMessage from ...
[ "logging.getLogger", "uuid.uuid4", "django.utils.timezone.now", "signald.types.Payment", "collections.defaultdict", "decimal.Decimal", "attr.ib" ]
[((1854, 1871), 'attr.ib', 'attr.ib', ([], {'type': 'str'}), '(type=str)\n', (1861, 1871), False, 'import attr\n'), ((1891, 1908), 'attr.ib', 'attr.ib', ([], {'type': 'str'}), '(type=str)\n', (1898, 1908), False, 'import attr\n'), ((2005, 2046), 'attr.ib', 'attr.ib', ([], {'type': 'Optional[int]', 'default': 'None'}), ...
# coding=utf-8 # Copyright 2018 The Google AI Language Team 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 ...
[ "eval_utils.is_null_span_list", "eval_utils.read_annotation", "absl.flags.DEFINE_integer", "eval_utils.gold_has_short_answer", "absl.app.run", "absl.flags.mark_flag_as_required", "eval_utils.span_set_equal", "eval_utils.gold_has_long_answer", "eval_utils.nonnull_span_equal", "eval_utils.read_predi...
[((2123, 2271), 'absl.flags.DEFINE_string', 'flags.DEFINE_string', (['"""gold_path"""', 'None', '"""Path to the gzip JSON data. For multiple files, should be a glob pattern (e.g. "/path/to/files-*\\""""'], {}), '(\'gold_path\', None,\n \'Path to the gzip JSON data. For multiple files, should be a glob pattern (e.g. ...
import os import re import sys import cffi from ._compat import PY2 _directive_re = re.compile(r'^\s*#.*?$(?m)') def make_ffi(module_path, crate_path, cached_header_filename=None): """Creates a FFI instance for the given configuration.""" if cached_header_filename is not None and \ os.path.isfile(ca...
[ "re.compile", "cffi.FFI", "os.environ.get", "sys.stderr.flush", "os.path.isfile", "sys.stderr.write" ]
[((87, 115), 're.compile', 're.compile', (['"""^\\\\s*#.*?$(?m)"""'], {}), "('^\\\\s*#.*?$(?m)')\n", (97, 115), False, 'import re\n'), ((865, 875), 'cffi.FFI', 'cffi.FFI', ([], {}), '()\n', (873, 875), False, 'import cffi\n'), ((303, 341), 'os.path.isfile', 'os.path.isfile', (['cached_header_filename'], {}), '(cached_h...
# Based on https://github.com/eklitzke/utxodump from typing import Tuple import binascii import leveldb import config import json import os def decode_varint(val: bytearray) -> Tuple[int, int]: n = 0 for i, c in enumerate(val): n = (n << 7) | (c & 0x7f) if c & 0x80: n += 1 else: return n, i + 1 assert F...
[ "json.dump", "os.path.join", "os.path.expanduser", "binascii.hexlify" ]
[((735, 759), 'os.path.expanduser', 'os.path.expanduser', (['path'], {}), '(path)\n', (753, 759), False, 'import os\n'), ((768, 803), 'os.path.join', 'os.path.join', (['datadir', '"""chainstate"""'], {}), "(datadir, 'chainstate')\n", (780, 803), False, 'import os\n'), ((1732, 1753), 'json.dump', 'json.dump', (['data', ...
#! /usr/bin/env python3 import sys import os os.chdir(os.path.dirname(sys.argv[0])) from mule_local.JobMule import * from mule.exec_program import * exec_program('mule.benchmark.cleanup_all', catch_output=False) jg = JobGeneration() jg.compile.unit_test="test_plane_fftw_wisdom_import_export" jg.compile.plane_spectr...
[ "os.path.dirname", "glob.glob", "sys.exit" ]
[((1482, 1518), 'glob.glob', 'glob.glob', (['"""job_bench_*_planssave_*"""'], {}), "('job_bench_*_planssave_*')\n", (1491, 1518), False, 'import glob\n'), ((1695, 1739), 'glob.glob', 'glob.glob', (['"""job_bench_*_plansrequire_load_*"""'], {}), "('job_bench_*_plansrequire_load_*')\n", (1704, 1739), False, 'import glob\...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jan 10 13:54:34 2020 @author: tbarton """ # make sure you have tensorflow 1.15 import gpt_2_simple as gpt2 gpt2.download_gpt2() sess = gpt2.start_tf_sess() gpt2.finetune(sess, dataset='big_chess_set.txt', run_name='lets_play...
[ "gpt_2_simple.finetune", "gpt_2_simple.download_gpt2", "gpt_2_simple.start_tf_sess" ]
[((174, 194), 'gpt_2_simple.download_gpt2', 'gpt2.download_gpt2', ([], {}), '()\n', (192, 194), True, 'import gpt_2_simple as gpt2\n'), ((203, 223), 'gpt_2_simple.start_tf_sess', 'gpt2.start_tf_sess', ([], {}), '()\n', (221, 223), True, 'import gpt_2_simple as gpt2\n'), ((224, 372), 'gpt_2_simple.finetune', 'gpt2.finet...
#!/usr/bin/python2.7 # Copyright 2011 Google Inc. 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 requi...
[ "googleapis.codegen.cpp_import_manager.CppImportManager", "google.apputils.basetest.main" ]
[((3242, 3257), 'google.apputils.basetest.main', 'basetest.main', ([], {}), '()\n', (3255, 3257), False, 'from google.apputils import basetest\n'), ((1351, 1385), 'googleapis.codegen.cpp_import_manager.CppImportManager', 'CppImportManager', (['self.mock_schema'], {}), '(self.mock_schema)\n', (1367, 1385), False, 'from ...
from ryu.base import app_manager from ryu.controller import ofp_event from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER from ryu.controller.handler import set_ev_cls from ryu.ofproto import ofproto_v1_3 from ryu.lib.packet import packet from ryu.lib.packet import ethernet, arp, ipv4 from ryu.lib.pac...
[ "ryu.lib.packet.packet.Packet", "ryu.topology.api.get_switch", "networkx.DiGraph", "ryu.app.ofctl.api.get_datapath", "ryu.controller.handler.set_ev_cls", "ryu.topology.api.get_link" ]
[((2191, 2254), 'ryu.controller.handler.set_ev_cls', 'set_ev_cls', (['ofp_event.EventOFPSwitchFeatures', 'CONFIG_DISPATCHER'], {}), '(ofp_event.EventOFPSwitchFeatures, CONFIG_DISPATCHER)\n', (2201, 2254), False, 'from ryu.controller.handler import set_ev_cls\n'), ((7952, 8007), 'ryu.controller.handler.set_ev_cls', 'set...
import luhn def test_checksum_len1(): assert luhn.checksum('7') == 7 def test_checksum_len2(): assert luhn.checksum('13') == 5 def test_checksum_len3(): assert luhn.checksum('383') == 3 def test_checksum_len4(): assert luhn.checksum('2827') == 3 def test_checksum_len13(): assert luhn.checksum('...
[ "luhn.verify", "luhn.generate", "luhn.append", "luhn.checksum" ]
[((447, 477), 'luhn.verify', 'luhn.verify', (['"""356938035643809"""'], {}), "('356938035643809')\n", (458, 477), False, 'import luhn\n'), ((50, 68), 'luhn.checksum', 'luhn.checksum', (['"""7"""'], {}), "('7')\n", (63, 68), False, 'import luhn\n'), ((112, 131), 'luhn.checksum', 'luhn.checksum', (['"""13"""'], {}), "('1...
# Author: <NAME> import numpy as np import pickle class evolutionary_strategies_model(object): def __init__( self, n_population, n_params, n_survival, n_crossover = 2, sigma_init = 1, mu_init = 0, tau = None): """ Evolutionary strategies model loosely based on Beyer and Sch...
[ "numpy.random.normal", "numpy.tile", "numpy.eye", "pickle.dump", "numpy.argsort", "numpy.zeros", "numpy.full", "numpy.random.shuffle" ]
[((1928, 1991), 'numpy.random.normal', 'np.random.normal', (['mu_init', 'sigma_init', '(n_population, n_params)'], {}), '(mu_init, sigma_init, (n_population, n_params))\n', (1944, 1991), True, 'import numpy as np\n'), ((2014, 2076), 'numpy.full', 'np.full', (['(n_population, n_params)', 'sigma_init'], {'dtype': '"""flo...
from setuptools import setup def _md(filename): ''' Load md file and sanitize it for PyPI. Remove unsupported github tags: - code-block directive - all badges ''' content = open(filename).read() return content long_description = '\n'.join(( _md('README.md'), _md('CHANGELOG....
[ "setuptools.setup" ]
[((455, 1470), 'setuptools.setup', 'setup', ([], {'name': '"""devpi-semantic-ui"""', 'description': '__description__', 'url': '"""https://github.com/apihackers/devpi-semantic-ui"""', 'version': '__version__', 'maintainer': '"""API Hackers"""', 'maintainer_email': '"""<EMAIL>"""', 'license': '"""MIT"""', 'entry_points':...
import pandas as pd import matplotlib.pyplot as plt import os # uncomment these two lines so you can see all the records when you print or write instead of dot dot dot ... # pd.set_option('display.max_columns', None) # pd.set_option('display.max_rows', None) def pretty_print(name, to_print): print(f'{name} ') ...
[ "matplotlib.pyplot.savefig", "os.makedirs", "pandas.read_csv", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.clf", "matplotlib.pyplot.close", "matplotlib.pyplot.scatter", "matplotlib.pyplot.title", "pandas.to_datetime" ]
[((469, 537), 'pandas.read_csv', 'pd.read_csv', ([], {'filepath_or_buffer': '"""data/tweets.csv"""', 'sep': '""","""', 'header': '(0)'}), "(filepath_or_buffer='data/tweets.csv', sep=',', header=0)\n", (480, 537), True, 'import pandas as pd\n'), ((1330, 1382), 'pandas.to_datetime', 'pd.to_datetime', (["df['actual_date']...
from typing import Any, Optional, Callable from enum import IntEnum import time import uuid import math from commlib.node import Node from goalee.goal import Goal, GoalState from goalee.types import Point class AreaGoalTag(IntEnum): ENTER = 0 EXIT = 1 AVOID = 2 STEP = 3 class RectangleAreaGoal(...
[ "math.sqrt" ]
[((3871, 3949), 'math.sqrt', 'math.sqrt', (["((pos['x'] - self._center.x) ** 2 + (pos['y'] - self._center.y) ** 2)"], {}), "((pos['x'] - self._center.x) ** 2 + (pos['y'] - self._center.y) ** 2)\n", (3880, 3949), False, 'import math\n')]
# Generated by Django 3.2.11 on 2022-01-07 02:15 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ("mus...
[ "django.db.models.DateField", "django.db.models.TextField", "django.db.models.ForeignKey", "django.db.models.BigAutoField", "django.db.migrations.swappable_dependency", "django.db.models.CharField" ]
[((248, 305), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (279, 305), False, 'from django.db import migrations, models\n'), ((3849, 3947), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'djang...
import os def file_len(filename, comment): line_count = 0 with open(filename) as f: for line in f: if line.strip().startswith(comment): continue if line.strip(): line_count += 1 return line_count def walk(path='.'): loc = 0 for r...
[ "os.path.join", "os.walk" ]
[((340, 353), 'os.walk', 'os.walk', (['path'], {}), '(path)\n', (347, 353), False, 'import os\n'), ((471, 495), 'os.path.join', 'os.path.join', (['root', 'file'], {}), '(root, file)\n', (483, 495), False, 'import os\n')]
import random def parse_args(): from argparse import ArgumentParser from argparse import ArgumentDefaultsHelpFormatter parser = ArgumentParser(description="Framestick feed-forward f0 generator", formatter_class=ArgumentDefaultsHelpFormatter) parser.add_argument("-a", "--sc...
[ "random.randint", "argparse.ArgumentParser" ]
[((143, 260), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""Framestick feed-forward f0 generator"""', 'formatter_class': 'ArgumentDefaultsHelpFormatter'}), "(description='Framestick feed-forward f0 generator',\n formatter_class=ArgumentDefaultsHelpFormatter)\n", (157, 260), False, 'from argpa...
################################################################################ ## Imports and configurations import sys import os PROJ_PATH = '.' #PROJ_PATH = os.path.realpath(os.path.join(os.path.dirname(__file__), '../../')) #sys.path.append(PROJ_PATH) import pandas as pd import numpy as np from sklearn.preproc...
[ "pandas.Series", "pandas.read_csv", "sklearn.model_selection.train_test_split", "sklearn.ensemble.RandomForestClassifier", "sklearn.preprocessing.StandardScaler", "numpy.array", "src.reporting.reports.reports", "pandas.DataFrame", "pandas.concat", "sklearn.feature_selection.SelectFromModel" ]
[((1358, 1374), 'sklearn.preprocessing.StandardScaler', 'StandardScaler', ([], {}), '()\n', (1372, 1374), False, 'from sklearn.preprocessing import StandardScaler\n'), ((1589, 1653), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'y'], {'test_size': '(0.4)', 'random_state': 'random_state'}), '(X...
import re from PIL import Image, ImageOps from io import BytesIO from django.contrib.auth.models import User from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.http import HttpResponseForbidden from django.shortcuts import get_object_or_404 from django.core.files.uploadedfile import Si...
[ "re.compile", "django.shortcuts.get_object_or_404", "PIL.ImageOps.fit", "io.BytesIO", "django.http.HttpResponseForbidden", "django.contrib.auth.models.User.objects.filter", "re.findall", "django.core.paginator.Paginator" ]
[((385, 412), 're.compile', 're.compile', (['"""@(\\\\w+)"""', 're.M'], {}), "('@(\\\\w+)', re.M)\n", (395, 412), False, 'import re\n'), ((530, 573), 'PIL.ImageOps.fit', 'ImageOps.fit', (['upload', 'size', 'Image.ANTIALIAS'], {}), '(upload, size, Image.ANTIALIAS)\n', (542, 573), False, 'from PIL import Image, ImageOps\...
# Test methods with long descriptive names can omit docstrings # pylint: disable=missing-docstring import warnings from time import time from numbers import Real from itertools import starmap, chain import unittest import pickle import numpy as np from numpy.testing import assert_array_equal from Orange.data import (...
[ "itertools.chain", "pickle.dumps", "Orange.preprocess.Impute", "Orange.data.DiscreteVariable", "numpy.array", "unittest.main", "numpy.arange", "Orange.data.domain.filter_visible", "Orange.data.DomainConversion", "numpy.testing.assert_almost_equal", "warnings.simplefilter", "Orange.data.Domain"...
[((692, 720), 'Orange.data.Variable._clear_all_caches', 'Variable._clear_all_caches', ([], {}), '()\n', (718, 720), False, 'from Orange.data import ContinuousVariable, DiscreteVariable, StringVariable, TimeVariable, Variable, Domain, Table, DomainConversion\n'), ((23186, 23201), 'unittest.main', 'unittest.main', ([], {...
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import os from django.core.management import BaseCommand from django.urls import RegexURLResolver from djue.factories import ComponentFactory from djue.utils import log from djue.vue.core import SingleFileComponent class ModuleCommand(BaseCommand): h...
[ "djue.factories.ComponentFactory.from_callback", "os.path.join", "djue.factories.ComponentFactory.from_junk", "os.path.dirname", "djue.utils.log" ]
[((1589, 1623), 'os.path.join', 'os.path.join', (['path', 'component.path'], {}), '(path, component.path)\n', (1601, 1623), False, 'import os\n'), ((574, 606), 'djue.utils.log', 'log', (['f"""url: {url.regex.pattern}"""'], {}), "(f'url: {url.regex.pattern}')\n", (577, 606), False, 'from djue.utils import log\n'), ((124...
# Generated by Django 3.1.6 on 2021-03-14 08:14 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Article', fields=[ ...
[ "django.db.models.TextField", "django.db.models.IntegerField", "django.db.models.ForeignKey", "django.db.models.ImageField", "django.db.models.AutoField", "django.db.models.DateTimeField", "django.db.models.CharField" ]
[((336, 429), '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", (352, 429), False, 'from django.db import migrations, models\...
import pathlib import re from typing import List, Tuple, Dict def graph_dfs( root: str, graph: Dict[str, List[Tuple[str, int]]] ) -> Tuple[List[str], int]: nodes_visited = [] total_weight = 0 for neighbor, weight in graph[root]: nodes_visited.append(neighbor) neighbor_visited, neighb...
[ "pathlib.Path", "re.compile" ]
[((612, 648), 're.compile', 're.compile', (['"""([\\\\w ]+) bags contain"""'], {}), "('([\\\\w ]+) bags contain')\n", (622, 648), False, 'import re\n'), ((670, 715), 're.compile', 're.compile', (['"""(?:(?:(\\\\d+) ([\\\\w ]+)) bags?)+"""'], {}), "('(?:(?:(\\\\d+) ([\\\\w ]+)) bags?)+')\n", (680, 715), False, 'import r...
import pandas as pd import urllib.request # Linear pathway data BASE_URL = "https://github.com/sys-bio/network-modeling-summer-school-2021/raw/main/" BASE_DATA_URL = "%sdata/" % BASE_URL BASE_MODULE_URL = "%ssrc/" % BASE_URL BASE_MODEL_URL = "%smodels/" % BASE_URL LOCAL_FILE = "local_file.txt" def getData(csvFilenam...
[ "pandas.read_csv" ]
[((676, 699), 'pandas.read_csv', 'pd.read_csv', (['LOCAL_FILE'], {}), '(LOCAL_FILE)\n', (687, 699), True, 'import pandas as pd\n')]
''' alpine-python-falcon example In this example, we import one of our own scripts: myfunction. We then modify Numbers() to return myfunction.myfunction()'s result when we perform a POST request. ''' import falcon from middleware import JSONTranslator from myfunction import myfunction class Hello_world(object): ...
[ "middleware.JSONTranslator", "myfunction.myfunction" ]
[((724, 748), 'myfunction.myfunction', 'myfunction', (['[1, 2, 3, 4]'], {}), '([1, 2, 3, 4])\n', (734, 748), False, 'from myfunction import myfunction\n'), ((842, 858), 'middleware.JSONTranslator', 'JSONTranslator', ([], {}), '()\n', (856, 858), False, 'from middleware import JSONTranslator\n')]
"""empty message Revision ID: ddf3cbc60873 Revises: x Create Date: 2020-08-22 17:27:08.449495 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "<KEY>" down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto generated ...
[ "sqlalchemy.ForeignKeyConstraint", "alembic.op.drop_table", "sqlalchemy.PrimaryKeyConstraint", "sqlalchemy.Integer", "sqlalchemy.String" ]
[((1176, 1200), 'alembic.op.drop_table', 'op.drop_table', (['"""address"""'], {}), "('address')\n", (1189, 1200), False, 'from alembic import op\n'), ((1205, 1226), 'alembic.op.drop_table', 'op.drop_table', (['"""user"""'], {}), "('user')\n", (1218, 1226), False, 'from alembic import op\n'), ((584, 613), 'sqlalchemy.Pr...
from io import BytesIO import pytest from PIL import Image, ImageFile from pyzint.zint import ( BARCODE_C25INTER, BARCODE_CODE128, BARCODE_EANX, BARCODE_ISBNX, BARCODE_QRCODE, BARCODE_UPCA, BARCODE_UPCE, Zint, ) try: from zbar import Scanner except ImportError: Scanner = None...
[ "PIL.Image.open", "io.BytesIO", "pytest.mark.parametrize", "pytest.mark.skipif", "zbar.Scanner", "pyzint.zint.Zint" ]
[((484, 551), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(Scanner is None)'], {'reason': '"""zbar is not installed"""'}), "(Scanner is None, reason='zbar is not installed')\n", (502, 551), False, 'import pytest\n'), ((553, 1209), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""type,value, checksum, zbar...
# Generated by Django 3.0.5 on 2020-04-17 22:28 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('cliente', '0001_initial'), ] operations = [ migrations.RemoveField( model_name='endereco', name='ruaEndereco', ...
[ "django.db.migrations.RemoveField", "django.db.models.CharField", "django.db.models.IntegerField" ]
[((224, 289), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""endereco"""', 'name': '"""ruaEndereco"""'}), "(model_name='endereco', name='ruaEndereco')\n", (246, 289), False, 'from django.db import migrations, models\n'), ((447, 525), 'django.db.models.CharField', 'models.CharField...
import itertools import logging from evm.validation import ( validate_is_bytes, validate_length, validate_lte, validate_uint256, ) from evm.utils.numeric import ( ceil32, ) class Memory(object): """ VM Memory """ bytes = None logger = logging.getLogger('evm.vm.memory.Memory')...
[ "logging.getLogger", "evm.utils.numeric.ceil32", "evm.validation.validate_uint256", "evm.validation.validate_is_bytes", "evm.validation.validate_length", "itertools.repeat" ]
[((279, 320), 'logging.getLogger', 'logging.getLogger', (['"""evm.vm.memory.Memory"""'], {}), "('evm.vm.memory.Memory')\n", (296, 320), False, 'import logging\n'), ((485, 514), 'evm.utils.numeric.ceil32', 'ceil32', (['(start_position + size)'], {}), '(start_position + size)\n', (491, 514), False, 'from evm.utils.numeri...
import sys import argparse import subprocess import os import shutil import glob irene_list = ["blackscholes", "bodytrack", "canneal", "dedup"] maxwell_list = ["facesim", "ferret", "fluidanimate", "freqmine"] jen_list = ["raytrace", "streamcluster", "swaptions", "vips", "x264"] suite = { "Maxwell":"intrate", ...
[ "os.path.exists", "os.listdir", "argparse.ArgumentParser", "os.path.join", "os.chmod", "os.chdir", "shutil.copyfile", "subprocess.call" ]
[((983, 1037), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Run benchmarks."""'}), "(description='Run benchmarks.')\n", (1006, 1037), False, 'import argparse\n'), ((3493, 3543), 'os.path.join', 'os.path.join', (['parsec_path', '"""config"""', '"""gcc.bldconf"""'], {}), "(parsec_path, '...
from unittest.mock import patch import dhooks_lite from django.core.cache import cache from django.test import TestCase from django.test.utils import override_settings from ..exceptions import WebhookTooManyRequests from ..models import EveKillmail, Tracker, Webhook from .testdata.helpers import load_killmail, load_...
[ "django.core.cache.cache.clear", "django.test.utils.override_settings", "unittest.mock.patch", "dhooks_lite.WebhookResponse" ]
[((1222, 1265), 'django.test.utils.override_settings', 'override_settings', ([], {'CELERY_ALWAYS_EAGER': '(True)'}), '(CELERY_ALWAYS_EAGER=True)\n', (1239, 1265), False, 'from django.test.utils import override_settings\n'), ((1267, 1304), 'unittest.mock.patch', 'patch', (["(MODULE_PATH + '.is_esi_online')"], {}), "(MOD...
#!/usr/bin/env python # PostgreSQL doesn't allow ADDing columns to a table in a particular position - # because it doesn't really make sense in SQL - # but COPY from CSV **requires** the columns in a specific order # as the fields aren't specified in the source CSV file. # so specify /ALL/ of the fields to import. # ...
[ "psycopg2.connect", "os.path.join", "os.environ.get", "getpass.getpass", "base64.b64decode", "calendar.monthrange", "os.path.basename", "sys.exit", "hashlib.sha1", "csv.reader", "sys.stdout.write" ]
[((2911, 2982), 'psycopg2.connect', 'psycopg2.connect', (["('dbname=%s user=%s password=%s' % (DB, DBA, password))"], {}), "('dbname=%s user=%s password=%s' % (DB, DBA, password))\n", (2927, 2982), False, 'import psycopg2\n'), ((4157, 4226), 'os.path.join', 'os.path.join', (['csvpath', "('PHE_%d%s_pseudonymised.csv' % ...
# __init__.py (flowsa) # !/usr/bin/env python3 # coding=utf-8 """ Public API for flowsa For standard dataframe formats, see https://github.com/USEPA/flowsa/tree/master/format%20specs """ import os import pprint from esupy.processed_data_mgmt import load_preprocessed_output from flowsa.common import paths, biboutputpat...
[ "flowsa.bibliography.generate_fbs_bibliography", "os.listdir", "flowsa.validation.check_for_negative_flowamounts", "flowsa.flowbyfunctions.filter_by_geoscale", "flowsa.common.log.info", "flowsa.flowbyfunctions.collapse_fbs_sectors", "os.path.splitext", "flowsa.metadata.set_fb_meta", "esupy.processed...
[((1675, 1710), 'flowsa.metadata.set_fb_meta', 'set_fb_meta', (['name', '"""FlowByActivity"""'], {}), "(name, 'FlowByActivity')\n", (1686, 1710), False, 'from flowsa.metadata import set_fb_meta\n'), ((1793, 1834), 'esupy.processed_data_mgmt.load_preprocessed_output', 'load_preprocessed_output', (['fba_meta', 'paths'], ...
import sys def f(): try: return f() except RuntimeError: return sys.exc_info() def do_check(): f() assert sys.exc_info() == (None, None, None) def recurse(n): if n > 0: return recurse(n-1) else: return do_check() def test_recursion(): """ Test that sy...
[ "sys.exc_info" ]
[((140, 154), 'sys.exc_info', 'sys.exc_info', ([], {}), '()\n', (152, 154), False, 'import sys\n'), ((89, 103), 'sys.exc_info', 'sys.exc_info', ([], {}), '()\n', (101, 103), False, 'import sys\n')]
from collections import defaultdict from base.threedi_base.constants import CULVERT_SNAPPED_TABLE_NAME from base.threedi_base import position from base.threedi_base.logger import Logger from base.threedi_base.apps import ThreediBaseConfig as conf from base.threedi_base.exceptions import InsertError logger = Logger.ge...
[ "base.threedi_base.position.must_be_skipped", "base.threedi_base.position.get_ordered_positions", "base.threedi_base.position.flip_start_end_position", "base.threedi_base.position.correct_positions_by_threshold", "base.threedi_base.logger.Logger.get", "base.threedi_base.position.correct_crossings", "bas...
[((311, 347), 'base.threedi_base.logger.Logger.get', 'Logger.get', (['__name__', 'conf.LOG_LEVEL'], {}), '(__name__, conf.LOG_LEVEL)\n', (321, 347), False, 'from base.threedi_base.logger import Logger\n'), ((1751, 1768), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (1762, 1768), False, 'from co...
from __future__ import unicode_literals import copy import importlib import threading from django.db import models, router from django.db.models import Q from django.db.models.fields.proxy import OrderWrt from django.conf import settings from django.contrib import admin from django.utils import six from django.utils....
[ "simple_history.register", "threading.local", "importlib.import_module", "django.db.models.signals.class_prepared.connect", "django.db.models.signals.post_delete.connect", "django.db.models.signals.m2m_changed.connect", "django.db.models.signals.post_save.connect", "django.db.models.ForeignKey", "dj...
[((1037, 1114), 'south.modelsinspector.add_introspection_rules', 'add_introspection_rules', (['[]', "['^simple_history.models.CustomForeignKeyField']"], {}), "([], ['^simple_history.models.CustomForeignKeyField'])\n", (1060, 1114), False, 'from south.modelsinspector import add_introspection_rules\n'), ((1524, 1541), 't...
import tkinter as tk import threading import os from pathlib import Path class PDFExtractionThread(threading.Thread): def __init__(self, pdf_extractor, output_filename): super().__init__() self.setDaemon(True) self.pdf_extractor = pdf_extractor self.output_filename = output_filena...
[ "pathlib.Path" ]
[((899, 913), 'pathlib.Path', 'Path', (['filename'], {}), '(filename)\n', (903, 913), False, 'from pathlib import Path\n')]
from transitions.extensions import GraphMachine class TocMachine(GraphMachine): def __init__(self, **machine_configs): self.machine = GraphMachine( model = self, **machine_configs ) def is_going_to_92(self, update): text = update.message.text return tex...
[ "transitions.extensions.GraphMachine" ]
[((148, 191), 'transitions.extensions.GraphMachine', 'GraphMachine', ([], {'model': 'self'}), '(model=self, **machine_configs)\n', (160, 191), False, 'from transitions.extensions import GraphMachine\n')]
from ctypes import windll, c_void_p, POINTER, c_size_t, Structure, c_uint64, c_uint32, sizeof, c_wchar, c_wchar_p, byref from ctypes.wintypes import DWORD from pprint import pprint from inc.errors import GWErrors from inc.system_info import GWSystemInfo class MEMORY_BASIC_INFORMATION(Structure): """https://msdn...
[ "ctypes.POINTER", "inc.errors.GWErrors", "ctypes.windll.kernel32.GetProcessId", "inc.system_info.GWSystemInfo", "ctypes.c_uint64", "ctypes.sizeof" ]
[((1493, 1526), 'ctypes.POINTER', 'POINTER', (['MEMORY_BASIC_INFORMATION'], {}), '(MEMORY_BASIC_INFORMATION)\n', (1500, 1526), False, 'from ctypes import windll, c_void_p, POINTER, c_size_t, Structure, c_uint64, c_uint32, sizeof, c_wchar, c_wchar_p, byref\n'), ((1721, 1737), 'ctypes.POINTER', 'POINTER', (['c_wchar'], {...
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-10-13 19:03 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('btc', '0023_auto_20160923_1904'), ] operations = [ migrations.AddField( ...
[ "django.db.models.FloatField", "django.db.models.IntegerField", "django.db.models.CharField", "django.db.models.BooleanField" ]
[((410, 444), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(False)'}), '(default=False)\n', (429, 444), False, 'from django.db import migrations, models\n'), ((567, 595), 'django.db.models.FloatField', 'models.FloatField', ([], {'default': '(0)'}), '(default=0)\n', (584, 595), False, 'from ...
from dsbattle_api_app.core.database import Base from sqlalchemy import Column, Integer, Float, VARCHAR, DateTime class Submit(Base): __tablename__ = "dsbt_submits" id = Column(Integer, primary_key=True, index=True) bid = Column(Integer, nullable=False, index=True) hid = Column(Integer, nullable=False...
[ "sqlalchemy.VARCHAR", "sqlalchemy.Column" ]
[((180, 225), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)', 'index': '(True)'}), '(Integer, primary_key=True, index=True)\n', (186, 225), False, 'from sqlalchemy import Column, Integer, Float, VARCHAR, DateTime\n'), ((236, 279), 'sqlalchemy.Column', 'Column', (['Integer'], {'nullable': '(False)...
import sys, os myPath = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, myPath + '/../') import unittest from fcmpy.simulator.simulator import FcmSimulator import pandas as pd class TestSimulator(unittest.TestCase): def setUp(self): C1 = [0.0, 0.0, 0.6, 0.9, 0.0, 0.0, 0.0, 0.8] ...
[ "sys.path.insert", "pandas.DataFrame", "unittest.main", "fcmpy.simulator.simulator.FcmSimulator", "os.path.abspath" ]
[((68, 103), 'sys.path.insert', 'sys.path.insert', (['(0)', "(myPath + '/../')"], {}), "(0, myPath + '/../')\n", (83, 103), False, 'import sys, os\n'), ((41, 66), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (56, 66), False, 'import sys, os\n'), ((3088, 3103), 'unittest.main', 'unittest.mai...
# Generated by Django 3.1.5 on 2021-01-19 08:20 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('fina...
[ "django.db.migrations.swappable_dependency", "django.db.models.ForeignKey" ]
[((247, 304), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (278, 304), False, 'from django.db import migrations, models\n'), ((512, 597), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'on_delete': 'django....
""" Problem: A bridge in a connected (undirected) graph is an edge that, if removed, causes the graph to become disconnected. Find all the bridges in a graph. """ from sys import maxsize from typing import Dict, List, Optional, Set, Tuple from DataStructures.Graph import GraphUndirectedUnweighted def get_bridges_h...
[ "DataStructures.Graph.GraphUndirectedUnweighted" ]
[((1895, 1922), 'DataStructures.Graph.GraphUndirectedUnweighted', 'GraphUndirectedUnweighted', ([], {}), '()\n', (1920, 1922), False, 'from DataStructures.Graph import GraphUndirectedUnweighted\n'), ((2108, 2135), 'DataStructures.Graph.GraphUndirectedUnweighted', 'GraphUndirectedUnweighted', ([], {}), '()\n', (2133, 21...
#!/usr/bin/env python3 import sys import csv import os import multiprocessing from UDPNode import UDPNode def spawn_node(node, edges): neighbors = dict() for (node_a, node_b), cost in edges.items(): if node_a == node: neighbors[node_b] = cost elif node_b == node: neighb...
[ "os.system", "csv.reader", "UDPNode.UDPNode" ]
[((409, 443), 'UDPNode.UDPNode', 'UDPNode', (['ip', 'mask', 'port', 'neighbors'], {}), '(ip, mask, port, neighbors)\n', (416, 443), False, 'from UDPNode import UDPNode\n'), ((652, 672), 'csv.reader', 'csv.reader', (['csv_file'], {}), '(csv_file)\n', (662, 672), False, 'import csv\n'), ((1411, 1472), 'os.system', 'os.sy...
import torch import time from utils import AverageMeter, ProgressMeter from utils import accuracy def train_step(train_loader, model, optimizer, epoch, device, writer, args): batch_time = AverageMeter('Time', ':6.3f') data_time = AverageMeter('Data', ':6.3f') losses = AverageMeter('Loss', ':.4e') pro...
[ "utils.AverageMeter", "torch.no_grad", "time.time", "utils.accuracy" ]
[((194, 223), 'utils.AverageMeter', 'AverageMeter', (['"""Time"""', '""":6.3f"""'], {}), "('Time', ':6.3f')\n", (206, 223), False, 'from utils import AverageMeter, ProgressMeter\n'), ((240, 269), 'utils.AverageMeter', 'AverageMeter', (['"""Data"""', '""":6.3f"""'], {}), "('Data', ':6.3f')\n", (252, 269), False, 'from u...
# -*- coding: utf-8 -*- # # Copyright (C) 2016-2017 <NAME> # All rights reserved. # # This software is licensed as described in the file LICENSE, which # you should have received as part of this distribution. # import bz2 import gzip import hashlib import json import os import platform import re import shutil import s...
[ "os.path.exists", "hashlib.sha256", "tarfile.open", "json.dump", "os.path.join", "shutil.rmtree", "os.path.relpath", "os.path.dirname", "platform.system", "platform.release", "distutils.errors.DistutilsOptionError", "pkg_resources.Requirement.parse", "setuptools.package_index.PackageIndex", ...
[((2531, 2545), 'setuptools.package_index.PackageIndex', 'PackageIndex', ([], {}), '()\n', (2543, 2545), False, 'from setuptools.package_index import PackageIndex\n'), ((4659, 4695), 'os.path.join', 'os.path.join', (['self.bdist_base', '"""pkg"""'], {}), "(self.bdist_base, 'pkg')\n", (4671, 4695), False, 'import os\n')...
import logging import numpy as np __author__ = "<NAME>" def class_to_dict(obj, *args): """ Create dict which contains values of given fields :type obj: object :type args: list[str] :return: """ res = dict() for name in args: res[name] = getattr(obj, name) return res def...
[ "logging.warning" ]
[((813, 832), 'logging.warning', 'logging.warning', (['ae'], {}), '(ae)\n', (828, 832), False, 'import logging\n')]
""" Count and Sort the times a word appear in a text. Using regular expressions """ import re from pyspark import SparkConf, SparkContext def normalize_words(text): return re.compile(r'\W+', re.UNICODE).split(text.lower()) conf = SparkConf().setMaster("local").setAppName("WordCount") sc = SparkContext(conf=conf...
[ "pyspark.SparkContext", "pyspark.SparkConf", "re.compile" ]
[((298, 321), 'pyspark.SparkContext', 'SparkContext', ([], {'conf': 'conf'}), '(conf=conf)\n', (310, 321), False, 'from pyspark import SparkConf, SparkContext\n'), ((178, 208), 're.compile', 're.compile', (['"""\\\\W+"""', 're.UNICODE'], {}), "('\\\\W+', re.UNICODE)\n", (188, 208), False, 'import re\n'), ((238, 249), '...
from terragpu.ai.deep_learning.datasets.segmentation_dataset \ import SegmentationDataset prepare_data = True images_regex = '/Users/jacaraba/Desktop/development/ilab/vhr-cloudmask/data/images/*.tif' labels_regex = '/Users/jacaraba/Desktop/development/ilab/vhr-cloudmask/data/labels/*.tif' dataset_dir = '/Users/jac...
[ "terragpu.ai.deep_learning.datasets.segmentation_dataset.SegmentationDataset" ]
[((390, 737), 'terragpu.ai.deep_learning.datasets.segmentation_dataset.SegmentationDataset', 'SegmentationDataset', ([], {'prepare_data': 'prepare_data', 'images_regex': 'images_regex', 'labels_regex': 'labels_regex', 'dataset_dir': 'dataset_dir', 'tile_size': '(128)', 'seed': '(24)', 'max_patches': '(1e-06)', 'augment...
from collections import deque from itertools import combinations from grafo import Grafo def edmonds_karp(grafo, v_inicial, v_sorvedouro): rede_residual = [[None for x in range(grafo.qtd_vertices())] for y in range(grafo.qtd_vertices())] for u in range(len(grafo.arestas)): for v in range(len(...
[ "itertools.combinations", "grafo.Grafo" ]
[((6280, 6337), 'grafo.Grafo', 'Grafo', (['vertices', 'indice_vertices', 'arestas', 'grafo.dirigido'], {}), '(vertices, indice_vertices, arestas, grafo.dirigido)\n', (6285, 6337), False, 'from grafo import Grafo\n'), ((5774, 5798), 'itertools.combinations', 'combinations', (['valores', 'n'], {}), '(valores, n)\n', (578...
from part import * from material import * from section import * from assembly import * from step import * from interaction import * from load import * from mesh import * from job import * from sketch import * from visualization import * from connectorBehavior import * import boundaryUtils import regionToolset import ge...
[ "boundaryUtils.getFacesFromCntnr", "geomHoney.getLines", "geomHoney.getVertices", "boundaryUtils.getEdges", "boundaryUtils.dist", "regionToolset.Region", "geomHoney.getMinDist", "geomHoney.getCorners", "boundaryUtils.getColinearEdges", "boundaryUtils.getFaces", "boundaryUtils.getFacesList", "b...
[((1637, 1669), 'geomHoney.getCorners', 'geomHoney.getCorners', (['lx', 'nx', 'ny'], {}), '(lx, nx, ny)\n', (1657, 1669), False, 'import geomHoney\n'), ((2080, 2110), 'geomHoney.getLines', 'geomHoney.getLines', (['(0, 0)', 'lx'], {}), '((0, 0), lx)\n', (2098, 2110), False, 'import geomHoney\n'), ((9977, 10031), 'bounda...
from django.conf import settings from django.urls import include, path from . import views urlpatterns = [ path(f"{settings.BASE_PATH}callback", views.callback, name="callback"), path(f"{settings.BASE_PATH}index", views.index, name="index"), path(f"{settings.BASE_PATH}v0/auth/login", views.login, name="op...
[ "django.urls.path", "django.urls.include" ]
[((113, 183), 'django.urls.path', 'path', (['f"""{settings.BASE_PATH}callback"""', 'views.callback'], {'name': '"""callback"""'}), "(f'{settings.BASE_PATH}callback', views.callback, name='callback')\n", (117, 183), False, 'from django.urls import include, path\n'), ((189, 250), 'django.urls.path', 'path', (['f"""{setti...
from PIL import Image def create_thumbnail(infile, outfile, size=(129, 129), file_format="JPEG"): if infile != outfile: try: im = Image.open(infile) im.thumbnail(size) im.save(outfile, file_format) return im except IOError: raise IOError ...
[ "PIL.Image.open" ]
[((156, 174), 'PIL.Image.open', 'Image.open', (['infile'], {}), '(infile)\n', (166, 174), False, 'from PIL import Image\n')]
import gym from stable_baselines3 import SAC from stable_baselines3.common.callbacks import BaseCallback from stable_baselines3.common.monitor import Monitor from stable_baselines3.common.vec_env import DummyVecEnv, VecNormalize import active_reward_learning from active_reward_learning.drlhp.reward_model import ( ...
[ "stable_baselines3.SAC", "stable_baselines3.common.vec_env.VecNormalize", "stable_baselines3.common.monitor.Monitor", "active_reward_learning.drlhp.reward_model.RewardModelNN.load", "active_reward_learning.drlhp.reward_model.RewardModelEnvWrapper", "active_reward_learning.drlhp.reward_model.TrueRewardCall...
[((412, 451), 'gym.make', 'gym.make', (['"""InvertedPendulum-Penalty-v2"""'], {}), "('InvertedPendulum-Penalty-v2')\n", (420, 451), False, 'import gym\n'), ((472, 518), 'active_reward_learning.drlhp.reward_model.RewardModelNN.load', 'RewardModelNN.load', (['"""pendulum_reward_model.pt"""'], {}), "('pendulum_reward_mode...
# Attention-based Feature-level Distillation # Original Source : https://github.com/HobbitLong/RepDistiller import os from torchvision import transforms, datasets import torch.utils.data as data import torch def create_loader(batch_size, data_dir, data): data_dir = os.path.join(data_dir, data) if ...
[ "torchvision.transforms.CenterCrop", "torchvision.datasets.CIFAR100", "os.path.join", "torchvision.transforms.RandomHorizontalFlip", "torch.utils.data.lower", "torchvision.transforms.RandomCrop", "torchvision.transforms.Normalize", "torch.utils.data.DataLoader", "torchvision.transforms.Resize", "t...
[((283, 311), 'os.path.join', 'os.path.join', (['data_dir', 'data'], {}), '(data_dir, data)\n', (295, 311), False, 'import os\n'), ((2235, 2345), 'torch.utils.data.DataLoader', 'torch.utils.data.DataLoader', (['trainset'], {'batch_size': 'batch_size', 'shuffle': '(True)', 'num_workers': '(4)', 'pin_memory': '(True)'}),...
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
[ "subprocess.Popen", "json.dumps", "moi.ctxs.get", "datetime.datetime.now", "moi.r_client.pipeline", "sys.exc_info", "moi.r_client.get", "functools.partial", "moi.group.create_info" ]
[((1299, 1372), 'subprocess.Popen', 'Popen', (['cmd'], {'universal_newlines': '(True)', 'shell': '(True)', 'stdout': 'PIPE', 'stderr': 'PIPE'}), '(cmd, universal_newlines=True, shell=True, stdout=PIPE, stderr=PIPE)\n', (1304, 1372), False, 'from subprocess import Popen, PIPE\n'), ((3586, 3625), 'functools.partial', 'pa...
import os from unittest import TestCase from keras_gpt_2 import get_bpe_from_files class TestBPE(TestCase): def test_encode_and_decode(self): current_path = os.path.dirname(os.path.abspath(__file__)) toy_checkpoint_path = os.path.join(current_path, 'toy_checkpoint') encoder_path = os.path...
[ "os.path.abspath", "keras_gpt_2.get_bpe_from_files", "os.path.join" ]
[((245, 289), 'os.path.join', 'os.path.join', (['current_path', '"""toy_checkpoint"""'], {}), "(current_path, 'toy_checkpoint')\n", (257, 289), False, 'import os\n'), ((313, 362), 'os.path.join', 'os.path.join', (['toy_checkpoint_path', '"""encoder.json"""'], {}), "(toy_checkpoint_path, 'encoder.json')\n", (325, 362), ...
#!/usr/bin/env python import PySimpleGUI as sg # Simple example of TabGroup element and the options available to it sg.theme('DarkAmber') # Please always add color to your window cookiesStat = [sg.Text("Cookies: "), sg.Text('0', size = (50,1), key="cookieBank"), sg.Text("CpS: "), sg.Text("0", size=(50,1), key="cp...
[ "PySimpleGUI.Text", "PySimpleGUI.TabGroup", "PySimpleGUI.Button", "PySimpleGUI.theme", "PySimpleGUI.Tab", "PySimpleGUI.Input", "PySimpleGUI.Window" ]
[((117, 138), 'PySimpleGUI.theme', 'sg.theme', (['"""DarkAmber"""'], {}), "('DarkAmber')\n", (125, 138), True, 'import PySimpleGUI as sg\n'), ((1834, 1893), 'PySimpleGUI.Window', 'sg.Window', (['"""My window with tabs"""', 'layout'], {'no_titlebar': '(False)'}), "('My window with tabs', layout, no_titlebar=False)\n", (...
#!/usr/bin/env python import PySimpleGUI as sg import os ''' Simple Image Browser based on PySimpleGUI ''' def main(): # Get the folder containing the images from the user folder = sg.popup_get_folder('Image folder to open') if folder is None: sg.popup_cancel('Cancelling') return ...
[ "PySimpleGUI.popup_get_folder", "os.listdir", "PySimpleGUI.Listbox", "PySimpleGUI.popup", "PySimpleGUI.Text", "PySimpleGUI.popup_cancel", "PySimpleGUI.Button", "PySimpleGUI.Col", "PySimpleGUI.Image", "PySimpleGUI.Menu", "PySimpleGUI.Window" ]
[((197, 240), 'PySimpleGUI.popup_get_folder', 'sg.popup_get_folder', (['"""Image folder to open"""'], {}), "('Image folder to open')\n", (216, 240), True, 'import PySimpleGUI as sg\n'), ((1229, 1338), 'PySimpleGUI.Window', 'sg.Window', (['"""Image Browser"""', 'layout'], {'return_keyboard_events': '(True)', 'location':...
import os import sys import torch import models import logging import argparse import datetime from amp import AMP from data_utils import load_data class Instructor: def __init__(self, args): self.args = args self.logger = logging.getLogger() self.logger.setLevel(logging.INFO) sel...
[ "logging.getLogger", "logging.StreamHandler", "torch.optim.lr_scheduler.MultiStepLR", "torch.nn.CrossEntropyLoss", "argparse.ArgumentParser", "torch.cuda.memory_allocated", "os.path.join", "torch.argmax", "sys.stdout.write", "datetime.datetime.now", "torch.cuda.is_available", "logging.FileHand...
[((5963, 6070), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Trainer"""', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), "(description='Trainer', formatter_class=argparse.\n ArgumentDefaultsHelpFormatter)\n", (5986, 6070), False, 'import argparse\n'), ((246, 265), 'l...
import re import pandas as pd import numpy as np from sklearn.model_selection import train_test_split class FormulaProcessor: def __init__(self, formula): self.formula = formula yX = self.stringFilter(re.split(r'\~+', self.formula)) if len(yX) != 2: raise Exception(f"{...
[ "sklearn.model_selection.train_test_split", "re.split" ]
[((1184, 1278), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'y'], {'test_size': 'trainingProfile.validationSplit', 'random_state': 'randomSeed'}), '(X, y, test_size=trainingProfile.validationSplit,\n random_state=randomSeed)\n', (1200, 1278), False, 'from sklearn.model_selection import tra...
from django.shortcuts import get_object_or_404 from menu.models import Menu """ Credits to CI's Boutique Ado Tutorial """ def cart_contents(request): cart_items = [] total = 0 item_count = 0 cart = request.session.get('order', {}) for item_id, quantity in cart.items(): menu = get_object...
[ "django.shortcuts.get_object_or_404" ]
[((310, 345), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['Menu'], {'pk': 'item_id'}), '(Menu, pk=item_id)\n', (327, 345), False, 'from django.shortcuts import get_object_or_404\n')]
from arlo import Arlo import datetime import glob import re import os import imageio import timeout_decorator import yaml import logging import logging.handlers CONFIG_PATH = './cfg/' LAPSE_PATH = './lapse/' SNAPSHOT_PATH = './raw/' PURGE_DURATION_HOURS = 24 LAPSE_DURATION = 20 LOGGER = logging.get...
[ "logging.getLogger", "re.search", "timeout_decorator.timeout", "logging.Formatter", "imageio.mimwrite", "yaml.load", "os.remove", "datetime.datetime.now", "glob.glob", "imageio.imread", "os.system", "datetime.timedelta", "logging.handlers.SysLogHandler", "arlo.Arlo" ]
[((309, 336), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (326, 336), False, 'import logging\n'), ((380, 422), 'logging.handlers.SysLogHandler', 'logging.handlers.SysLogHandler', (['"""/dev/log"""'], {}), "('/dev/log')\n", (410, 422), False, 'import logging\n'), ((436, 508), 'logging.F...
""" .. module:: mixtures :platform: Unix, Windows :synopsis: a module for defining the class :class:`Mixture`. .. moduleauthor:: <NAME> <<EMAIL>> """ import numpy as np import pandas as pd import mics from mics.funcs import deltaMethod from mics.funcs import diff from mics.funcs import func from mics.utils im...
[ "mics.utils.InputError", "numpy.log", "numpy.equal", "mics.utils.stdError", "numpy.array", "mics.utils.multimap", "numpy.arange", "numpy.histogram", "mics.utils.cases", "mics.funcs.diff", "pandas.concat", "pandas.DataFrame", "mics.utils.info", "mics.funcs.deltaMethod", "numpy.amin", "n...
[((1484, 1529), 'numpy.array', 'np.array', (['[sample.neff for sample in samples]'], {}), '([sample.neff for sample in samples])\n', (1492, 1529), True, 'import numpy as np\n'), ((1933, 1948), 'mics.utils.bennett', 'bennett', (['self.u'], {}), '(self.u)\n', (1940, 1948), False, 'from mics.utils import bennett\n'), ((12...
from django.test import TestCase from dojo.tools.scantist.parser import ScantistJSONParser from dojo.models import Test class TestScantistJSONParser(TestCase): def test_parse_without_file_has_no_findings(self): parser = ScantistJSONParser(None, Test()) self.assertEqual(0, len(parser.items)) ...
[ "dojo.models.Test" ]
[((260, 266), 'dojo.models.Test', 'Test', ([], {}), '()\n', (264, 266), False, 'from dojo.models import Test\n'), ((501, 507), 'dojo.models.Test', 'Test', ([], {}), '()\n', (505, 507), False, 'from dojo.models import Test\n'), ((744, 750), 'dojo.models.Test', 'Test', ([], {}), '()\n', (748, 750), False, 'from dojo.mode...