code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import os
import copy
from parser import Parser
import json
import argparse
from tqdm import tqdm
def get_data_paths(ace2005_path):
test_files, dev_files, train_files = [], [], []
with open('./data_list.csv', mode='r') as csv_file:
rows = csv_file.readlines()
for row in rows[1:]:
... | [
"argparse.ArgumentParser",
"tqdm.tqdm",
"os.path.join",
"parser.Parser",
"copy.deepcopy",
"json.dump"
] | [((1837, 1848), 'tqdm.tqdm', 'tqdm', (['files'], {}), '(files)\n', (1841, 1848), False, 'from tqdm import tqdm\n'), ((4968, 4993), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (4991, 4993), False, 'import argparse\n'), ((1867, 1884), 'parser.Parser', 'Parser', ([], {'path': 'file'}), '(path=f... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 6 21:00:25 2018
@author: Vishwesh
"""
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
DATA_DIR = "/tmp/data"
NUM_STEPS=1000
MINIBATCH_SIZE=32
data = input_data.read_data_sets(DATA_DIR,one_hot=True)
x = tf.placeholder... | [
"tensorflow.placeholder",
"tensorflow.Session",
"tensorflow.train.GradientDescentOptimizer",
"tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"tensorflow.argmax",
"tensorflow.global_variables_initializer",
"tensorflow.matmul",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tenso... | [((250, 299), 'tensorflow.examples.tutorials.mnist.input_data.read_data_sets', 'input_data.read_data_sets', (['DATA_DIR'], {'one_hot': '(True)'}), '(DATA_DIR, one_hot=True)\n', (275, 299), False, 'from tensorflow.examples.tutorials.mnist import input_data\n'), ((306, 345), 'tensorflow.placeholder', 'tf.placeholder', ([... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-28 09:09
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('planner', '0019_auto_20171028... | [
"django.db.models.OneToOneField",
"django.db.migrations.DeleteModel",
"django.db.models.TextField",
"django.db.migrations.RenameModel",
"django.db.models.AutoField",
"django.db.migrations.RemoveField",
"django.db.models.CharField"
] | [((2682, 2753), 'django.db.migrations.RenameModel', 'migrations.RenameModel', ([], {'old_name': '"""OperationLogs"""', 'new_name': '"""ChangeList"""'}), "(old_name='OperationLogs', new_name='ChangeList')\n", (2704, 2753), False, 'from django.db import migrations, models\n'), ((2798, 2862), 'django.db.migrations.RemoveF... |
from __future__ import annotations
from conflowgen.posthoc_analyses.inbound_and_outbound_vehicle_capacity_analysis import \
InboundAndOutboundVehicleCapacityAnalysis
from conflowgen.reporting import AbstractReportWithMatplotlib
class InboundAndOutboundVehicleCapacityAnalysisReport(AbstractReportWithMatplotlib):
... | [
"pandas.DataFrame",
"conflowgen.posthoc_analyses.inbound_and_outbound_vehicle_capacity_analysis.InboundAndOutboundVehicleCapacityAnalysis",
"seaborn.color_palette"
] | [((1102, 1198), 'conflowgen.posthoc_analyses.inbound_and_outbound_vehicle_capacity_analysis.InboundAndOutboundVehicleCapacityAnalysis', 'InboundAndOutboundVehicleCapacityAnalysis', ([], {'transportation_buffer': 'self.transportation_buffer'}), '(transportation_buffer=self.\n transportation_buffer)\n', (1143, 1198), ... |
"""Transformer from 'Attention is all you need' (Vaswani et al., 2017)"""
# Reference: https://www.tensorflow.org/text/tutorials/transformer
# Reference: https://keras.io/examples/nlp/text_classification_with_transformer/
import numpy as np
import tensorflow as tf
class Transformer(tf.keras.Model):
def __init__(... | [
"tensorflow.shape",
"tensorflow.transpose",
"tensorflow.keras.layers.Dense",
"tensorflow.nn.softmax",
"numpy.sin",
"tensorflow.cast",
"numpy.arange",
"tensorflow.math.minimum",
"tensorflow.math.sqrt",
"tensorflow.matmul",
"tensorflow.math.equal",
"tensorflow.maximum",
"tensorflow.keras.layer... | [((11454, 11481), 'numpy.sin', 'np.sin', (['angle_rads[:, 0::2]'], {}), '(angle_rads[:, 0::2])\n', (11460, 11481), True, 'import numpy as np\n'), ((11558, 11585), 'numpy.cos', 'np.cos', (['angle_rads[:, 1::2]'], {}), '(angle_rads[:, 1::2])\n', (11564, 11585), True, 'import numpy as np\n'), ((11645, 11684), 'tensorflow.... |
from oil.utils.utils import export
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.animation as animation
import numpy as np
@export
class Animation(object):
def __init__(self, qt,body=None):
""" [qt (T,n,d)"""
self.qt = qt.data.numpy()
T... | [
"matplotlib.animation.FuncAnimation",
"matplotlib.pyplot.figure"
] | [((420, 432), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (430, 432), True, 'import matplotlib.pyplot as plt\n'), ((2511, 2631), 'matplotlib.animation.FuncAnimation', 'animation.FuncAnimation', (['self.fig', 'self.update'], {'frames': 'self.qt.shape[0]', 'interval': '(33)', 'init_func': 'self.init', 'bl... |
from functools import wraps
from opentracing import global_tracer, tags, logs
from contextlib import contextmanager
def operation_name(query: str):
# TODO: some statement should contain two words. For example CREATE TABLE.
query = query.strip().split(' ')[0].strip(';').upper()
return 'asyncpg ' + query
... | [
"opentracing.global_tracer",
"functools.wraps"
] | [((1115, 1126), 'functools.wraps', 'wraps', (['coro'], {}), '(coro)\n', (1120, 1126), False, 'from functools import wraps\n'), ((1340, 1351), 'functools.wraps', 'wraps', (['coro'], {}), '(coro)\n', (1345, 1351), False, 'from functools import wraps\n'), ((677, 692), 'opentracing.global_tracer', 'global_tracer', ([], {})... |
from collections import OrderedDict
from evidence import Evidence
def get_name(item, entity='all'):
from ._add_reference_to_evidence import _add_reference_to_evidence
evidence = Evidence()
fullName = item['uniprot']['entry']['protein']['recommendedName']['fullName']
if type(fullName)==str:
... | [
"evidence.Evidence"
] | [((189, 199), 'evidence.Evidence', 'Evidence', ([], {}), '()\n', (197, 199), False, 'from evidence import Evidence\n')] |
#!/usr/bin/env python3
from dataknead import Knead
from facetool import config, media, util
from facetool.constants import *
from facetool.path import Path
from facetool.profiler import Profiler
from facetool.errors import ArgumentError
from facetool.util import message, force_mkdir, sample_remove, is_json_path
from r... | [
"logging.getLogger",
"facetool.media.probe",
"facetool.media.combineaudio",
"logging.debug",
"facetool.util.mkdir_if_not_exists",
"facetool.averager.Averager",
"facetool.media.combineframes",
"facetool.detect.Detect",
"facetool.path.Path",
"facetool.util.sample_remove",
"facetool.poser.Poser",
... | [((861, 888), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (878, 888), False, 'import logging\n'), ((994, 1017), 'facetool.profiler.Profiler', 'Profiler', (['"""facetool.py"""'], {}), "('facetool.py')\n", (1002, 1017), False, 'from facetool.profiler import Profiler\n'), ((1050, 1126), '... |
from torchvision.datasets import VisionDataset
from datamodules.dsfunction import imread
from torch.utils.data import Dataset, RandomSampler, Sampler, DataLoader, TensorDataset, random_split, ConcatDataset
import os
import glob
from typing import List, Sequence, Tuple
from itertools import cycle, islice
import torch
fr... | [
"itertools.cycle",
"os.listdir",
"math.ceil",
"torch.randperm",
"os.path.join",
"torch.randint"
] | [((1178, 1194), 'os.listdir', 'os.listdir', (['root'], {}), '(root)\n', (1188, 1194), False, 'import os\n'), ((613, 640), 'os.path.join', 'os.path.join', (['root', 'pattern'], {}), '(root, pattern)\n', (625, 640), False, 'import os\n'), ((5843, 5862), 'math.ceil', 'ceil', (['(w / minweight)'], {}), '(w / minweight)\n',... |
"""
Script for analyzing model's performance
"""
import argparse
import sys
import collections
import yaml
import tensorflow as tf
import tqdm
import numpy as np
import net.data
import net.ml
import net.utilities
def report_iou_results(categories_intersections_counts_map, categories_unions_counts_map):
"""
... | [
"numpy.mean",
"argparse.ArgumentParser",
"numpy.logical_and",
"tensorflow.keras.backend.get_session",
"numpy.logical_or",
"yaml.safe_load",
"numpy.sum",
"collections.defaultdict"
] | [((3250, 3279), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (3273, 3279), False, 'import collections\n'), ((3315, 3344), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (3338, 3344), False, 'import collections\n'), ((4322, 4347), 'argparse.Argument... |
# --- Day 12: Rain Risk ---
# https://adventofcode.com/2020/day/12
import time
simple = False
verbose = 1
if simple:
data = 'F10\nN3\nF7\nR90\nF11'.splitlines()
else:
file = open('12_input.txt', 'r')
data = file.read().splitlines()
class Ship(object):
def __init__(self, d=0, x=0, y=0,... | [
"time.time"
] | [((4279, 4290), 'time.time', 'time.time', ([], {}), '()\n', (4288, 4290), False, 'import time\n'), ((4595, 4606), 'time.time', 'time.time', ([], {}), '()\n', (4604, 4606), False, 'import time\n'), ((4980, 4991), 'time.time', 'time.time', ([], {}), '()\n', (4989, 4991), False, 'import time\n')] |
from collections import OrderedDict
from .abstract_model_helper import ModelHelper
from tflite.Tensor import Tensor
from tflite.Model import Model
from tflite.TensorType import TensorType
from typing import List
class TFLiteModelHelper(ModelHelper):
TFLITE_TENSOR_TYPE_TO_DTYPE = {}
TFLITE_TENSOR_TYPE_TO_DTYPE[... | [
"collections.OrderedDict"
] | [((2415, 2428), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (2426, 2428), False, 'from collections import OrderedDict\n'), ((3214, 3227), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (3225, 3227), False, 'from collections import OrderedDict\n')] |
from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"label": _("WMS"),
"icon": "octicon octicon-briefcase",
"items": [
{
"type": "doctype",
"name": "WMS Lead",
... | [
"frappe._"
] | [((128, 136), 'frappe._', '_', (['"""WMS"""'], {}), "('WMS')\n", (129, 136), False, 'from frappe import _\n'), ((1621, 1633), 'frappe._', '_', (['"""Reports"""'], {}), "('Reports')\n", (1622, 1633), False, 'from frappe import _\n'), ((342, 355), 'frappe._', '_', (['"""WMS Lead"""'], {}), "('WMS Lead')\n", (343, 355), F... |
import datetime
from pychpp import ht_model
from pychpp import ht_xml
from pychpp import ht_team, ht_match, ht_datetime
class HTMatchesArchive(ht_model.HTModel):
"""
Hattrick matches archive
"""
_SOURCE_FILE = "matchesarchive"
_SOURCE_FILE_VERSION = "1.4"
# URL PATH with several params avai... | [
"pychpp.ht_team.HTTeam",
"pychpp.ht_match.HTMatch",
"pychpp.ht_xml.HTXml.ht_datetime_to_text"
] | [((6074, 6125), 'pychpp.ht_match.HTMatch', 'ht_match.HTMatch', ([], {'chpp': 'self._chpp', 'ht_id': 'self.ht_id'}), '(chpp=self._chpp, ht_id=self.ht_id)\n', (6090, 6125), False, 'from pychpp import ht_team, ht_match, ht_datetime\n'), ((6181, 6237), 'pychpp.ht_team.HTTeam', 'ht_team.HTTeam', ([], {'chpp': 'self._chpp', ... |
"""
langcodes knows what languages are. It knows the standardized codes that
refer to them, such as `en` for English, `es` for Spanish and `hi` for Hindi.
Often, it knows what these languages are called *in* a language, and that
language doesn't have to be English.
See README.md for the main documentation, or read it ... | [
"langcodes.names.name_to_code",
"langcodes.data_dicts.DEFAULT_SCRIPTS.get",
"langcodes.distance.raw_distance",
"langcodes.tag_parser.parse_tag",
"langcodes.names.code_to_names"
] | [((9235, 9249), 'langcodes.tag_parser.parse_tag', 'parse_tag', (['tag'], {}), '(tag)\n', (9244, 9249), False, 'from langcodes.tag_parser import parse_tag\n'), ((22078, 22114), 'langcodes.names.code_to_names', 'code_to_names', (['attribute', 'attr_value'], {}), '(attribute, attr_value)\n', (22091, 22114), False, 'from l... |
import torch
from torch.utils.data import Dataset
import os
import pickle
class GNNdataset(Dataset): # train and test
def __init__(self, data_dir):
super().__init__()
self.data_dir = data_dir
self.file_list = os.listdir(self.data_dir)
def __len__(self):
return len(self.... | [
"os.path.join",
"os.listdir",
"pickle.load"
] | [((238, 263), 'os.listdir', 'os.listdir', (['self.data_dir'], {}), '(self.data_dir)\n', (248, 263), False, 'import os\n'), ((505, 519), 'pickle.load', 'pickle.load', (['f'], {}), '(f)\n', (516, 519), False, 'import pickle\n'), ((429, 469), 'os.path.join', 'os.path.join', (['self.data_dir', 'single_file'], {}), '(self.d... |
import asyncio
import base64
import os
from telethon import functions, types
from telethon.tl.functions.messages import ImportChatInviteRequest as Get
from userbot import CMD_HELP
from userbot.plugins import BOTLOG, BOTLOG_CHATID
from userbot.utils import lightning_cmd, edit_or_reply, sudo_cmd
@bot.on(lightning_cmd... | [
"os.path.exists",
"telethon.tl.functions.messages.ImportChatInviteRequest",
"userbot.utils.edit_or_reply",
"os.makedirs",
"os.path.join",
"base64.b64decode",
"telethon.types.InputDocument",
"os.path.isdir",
"asyncio.sleep",
"userbot.utils.sudo_cmd",
"userbot.CMD_HELP.update",
"userbot.utils.li... | [((17757, 18488), 'userbot.CMD_HELP.update', 'CMD_HELP.update', (['{\'spam\':\n """**Plugin : **`spam` \n\n**Syntax : **`.spam <count> <text>` \n**Function : **__ Floods text in the chat !!__ \n\n**Syntax : **`.spam <count> reply to media` \n**Function : **__Sends the replied media <count... |
from random import choice
from string import Template
from . import BaseGenerator
class Name(BaseGenerator):
def __init__(self, company):
self.company = company
self.data = self._load_json('name.json')
self.templates = self.data.pop('templates')
self.noun... | [
"random.choice"
] | [((1376, 1428), 'random.choice', 'choice', (['[self.company.city, self.company.state_name]'], {}), '([self.company.city, self.company.state_name])\n', (1382, 1428), False, 'from random import choice\n'), ((767, 785), 'random.choice', 'choice', (['self.nouns'], {}), '(self.nouns)\n', (773, 785), False, 'from random impo... |
#!/usr/bin/env python3
import os.path
import subprocess
import shutil
def get_compiler_path():
compiler_path = os.path.abspath("../../debug-compiler-theory-samples/llvm_4")
if not os.path.exists(compiler_path):
raise ValueError('compiler llvm_4 not found')
return compiler_path
class Runner:
d... | [
"subprocess.check_call"
] | [((603, 664), 'subprocess.check_call', 'subprocess.check_call', (['[self.compiler_path]'], {'stdin': 'input_file'}), '([self.compiler_path], stdin=input_file)\n', (624, 664), False, 'import subprocess\n')] |
from dateutil.relativedelta import relativedelta
from django.core.management.base import BaseCommand
from django.utils import timezone
from cropwatch.apps.ioTank.models import ioTank, SensorReading
from cropwatch.apps.metrics.tasks import *
class Command(BaseCommand):
help = 'Performs uptime validation every 5'
... | [
"django.utils.timezone.now",
"cropwatch.apps.ioTank.models.ioTank.objects.filter",
"dateutil.relativedelta.relativedelta",
"cropwatch.apps.ioTank.models.SensorReading.objects.filter"
] | [((537, 578), 'cropwatch.apps.ioTank.models.ioTank.objects.filter', 'ioTank.objects.filter', ([], {'owner': 'account.user'}), '(owner=account.user)\n', (558, 578), False, 'from cropwatch.apps.ioTank.models import ioTank, SensorReading\n'), ((771, 785), 'django.utils.timezone.now', 'timezone.now', ([], {}), '()\n', (783... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Asynchronous task support for discovery."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from datetime import datetime, timedelta
from functools import partial
impo... | [
"traceback.format_exc",
"textwrap.dedent",
"random.randint",
"ralph.discovery.models.Network.objects.exclude",
"re.compile",
"ralph.discovery.models.Network.objects.get",
"ralph.util.plugin.highest_priority",
"ralph.util.network.ping",
"ralph.discovery.models.Network.from_ip",
"functools.partial",... | [((681, 730), 're.compile', 're.compile', (['"""(?P<attribute>[^:]+): (?P<value>.*)"""'], {}), "('(?P<attribute>[^:]+): (?P<value>.*)')\n", (691, 730), False, 'import re\n'), ((2347, 2370), 'ralph.util.output.get', 'output.get', (['interactive'], {}), '(interactive)\n', (2357, 2370), False, 'from ralph.util import outp... |
'''
Module containing a preprocessor that keeps cells if they match given
expression.
'''
# Author: <NAME> <<EMAIL>>
import re
from typing import Pattern
from traitlets import Unicode
from nbconvert.preprocessors import Preprocessor
class HomeworkPreproccessor(Preprocessor):
'''Keeps cells form a notebook that ... | [
"traitlets.Unicode",
"re.compile"
] | [((598, 622), 're.compile', 're.compile', (['self.pattern'], {}), '(self.pattern)\n', (608, 622), False, 'import re\n'), ((364, 373), 'traitlets.Unicode', 'Unicode', ([], {}), '()\n', (371, 373), False, 'from traitlets import Unicode\n')] |
#!/usr/bin/env python3
import socket
import threading
import logging
logging.basicConfig(filename='meca.log', level=logging.DEBUG)
PROGRAM_FILE = 'program_output.txt'
# Dictionary of status indexes in robot status message
statusDict = {'activated': 0,
'homed': 1,
'simulating': 2,
'... | [
"logging.basicConfig",
"logging.warning",
"logging.info",
"socket.socket"
] | [((69, 130), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename': '"""meca.log"""', 'level': 'logging.DEBUG'}), "(filename='meca.log', level=logging.DEBUG)\n", (88, 130), False, 'import logging\n'), ((1719, 1768), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_I... |
import os
import numpy as np
import tensorflow as tf
from PIL import Image
def modcrop(im, modulo):
if len(im.shape) == 3:
size = np.array(im.shape)
size = size - (size % modulo)
im = im[0 : size[0], 0 : size[1], :]
elif len(im.shape) == 2:
size = np.array(im.shape)
size = size - (size % modulo)
im = im... | [
"numpy.log10",
"numpy.asfarray",
"numpy.array",
"numpy.arange",
"numpy.mean",
"os.listdir",
"tensorflow.placeholder",
"tensorflow.Session",
"numpy.asarray",
"tensorflow.GraphDef",
"tensorflow.ConfigProto",
"numpy.maximum",
"tensorflow.device",
"numpy.squeeze",
"tensorflow.import_graph_de... | [((971, 989), 'os.listdir', 'os.listdir', (['folder'], {}), '(folder)\n', (981, 989), False, 'import os\n'), ((1021, 1081), 'tensorflow.placeholder', 'tf.placeholder', (['"""float"""', '[1, None, None, 3]'], {'name': '"""im_input"""'}), "('float', [1, None, None, 3], name='im_input')\n", (1035, 1081), True, 'import ten... |
import sh
from dotenv import load_dotenv
import os
load_dotenv()
PASSWORD = os.environ.get("sudo_password")
def c_registry():
with sh.contrib.sudo(password=PASSWORD, _with=True):
sh.docker('run', '-d', '-p', '5000:5000', '--restart=always', '--name', 'registry', 'registry:2')
| [
"sh.contrib.sudo",
"os.environ.get",
"sh.docker",
"dotenv.load_dotenv"
] | [((53, 66), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (64, 66), False, 'from dotenv import load_dotenv\n'), ((78, 109), 'os.environ.get', 'os.environ.get', (['"""sudo_password"""'], {}), "('sudo_password')\n", (92, 109), False, 'import os\n'), ((140, 186), 'sh.contrib.sudo', 'sh.contrib.sudo', ([], {'passw... |
# Generated by Django 3.1.2 on 2020-10-29 04:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('recipes', '0001_initial'),
('ingredients', '0001_initial'),
('drinks', '0001_initial'),
]
operations = [
migrations.AddField... | [
"django.db.models.ManyToManyField"
] | [((404, 481), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'through': '"""recipes.Recipe"""', 'to': '"""ingredients.Ingredient"""'}), "(through='recipes.Recipe', to='ingredients.Ingredient')\n", (426, 481), False, 'from django.db import migrations, models\n')] |
# Copyright 2017 Battelle Energy Alliance, LLC
#
# 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 t... | [
"sklearn.__version__.split"
] | [((1942, 1972), 'sklearn.__version__.split', 'sklearn.__version__.split', (['"""."""'], {}), "('.')\n", (1967, 1972), False, 'import sklearn\n')] |
import tkinter as tk
from abc import ABCMeta, abstractmethod
from ...frames.templates import FrameTemplate
from ...elements import AddButton, EditButton, DeleteButton
class ListFrameTemplate(FrameTemplate, metaclass=ABCMeta):
def __init__(self, top, *args, **kw):
super().__init__(top, *args, **kw)
... | [
"tkinter.Frame",
"tkinter.Label"
] | [((612, 625), 'tkinter.Frame', 'tk.Frame', (['top'], {}), '(top)\n', (620, 625), True, 'import tkinter as tk\n'), ((1002, 1015), 'tkinter.Frame', 'tk.Frame', (['top'], {}), '(top)\n', (1010, 1015), True, 'import tkinter as tk\n'), ((1036, 1055), 'tkinter.Frame', 'tk.Frame', (['container'], {}), '(container)\n', (1044, ... |
"""Django command for rebuilding cohort statistics after import."""
import aldjemy
from django.contrib.auth import get_user_model
from django.core.exceptions import ObjectDoesNotExist
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
from django.conf import settings
f... | [
"projectroles.plugins.get_backend_api",
"django.contrib.auth.get_user_model",
"projectroles.models.Project.objects.get",
"variants.variant_stats.rebuild_project_variant_stats"
] | [((532, 567), 'projectroles.plugins.get_backend_api', 'get_backend_api', (['"""timeline_backend"""'], {}), "('timeline_backend')\n", (547, 567), False, 'from projectroles.plugins import get_backend_api\n'), ((603, 619), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (617, 619), False, 'from d... |
import torch
from torch import Tensor
import torch.nn as nn
import torch.nn.functional as F
from .. import BaseModel, register_model
from .knowledge_base import KGEModel
@register_model("rotate")
class RotatE(KGEModel):
r"""
Implementation of RotatE model from the paper `"RotatE: Knowledge Graph Embedding by... | [
"torch.cos",
"torch.chunk",
"torch.sin",
"torch.stack"
] | [((889, 916), 'torch.chunk', 'torch.chunk', (['head', '(2)'], {'dim': '(2)'}), '(head, 2, dim=2)\n', (900, 916), False, 'import torch\n'), ((944, 971), 'torch.chunk', 'torch.chunk', (['tail', '(2)'], {'dim': '(2)'}), '(tail, 2, dim=2)\n', (955, 971), False, 'import torch\n'), ((1138, 1163), 'torch.cos', 'torch.cos', ([... |
import os
from os import mkdir
from os.path import join
from os.path import exists
import json
import importlib.resources
import jinja2
from jinja2 import Environment
from jinja2 import BaseLoader
with importlib.resources.path('mititools', 'fd_schema.json.jinja') as file:
jinja_environment = Environment(loader=Ba... | [
"os.path.exists",
"json.loads",
"jinja2.Environment",
"json.dumps",
"os.path.join",
"os.mkdir"
] | [((299, 329), 'jinja2.Environment', 'Environment', ([], {'loader': 'BaseLoader'}), '(loader=BaseLoader)\n', (310, 329), False, 'from jinja2 import Environment\n'), ((675, 695), 'json.loads', 'json.loads', (['json_str'], {}), '(json_str)\n', (685, 695), False, 'import json\n'), ((710, 743), 'json.dumps', 'json.dumps', (... |
# Copyright 2018 <NAME> and Cable Television
# Laboratories, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | [
"snaps_k8s.common.utils.config_utils.get_minion_node_ips",
"snaps_k8s.common.utils.config_utils.get_hosts",
"snaps_k8s.common.utils.config_utils.get_project_name",
"snaps_k8s.common.utils.config_utils.get_ceph_osds_info",
"snaps_k8s.common.utils.config_utils.is_cpu_alloc",
"snaps_k8s.common.utils.config_u... | [((947, 1011), 'pkg_resources.resource_filename', 'pkg_resources.resource_filename', (['"""tests.conf"""', '"""deployment.yaml"""'], {}), "('tests.conf', 'deployment.yaml')\n", (978, 1011), False, 'import pkg_resources\n'), ((1047, 1080), 'snaps_common.file.file_utils.read_yaml', 'file_utils.read_yaml', (['config_file'... |
from pathlib import Path
from typing import List
from src.user_errors import NoItemToRenameError
from src.user_types import Inode, InodesPaths
def paths_to_inodes_paths(paths: List[Path]) -> InodesPaths:
"""
Given a list of paths, return a mapping from inodes to paths.
Args:
paths: list of Path ... | [
"src.user_errors.NoItemToRenameError"
] | [((925, 979), 'src.user_errors.NoItemToRenameError', 'NoItemToRenameError', (['"""No item to rename was provided."""'], {}), "('No item to rename was provided.')\n", (944, 979), False, 'from src.user_errors import NoItemToRenameError\n')] |
import re
import gensim.utils as gensim_utils
def normalize_text_proximity(message):
""" Clean text of dots between words
Keyword arguments:
message -- a plain sentence or paragraph
"""
sent = message.lower()
sent = sent.replace("á", "a")
sent = sent.replace("é", "e")
sent = sen... | [
"gensim.utils.to_unicode",
"re.sub"
] | [((419, 465), 're.sub', 're.sub', (['"""(?i)(?<=[a-z])\\\\.(?=[a-z])"""', '""""""', 'sent'], {}), "('(?i)(?<=[a-z])\\\\.(?=[a-z])', '', sent)\n", (425, 465), False, 'import re\n'), ((664, 708), 're.sub', 're.sub', (['"""[\\\\-_*+,\\\\(\\\\).:]{1,}"""', '""""""', 'message'], {}), "('[\\\\-_*+,\\\\(\\\\).:]{1,}', '', mes... |
import angr
from angr.sim_type import SimTypeInt
import logging
l = logging.getLogger("angr.procedures.libc.tolower")
class tolower(angr.SimProcedure):
def run(self, c):
self.argument_types = {0: SimTypeInt(self.state.arch, True)}
self.return_type = SimTypeInt(self.state.arch, True)
retu... | [
"logging.getLogger",
"angr.sim_type.SimTypeInt"
] | [((69, 118), 'logging.getLogger', 'logging.getLogger', (['"""angr.procedures.libc.tolower"""'], {}), "('angr.procedures.libc.tolower')\n", (86, 118), False, 'import logging\n'), ((273, 306), 'angr.sim_type.SimTypeInt', 'SimTypeInt', (['self.state.arch', '(True)'], {}), '(self.state.arch, True)\n', (283, 306), False, 'f... |
import data_mine as dm
from data_mine.nlp.cosmos_qa import CosmosQAType
def main():
df = dm.COSMOS_QA(CosmosQAType.TRAIN)
print(df)
print("\n")
df = df.sample(n=1)
row = next(df.iterrows())[1]
print("Question: ", row.question, "\n")
print("Context: ", row.context, "\n")
for i, answer... | [
"data_mine.COSMOS_QA"
] | [((96, 128), 'data_mine.COSMOS_QA', 'dm.COSMOS_QA', (['CosmosQAType.TRAIN'], {}), '(CosmosQAType.TRAIN)\n', (108, 128), True, 'import data_mine as dm\n')] |
# used for connecting to the trusted capsule server
import socket
TCP_IP = '127.0.0.1'
TCP_PORT = 4000
BUFFER_SIZE = 1024
MESSAGE = "Hello, World!"
def connect(ip: str, port: int, request: bytes):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((ip, port))
s.send(request)
print("sent"... | [
"socket.socket"
] | [((208, 257), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (221, 257), False, 'import socket\n')] |
from randonet.generator.param import Param, IntParam, FloatParam, BinaryParam, ChoiceParam, TupleParam
from randonet.generator.unit import Unit, Factory as _Factory
from randonet.generator.conv import ConvFactory, ConvTransposeFactory
from collections import namedtuple
class TransformerEncoder(_Factory):
def __i... | [
"collections.namedtuple",
"randonet.generator.param.FloatParam",
"randonet.generator.param.ChoiceParam",
"randonet.generator.param.Param",
"randonet.generator.param.IntParam",
"randonet.generator.unit.Factory.__init__"
] | [((351, 374), 'randonet.generator.unit.Factory.__init__', '_Factory.__init__', (['self'], {}), '(self)\n', (368, 374), True, 'from randonet.generator.unit import Unit, Factory as _Factory\n'), ((402, 475), 'collections.namedtuple', 'namedtuple', (['"""TransformerEncoder"""', "['encoder_layer', 'num_layers', 'norm']"], ... |
from rest_framework import serializers
from . import models
class ShelterSerializer(serializers.ModelSerializer):
class Meta:
model = models.Shelter
fields = ('name',
'location')
class DogSerializer(serializers.ModelSerializer):
class Meta:
model = models.Dog
... | [
"rest_framework.serializers.CharField"
] | [((505, 542), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {'max_length': '(200)'}), '(max_length=200)\n', (526, 542), False, 'from rest_framework import serializers\n')] |
import struct
_SetSeparator=b"_~|IMMU|~_"
def wrap_zindex_ref(key: bytes, index) -> bytes:
fmt=">{}sQB".format(len(key))
if index!=None and index.index!=None:
ret=struct.pack(fmt,key,index.index,1)
else:
ret=struct.pack(fmt,key,0,0)
return ret
def unwrap_zindex_ref(value:bytes):
l=len(value)
fmt=">{}sQB".f... | [
"struct.unpack",
"struct.pack"
] | [((353, 378), 'struct.unpack', 'struct.unpack', (['fmt', 'value'], {}), '(fmt, value)\n', (366, 378), False, 'import struct\n'), ((662, 682), 'struct.pack', 'struct.pack', (['""">d"""', 'f'], {}), "('>d', f)\n", (673, 682), False, 'import struct\n'), ((169, 206), 'struct.pack', 'struct.pack', (['fmt', 'key', 'index.ind... |
"""Testing the Flask application factory"""
import os
import tempfile
import textwrap
from interpersonal import create_app
def test_config():
"""Test the application configuration
Make sure it works in testing mode and in normal mode.
"""
db_fd, db_path = tempfile.mkstemp()
conf_fd, conf_path =... | [
"textwrap.dedent",
"interpersonal.create_app",
"os.close",
"tempfile.mkdtemp",
"os.unlink",
"tempfile.mkstemp"
] | [((277, 295), 'tempfile.mkstemp', 'tempfile.mkstemp', ([], {}), '()\n', (293, 295), False, 'import tempfile\n'), ((321, 339), 'tempfile.mkstemp', 'tempfile.mkstemp', ([], {}), '()\n', (337, 339), False, 'import tempfile\n'), ((365, 383), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (381, 383), False, 'impo... |
import sql as sql
import streamlit as st
from streamlit_folium import folium_static
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import json
import sys
import folium
import requests
from bs4 import BeautifulSoup
import csv
from tqdm import tqdm
import webbrowser
import os.path as osp
import... | [
"pandas.read_csv",
"zipfile.ZipFile",
"streamlit.echo",
"matplotlib.pyplot.ylabel",
"streamlit.button",
"numpy.array",
"streamlit.title",
"matplotlib.pyplot.xlabel",
"folium.Map",
"folium.plugins.MarkerCluster",
"csv.reader",
"streamlit.write",
"requests.get",
"seaborn.lineplot",
"stream... | [((438, 468), 'streamlit.echo', 'st.echo', ([], {'code_location': '"""below"""'}), "(code_location='below')\n", (445, 468), True, 'import streamlit as st\n'), ((503, 563), 'zipfile.ZipFile', 'zipfile.ZipFile', (['"""2019-20-fullyr-data_sa_crime.csv.zip"""', '"""r"""'], {}), "('2019-20-fullyr-data_sa_crime.csv.zip', 'r'... |
# Generated by Django 2.2.12 on 2020-07-18 07:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('movie', '0002_auto_20200717_1039'),
]
operations = [
migrations.RemoveField(
model_name='show',
name='plot',
... | [
"django.db.migrations.RemoveField",
"django.db.models.TextField",
"django.db.models.IntegerField"
] | [((234, 288), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""show"""', 'name': '"""plot"""'}), "(model_name='show', name='plot')\n", (256, 288), False, 'from django.db import migrations, models\n'), ((430, 458), 'django.db.models.TextField', 'models.TextField', ([], {'default': '"... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 18-10-28 上午11:51
# @Author : Vitan
# @File : mao.py
import requests
import re
import json
from multiprocessing import Pool
from requests.exceptions import RequestException
def get_one_page(url):
headers = {'user-agent': 'Mozilla/5.0 (X11;... | [
"re.compile",
"json.dumps",
"requests.get",
"multiprocessing.Pool",
"re.findall"
] | [((690, 880), 're.compile', 're.compile', (['(\'<dd>.*?board-index.*?>(\\\\d+)</i>\' +\n \'.*?<p.*?title="(.*?)".*?</p>.*?star">(.*?)</p>\' +\n \'.*?releasetime">(.*?)</p>.*?integer">(.*?)\' + \'<.*?fraction">(.*?)</i>\')', 're.S'], {}), '(\'<dd>.*?board-index.*?>(\\\\d+)</i>\' +\n \'.*?<p.*?title="(.*?)".*?</... |
from distutils.core import setup
setup(
name='shortest-python',
packages=['shortest'],
version='0.1',
description='Python library for shorte.st url shortener',
long_description="More on github: https://github.com/CubexX/shortest-python",
author='CubexX',
author_email='<EMAIL>',
url='htt... | [
"distutils.core.setup"
] | [((34, 422), 'distutils.core.setup', 'setup', ([], {'name': '"""shortest-python"""', 'packages': "['shortest']", 'version': '"""0.1"""', 'description': '"""Python library for shorte.st url shortener"""', 'long_description': '"""More on github: https://github.com/CubexX/shortest-python"""', 'author': '"""CubexX"""', 'au... |
"""
Implementation of vegas+ algorithm:
adaptive importance sampling + adaptive stratified sampling
from https://arxiv.org/abs/2009.05112
The main interface is the `VegasFlowPlus` class.
"""
from itertools import product
import numpy as np
import tensorflow as tf
from vegasflow.configflow import (
... | [
"logging.getLogger",
"tensorflow.math.pow",
"tensorflow.shape",
"tensorflow.transpose",
"tensorflow.reduce_sum",
"vegasflow.monte_carlo.sampler",
"tensorflow.pow",
"tensorflow.maximum",
"tensorflow.square",
"tensorflow.convert_to_tensor",
"vegasflow.vflow.importance_sampling_digest",
"tensorfl... | [((651, 678), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (668, 678), False, 'import logging\n'), ((688, 706), 'vegasflow.configflow.float_me', 'float_me', (['BINS_MAX'], {}), '(BINS_MAX)\n', (696, 706), False, 'from vegasflow.configflow import DTYPE, DTYPEINT, fone, fzero, float_me, i... |
#!/usr/bin/env python
'''
Copyright (c) 2020 RIKEN
All Rights Reserved
See file LICENSE for details.
'''
import os,sys,datetime,multiprocessing
from os.path import abspath,dirname,realpath,join
import log,traceback
# http://stackoverflow.com/questions/377017/test-if-executable-exists-in-python
def which(program):
... | [
"os.path.exists",
"traceback.format_exc",
"log.logger.debug",
"os.access",
"os.path.join",
"os.path.split",
"os.path.isfile",
"log.logger.error"
] | [((428, 450), 'os.path.split', 'os.path.split', (['program'], {}), '(program)\n', (441, 450), False, 'import os, sys, datetime, multiprocessing\n'), ((804, 831), 'log.logger.debug', 'log.logger.debug', (['"""started"""'], {}), "('started')\n", (820, 831), False, 'import log, traceback\n'), ((357, 378), 'os.path.isfile'... |
from pydantic_avro.avro_to_pydantic import avsc_to_pydantic
def test_avsc_to_pydantic_empty():
pydantic_code = avsc_to_pydantic({"name": "Test", "type": "record", "fields": []})
assert "class Test(BaseModel):\n pass" in pydantic_code
def test_avsc_to_pydantic_primitive():
pydantic_code = avsc_to_pyda... | [
"pydantic_avro.avro_to_pydantic.avsc_to_pydantic"
] | [((117, 183), 'pydantic_avro.avro_to_pydantic.avsc_to_pydantic', 'avsc_to_pydantic', (["{'name': 'Test', 'type': 'record', 'fields': []}"], {}), "({'name': 'Test', 'type': 'record', 'fields': []})\n", (133, 183), False, 'from pydantic_avro.avro_to_pydantic import avsc_to_pydantic\n'), ((308, 595), 'pydantic_avro.avro_t... |
from django.test import TestCase
from dojo.models import Test
from dojo.tools.cloudsploit.parser import CloudsploitParser
class TestCloudsploitParser(TestCase):
def test_cloudsploit_parser_with_no_vuln_has_no_findings(self):
testfile = open("dojo/unittests/scans/cloudsploit/cloudsploit_zero_vul.json")
... | [
"dojo.tools.cloudsploit.parser.CloudsploitParser",
"dojo.models.Test"
] | [((335, 354), 'dojo.tools.cloudsploit.parser.CloudsploitParser', 'CloudsploitParser', ([], {}), '()\n', (352, 354), False, 'from dojo.tools.cloudsploit.parser import CloudsploitParser\n'), ((662, 681), 'dojo.tools.cloudsploit.parser.CloudsploitParser', 'CloudsploitParser', ([], {}), '()\n', (679, 681), False, 'from doj... |
#!/usr/bin/env python
'''
Port Google Bookmarks over to pinboard.in
* Export Google Bookmarks by hitting
http://www.google.com/bookmarks/?output=xml&num=10000
* Get pinboard auth_token from https://pinboard.in/settings/password
Run:
./gbmk2pinb.py bookmarks.xml --auth-token <token>
'''
import requests
from cS... | [
"datetime.datetime.utcfromtimestamp",
"requests.post",
"cStringIO.StringIO",
"argparse.ArgumentParser",
"xml.etree.cElementTree.parse",
"logging.error"
] | [((1017, 1029), 'xml.etree.cElementTree.parse', 'et.parse', (['fo'], {}), '(fo)\n', (1025, 1029), True, 'import xml.etree.cElementTree as et\n'), ((2062, 2099), 'requests.post', 'requests.post', (['add_url'], {'params': 'params'}), '(add_url, params=params)\n', (2075, 2099), False, 'import requests\n'), ((2251, 2314), ... |
import os
import re
import subprocess
from ..segment import BasicSegment
class Repo(object):
symbols = {
"detached": "\u2693",
"ahead": "\u2B06",
"behind": "\u2B07",
"staged": "\u2714",
"changed": "\u270E",
"new": "\uf128",
"conflicted": "\u2... | [
"subprocess.Popen",
"os.access",
"os.getcwd",
"os.chdir",
"re.search"
] | [((2219, 2365), 're.search', 're.search', (['"""^## (?P<local>\\\\S+?)(\\\\.{3}(?P<remote>\\\\S+?)( \\\\[(ahead (?P<ahead>\\\\d+)(, )?)?(behind (?P<behind>\\\\d+))?\\\\])?)?$"""', 'status[0]'], {}), "(\n '^## (?P<local>\\\\S+?)(\\\\.{3}(?P<remote>\\\\S+?)( \\\\[(ahead (?P<ahead>\\\\d+)(, )?)?(behind (?P<behind>\\\\d... |
import unittest
from . import *
from edg_core.ScalaCompilerInterface import ScalaCompiler
class TestConstPropInternal(Block):
def __init__(self) -> None:
super().__init__()
self.float_param = self.Parameter(FloatExpr())
self.range_param = self.Parameter(RangeExpr())
class TestParameterConstProp(Bloc... | [
"edg_core.ScalaCompilerInterface.ScalaCompiler.compile"
] | [((1065, 1110), 'edg_core.ScalaCompilerInterface.ScalaCompiler.compile', 'ScalaCompiler.compile', (['TestParameterConstProp'], {}), '(TestParameterConstProp)\n', (1086, 1110), False, 'from edg_core.ScalaCompilerInterface import ScalaCompiler\n'), ((2826, 2874), 'edg_core.ScalaCompilerInterface.ScalaCompiler.compile', '... |
'''
Created on 2017年1月15日
@author: Think
题目:一个5位数,判断它是不是回文数。即12321是回文数,个位与万位相同,十位与千位相同。
1.程序分析:同29例
2.程序源代码:
'''
from pip._vendor.distlib.compat import raw_input
def jcp030():
x = int(raw_input('input a number:\n'))
x = str(x)
for i in range(len(x)//2):
if x[i] != x[-i - 1]:
print('... | [
"pip._vendor.distlib.compat.raw_input"
] | [((193, 223), 'pip._vendor.distlib.compat.raw_input', 'raw_input', (['"""input a number:\n"""'], {}), "('input a number:\\n')\n", (202, 223), False, 'from pip._vendor.distlib.compat import raw_input\n')] |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Created by <NAME> (<EMAIL>)
Anisotropy data analysis
The equation for the curve as published by Marchand et al. in Nature Cell Biology in 2001 is as follows:
y = a + (b-a) / [(c(x+K)/K*d)+1], where
a is the anisotropy without protein,
b... | [
"scipy.optimize.curve_fit",
"pathlib.Path",
"inspect.currentframe",
"matplotlib.pyplot.close",
"numpy.array",
"numpy.linspace",
"matplotlib.pyplot.subplots"
] | [((1092, 1143), 'numpy.array', 'np.array', (['[100, 50, 25, 12.5, 6.25, 3.125, 1.56, 0]'], {}), '([100, 50, 25, 12.5, 6.25, 3.125, 1.56, 0])\n', (1100, 1143), True, 'import numpy as np\n'), ((1153, 1216), 'numpy.array', 'np.array', (['[0.179, 0.186, 0.19, 0.195, 0.2, 0.212, 0.222, 0.248]'], {}), '([0.179, 0.186, 0.19, ... |
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"numpy.clip",
"common.actor_critic.ActorNetwork",
"common.replay_buffer.ReplayBuffer",
"common.actor_critic.CriticNetwork",
"numpy.random.randn"
] | [((1489, 1747), 'common.actor_critic.ActorNetwork', 'ActorNetwork', ([], {'sess': 'sess', 'state_dim': 'state_dim', 'action_dim': 'self.action_dim', 'action_high': 'self.action_high', 'action_low': 'self.action_low', 'learning_rate': 'config.actor_lr', 'grad_norm_clip': 'config.grad_norm_clip', 'tau': 'config.tau', 'ba... |
# Generated by Django 3.1.4 on 2021-01-09 20:56
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),
('products', '0002_auto_20... | [
"django.db.models.FloatField",
"django.db.migrations.RemoveField",
"django.db.models.TextField",
"django.db.models.IntegerField",
"django.db.models.ForeignKey",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.migrations.swappable_dependency",
"django.db.models.CharField"
] | [((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'), ((369, 428), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from distutils.core import Extension
import pathlib
here = pathlib.Path(__file__).parent.resolve()
setup(
name='envemind',
version='0.0.1',
description='Prediction of monoisotopic mass in mass spectra',
# long_des... | [
"setuptools.find_packages",
"pathlib.Path"
] | [((1178, 1193), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (1191, 1193), False, 'from setuptools import setup, find_packages\n'), ((150, 172), 'pathlib.Path', 'pathlib.Path', (['__file__'], {}), '(__file__)\n', (162, 172), False, 'import pathlib\n')] |
import argparse
import os
import subprocess
import time
from Cython.Build import cythonize
import generate_bindings
from meson_scripts import copy_tools, download_python, generate_init_files, \
locations, platform_check, generate_godot, \
download_godot
generate_bindings.build()
def cythonize_files():
m... | [
"meson_scripts.copy_tools.copy_main",
"meson_scripts.generate_godot.generate_lib",
"argparse.ArgumentParser",
"Cython.Build.cythonize",
"subprocess.Popen",
"subprocess.run",
"meson_scripts.copy_tools.copy_tests",
"meson_scripts.locations.get_godot_dir",
"meson_scripts.generate_godot.generate_gdignor... | [((264, 289), 'generate_bindings.build', 'generate_bindings.build', ([], {}), '()\n', (287, 289), False, 'import generate_bindings\n'), ((2157, 2186), 'meson_scripts.platform_check.get_platform', 'platform_check.get_platform', ([], {}), '()\n', (2184, 2186), False, 'from meson_scripts import copy_tools, download_python... |
import os
import django
from django.conf import settings
def pytest_configure(config):
"""Configure Django."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
settings.configure()
django.setup()
| [
"os.environ.setdefault",
"django.setup",
"django.conf.settings.configure"
] | [((123, 182), 'os.environ.setdefault', 'os.environ.setdefault', (['"""DJANGO_SETTINGS_MODULE"""', '"""settings"""'], {}), "('DJANGO_SETTINGS_MODULE', 'settings')\n", (144, 182), False, 'import os\n'), ((187, 207), 'django.conf.settings.configure', 'settings.configure', ([], {}), '()\n', (205, 207), False, 'from django.... |
import owlready2
import yaml
import urllib.request
import os
import gzip
import json
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../cellxgene_schema"))
import env
from typing import List
import os
def _download_owls(
owl_info_yml: str = env.OWL_INFO_YAML, output_dir: str ... | [
"os.listdir",
"owlready2.World",
"gzip.open",
"os.path.join",
"os.path.realpath",
"yaml.safe_load",
"json.dump",
"os.remove"
] | [((2994, 3017), 'os.listdir', 'os.listdir', (['working_dir'], {}), '(working_dir)\n', (3004, 3017), False, 'import os\n'), ((692, 723), 'yaml.safe_load', 'yaml.safe_load', (['owl_info_handle'], {}), '(owl_info_handle)\n', (706, 723), False, 'import yaml\n'), ((1081, 1124), 'os.path.join', 'os.path.join', (['output_dir'... |
# importing modules and packages
# system tools
import os
import sys
import argparse
sys.path.append(os.path.join("..", ".."))
from contextlib import redirect_stdout
# pandas, numpy, gensim
import pandas as pd
import numpy as np
import gensim.downloader
# import my classifier utility functions - see the Github repo!
... | [
"argparse.ArgumentParser",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"sklearn.feature_extraction.text.CountVectorizer",
"sklearn.metrics.classification_report",
"os.path.join",
"sklearn.linear_model.LogisticRegression"
] | [((101, 125), 'os.path.join', 'os.path.join', (['""".."""', '""".."""'], {}), "('..', '..')\n", (113, 125), False, 'import os\n'), ((4799, 4868), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""[INFO] LR classifier arguments"""'}), "(description='[INFO] LR classifier arguments')\n", (4822... |
#!/usr/bin/env python
'''
Central execution points for non-python services
'''
import logging
from neo4j.v1 import GraphDatabase, basic_auth
import neo4j.bolt.connection
import elasticsearch.exceptions
from isoprene_pumpjack.constants.environment import environment
from isoprene_pumpjack.utils.neo_to_d3 import neo_... | [
"logging.getLogger",
"isoprene_pumpjack.utils.neo_to_d3.neo_to_d3",
"neo4j.v1.basic_auth",
"isoprene_pumpjack.exceptions.IsopumpException"
] | [((394, 421), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (411, 421), False, 'import logging\n'), ((1470, 1511), 'isoprene_pumpjack.utils.neo_to_d3.neo_to_d3', 'neo_to_d3', (['result', 'nodeLabels', 'linkLabels'], {}), '(result, nodeLabels, linkLabels)\n', (1479, 1511), False, 'from is... |
# Generated by Django 2.2.1 on 2019-07-28 08:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('login', '0002_auto_20190720_1846'),
]
operations = [
migrations.AddField(
model_name='user',
name='token',
... | [
"django.db.models.CharField"
] | [((329, 396), 'django.db.models.CharField', 'models.CharField', ([], {'default': '(1)', 'max_length': '(100)', 'verbose_name': '"""token验证"""'}), "(default=1, max_length=100, verbose_name='token验证')\n", (345, 396), False, 'from django.db import migrations, models\n')] |
from allauth.account.utils import setup_user_email, send_email_confirmation
from rest_framework.response import Response
from usersystem.serializers import UserSerializer, UserRegisterSerializer
from rest_framework.views import APIView
from rest_framework.status import HTTP_200_OK, HTTP_400_BAD_REQUEST, HTTP_201_CREATE... | [
"requests.post",
"usersystem.serializers.UserSerializer",
"social.apps.django_app.default.models.UserSocialAuth.get_social_auth_for_user",
"usersystem.serializers.UserRegisterSerializer",
"django.contrib.auth.models.User.objects.all",
"django.contrib.auth.models.User.objects.filter",
"allauth.account.ut... | [((1065, 1123), 'usersystem.serializers.UserSerializer', 'UserSerializer', (['request.user'], {'context': "{'request': request}"}), "(request.user, context={'request': request})\n", (1079, 1123), False, 'from usersystem.serializers import UserSerializer, UserRegisterSerializer\n'), ((1139, 1164), 'rest_framework.respon... |
#!/usr/bin/env python
#
# ======================================================================
#
# <NAME>, U.S. Geological Survey
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://geodynamics.org).
#
# Copyright (c) 2010-2017 University of California, Davis
#
# See COPY... | [
"pyre.applications.Script.Script.__init__"
] | [((949, 988), 'pyre.applications.Script.Script.__init__', 'Script.__init__', (['self', '"""convertdataapp"""'], {}), "(self, 'convertdataapp')\n", (964, 988), False, 'from pyre.applications.Script import Script\n')] |
import subprocess
import json
import csv
from csv import DictWriter
import datetime
import pandas as pd
import Cmd
import Data
from Report import Report
import File
def main():
Data.val_earnings_w_sum_columns()
dataframe=Data.get_val_token_info()
dataframe.to_csv(File._generate_file_name("fxcored_s... | [
"File._generate_file_name",
"Data.val_earnings_w_sum_columns",
"Data.get_val_token_info"
] | [((187, 220), 'Data.val_earnings_w_sum_columns', 'Data.val_earnings_w_sum_columns', ([], {}), '()\n', (218, 220), False, 'import Data\n'), ((238, 263), 'Data.get_val_token_info', 'Data.get_val_token_info', ([], {}), '()\n', (261, 263), False, 'import Data\n'), ((285, 327), 'File._generate_file_name', 'File._generate_fi... |
# Solution of;
# Project Euler Problem 67: Maximum path sum II
# https://projecteuler.net/problem=67
#
# By starting at the top of the triangle below and moving to adjacent numbers
# on the row below, the maximum total from top to bottom is 23. 37 42 4 68 5 9
# 3That is, 3 + 7 + 4 + 9 = 23. Find the maximum total fr... | [
"timed.caller"
] | [((965, 999), 'timed.caller', 'timed.caller', (['dummy', 'n', 'i', 'prob_id'], {}), '(dummy, n, i, prob_id)\n', (977, 999), False, 'import timed\n')] |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def unemp_dur(path):
"""Unemployment Duration
Journal of Business Econ... | [
"observations.util.maybe_download_and_extract",
"os.path.join",
"os.path.expanduser"
] | [((1438, 1462), 'os.path.expanduser', 'os.path.expanduser', (['path'], {}), '(path)\n', (1456, 1462), False, 'import os\n'), ((1611, 1698), 'observations.util.maybe_download_and_extract', 'maybe_download_and_extract', (['path', 'url'], {'save_file_name': '"""unemp_dur.csv"""', 'resume': '(False)'}), "(path, url, save_f... |
import numpy as np
import GPy
from .GP_interface import GPInterface, convert_lengthscale, convert_2D_format
class GPyWrapper(GPInterface):
def __init__(self):
# GPy settings
GPy.plotting.change_plotting_library("matplotlib") # use matpoltlib for drawing
super().__init__()
self.cen... | [
"numpy.clip",
"numpy.sqrt",
"numpy.isscalar",
"numpy.ones",
"GPy.kern.RBF",
"GPy.plotting.change_plotting_library",
"numpy.square",
"numpy.array",
"GPy.models.GPClassification",
"GPy.kern.Matern52",
"GPy.kern.Bias",
"numpy.stack",
"numpy.concatenate",
"GPy.priors.Gamma.from_EV",
"numpy.l... | [((10112, 10136), 'numpy.isscalar', 'np.isscalar', (['lengthscale'], {}), '(lengthscale)\n', (10123, 10136), True, 'import numpy as np\n'), ((10773, 10792), 'numpy.square', 'np.square', (['(X / 10.0)'], {}), '(X / 10.0)\n', (10782, 10792), True, 'import numpy as np\n'), ((197, 247), 'GPy.plotting.change_plotting_librar... |
import os
from pathlib import Path
from unittest import TestCase
import validator.validator as validator
from .test_utils import schema, build_map
class TestStrangeNames(TestCase):
old_cwd = os.getcwd()
@classmethod
def setUpClass(cls):
os.chdir('./tests/workspaces/strange-names')
@classmet... | [
"os.chdir",
"validator.validator.validate_cwd",
"pathlib.Path",
"os.getcwd"
] | [((198, 209), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (207, 209), False, 'import os\n'), ((261, 305), 'os.chdir', 'os.chdir', (['"""./tests/workspaces/strange-names"""'], {}), "('./tests/workspaces/strange-names')\n", (269, 305), False, 'import os\n'), ((360, 381), 'os.chdir', 'os.chdir', (['cls.old_cwd'], {}), '(c... |
'''Tokenizer Class'''
# -*- encoding: utf-8 -*-
import re
from .token_with_pos import TokenWithPos
from .patterns import Patterns
class Tokenizer():
'''
A basic Tokenizer class to tokenize strings and patterns
Parameters:
- regexp: regexp used to tokenize the string
'''
def __init__(self,... | [
"re.split",
"re.compile"
] | [((493, 510), 're.compile', 're.compile', (['"""\\\\s"""'], {}), "('\\\\s')\n", (503, 510), False, 'import re\n'), ((2574, 2620), 're.split', 're.split', (['Patterns.ALL_WEB_CAPTURED_RE', 'phrase'], {}), '(Patterns.ALL_WEB_CAPTURED_RE, phrase)\n', (2582, 2620), False, 'import re\n'), ((3253, 3298), 're.split', 're.spli... |
from numpy import zeros, ones, dot, sum, abs, max, argmax, clip, \
random, prod, asarray, set_printoptions, unravel_index
# Generate a random uniform number (array) in range [0,1].
def zero(*shape): return zeros(shape)
def randnorm(*shape): return random.normal(size=shape)
def randuni(*shape): return random.ran... | [
"numpy.random.normal",
"numpy.prod",
"numpy.abs",
"numpy.ones",
"numpy.random.random",
"itertools.product",
"numpy.asarray",
"numpy.argmax",
"numpy.max",
"numpy.sum",
"numpy.dot",
"numpy.zeros",
"numpy.random.randint",
"numpy.unravel_index",
"numpy.random.seed",
"util.plot.Plot",
"nu... | [((214, 226), 'numpy.zeros', 'zeros', (['shape'], {}), '(shape)\n', (219, 226), False, 'from numpy import zeros, ones, dot, sum, abs, max, argmax, clip, random, prod, asarray, set_printoptions, unravel_index\n'), ((256, 281), 'numpy.random.normal', 'random.normal', ([], {'size': 'shape'}), '(size=shape)\n', (269, 281),... |
'''
Algorithm for matching the model to image points.
Based on (Cootes et al. 2000, p.9) and (Blanz et al., p.4).
'''
import numpy as np
from utils.structure import Shape
from utils.align import Aligner
class Fitter(object):
def __init__(self, pdmodel):
self.pdmodel = pdmodel
self.aligner = Align... | [
"utils.align.Aligner",
"numpy.diag",
"utils.structure.Shape",
"numpy.linalg.svd",
"numpy.zeros_like"
] | [((315, 324), 'utils.align.Aligner', 'Aligner', ([], {}), '()\n', (322, 324), False, 'from utils.align import Aligner\n'), ((1480, 1548), 'numpy.linalg.svd', 'np.linalg.svd', (['self.pdmodel.scaled_eigenvectors'], {'full_matrices': '(False)'}), '(self.pdmodel.scaled_eigenvectors, full_matrices=False)\n', (1493, 1548), ... |
from flask import Flask
from flask_cors import CORS # type: ignore
from .api import account_blueprint
from .event_handlers import register_event_handlers
from .infrastructure import event_store_db
from .composition_root import event_manager
def account_app_factory(db_string: str):
app = Flask(__name__)
CORS(... | [
"flask_cors.CORS",
"flask.Flask"
] | [((295, 310), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (300, 310), False, 'from flask import Flask\n'), ((315, 324), 'flask_cors.CORS', 'CORS', (['app'], {}), '(app)\n', (319, 324), False, 'from flask_cors import CORS\n')] |
# Package: Storage Manager
# License: Released under MIT License
# Notice: Copyright (c) 2020 TytusDB Team
# Developers: <NAME>
from storage.avl import avlMode
from storage.b import BMode
from storage.bplus import BPlusMode
from storage.hash import HashMode
from storage.isam import ISAMMode
... | [
"storage.bplus.BPlusMode.dropDatabase",
"storage.b.BMode.extractRangeTable",
"storage.bplus.BPlusMode.extractRangeTable",
"storage.b.BMode.update",
"storage.json_mode.jsonMode.delete",
"storage.json_mode.jsonMode.extractRow",
"storage.hash.HashMode.extractRangeTable",
"storage.hash.HashMode.alterDatab... | [((977, 1022), 'storage.b.Serializable.rollback', 'Serializable.rollback', (['"""lista_bases_de_datos"""'], {}), "('lista_bases_de_datos')\n", (998, 1022), False, 'from storage.b import Serializable\n'), ((12469, 12505), 're.search', 're.search', (['DB_NAME_PATTERN', 'database'], {}), '(DB_NAME_PATTERN, database)\n', (... |
from RPA.Browser.Selenium import Selenium
from RPA.FileSystem import FileSystem
import datetime
import os
class PDFDownloader:
def __init__(self, page_urls, names):
self.browser = Selenium()
self.files = FileSystem()
self._dir = f'{os.getcwd()}/output'
self._urls = page_urls
... | [
"datetime.timedelta",
"RPA.FileSystem.FileSystem",
"RPA.Browser.Selenium.Selenium",
"os.getcwd"
] | [((196, 206), 'RPA.Browser.Selenium.Selenium', 'Selenium', ([], {}), '()\n', (204, 206), False, 'from RPA.Browser.Selenium import Selenium\n'), ((228, 240), 'RPA.FileSystem.FileSystem', 'FileSystem', ([], {}), '()\n', (238, 240), False, 'from RPA.FileSystem import FileSystem\n'), ((264, 275), 'os.getcwd', 'os.getcwd', ... |
"""Constants for the Ridwell integration."""
import logging
DOMAIN = "ridwell"
LOGGER = logging.getLogger(__package__)
DATA_ACCOUNT = "account"
DATA_COORDINATOR = "coordinator"
SENSOR_TYPE_NEXT_PICKUP = "next_pickup"
| [
"logging.getLogger"
] | [((90, 120), 'logging.getLogger', 'logging.getLogger', (['__package__'], {}), '(__package__)\n', (107, 120), False, 'import logging\n')] |
import subprocess
import fnmatch
from pathlib import Path
import os
import re
def all_files(src):
regex_include = re.compile("|".join((fnmatch.translate(e) for e in src.included_files)))
regex_exclude = re.compile("|".join((fnmatch.translate(e) for e in src.excluded_files)))
for root, dirs, files in os.w... | [
"fnmatch.translate",
"subprocess.run",
"os.path.join",
"os.chdir",
"os.walk",
"os.path.relpath"
] | [((316, 333), 'os.walk', 'os.walk', (['src.root'], {}), '(src.root)\n', (323, 333), False, 'import os\n'), ((658, 702), 'subprocess.run', 'subprocess.run', (['args'], {'stdout': 'subprocess.PIPE'}), '(args, stdout=subprocess.PIPE)\n', (672, 702), False, 'import subprocess\n'), ((1109, 1134), 'os.chdir', 'os.chdir', (['... |
import click
class command:
def __init__(self, name=None, cls=click.Command, **attrs):
self.name = name
self.cls = cls
self.attrs = attrs
def __call__(self, method):
def __command__(this):
def wrapper(*args, **kwargs):
return method(this, *args, **k... | [
"click.Group",
"click.Option"
] | [((1086, 1099), 'click.Group', 'click.Group', ([], {}), '()\n', (1097, 1099), False, 'import click\n'), ((864, 920), 'click.Option', 'click.Option', ([], {'param_decls': 'self.param_decls'}), '(param_decls=self.param_decls, **self.attrs)\n', (876, 920), False, 'import click\n')] |
# Leechy Prototype Spectrum Analyzer.
# Important: MAKE SURE KEYBOARD IS ON ENGLISH AND CAPSLOCK IS NOT ON!
import cv2,pickle,xlsxwriter,time,datetime,os, os.path
from imutils import rotate_bound
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Button
from PIL import Image, Im... | [
"cv2.rectangle",
"cv2.imshow",
"os.remove",
"cv2.setMouseCallback",
"os.listdir",
"cv2.threshold",
"matplotlib.pyplot.plot",
"cv2.contourArea",
"matplotlib.pyplot.close",
"cv2.waitKey",
"xlsxwriter.Workbook",
"cv2.drawContours",
"cv2.cvtColor",
"matplotlib.pyplot.ion",
"matplotlib.pyplot... | [((995, 1004), 'matplotlib.pyplot.ion', 'plt.ion', ([], {}), '()\n', (1002, 1004), True, 'import matplotlib.pyplot as plt\n'), ((1560, 1615), 'cv2.namedWindow', 'cv2.namedWindow', (['"""Spectrum Analyser"""', 'cv2.WINDOW_NORMAL'], {}), "('Spectrum Analyser', cv2.WINDOW_NORMAL)\n", (1575, 1615), False, 'import cv2, pick... |
"""
Spacer components to add horizontal or vertical space to a layout.
"""
import param
from bokeh.models import Div as BkDiv, Spacer as BkSpacer
from ..reactive import Reactive
class Spacer(Reactive):
"""
The `Spacer` layout is a very versatile component which makes it easy to
put fixed or responsive ... | [
"param.Parameter",
"param.ObjectSelector"
] | [((1501, 1557), 'param.Parameter', 'param.Parameter', ([], {'default': '"""stretch_height"""', 'readonly': '(True)'}), "(default='stretch_height', readonly=True)\n", (1516, 1557), False, 'import param\n'), ((2063, 2118), 'param.Parameter', 'param.Parameter', ([], {'default': '"""stretch_width"""', 'readonly': '(True)'}... |
#!/usr/bin/env python3
import member
m1 = member.SomeClass("Pavel")
print ("name =",m1.name)
m1.name = "Gunther"
print ("name =",m1.name)
m1.number = 7.3
print ("number =",m1.number)
| [
"member.SomeClass"
] | [((44, 69), 'member.SomeClass', 'member.SomeClass', (['"""Pavel"""'], {}), "('Pavel')\n", (60, 69), False, 'import member\n')] |
from distutils.core import setup
setup(name='Bluemix',
version='0.1',
description='A bluemix datasource to be used with cloudbase-init',
packages=['bluemix', 'bluemix.conf'])
| [
"distutils.core.setup"
] | [((34, 185), 'distutils.core.setup', 'setup', ([], {'name': '"""Bluemix"""', 'version': '"""0.1"""', 'description': '"""A bluemix datasource to be used with cloudbase-init"""', 'packages': "['bluemix', 'bluemix.conf']"}), "(name='Bluemix', version='0.1', description=\n 'A bluemix datasource to be used with cloudbase... |
import matplotlib
matplotlib.use('Agg') # this lets us do some headless stuff
import matplotlib.pylab as plt
import numpy as np
x = np.asarray([0,5,2])
y = np.asarray([0,1,3])
f = plt.figure()
ax = f.add_subplot(111)
ax.plot(x,y)
#plt.show() # we have a headless display, can't do this!
f.savefig('basicplot.eps',format... | [
"matplotlib.use",
"numpy.asarray",
"matplotlib.pylab.figure"
] | [((18, 39), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (32, 39), False, 'import matplotlib\n'), ((133, 154), 'numpy.asarray', 'np.asarray', (['[0, 5, 2]'], {}), '([0, 5, 2])\n', (143, 154), True, 'import numpy as np\n'), ((157, 178), 'numpy.asarray', 'np.asarray', (['[0, 1, 3]'], {}), '([0, 1... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
from itertools import product
from pathlib import Path
import numpy as np
import tensorflow as tf
from dotenv import load_dotenv
from annotation.direction import (Direction, get_diagonal_directions,
get_cross_directions)
from ... | [
"annotation.direction.get_cross_directions",
"pathlib.Path",
"tensorflow.placeholder",
"os.environ.get",
"numpy.squeeze",
"annotation.piece.Piece",
"numpy.empty",
"annotation.direction.get_diagonal_directions",
"numpy.all",
"tensorflow.squeeze"
] | [((639, 668), 'os.environ.get', 'os.environ.get', (['"""DATA_FORMAT"""'], {}), "('DATA_FORMAT')\n", (653, 668), False, 'import os\n'), ((1280, 1311), 'numpy.empty', 'np.empty', (['shape'], {'dtype': 'np.int32'}), '(shape, dtype=np.int32)\n', (1288, 1311), True, 'import numpy as np\n'), ((1332, 1369), 'tensorflow.placeh... |
# Generated by Django 2.0.2 on 2018-03-22 21:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('palsbet', '0002_viptipsgames'),
]
operations = [
migrations.AlterField(
model_name='viptipsgames',
name='cathegory',... | [
"django.db.models.CharField"
] | [((339, 371), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (355, 371), False, 'from django.db import migrations, models\n')] |
import gym
from gym import spaces
import numpy as np
import learning_data
from Simulation import Simulation
def get_value_or_delimiter(value, delimiter):
return min(delimiter[1], max(delimiter[0], value))
class Environment(gym.Env):
def __init__(self, simulation, training):
super(Environment, self)... | [
"gym.spaces.Dict",
"Simulation.Simulation",
"gym.spaces.Discrete",
"gym.spaces.Box"
] | [((431, 449), 'gym.spaces.Discrete', 'spaces.Discrete', (['(2)'], {}), '(2)\n', (446, 449), False, 'from gym import spaces\n'), ((554, 607), 'gym.spaces.Box', 'spaces.Box', ([], {'low': '(0)', 'high': '(1)', 'shape': '(1,)', 'dtype': 'np.uint8'}), '(low=0, high=1, shape=(1,), dtype=np.uint8)\n', (564, 607), False, 'fro... |
# Copyright <NAME> 2011-2017
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#-------------------------------------------------------------------------------
# CreateVersionFileCpp
#--------... | [
"os.path.exists",
"SCons.Script.File",
"os.makedirs",
"datetime.datetime.utcnow",
"cuppa.utility.attr_tools.try_attr_as_str",
"os.path.join",
"os.path.splitext",
"os.path.split",
"getpass.getuser",
"socket.gethostname",
"os.path.relpath"
] | [((686, 710), 'os.path.relpath', 'relpath', (['path', 'build_dir'], {}), '(path, build_dir)\n', (693, 710), False, 'from os.path import splitext, relpath, sep\n'), ((1282, 1330), 'os.path.join', 'os.path.join', (["env['base_path']", "env['build_dir']"], {}), "(env['base_path'], env['build_dir'])\n", (1294, 1330), False... |
import pandas as pd
from scipy.stats import ttest_rel
"""
output
"""
# Note: some output is shortened to save spaces.
# This file discusses statistical analysis (Part II).
# ------------------------------------------------------------------------------
# Data stored in form of xlsx with contents:
"""
group data... | [
"scipy.stats.ttest_rel",
"pandas.read_excel"
] | [((610, 645), 'pandas.read_excel', 'pd.read_excel', (['"""E:\\\\IS_t_test.xlsx"""'], {}), "('E:\\\\IS_t_test.xlsx')\n", (623, 645), True, 'import pandas as pd\n'), ((756, 781), 'scipy.stats.ttest_rel', 'ttest_rel', (['Group1', 'Group2'], {}), '(Group1, Group2)\n', (765, 781), False, 'from scipy.stats import ttest_rel\n... |
import random
import torch
import torch.nn as nn
import torch.nn.functional as F
from .layers import *
PRIMITIVES = [
'MBI_k3_e3',
'MBI_k3_e6',
'MBI_k5_e3',
'MBI_k5_e6',
'MBI_k3_e3_se',
'MBI_k3_e6_se',
'MBI_k5_e3_se',
'MBI_k5_e6_se',
# 'skip',
]
OPS = {
'MBI_k3_e3' : lambda ic, mc, oc, s, aff, act: MBInvert... | [
"torch.nn.functional.gumbel_softmax",
"torch.nn.init.constant_",
"torch.nn.ModuleList",
"torch.nn.Parameter",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.functional.log_softmax",
"torch.zeros",
"torch.argmin",
"torch.nn.functional.softmax",
"torch.argmax"
] | [((1549, 1564), 'torch.nn.ModuleList', 'nn.ModuleList', ([], {}), '()\n', (1562, 1564), True, 'import torch.nn as nn\n'), ((3802, 3830), 'torch.zeros', 'torch.zeros', (['(self.num_ops,)'], {}), '((self.num_ops,))\n', (3813, 3830), False, 'import torch\n'), ((3846, 3875), 'torch.nn.functional.log_softmax', 'F.log_softma... |
import numpy as np
import random as random
def move_to_sample(Rover):
delX = 0; delY = 0;
if len(Rover.rock_angles) > 0:
dist_to_rock = np.mean(np.abs(Rover.rock_dist))
angle_to_rock = np.mean(Rover.rock_angles);
Rover.steer = np.clip(angle_to_rock* 180/np.pi, -15, 15)
if Rove... | [
"numpy.clip",
"numpy.mean",
"numpy.abs",
"numpy.diff",
"numpy.random.randint"
] | [((211, 237), 'numpy.mean', 'np.mean', (['Rover.rock_angles'], {}), '(Rover.rock_angles)\n', (218, 237), True, 'import numpy as np\n'), ((261, 306), 'numpy.clip', 'np.clip', (['(angle_to_rock * 180 / np.pi)', '(-15)', '(15)'], {}), '(angle_to_rock * 180 / np.pi, -15, 15)\n', (268, 306), True, 'import numpy as np\n'), (... |
# -*- coding: utf-8 -*-
from datetime import date, datetime
from odoo.tests.common import Form
from odoo.addons.hr_holidays.tests.common import TestHrHolidaysCommon
from odoo.exceptions import ValidationError
class TestAutomaticLeaveDates(TestHrHolidaysCommon):
def setUp(self):
super(TestAutomaticLeaveD... | [
"datetime.datetime",
"datetime.date"
] | [((1035, 1051), 'datetime.date', 'date', (['(2019)', '(9)', '(2)'], {}), '(2019, 9, 2)\n', (1039, 1051), False, 'from datetime import date, datetime\n'), ((1093, 1109), 'datetime.date', 'date', (['(2019)', '(9)', '(2)'], {}), '(2019, 9, 2)\n', (1097, 1109), False, 'from datetime import date, datetime\n'), ((2577, 2593)... |
# encoding: utf-8
from __future__ import absolute_import, unicode_literals
import onnxruntime
class ONNXModel:
def __init__(self, model_file=None, session=None, task_name=''):
self.model_file = model_file
self.session = session
self.task_name = task_name
if self.session is None:
... | [
"onnxruntime.InferenceSession"
] | [((393, 444), 'onnxruntime.InferenceSession', 'onnxruntime.InferenceSession', (['self.model_file', 'None'], {}), '(self.model_file, None)\n', (421, 444), False, 'import onnxruntime\n')] |
# -*- coding: utf-8 -*-
from django.shortcuts import get_object_or_404, render_to_response, redirect
from django.template import RequestContext
from django.core.context_processors import csrf
from django.views.decorators.csrf import csrf_exempt
from django.http import Http404, HttpResponse, HttpResponseForbidden, Http... | [
"django.http.HttpResponse",
"subprocess.Popen",
"django.shortcuts.get_object_or_404",
"fabrun.models.Task.objects.order_by",
"django.template.RequestContext",
"django.core.urlresolvers.reverse",
"datetime.timedelta",
"servers.models.Server.objects.exclude",
"django.utils.timezone.now",
"django.con... | [((2762, 2792), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['Task'], {'pk': 'pk'}), '(Task, pk=pk)\n', (2779, 2792), False, 'from django.shortcuts import get_object_or_404, render_to_response, redirect\n'), ((3072, 3134), 'django.contrib.messages.success', 'messages.success', (['request', '"""Old fabri... |
########################################
# CS/CNS/EE 155 2018
# Problem Set 1
#
# Author: <NAME>
# Description: Set 1 Perceptron helper
########################################
import numpy as np
import matplotlib.pyplot as plt
def predict(x, w, b):
'''
The method takes the weight vector and bias of a... | [
"numpy.dot"
] | [((663, 675), 'numpy.dot', 'np.dot', (['w', 'x'], {}), '(w, x)\n', (669, 675), True, 'import numpy as np\n')] |
from models import StandardHMM, DenseHMM, HMMLoggingMonitor
from utils import prepare_data, check_random_state, create_directories, dict_get, Timer, timestamp_msg, check_dir, is_multinomial, compute_stationary, check_sequences
from data import penntreebank_tag_sequences, protein_sequences, train_test_split
from datet... | [
"data.penntreebank_tag_sequences",
"numpy.sqrt",
"utils.is_multinomial",
"copy.deepcopy",
"models.HMMLoggingMonitor",
"numpy.save",
"utils.Timer",
"numpy.max",
"utils.compute_stationary",
"utils.check_sequences",
"data.protein_sequences",
"numpy.ones",
"data.train_test_split",
"numpy.aroun... | [((571, 578), 'utils.Timer', 'Timer', ([], {}), '()\n', (576, 578), False, 'from utils import prepare_data, check_random_state, create_directories, dict_get, Timer, timestamp_msg, check_dir, is_multinomial, compute_stationary, check_sequences\n'), ((627, 648), 'utils.prepare_data', 'prepare_data', (['train_X'], {}), '(... |
'''
TaxiMDPClass.py: Contains the TaxiMDP class.
From:
Dietterich, <NAME>. "Hierarchical reinforcement learning with the
MAXQ value function decomposition." J. Artif. Intell. Res.(JAIR) 13
(2000): 227-303.
Author: <NAME> (cs.brown.edu/~dabel/)
'''
# Python imports.
from __future__ import print_function
i... | [
"simple_rl.tasks.taxi.taxi_helpers._is_wall_in_the_way",
"simple_rl.mdp.oomdp.OOMDPClass.OOMDP.__init__",
"simple_rl.tasks.taxi.TaxiStateClass.TaxiState",
"simple_rl.utils.mdp_visualizer.visualize_interaction",
"random.random",
"simple_rl.tasks.taxi.taxi_helpers.is_taxi_terminal_state",
"copy.deepcopy",... | [((1020, 1063), 'simple_rl.mdp.oomdp.OOMDPObjectClass.OOMDPObject', 'OOMDPObject', ([], {'attributes': 'agent', 'name': '"""agent"""'}), "(attributes=agent, name='agent')\n", (1031, 1063), False, 'from simple_rl.mdp.oomdp.OOMDPObjectClass import OOMDPObject\n'), ((1306, 1438), 'simple_rl.mdp.oomdp.OOMDPClass.OOMDP.__in... |
#coding:utf-8
#
# id: bugs.core_2923
# title: Problem with dependencies between a procedure and a view using that procedure
# decription:
# tracker_id: CORE-2923
# min_versions: ['2.5.0']
# versions: 3.0
# qmid: None
import pytest
from firebird.qa import db_factory, isql_act, Action
... | [
"pytest.mark.version",
"firebird.qa.db_factory",
"firebird.qa.isql_act"
] | [((407, 452), 'firebird.qa.db_factory', 'db_factory', ([], {'sql_dialect': '(3)', 'init': 'init_script_1'}), '(sql_dialect=3, init=init_script_1)\n', (417, 452), False, 'from firebird.qa import db_factory, isql_act, Action\n'), ((1498, 1560), 'firebird.qa.isql_act', 'isql_act', (['"""db_1"""', 'test_script_1'], {'subst... |
from django.db import models
from django.core.validators import MinValueValidator, MaxValueValidator
class Control(models.Model):
objects=models.Manager()
TYPE_CHOICES=(
('Primitive','Primitive'),
('Corpse','CORPSE'),
('Gaussian','Gaussian'),
('CinBB','CinBB'),
)
#pk i.... | [
"django.core.validators.MinValueValidator",
"django.db.models.Manager",
"django.core.validators.MaxValueValidator",
"django.db.models.CharField"
] | [((143, 159), 'django.db.models.Manager', 'models.Manager', ([], {}), '()\n', (157, 159), False, 'from django.db import models\n'), ((394, 426), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)'}), '(max_length=200)\n', (410, 426), False, 'from django.db import models\n'), ((438, 513), 'djan... |