code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import regex
from src.extractor.constants import separators, prefixes
from src.extractor.models.ExtractedData import ExtractedList
from src.extractor.models.RegexHandler import RegexHandler
from src.utils.conversion_utils import parse_postal_code
from src.utils.io_utils import load_regex
from src.utils.number_conversi... | [
"src.extractor.models.RegexHandler.RegexHandler",
"regex.compile",
"src.utils.io_utils.load_regex"
] | [((388, 436), 'src.utils.io_utils.load_regex', 'load_regex', ([], {'regex_file_name': '"""postal_code.regexp"""'}), "(regex_file_name='postal_code.regexp')\n", (398, 436), False, 'from src.utils.io_utils import load_regex\n'), ((457, 753), 'regex.compile', 'regex.compile', (['POSTAL_CODE_REGEX_STRING'], {'seperator_pos... |
"""
This compares force from drag on a 2 inch projectile at a variety of
velocities using a variety of formulas.
"""
import math
import sys
import ballistics
Hutton = { # Hutton, 1812, Vol. III, p. 318
5: 0.006,
10: 0.026,
15: 0.058,
20: 0.103,
25: 0.163,
30: 0.237,
40: 0.427,
50: 0.... | [
"sys.stdout.write",
"ballistics.determine_material",
"ballistics.acceleration_from_drag",
"ballistics.convert_units",
"math.log10",
"ballistics.acceleration_from_gravity"
] | [((1553, 1582), 'sys.stdout.write', 'sys.stdout.write', (['"""Velocity """'], {}), "('Velocity ')\n", (1569, 1582), False, 'import sys\n'), ((1661, 1696), 'sys.stdout.write', 'sys.stdout.write', (['""" Mn ^Re\n"""'], {}), "(' Mn ^Re\\n')\n", (1677, 1696), False, 'import sys\n'), ((1728, 1762), 'sys.stdout.w... |
"""
Script to delete datasource
It is a handy script to delete datasource, while creating and new importers
The script only takes one argument the name of the API that needs to be deleted
Importers can be deleted:
python manage.py remove -id <Name-of-the-importer>
Name of the importer can be found:
python manage.p... | [
"models.sensor.Sensor.query.filter_by",
"models.sensor_attribute.SensorAttribute.s_id.in_",
"models.api.API.get_all",
"os.path.dirname",
"db.db.session.delete",
"models.attributes.Attributes.id.in_",
"db.db.session.query",
"db.db.session.commit",
"flask_script.Option"
] | [((1072, 1085), 'models.api.API.get_all', 'API.get_all', ([], {}), '()\n', (1083, 1085), False, 'from models.api import API\n'), ((1242, 1270), 'db.db.session.delete', 'db.session.delete', (['_dict[id]'], {}), '(_dict[id])\n', (1259, 1270), False, 'from db import db\n'), ((1273, 1292), 'db.db.session.commit', 'db.sessi... |
from django.shortcuts import render,redirect
from django.http import HttpResponse,Http404
from .models import Image,Location,Category
# Create your views here.
from django import forms
from django.http import HttpResponse
from cloudinary.forms import cl_init_js_callbacks
from .forms import PhotoForm
def upload... | [
"django.shortcuts.render"
] | [((551, 590), 'django.shortcuts.render', 'render', (['request', '"""upload.html"""', 'context'], {}), "(request, 'upload.html', context)\n", (557, 590), False, 'from django.shortcuts import render, redirect\n'), ((734, 853), 'django.shortcuts.render', 'render', (['request', '"""all-photos/all_photos.html"""', "{'images... |
import http.server
import socketserver
PORT = 8000
# Found this at
# https://stackoverflow.com/questions/39801718/how-to-run-a-http-server-which-serve-a-specific-path
#
# Change the base directory for the simple server by intercepting the constructor
# for SimpleHTTPRequestHandler
DIRECTORY = "w... | [
"socketserver.TCPServer"
] | [((586, 629), 'socketserver.TCPServer', 'socketserver.TCPServer', (["('', PORT)", 'Handler'], {}), "(('', PORT), Handler)\n", (608, 629), False, 'import socketserver\n')] |
import numpy as np
import random as rd
import pandas as pd
data = pd.read_csv('Assets\MetaData\Metadata1.csv',sep = ';')
print(data)
x = data["Cost"]
print (x)
for i in range(1,17):
x = data[data.columns[i]]
for j in range (0,len(x)-1):
if(x[j] is not None):
x[j] = rd.randint(0,400)
... | [
"pandas.read_csv",
"random.randint"
] | [((70, 125), 'pandas.read_csv', 'pd.read_csv', (['"""Assets\\\\MetaData\\\\Metadata1.csv"""'], {'sep': '""";"""'}), "('Assets\\\\MetaData\\\\Metadata1.csv', sep=';')\n", (81, 125), True, 'import pandas as pd\n'), ((298, 316), 'random.randint', 'rd.randint', (['(0)', '(400)'], {}), '(0, 400)\n', (308, 316), True, 'impor... |
"""Config flow for roon integration."""
import asyncio
import logging
from roon import RoonApi
import voluptuous as vol
from homeassistant import config_entries, core, exceptions
from homeassistant.const import CONF_API_KEY, CONF_HOST
from .const import ( # pylint: disable=unused-import
AUTHENTICATE_TIMEOUT,
... | [
"voluptuous.Schema",
"roon.RoonApi",
"asyncio.sleep",
"logging.getLogger"
] | [((379, 406), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (396, 406), False, 'import logging\n'), ((422, 447), 'voluptuous.Schema', 'vol.Schema', (["{'host': str}"], {}), "({'host': str})\n", (432, 447), True, 'import voluptuous as vol\n'), ((774, 834), 'roon.RoonApi', 'RoonApi', (['RO... |
import os
from abc import abstractmethod
from typing import Tuple, Type, Dict, Optional, Any
from enn_zoo.griddly.wrapper import GriddlyEnv
from entity_gym.environment import ActionSpace, ObsSpace, Entity, CategoricalActionSpace
from entity_gym.environment import Environment
from griddly import GymWrapper, gd
init_pa... | [
"os.path.realpath",
"entity_gym.environment.CategoricalActionSpace",
"entity_gym.environment.ObsSpace",
"entity_gym.environment.Entity",
"os.path.join",
"griddly.GymWrapper"
] | [((341, 367), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (357, 367), False, 'import os\n'), ((938, 953), 'entity_gym.environment.ObsSpace', 'ObsSpace', (['space'], {}), '(space)\n', (946, 953), False, 'from entity_gym.environment import ActionSpace, ObsSpace, Entity, CategoricalActionSp... |
# Copyright (c) 2020 wngfra
# Use of this source code is governed by the Apache-2.0 license, see LICENSE
import socket
from collections import deque
import numpy as np
import rclpy
from rclpy.node import Node
from tactile_interfaces.msg import TactileSignal
from tactile_interfaces.srv import ChangeState
STATE_LIST... | [
"rclpy.spin",
"rclpy.init",
"socket.socket",
"numpy.zeros",
"rclpy.shutdown",
"numpy.mean",
"tactile_interfaces.msg.TactileSignal",
"collections.deque"
] | [((4306, 4327), 'rclpy.init', 'rclpy.init', ([], {'args': 'args'}), '(args=args)\n', (4316, 4327), False, 'import rclpy\n'), ((4367, 4382), 'rclpy.spin', 'rclpy.spin', (['pub'], {}), '(pub)\n', (4377, 4382), False, 'import rclpy\n'), ((4387, 4403), 'rclpy.shutdown', 'rclpy.shutdown', ([], {}), '()\n', (4401, 4403), Fal... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | [
"six.with_metaclass"
] | [((1163, 1214), 'six.with_metaclass', 'with_metaclass', (['_CaseInsensitiveEnumMeta', 'str', 'Enum'], {}), '(_CaseInsensitiveEnumMeta, str, Enum)\n', (1177, 1214), False, 'from six import with_metaclass\n'), ((1324, 1375), 'six.with_metaclass', 'with_metaclass', (['_CaseInsensitiveEnumMeta', 'str', 'Enum'], {}), '(_Cas... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright (c) 2019 <NAME>
This software is released under the MIT License.
See the LICENSE file in the project root for more information.
"""
import numpy as np
import os
import six.moves.urllib as urllib
import sys
import tarfile
import tensorflow as tf... | [
"distutils.version.StrictVersion",
"cv2.getTickCount",
"tensorflow.get_default_graph",
"cv2.imshow",
"os.path.join",
"tensorflow.greater",
"sys.path.append",
"cv2.getTickFrequency",
"cv2.cvtColor",
"tensorflow.cast",
"tensorflow.squeeze",
"tensorflow.GraphDef",
"cv2.destroyAllWindows",
"cv... | [((873, 933), 'sys.path.append', 'sys.path.append', (['"""/home/pi/models/research/object_detection"""'], {}), "('/home/pi/models/research/object_detection')\n", (888, 933), False, 'import sys\n'), ((1234, 1287), 'os.path.join', 'os.path.join', (['MODEL_NAME', '"""frozen_inference_graph.pb"""'], {}), "(MODEL_NAME, 'fro... |
# Copyright 2021 AIPlan4EU project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | [
"upf.test.main",
"upf.test.TestCase.setUp",
"upf.test.examples.get_example_problems"
] | [((20166, 20172), 'upf.test.main', 'main', ([], {}), '()\n', (20170, 20172), False, 'from upf.test import TestCase, main\n'), ((768, 788), 'upf.test.TestCase.setUp', 'TestCase.setUp', (['self'], {}), '(self)\n', (782, 788), False, 'from upf.test import TestCase, main\n'), ((813, 835), 'upf.test.examples.get_example_pro... |
import sys
import os
from cliff.app import App
from cliff.commandmanager import CommandManager
from hvac_cli.version import __version__
DEFAULT_VAULT_ADDR = 'http://127.0.0.1:8200'
class HvacApp(App):
def __init__(self):
super(HvacApp, self).__init__(
description="""
hvac-cli i... | [
"cliff.commandmanager.CommandManager",
"os.getenv"
] | [((641, 667), 'cliff.commandmanager.CommandManager', 'CommandManager', (['"""hvac_cli"""'], {}), "('hvac_cli')\n", (655, 667), False, 'from cliff.commandmanager import CommandManager\n'), ((1255, 1279), 'os.getenv', 'os.getenv', (['"""VAULT_TOKEN"""'], {}), "('VAULT_TOKEN')\n", (1264, 1279), False, 'import os\n'), ((27... |
QGRAIN_VERSION = "0.3.4.2"
import os
QGRAIN_ROOT_PATH = os.path.dirname(__file__)
from enum import Enum, unique
@unique
class DistributionType(Enum):
Customized = "Customized"
Nonparametric = "NonParametric"
Normal = "Normal"
Weibull = "Weibull"
SkewNormal = "SkewNormal"
@unique
class FittingSt... | [
"os.path.dirname"
] | [((58, 83), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (73, 83), False, 'import os\n')] |
import vcs
x=vcs.init()
b=x.createboxfill()
b.boxfill_type="custom"
b.levels=[10.0, 21.42857142857143, 32.85714285714286, 44.28571428571429, 55.71428571428572, 67.14285714285715, 78.57142857142858, 90.00000000000001]
assert(abs(b.levels[0])<1.e19 and b.ext_1 is False and b.ext_2 is False)
b.ext_1=False
assert(abs(b.lev... | [
"vcs.init"
] | [((13, 23), 'vcs.init', 'vcs.init', ([], {}), '()\n', (21, 23), False, 'import vcs\n')] |
"""
https://softeer.ai/practice/info.do?eventIdx=1&psProblemId=581
택배 마스터 광우
큐, 순열
"""
import sys
input = sys.stdin.readline
import itertools
N, M, K = map(int, input().split())
arr = map(int, input().split())
result = 987654321
def dojob(k, p, m):
global result
part_sum = 0
s = 0
i = 0
while Tr... | [
"itertools.permutations"
] | [((620, 647), 'itertools.permutations', 'itertools.permutations', (['arr'], {}), '(arr)\n', (642, 647), False, 'import itertools\n')] |
# -*- encoding: utf-8 -*-
#from flask_sqlalchemy import SQLAlchemy
#db = SQLAlchemy()
from sqlalchemy import Column, Integer, Text
from database import db
from database import Base
class Paste(Base):
__tablename__ = 'paste'
id = Column(Integer, primary_key = True)
#hash = db.Column(db.String(32), unique =... | [
"database.db.add",
"sqlalchemy.Text",
"sqlalchemy.Column",
"database.db.commit"
] | [((239, 272), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)'}), '(Integer, primary_key=True)\n', (245, 272), False, 'from sqlalchemy import Column, Integer, Text\n'), ((345, 351), 'sqlalchemy.Text', 'Text', ([], {}), '()\n', (349, 351), False, 'from sqlalchemy import Column, Integer, Text\n'), ((... |
from __future__ import unicode_literals
import json
import time
class Event(object):
"""Base class for a websocket 'event'."""
__slots__ = ['received_time']
def __init__(self):
self.received_time = time.time()
def __repr__(self):
return "{}()".format(self.__class__.__name__)
@c... | [
"json.loads",
"time.time"
] | [((222, 233), 'time.time', 'time.time', ([], {}), '()\n', (231, 233), False, 'import time\n'), ((9315, 9336), 'json.loads', 'json.loads', (['self.text'], {}), '(self.text)\n', (9325, 9336), False, 'import json\n')] |
"""Retrive Tweets, word embeddings, and populate DB"""
import tweepy
import spacy
from .models import DB, Tweet, User
from os import getenv
TWITTER_API_KEY = getenv('TWITTER_API_KEY')
TWITTER_API_KEY_SECRET = getenv('TWITTER_API_KEY_SECRET')
TWITTER_AUTH = tweepy.OAuthHandler(TWITTER_API_KEY, TWITTER_API_KEY_SECRET)... | [
"tweepy.OAuthHandler",
"tweepy.API",
"os.getenv",
"spacy.load"
] | [((160, 185), 'os.getenv', 'getenv', (['"""TWITTER_API_KEY"""'], {}), "('TWITTER_API_KEY')\n", (166, 185), False, 'from os import getenv\n'), ((211, 243), 'os.getenv', 'getenv', (['"""TWITTER_API_KEY_SECRET"""'], {}), "('TWITTER_API_KEY_SECRET')\n", (217, 243), False, 'from os import getenv\n'), ((260, 320), 'tweepy.OA... |
import os
from tests.checks import checks
from tests.harness import harness
from scripts import terminal
check_dir = os.path.dirname(os.path.abspath(__file__))
check_suite = checks.CheckSuite()
folds = [3]
inf_folds = [3]
incs = [1]
FLT_BIN_WIDTH=13
FLT_MAX_EXP=128
FLT_BIG_EXP=13
FLT_SMALL_EXP=-12
FLT_MIN_EXP=-125... | [
"tests.checks.checks.VerifyRDASUMTest",
"tests.checks.checks.ValidateXBLASRCDOTUTest",
"tests.checks.checks.ValidateInternalRZSUMTest",
"tests.checks.checks.ValidateInternalRZDOTUTest",
"tests.checks.checks.CorroborateRDGEMMTest",
"os.path.abspath",
"tests.checks.checks.CorroborateRCGEMVTest",
"tests.... | [((177, 196), 'tests.checks.checks.CheckSuite', 'checks.CheckSuite', ([], {}), '()\n', (194, 196), False, 'from tests.checks import checks\n'), ((31700, 31724), 'tests.harness.harness.Harness', 'harness.Harness', (['"""check"""'], {}), "('check')\n", (31715, 31724), False, 'from tests.harness import harness\n'), ((135,... |
#!/usr/bin/env python
from __future__ import print_function
import time
import traceback
import os
import base64
import random
import sys
import json
import subprocess
from os import walk
from os.path import splitext, join
import io
if sys.version_info >= (3,):
def unicode(s):
return s
from sandbox import... | [
"sys.stdout.write",
"json.dump",
"os.path.isdir",
"os.path.dirname",
"os.walk",
"os.path.exists",
"time.sleep",
"time.time",
"traceback.format_exc",
"os.path.splitext",
"sys.stderr.write",
"os.path.join",
"os.listdir"
] | [((18473, 18484), 'time.time', 'time.time', ([], {}), '()\n', (18482, 18484), False, 'import time\n'), ((21899, 21940), 'os.path.exists', 'os.path.exists', (['"""C:\\\\Program Files\\\\java"""'], {}), "('C:\\\\Program Files\\\\java')\n", (21913, 21940), False, 'import os\n'), ((22057, 22104), 'os.path.exists', 'os.path... |
#!/usr/bin/env python
"""Check Identity class"""
from matplotlib import pyplot as plt
import numpy as N
from load import ROOT as R
from matplotlib.ticker import MaxNLocator
from gna import constructors as C
from gna.bindings import DataType
from gna.unittest import *
from gna import context
#
# Create the matrix
#
d... | [
"argparse.ArgumentParser",
"numpy.allclose",
"gna.constructors.Points",
"gna.env.env.globalns",
"load.ROOT.Identity",
"numpy.arange",
"gna.constructors.Dummy",
"gna.context.manager"
] | [((551, 564), 'gna.constructors.Points', 'C.Points', (['mat'], {}), '(mat)\n', (559, 564), True, 'from gna import constructors as C\n'), ((580, 592), 'load.ROOT.Identity', 'R.Identity', ([], {}), '()\n', (590, 592), True, 'from load import ROOT as R\n'), ((829, 849), 'numpy.allclose', 'N.allclose', (['mat', 'res'], {})... |
# Copyright (C) 2013 ~ 2016 - <NAME> <<EMAIL>>
# This program is Free Software see LICENSE file for details
import sublime
from ._typing import List
from Default.history_list import get_jump_history_for_view
class ExplorerPanel:
"""
Creates a panel that can be used to explore nested options sets
The d... | [
"sublime.active_window",
"sublime.Region",
"Default.history_list.get_jump_history_for_view"
] | [((3292, 3315), 'sublime.active_window', 'sublime.active_window', ([], {}), '()\n', (3313, 3315), False, 'import sublime\n'), ((3970, 4006), 'Default.history_list.get_jump_history_for_view', 'get_jump_history_for_view', (['self.view'], {}), '(self.view)\n', (3995, 4006), False, 'from Default.history_list import get_jum... |
from __future__ import annotations
import glob
import os
import uuid
from typing import Callable
import pandas as pd
import pytest
from black import itertools
from pyriksprot import interface, to_speech
from pyriksprot.corpus import tagged as tagged_corpus
from .utility import TAGGED_SOURCE_PATTERN, UTTERANCES_DICT... | [
"pyriksprot.interface.UtteranceHelper.from_json",
"pyriksprot.interface.UtteranceHelper.to_json",
"pyriksprot.to_speech.MergeByWhoSequence",
"pyriksprot.interface.UtteranceHelper.from_csv",
"uuid.uuid4",
"pyriksprot.interface.Protocol",
"pyriksprot.corpus.tagged.load_protocols",
"pytest.fixture",
"p... | [((403, 433), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (417, 433), False, 'import pytest\n'), ((570, 658), 'pyriksprot.interface.Utterance', 'interface.Utterance', ([], {'u_id': '"""A"""', 'speaker_hash': '"""x"""', 'who': '"""x"""', 'paragraphs': "['X', 'Y', 'C']"}), "... |
import FWCore.ParameterSet.Config as cms
process = cms.Process("L1SKIM")
process.load("FWCore.MessageService.MessageLogger_cfi")
process.MessageLogger.cerr.FwkReport.reportEvery = 100000
process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )
####################### configure pool source ####... | [
"FWCore.ParameterSet.Config.string",
"FWCore.ParameterSet.Config.untracked.int32",
"FWCore.ParameterSet.Config.double",
"FWCore.ParameterSet.Config.untracked.vstring",
"FWCore.ParameterSet.Config.untracked.double",
"FWCore.ParameterSet.Config.untracked.bool",
"FWCore.ParameterSet.Config.EndPath",
"FWC... | [((52, 73), 'FWCore.ParameterSet.Config.Process', 'cms.Process', (['"""L1SKIM"""'], {}), "('L1SKIM')\n", (63, 73), True, 'import FWCore.ParameterSet.Config as cms\n'), ((1476, 1499), 'FWCore.ParameterSet.Config.InputTag', 'cms.InputTag', (['"""gtDigis"""'], {}), "('gtDigis')\n", (1488, 1499), True, 'import FWCore.Param... |
import os
import random
import sys
import pygame
from pygame.locals import *
class Satyr(pygame.sprite.Sprite):
def __init__(self, position, ipath, scale=0.5):
pygame.sprite.Sprite.__init__(self)
img = pygame.image.load(ipath)
rect = img.get_rect(center=position)
w, h = rect.size... | [
"pygame.quit",
"random.randint",
"pygame.event.get",
"pygame.display.set_mode",
"pygame.init",
"pygame.sprite.Group",
"pygame.transform.scale",
"pygame.display.update",
"random.random",
"pygame.sprite.Sprite.__init__",
"pygame.sprite.spritecollide",
"pygame.image.load",
"pygame.mouse.get_pos... | [((1759, 1772), 'pygame.init', 'pygame.init', ([], {}), '()\n', (1770, 1772), False, 'import pygame\n'), ((1838, 1878), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(width, height)'], {}), '((width, height))\n', (1861, 1878), False, 'import pygame\n'), ((1921, 1961), 'pygame.display.set_caption', 'pygame.di... |
from direct.distributed.DistributedObjectGlobalAI import DistributedObjectGlobalAI
from direct.distributed.PyDatagram import *
from direct.directnotify.DirectNotifyGlobal import directNotify
class GlobalLobbyManagerAI(DistributedObjectGlobalAI):
notify = directNotify.newCategory('GlobalLobbyManagerAI')
def an... | [
"direct.directnotify.DirectNotifyGlobal.directNotify.newCategory",
"direct.distributed.DistributedObjectGlobalAI.DistributedObjectGlobalAI.announceGenerate"
] | [((260, 308), 'direct.directnotify.DirectNotifyGlobal.directNotify.newCategory', 'directNotify.newCategory', (['"""GlobalLobbyManagerAI"""'], {}), "('GlobalLobbyManagerAI')\n", (284, 308), False, 'from direct.directnotify.DirectNotifyGlobal import directNotify\n'), ((350, 398), 'direct.distributed.DistributedObjectGlob... |
"""
Combines predictions based on votes by a set of answer files.
"""
import re
from os import listdir
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
from sklearn.metrics import accuracy_score
from .consta... | [
"numpy.load",
"numpy.abs",
"numpy.argmax",
"pandas.read_csv",
"sklearn.metrics.accuracy_score",
"numpy.isclose",
"numpy.mean",
"pandas.set_option",
"pandas.DataFrame",
"matplotlib.pyplot.close",
"matplotlib.ticker.FormatStrFormatter",
"matplotlib.ticker.MultipleLocator",
"matplotlib.pyplot.s... | [((463, 486), 'numpy.argmax', 'np.argmax', (['conf'], {'axis': '(0)'}), '(conf, axis=0)\n', (472, 486), True, 'import numpy as np\n'), ((566, 613), 'sklearn.metrics.accuracy_score', 'accuracy_score', ([], {'y_true': 'y_true', 'y_pred': 'conf_vote'}), '(y_true=y_true, y_pred=conf_vote)\n', (580, 613), False, 'from sklea... |
import os
import m5
from m5.objects import *
m5.util.addToPath('../common')
spec_dist = os.environ.get('M5_CPU2006', '/dist/m5/cpu2006')
binary_dir = spec_dist
data_dir = binary_dir
current_pid = 100
# 400.perlbench
def perlbench():
process = Process(pid=current_pid)
process.cwd = binary_dir + '400.perlb... | [
"os.environ.get",
"m5.util.addToPath"
] | [((47, 77), 'm5.util.addToPath', 'm5.util.addToPath', (['"""../common"""'], {}), "('../common')\n", (64, 77), False, 'import m5\n'), ((91, 139), 'os.environ.get', 'os.environ.get', (['"""M5_CPU2006"""', '"""/dist/m5/cpu2006"""'], {}), "('M5_CPU2006', '/dist/m5/cpu2006')\n", (105, 139), False, 'import os\n')] |
# import libraries
import os
import argparse
import cudf
import mlflow
# define functions
def main():
# Set the columns and their datatypes for conversion and parsing
cols = ['Flight_Number_Reporting_Airline', 'Year', 'Quarter', 'Month', 'DayOfWeek', 'DOT_ID_Reporting_Airline', 'OriginCityMarketID', 'DestC... | [
"cudf.read_csv",
"mlflow.log_metric",
"cudf.merge"
] | [((1574, 1621), 'mlflow.log_metric', 'mlflow.log_metric', (['"""processed rows"""', 'count_rows'], {}), "('processed rows', count_rows)\n", (1591, 1621), False, 'import mlflow\n'), ((2008, 2044), 'cudf.read_csv', 'cudf.read_csv', (['"""./data/carriers.csv"""'], {}), "('./data/carriers.csv')\n", (2021, 2044), False, 'im... |
# Databricks notebook source
import numpy as np
import pandas as pd
from scipy import stats
# COMMAND ----------
# Simulate original ice cream dataset
df = pd.DataFrame()
df['temperature'] = np.random.uniform(60, 80, 1000)
df['number_of_cones_sold'] = np.random.uniform(0, 20, 1000)
flavors = ["Vanilla"] * 300 + ['... | [
"pandas.DataFrame",
"numpy.random.uniform",
"numpy.random.normal",
"numpy.random.shuffle"
] | [((160, 174), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (172, 174), True, 'import pandas as pd\n'), ((195, 226), 'numpy.random.uniform', 'np.random.uniform', (['(60)', '(80)', '(1000)'], {}), '(60, 80, 1000)\n', (212, 226), True, 'import numpy as np\n'), ((256, 286), 'numpy.random.uniform', 'np.random.unifo... |
# -*- coding: utf-8 -*-
from PyQt5.QtWidgets import QVBoxLayout, QDialog, QLineEdit, QHBoxLayout, QPushButton, QProgressDialog
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QMessageBox
from PyQt5.QtCore import pyqtSignal, Qt
from network import Server, Client
import logging
import socket
class Connectio... | [
"PyQt5.QtCore.pyqtSignal",
"PyQt5.QtWidgets.QProgressDialog",
"PyQt5.QtGui.QIcon",
"network.Client",
"PyQt5.QtWidgets.QLineEdit",
"PyQt5.QtWidgets.QHBoxLayout",
"PyQt5.QtWidgets.QPushButton",
"PyQt5.QtWidgets.QMessageBox.warning",
"PyQt5.QtWidgets.QVBoxLayout",
"socket.gethostname",
"network.Ser... | [((359, 371), 'PyQt5.QtCore.pyqtSignal', 'pyqtSignal', ([], {}), '()\n', (369, 371), False, 'from PyQt5.QtCore import pyqtSignal, Qt\n'), ((655, 668), 'PyQt5.QtWidgets.QVBoxLayout', 'QVBoxLayout', ([], {}), '()\n', (666, 668), False, 'from PyQt5.QtWidgets import QVBoxLayout, QDialog, QLineEdit, QHBoxLayout, QPushButton... |
from __future__ import division
__author__ = '<NAME>'
import numpy as np
from scipy.stats import norm
import string
import bottleneck as bn
import math
# paa tranformation, window = incoming data, string_length = length of outcoming data
class sax():
def process(self, window, output_length, sax_vocab):
sa... | [
"numpy.divide",
"scipy.stats.norm",
"numpy.mean",
"numpy.array",
"numpy.where",
"numpy.linspace",
"numpy.array_split",
"numpy.sqrt"
] | [((661, 675), 'numpy.array', 'np.array', (['data'], {}), '(data)\n', (669, 675), True, 'import numpy as np\n'), ((804, 839), 'numpy.array_split', 'np.array_split', (['data', 'string_length'], {}), '(data, string_length)\n', (818, 839), True, 'import numpy as np\n'), ((2446, 2485), 'scipy.stats.norm', 'norm', (['data', ... |
import komand
from .schema import GetFileInput, GetFileOutput
# Custom imports below
from komand_get_url.util.utils import Utils
class GetFile(komand.Action):
def __init__(self):
super(self.__class__, self).__init__(
name='get_file',
description='Download a file by URL',
... | [
"komand.helper.open_cachefile",
"komand.helper.check_cachefile",
"komand_get_url.util.utils.Utils",
"komand.helper.check_hashes",
"komand.helper.check_url",
"komand.helper.encode_file",
"komand.helper.encode_string"
] | [((428, 446), 'komand_get_url.util.utils.Utils', 'Utils', ([], {'action': 'self'}), '(action=self)\n', (433, 446), False, 'from komand_get_url.util.utils import Utils\n'), ((861, 908), 'komand.helper.check_cachefile', 'komand.helper.check_cachefile', (["meta['metafile']"], {}), "(meta['metafile'])\n", (890, 908), False... |
import tempfile
import os
from PIL import Image
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Recipe, Tag, Ingredient
from recipe.serializers import ... | [
"core.models.Recipe.objects.filter",
"core.models.Tag.objects.create",
"tempfile.NamedTemporaryFile",
"PIL.Image.new",
"core.models.Recipe.objects.create",
"core.models.Recipe.objects.all",
"recipe.serializers.RecipeDetailSerializer",
"core.models.Recipe.objects.get",
"os.path.exists",
"django.con... | [((376, 405), 'django.urls.reverse', 'reverse', (['"""recipe:recipe-list"""'], {}), "('recipe:recipe-list')\n", (383, 405), False, 'from django.urls import reverse\n'), ((482, 537), 'django.urls.reverse', 'reverse', (['"""recipe:recipe-upload-image"""'], {'args': '[recipe_id]'}), "('recipe:recipe-upload-image', args=[r... |
from kivy.config import Config # isort:skip
Config.set("input", "mouse", "mouse,multitouch_on_demand") # isort:skip # no red dots on right click
ICON = "img/icon.png"
Config.set("kivy", "window_icon", ICON) # isort:skip # set icon before Window is imported
import signal
import os
import sys
import threading
impo... | [
"kivy.config.Config.set",
"core.game.KaTrainSGF.parse",
"os.path.join",
"traceback.print_exc",
"sys._current_frames",
"threading.Thread",
"core.game.KaTrainSGF.parse_file",
"core.ai.ai_move",
"core.sgf_parser.Move",
"signal.signal",
"queue.Queue",
"sys.exit",
"kivy.uix.popup.Popup",
"os.ge... | [((46, 104), 'kivy.config.Config.set', 'Config.set', (['"""input"""', '"""mouse"""', '"""mouse,multitouch_on_demand"""'], {}), "('input', 'mouse', 'mouse,multitouch_on_demand')\n", (56, 104), False, 'from kivy.config import Config\n'), ((171, 210), 'kivy.config.Config.set', 'Config.set', (['"""kivy"""', '"""window_icon... |
# Copyright 2020 The Pigweed 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | [
"struct.Struct",
"re.compile"
] | [((1414, 1542), 're.compile', 're.compile', (['"""%(?:(?P<flags>[+\\\\- #0]*\\\\d*(?:\\\\.\\\\d+)?)(?P<length>hh|h|ll|l|j|z|t|L)?(?P<type>[csdioxXufFeEaAgGnp])|%)"""'], {}), "(\n '%(?:(?P<flags>[+\\\\- #0]*\\\\d*(?:\\\\.\\\\d+)?)(?P<length>hh|h|ll|l|j|z|t|L)?(?P<type>[csdioxXufFeEaAgGnp])|%)'\n )\n", (1424, 1542)... |
#!/usr/bin/env python
import unittest
from pyspark.sql import SparkSession
from mmtfPyspark.datasets import dbPtmDataset as pm
from mmtfPyspark.datasets.dbPtmDataset import PtmType
class DbPtmDatasetTest(unittest.TestCase):
def setUp(self):
self.spark = SparkSession.builder.master("local[*]") \
... | [
"unittest.main",
"mmtfPyspark.datasets.dbPtmDataset.get_ptm_dataset",
"mmtfPyspark.datasets.dbPtmDataset.download_ptm_dataset",
"pyspark.sql.SparkSession.builder.master"
] | [((703, 718), 'unittest.main', 'unittest.main', ([], {}), '()\n', (716, 718), False, 'import unittest\n'), ((419, 473), 'mmtfPyspark.datasets.dbPtmDataset.download_ptm_dataset', 'pm.download_ptm_dataset', (['PtmType.S_LINKEDGLYCOSYLATION'], {}), '(PtmType.S_LINKEDGLYCOSYLATION)\n', (442, 473), True, 'from mmtfPyspark.d... |
import numpy as np
from astropy.table import Table
import glob
models = ['MIST_v1.2_feh_m4.00_afe_p0.0_vvcrit0.0_EEPS',
'MIST_v1.2_feh_m4.00_afe_p0.0_vvcrit0.4_EEPS',
'MIST_v1.2_feh_p0.00_afe_p0.0_vvcrit0.0_EEPS',
'MIST_v1.2... | [
"astropy.table.Table",
"numpy.loadtxt",
"glob.glob"
] | [((820, 827), 'astropy.table.Table', 'Table', ([], {}), '()\n', (825, 827), False, 'from astropy.table import Table\n'), ((640, 667), 'glob.glob', 'glob.glob', (["(model + '/*.txt')"], {}), "(model + '/*.txt')\n", (649, 667), False, 'import glob\n'), ((684, 700), 'numpy.loadtxt', 'np.loadtxt', (['file'], {}), '(file)\n... |
import json
import csv
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import itertools
import os
import shutil
def get_dtype_groups(data_types):
float_unis = []
object_unis = []
int_unis = []
for i, v in data_types.items():
if i == np.dtype('float... | [
"os.makedirs",
"matplotlib.pyplot.axes",
"os.path.isdir",
"itertools.permutations",
"numpy.dtype",
"os.path.exists",
"pandas.unique",
"matplotlib.pyplot.figure",
"seaborn.color_palette",
"shutil.rmtree",
"matplotlib.pyplot.subplots"
] | [((933, 953), 'os.makedirs', 'os.makedirs', (['dirpath'], {}), '(dirpath)\n', (944, 953), False, 'import os\n'), ((1107, 1119), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1117, 1119), True, 'import matplotlib.pyplot as plt\n'), ((1129, 1154), 'matplotlib.pyplot.axes', 'plt.axes', ([], {'projection': '... |
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright SAS Institute
#
# 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... | [
"dlpy.network.extract_conv_layer",
"dlpy.utils.DLPyError",
"dlpy.sequential.Sequential",
"dlpy.network.extract_input_layer",
"dlpy.layers.Concat",
"dlpy.layers.OutputLayer",
"os.path.dirname",
"dlpy.layers.Conv2d",
"dlpy.network.extract_output_layer",
"dlpy.layers.InputLayer",
"dlpy.layers.Globa... | [((4077, 4123), 'dlpy.sequential.Sequential', 'Sequential', ([], {'conn': 'conn', 'model_table': 'model_table'}), '(conn=conn, model_table=model_table)\n', (4087, 4123), False, 'from dlpy.sequential import Sequential\n'), ((8023, 8069), 'dlpy.sequential.Sequential', 'Sequential', ([], {'conn': 'conn', 'model_table': 'm... |
#!/usr/bin/env python3
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
import numpy as np
import sys
import operator
import bisect
import os
class Scale:
def __init__(self, prefix, mult):
self.prefix = prefix
self.mult = float(mult)
def __call__(self... | [
"os.sysconf",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.gridspec.GridSpec",
"matplotlib.pyplot.savefig"
] | [((898, 967), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(scale * 7 * self.columns, scale * self.rows * 2)'}), '(figsize=(scale * 7 * self.columns, scale * self.rows * 2))\n', (908, 967), True, 'import matplotlib.pyplot as plt\n'), ((1032, 1065), 'matplotlib.gridspec.GridSpec', 'GridSpec', (['self.rows... |
from django.contrib import admin
from .models import Author, Genre, Artwork, Painting, Book, Media
class AuthorAdmin(admin.ModelAdmin):
list_display = ('id', 'name', )
list_display_links = ('id', 'name', )
search_fields = ('name', )
class GenreAdmin(admin.ModelAdmin):
list_display = ('id', 'title',... | [
"django.contrib.admin.site.register"
] | [((1043, 1083), 'django.contrib.admin.site.register', 'admin.site.register', (['Author', 'AuthorAdmin'], {}), '(Author, AuthorAdmin)\n', (1062, 1083), False, 'from django.contrib import admin\n'), ((1084, 1122), 'django.contrib.admin.site.register', 'admin.site.register', (['Genre', 'GenreAdmin'], {}), '(Genre, GenreAd... |
import re
import json
from urllib.parse import parse_qs, urlparse
from json import JSONDecodeError
from django.template.defaultfilters import truncatechars
from django.utils.encoding import force_text
from security.config import settings
from security.utils import remove_nul_from_string
def is_base_collection(v):... | [
"json.loads",
"re.finditer",
"security.config.settings.HIDE_SENSITIVE_DATA_PATTERNS.get",
"re.match",
"django.template.defaultfilters.truncatechars",
"security.utils.remove_nul_from_string",
"django.utils.encoding.force_text",
"urllib.parse.urlparse",
"re.compile"
] | [((406, 426), 're.compile', 're.compile', (['"""^HTTP_"""'], {}), "('^HTTP_')\n", (416, 426), False, 'import re\n'), ((3055, 3092), 'django.utils.encoding.force_text', 'force_text', (['content'], {'errors': '"""replace"""'}), "(content, errors='replace')\n", (3065, 3092), False, 'from django.utils.encoding import force... |
#!/usr/bin/env python
'''
Example code for
k-point spin-restricted periodic MP2 calculation using the staggered mesh method
Author: <NAME> (<EMAIL>)
Reference: Staggered Mesh Method for Correlation Energy Calculations of Solids: Second-Order
Møller–Plesset Perturbation Theory, J. Chem. Theory Comput. 2021, 17,... | [
"pyscf.pbc.scf.KRHF",
"pyscf.pbc.df.GDF",
"pyscf.pbc.mp.KMP2",
"pyscf.pbc.mp.kmp2_stagger.KMP2_stagger",
"pyscf.pbc.gto.Cell"
] | [((462, 472), 'pyscf.pbc.gto.Cell', 'gto.Cell', ([], {}), '()\n', (470, 472), False, 'from pyscf.pbc import df, gto, scf, mp\n'), ((848, 884), 'pyscf.pbc.scf.KRHF', 'scf.KRHF', (['cell', 'kpts'], {'exxdiv': '"""ewald"""'}), "(cell, kpts, exxdiv='ewald')\n", (856, 884), False, 'from pyscf.pbc import df, gto, scf, mp\n')... |
try:
from django.utils.deprecation import MiddlewareMixin as MIDDLEWARE_BASE_CLASS
except ImportError:
MIDDLEWARE_BASE_CLASS = object
from django.contrib.auth import views as auth_views
from django.utils.decorators import method_decorator
from .decorators import watch_login
class FailedLoginMiddleware(MIDDLE... | [
"django.utils.decorators.method_decorator"
] | [((969, 1000), 'django.utils.decorators.method_decorator', 'method_decorator', (['our_decorator'], {}), '(our_decorator)\n', (985, 1000), False, 'from django.utils.decorators import method_decorator\n')] |
# Copyright (c) Facebook, Inc. and its affiliates.
# TODO: Once internal torchvision transforms become stable either in torchvision
# or in pytorchvideo, move to use those transforms.
import random
import mmf.datasets.processors.functional as F
import torch
from mmf.common.registry import registry
from mmf.datasets.p... | [
"mmf.datasets.processors.functional.video_hflip",
"random.randint",
"mmf.datasets.processors.functional.video_to_normalized_float_tensor",
"mmf.datasets.processors.functional.video_resize",
"torch.zeros",
"mmf.datasets.processors.functional.video_crop",
"mmf.common.registry.registry.register_processor",... | [((354, 402), 'mmf.common.registry.registry.register_processor', 'registry.register_processor', (['"""video_random_crop"""'], {}), "('video_random_crop')\n", (381, 402), False, 'from mmf.common.registry import registry\n'), ((1113, 1161), 'mmf.common.registry.registry.register_processor', 'registry.register_processor',... |
import math
import os
from datetime import timedelta, datetime
import unicodedata
from typing import List
import re
import pandas as pd
from dateutil import parser
# timedelta/datetime
def strtotimedelta(s: str):
"""XM X minutes, XH X hours, Xd X days, Xw X weeks, Xm X months, all separated by a space"""
t... | [
"dateutil.parser.parse",
"math.ceil",
"math.floor",
"re.match",
"math.copysign",
"datetime.timedelta",
"os.path.splitext"
] | [((323, 334), 'datetime.timedelta', 'timedelta', ([], {}), '()\n', (332, 334), False, 'from datetime import timedelta, datetime\n'), ((3105, 3135), 're.match', 're.match', (['"""^\\\\d+[a-zA-Z]+$"""', 's'], {}), "('^\\\\d+[a-zA-Z]+$', s)\n", (3113, 3135), False, 'import re\n'), ((7350, 7365), 'dateutil.parser.parse', '... |
"""Test Keysmith."""
import subprocess
import sys
import keysmith
def test_script():
"""Test a full run when directly invoking."""
subprocess.check_call([sys.executable, keysmith.__file__])
def test_python_m():
"""Test python -m."""
command = [sys.executable, '-m', keysmith.__name__]
assert su... | [
"subprocess.run",
"keysmith.main",
"subprocess.check_call"
] | [((143, 201), 'subprocess.check_call', 'subprocess.check_call', (['[sys.executable, keysmith.__file__]'], {}), '([sys.executable, keysmith.__file__])\n', (164, 201), False, 'import subprocess\n'), ((437, 463), 'keysmith.main', 'keysmith.main', (["['--stats']"], {}), "(['--stats'])\n", (450, 463), False, 'import keysmit... |
import numpy as np
from deepen.activation import relu, relu_backward, sigmoid, sigmoid_backward
def initialize_params(layer_dims):
"""Create and initialize the params of an L-layer neural network.
Parameters
----------
layer_dims : list or tuple of int
The number of neurons in each layer of th... | [
"numpy.divide",
"deepen.activation.relu",
"numpy.sum",
"numpy.log",
"numpy.random.randn",
"numpy.zeros",
"deepen.activation.sigmoid",
"numpy.squeeze",
"numpy.dot",
"deepen.activation.relu_backward",
"deepen.activation.sigmoid_backward",
"numpy.sqrt"
] | [((4728, 4744), 'numpy.squeeze', 'np.squeeze', (['cost'], {}), '(cost)\n', (4738, 4744), True, 'import numpy as np\n'), ((5651, 5666), 'numpy.dot', 'np.dot', (['W.T', 'dZ'], {}), '(W.T, dZ)\n', (5657, 5666), True, 'import numpy as np\n'), ((877, 905), 'numpy.zeros', 'np.zeros', (['(layer_dims[l], 1)'], {}), '((layer_di... |
#!E:\py_virtual_env\saas_project\Scripts\python.exe
# -*- coding: utf-8 -*-
from django.template import Library
from web import models
register = Library()
@register.inclusion_tag('inclusion/all_project_list.html')
def all_project_list(request):
"""
1。获取我创建的所有项目
2.获取我参与的所有项目
:return:
"""
my_pro... | [
"django.template.Library",
"web.models.ProjectUser.objects.filter",
"web.models.Project.objects.filter"
] | [((146, 155), 'django.template.Library', 'Library', ([], {}), '()\n', (153, 155), False, 'from django.template import Library\n'), ((332, 390), 'web.models.Project.objects.filter', 'models.Project.objects.filter', ([], {'creator': 'request.tracer.user'}), '(creator=request.tracer.user)\n', (361, 390), False, 'from web ... |
from nmigen import *
from nmigen.cli import main
from nmigen.asserts import *
from enum import Enum, unique, IntEnum
# Two different types of "enums".
class Thing(object):
"""A fake enumerated value.
This isn't actually an Enum, but is just a bag of constants,
and not at all Pythonic.
"... | [
"nmigen.cli.main"
] | [((10042, 10258), 'nmigen.cli.main', 'main', (['m'], {'ports': '[meow.input, meow.output, meow3.input, meow3.output, meow4.input, meow4.\n output, meow5.input, meow5.output, meow6.input, meow6.output1, meow6.\n output2, meow6.output3, meow7.input, meow7.output]'}), '(m, ports=[meow.input, meow.output, meow3.input... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""
The MetadataWizard(pymdwizard) software was developed by the
U.S. Geological Survey Fort Collins Science Center.
See: https://github.com/usgs/fort-pymdwizard for current project source code
See: https://usgs.github.io/fort-pymdwizard/ for current user documentation
See: ... | [
"PyQt5.QtGui.QPainter",
"pymdwizard.gui.distinfo.DistInfo",
"PyQt5.QtCore.QTimeLine",
"pymdwizard.gui.DataQuality.DataQuality",
"pymdwizard.gui.IDInfo.IdInfo",
"pymdwizard.gui.spatial_tab.SpatialTab",
"pymdwizard.core.xml_utils.xml_node",
"pymdwizard.gui.EA.EA",
"pymdwizard.gui.metainfo.MetaInfo",
... | [((11272, 11329), 'pymdwizard.core.utils.launch_widget', 'utils.launch_widget', (['MetadataRoot', '"""MetadataRoot testing"""'], {}), "(MetadataRoot, 'MetadataRoot testing')\n", (11291, 11329), False, 'from pymdwizard.core import utils\n'), ((3654, 3691), 'pymdwizard.gui.IDInfo.IdInfo', 'IdInfo', ([], {'root_widget': '... |
import uuid
import pytest
from selenium.common.exceptions import TimeoutException
from skyportal.tests import api
def enter_comment_text(driver, comment_text):
comment_xpath = "//div[contains(@data-testid, 'individual-spectrum-id_')]//textarea[@name='text']"
comment_box = driver.wait_for_xpath(comment_xpath... | [
"uuid.uuid4",
"skyportal.tests.api",
"pytest.mark.flaky"
] | [((920, 947), 'pytest.mark.flaky', 'pytest.mark.flaky', ([], {'reruns': '(2)'}), '(reruns=2)\n', (937, 947), False, 'import pytest\n'), ((2173, 2326), 'skyportal.tests.api', 'api', (['"""POST"""', 'f"""spectra/{spectrum_id}/annotations"""'], {'data': "{'origin': 'kowalski', 'data': {'useful_info': annotation_data}}", '... |
import string
import pytest
from pysj import md5, sha1, sha256, uuid
from pysj.crypto import ALPHABET
@pytest.mark.parametrize(
"hash_algorithm, digest",
[
("sha256", "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"),
("sha1", "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3"),
... | [
"pytest.raises",
"pytest.mark.parametrize",
"pysj.uuid",
"pysj.sha256"
] | [((107, 350), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""hash_algorithm, digest"""', "[('sha256',\n '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08'), (\n 'sha1', 'a94a8fe5ccb19ba61c4c0873d391e987982fbbd3'), ('md5',\n '098f6bcd4621d373cade4e832627b4f6')]"], {}), "('hash_algor... |
#!/usr/bin/env python3
"""Tetrix
This is a Qt6 version of the classic Tetrix game.
The object of the game is to stack pieces dropped from the top of the playing
area so that they fill entire rows at the bottom of the playing area.
When a row is filled, all the blocks on that row are removed, the player earns
a numbe... | [
"PySide6.QtGui.QPainter",
"PySide6.QtCore.QBasicTimer",
"PySide6.QtGui.QColor",
"random.choice",
"PySide6.QtWidgets.QPushButton",
"PySide6.QtWidgets.QLabel",
"time.time",
"PySide6.QtWidgets.QApplication",
"PySide6.QtCore.Signal",
"PySide6.QtWidgets.QGridLayout",
"PySide6.QtWidgets.QLCDNumber"
] | [((4476, 4494), 'PySide6.QtCore.Signal', 'QtCore.Signal', (['int'], {}), '(int)\n', (4489, 4494), False, 'from PySide6 import QtCore\n'), ((4514, 4532), 'PySide6.QtCore.Signal', 'QtCore.Signal', (['int'], {}), '(int)\n', (4527, 4532), False, 'from PySide6 import QtCore\n'), ((4559, 4577), 'PySide6.QtCore.Signal', 'QtCo... |
import csv
from baseline.base_utils import INTENTION_TAGS_WITH_SPACE
''' Convert .tsv to .csv without header for each intent
Format:
example1 intent1
example2 intent1
...
exampleN intentM
'''
dataset_arr = ['chatbot', 'snips']
dataset_fullname_arr = ['ChatbotCorpus', 'snips']
for tts_stt in ["gtts_witai", "macsay_wi... | [
"csv.reader",
"csv.writer"
] | [((735, 771), 'csv.reader', 'csv.reader', (['tsv_file'], {'delimiter': '"""\t"""'}), "(tsv_file, delimiter='\\t')\n", (745, 771), False, 'import csv\n'), ((964, 1001), 'csv.writer', 'csv.writer', (['file_test'], {'delimiter': '"""\t"""'}), "(file_test, delimiter='\\t')\n", (974, 1001), False, 'import csv\n')] |
# Generated by Django 3.0.6 on 2020-05-17 00:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shelf', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='clipping',
name='kind_of_clipping',
... | [
"django.db.models.CharField",
"django.db.models.TextField"
] | [((335, 474), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[('Highlight', 'Highlight'), ('Note', 'Note'), ('Bookmark', 'Bookmark')]", 'default': '"""Highlight"""', 'max_length': '(10)'}), "(choices=[('Highlight', 'Highlight'), ('Note', 'Note'), (\n 'Bookmark', 'Bookmark')], default='Highlight'... |
"""
Peasauce - interactive disassembler
Copyright (C) 2012-2017 <NAME>
Licensed using the MIT license.
This file is intended to allow compilation of assembler instructions and
from the compiled binary, the ability to isolate the machine code those
instructions produce.
The targeted assembl... | [
"tempfile.NamedTemporaryFile",
"os.remove",
"os.path.join",
"os.getcwd",
"tempfile.gettempdir",
"os.path.exists",
"subprocess.call",
"glob.glob",
"os.path.split",
"tempfile.mktemp",
"os.chdir",
"logging.getLogger"
] | [((2201, 2241), 'logging.getLogger', 'logging.getLogger', (['"""tool-assembler-vasm"""'], {}), "('tool-assembler-vasm')\n", (2218, 2241), False, 'import logging\n'), ((2372, 2383), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (2381, 2383), False, 'import os\n'), ((3741, 3762), 'tempfile.gettempdir', 'tempfile.gettempdir... |
import matplotlib.pyplot as plt
import numpy as np
import random
from collections import namedtuple
def plot_winsratio(
wins: list,
title: str,
start_idx: int = 0,
wsize_mean: int = 100,
wsize_means_mean: int = 1000,
opponent_update_idxs=None,
):
"""Winrate plotting function, plots both a ... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.plot",
"random.sample",
"matplotlib.pyplot.close",
"matplotlib.pyplot.legend",
"numpy.cumsum",
"collections.namedtuple",
"matplotlib.pyplot.savefig"
] | [((2784, 2852), 'collections.namedtuple', 'namedtuple', (['"""Transition"""', "('ob', 'action', 'next_ob', 'rew', 'done')"], {}), "('Transition', ('ob', 'action', 'next_ob', 'rew', 'done'))\n", (2794, 2852), False, 'from collections import namedtuple\n'), ((1078, 1106), 'numpy.cumsum', 'np.cumsum', (['wins'], {'dtype':... |
import mp3treesim as mp3
import argparse
def main():
parser = argparse.ArgumentParser(
description='mp3treesim', # TODO: fix this
add_help=True)
parser.add_argument('trees', metavar='TREE', nargs=2,
help='Paths to the trees')
group_mode = parser.add_mutually_excl... | [
"mp3treesim.similarity",
"mp3treesim.read_dotfile",
"argparse.ArgumentParser"
] | [((68, 132), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""mp3treesim"""', 'add_help': '(True)'}), "(description='mp3treesim', add_help=True)\n", (91, 132), False, 'import argparse\n'), ((966, 997), 'mp3treesim.read_dotfile', 'mp3.read_dotfile', (['args.trees[0]'], {}), '(args.trees[0])... |
# Generated by Django 2.2.5 on 2020-07-04 00:22
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('system', '0018_auto_20200703_2354'),
]
operations = [
migrations.AddField(
model_name='role',
name='code... | [
"django.db.models.CharField",
"uuid.UUID"
] | [((341, 384), 'django.db.models.CharField', 'models.CharField', ([], {'default': '""""""', 'max_length': '(20)'}), "(default='', max_length=20)\n", (357, 384), False, 'from django.db import migrations, models\n'), ((541, 590), 'uuid.UUID', 'uuid.UUID', (['"""f51c894d-a532-4ddc-b3e9-2847d4b2e7ae"""'], {}), "('f51c894d-a... |
from pathlib import Path
_ = lambda x : x
addon_info = {
"addon_name" : "unspokenPy3",
"addon_summary" : _("Unspoken"),
"addon_description" : _("""Removes names label from object like, link, button. It plays different sounds instead of labels."""),
"addon_version" : "0.4",
"addon_author" : u", Sean (ported py... | [
"pathlib.Path.cwd"
] | [((643, 653), 'pathlib.Path.cwd', 'Path.cwd', ([], {}), '()\n', (651, 653), False, 'from pathlib import Path\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
process_activity_logs.py
Script to process activity_log records.
* Create activity_log records from tentative_activity_log records.
* Delete tentative_activity_log records converted thus.
"""
import sys
import traceback
from optparse import OptionParser
from applicat... | [
"traceback.print_exc",
"optparse.OptionParser",
"applications.zcomx.modules.activity_logs.ActivityLog.from_add",
"applications.zcomx.modules.logger.set_cli_logging",
"applications.zcomx.modules.activity_logs.TentativeLogSet.load"
] | [((1220, 1262), 'optparse.OptionParser', 'OptionParser', ([], {'usage': 'usage', 'version': 'VERSION'}), '(usage=usage, version=VERSION)\n', (1232, 1262), False, 'from optparse import OptionParser\n'), ((2017, 2066), 'applications.zcomx.modules.logger.set_cli_logging', 'set_cli_logging', (['LOG', 'options.verbose', 'op... |
import sys
import os
from loguru import logger
from config_handler import get_mongo_config
from docker_service import create_archive, get_docker_container
from exceptions import AppError
class MongoImportRunner:
container_dest_dir = "/home"
def __call__(self, source, destination):
container = get_d... | [
"exceptions.AppError",
"os.path.basename",
"docker_service.create_archive",
"config_handler.get_mongo_config",
"docker_service.get_docker_container",
"sys.exit"
] | [((315, 344), 'docker_service.get_docker_container', 'get_docker_container', (['"""mongo"""'], {}), "('mongo')\n", (335, 344), False, 'from docker_service import create_archive, get_docker_container\n'), ((366, 388), 'docker_service.create_archive', 'create_archive', (['source'], {}), '(source)\n', (380, 388), False, '... |
####################################################################################################
### ###
### Functions for graph handling (creation, ...) ###
### ... | [
"openbabel.pybel.readstring",
"matplotlib.pyplot.figure",
"networkx.draw_networkx_nodes",
"networkx.draw_networkx_labels",
"networkx.shell_layout",
"networkx.random_layout",
"matplotlib.pyplot.close",
"networkx.kamada_kawai_layout",
"networkx.spectral_layout",
"networkx.shortest_path_length",
"m... | [((5451, 5461), 'networkx.Graph', 'nx.Graph', ([], {}), '()\n', (5459, 5461), True, 'import networkx as nx\n'), ((10232, 10343), 'networkx.algorithms.graph_hashing.weisfeiler_lehman_graph_hash', 'nx.algorithms.graph_hashing.weisfeiler_lehman_graph_hash', (['G2'], {'edge_attr': '"""w"""', 'node_attr': '"""elem"""', 'ite... |
"""
This module implements all the functionalities required for setting up and
running Fio workloads on the pods.
This module implements few functions
setup(): for setting up fio utility on the pod and any necessary
environmental params.
run(): for running fio on pod on specified mount point
Note: The above menti... | [
"logging.getLogger"
] | [((499, 526), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (516, 526), False, 'import logging\n')] |
"""Add pending flag
Revision ID: 6458bd3b46dc
Revises: <PASSWORD>
Create Date: 2017-11-26 07:32:09.814699
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None
def upgrade():
# ### comm... | [
"alembic.op.drop_column",
"sqlalchemy.Boolean"
] | [((572, 604), 'alembic.op.drop_column', 'op.drop_column', (['"""iou"""', '"""pending"""'], {}), "('iou', 'pending')\n", (586, 604), False, 'from alembic import op\n'), ((418, 430), 'sqlalchemy.Boolean', 'sa.Boolean', ([], {}), '()\n', (428, 430), True, 'import sqlalchemy as sa\n')] |
# pylint: disable=C0111,R0903
"""Display HTTP status code
Parameters:
* http__status.label: Prefix label (optional)
* http__status.target: Target to retrieve the HTTP status from
* http__status.expect: Expected HTTP status
contributed by `valkheim <https://github.com/valkheim>`_ - many thanks!
"""
from ... | [
"requests.head"
] | [((962, 981), 'requests.head', 'head', (['self.__target'], {}), '(self.__target)\n', (966, 981), False, 'from requests import head\n')] |
"""commandline.
Usage:
commandline.py lookup --lang=<lang> --word=<preword> [--ip=<redis-ip>] [--port=<redis-port>]
commandline.py -h | --help
Options:
-h --help Show this screen.
--lang=<lang> Language of suggested word.
--word=<preword> Pre-word of suggested word.
--ip=<rediis-i... | [
"redis.StrictRedis",
"py_word_suggest.Selector_redis",
"docopt.docopt"
] | [((557, 601), 'docopt.docopt', 'docopt', (['__doc__'], {'version': '"""commandline 0.0.1"""'}), "(__doc__, version='commandline 0.0.1')\n", (563, 601), False, 'from docopt import docopt\n'), ((792, 833), 'redis.StrictRedis', 'redis.StrictRedis', ([], {'host': 'rs', 'port': 'rp', 'db': '(0)'}), '(host=rs, port=rp, db=0)... |
import torch
import torch.nn as nn
from torch.autograd import Variable
# adapted from pytorch/examples/vae and ethanluoyc/pytorch-vae
class ImageClassifier(nn.Module):
def __init__(self, latent_variable_size, pretrained, nout=2):
super(ImageClassifier, self).__init__()
self.latent_variable_size =... | [
"torch.nn.ReLU",
"torch.nn.ConvTranspose2d",
"torch.autograd.Variable",
"torch.nn.Conv2d",
"torch.nn.BatchNorm1d",
"torch.nn.BatchNorm2d",
"torch.cuda.is_available",
"torch.nn.Linear",
"torch.nn.LeakyReLU",
"torch.nn.Sigmoid"
] | [((412, 449), 'torch.nn.Linear', 'nn.Linear', (['latent_variable_size', 'nout'], {}), '(latent_variable_size, nout)\n', (421, 449), True, 'import torch.nn as nn\n'), ((1948, 1996), 'torch.nn.Linear', 'nn.Linear', (['(ndf * 8 * 2 * 2)', 'latent_variable_size'], {}), '(ndf * 8 * 2 * 2, latent_variable_size)\n', (1957, 19... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Software: Pre-Processing-01
Description:
- Processa todos arquivos, dos diretórios neg_ e pos_ do dataset que contem os registros
já separados em arquivos .TXT;
- Converte todos para caracteres minusculos;
- Remove carac... | [
"nltk.stem.RSLPStemmer",
"re.sub",
"os.listdir",
"sys.setdefaultencoding"
] | [((1239, 1270), 'sys.setdefaultencoding', 'sys.setdefaultencoding', (['"""utf-8"""'], {}), "('utf-8')\n", (1261, 1270), False, 'import sys\n'), ((2086, 2142), 're.sub', 're.sub', (['"""[-_./?!,`":;=+()<>|@#$%&*^~\\\\\']"""', '""""""', 'document'], {}), '(\'[-_./?!,`":;=+()<>|@#$%&*^~\\\\\\\']\', \'\', document)\n', (20... |
import torch as th
from copy import deepcopy
def knowledge_transfer(net2: th.nn.Module, old_state_path: str):
print(f"Copied weights from {old_state_path}")
net1 = th.load(old_state_path)
old_state = net1.state_dict()
n_layers_old = net1.transformer.n_layers
n_head_old = net1.transformer.n_heads
... | [
"copy.deepcopy",
"torch.load",
"torch.cat",
"torch.randn_like"
] | [((174, 197), 'torch.load', 'th.load', (['old_state_path'], {}), '(old_state_path)\n', (181, 197), True, 'import torch as th\n'), ((507, 526), 'copy.deepcopy', 'deepcopy', (['new_state'], {}), '(new_state)\n', (515, 526), False, 'from copy import deepcopy\n'), ((806, 833), 'torch.randn_like', 'th.randn_like', (['new_st... |
## This Python file uses the following encoding: utf-8
from PyQt5.QtWidgets import *
from mainwindow import MainWindow
from call_standard import StandardPageWindow
import sys
if __name__ == '__main__':
app = QApplication(sys.argv)
mainWindow = MainWindow()
mainWindow.show()
sys.exit(app.exec_())
| [
"mainwindow.MainWindow"
] | [((254, 266), 'mainwindow.MainWindow', 'MainWindow', ([], {}), '()\n', (264, 266), False, 'from mainwindow import MainWindow\n')] |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-21 06:31
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('wagtailcore', '0023_alter_page_revision_... | [
"django.db.models.CharField",
"django.db.models.ForeignKey",
"django.db.models.PositiveSmallIntegerField",
"django.db.models.BooleanField",
"django.db.models.AutoField"
] | [((473, 566), '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", (489, 566), False, 'from django.db import migrations, models\... |
import copy
import json
import logging
import time
import pytest
import test_utilities
from pytest_utilities import create_new_sifaddr
from pytest_utilities import generate_test_account, generate_minimal_test_account
from test_utilities import EthereumToSifchainTransferRequest
def test_ebrelayer_restart(
ba... | [
"pytest_utilities.generate_minimal_test_account",
"copy.deepcopy",
"test_utilities.wait_for_sif_account",
"logging.debug",
"test_utilities.create_ethereum_addresses",
"test_utilities.wait_for_eth_balance",
"test_utilities.get_sifchain_addr_balance",
"test_utilities.advance_n_ethereum_blocks",
"json.... | [((1261, 1310), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""ensure_relayer_restart"""'], {}), "('ensure_relayer_restart')\n", (1284, 1310), False, 'import pytest\n'), ((3291, 3340), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""ensure_relayer_restart"""'], {}), "('ensure_relayer_restart')\... |
import setuptools
import os, sys
sys.path.append(os.getcwd())
import mpdb
with open("README.md", "r") as fh:
long_description = fh.read()
try:
from Cython.Build import cythonize
cem = cythonize("mpdb/eq/*.pyx")
except:
cem = []
setuptools.setup(
author="<NAME>",
author_email="<EMAIL>",
cl... | [
"os.getcwd",
"Cython.Build.cythonize",
"setuptools.find_packages"
] | [((49, 60), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (58, 60), False, 'import os, sys\n'), ((198, 224), 'Cython.Build.cythonize', 'cythonize', (['"""mpdb/eq/*.pyx"""'], {}), "('mpdb/eq/*.pyx')\n", (207, 224), False, 'from Cython.Build import cythonize\n'), ((573, 599), 'setuptools.find_packages', 'setuptools.find_pa... |
#!/usr/bin/env python
# Parses the nl80211.h interface and generate appropriate enums and fields
# (value_string) for packet-netlink-nl80211.c
#
# Copyright (c) 2017, <NAME> <<EMAIL>>
# Copyright (c) 2018, <NAME> <<EMAIL>>
#
# Wireshark - Network traffic analyzer
# By Ger<NAME> <<EMAIL>>
# Copyright 1998 Gerald Combs
#... | [
"sys.stdin.read",
"argparse.ArgumentParser",
"requests.get",
"re.sub",
"re.compile"
] | [((7737, 7834), 're.compile', 're.compile', (['"""enum\\\\s+?(?P<enum>\\\\w+)\\\\s+?\\\\{(?P<values>.*?)\\\\}\\\\;"""', '(re.MULTILINE | re.DOTALL)'], {}), "('enum\\\\s+?(?P<enum>\\\\w+)\\\\s+?\\\\{(?P<values>.*?)\\\\}\\\\;', re.\n MULTILINE | re.DOTALL)\n", (7747, 7834), False, 'import re\n'), ((7847, 7898), 're.co... |
# Generated by Django 3.0.6 on 2020-06-10 14:43
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('core', '0001_initial'),
... | [
"django.db.migrations.swappable_dependency",
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.models.SlugField",
"django.db.models.AutoField"
] | [((227, 284), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (258, 284), False, 'from django.db import migrations, models\n'), ((458, 593), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'null': '(True)', 'on... |
import bottle
from genetic import GA
ga = GA()
app = bottle.Bottle()
@app.get('/')
def home():
data = ga.get_data()
return bottle.template('home.html', **data)
@app.get('/mark-hit/<ident>')
def mark_hit(ident):
ga.mark_hit(ident)
if __name__ == '__main__':
app.run(debug=True)
| [
"bottle.template",
"genetic.GA",
"bottle.Bottle"
] | [((44, 48), 'genetic.GA', 'GA', ([], {}), '()\n', (46, 48), False, 'from genetic import GA\n'), ((55, 70), 'bottle.Bottle', 'bottle.Bottle', ([], {}), '()\n', (68, 70), False, 'import bottle\n'), ((135, 171), 'bottle.template', 'bottle.template', (['"""home.html"""'], {}), "('home.html', **data)\n", (150, 171), False, ... |
from sympy import sympify, Symbol
x = Symbol('x') #Se comvierte la variable a simbolico
#Funcion principal del metodo
def metodo_nuevo(x_0, f, tol, iter_max):
if tol <= 0:
raise ValueError('Tolerancia no debe ser cero.') #Error al ingresar una tolerancia con las condiones no aptas
f = sympify(f)
... | [
"sympy.Symbol",
"sympy.sympify"
] | [((39, 50), 'sympy.Symbol', 'Symbol', (['"""x"""'], {}), "('x')\n", (45, 50), False, 'from sympy import sympify, Symbol\n'), ((306, 316), 'sympy.sympify', 'sympify', (['f'], {}), '(f)\n', (313, 316), False, 'from sympy import sympify, Symbol\n')] |
import numpy as np
from matplotlib import pyplot as plt
from matplotlib.lines import Line2D
import matplotlib.ticker as ticker
def movingAverage(x, window):
ret = np.zeros_like(x)
for i in range(len(x)):
idx1 = max(0, i - (window - 1) // 2)
idx2 = min(len(x), i + (window - 1) // 2 + (2 - (window % 2)))
... | [
"numpy.zeros_like",
"matplotlib.pyplot.show",
"numpy.mean",
"numpy.array",
"matplotlib.ticker.FormatStrFormatter",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.subplots"
] | [((168, 184), 'numpy.zeros_like', 'np.zeros_like', (['x'], {}), '(x)\n', (181, 184), True, 'import numpy as np\n'), ((458, 481), 'numpy.mean', 'np.mean', (['x[min_idx:idx]'], {}), '(x[min_idx:idx])\n', (465, 481), True, 'import numpy as np\n'), ((527, 541), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n'... |
#!/usr/bin/env python
# _*_ coding: utf-8 _*_
import os
import argparse
from pymatflow.qe.static import StaticRun
"""
usage:
"""
control = {}
system = {}
electrons = {}
bands = {}
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("-d", "--directory", t... | [
"pymatflow.qe.static.StaticRun",
"argparse.ArgumentParser"
] | [((245, 270), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (268, 270), False, 'import argparse\n'), ((7538, 7549), 'pymatflow.qe.static.StaticRun', 'StaticRun', ([], {}), '()\n', (7547, 7549), False, 'from pymatflow.qe.static import StaticRun\n')] |
import pytest
from hypothesis import assume, given
from pfun import compose, identity
from pfun.aio_trampoline import Done
from pfun.hypothesis_strategies import aio_trampolines, anything, unaries
from .monad_test import MonadTest
class TestTrampoline(MonadTest):
@pytest.mark.asyncio
@given(aio_trampolines(... | [
"pfun.aio_trampoline.Done",
"pfun.compose",
"pfun.hypothesis_strategies.anything",
"hypothesis.assume"
] | [((526, 536), 'pfun.hypothesis_strategies.anything', 'anything', ([], {}), '()\n', (534, 536), False, 'from pfun.hypothesis_strategies import aio_trampolines, anything, unaries\n'), ((1093, 1103), 'pfun.hypothesis_strategies.anything', 'anything', ([], {}), '()\n', (1101, 1103), False, 'from pfun.hypothesis_strategies ... |
import os
from datetime import datetime
from distutils.util import strtobool
import discord
from discord.ext import commands
from dotenv import load_dotenv
load_dotenv()
LOCKDOWN_ACTIVE = bool(os.getenv('LOCKDOWN_ACTIVE'))
class Administration(commands.Cog):
@commands.command()
@commands.has_permissio... | [
"discord.ext.commands.command",
"discord.ext.commands.has_permissions",
"dotenv.load_dotenv",
"datetime.datetime.now",
"os.getenv"
] | [((158, 171), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (169, 171), False, 'from dotenv import load_dotenv\n'), ((196, 224), 'os.getenv', 'os.getenv', (['"""LOCKDOWN_ACTIVE"""'], {}), "('LOCKDOWN_ACTIVE')\n", (205, 224), False, 'import os\n'), ((274, 292), 'discord.ext.commands.command', 'commands.command'... |
# SPDX-License-Identifier: Apache-2.0
"""
Tests scikit-normalizer converter.
"""
import unittest
import numpy
from sklearn.preprocessing import Normalizer
from skl2onnx import convert_sklearn
from skl2onnx.common.data_types import (
Int64TensorType, FloatTensorType, DoubleTensorType)
from test_utils import dump_da... | [
"unittest.main",
"skl2onnx.common.data_types.DoubleTensorType",
"skl2onnx.common.data_types.Int64TensorType",
"skl2onnx.common.data_types.FloatTensorType",
"numpy.array",
"sklearn.preprocessing.Normalizer"
] | [((4006, 4021), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4019, 4021), False, 'import unittest\n'), ((459, 480), 'sklearn.preprocessing.Normalizer', 'Normalizer', ([], {'norm': '"""l2"""'}), "(norm='l2')\n", (469, 480), False, 'from sklearn.preprocessing import Normalizer\n'), ((824, 845), 'sklearn.preproces... |
import random as r
def solve(board_size):
"""Solves the n-queens problem given a board size n
Args:
board_size (int): The size of the n*n board containing n queens.
Returns:
board (int[]): A list where each element corresponds to the row of a queen. It is 1-based.
"""
# Declare... | [
"random.choice"
] | [((4028, 4049), 'random.choice', 'r.choice', (['integerList'], {}), '(integerList)\n', (4036, 4049), True, 'import random as r\n'), ((4072, 4094), 'random.choice', 'r.choice', (['integerList2'], {}), '(integerList2)\n', (4080, 4094), True, 'import random as r\n'), ((1063, 1085), 'random.choice', 'r.choice', (['conflict... |
import numpy as np
from flask import Flask, session,abort,request, jsonify, render_template,redirect,url_for,flash
import pickle
import pandas as pd
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from keras.models import load_model
import os
import stripe
... | [
"keras.models.load_model",
"flask.request.form.values",
"flask.Flask",
"numpy.array",
"flask.render_template"
] | [((610, 625), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (615, 625), False, 'from flask import Flask, session, abort, request, jsonify, render_template, redirect, url_for, flash\n'), ((670, 699), 'flask.render_template', 'render_template', (['"""index.html"""'], {}), "('index.html')\n", (685, 699), Fal... |
from numbers import Real
from typing import Union
from hypothesis import given
from symba.base import Expression
from tests.utils import equivalence
from . import strategies
@given(strategies.expressions, strategies.non_zero_reals_or_expressions)
def test_basic(expression: Expression,
real_or_express... | [
"hypothesis.given"
] | [((179, 250), 'hypothesis.given', 'given', (['strategies.expressions', 'strategies.non_zero_reals_or_expressions'], {}), '(strategies.expressions, strategies.non_zero_reals_or_expressions)\n', (184, 250), False, 'from hypothesis import given\n'), ((450, 495), 'hypothesis.given', 'given', (['strategies.finite_non_zero_e... |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
df = pd.read_csv('/home/jordibisbal/WS18-MSc-JordiBisbalAnsaldo--NetworkSlicing/evaluation/experiments/1/forks/forks_pow.csv')
x = np.arange(0.0, 100, 1)
data = df[['T1', 'T2','T3','T4', 'T5','T6','T7', 'T8','T9','T10', 'T11','T12','T13', 'T14',... | [
"matplotlib.pyplot.show",
"pandas.read_csv",
"numpy.sqrt",
"numpy.arange",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.grid"
] | [((78, 209), 'pandas.read_csv', 'pd.read_csv', (['"""/home/jordibisbal/WS18-MSc-JordiBisbalAnsaldo--NetworkSlicing/evaluation/experiments/1/forks/forks_pow.csv"""'], {}), "(\n '/home/jordibisbal/WS18-MSc-JordiBisbalAnsaldo--NetworkSlicing/evaluation/experiments/1/forks/forks_pow.csv'\n )\n", (89, 209), True, 'imp... |
from typing import List, Tuple
import time
import pandas as pd
from initial_solution import *
from local_search import *
from graph import *
def algorithm(nodes: List[dict], vehicles: int, clients: int, vehicle_capacity: int, tenure: int, file_writer, iter_max:int=1000, savings:bool=True) -> None:
"""
Aplica ... | [
"pandas.DataFrame",
"time.time"
] | [((480, 491), 'time.time', 'time.time', ([], {}), '()\n', (489, 491), False, 'import time\n'), ((2603, 2626), 'pandas.DataFrame', 'pd.DataFrame', (['sol_dists'], {}), '(sol_dists)\n', (2615, 2626), True, 'import pandas as pd\n'), ((2417, 2428), 'time.time', 'time.time', ([], {}), '()\n', (2426, 2428), False, 'import ti... |
import pytz
import logging
from .base_records_test import BaseRecordsIntegrationTest
from ..directory_validator import RecordsDirectoryValidator
from records_mover.records import (
RecordsSchema, DelimitedRecordsFormat, ProcessingInstructions
)
import tempfile
import pathlib
import datetime
logger = logging.getLo... | [
"tempfile.TemporaryDirectory",
"datetime.date",
"datetime.datetime",
"records_mover.records.DelimitedRecordsFormat",
"pathlib.Path",
"pytz.timezone",
"records_mover.records.RecordsSchema.from_dataframe",
"datetime.time",
"records_mover.records.ProcessingInstructions",
"logging.getLogger"
] | [((307, 334), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (324, 334), False, 'import logging\n'), ((795, 822), 'pytz.timezone', 'pytz.timezone', (['"""US/Eastern"""'], {}), "('US/Eastern')\n", (808, 822), False, 'import pytz\n'), ((1508, 1586), 'records_mover.records.RecordsSchema.from... |
import click
import orjson as json
import yaml
from r2k.cli import cli_utils, logger
from r2k.config import config as _config
@click.command("show")
@cli_utils.config_path_option()
@click.option(
"-j",
"--json",
"is_json",
is_flag=True,
help="When passed the output will be in JSON format (e.g. fo... | [
"yaml.safe_dump",
"click.option",
"click.command",
"r2k.config.config.as_dict",
"orjson.dumps",
"r2k.cli.cli_utils.config_path_option"
] | [((130, 151), 'click.command', 'click.command', (['"""show"""'], {}), "('show')\n", (143, 151), False, 'import click\n'), ((153, 183), 'r2k.cli.cli_utils.config_path_option', 'cli_utils.config_path_option', ([], {}), '()\n', (181, 183), False, 'from r2k.cli import cli_utils, logger\n'), ((185, 375), 'click.option', 'cl... |
import os
import subprocess
subprocess.call([
'git'
, 'submodule'
, 'foreach'
, 'git'
, 'checkout'
, 'master'
])
subprocess.call([
'git'
, 'submodule'
, 'foreach'
, 'git'
, 'pull'
, 'origin'
, 'master'
])
| [
"subprocess.call"
] | [((29, 106), 'subprocess.call', 'subprocess.call', (["['git', 'submodule', 'foreach', 'git', 'checkout', 'master']"], {}), "(['git', 'submodule', 'foreach', 'git', 'checkout', 'master'])\n", (44, 106), False, 'import subprocess\n'), ((127, 214), 'subprocess.call', 'subprocess.call', (["['git', 'submodule', 'foreach', '... |
import firebase_admin
from firebase_admin import credentials, firestore
class Database:
def __init__(self):
self._conn = None
def connect(self, creds=None, from_file=None):
if not creds and not from_file:
raise Exception("Credentials or service account json file path required to connect with firestore")
... | [
"firebase_admin.initialize_app",
"firebase_admin.credentials.Certificate",
"firebase_admin.firestore.client"
] | [((718, 736), 'firebase_admin.firestore.client', 'firestore.client', ([], {}), '()\n', (734, 736), False, 'from firebase_admin import credentials, firestore\n'), ((345, 379), 'firebase_admin.credentials.Certificate', 'credentials.Certificate', (['from_file'], {}), '(from_file)\n', (368, 379), False, 'from firebase_admi... |
import pytest
from graphs.graph import Graph, Vertex, Edge
from graph_business_trip.graph_business_trip import business_trip
def test_can_instantiate_Graph():
graph = Graph()
assert graph
assert graph._adjacency_list == {}
def test_can_instantiate_Vertex():
vertex = Vertex()
assert vertex
a... | [
"graphs.graph.Edge",
"graphs.graph.Vertex",
"graphs.graph.Graph",
"graph_business_trip.graph_business_trip.business_trip"
] | [((174, 181), 'graphs.graph.Graph', 'Graph', ([], {}), '()\n', (179, 181), False, 'from graphs.graph import Graph, Vertex, Edge\n'), ((288, 296), 'graphs.graph.Vertex', 'Vertex', ([], {}), '()\n', (294, 296), False, 'from graphs.graph import Graph, Vertex, Edge\n'), ((396, 411), 'graphs.graph.Vertex', 'Vertex', (['"""h... |
import http.server
import socketserver
import threading
ADDR = "192.168.2.1"
PORT = 80
class UDPHandler(socketserver.DatagramRequestHandler):
def handle(self):
data = self.request[0]
socket = self.request[1]
print ('client send: ', data)
socket.sendto(b'Hello from server!', se... | [
"threading.Thread",
"socketserver.TCPServer",
"socketserver.UDPServer"
] | [((346, 420), 'socketserver.TCPServer', 'socketserver.TCPServer', (['(ADDR, PORT)', 'http.server.SimpleHTTPRequestHandler'], {}), '((ADDR, PORT), http.server.SimpleHTTPRequestHandler)\n', (368, 420), False, 'import socketserver\n'), ((502, 545), 'threading.Thread', 'threading.Thread', ([], {'target': 'http.serve_foreve... |
import unittest
import array_problems.Solutions as array_problems
import array_problems.Solutions_Two as array_problems_two
import array_problems.Solutions_Three as array_problems_three
import array_problems.Solutions_Four as array_problems_four
import array_problems.Solutions_Five as array_problems_five
class Soluti... | [
"array_problems.Solutions_Four.validateStackSequences",
"array_problems.Solutions_Four.maxIncreaseKeepingSkyline",
"array_problems.Solutions_Five.intersection",
"array_problems.Solutions_Five.maxSatisfied",
"array_problems.Solutions_Five.permute",
"array_problems.Solutions_Five.findJudge",
"array_proble... | [((28403, 28418), 'unittest.main', 'unittest.main', ([], {}), '()\n', (28416, 28418), False, 'import unittest\n'), ((10741, 10774), 'array_problems.Solutions.MyCircularDeque', 'array_problems.MyCircularDeque', (['(3)'], {}), '(3)\n', (10771, 10774), True, 'import array_problems.Solutions as array_problems\n'), ((13663,... |
import yaml
def yamldump(data):
if isinstance(data, list):
data = [d.to_dict() for d in data]
else:
data = data.to_dict()
print(yaml.dump(data))
| [
"yaml.dump"
] | [((158, 173), 'yaml.dump', 'yaml.dump', (['data'], {}), '(data)\n', (167, 173), False, 'import yaml\n')] |
import argparse
import sys # We need sys so that we can pass argv to QApplication
import os
import warnings
import pandas as pd
import petab.C as ptc
import pyqtgraph as pg
from PySide6 import QtWidgets, QtCore, QtGui
from PySide6.QtWidgets import (
QVBoxLayout, QComboBox, QWidget, QLabel, QTreeView
)
from petab ... | [
"petab.visualize.helper_functions.check_ex_exp_columns",
"pyqtgraph.setConfigOption",
"petab.core.get_simulation_df",
"argparse.ArgumentParser",
"os.path.basename",
"petab.load_yaml",
"PySide6.QtWidgets.QComboBox",
"os.path.dirname",
"PySide6.QtWidgets.QVBoxLayout",
"PySide6.QtWidgets.QWidget",
... | [((14165, 14190), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (14188, 14190), False, 'import argparse\n'), ((14612, 14644), 'PySide6.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (14634, 14644), False, 'from PySide6 import QtWidgets, QtCore, QtGui\n')... |