code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from setuptools import setup
setup(name='pyunlvrtm',
version='0.2.4',
description='Python packages to faciliate the UNL-VRTM model',
url='https://github.com/xxu2/pyunlvrtm',
author='<NAME>',
author_email='<EMAIL>',
license='MIT',
packages=['pyunlvrtm'],
test_suite='nose.... | [
"setuptools.setup"
] | [((30, 343), 'setuptools.setup', 'setup', ([], {'name': '"""pyunlvrtm"""', 'version': '"""0.2.4"""', 'description': '"""Python packages to faciliate the UNL-VRTM model"""', 'url': '"""https://github.com/xxu2/pyunlvrtm"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'license': '"""MIT"""', 'packages': "[... |
from transformers import GPTNeoModel, GPTNeoForCausalLM,\
GPT2Tokenizer, GPTNeoConfig, AdamW
from torch.utils.data import IterableDataset, DataLoader
from lm_dataformat import *
import torch
import torch.nn.functional as F
from torch.nn.functional import normalize, cross_entropy
from torch.nn import DataParallel
f... | [
"torch.distributed.barrier",
"transformers.GPT2Tokenizer.from_pretrained",
"get_args.get_args",
"torch.nn.functional.normalize",
"torch.tensor",
"transformers.GPTNeoConfig.from_pretrained",
"torch.cuda.is_available",
"torch.einsum",
"torch.nn.Linear",
"torch.utils.data.DataLoader",
"torch.nn.fun... | [((401, 411), 'get_args.get_args', 'get_args', ([], {}), '()\n', (409, 411), False, 'from get_args import get_args\n'), ((520, 575), 'transformers.GPTNeoConfig.from_pretrained', 'GPTNeoConfig.from_pretrained', (['"""EleutherAI/gpt-neo-1.3B"""'], {}), "('EleutherAI/gpt-neo-1.3B')\n", (548, 575), False, 'from transformer... |
from enum import Enum
from importlib import resources
import sys
from typing import Dict
import yaml
current_module = sys.modules[__name__]
YAML_EXTENSION = '.yaml'
# the key names come from keyboardlayout.keyconstant
def __generate_keyboard_layout_enum():
layout_names = []
for file_name in resources.content... | [
"yaml.safe_load",
"importlib.resources.contents",
"importlib.resources.read_text"
] | [((303, 337), 'importlib.resources.contents', 'resources.contents', (['current_module'], {}), '(current_module)\n', (321, 337), False, 'from importlib import resources\n'), ((1034, 1087), 'importlib.resources.read_text', 'resources.read_text', (['current_module', 'layout_file_name'], {}), '(current_module, layout_file_... |
from app import db, ma
class Participation(db.Model):
__tablename__ = 'participations'
id = db.Column(db.Integer, primary_key=True)
event_id = db.Column(db.Integer, nullable=True)
trucker_whatsapp = db.Column(db.String(120), nullable=True)
date = db.Column(db.Date, nullable=True)
def __in... | [
"app.db.String",
"app.db.Column"
] | [((102, 141), 'app.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (111, 141), False, 'from app import db, ma\n'), ((157, 193), 'app.db.Column', 'db.Column', (['db.Integer'], {'nullable': '(True)'}), '(db.Integer, nullable=True)\n', (166, 193), False, 'from app ... |
#!/usr/bin/env python
import sys,os
root = os.environ['NEMO_ROOT']
site = os.environ['NEMO_SITE']
sys.path.append(os.path.join(root,'scripts'))
from nemo import Makefile
mk = Makefile(
root = root,
sites = site,
flags = dict(PP_N_NODES = 4, PP_KERNEL_DGFV_QMAX = 2, PP_SPLIT_FORM = 0, PP_MESH_PERIODIC =... | [
"os.path.join"
] | [((117, 146), 'os.path.join', 'os.path.join', (['root', '"""scripts"""'], {}), "(root, 'scripts')\n", (129, 146), False, 'import sys, os\n')] |
"""Utility functions for the project deployment scripts."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import glob
import json
import os
import string
import subprocess
import sys
import tempfile
from absl import flags
import jsonschema
import ruamel... | [
"json.loads",
"string.Template",
"os.path.isabs",
"subprocess.check_call",
"os.path.join",
"os.getcwd",
"os.path.dirname",
"jsonschema.validate",
"glob.glob",
"tempfile.NamedTemporaryFile",
"deploy.utils.runner.run_gcloud_command",
"os.path.expanduser"
] | [((476, 501), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (491, 501), False, 'import os\n'), ((3158, 3193), 'jsonschema.validate', 'jsonschema.validate', (['config', 'schema'], {}), '(config, schema)\n', (3177, 3193), False, 'import jsonschema\n'), ((3733, 3776), 'tempfile.NamedTemporaryFi... |
import seaborn as sns
import matplotlib.pyplot as plt
wine = pd.read_csv('https://raw.githubusercontent.com/hadley/rminds/master/1-data/wine.csv').drop('type', axis = 1)
# Create correlation matrix
sns.heatmap(wine.corr(), cmap='viridis'); plt.show()
plt.matshow(wine.corr(), cmap = 'viridis')
plt.colorbar()
plt.sho... | [
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.show"
] | [((243, 253), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (251, 253), True, 'import matplotlib.pyplot as plt\n'), ((298, 312), 'matplotlib.pyplot.colorbar', 'plt.colorbar', ([], {}), '()\n', (310, 312), True, 'import matplotlib.pyplot as plt\n'), ((313, 323), 'matplotlib.pyplot.show', 'plt.show', ([], {}), ... |
import functools
import time
import jwt
import requests
from speechkit.exceptions import RequestError
def generate_jwt(service_account_id, key_id, private_key, exp_time=360):
"""
Generating JWT token for authorisation
:param string service_account_id: The ID of the service account whose key the JWT is ... | [
"requests.post",
"time.time",
"jwt.encode"
] | [((1603, 1679), 'jwt.encode', 'jwt.encode', (['payload', 'private_key'], {'algorithm': '"""PS256"""', 'headers': "{'kid': key_id}"}), "(payload, private_key, algorithm='PS256', headers={'kid': key_id})\n", (1613, 1679), False, 'import jwt\n'), ((3079, 3108), 'requests.post', 'requests.post', (['url'], {'json': 'data'})... |
import io
import re
import sys
import token
import tokenize
from token import tok_name
from tokenize import TokenInfo
from typing import Iterator, List
numchars = "0123456789"
reNamelike = re.compile(r"[A-Za-z_]")
reWhitespace = re.compile("[ \t\n]+")
reName = re.compile(r"[A-Za-z_]\w*")
reStringStart = re.compile(r'... | [
"argparse.ArgumentParser",
"re.compile",
"tokenize.TokenInfo",
"tokenize.generate_tokens",
"sys.stderr.write",
"sys.exit",
"io.StringIO"
] | [((191, 214), 're.compile', 're.compile', (['"""[A-Za-z_]"""'], {}), "('[A-Za-z_]')\n", (201, 214), False, 'import re\n'), ((231, 253), 're.compile', 're.compile', (['"""[ \t\n]+"""'], {}), "('[ \\t\\n]+')\n", (241, 253), False, 'import re\n'), ((263, 290), 're.compile', 're.compile', (['"""[A-Za-z_]\\\\w*"""'], {}), "... |
from firebase import firebase
from firebase_admin import db
from prettytable import PrettyTable
class Category:
def __init__(self, category_name=None):
self.category_name = category_name
def add_category(self, category_name=None):
data = {
'category_name': category_name,
... | [
"prettytable.PrettyTable",
"firebase_admin.db.reference"
] | [((675, 708), 'prettytable.PrettyTable', 'PrettyTable', (["['S.no', 'Category']"], {}), "(['S.no', 'Category'])\n", (686, 708), False, 'from prettytable import PrettyTable\n'), ((342, 366), 'firebase_admin.db.reference', 'db.reference', (['"""Category"""'], {}), "('Category')\n", (354, 366), False, 'from firebase_admin... |
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
from selenium.webdriver.support import expected_conditions as ec
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.firefox.options import Options
from se... | [
"selenium.webdriver.firefox.firefox_profile.FirefoxProfile",
"selenium.webdriver.support.ui.WebDriverWait",
"selenium.webdriver.support.expected_conditions.invisibility_of_element_located",
"account.check_files_2",
"selenium.webdriver.Firefox",
"time.sleep",
"selenium.webdriver.firefox.options.Options",... | [((514, 523), 'selenium.webdriver.firefox.options.Options', 'Options', ([], {}), '()\n', (521, 523), False, 'from selenium.webdriver.firefox.options import Options\n'), ((564, 580), 'selenium.webdriver.firefox.firefox_profile.FirefoxProfile', 'FirefoxProfile', ([], {}), '()\n', (578, 580), False, 'from selenium.webdriv... |
# Copyright 2020 <NAME>
#
# 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 wr... | [
"qubovert.utils.QUSOMatrix",
"qubovert.PCSO"
] | [((7586, 7598), 'qubovert.utils.QUSOMatrix', 'QUSOMatrix', ([], {}), '()\n', (7596, 7598), False, 'from qubovert.utils import QUSOMatrix\n'), ((7647, 7653), 'qubovert.PCSO', 'PCSO', ([], {}), '()\n', (7651, 7653), False, 'from qubovert import PCSO\n')] |
#!/usr/bin/python
import requests
def check():
data = {}
consumers = requests.get('http://localhost:9000/consumers').json()
for consumer_group in consumers:
consumer_infos = requests.get(
'http://localhost:9000/consumers/{consumer_group}'.format(
consumer_group=cons... | [
"requests.get"
] | [((81, 128), 'requests.get', 'requests.get', (['"""http://localhost:9000/consumers"""'], {}), "('http://localhost:9000/consumers')\n", (93, 128), False, 'import requests\n')] |
from Xlib import X, display
def lock_screen(display: display.Display, screen_nb: int):
screen = display.screen(screen_nb)
root = screen.root
display_width = screen.width_in_pixels
display_height = screen.height_in_pixels
window = root.create_window(0, 0, display_width, display_height,
... | [
"Xlib.display.screen_count",
"Xlib.display.screen",
"Xlib.display.sync"
] | [((102, 127), 'Xlib.display.screen', 'display.screen', (['screen_nb'], {}), '(screen_nb)\n', (116, 127), False, 'from Xlib import X, display\n'), ((1356, 1370), 'Xlib.display.sync', 'display.sync', ([], {}), '()\n', (1368, 1370), False, 'from Xlib import X, display\n'), ((1290, 1312), 'Xlib.display.screen_count', 'disp... |
import torch
import torch.utils.data as data
from glob import glob
from os.path import join, basename, exists
import numpy as np
import pickle as pkl
from random import random
class KETTS76(data.Dataset):
def __init__(self, which_set='train', datapath='/home/thkim/data/KETTS76/bin_22050'):
# Load vocabular... | [
"os.path.exists",
"ipdb.set_trace",
"numpy.random.choice",
"os.path.join",
"numpy.asarray",
"numpy.random.randint",
"os.path.basename",
"glob.glob"
] | [((4439, 4455), 'ipdb.set_trace', 'ipdb.set_trace', ([], {}), '()\n', (4453, 4455), False, 'import ipdb\n'), ((2296, 2323), 'os.path.basename', 'basename', (['self.mellist[idx]'], {}), '(self.mellist[idx])\n', (2304, 2323), False, 'from os.path import join, basename, exists\n'), ((3660, 3678), 'os.path.basename', 'base... |
from django.contrib import admin
from .models import User, Category, Listing, WatchList, Bid, Comment
admin.site.register(User)
admin.site.register(Category)
admin.site.register(WatchList)
class ListingAdmin(admin.ModelAdmin):
list_display = ('title', 'username', 'price', 'status')
admin.site.register(Listing, ... | [
"django.contrib.admin.site.register"
] | [((103, 128), 'django.contrib.admin.site.register', 'admin.site.register', (['User'], {}), '(User)\n', (122, 128), False, 'from django.contrib import admin\n'), ((129, 158), 'django.contrib.admin.site.register', 'admin.site.register', (['Category'], {}), '(Category)\n', (148, 158), False, 'from django.contrib import ad... |
"""Flexible code for histogramming per-snp and per-replica statistics for selected SNPs in selected replicas in
selected scenarios and/or demographies."""
from Operations.Shari_Operations.localize.Scenario import GetScenarios, GetSelectionScenarios
from Operations.MiscUtil import Dict, compile_expr, dbg, Histogrammer... | [
"Operations.Shari_Operations.localize.Scenario.GetScenarios",
"Operations.MiscUtil.dbg",
"matplotlib.pyplot.ylabel",
"Operations.MiscUtil.compile_expr",
"Operations.MiscUtil.ReplaceFileExt",
"itertools.izip",
"Operations.MiscUtil.Dict",
"operator.itemgetter",
"logging.info",
"Operations.Shari_Oper... | [((871, 892), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (885, 892), False, 'import matplotlib\n'), ((4643, 4683), 'Operations.Shari_Operations.localize.Scenario.GetScenarios', 'GetScenarios', (['mutAges', 'mutPops', 'mutFreqs'], {}), '(mutAges, mutPops, mutFreqs)\n', (4655, 4683), False, 'fr... |
import unittest
import torch
from torch.nn import CrossEntropyLoss
from torch.optim import SGD
from avalanche.evaluation.metrics import (
accuracy_metrics,
forgetting_metrics,
loss_metrics
)
from avalanche.training.plugins import EvaluationPlugin
from models import MultiHeadVGGSmall
from strategies.utils ... | [
"avalanche.evaluation.metrics.accuracy_metrics",
"avalanche.evaluation.metrics.forgetting_metrics",
"torch.nn.CrossEntropyLoss",
"models.MultiHeadVGGSmall",
"avalanche.logging.InteractiveLogger",
"avalanche.evaluation.metrics.loss_metrics",
"strategies.utils.create_default_args",
"avalanche.benchmarks... | [((819, 1017), 'strategies.utils.create_default_args', 'create_default_args', (["{'cuda': 0, 'lambda_reg': 2.0, 'alpha': 0.5, 'verbose': True,\n 'learning_rate': 0.005, 'train_mb_size': 200, 'epochs': 70, 'seed': 0,\n 'dataset_root': None}", 'override_args'], {}), "({'cuda': 0, 'lambda_reg': 2.0, 'alpha': 0.5, 'v... |
import logging
import os
import random
import time
import warnings
from collections import OrderedDict
from contextlib import contextmanager
from pathlib import Path
from typing import List, Optional
import cv2
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.nn.functional as F
im... | [
"torch.nn.BatchNorm1d",
"librosa.util.pad_center",
"torch.nn.functional.avg_pool1d",
"torch.sum",
"torch.nn.functional.pad",
"torch.isinf",
"numpy.imag",
"numpy.arange",
"torch.nn.BatchNorm2d",
"torch.nn.init.xavier_uniform_",
"torch.mean",
"torch.nn.functional.avg_pool2d",
"numpy.exp",
"t... | [((9567, 9604), 'torch.nn.init.xavier_uniform_', 'nn.init.xavier_uniform_', (['layer.weight'], {}), '(layer.weight)\n', (9590, 9604), True, 'import torch.nn as nn\n'), ((11300, 11341), 'torch.cat', 'torch.cat', (['(framewise_output, pad)'], {'dim': '(1)'}), '((framewise_output, pad), dim=1)\n', (11309, 11341), False, '... |
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name, too-many-arguments, bad-whitespace
# pylint: disable=too-many-lines, too-many-locals, len-as-condition
# pylint: disable=import-outside-toplevel
"""Copyright 2015 <NAME>.
FilterPy library.
http://github.com/rlabbe/filterpy
Documentation at:
https://filterpy.rea... | [
"numpy.sqrt",
"math.sqrt",
"math.log",
"numpy.array",
"math.exp",
"scipy.stats.norm.cdf",
"numpy.atleast_2d",
"numpy.isscalar",
"random.gammavariate",
"numpy.asarray",
"scipy.stats.norm.interval",
"numpy.dot",
"numpy.linalg.eigh",
"warnings.warn",
"scipy.sparse.linalg.spsolve",
"numpy.... | [((1014, 1070), 'scipy.stats.multivariate_normal.logpdf', 'multivariate_normal.logpdf', (['(1)', '(1)', '(1)'], {'allow_singular': '(True)'}), '(1, 1, 1, allow_singular=True)\n', (1040, 1070), False, 'from scipy.stats import norm, multivariate_normal\n'), ((1685, 1701), 'numpy.atleast_1d', 'np.atleast_1d', (['u'], {}),... |
import msgpack
ASSERT_TEMPLATE = """
(test-group "%(name)s"
(test "unpack" %(chicken_expr)s (unpack/from-blob (byte-blob %(blob)s)))
(test "pack" (pack/to-blob %(chicken_expr)s) (byte-blob %(blob)s)))
"""
def asChickenAssertion(data, chicken_expr=None, name=None):
blob = ' '.join([hex(b).replace('0', '#', 1) for ... | [
"msgpack.dumps"
] | [((325, 344), 'msgpack.dumps', 'msgpack.dumps', (['data'], {}), '(data)\n', (338, 344), False, 'import msgpack\n')] |
'''
Script to pull in set of cif files and make a single dataframe .
@author: pmm
'''
import numpy as np
import os
import sys
sys.path.append('../')
import pyXtal as pxt
from pyXtal.csp_utils.dataset_io import parse_filenames
import pandas as pd
dirs = ['/Users/pmm/Documents/xtal_learning/triptycene/cifs/T2',
... | [
"pyXtal.csp_utils.dataset_io.parse_filenames",
"sys.path.append",
"pandas.concat"
] | [((127, 149), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (142, 149), False, 'import sys\n'), ((758, 775), 'pandas.concat', 'pd.concat', (['frames'], {}), '(frames)\n', (767, 775), True, 'import pandas as pd\n'), ((634, 687), 'pyXtal.csp_utils.dataset_io.parse_filenames', 'parse_filenames', ... |
# -*- coding: utf-8 -*-
#!/usr/bin/env python3
"""
Created on Tue Oct 16 14:53:15 2018
@author: yansl
Note:
synthesize the whole procedure
"""
import os
import shutil
import gc
import cv2
import time
import mask_maker
import image_fill
import discreteness_boundary_repair
import filter_enhanc... | [
"mask_maker.border_cropping",
"image_fill.reflection_symmetry",
"mask_maker.border_adding",
"filter_enhancement.usm_enhancement",
"mask_maker.FOV_adjustment",
"image_fill.circle_fill",
"filter_enhancement.filter_enhancement",
"os.path.exists",
"os.listdir",
"os.path.split",
"os.path.isdir",
"m... | [((422, 433), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (431, 433), False, 'import os\n'), ((892, 945), 'cv2.imwrite', 'cv2.imwrite', (['(folder_name + image_name + postfix)', 'file'], {}), '(folder_name + image_name + postfix, file)\n', (903, 945), False, 'import cv2\n'), ((1012, 1023), 'time.time', 'time.time', ([]... |
import tensorflow as tf
from dltk.core.activations import leaky_relu
import numpy as np
def test_leaky_relu():
test_alpha = tf.constant(0.1)
test_inp_1 = tf.constant(1.)
test_inp_2 = tf.constant(-1.)
test_relu_1 = leaky_relu(test_inp_1, test_alpha)
test_relu_2 = leaky_relu(test_inp_2, test_alpha)... | [
"tensorflow.Session",
"tensorflow.constant",
"numpy.isclose",
"dltk.core.activations.leaky_relu"
] | [((130, 146), 'tensorflow.constant', 'tf.constant', (['(0.1)'], {}), '(0.1)\n', (141, 146), True, 'import tensorflow as tf\n'), ((164, 180), 'tensorflow.constant', 'tf.constant', (['(1.0)'], {}), '(1.0)\n', (175, 180), True, 'import tensorflow as tf\n'), ((197, 214), 'tensorflow.constant', 'tf.constant', (['(-1.0)'], {... |
import collections
import typing
from . import tags
from .iterators import chunked_iterable
from .models import Project
def list_cluster_arns_in_account(ecs_client):
"""
Generates the ARN of every ECS cluster in an account.
"""
paginator = ecs_client.get_paginator("list_clusters")
for page in pa... | [
"collections.defaultdict"
] | [((4927, 4956), 'collections.defaultdict', 'collections.defaultdict', (['dict'], {}), '(dict)\n', (4950, 4956), False, 'import collections\n')] |
# -*- coding: utf-8 -*-
#!/usr/bin/env python
import sys
import os
import subprocess
import pyttsx
from gtts import gTTS
import readchar
from PIL import Image
ordinals = ["primera", "segona", "tercera", "quarta", "cinquena", "sisena", "setena", "vuitena", "novena", "desena"]
def digues(frase):
tts = gTTS(text=fra... | [
"subprocess.Popen",
"readchar.readchar",
"gtts.gTTS",
"sys.exit",
"os.system"
] | [((307, 334), 'gtts.gTTS', 'gTTS', ([], {'text': 'frase', 'lang': '"""ca"""'}), "(text=frase, lang='ca')\n", (311, 334), False, 'from gtts import gTTS\n'), ((365, 415), 'os.system', 'os.system', (['"""vlc --play-and-exit --quiet frase.mp3"""'], {}), "('vlc --play-and-exit --quiet frase.mp3')\n", (374, 415), False, 'imp... |
from django.conf import settings
from django.conf.urls import include
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path
urlpatterns = [
path('', include('apps.sitio.urls', namespace='sitio')),
]
if settings.DEBUG:
urlpatterns += static(settings.STATIC_UR... | [
"django.conf.urls.include",
"django.conf.urls.static.static"
] | [((295, 358), 'django.conf.urls.static.static', 'static', (['settings.STATIC_URL'], {'document_root': 'settings.STATIC_ROOT'}), '(settings.STATIC_URL, document_root=settings.STATIC_ROOT)\n', (301, 358), False, 'from django.conf.urls.static import static\n'), ((378, 439), 'django.conf.urls.static.static', 'static', (['s... |
import os
import pandas as pd
from rivm_loader import rivm
from constants import CoronaConstants
import datetime as dt
from mobility_seir import *
import copy
'''
Create forecasts without confidence intervals.
Always check for inclusion of mobility or not!!!
'''
fn = os.path.join(os.path.dirname(__file__), 'data/CO... | [
"rivm_loader.rivm.SEI2R2_init",
"constants.CoronaConstants",
"pandas.read_csv",
"datetime.datetime.strptime",
"os.path.dirname",
"rivm_loader.rivm.rivm_corona",
"rivm_loader.rivm.date2mmdd",
"pandas.DataFrame",
"datetime.timedelta",
"pandas.read_json"
] | [((581, 626), 'datetime.datetime.strptime', 'dt.datetime.strptime', (['start_date', 'date_format'], {}), '(start_date, date_format)\n', (601, 626), True, 'import datetime as dt\n'), ((644, 687), 'datetime.datetime.strptime', 'dt.datetime.strptime', (['end_date', 'date_format'], {}), '(end_date, date_format)\n', (664, 6... |
"""empty message
Revision ID: <KEY>
Revises: <PASSWORD>
Create Date: 2019-06-20 16:08:32.621912
"""
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():
# ### commands auto ... | [
"sqlalchemy.ForeignKeyConstraint",
"alembic.op.drop_table",
"alembic.op.f",
"sqlalchemy.PrimaryKeyConstraint",
"sqlalchemy.Integer",
"sqlalchemy.String"
] | [((1013, 1048), 'alembic.op.drop_table', 'op.drop_table', (['"""predictor_category"""'], {}), "('predictor_category')\n", (1026, 1048), False, 'from alembic import op\n'), ((573, 632), 'sqlalchemy.ForeignKeyConstraint', 'sa.ForeignKeyConstraint', (["['predictor_id']", "['predictor.id']"], {}), "(['predictor_id'], ['pre... |
import yaml
from util import AttrDict
class SchemaOrField(object):
def __init__(self, optional=False, default=None):
self.optional = optional
self.default = default
def is_optional(self):
return self.optional
def keyify(self, parents, key=None):
if key is not None:
parents = parents + [key]
return "... | [
"util.AttrDict"
] | [((2935, 2954), 'util.AttrDict', 'AttrDict', (['succeeded'], {}), '(succeeded)\n', (2943, 2954), False, 'from util import AttrDict\n')] |
# -*- coding: utf-8 -*-
from watson.routing import routers
from pytest import raises
from tests.watson.routing.support import sample_request
class TestDict(object):
def test_create(self):
router = routers.Dict()
assert router
assert repr(router) == '<watson.routing.routers.Dict routes:0>'
... | [
"watson.routing.routers.List",
"watson.routing.routers.Dict",
"watson.routing.routers.Choice",
"pytest.raises",
"tests.watson.routing.support.sample_request"
] | [((211, 225), 'watson.routing.routers.Dict', 'routers.Dict', ([], {}), '()\n', (223, 225), False, 'from watson.routing import routers\n'), ((382, 419), 'watson.routing.routers.Dict', 'routers.Dict', (["{'home': {'path': '/'}}"], {}), "({'home': {'path': '/'}})\n", (394, 419), False, 'from watson.routing import routers\... |
# Copyright 2017 DataCentred Ltd
#
# 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 ag... | [
"sentinel.tests.functional.base.FederatedUserClient",
"sentinel.tests.functional.client_fixtures.Server",
"sentinel.tests.functional.client_fixtures.UserProjectGrant"
] | [((1012, 1077), 'sentinel.tests.functional.base.FederatedUserClient', 'base.FederatedUserClient', (['grant.user.entity', 'grant.project.entity'], {}), '(grant.user.entity, grant.project.entity)\n', (1036, 1077), False, 'from sentinel.tests.functional import base\n'), ((953, 993), 'sentinel.tests.functional.client_fixtu... |
from django.apps import AppConfig
from django.db.models.signals import post_migrate
import logging
LOGGER = logging.getLogger(__name__)
def start_reminder_email_task(sender, **kwargs):
from .tasks import send_reminder_email, send_queued_mail, update_registration_status
# reminder emails are scheduled to run... | [
"logging.getLogger",
"django.db.models.signals.post_migrate.connect"
] | [((109, 136), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (126, 136), False, 'import logging\n'), ((827, 887), 'django.db.models.signals.post_migrate.connect', 'post_migrate.connect', (['start_reminder_email_task'], {'sender': 'self'}), '(start_reminder_email_task, sender=self)\n', (84... |
import argparse
import penman
from amrlib.evaluate.smatch_enhanced import compute_smatch
from ensemble.utils import align, get_entries
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Graph Ensemble (Graphene)')
parser.add_argument(
'-g', '--gold', default='./datasets/spring_g... | [
"penman.decode",
"argparse.ArgumentParser",
"amrlib.evaluate.smatch_enhanced.compute_smatch",
"ensemble.utils.align",
"ensemble.utils.get_entries"
] | [((178, 242), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Graph Ensemble (Graphene)"""'}), "(description='Graph Ensemble (Graphene)')\n", (201, 242), False, 'import argparse\n'), ((703, 725), 'ensemble.utils.get_entries', 'get_entries', (['ref_fname'], {}), '(ref_fname)\n', (714, 725)... |
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
class Participant(db.Model):
id = db.Column(db.Integer, primary_key=True)
firstname = db.Column(db.String(80), nullable=False)
lastname = db.Column(db.String(80), nullable=False)
classname = db.Column(db.String(7), nullable=False)
email_... | [
"flask_sqlalchemy.SQLAlchemy"
] | [((48, 60), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', ([], {}), '()\n', (58, 60), False, 'from flask_sqlalchemy import SQLAlchemy\n')] |
# -*- encoding: utf-8 -*-
"""
@File : views.py
@Time : 2020/4/11 14:04
@Author : chise
@Email : <EMAIL>
@Software: PyCharm
@info :
"""
import math
from datetime import datetime
from typing import Dict
from fastapi import APIRouter, Query, Depends
from sqlalchemy import select, func, insert
from fastapi_ad... | [
"fastapi_admin.AdminDatabase",
"sqlalchemy.func.count",
"math.ceil",
"sqlalchemy.insert",
"fastapi_admin.auth.depends.create_current_active_user",
"fastapi_admin.views.methods_get.model_get_list_func",
"fastapi.APIRouter",
"fastapi.Query",
"fastapi.Depends",
"fastapi_admin.views.methods_post.model... | [((585, 596), 'fastapi.APIRouter', 'APIRouter', ([], {}), '()\n', (594, 596), False, 'from fastapi import APIRouter, Query, Depends\n'), ((774, 800), 'fastapi_admin.views.methods_get.model_get_list_func', 'model_get_list_func', (['Order'], {}), '(Order)\n', (793, 800), False, 'from fastapi_admin.views.methods_get impor... |
#
# Copyright (c) 2021 IBM Corp.
# 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 writi... | [
"numpy.array",
"numpy.empty_like"
] | [((5071, 5104), 'numpy.empty_like', 'np.empty_like', (['old_ids'], {'dtype': 'int'}), '(old_ids, dtype=int)\n', (5084, 5104), True, 'import numpy as np\n'), ((9024, 9052), 'numpy.array', 'np.array', (['int_ids'], {'dtype': 'int'}), '(int_ids, dtype=int)\n', (9032, 9052), True, 'import numpy as np\n')] |
# ------------------------------------------------------------------------------
# Copyright 2018 <NAME> and <NAME>
#
# 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.o... | [
"logging.getLogger",
"protobuf.asset_pb2.AssetCandidates",
"protobuf.setting_pb2.Settings",
"protobuf.asset_pb2.AssetVote",
"protobuf.asset_pb2.AssetPayload",
"sawtooth_sdk.processor.exceptions.InvalidTransaction",
"protobuf.asset_pb2.Asset",
"protobuf.asset_pb2.AssetCandidate.VoteRecord",
"modules.... | [((1219, 1246), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1236, 1246), False, 'import logging\n'), ((10687, 10697), 'protobuf.setting_pb2.Settings', 'Settings', ([], {}), '()\n', (10695, 10697), False, 'from protobuf.setting_pb2 import Settings\n'), ((10932, 10949), 'protobuf.asset_... |
import datetime
from pyshark import FileCapture
from srsran_controller.uu_events.factory import EventsFactory
from srsran_controller.uu_events.gsm_sms_submit import GSM_SMS_SUBMIT_NAME
GSM_SMS_SUBMIT_PCAP_DATA = (
'0a0d0d0ab80000004d3c2b1a01000000ffffffffffffffff02003500496e74656c28522920436f726528544d292069372d... | [
"datetime.datetime",
"srsran_controller.uu_events.factory.EventsFactory"
] | [((2884, 2932), 'datetime.datetime', 'datetime.datetime', (['(2021)', '(9)', '(1)', '(19)', '(40)', '(56)', '(27320)'], {}), '(2021, 9, 1, 19, 40, 56, 27320)\n', (2901, 2932), False, 'import datetime\n'), ((2605, 2620), 'srsran_controller.uu_events.factory.EventsFactory', 'EventsFactory', ([], {}), '()\n', (2618, 2620)... |
"""
Semantic operations.
outliers
create_or_update_out_of_the_bbox,
create_or_update_gps_deactivated_signal,
create_or_update_gps_jump,
create_or_update_short_trajectory,
create_or_update_gps_block_signal,
filter_block_signal_by_repeated_amount_of_points,
filter_block_signal_by_time,
filter_longer_time_to_stop_segment... | [
"pymove.preprocessing.filters.by_bbox",
"pymove.preprocessing.stay_point_detection.create_or_update_move_stop_by_dist_time",
"pymove.utils.log.logger.debug",
"pymove.utils.log.logger.warning",
"pymove.preprocessing.segmentation.by_max_dist",
"numpy.concatenate",
"pymove.preprocessing.segmentation.by_dis... | [((2615, 2659), 'numpy.concatenate', 'np.concatenate', (['[idx_start, idx_end]'], {'axis': '(0)'}), '([idx_start, idx_end], axis=0)\n', (2629, 2659), True, 'import numpy as np\n'), ((5895, 5986), 'pymove.utils.log.logger.debug', 'logger.debug', (['"""\nCreate or update boolean feature to detect points out of the bbox""... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import pytest
from textacy import Corpus
from textacy import Doc
from textacy import cache
from textacy import compat
from textacy import io
from textacy.datasets.capitol_words import CapitolWords
DATASET = CapitolWords()
pytestmark = ... | [
"textacy.Corpus",
"textacy.cache.load_spacy",
"textacy.Doc",
"textacy.Corpus.load",
"pytest.raises",
"pytest.mark.skipif",
"pytest.fixture",
"textacy.datasets.capitol_words.CapitolWords"
] | [((291, 305), 'textacy.datasets.capitol_words.CapitolWords', 'CapitolWords', ([], {}), '()\n', (303, 305), False, 'from textacy.datasets.capitol_words import CapitolWords\n'), ((320, 440), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(DATASET.filename is None)'], {'reason': '"""CapitolWords dataset must be downloaded... |
from django.core.urlresolvers import reverse
from mock import patch
from sentry.constants import MEMBER_ADMIN
from sentry.models import Team, TeamStatus
from sentry.testutils import APITestCase
class TeamDetailsTest(APITestCase):
def test_simple(self):
team = self.team # force creation
self.logi... | [
"sentry.models.Team.objects.get",
"mock.patch",
"django.core.urlresolvers.reverse"
] | [((2482, 2536), 'mock.patch', 'patch', (['"""sentry.api.endpoints.team_details.delete_team"""'], {}), "('sentry.api.endpoints.team_details.delete_team')\n", (2487, 2536), False, 'from mock import patch\n'), ((355, 420), 'django.core.urlresolvers.reverse', 'reverse', (['"""sentry-api-0-team-details"""'], {'kwargs': "{'t... |
import gzip
import glob
import argparse
import sys
def merge():
with gzip.open("ngram.merged.txt.gz", 'w') as file_write_handler:
files = glob.glob("pubmed*.txt.gz")
for current_file in files:
print("processing: {}".format(current_file))
with gzip.open(current_file, 'rb') ... | [
"glob.glob",
"gzip.open"
] | [((75, 112), 'gzip.open', 'gzip.open', (['"""ngram.merged.txt.gz"""', '"""w"""'], {}), "('ngram.merged.txt.gz', 'w')\n", (84, 112), False, 'import gzip\n'), ((153, 180), 'glob.glob', 'glob.glob', (['"""pubmed*.txt.gz"""'], {}), "('pubmed*.txt.gz')\n", (162, 180), False, 'import glob\n'), ((636, 677), 'gzip.open', 'gzip... |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# <NAME> wrote this file. As long as you retain
# this notice you can do whatever you want with this stuff. If we meet some day,
# and you think this stuff is worth it, you ca... | [
"requests.post",
"requests.get",
"time.sleep",
"os.path.isfile",
"platform.system",
"subprocess.call",
"sys.exit",
"re.search"
] | [((1824, 1877), 'requests.post', 'requests.post', (["('http://' + hostname + '/pgmmega/sync')"], {}), "('http://' + hostname + '/pgmmega/sync')\n", (1837, 1877), False, 'import requests\n'), ((2600, 2688), 'requests.post', 'requests.post', (["('http://' + hostname + '/pgmmega/upload')"], {'data': 'hex_file', 'timeout':... |
from datetime import datetime
from book_manage import db, login_manager
from flask_login import UserMixin
@login_manager.user_loader
def load_user(user_id):
return Admin.query.get(int(user_id))
# This class to hold Admins who uploads books.
class Admin(db.Model, UserMixin):
id = db.Column(db.Integer, prima... | [
"book_manage.db.ForeignKey",
"book_manage.db.relationship",
"book_manage.db.String",
"book_manage.db.Column"
] | [((293, 332), 'book_manage.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (302, 332), False, 'from book_manage import db, login_manager\n'), ((565, 619), 'book_manage.db.relationship', 'db.relationship', (['"""Uploaded"""'], {'backref': '"""auth"""', 'lazy': '(... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-08-22 14:31
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cards', '0003_session_revision'),
]
operations = [
migrations.AlterField(
... | [
"django.db.models.DateTimeField"
] | [((403, 471), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)', 'verbose_name': '"""Date created"""'}), "(auto_now_add=True, verbose_name='Date created')\n", (423, 471), False, 'from django.db import migrations, models\n'), ((601, 666), 'django.db.models.DateTimeField', 'models.D... |
from typing import List
import os
"""
Event counter. Is counted up for each new event (row in CSV file) generated.
"""
event_count = 0
"""
Counting commands being issued. Used as second argument
to events (the 'nr'). First generated will be 0.
"""
command_counter: int = 0
"""
The file written to.
"""
file = None
d... | [
"os.system"
] | [((3565, 3589), 'os.system', 'os.system', (['"""rm log*.csv"""'], {}), "('rm log*.csv')\n", (3574, 3589), False, 'import os\n'), ((3464, 3493), 'os.system', 'os.system', (['f"""rm {d}/log*.csv"""'], {}), "(f'rm {d}/log*.csv')\n", (3473, 3493), False, 'import os\n'), ((3502, 3531), 'os.system', 'os.system', (['f"""cp lo... |
#!/usr/bin/python
# ex:set fileencoding=utf-8:
from __future__ import unicode_literals
from django.conf.urls import patterns
# from django.conf.urls import url
from django.contrib.admin.sites import AlreadyRegistered
from django.core.exceptions import ImproperlyConfigured
from django.utils import six
from django.util... | [
"logging.getLogger",
"django.utils.text.slugify",
"collections.OrderedDict",
"django.utils.six.with_metaclass",
"re.match",
"django.contrib.admin.sites.AlreadyRegistered",
"django.conf.urls.patterns",
"django.core.exceptions.ImproperlyConfigured"
] | [((447, 474), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (464, 474), False, 'import logging\n'), ((1771, 1817), 'django.utils.six.with_metaclass', 'six.with_metaclass', (['DashboardMetaclass', 'object'], {}), '(DashboardMetaclass, object)\n', (1789, 1817), False, 'from django.utils im... |
# -*- coding: utf-8 -*-
# Copyright 2018, IBM.
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
import os
from qiskit import *
import numpy as np
import time
import itertools
import math
from random import *
def inner_pr... | [
"numpy.eye",
"numpy.concatenate"
] | [((2266, 2294), 'numpy.eye', 'np.eye', (['dimension', 'dimension'], {}), '(dimension, dimension)\n', (2272, 2294), True, 'import numpy as np\n'), ((3185, 3228), 'numpy.concatenate', 'np.concatenate', (['[first_array, second_array]'], {}), '([first_array, second_array])\n', (3199, 3228), True, 'import numpy as np\n')] |
import random
keepplaying = True
while keepplaying == True:
myInput = input("Bet your color Type: Red or Black:")
myInput = myInput.lower()
computerInput = random.randint(1,2)
if computerInput == 1:
computerSelection = "red"
elif computerInput == 2:
computerSelection = "black"
if computerSe... | [
"random.randint"
] | [((165, 185), 'random.randint', 'random.randint', (['(1)', '(2)'], {}), '(1, 2)\n', (179, 185), False, 'import random\n')] |
#########################################################################################
# Convert Jupyter notebook from Step 1 into Python script with a function called scrape
# that will execute all scraping code and return one Python dictionary containing
# all of the scraped data.
############################... | [
"bs4.BeautifulSoup",
"pandas.read_html",
"requests.get"
] | [((1549, 1566), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (1561, 1566), False, 'import requests\n'), ((1580, 1612), 'bs4.BeautifulSoup', 'bs', (['response.text', '"""html.parser"""'], {}), "(response.text, 'html.parser')\n", (1582, 1612), True, 'from bs4 import BeautifulSoup as bs\n'), ((2160, 2185), 'r... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-08 16:13
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('medicos', '0001_initial'),
('pacientes', '0005_auto... | [
"django.db.models.ForeignKey"
] | [((473, 571), 'django.db.models.ForeignKey', 'models.ForeignKey', ([], {'null': '(True)', 'on_delete': 'django.db.models.deletion.PROTECT', 'to': '"""medicos.Medico"""'}), "(null=True, on_delete=django.db.models.deletion.PROTECT,\n to='medicos.Medico')\n", (490, 571), False, 'from django.db import migrations, models... |
__all__ = ["SequenceEmbedder"]
from os import PathLike
from pathlib import Path
from typing import List, Tuple
import esm
import torch
from sklearn.decomposition import PCA
from torch.utils.data import DataLoader
from src.path import ROOT_PATH
PCA_PATH = Path(ROOT_PATH, "data", "processed", "pca_train.pt")
class ... | [
"esm.FastaBatchedDataset.from_file",
"pathlib.Path",
"torch.load",
"esm.pretrained.load_model_and_alphabet",
"torch.no_grad",
"torch.zeros"
] | [((259, 311), 'pathlib.Path', 'Path', (['ROOT_PATH', '"""data"""', '"""processed"""', '"""pca_train.pt"""'], {}), "(ROOT_PATH, 'data', 'processed', 'pca_train.pt')\n", (263, 311), False, 'from pathlib import Path\n'), ((900, 915), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (913, 915), False, 'import torch\n'),... |
import sys
def solution(n, r, c):
if n == 0:
return 0
return 2 * (r % 2) + (c % 2) + 4 * solution(n - 1, int(r / 2), int(c / 2))
if __name__ == "__main__":
n, r, c = map(int, sys.stdin.readline().split())
print(solution(n, r, c))
| [
"sys.stdin.readline"
] | [((199, 219), 'sys.stdin.readline', 'sys.stdin.readline', ([], {}), '()\n', (217, 219), False, 'import sys\n')] |
import csv
import six
DAYS = ('mon', 'tue', 'wed', 'thu', 'fri')
SQUARE_DAYS = ('mon', 'tue', 'wed')
DOUBLE_DAYS = ('thu', 'fri')
DAY_TO_NUMBER = {day: i for i, day in enumerate(DAYS)}
NUMBER_TO_DAY = {i: day for i, day in enumerate(DAYS)}
def parse_week(filename):
"""
We open an input filename, parse it ... | [
"six.moves.xrange",
"six.iteritems",
"csv.DictReader"
] | [((840, 858), 'six.iteritems', 'six.iteritems', (['row'], {}), '(row)\n', (853, 858), False, 'import six\n'), ((1716, 1740), 'six.iteritems', 'six.iteritems', (['week_data'], {}), '(week_data)\n', (1729, 1740), False, 'import six\n'), ((423, 447), 'csv.DictReader', 'csv.DictReader', (['csv_file'], {}), '(csv_file)\n', ... |
# Generated by Django 3.1.13 on 2021-11-28 12:45
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
op... | [
"django.db.models.OneToOneField",
"django.db.models.DateField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.BooleanField",
"django.db.models.AutoField",
"django.db.models.DateTimeField",
"django.db.migrations.swappable_dependency",
"django.db.models.CharField"
] | [((248, 305), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (279, 305), False, 'from django.db import migrations, models\n'), ((446, 539), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)... |
import bisect
import copy
import hashlib
import itertools
import json
import operator
import time
from collections import ChainMap
import pmdefaults as PM
from pmdefaults import *
from policy import NEATProperty, PropertyArray, PropertyMultiArray, ImmutablePropertyError, term_separator
CIB_EXPIRED = 2
class CIBEntr... | [
"operator.attrgetter",
"json.loads",
"copy.deepcopy",
"policy.term_separator",
"json.dumps",
"itertools.product",
"collections.ChainMap",
"policy.PropertyArray.from_dict",
"policy.PropertyMultiArray",
"bisect.bisect",
"policy.NEATProperty",
"time.time",
"json.load",
"policy.PropertyArray"
... | [((16694, 16709), 'policy.PropertyArray', 'PropertyArray', ([], {}), '()\n', (16707, 16709), False, 'from policy import NEATProperty, PropertyArray, PropertyMultiArray, ImmutablePropertyError, term_separator\n'), ((16918, 16946), 'json.loads', 'json.loads', (['test_request_str'], {}), '(test_request_str)\n', (16928, 16... |
import py
import os, sys
from py.__.io import terminalwriter
def skip_win32():
if sys.platform == 'win32':
py.test.skip('Not relevant on win32')
def test_terminalwriter_computes_width():
py.magic.patch(terminalwriter, 'get_terminal_width', lambda: 42)
try:
tw = py.io.TerminalWriter()
... | [
"py.std.cStringIO.StringIO",
"py.test.raises",
"os.environ.get",
"py.magic.revert",
"py.magic.patch",
"py.io.TerminalWriter",
"py.test.skip"
] | [((206, 271), 'py.magic.patch', 'py.magic.patch', (['terminalwriter', '"""get_terminal_width"""', '(lambda : 42)'], {}), "(terminalwriter, 'get_terminal_width', lambda : 42)\n", (220, 271), False, 'import py\n'), ((484, 548), 'py.magic.patch', 'py.magic.patch', (['terminalwriter', '"""_getdimensions"""', '(lambda : 0 /... |
#!/usr/bin/python3
from sys import argv, stdin
from matplotlib import pyplot as plt
def main( argc, argv ):
exec, coords, x, y, radius = argv
x, y, radius = float( x ), float( y ), float( radius )
stdin = open( coords, 'r' )
X = []
Y = []
for line in stdin.readlines():
x, y = map( lambda v: float( v ... | [
"matplotlib.pyplot.Circle",
"matplotlib.pyplot.plot",
"sys.stdin.readlines",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((264, 281), 'sys.stdin.readlines', 'stdin.readlines', ([], {}), '()\n', (279, 281), False, 'from sys import argv, stdin\n'), ((399, 413), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (411, 413), True, 'from matplotlib import pyplot as plt\n'), ((416, 440), 'matplotlib.pyplot.plot', 'plt.plot', (['[... |
# -*- coding: utf-8 -*-
__author__ = 'fyabc'
from flask.ext.wtf import Form
from wtforms import StringField, SubmitField, SelectField, PasswordField, IntegerField
from wtforms.validators import DataRequired, NumberRange, Length
# Local modules.
from config import TableNames
class SignInForm(Form):
userID = Str... | [
"wtforms.validators.NumberRange",
"wtforms.SubmitField",
"wtforms.StringField",
"wtforms.validators.Length",
"wtforms.SelectField",
"wtforms.validators.DataRequired"
] | [((555, 572), 'wtforms.SubmitField', 'SubmitField', (['"""注册"""'], {}), "('注册')\n", (566, 572), False, 'from wtforms import StringField, SubmitField, SelectField, PasswordField, IntegerField\n'), ((609, 660), 'wtforms.SelectField', 'SelectField', (['"""查询类型"""'], {'coerce': 'str', 'choices': 'TableNames'}), "('查询类型', c... |
import htmllistparse as ftp
from epivizfileserver.parser import BigWig
from joblib import Parallel, delayed
import struct
import pandas
import json
import pickle
url = "https://egg2.wustl.edu/roadmap/data/byFileType/signal/consolidated/macs2signal/foldChange/"
cwd, files = ftp.fetch_listing(url)
print("total files - ... | [
"pickle.dump",
"epivizfileserver.parser.BigWig",
"htmllistparse.fetch_listing",
"joblib.Parallel",
"struct.unpack",
"pandas.DataFrame",
"joblib.delayed"
] | [((275, 297), 'htmllistparse.fetch_listing', 'ftp.fetch_listing', (['url'], {}), '(url)\n', (292, 297), True, 'import htmllistparse as ftp\n'), ((423, 450), 'epivizfileserver.parser.BigWig', 'BigWig', (['(baseurl + file.name)'], {}), '(baseurl + file.name)\n', (429, 450), False, 'from epivizfileserver.parser import Big... |
from os import stat
from django.contrib.auth import get_user_model
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.utils.encoding import smart_str, smart_bytes
from django.utils.http import urlsafe_base64_decode, urlsafe_base64_encode
from django.test.utils import override_settings
from r... | [
"django.contrib.auth.get_user_model",
"django.contrib.auth.tokens.PasswordResetTokenGenerator",
"decouple.config",
"django.utils.encoding.smart_bytes",
"rest_framework.reverse.reverse"
] | [((605, 621), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (619, 621), False, 'from django.contrib.auth import get_user_model\n'), ((777, 809), 'rest_framework.reverse.reverse', 'reverse', (['"""users:login_via_email"""'], {}), "('users:login_via_email')\n", (784, 809), False, 'from rest_fr... |
# -*- coding: utf-8 -*-
"""Copyright 2015 <NAME>.
Code supporting the book
Kalman and Bayesian Filters in Python
https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python
This is licensed under an MIT license. See the LICENSE.txt file
for more information.
"""
from __future__ import (absolut... | [
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.plot",
"numpy.array",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.ion",
"matplotlib.pyplot.pause",
"numpy.random.randn"
] | [((747, 765), 'numpy.array', 'np.array', (['[20, 20]'], {}), '([20, 20])\n', (755, 765), True, 'import numpy as np\n'), ((826, 846), 'numpy.array', 'np.array', (['[0.0, 0.0]'], {}), '([0.0, 0.0])\n', (834, 846), True, 'import numpy as np\n'), ((850, 877), 'matplotlib.pyplot.plot', 'plt.plot', (['pf'], {'weights': '(Fal... |
import setuptools
setuptools.setup(
name='pipns',
version='0.0.12',
author='<NAME>',
author_email='<EMAIL>',
url='https://github.com/nvllsvm/pipns',
license='MIT',
packages=['pipns'],
entry_points={'console_scripts': ['pipns=pipns.__main__:main']},
package_data={'pipns': ['scripts/*... | [
"setuptools.setup"
] | [((19, 362), 'setuptools.setup', 'setuptools.setup', ([], {'name': '"""pipns"""', 'version': '"""0.0.12"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https://github.com/nvllsvm/pipns"""', 'license': '"""MIT"""', 'packages': "['pipns']", 'entry_points': "{'console_scripts': ['pipns=pipns.__m... |
from PyQt5.QtWidgets import QWidget, QLabel, QLineEdit, QComboBox, QGroupBox, QPushButton, QGridLayout
from PyQt5.QtGui import QFont, QFontMetrics
from PyQt5 import QtGui
from json_appdata import *
import utils
labels = []
lineEdits = {}
jsonFile = 'supplier_parameter_mapping.json'
class ParameterMappin... | [
"PyQt5.QtWidgets.QComboBox",
"PyQt5.QtWidgets.QGridLayout",
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QPushButton",
"PyQt5.QtWidgets.QLineEdit",
"PyQt5.QtGui.QGuiApplication.font"
] | [((1390, 1403), 'PyQt5.QtWidgets.QGridLayout', 'QGridLayout', ([], {}), '()\n', (1401, 1403), False, 'from PyQt5.QtWidgets import QWidget, QLabel, QLineEdit, QComboBox, QGroupBox, QPushButton, QGridLayout\n'), ((1480, 1505), 'PyQt5.QtWidgets.QLabel', 'QLabel', (['"""Database Table:"""'], {}), "('Database Table:')\n", (... |
import os
import cv2
import numpy as np
import torch
import pickle
import argparse
from configs import paths
from utils.cam_utils import perspective_project_torch
from models.smpl_official import SMPL
def rotate_2d(pt_2d, rot_rad):
x = pt_2d[0]
y = pt_2d[1]
sn, cs = np.sin(rot_rad), np.cos(rot_rad)
... | [
"torch.from_numpy",
"numpy.array",
"torch.cuda.is_available",
"numpy.sin",
"numpy.savez",
"argparse.ArgumentParser",
"os.path.isdir",
"pickle.load",
"os.path.isfile",
"numpy.cos",
"cv2.imread",
"cv2.imwrite",
"utils.cam_utils.perspective_project_torch",
"os.path.join",
"numpy.sum",
"nu... | [((377, 413), 'numpy.array', 'np.array', (['[xx, yy]'], {'dtype': 'np.float32'}), '([xx, yy], dtype=np.float32)\n', (385, 413), True, 'import numpy as np\n'), ((632, 643), 'numpy.zeros', 'np.zeros', (['(2)'], {}), '(2)\n', (640, 643), True, 'import numpy as np\n'), ((1018, 1072), 'numpy.array', 'np.array', (['[dst_w * ... |
# @Author : FederalLab
# @Date : 2021-09-26 11:03:42
# @Last Modified by : <NAME>
# @Last Modified time: 2021-09-26 11:03:42
# Copyright (c) FederalLab. All rights reserved.
import argparse
import json
import os
import time
import openfed
import torch
from torch.utils.data import DataLoader
f... | [
"torch.cuda.device_count",
"time.sleep",
"torch.cuda.is_available",
"openfed.Meta",
"openfed.utils.seed_everything",
"argparse.ArgumentParser",
"openfed.data.DirichletPartitioner",
"openfed.optim.ScaffoldOptimizer",
"openfed.optim.FederatedOptimizer",
"openfed.federated.FederatedProperties.load",
... | [((514, 558), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""benchmark-lightly"""'], {}), "('benchmark-lightly')\n", (537, 558), False, 'import argparse\n'), ((5314, 5368), 'openfed.federated.FederatedProperties.load', 'openfed.federated.FederatedProperties.load', (['args.props'], {}), '(args.props)\n', (5... |
import os
import asyncio
import logging
from contextlib import suppress
import discord
from discord.ext import commands
import aiohttp
import config
from cogs.utils.database import Database
log = logging.getLogger("discord")
log.setLevel(logging.WARNING)
handler = logging.FileHandler(filename="disc... | [
"logging.getLogger",
"discord.ext.commands.when_mentioned_or",
"discord.AllowedMentions",
"discord.Game",
"logging.Formatter",
"os.scandir",
"cogs.utils.database.Database",
"discord.Intents.all",
"aiohttp.ClientTimeout",
"logging.FileHandler",
"contextlib.suppress",
"asyncio.get_event_loop"
] | [((213, 241), 'logging.getLogger', 'logging.getLogger', (['"""discord"""'], {}), "('discord')\n", (230, 241), False, 'import logging\n'), ((286, 357), 'logging.FileHandler', 'logging.FileHandler', ([], {'filename': '"""discord.log"""', 'encoding': '"""utf-8"""', 'mode': '"""a"""'}), "(filename='discord.log', encoding='... |
from django.contrib import admin
from django.contrib.contenttypes.admin import GenericTabularInline
from .models import (Response, Survey, Question,
Answer, Report, Attachment, MapNode)
from import_export.admin import ImportExportActionModelAdmin
class QuestionInline(admin.TabularInline):
mo... | [
"django.contrib.admin.register"
] | [((523, 545), 'django.contrib.admin.register', 'admin.register', (['Survey'], {}), '(Survey)\n', (537, 545), False, 'from django.contrib import admin\n'), ((808, 832), 'django.contrib.admin.register', 'admin.register', (['Response'], {}), '(Response)\n', (822, 832), False, 'from django.contrib import admin\n'), ((1135,... |
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 6 10:59:16 2019
@author: WEIKANG
"""
import numpy as np
import copy
# import torch
import random
# from Calculate import get_1_norm#, get_2_norm, inner_product, avg_grads
def noise_add(noise_scale, w):
w_noise = copy.deepcopy(w)
if isinstance(w[0], np.ndarray... | [
"copy.deepcopy"
] | [((269, 285), 'copy.deepcopy', 'copy.deepcopy', (['w'], {}), '(w)\n', (282, 285), False, 'import copy\n'), ((1063, 1079), 'copy.deepcopy', 'copy.deepcopy', (['w'], {}), '(w)\n', (1076, 1079), False, 'import copy\n')] |
#!/usr/bin/env python
# _*_ coding: utf-8 _*_
# @author: Drizzle_Zhang
# @file: cufflinks.py
# @time: 2018/10/24 20:14
from time import time
from argparse import ArgumentParser
import os
import subprocess
def cufflinks(bam_path, cufflinks_out, process=3, thread=10):
# read samples from results of ... | [
"os.path.join",
"os.listdir",
"time.time",
"argparse.ArgumentParser"
] | [((342, 362), 'os.listdir', 'os.listdir', (['bam_path'], {}), '(bam_path)\n', (352, 362), False, 'import os\n'), ((1242, 1268), 'os.listdir', 'os.listdir', (['cufflinks_path'], {}), '(cufflinks_path)\n', (1252, 1268), False, 'import os\n'), ((1950, 1970), 'os.listdir', 'os.listdir', (['bam_path'], {}), '(bam_path)\n', ... |
from flask import make_response, request, render_template, redirect
from flask.helpers import url_for
from models.session import Session
from models.user import User
from werkzeug.security import generate_password_hash
class RegisterView:
RESULT_SUCCESS = "success"
RESULT_USEREXISTS = "userexists"
RESULT_... | [
"flask.render_template",
"flask.request.args.get",
"models.user.User",
"flask.request.cookies.get",
"werkzeug.security.generate_password_hash",
"flask.helpers.url_for"
] | [((1189, 1219), 'models.user.User', 'User', (["request.form['username']"], {}), "(request.form['username'])\n", (1193, 1219), False, 'from models.user import User\n'), ((1431, 1495), 'werkzeug.security.generate_password_hash', 'generate_password_hash', (["request.form['password']"], {'salt_length': '(16)'}), "(request.... |
#! /bin/bash.env python
# *-* coding:utf-8 *-*
import os
import sys
os.system("touch a.sh && chmod +x a.sh")
os.system("mkdir output")
print("文件会被转换在output文件夹中")
x=int(input("输入数量:"))
fo = open("a.sh","r+")
for a in range(1,1+x) :
com="mri_convert -i "+"IM"+str(a)+" -o "+"./output/IM"+str(a)+".mgz"
fo.write(str(c... | [
"os.system"
] | [((70, 110), 'os.system', 'os.system', (['"""touch a.sh && chmod +x a.sh"""'], {}), "('touch a.sh && chmod +x a.sh')\n", (79, 110), False, 'import os\n'), ((111, 136), 'os.system', 'os.system', (['"""mkdir output"""'], {}), "('mkdir output')\n", (120, 136), False, 'import os\n'), ((393, 412), 'os.system', 'os.system', ... |
"""Overview page of contributions.
* Country selection
* Grouping by categories
* Statistics
"""
from flask import make_response
from config import Names as N
from control.utils import mjson, mktsv, pick as G, serverprint
from control.table import Table, SENSITIVE_TABLES, SENSITIVE_FIELDS
from control.typ.rela... | [
"control.table.Table",
"control.typ.related.castObjectId",
"control.utils.pick",
"control.utils.serverprint",
"control.utils.mjson",
"control.utils.mktsv"
] | [((3351, 3401), 'control.utils.serverprint', 'serverprint', (['f"""Invalid api call requested: {verb}"""'], {}), "(f'Invalid api call requested: {verb}')\n", (3362, 3401), False, 'from control.utils import mjson, mktsv, pick as G, serverprint\n'), ((4458, 4480), 'control.typ.related.castObjectId', 'castObjectId', (['gi... |
from unittest.mock import patch
from django.test import TestCase
import vcr
from data_refinery_common.models import (
Contribution,
Experiment,
ExperimentSampleAssociation,
OntologyTerm,
Sample,
SampleAttribute,
)
from data_refinery_foreman.foreman.management.commands.import_external_sample_a... | [
"data_refinery_common.models.OntologyTerm",
"data_refinery_common.models.SampleAttribute.objects.all",
"vcr.use_cassette",
"data_refinery_foreman.foreman.management.commands.import_external_sample_attributes.import_sample_attributes",
"data_refinery_foreman.foreman.management.commands.import_external_sample... | [((4472, 4575), 'vcr.use_cassette', 'vcr.use_cassette', (['"""/home/user/data_store/cassettes/foreman.sample_attributes.end-to-end.yaml"""'], {}), "(\n '/home/user/data_store/cassettes/foreman.sample_attributes.end-to-end.yaml'\n )\n", (4488, 4575), False, 'import vcr\n'), ((599, 611), 'data_refinery_common.model... |
from setuptools import setup, find_packages
setup(
name='simplexapiclient',
version='0.0.1',
url='https://github.com/IngoKl/simple-xapi-client.git',
author='<NAME>',
author_email='<EMAIL>',
description='A minimalistic xAPI client written in Python',
packages=find_packages(),
install... | [
"setuptools.find_packages"
] | [((288, 303), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (301, 303), False, 'from setuptools import setup, find_packages\n')] |
"""File of parameters to be used throughout the notebook."""
import os
# # # # # #
### Ch15
# # # # # #
###
N_STEPS = 50
### saving stuff
PROJECT_ROOT_DIR = "."
CHAPTER_ID = "rnn"
IMAGES_PATH = os.path.join(PROJECT_ROOT_DIR, "images", CHAPTER_ID) | [
"os.path.join"
] | [((197, 249), 'os.path.join', 'os.path.join', (['PROJECT_ROOT_DIR', '"""images"""', 'CHAPTER_ID'], {}), "(PROJECT_ROOT_DIR, 'images', CHAPTER_ID)\n", (209, 249), False, 'import os\n')] |
import sys
from etl.entities_registry import get_spark_job_by_entity_name
def main(argv):
"""
Calls the needed job according to the entity
:param list argv: the list elements should be:
[1]: Entity name
[2:]: Rest of parameters (the paths to the parquet files neede... | [
"etl.entities_registry.get_spark_job_by_entity_name"
] | [((496, 537), 'etl.entities_registry.get_spark_job_by_entity_name', 'get_spark_job_by_entity_name', (['entity_name'], {}), '(entity_name)\n', (524, 537), False, 'from etl.entities_registry import get_spark_job_by_entity_name\n')] |
#! /usr/bin/env python3.6
from urllib.request import urlopen
from urllib.error import HTTPError
from bs4 import BeautifulSoup
try:
html = urlopen("https://en.wikipedia.org/wiki/Kevin_Bacon")
except HTTPError as e:
print(e)
bs_obj = BeautifulSoup(html, "html.parser")
for link in bs_obj.findAll("a"):
print... | [
"bs4.BeautifulSoup",
"urllib.request.urlopen"
] | [((243, 277), 'bs4.BeautifulSoup', 'BeautifulSoup', (['html', '"""html.parser"""'], {}), "(html, 'html.parser')\n", (256, 277), False, 'from bs4 import BeautifulSoup\n'), ((144, 196), 'urllib.request.urlopen', 'urlopen', (['"""https://en.wikipedia.org/wiki/Kevin_Bacon"""'], {}), "('https://en.wikipedia.org/wiki/Kevin_B... |
from django.db.models import CharField, ManyToManyField
from django.utils.translation import gettext_lazy as _
from app.utils.models import BaseModel
from app.users.models import User
class Enterprise(BaseModel):
name = CharField(_("Name of Enterprise"), max_length=255)
members = ManyToManyField(User, through... | [
"django.utils.translation.gettext_lazy",
"django.db.models.ManyToManyField"
] | [((291, 366), 'django.db.models.ManyToManyField', 'ManyToManyField', (['User'], {'through': '"""UserEnterprise"""', 'related_name': '"""enterprises"""'}), "(User, through='UserEnterprise', related_name='enterprises')\n", (306, 366), False, 'from django.db.models import CharField, ManyToManyField\n'), ((236, 259), 'djan... |
#! /usr/bin/env python
import rospy
import math
from pprint import pprint
from access_teleop_msgs.msg import DeltaPX, PX, PXAndTheta, Theta
from image_geometry import PinholeCameraModel
from geometry_msgs.msg import Pose, PoseStamped, Quaternion, Point, Vector3
from std_msgs.msg import Header, ColorRGBA
from visualiza... | [
"geometry_msgs.msg.Vector3",
"image_geometry.PinholeCameraModel",
"std_msgs.msg.ColorRGBA",
"access_teleop_msgs.msg.PX",
"geometry_msgs.msg.Quaternion",
"rospy.Time",
"geometry_msgs.msg.Point",
"std_msgs.msg.Header"
] | [((1886, 1898), 'geometry_msgs.msg.Quaternion', 'Quaternion', ([], {}), '()\n', (1896, 1898), False, 'from geometry_msgs.msg import Pose, PoseStamped, Quaternion, Point, Vector3\n'), ((5257, 5277), 'image_geometry.PinholeCameraModel', 'PinholeCameraModel', ([], {}), '()\n', (5275, 5277), False, 'from image_geometry imp... |
import numpy as np
import torch
import torch.nn.functional as F
import skimage.measure as sk
import time
import pyrender
import pymesh
import trimesh
from pyemd import emd_samples
import chamfer_python
import binvox_rw
from glob import glob
D2R = np.pi/180.0
voxsize = 32
sample_size = 2048
def RotatePhi(phi):
... | [
"numpy.clip",
"numpy.sqrt",
"pyemd.emd_samples",
"trimesh.sample.sample_surface",
"skimage.measure.marching_cubes_lewiner",
"numpy.array",
"numpy.sin",
"numpy.arange",
"numpy.where",
"torch.mean",
"numpy.linspace",
"pymesh.form_mesh",
"numpy.vstack",
"numpy.concatenate",
"pyrender.Mesh.f... | [((2036, 2067), 'numpy.expand_dims', 'np.expand_dims', (['x_mesh'], {'axis': '(-1)'}), '(x_mesh, axis=-1)\n', (2050, 2067), True, 'import numpy as np\n'), ((2085, 2116), 'numpy.expand_dims', 'np.expand_dims', (['y_mesh'], {'axis': '(-1)'}), '(y_mesh, axis=-1)\n', (2099, 2116), True, 'import numpy as np\n'), ((2134, 216... |
# -*- coding: utf-8 -*-
# Copyright 2019 Cohesity Inc.
import logging
from cohesity_management_sdk.api_helper import APIHelper
from cohesity_management_sdk.configuration import Configuration
from cohesity_management_sdk.controllers.base_controller import BaseController
from cohesity_management_sdk.http.auth.auth_manag... | [
"logging.getLogger",
"cohesity_management_sdk.configuration.Configuration.get_base_uri",
"cohesity_management_sdk.api_helper.APIHelper.append_url_with_template_parameters",
"cohesity_management_sdk.api_helper.APIHelper.json_serialize",
"cohesity_management_sdk.api_helper.APIHelper.clean_url",
"cohesity_ma... | [((776, 803), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (793, 803), False, 'import logging\n'), ((1989, 2057), 'cohesity_management_sdk.api_helper.APIHelper.append_url_with_template_parameters', 'APIHelper.append_url_with_template_parameters', (['_url_path', "{'id': id}"], {}), "(_ur... |
# -*- coding: utf-8 -*-
from openerp.osv import osv
from openerp.osv import fields
import time
class stage_tache(osv.osv):
""" stage_tache """
_name = 'stage.tache'
_description = 'stage_tache'
_columns = {
'type': fields.char('Type', size=100, required=True),
}
stage_tache()
class stage_... | [
"openerp.osv.fields.char",
"openerp.osv.fields.date"
] | [((239, 283), 'openerp.osv.fields.char', 'fields.char', (['"""Type"""'], {'size': '(100)', 'required': '(True)'}), "('Type', size=100, required=True)\n", (250, 283), False, 'from openerp.osv import fields\n'), ((444, 488), 'openerp.osv.fields.char', 'fields.char', (['"""Type"""'], {'size': '(100)', 'required': '(True)'... |
"""Button which sends one key combination."""
import time
import board
from digitalio import DigitalInOut, Direction, Pull
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
import usb_hid
# Define output LED
led = DigitalIn... | [
"digitalio.DigitalInOut",
"adafruit_hid.keyboard.Keyboard",
"time.sleep",
"adafruit_hid.keyboard_layout_us.KeyboardLayoutUS"
] | [((311, 334), 'digitalio.DigitalInOut', 'DigitalInOut', (['board.LED'], {}), '(board.LED)\n', (323, 334), False, 'from digitalio import DigitalInOut, Direction, Pull\n'), ((399, 424), 'adafruit_hid.keyboard.Keyboard', 'Keyboard', (['usb_hid.devices'], {}), '(usb_hid.devices)\n', (407, 424), False, 'from adafruit_hid.ke... |
from django.conf.urls import url
from .views import ResaleListView, detailed
urlpatterns = [
url(r'^$', ResaleListView.as_view(), name='index'),
url(r'^(?P<pk>\d+)/$', detailed, name='detailed'),
]
| [
"django.conf.urls.url"
] | [((156, 205), 'django.conf.urls.url', 'url', (['"""^(?P<pk>\\\\d+)/$"""', 'detailed'], {'name': '"""detailed"""'}), "('^(?P<pk>\\\\d+)/$', detailed, name='detailed')\n", (159, 205), False, 'from django.conf.urls import url\n')] |
import os
import math
import gzip
import csv
import time
import torch
import torch.optim as optim
import torch.utils.data as data_utils
from sklearn.model_selection import train_test_split
from tqdm import tqdm
# import matplotlib.pyplot as plt
import numpy as np
from crf import CRF
# import Data Loa... | [
"os.listdir",
"numpy.random.choice",
"os.path.join",
"torch.from_numpy",
"torch.eq",
"torch.tensor",
"torch.cuda.is_available",
"data_loader.get_dataset",
"torch.sum",
"torch.utils.data.DataLoader",
"torch.no_grad",
"crf.CRF",
"time.time"
] | [((841, 854), 'data_loader.get_dataset', 'get_dataset', ([], {}), '()\n', (852, 854), False, 'from data_loader import get_dataset\n'), ((1818, 1838), 'os.listdir', 'os.listdir', (['dir_name'], {}), '(dir_name)\n', (1828, 1838), False, 'import os\n'), ((2138, 2149), 'time.time', 'time.time', ([], {}), '()\n', (2147, 214... |
import torch
import numpy as np
import argparse
import os
from utils import Logger, LogFiles, ValidationAccuracies, cross_entropy_loss, compute_accuracy, MetaLearningState,\
shuffle
from model import FewShotClassifier
from dataset import get_dataset_reader
from tf_dataset_reader import TfDatasetReader
from image_fo... | [
"torch.from_numpy",
"numpy.array",
"torch.cuda.is_available",
"utils.ValidationAccuracies",
"torch.set_grad_enabled",
"argparse.ArgumentParser",
"utils.LogFiles",
"dataset.get_dataset_reader",
"tf_dataset_reader.TfDatasetReader",
"utils.shuffle",
"numpy.random.permutation",
"torch.Tensor",
"... | [((597, 729), 'utils.LogFiles', 'LogFiles', (['self.args.checkpoint_dir', 'self.args.resume_from_checkpoint', "(self.args.mode == 'test' or self.args.mode == 'test_vtab')"], {}), "(self.args.checkpoint_dir, self.args.resume_from_checkpoint, self.\n args.mode == 'test' or self.args.mode == 'test_vtab')\n", (605, 729)... |
"""
The federated learning trainer for MistNet, used by both the client and the
server.
Reference:
<NAME>, et al. "MistNet: Towards Private Neural Network Training with Local
Differential Privacy," found in docs/papers.
"""
import time
import logging
import mindspore
import mindspore.dataset as ds
from plato.utils ... | [
"plato.utils.unary_encoding.encode",
"plato.utils.unary_encoding.randomize",
"time.perf_counter",
"plato.config.Config",
"mindspore.Tensor"
] | [((1030, 1049), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (1047, 1049), False, 'import time\n'), ((1617, 1636), 'time.perf_counter', 'time.perf_counter', ([], {}), '()\n', (1634, 1636), False, 'import time\n'), ((1142, 1166), 'mindspore.Tensor', 'mindspore.Tensor', (['inputs'], {}), '(inputs)\n', (115... |
import gem
from abc import ABCMeta, abstractmethod
try:
from firedrake_citations import Citations
Citations().add("Kirby2018zany", """
@Article{Kirby2018zany,
author = {<NAME>},
title = {A general approach to transforming finite elements},
journal = {SMAI Journal of Computational Mathem... | [
"gem.optimise.aggressive_unroll",
"gem.indices",
"firedrake_citations.Citations",
"gem.IndexSum"
] | [((107, 118), 'firedrake_citations.Citations', 'Citations', ([], {}), '()\n', (116, 118), False, 'from firedrake_citations import Citations\n'), ((534, 545), 'firedrake_citations.Citations', 'Citations', ([], {}), '()\n', (543, 545), False, 'from firedrake_citations import Citations\n'), ((1008, 1019), 'firedrake_citat... |
from ..Simulation.Parameters import simLevel, isSimulation
from ..utils.misc import singleton
from telnetlib import Telnet
import paramiko
import logging
logger = logging.getLogger(__name__)
# If it is a simulation, do not import pyvisa
try:
import pyvisa
except ImportError:
if isSimulation:
logger.log(simLevel, "... | [
"logging.getLogger",
"paramiko.SSHClient",
"paramiko.AutoAddPolicy",
"telnetlib.Telnet"
] | [((163, 190), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (180, 190), False, 'import logging\n'), ((899, 920), 'telnetlib.Telnet', 'Telnet', (['ip'], {'port': 'port'}), '(ip, port=port)\n', (905, 920), False, 'from telnetlib import Telnet\n'), ((1315, 1335), 'paramiko.SSHClient', 'para... |
import requests
import json
import logging
class PullRequestProfile :
'''
This class instantiates the Sonarcloud Quality Profile for a Pull Request from one SCM branch to another.
'''
def __init__(self, url="https://sonarcloud.io", **kwargs):
self.url = url
self.authorization = kwargs.g... | [
"requests.get"
] | [((1051, 1140), 'requests.get', 'requests.get', ([], {'url': 'url', 'headers': 'headers', 'params': 'params', 'auth': "(self.authorization, '')"}), "(url=url, headers=headers, params=params, auth=(self.\n authorization, ''))\n", (1063, 1140), False, 'import requests\n'), ((2346, 2435), 'requests.get', 'requests.get'... |
#!/usr/bin/env python3
import os
import numpy as np
import sys
try:
import torch
except ImportError:
pass
from easypbr import *
from dataloaders import *
config_file="lnn_check_lattice_size.cfg"
config_path=os.path.join( os.path.dirname( os.path.realpath(__file__) ) , '../../config', config_file)
view=Viewer... | [
"os.path.realpath",
"numpy.mean"
] | [((249, 275), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (265, 275), False, 'import os\n'), ((792, 820), 'numpy.mean', 'np.mean', (['nr_points_in_radius'], {}), '(nr_points_in_radius)\n', (799, 820), True, 'import numpy as np\n')] |
import os
import subprocess
import sys
args = sys.argv[:]
print('hello from %s' % args[0])
print('args: ' + ' '.join(args))
print('current directory: ' + os.getcwd())
p = subprocess.Popen('ls -al', shell=True, bufsize=1, universal_newlines=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
while True:
line = p.s... | [
"subprocess.Popen",
"os.getcwd"
] | [((171, 299), 'subprocess.Popen', 'subprocess.Popen', (['"""ls -al"""'], {'shell': '(True)', 'bufsize': '(1)', 'universal_newlines': '(True)', 'stdout': 'subprocess.PIPE', 'stderr': 'subprocess.STDOUT'}), "('ls -al', shell=True, bufsize=1, universal_newlines=True,\n stdout=subprocess.PIPE, stderr=subprocess.STDOUT)\... |
# -*- coding: utf-8 -*-
from gluon import DAL, HTTP, Field, current
from gluon.contrib.appconfig import AppConfig
from gluon.tools import Auth
class Cognito(object):
def __init__(self):
self.db = DAL(
current.config.get("cognito_db.uri"),
pool_size=current.config.get("cognito_db.... | [
"gluon.HTTP",
"gluon.Field",
"gluon.current.config.get"
] | [((229, 265), 'gluon.current.config.get', 'current.config.get', (['"""cognito_db.uri"""'], {}), "('cognito_db.uri')\n", (247, 265), False, 'from gluon import DAL, HTTP, Field, current\n'), ((706, 743), 'gluon.Field', 'Field', (['"""user_attributes"""'], {'type': '"""json"""'}), "('user_attributes', type='json')\n", (71... |
from flask_jwt_extended import (create_access_token,
create_refresh_token,
jwt_required,
get_raw_jwt,
get_jwt_identity,
fresh_jwt_required)
from flask_restful i... | [
"app.models.users.user.User.get_by_email",
"app.common.utils.Utils.check_hashed_password",
"flask_jwt_extended.get_raw_jwt",
"flask_restful.reqparse.RequestParser",
"app.Response",
"flask_jwt_extended.create_access_token",
"app.models.users.user.User.get_by_id",
"flask_jwt_extended.create_refresh_toke... | [((586, 610), 'flask_restful.reqparse.RequestParser', 'reqparse.RequestParser', ([], {}), '()\n', (608, 610), False, 'from flask_restful import Resource, reqparse\n'), ((5634, 5658), 'flask_restful.reqparse.RequestParser', 'reqparse.RequestParser', ([], {}), '()\n', (5656, 5658), False, 'from flask_restful import Resou... |
import arff
import argparse
import json
import logging
import numpy as np
import openmlcontrib
import openmldefaults
import os
import pandas as pd
# SSHFS NEMO FREIBURG:
# sshfs <EMAIL>:/rigel/home/jv2657/experiments ~/habanero_experiments
#
# SSHFS GRACE LEIDEN:
# ssh -f -N -L 1233:grace.liacs.nl:22 <EMAIL>
# sshfs ... | [
"logging.getLogger",
"json.loads",
"numpy.unique",
"argparse.ArgumentParser",
"openmldefaults.models.AverageRankDefaults",
"arff.load",
"numpy.append",
"logging.info",
"os.path.expanduser",
"openmldefaults.models.ActiveTestingDefaults"
] | [((450, 507), 'os.path.expanduser', 'os.path.expanduser', (['"""../../data/text_classification.arff"""'], {}), "('../../data/text_classification.arff')\n", (468, 507), False, 'import os\n'), ((521, 580), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Creates an ARFF file"""'}), "(descrip... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | [
"pulumi.set",
"pulumi.ResourceOptions",
"pulumi.get"
] | [((1542, 1573), 'pulumi.get', 'pulumi.get', (['self', '"""description"""'], {}), "(self, 'description')\n", (1552, 1573), False, 'import pulumi\n'), ((1670, 1708), 'pulumi.set', 'pulumi.set', (['self', '"""description"""', 'value'], {}), "(self, 'description', value)\n", (1680, 1708), False, 'import pulumi\n'), ((1878,... |
from brownie import ZERO_ADDRESS, PACDaoBonus1, accounts, network
from brownie.network import max_fee, priority_fee
def main():
publish_source = True
multisig = "0xf27AC88ac7e80487f21e5c2C847290b2AE5d7B8e"
beneficiary_address = multisig
if network.show_active() in ["development"]:
tokens = [Z... | [
"brownie.network.show_active",
"brownie.network.priority_fee",
"brownie.PACDaoBonus1.deploy",
"brownie.accounts.load"
] | [((1771, 1874), 'brownie.PACDaoBonus1.deploy', 'PACDaoBonus1.deploy', (['beneficiary_address', 'tokens', "{'from': deployer}"], {'publish_source': 'publish_source'}), "(beneficiary_address, tokens, {'from': deployer},\n publish_source=publish_source)\n", (1790, 1874), False, 'from brownie import ZERO_ADDRESS, PACDao... |
import pynput
from pynput.keyboard import Key, Listener
count = 0
keys = []
def on_press(key):
global keys, count
keys.append(key)
count += 1
print("{0} key pressed on keyboard".format(key))
if count >= 4:
# This numerical value can be changed, however many keys are pressed, the log fil... | [
"pynput.keyboard.Listener"
] | [((835, 885), 'pynput.keyboard.Listener', 'Listener', ([], {'on_press': 'on_press', 'on_release': 'on_release'}), '(on_press=on_press, on_release=on_release)\n', (843, 885), False, 'from pynput.keyboard import Key, Listener\n')] |