code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import pandas as pd
import argparse
import json
# Parsing arguments
parser = argparse.ArgumentParser(description='Train lstm-NN model.')
parser.add_argument('-i, --iterations', dest='iterations', type=int, required=True,
help='number of trainings performed by the model')
parser.add_argument('-ep, -... | [
"argparse.ArgumentParser",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"keras.models.Sequential",
"pandas.get_dummies",
"keras.layers.LSTM",
"keras.layers.Dense",
"keras.layers.SpatialDropout1D",
"json.load",
"keras.layers.Embedding"
] | [((78, 137), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Train lstm-NN model."""'}), "(description='Train lstm-NN model.')\n", (101, 137), False, 'import argparse\n'), ((2076, 2115), 'pandas.read_csv', 'pd.read_csv', (['"""Data/clean_full_data.csv"""'], {}), "('Data/clean_full_data.cs... |
import dataclasses
import click
import datetime
import neuro_extras
from collections import defaultdict
from graphviz import Digraph
from neuro_cli import __version__ as cli_version
from neuro_sdk import Client, ResourceNotFound, __version__ as sdk_version
from operator import attrgetter
from rich import box
from rich... | [
"operator.attrgetter",
"rich.panel.Panel",
"rich.table.Table",
"collections.defaultdict",
"click.BadArgumentUsage"
] | [((5951, 5968), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (5962, 5968), False, 'from collections import defaultdict\n'), ((19952, 19985), 'rich.table.Table', 'Table', ([], {'box': 'box.MINIMAL_HEAVY_HEAD'}), '(box=box.MINIMAL_HEAVY_HEAD)\n', (19957, 19985), False, 'from rich.table import Tab... |
#!/usr/bin/env python3
from argparse import ArgumentParser
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import to_hex
def main(args):
cmap = plt.get_cmap(args.cmap)
for x in np.linspace(0, 1, num=args.n_colors):
print(to_hex(cmap(x), keep_alpha=False))
if __name__ == '... | [
"numpy.linspace",
"argparse.ArgumentParser",
"matplotlib.pyplot.get_cmap"
] | [((178, 201), 'matplotlib.pyplot.get_cmap', 'plt.get_cmap', (['args.cmap'], {}), '(args.cmap)\n', (190, 201), True, 'import matplotlib.pyplot as plt\n'), ((215, 251), 'numpy.linspace', 'np.linspace', (['(0)', '(1)'], {'num': 'args.n_colors'}), '(0, 1, num=args.n_colors)\n', (226, 251), True, 'import numpy as np\n'), ((... |
import pandas as pd
from matplotlib import pyplot
from sklearn.externals import joblib
import numpy as np
import datetime
import pickle
import argparse
def string_to_timestamp(string):
date_time_obj = datetime.datetime.strptime(string, '%Y-%m-%d %H:%M:%S')
timestamp = date_time_obj.timestamp()
return times... | [
"numpy.mean",
"argparse.ArgumentParser",
"pandas.read_csv",
"datetime.datetime.strptime",
"numpy.array",
"pandas.to_datetime"
] | [((206, 261), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (['string', '"""%Y-%m-%d %H:%M:%S"""'], {}), "(string, '%Y-%m-%d %H:%M:%S')\n", (232, 261), False, 'import datetime\n'), ((1988, 2046), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Start and End Times"""'}), "(de... |
from autoencoder import Lambda
import torch.nn as nn
import torch
def create_block(in_channels, out_channels=None):
if out_channels is None:
out_channels = in_channels
return nn.Sequential(
nn.Conv2d(in_channels = in_channels, out_channels = out_channels, kernel_size = 3, padding=1),
nn... | [
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Softmax",
"torch.nn.Conv2d",
"torch.nn.BatchNorm1d",
"torch.nn.MaxPool2d",
"torch.nn.Linear",
"torch.nn.AvgPool2d"
] | [((215, 306), 'torch.nn.Conv2d', 'nn.Conv2d', ([], {'in_channels': 'in_channels', 'out_channels': 'out_channels', 'kernel_size': '(3)', 'padding': '(1)'}), '(in_channels=in_channels, out_channels=out_channels, kernel_size=3,\n padding=1)\n', (224, 306), True, 'import torch.nn as nn\n'), ((318, 346), 'torch.nn.BatchN... |
# The model for the skin cancer classifier
# Import the libraries
import numpy as np
import keras
from keras import backend as K
from keras.layers.core import Dense, Dropout
from keras.optimizers import Adam
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Model
from keras.models impor... | [
"matplotlib.pyplot.ylabel",
"keras.utils.vis_utils.plot_model",
"keras.preprocessing.image.ImageDataGenerator",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.yticks",
"keras.models.Model",
"keras.optimizers.Adam",
"numpy.ceil",
"matplotlib.pyplot.xticks",
"keras.call... | [((524, 566), 'keras.backend.tensorflow_backend._get_available_gpus', 'K.tensorflow_backend._get_available_gpus', ([], {}), '()\n', (564, 566), True, 'from keras import backend as K\n'), ((890, 935), 'numpy.ceil', 'np.ceil', (['(num_train_samples / train_batch_size)'], {}), '(num_train_samples / train_batch_size)\n', (... |
"""versatileimagefield tests."""
from __future__ import division
from __future__ import unicode_literals
from functools import reduce
import math
import operator
import os
from shutil import rmtree
from django import VERSION as DJANGO_VERSION
from django.conf import settings
from django.contrib.auth.models import Use... | [
"django.utils._os.upath",
"versatileimagefield.files.VersatileImageFileDescriptor",
"django.core.cache.cache.get",
"versatileimagefield.registry.versatileimagefield_registry.register_filter",
"versatileimagefield.registry.versatileimagefield_registry.unregister_filter",
"django.template.Context",
"versa... | [((34206, 34268), 'django.test.utils.override_settings', 'override_settings', ([], {'INSTALLED_APPS': "('tests.test_autodiscover',)"}), "(INSTALLED_APPS=('tests.test_autodiscover',))\n", (34223, 34268), False, 'from django.test.utils import override_settings\n'), ((34454, 34513), 'django.test.utils.override_settings', ... |
import uuid
import cv2
OUTPUT_IMAGE_FOLDER = "./output/"
OUTPUT_FILE_TYPE = ".jpg"
def save_image_with_internal_name(img):
internal_name = str(uuid.uuid1()) + OUTPUT_FILE_TYPE
cv2.imwrite(OUTPUT_IMAGE_FOLDER + internal_name, img)
return internal_name
| [
"uuid.uuid1",
"cv2.imwrite"
] | [((188, 241), 'cv2.imwrite', 'cv2.imwrite', (['(OUTPUT_IMAGE_FOLDER + internal_name)', 'img'], {}), '(OUTPUT_IMAGE_FOLDER + internal_name, img)\n', (199, 241), False, 'import cv2\n'), ((151, 163), 'uuid.uuid1', 'uuid.uuid1', ([], {}), '()\n', (161, 163), False, 'import uuid\n')] |
"""Top-level package for fmu-dataio"""
# noqa
import logging
from fmu.dataio.dataio import ExportData # noqa # type: ignore
from fmu.dataio.dataio import InitializeCase # noqa # type: ignore
try:
from .version import version
__version__ = version
except ImportError:
__version__ = "0.0.0"
LOGGING_LE... | [
"logging.getLogger",
"logging.Formatter",
"logging.basicConfig"
] | [((488, 507), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (505, 507), False, 'import logging\n'), ((621, 644), 'logging.Formatter', 'logging.Formatter', (['LFMT'], {}), '(LFMT)\n', (638, 644), False, 'import logging\n'), ((669, 722), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'LOGGING_... |
import os
from urllib.parse import urlparse
from .base import *
DEBUG = False
SECRET_KEY = os.environ['SECRET_KEY']
ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', 'stura-md.de,www.stura-md.de').split(',')
# Application definition
MIDDLEWARE += [
'whitenoise.middleware.WhiteNoiseMiddleware',
]
# Database
... | [
"os.environ.get",
"urllib.parse.urlparse"
] | [((323, 353), 'os.environ.get', 'os.environ.get', (['"""DATABASE_URL"""'], {}), "('DATABASE_URL')\n", (337, 353), False, 'import os\n'), ((363, 399), 'urllib.parse.urlparse', 'urlparse', (["os.environ['DATABASE_URL']"], {}), "(os.environ['DATABASE_URL'])\n", (371, 399), False, 'from urllib.parse import urlparse\n'), ((... |
from glob import glob
from logzero import logger as log
import os
import pyconll
from ufal.udpipe import Model, Pipeline, ProcessingError
def find_best_udpipe_model(model_dir, prefix):
models = [(f, os.path.getsize(f)) for f in glob(f"{model_dir}/{prefix}*")]
if not models:
return None
return sort... | [
"os.path.exists",
"os.path.getsize",
"ufal.udpipe.Model.load",
"os.path.isdir",
"logzero.logger.info",
"ufal.udpipe.Pipeline",
"pyconll.load_from_string",
"glob.glob",
"ufal.udpipe.ProcessingError"
] | [((1399, 1451), 'logzero.logger.info', 'log.info', (['f"""Loading UDPipe model: {self._modelfile}"""'], {}), "(f'Loading UDPipe model: {self._modelfile}')\n", (1407, 1451), True, 'from logzero import logger as log\n'), ((1473, 1500), 'ufal.udpipe.Model.load', 'Model.load', (['self._modelfile'], {}), '(self._modelfile)\... |
import math
a = float(input("a katsayısını giriniz: "))
b = float(input("b katsayısını giriniz: "))
c = float(input("c katsayısını giriniz: "))
d = b*b - 4*a*c
if d < 0:
print("gerçel kök yoktur.")
if d == 0:
print("çakışık kök vardır.")
x = -b/(2*a)
print("x: ",x)
if d > 0:
print("gerçel iki kök... | [
"math.sqrt"
] | [((345, 357), 'math.sqrt', 'math.sqrt', (['d'], {}), '(d)\n', (354, 357), False, 'import math\n'), ((379, 391), 'math.sqrt', 'math.sqrt', (['d'], {}), '(d)\n', (388, 391), False, 'import math\n')] |
""" Helpers for accessing files in the ./library dir.
This dir has a $module/$version.bru+gyp structure, containing information
about how to download tar.gzs for (or hwo to clone) each module, as well
as for how to build the module's libs and some of its tests/examples.
"""
from __future__ import absolute_... | [
"re.split",
"os.path.join",
"re.compile"
] | [((3670, 3716), 'os.path.join', 'os.path.join', (['module_dir', '(module_version + ext)'], {}), '(module_dir, module_version + ext)\n', (3682, 3716), False, 'import os\n'), ((4380, 4406), 're.compile', 're.compile', (['"""^(.+)\\\\.bru$"""'], {}), "('^(.+)\\\\.bru$')\n", (4390, 4406), False, 'import re\n'), ((833, 858)... |
import re
import json
import requests
import esprima
import ast_2_js
requests = requests.Session()
url_regex = re.compile(r"https:\/\/jsbin\.com\/[\w\W]+?\/")
null = None
false = False
true = True
document = None
this = None
def start(obj, *args, **kwargs):
return obj
def parse_jsbin(url):
headers = { "refere... | [
"requests.Session",
"re.compile",
"requests.get",
"esprima.parse",
"ast_2_js.generate"
] | [((82, 100), 'requests.Session', 'requests.Session', ([], {}), '()\n', (98, 100), False, 'import requests\n'), ((115, 168), 're.compile', 're.compile', (['"""https:\\\\/\\\\/jsbin\\\\.com\\\\/[\\\\w\\\\W]+?\\\\/"""'], {}), "('https:\\\\/\\\\/jsbin\\\\.com\\\\/[\\\\w\\\\W]+?\\\\/')\n", (125, 168), False, 'import re\n'),... |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import csv
import math
from sklearn.metrics import r2_score
from sklearn.linear_model import LinearRegression
from matplotlib import font_manager
resol = 0.1
query_TK = 293
total = 19
total_s = 15
sample = 6
sample_s = 1
ref_clk = ... | [
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylabel",
"numpy.log",
"numpy.array",
"numpy.arange",
"matplotlib.pyplot.xlabel",
"numpy.asarray",
"numpy.exp",
"numpy.linspace",
"matplotlib.pyplot.yscale",
"csv.reader",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.gca",
"matplotlib.font_mana... | [((535, 584), 'matplotlib.font_manager.findSystemFonts', 'font_manager.findSystemFonts', ([], {'fontpaths': 'font_dirs'}), '(fontpaths=font_dirs)\n', (563, 584), False, 'from matplotlib import font_manager\n'), ((1156, 1189), 'numpy.linspace', 'np.linspace', (['TK_min', 'TK_max', 'N_TK'], {}), '(TK_min, TK_max, N_TK)\n... |
""" A combination of strategies used to build a circular enclosure centred on a
landmark. The absence of a visible landmark indicates an area to be cleared
such that arcs of circles can be constructed. Partially inspired by Gauci et
al's controller from 'Clustering objects with robots that do not compute'. """
from ... | [
"common.drawing.draw_line",
"math.sin",
"common.angles.normalize_angle_pm_pi",
"math.cos",
"math.fabs",
"random.random",
"configsingleton.ConfigSingleton.get_instance"
] | [((798, 828), 'configsingleton.ConfigSingleton.get_instance', 'ConfigSingleton.get_instance', ([], {}), '()\n', (826, 828), False, 'from configsingleton import ConfigSingleton\n'), ((2526, 2534), 'random.random', 'random', ([], {}), '()\n', (2532, 2534), False, 'from random import random\n'), ((5683, 5691), 'random.ran... |
from __future__ import print_function
from distutils import log
from setuptools import setup, find_packages
import os
from jupyter_packaging import (
create_cmdclass,
install_npm,
ensure_targets,
combine_commands,
get_version,
skip_if_exists
)
# Name of the project
name = 'keplergl'
here = os... | [
"jupyter_packaging.ensure_targets",
"jupyter_packaging.skip_if_exists",
"setuptools.find_packages",
"os.path.join",
"setuptools.setup",
"distutils.log.info",
"os.path.abspath",
"jupyter_packaging.create_cmdclass",
"jupyter_packaging.install_npm"
] | [((410, 438), 'distutils.log.info', 'log.info', (['"""setup.py entered"""'], {}), "('setup.py entered')\n", (418, 438), False, 'from distutils import log\n'), ((439, 480), 'distutils.log.info', 'log.info', (["('$PATH=%s' % os.environ['PATH'])"], {}), "('$PATH=%s' % os.environ['PATH'])\n", (447, 480), False, 'from distu... |
import random
passlen = int(input("enter the length of password"))
s="abcdefghijklmnopqrstuvwxyz01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()?"
p = "".join(random.sample(s,passlen ))
print (p)
| [
"random.sample"
] | [((162, 187), 'random.sample', 'random.sample', (['s', 'passlen'], {}), '(s, passlen)\n', (175, 187), False, 'import random\n')] |
from rest_framework import serializers
from .models import GenericFileUpload, Message, MessageAttachment
class GenericFileUploadSerializer(serializers.ModelSerializer):
class Meta:
model = GenericFileUpload
fields = "__all__"
class MessageAttachmentSerializer(serializers.ModelSerializer):
a... | [
"user_control.serializers.UserProfileSerializer",
"rest_framework.serializers.IntegerField",
"rest_framework.serializers.SerializerMethodField"
] | [((509, 561), 'rest_framework.serializers.SerializerMethodField', 'serializers.SerializerMethodField', (['"""get_sender_data"""'], {}), "('get_sender_data')\n", (542, 561), False, 'from rest_framework import serializers\n'), ((578, 619), 'rest_framework.serializers.IntegerField', 'serializers.IntegerField', ([], {'writ... |
import random
import cv2
cv2.setNumThreads(0)
import imgaug as ia
import numpy as np
import torch
from PIL import Image
from trains import Task
from imgaug import augmenters as iaa
from torchvision.transforms import functional as F
from torchvision.transforms import transforms
def get_transform(train, image_size):
... | [
"imgaug.augmenters.GaussianBlur",
"numpy.array",
"imgaug.augmenters.Resize",
"imgaug.augmenters.Fliplr",
"imgaug.augmenters.ChannelShuffle",
"trains.Task.current_task",
"imgaug.augmenters.MultiplyHueAndSaturation",
"imgaug.augmenters.LinearContrast",
"random.choice",
"imgaug.augmenters.AdditiveGau... | [((25, 45), 'cv2.setNumThreads', 'cv2.setNumThreads', (['(0)'], {}), '(0)\n', (42, 45), False, 'import cv2\n'), ((3390, 3405), 'numpy.array', 'np.array', (['image'], {}), '(image)\n', (3398, 3405), True, 'import numpy as np\n'), ((3854, 3892), 'torch.zeros', 'torch.zeros', (['(0, 1)'], {'dtype': 'torch.int64'}), '((0, ... |
import numpy as np
def B_to_b(B):
x_indices = [0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5]
y_indices = [0, 0, 3, 1, 3, 1, 3, 2, 3, 2, 3]
return np.array(B[x_indices, y_indices])
def b_to_B(b):
B = np.zeros((6, 4))
x_indices = [0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5]
y_indices = [0, 0, -1, 1, -1, 1, -1, 2, -1, ... | [
"numpy.array",
"numpy.zeros"
] | [((147, 180), 'numpy.array', 'np.array', (['B[x_indices, y_indices]'], {}), '(B[x_indices, y_indices])\n', (155, 180), True, 'import numpy as np\n'), ((205, 221), 'numpy.zeros', 'np.zeros', (['(6, 4)'], {}), '((6, 4))\n', (213, 221), True, 'import numpy as np\n'), ((554, 582), 'numpy.zeros', 'np.zeros', (['(chain_lengt... |
from typing import NamedTuple
from kfp.components import create_component_from_func
def suggest_parameter_sets_from_measurements_using_gcp_ai_platform_optimizer(
parameter_specs: list,
metrics_for_parameter_sets: list,
suggestion_count: int,
maximize: bool = False,
metric_specs: list = None,
g... | [
"logging.getLogger",
"google.cloud.storage.Client",
"kfp.components.create_component_from_func",
"time.sleep",
"googleapiclient.discovery.build",
"random.SystemRandom",
"googleapiclient.discovery.build_from_document",
"logging.info",
"typing.NamedTuple"
] | [((389, 448), 'typing.NamedTuple', 'NamedTuple', (['"""Outputs"""', "[('suggested_parameter_sets', list)]"], {}), "('Outputs', [('suggested_parameter_sets', list)])\n", (399, 448), False, 'from typing import NamedTuple\n'), ((3843, 3895), 'logging.info', 'logging.info', (['f"""Creating temporary study {study_id}"""'], ... |
import os
import shutil
a = os.walk('E:\\data\\test_1')
file_name_1 = 'E:\\data\\input\\val\\benign'
file_name_2 = 'E:\\data\\input\\val\\malignant'
print(a)
list_file1 = []
list_file2 = []
count_a = 0
count_b = 0
count_c = 0
for maindir, subdir, file_name_list in a:
print(len(file_name_list))
for f in file_na... | [
"os.path.join",
"shutil.copy",
"os.walk"
] | [((28, 55), 'os.walk', 'os.walk', (['"""E:\\\\data\\\\test_1"""'], {}), "('E:\\\\data\\\\test_1')\n", (35, 55), False, 'import os\n'), ((398, 422), 'os.path.join', 'os.path.join', (['maindir', 'f'], {}), '(maindir, f)\n', (410, 422), False, 'import os\n'), ((488, 523), 'shutil.copy', 'shutil.copy', (['file_name', 'file... |
from pytube import YouTube
import os
from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
url = input("Enter Link Here: ")
start = int(input("Enter the starting point: "))
end = int(input("Enter the ending point: "))
print("Processing, please wait......")
yt = YouTube(url)
out_put = yt.streams.get_highest... | [
"os.rename",
"moviepy.video.io.ffmpeg_tools.ffmpeg_extract_subclip",
"pytube.YouTube",
"os.remove"
] | [((275, 287), 'pytube.YouTube', 'YouTube', (['url'], {}), '(url)\n', (282, 287), False, 'from pytube import YouTube\n'), ((345, 375), 'os.rename', 'os.rename', (['out_put', '"""test.mp4"""'], {}), "(out_put, 'test.mp4')\n", (354, 375), False, 'import os\n'), ((376, 446), 'moviepy.video.io.ffmpeg_tools.ffmpeg_extract_su... |
from math import inf
from rest_framework.authtoken.models import Token
from rest_framework.decorators import action
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework.viewsets import GenericViewSet, ViewSet
from rest_framework.viewsets import mixins
from rest_fram... | [
"accounts.models.User.objects.all",
"rest_framework.decorators.action",
"rest_framework.response.Response",
"rest_framework.authtoken.models.Token.objects.get_or_create"
] | [((587, 612), 'accounts.models.User.objects.all', 'models.User.objects.all', ([], {}), '()\n', (610, 612), False, 'from accounts import models\n'), ((1367, 1404), 'rest_framework.decorators.action', 'action', ([], {'methods': "['GET']", 'detail': '(False)'}), "(methods=['GET'], detail=False)\n", (1373, 1404), False, 'f... |
# -*- coding: utf-8 -*-
"""
Created on Thu May 31 14:44:27 2018
@author: SilverDoe
"""
# 2) Read excel,Open excel, get sheets from workbook, getting sheets from the sheets
# getting rows and columns from the sheets
from __future__ import print_function
import xlrd
fname = 'E:\\Documents\\PythonProjects\\1_Basics\\D... | [
"xlrd.open_workbook",
"xlrd.sheet.ctype_text.get"
] | [((384, 409), 'xlrd.open_workbook', 'xlrd.open_workbook', (['fname'], {}), '(fname)\n', (402, 409), False, 'import xlrd\n'), ((1004, 1050), 'xlrd.sheet.ctype_text.get', 'ctype_text.get', (['cell_obj.ctype', '"""unknown type"""'], {}), "(cell_obj.ctype, 'unknown type')\n", (1018, 1050), False, 'from xlrd.sheet import ct... |
##@file kmedian.py
#@brief model for solving the k-median problem.
"""
minimize the total (weighted) travel cost for servicing
a set of customers from k facilities.
Copyright (c) by <NAME> and <NAME>, 2012
"""
import math
import random
from pyscipopt import Model, quicksum, multidict
def kmedian(I,J,c,k):
"""kmed... | [
"pyscipopt.quicksum",
"pyscipopt.Model",
"matplotlib.pyplot.clf",
"math.sqrt",
"networkx.Graph",
"random.seed",
"random.random",
"networkx.draw",
"matplotlib.pyplot.show"
] | [((645, 662), 'pyscipopt.Model', 'Model', (['"""k-median"""'], {}), "('k-median')\n", (650, 662), False, 'from pyscipopt import Model, quicksum, multidict\n'), ((1279, 1321), 'math.sqrt', 'math.sqrt', (['((x2 - x1) ** 2 + (y2 - y1) ** 2)'], {}), '((x2 - x1) ** 2 + (y2 - y1) ** 2)\n', (1288, 1321), False, 'import math\n... |
# -*- coding: utf-8 -*-
from pathlib import Path
import json
from setuptools import setup, find_packages
with open('./ocrd-tool.json', 'r') as f:
version = json.load(f)['version']
setup(
name='ocrd_calamari',
version=version,
description='Calamari bindings',
long_description=Path('README.md').rea... | [
"json.load",
"setuptools.find_packages",
"pathlib.Path"
] | [((162, 174), 'json.load', 'json.load', (['f'], {}), '(f)\n', (171, 174), False, 'import json\n'), ((544, 583), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "('test', 'docs')"}), "(exclude=('test', 'docs'))\n", (557, 583), False, 'from setuptools import setup, find_packages\n'), ((299, 316), 'pathlib.P... |
import traceback
from pycompss.api.task import task
from pycompss.api.constraint import constraint
from pycompss.api.multinode import multinode
from pycompss.api.parameter import FILE_IN, FILE_OUT
from biobb_common.tools import file_utils as fu
from biobb_pmx.pmx import mutate
import os
import sys
# Is constraint dec... | [
"os.path.exists",
"biobb_common.tools.file_utils.write_failed_output",
"sys.stderr.flush",
"biobb_pmx.pmx.mutate.Mutate",
"pycompss.api.task.task",
"sys.stdout.flush",
"traceback.print_exc"
] | [((380, 504), 'pycompss.api.task.task', 'task', ([], {'input_structure_path': 'FILE_IN', 'output_structure_path': 'FILE_OUT', 'input_b_structure_path': 'FILE_OUT', 'on_failure': '"""IGNORE"""'}), "(input_structure_path=FILE_IN, output_structure_path=FILE_OUT,\n input_b_structure_path=FILE_OUT, on_failure='IGNORE')\n... |
from rest_framework import viewsets
from rest_framework import status
from rest_framework.response import Response
from rest_framework import mixins
from rest_framework.decorators import detail_route, list_route
from rest_framework.permissions import IsAuthenticatedOrReadOnly
from .models import Bot, TelegramUser, Aut... | [
"ujson.dumps",
"django.shortcuts.get_object_or_404",
"rest_framework.response.Response",
"rest_framework.decorators.detail_route",
"cerberus.Validator",
"ujson.loads"
] | [((832, 843), 'cerberus.Validator', 'Validator', ([], {}), '()\n', (841, 843), False, 'from cerberus import Validator\n'), ((892, 922), 'rest_framework.decorators.detail_route', 'detail_route', ([], {'methods': "['post']"}), "(methods=['post'])\n", (904, 922), False, 'from rest_framework.decorators import detail_route,... |
import NeuralNetwork as NN
import numpy as np
import matplotlib.pyplot as plt
import tools
def train(path_to_datas, save_model_path):
# 读取MNIST数据集
train_datas, labels = tools.load_mnist(path_to_datas, 'train')
print("The total numbers of datas : ", len(train_datas))
train_labels = np.zeros((labels.shap... | [
"tools.load_mnist",
"numpy.argmax",
"numpy.zeros",
"tools.drawDataCurve",
"NeuralNetwork.MLP",
"numpy.arange"
] | [((178, 218), 'tools.load_mnist', 'tools.load_mnist', (['path_to_datas', '"""train"""'], {}), "(path_to_datas, 'train')\n", (194, 218), False, 'import tools\n'), ((299, 330), 'numpy.zeros', 'np.zeros', (['(labels.shape[0], 10)'], {}), '((labels.shape[0], 10))\n', (307, 330), True, 'import numpy as np\n'), ((758, 859), ... |
# coding=utf-8
import os
import sdl2
from renderable_sprite import UISpriteRenderable
from ui_dialog import UIDialog, Field
from ui_button import UIButton
from art import UV_NORMAL, UV_ROTATE90, UV_ROTATE180, UV_ROTATE270, UV_FLIPX, UV_FLIPY
from ui_colors import UIColors
class ChooserItemButton(UIButton):
... | [
"os.path.exists",
"ui_dialog.UIDialog.render",
"os.listdir",
"ui_button.UIButton.__init__",
"sdl2.SDL_GetKeyName",
"ui_dialog.Field",
"os.path.splitext",
"renderable_sprite.UISpriteRenderable",
"ui_dialog.UIDialog.handle_input",
"os.path.isfile",
"os.path.dirname",
"os.path.isdir",
"os.path.... | [((655, 687), 'ui_button.UIButton.__init__', 'UIButton.__init__', (['self', 'element'], {}), '(self, element)\n', (672, 687), False, 'from ui_button import UIButton\n'), ((2794, 2855), 'ui_dialog.Field', 'Field', ([], {'label': '""""""', 'type': 'str', 'width': '(tile_width - 4)', 'oneline': '(True)'}), "(label='', typ... |
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
from dace.transformation.dataflow import MapFusion
from dace.transformation.interstate import FPGATransformSDFG
from mapfusion_test import multiple_fusions, fusion_with_transient
import numpy as np
def multiple_fusions_fpga():
sdfg = mult... | [
"numpy.allclose",
"numpy.random.rand",
"numpy.zeros",
"mapfusion_test.multiple_fusions.to_sdfg",
"numpy.linalg.norm",
"numpy.zeros_like",
"mapfusion_test.fusion_with_transient.to_sdfg"
] | [((316, 342), 'mapfusion_test.multiple_fusions.to_sdfg', 'multiple_fusions.to_sdfg', ([], {}), '()\n', (340, 342), False, 'from mapfusion_test import multiple_fusions, fusion_with_transient\n'), ((575, 591), 'numpy.zeros_like', 'np.zeros_like', (['A'], {}), '(A)\n', (588, 591), True, 'import numpy as np\n'), ((600, 616... |
from django.shortcuts import render, redirect
from django.http import HttpResponse
from .forms import UploadFileForm
from django.http import HttpResponseRedirect
from django.views.decorators.csrf import csrf_exempt
import exifread
import uuid
from .models import images
from exif.settings import MEDIA_ROOT, APPROVED_SIG... | [
"django.shortcuts.render",
"jwt.decode",
"json.loads",
"django.http.HttpResponse",
"requests.get",
"django.contrib.auth.decorators.user_passes_test",
"django.shortcuts.redirect",
"exifread.process_file",
"django.contrib.auth.forms.UserCreationForm",
"django.contrib.auth.logout"
] | [((3295, 3322), 'django.contrib.auth.decorators.user_passes_test', 'user_passes_test', (['is_victim'], {}), '(is_victim)\n', (3311, 3322), False, 'from django.contrib.auth.decorators import login_required, user_passes_test\n'), ((4019, 4046), 'django.contrib.auth.decorators.user_passes_test', 'user_passes_test', (['is_... |
#!/usr/bin/env python3
import logging
import serial
import sys
import time
sys.path.append('.')
from logger.readers.serial_reader import SerialReader
################################################################################
class PolledSerialReader(SerialReader):
"""
Read text records from a serial port.... | [
"sys.path.append",
"logging.info",
"time.sleep"
] | [((77, 97), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (92, 97), False, 'import sys\n'), ((3076, 3124), 'logging.info', 'logging.info', (['"""Pausing %g seconds"""', 'pause_length'], {}), "('Pausing %g seconds', pause_length)\n", (3088, 3124), False, 'import logging\n'), ((3133, 3157), 'time.sl... |
from datetime import datetime
from pytest import fixture
from .model import DebtIndicators
@fixture
def debt_indicators() -> DebtIndicators:
return DebtIndicators(
asset_id = 1,
asset_symbol = 'SULA11',
search_date = datetime.now().isoformat(),
debt_net_worth = -1.86,
deb... | [
"datetime.datetime.now"
] | [((249, 263), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (261, 263), False, 'from datetime import datetime\n')] |
import numpy as np
import os
from skimage.io import imread
from skimage.transform import resize
from skimage.color import gray2rgb
import pandas as pd
from sklearn.metrics import confusion_matrix
import keras
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooling2D, AveragePooling2D, D... | [
"keras.layers.Conv2D",
"os.listdir",
"keras.layers.Flatten",
"pandas.read_csv",
"keras.layers.MaxPooling2D",
"keras.layers.AveragePooling2D",
"keras.utils.to_categorical",
"sklearn.model_selection.StratifiedKFold",
"keras.models.Sequential",
"skimage.io.imread",
"keras.layers.Dense",
"keras.la... | [((701, 719), 'os.listdir', 'os.listdir', (['imPath'], {}), '(imPath)\n', (711, 719), False, 'import os\n'), ((818, 875), 'pandas.read_csv', 'pd.read_csv', (['grndTruthPath'], {'names': 'clNames', 'delimiter': '"""\t"""'}), "(grndTruthPath, names=clNames, delimiter='\\t')\n", (829, 875), True, 'import pandas as pd\n'),... |
#!/usr/bin/env python
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__company__ = "Robotic Beverage Technologies Inc"
__status__ = "Development"
__date__ = "Late Updated: 2020-05-11"
__doc__ = "Class to operate at least 64 servos, 16 relays, and 32 motors at once with latency less then 100 ms"
# Useful docum... | [
"gpiozero.Motor.reverse",
"gpiozero.Motor.enable",
"time.sleep",
"numpy.empty",
"gpiozero.Motor.forward",
"gpiozero.Servo.dettach",
"gpiozero.Servo.value",
"gpiozero.Motor.disable"
] | [((5488, 5522), 'numpy.empty', 'np.empty', (['numOfWires'], {'dtype': 'object'}), '(numOfWires, dtype=object)\n', (5496, 5522), True, 'import numpy as np\n'), ((8218, 8231), 'gpiozero.Servo.value', 'Servo.value', ([], {}), '()\n', (8229, 8231), False, 'from gpiozero import Motor, Servo, LED, Energenie, OutputDevice\n')... |
import csv
from django.core.management import BaseCommand
from corehq.apps.es import CaseES, filters
from corehq.apps.locations.models import SQLLocation
from dimagi.utils.chunked import chunked
from corehq.util.log import with_progress_bar
CHILD_PROPERTIES = ['case_id', 'owner_id', 'opened_on', 'modified_on',
... | [
"csv.writer",
"corehq.util.log.with_progress_bar",
"corehq.apps.es.filters.term",
"corehq.apps.locations.models.SQLLocation.objects.filter",
"corehq.apps.locations.models.SQLLocation.objects.get_queryset_descendants",
"corehq.apps.es.CaseES"
] | [((771, 911), 'corehq.apps.locations.models.SQLLocation.objects.filter', 'SQLLocation.objects.filter', ([], {'domain': '"""icds-cas"""', 'location_id__in': "['d982a6fb4cca0824fbde59db18d2d422', '0ffe4a1f110ffc17bb9b749abdfd697c']"}), "(domain='icds-cas', location_id__in=[\n 'd982a6fb4cca0824fbde59db18d2d422', '0ffe4... |
from __future__ import print_function
import math
import numpy
import theano
import itertools
from theano import tensor, Op
from theano.gradient import disconnected_type
from fuel.utils import do_not_pickle_attributes
from picklable_itertools.extras import equizip
from collections import defaultdict, deque
from toposo... | [
"lvsr.error_rate.edit_distance",
"theano.tensor.ltensor3",
"lvsr.error_rate._bleu",
"theano.tensor.tensor3",
"theano.gradient.disconnected_type",
"lvsr.error_rate._edit_distance_matrix",
"numpy.zeros",
"theano.tensor.as_tensor_variable",
"lvsr.error_rate.reward_matrix",
"numpy.zeros_like",
"lvsr... | [((990, 1058), 'numpy.zeros', 'numpy.zeros', (['(recognized.shape + (self.alphabet_size,))'], {'dtype': '"""int64"""'}), "(recognized.shape + (self.alphabet_size,), dtype='int64')\n", (1001, 1058), False, 'import numpy\n'), ((1092, 1160), 'numpy.zeros', 'numpy.zeros', (['(recognized.shape + (self.alphabet_size,))'], {'... |
""" This module implements the definition of the different configuration.
NOTE: Make sure to run the function 'save_common_default_template'
to save the default config after altering CompleteConfiguration.
Write the default raw configuration template
>>> import muteria.configmanager.conf... | [
"os.path.abspath",
"muteria.common.mix.confirm_execution",
"os.path.isfile"
] | [((17662, 17687), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (17677, 17687), False, 'import os\n'), ((19047, 19071), 'os.path.isfile', 'os.path.isfile', (['filename'], {}), '(filename)\n', (19061, 19071), False, 'import os\n'), ((19088, 19209), 'muteria.common.mix.confirm_execution', 'com... |
from biblecoin import utils
from biblecoin.state import State
from biblecoin import vm
from biblecoin.state_transition import apply_transaction, apply_const_message, validate_block_header, initialize
from biblecoin.transactions import Transaction
from biblecoin.chain import Chain
from biblecoin.parse_genesis_declaratio... | [
"biblecoin.state_transition.validate_block_header",
"biblecoin.casper_utils.get_casper_ct",
"biblecoin.slogging.configure_logging",
"biblecoin.casper_utils.generate_validation_code",
"biblecoin.utils.privtoaddr",
"rlp.encode",
"biblecoin.casper_utils.get_timestamp",
"biblecoin.casper_utils.get_skips_a... | [((1175, 1221), 'biblecoin.slogging.configure_logging', 'configure_logging', ([], {'config_string': 'config_string'}), '(config_string=config_string)\n', (1192, 1221), False, 'from biblecoin.slogging import LogRecorder, configure_logging, set_level\n'), ((1865, 1880), 'biblecoin.casper_utils.get_casper_ct', 'get_casper... |
import click
from modules import console, Timer, DataProvider
def power_level(x, y, serial_number):
rack_id = x + 10
power_level = rack_id * y
power_level += serial_number
power_level *= rack_id
if power_level < 100:
return -5
power_level = int(power_level / 100)
power_level = powe... | [
"modules.console.log",
"click.command",
"modules.Timer",
"modules.console.header"
] | [((362, 377), 'click.command', 'click.command', ([], {}), '()\n', (375, 377), False, 'import click\n'), ((398, 430), 'modules.console.header', 'console.header', (['"""day 11, part 1"""'], {}), "('day 11, part 1')\n", (412, 430), False, 'from modules import console, Timer, DataProvider\n'), ((444, 451), 'modules.Timer',... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | [
"test.terra.reference.ref_kraus_noise.kraus_gate_error_circuits",
"test.terra.reference.ref_kraus_noise.kraus_gate_error_noise_models",
"qiskit.quantum_info.Statevector",
"dask.distributed.LocalCluster",
"qiskit.circuit.random.random_circuit",
"test.terra.reference.ref_kraus_noise.kraus_gate_error_counts"... | [((1618, 1646), 'qiskit.transpile', 'transpile', (['circuits', 'backend'], {}), '(circuits, backend)\n', (1627, 1646), False, 'from qiskit import QuantumCircuit, transpile\n'), ((2769, 2820), 'test.terra.backends.simulator_test_case.supported_methods', 'supported_methods', (["['statevector']", '[None, 1, 2, 3]'], {}), ... |
import os
import torchvision.datasets as datasets
import torchvision.transforms as transforms
def imagenet_data(type="train"):
data_path = '/home/7ml/ImageNet1k/'
datadir = os.path.join(data_path, type)
dataset = datasets.ImageFolder(
datadir,
transforms.Compose(
[
... | [
"torchvision.transforms.ToTensor",
"os.path.join",
"torchvision.transforms.RandomResizedCrop",
"torchvision.transforms.Normalize"
] | [((183, 212), 'os.path.join', 'os.path.join', (['data_path', 'type'], {}), '(data_path, type)\n', (195, 212), False, 'import os\n'), ((324, 356), 'torchvision.transforms.RandomResizedCrop', 'transforms.RandomResizedCrop', (['(32)'], {}), '(32)\n', (352, 356), True, 'import torchvision.transforms as transforms\n'), ((37... |
"""Base AutoML class."""
import logging
from typing import Any
from typing import Dict
from typing import Iterable
from typing import List
from typing import Optional
from typing import Sequence
from ..dataset.base import LAMLDataset
from ..dataset.utils import concatenate
from ..pipelines.ml.base import MLPipeline
... | [
"logging.getLogger"
] | [((621, 648), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (638, 648), False, 'import logging\n')] |
#!/usr/bin/python3
import time
import brickpi3
import pygame
BP = brickpi3.BrickPi3()
# call this function to turn off the motors and exit safely.
def SafeExit():
# Unconfigure the sensors, disable the motors
# and restore the LED to the control of the BrickPi3 firmware.
BP.reset_all()
#Power motor A an... | [
"brickpi3.BrickPi3",
"pygame.init",
"pygame.event.get",
"pygame.display.set_mode",
"time.sleep",
"pygame.time.Clock"
] | [((68, 87), 'brickpi3.BrickPi3', 'brickpi3.BrickPi3', ([], {}), '()\n', (85, 87), False, 'import brickpi3\n'), ((725, 741), 'time.sleep', 'time.sleep', (['(0.02)'], {}), '(0.02)\n', (735, 741), False, 'import time\n'), ((1111, 1127), 'time.sleep', 'time.sleep', (['(0.02)'], {}), '(0.02)\n', (1121, 1127), False, 'import... |
from functools import wraps
from aiogram import types
from app.core.config import ADMIN_IDS
def admin_requires(f):
@wraps(f)
async def wrapped(message: types.Message, *args, **kwargs):
if not ADMIN_IDS or message.from_user.id not in ADMIN_IDS:
await message.bot.delete_message(
... | [
"functools.wraps"
] | [((124, 132), 'functools.wraps', 'wraps', (['f'], {}), '(f)\n', (129, 132), False, 'from functools import wraps\n')] |
import boto3
from botocore.config import Config
import json
import os
TABLE_NAME = os.environ['TABLE_NAME']
config = Config(connect_timeout=5, read_timeout=5, retries={'max_attempts': 1})
dynamodb = boto3.client('dynamodb', config=config)
def assemble(response):
body = {
'quotes': []
}
for item ... | [
"botocore.config.Config",
"json.dumps",
"boto3.client"
] | [((119, 189), 'botocore.config.Config', 'Config', ([], {'connect_timeout': '(5)', 'read_timeout': '(5)', 'retries': "{'max_attempts': 1}"}), "(connect_timeout=5, read_timeout=5, retries={'max_attempts': 1})\n", (125, 189), False, 'from botocore.config import Config\n'), ((201, 240), 'boto3.client', 'boto3.client', (['"... |
import sys
from torch.utils.data import Dataset, DataLoader
import os
import os.path as osp
import glob
import numpy as np
import random
import cv2
import pickle as pkl
import json
import h5py
import torch
import matplotlib.pyplot as plt
from lib.utils.misc import process_dataset_for_video
class Surreal... | [
"os.path.exists",
"pickle.dump",
"numpy.random.random_sample",
"random.seed",
"h5py.File",
"torch.from_numpy",
"numpy.array",
"lib.utils.misc.process_dataset_for_video",
"numpy.random.randint",
"numpy.random.seed",
"numpy.concatenate",
"numpy.linalg.norm",
"numpy.random.shuffle"
] | [((1614, 1644), 'h5py.File', 'h5py.File', (['self.data_path', '"""r"""'], {}), "(self.data_path, 'r')\n", (1623, 1644), False, 'import h5py\n'), ((1667, 1684), 'numpy.array', 'np.array', (['fp[key]'], {}), '(fp[key])\n', (1675, 1684), True, 'import numpy as np\n'), ((2422, 2444), 'numpy.array', 'np.array', (["fp['seqle... |
import sqlite3
class CreateHackBulgariaDatabase:
def __init__(self):
create_students_table_query = """CREATE TABLE IF NOT EXISTS Students(
student_id INTEGER PRIMARY KEY,
student_name TEXT,
student_github TEXT)"""
create_courses_table_query = """CREATE TABLE ... | [
"sqlite3.connect"
] | [((781, 821), 'sqlite3.connect', 'sqlite3.connect', (['"""hackbulgaria_database"""'], {}), "('hackbulgaria_database')\n", (796, 821), False, 'import sqlite3\n')] |
import tempfile
from pathlib import Path
from typing import Any, Dict, Mapping, TypedDict
from uuid import uuid4
from kolga.libs.database import Database
from kolga.libs.service import Service
from kolga.settings import settings
from kolga.utils.general import (
DATABASE_DEFAULT_PORT_MAPPING,
MYSQL,
get_de... | [
"pathlib.Path",
"kolga.utils.general.string_to_yaml",
"kolga.utils.general.get_deploy_name",
"kolga.utils.general.get_project_secret_var",
"uuid.uuid4",
"kolga.libs.database.Database",
"kolga.utils.url.URL",
"tempfile.NamedTemporaryFile"
] | [((2029, 2056), 'kolga.utils.general.get_deploy_name', 'get_deploy_name', (['self.track'], {}), '(self.track)\n', (2044, 2056), False, 'from kolga.utils.general import DATABASE_DEFAULT_PORT_MAPPING, MYSQL, get_deploy_name, get_project_secret_var, string_to_yaml\n'), ((2165, 2208), 'kolga.utils.url.URL', 'URL', ([], {'d... |
'''
Redis Management Modules and Models
'''
from flask import g, current_app
from redis import Redis
def get_redis_cur(store_g=False):
'''
Open DB Cursor Connection
Params
-------
store_g : if True, store to Flask Global Object g.
'''
redis_cur = Redis(
host=current_app.config['RE... | [
"flask.g.pop",
"redis.Redis"
] | [((278, 407), 'redis.Redis', 'Redis', ([], {'host': "current_app.config['REDIS_HOST']", 'port': "current_app.config['REDIS_PORT']", 'password': "current_app.config['REDIS_PW']"}), "(host=current_app.config['REDIS_HOST'], port=current_app.config[\n 'REDIS_PORT'], password=current_app.config['REDIS_PW'])\n", (283, 407... |
from mp.core import extension as _ext
from mp.engine.pytorch.framework import torch as _torch
_F = _torch.optim
@_ext.static('__optim_adam', fixed=True)
def method_optim_adam(plan, toward, args, kwargs):
args.assert_sizeof(toward.symbol, 1)
lr, = args.get_value()
optim = _F.Adam({_torch.zeros(1)}, lr)
... | [
"mp.core.extension.static",
"mp.engine.pytorch.framework.torch.zeros"
] | [((116, 155), 'mp.core.extension.static', '_ext.static', (['"""__optim_adam"""'], {'fixed': '(True)'}), "('__optim_adam', fixed=True)\n", (127, 155), True, 'from mp.core import extension as _ext\n'), ((480, 499), 'mp.core.extension.static', '_ext.static', (['"""step"""'], {}), "('step')\n", (491, 499), True, 'from mp.c... |
import numpy as np
class BayesDiscri:
def __init__(self):
'''
:__init__: 初始化BayesDiscri类
'''
self.varipro=[] # 各个特征xk在各个类别yi下的条件概率
self.priorpro={} # 各个类别yi的先验概率
self.respro=[] # 测试集中每个样本向量属于各个类别的概率
def train(self, data, rowvar=False):
... | [
"numpy.array",
"numpy.shape"
] | [((797, 811), 'numpy.shape', 'np.shape', (['data'], {}), '(data)\n', (805, 811), True, 'import numpy as np\n'), ((840, 854), 'numpy.shape', 'np.shape', (['data'], {}), '(data)\n', (848, 854), True, 'import numpy as np\n'), ((2711, 2727), 'numpy.array', 'np.array', (['[data]'], {}), '([data])\n', (2719, 2727), True, 'im... |
from tabulate import tabulate
row = ["o"] * 4
board = [row] * 4
board[1][1] = "x"
print(tabulate(board))
| [
"tabulate.tabulate"
] | [((90, 105), 'tabulate.tabulate', 'tabulate', (['board'], {}), '(board)\n', (98, 105), False, 'from tabulate import tabulate\n')] |
#!/usr/bin/python3 -S
# -*- coding: utf-8 -*-
import unittest
import pickle
import copy
from cargo import aliased, Model
from cargo.fields import Field
from unit_tests import configure
class Tc(object):
def __init__(self, field):
self.field = field
class FieldModel(Model):
field = Field()
class... | [
"cargo.fields.Field",
"pickle.dumps",
"cargo.aliased",
"copy.deepcopy",
"copy.copy",
"unit_tests.configure.run_tests"
] | [((305, 312), 'cargo.fields.Field', 'Field', ([], {}), '()\n', (310, 312), False, 'from cargo.fields import Field\n'), ((3933, 3963), 'unit_tests.configure.run_tests', 'configure.run_tests', (['TestField'], {}), '(TestField)\n', (3952, 3963), False, 'from unit_tests import configure\n'), ((1890, 1910), 'copy.copy', 'co... |
from collections import OrderedDict
import torch
import torch.nn as nn
import torch.nn.functional as F
from horch.common import tuplify
from horch.models import get_default_activation, get_default_norm_layer
from horch.config import cfg
# sigmoid = torch.nn.Sigmoid()
class SwishFunction(torch.autograd.Function):
... | [
"torch.nn.ReLU",
"torch.nn.init.constant_",
"torch.nn.Sequential",
"horch.common.tuplify",
"torch.nn.init.xavier_normal_",
"torch.nn.BatchNorm1d",
"torch.nn.functional.interpolate",
"torch.nn.AvgPool2d",
"torch.nn.functional.softmax",
"torch.nn.ReLU6",
"torch.nn.BatchNorm2d",
"torch.nn.GroupNo... | [((2102, 2169), 'torch.nn.functional.interpolate', 'F.interpolate', (['x'], {'size': '(h, w)', 'mode': '"""bilinear"""', 'align_corners': '(False)'}), "(x, size=(h, w), mode='bilinear', align_corners=False)\n", (2115, 2169), True, 'import torch.nn.functional as F\n'), ((2181, 2205), 'torch.cat', 'torch.cat', (['(x, y)'... |
import pandas as pd
df = pd.read_csv("DataExport.csv", sep="|")
df.to_csv("DataExport_for_postgres.csv", header=False, index=False) | [
"pandas.read_csv"
] | [((25, 63), 'pandas.read_csv', 'pd.read_csv', (['"""DataExport.csv"""'], {'sep': '"""|"""'}), "('DataExport.csv', sep='|')\n", (36, 63), True, 'import pandas as pd\n')] |
from __future__ import division
import numpy as np
import six
from keras.models import Model
from keras.layers import (
Input,
Activation,
Dense,
Flatten
)
from keras.layers.convolutional import (
Conv2D,
MaxPooling2D,
AveragePooling2D
)
from keras.layers.merge import add
from keras.layers.n... | [
"numpy.zeros",
"keras.regularizers.l2"
] | [((436, 460), 'numpy.zeros', 'np.zeros', (['(1, 34, 34, 3)'], {}), '((1, 34, 34, 3))\n', (444, 460), True, 'import numpy as np\n'), ((473, 497), 'numpy.zeros', 'np.zeros', (['(1, 10, 10, 3)'], {}), '((1, 10, 10, 3))\n', (481, 497), True, 'import numpy as np\n'), ((1135, 1145), 'keras.regularizers.l2', 'l2', (['(0.0001)... |
import csv
import json
import glob
import re
import os
try:
os.makedirs('json')
except:
pass
to_cvt = []
for file in glob.glob("*.csv"):
to_cvt.append(file)
for f in to_cvt:
csvfile = open( f , 'r')
jsonfile = open('./json/' +f[:-4] +'.json', 'w', encoding='utf8')
fieldnames = ''
for i in open(f,'r'):
fi... | [
"os.makedirs",
"json.dump",
"csv.DictReader",
"glob.glob"
] | [((121, 139), 'glob.glob', 'glob.glob', (['"""*.csv"""'], {}), "('*.csv')\n", (130, 139), False, 'import glob\n'), ((62, 81), 'os.makedirs', 'os.makedirs', (['"""json"""'], {}), "('json')\n", (73, 81), False, 'import os\n'), ((519, 554), 'csv.DictReader', 'csv.DictReader', (['csvfile', 'fieldnames'], {}), '(csvfile, fi... |
"""
14 - Faça um programa que leia um vetor de 10 posições e verifique se existem valores iguais e escreva na tela.
"""
from collections import defaultdict
vetores = []
for n in range(10):
vetores.append(int(input(f'Digite o número: ')))
print(f'Estes foram os números digitados: {vetores}')
print('Foram digitados'... | [
"collections.defaultdict"
] | [((393, 410), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (404, 410), False, 'from collections import defaultdict\n')] |
# Copyright (C) 2019 by <EMAIL>
# This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
import vulkan as vk
import vks.vulkanbuffer
class VulkanDevice:
def __init__(self, physicalDevice):
assert(physicalDevice is not None)
self.physicalDevice = physicalDevice
... | [
"vulkan.vkGetBufferMemoryRequirements",
"vulkan.vkAllocateCommandBuffers",
"vulkan.VkDeviceCreateInfo",
"vulkan.vkGetPhysicalDeviceFeatures",
"vulkan.vkGetPhysicalDeviceMemoryProperties",
"vulkan.vkCreateBuffer",
"vulkan.VkCommandBufferBeginInfo",
"vulkan.VkSubmitInfo",
"vulkan.vkEnumerateDeviceExte... | [((542, 595), 'vulkan.vkGetPhysicalDeviceProperties', 'vk.vkGetPhysicalDeviceProperties', (['self.physicalDevice'], {}), '(self.physicalDevice)\n', (574, 595), True, 'import vulkan as vk\n'), ((691, 742), 'vulkan.vkGetPhysicalDeviceFeatures', 'vk.vkGetPhysicalDeviceFeatures', (['self.physicalDevice'], {}), '(self.physi... |
import pytest
import sys
import unittest
from six.moves import cStringIO as StringIO
from .. import parser
# There aren't many tests here because it turns out to be way more convenient to
# use test_serializer for the majority of cases
@pytest.mark.xfail(sys.version[0] == "3",
reason="wptmanifes... | [
"pytest.mark.xfail",
"six.moves.cStringIO",
"unittest.main"
] | [((242, 336), 'pytest.mark.xfail', 'pytest.mark.xfail', (["(sys.version[0] == '3')"], {'reason': '"""wptmanifest.parser doesn\'t support py3"""'}), '(sys.version[0] == \'3\', reason=\n "wptmanifest.parser doesn\'t support py3")\n', (259, 336), False, 'import pytest\n'), ((3636, 3651), 'unittest.main', 'unittest.main... |
import streamlit as st
import pandas as pd
import plotly.graph_objects as go
import plotly.express as px
import plotly.figure_factory as ff
@st.cache
def load_csv(file):
return pd.read_csv(file)
def main():
st.title("Depression Analyzer")
st.header("Visualize emotion data from CSV file")
module1_fi... | [
"streamlit.markdown",
"plotly.express.histogram",
"pandas.read_csv",
"plotly.graph_objects.Pie",
"streamlit.file_uploader",
"streamlit.button",
"streamlit.write",
"streamlit.subheader",
"streamlit.plotly_chart",
"streamlit.header",
"streamlit.title"
] | [((184, 201), 'pandas.read_csv', 'pd.read_csv', (['file'], {}), '(file)\n', (195, 201), True, 'import pandas as pd\n'), ((219, 250), 'streamlit.title', 'st.title', (['"""Depression Analyzer"""'], {}), "('Depression Analyzer')\n", (227, 250), True, 'import streamlit as st\n'), ((255, 304), 'streamlit.header', 'st.header... |
from typing import Dict, Optional
from pyspark.sql import Column, DataFrame
from pyspark.sql.functions import when
from spark_auto_mapper.type_definitions.defined_types import AutoMapperTextInputType
from spark_auto_mapper.data_types.data_type_base import AutoMapperDataTypeBase
from spark_auto_mapper.data_types.expr... | [
"spark_auto_mapper.helpers.value_parser.AutoMapperValueParser.parse_value"
] | [((1511, 1553), 'spark_auto_mapper.helpers.value_parser.AutoMapperValueParser.parse_value', 'AutoMapperValueParser.parse_value', (['default'], {}), '(default)\n', (1544, 1553), False, 'from spark_auto_mapper.helpers.value_parser import AutoMapperValueParser\n'), ((1227, 1267), 'spark_auto_mapper.helpers.value_parser.Au... |
"""Test MRI-ESM1 fixes."""
import unittest
from esmvalcore.cmor.fix import Fix
from esmvalcore.cmor._fixes.cmip5.mri_esm1 import Msftmyz
class TestMsftmyz(unittest.TestCase):
"""Test msftmyz fixes."""
def test_get(self):
"""Test fix get"""
self.assertListEqual(
Fix.get_fixes('CMIP... | [
"esmvalcore.cmor._fixes.cmip5.mri_esm1.Msftmyz",
"esmvalcore.cmor.fix.Fix.get_fixes"
] | [((301, 354), 'esmvalcore.cmor.fix.Fix.get_fixes', 'Fix.get_fixes', (['"""CMIP5"""', '"""MRI-ESM1"""', '"""Amon"""', '"""msftmyz"""'], {}), "('CMIP5', 'MRI-ESM1', 'Amon', 'msftmyz')\n", (314, 354), False, 'from esmvalcore.cmor.fix import Fix\n'), ((369, 382), 'esmvalcore.cmor._fixes.cmip5.mri_esm1.Msftmyz', 'Msftmyz', ... |
import chromedriver_autoinstaller
from web_crawler.utils.crawler_base import CrawlerBase
from web_crawler.tasks import NaverBlogCrawler, DaumBlogCrawler
TASKS = {
"naver_blog": NaverBlogCrawler,
"daum_blog": DaumBlogCrawler
}
CHROME_VER = chromedriver_autoinstaller.get_chrome_version().split('.')[0]
BASE_DRI... | [
"chromedriver_autoinstaller.get_chrome_version"
] | [((250, 297), 'chromedriver_autoinstaller.get_chrome_version', 'chromedriver_autoinstaller.get_chrome_version', ([], {}), '()\n', (295, 297), False, 'import chromedriver_autoinstaller\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
import io
import os.path
README = \
'''
Adapt google assistant's gRPC sample app for working with respeakerd
'''
def samples_requirements():
with io.open('requirements.txt') as f:
for p in f... | [
"setuptools.find_packages",
"io.open"
] | [((268, 295), 'io.open', 'io.open', (['"""requirements.txt"""'], {}), "('requirements.txt')\n", (275, 295), False, 'import io\n'), ((778, 831), 'setuptools.find_packages', 'find_packages', ([], {'include': "['googleassistant_respeakerd']"}), "(include=['googleassistant_respeakerd'])\n", (791, 831), False, 'from setupto... |
import machine
spi = machine.SPI(1)
spi.init(baudrate=1000000)
rclk = machine.Pin(15, machine.Pin.OUT)
rclk.off()
ZERO = 0b00111111
ONE = 0b00000110
TWO = 0b01011011
THREE = 0b01001111
FOUR = 0b01100110
FIVE = 0b01101101
SIX = 0b01111101
SEVEN = 0b00000111
EIGHT = 0b01111111
NINE = 0b01101111
digits = [ZER... | [
"machine.Pin",
"machine.SPI"
] | [((22, 36), 'machine.SPI', 'machine.SPI', (['(1)'], {}), '(1)\n', (33, 36), False, 'import machine\n'), ((71, 103), 'machine.Pin', 'machine.Pin', (['(15)', 'machine.Pin.OUT'], {}), '(15, machine.Pin.OUT)\n', (82, 103), False, 'import machine\n')] |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from typing import List, Pattern
from recognizers_text.matcher.string_matcher import StringMatcher
from recognizers_text.utilities import QueryProcessor
from ..base_timezone import TimeZoneExtractorConfiguration
from ...res... | [
"recognizers_text.matcher.string_matcher.StringMatcher"
] | [((1785, 1800), 'recognizers_text.matcher.string_matcher.StringMatcher', 'StringMatcher', ([], {}), '()\n', (1798, 1800), False, 'from recognizers_text.matcher.string_matcher import StringMatcher\n')] |
from typing import Tuple
import numpy as np
import math
class Point2D:
def __init__(self, x_init, y_init):
self.x = x_init
self.y = y_init
def as_tuple(self):
return self.x, self.y
def as_int_tuple(self):
return int(self.x), int(self.y)
def shift(self, x, y):
... | [
"numpy.argmin",
"math.sqrt"
] | [((528, 600), 'math.sqrt', 'math.sqrt', (['((self.x - other_point.x) ** 2 + (self.y - other_point.y) ** 2)'], {}), '((self.x - other_point.x) ** 2 + (self.y - other_point.y) ** 2)\n', (537, 600), False, 'import math\n'), ((748, 768), 'numpy.argmin', 'np.argmin', (['distances'], {}), '(distances)\n', (757, 768), True, '... |
import os
from django.conf.urls import url
from django.forms.forms import pretty_name
from django.http import HttpResponse, HttpResponseForbidden, JsonResponse
from django.template import Context
from django.template.loader import get_template
from glitter.assets.forms import ImageForm
from glitter.assets.models impo... | [
"glitter.assets.widgets.ImageSelect",
"django.conf.urls.url",
"django.http.JsonResponse",
"django.http.HttpResponse",
"django.template.Context",
"django.http.HttpResponseForbidden",
"os.path.splitext",
"glitter.assets.models.Image.objects.filter",
"django.forms.forms.pretty_name",
"glitter.blockad... | [((3470, 3519), 'glitter.blockadmin.blocks.site.register', 'blocks.site.register', (['ImageBlock', 'ImageBlockAdmin'], {}), '(ImageBlock, ImageBlockAdmin)\n', (3490, 3519), False, 'from glitter.blockadmin import blocks\n'), ((3520, 3568), 'glitter.blockadmin.blocks.site.register_block', 'blocks.site.register_block', ([... |
"""Simple if-else / swicth-case test."""
from src.SProgram import SProgram as program
from src.conf.SStd import SStd
def get_programData():
return {
"confs": [
SStd
],
"variableNameValuePairs": [
"i"
],
"states": [
("main", [
... | [
"src.SProgram.SProgram"
] | [((1830, 1852), 'src.SProgram.SProgram', 'program', ([], {}), '(**programData)\n', (1837, 1852), True, 'from src.SProgram import SProgram as program\n')] |
'''
Usage 1: python3 split_and_run.py --dataset [dataset name] --num_split [# of split] --metric [distance measure] --num_leaves [num_leaves] --num_search [num_leaves_to_search] --coarse_training_size [coarse traing sample size] --fine_training_size [fine training sample size] --threshold [threshold] --reorder [reorder... | [
"numpy.fromfile",
"runfaiss.faiss_search",
"math.log",
"numpy.argsort",
"numpy.array",
"ctypes.CDLL",
"numpy.linalg.norm",
"numpy.load",
"argparse.ArgumentParser",
"scann.scann_ops_pybind.builder",
"numpy.sort",
"numpy.memmap",
"multiprocessing.pool.ThreadPool",
"runfaiss.faiss_search_flat... | [((559, 605), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Options"""'}), "(description='Options')\n", (582, 605), False, 'import argparse\n'), ((84982, 85009), 'os.path.isdir', 'os.path.isdir', (['"""/arc-share"""'], {}), "('/arc-share')\n", (84995, 85009), False, 'import os\n'), ((85... |
from textwrap import dedent
op_table = {}
reverse_op_table = {}
def is_syntax(w):
return w[0] in "~'\";:,.|@&$#"
def is_op(w):
lhs = w[:3]
rhs = w[3:]
if lhs not in op_table:
return False
for c in rhs:
if c not in "2kr":
return False
return True
def build_op_t... | [
"textwrap.dedent"
] | [((388, 860), 'textwrap.dedent', 'dedent', (['"""\n BRK 0x00 a b c m[pc+1]\n LIT 0x00\n INC 0x01\n POP 0x02\n DUP 0x03\n NIP 0x04\n SWP 0x05\n OVR 0x06\n ROT 0x07\n EQU 0x08\n NEQ 0x09\n GTH 0x0a\n LTH 0x0b\n JMP 0x0c\n JCN 0x0d\n JSR 0x0e\n STH 0x0f\n LDZ 0x10\n ... |
"""
Data-oblivious sketching methods.
Provide an OO interface around existing procedural implementations.
Names of implementation classes take the form "SkOp[XY]", where
XY = ON: orthonormal
XY = GA: Gaussian
X = S: sparse (need a sparse matrix data structure)
Y = J: sparse J... | [
"parla.utils.sketching.sampling_operator",
"parla.utils.sketching.sparse_sign_operator",
"parla.utils.sketching.orthonormal_operator",
"parla.utils.sketching.srct_operator",
"parla.utils.sketching.sjlt_operator",
"parla.utils.sketching.gaussian_operator"
] | [((886, 931), 'parla.utils.sketching.orthonormal_operator', 'usk.orthonormal_operator', (['n_rows', 'n_cols', 'rng'], {}), '(n_rows, n_cols, rng)\n', (910, 931), True, 'import parla.utils.sketching as usk\n'), ((1148, 1206), 'parla.utils.sketching.gaussian_operator', 'usk.gaussian_operator', (['n_rows', 'n_cols', 'rng'... |
import scadnano as sc
import modifications as mod
import dataclasses
def create_design():
stap_left_ss1 = sc.Domain(1, True, 0, 16)
stap_left_ss0 = sc.Domain(0, False, 0, 16)
stap_right_ss0 = sc.Domain(0, False, 16, 32)
stap_right_ss1 = sc.Domain(1, True, 16, 32)
scaf_ss1_left = sc.Domain(1, False,... | [
"scadnano.Design",
"scadnano.Domain",
"scadnano.Strand"
] | [((111, 136), 'scadnano.Domain', 'sc.Domain', (['(1)', '(True)', '(0)', '(16)'], {}), '(1, True, 0, 16)\n', (120, 136), True, 'import scadnano as sc\n'), ((157, 183), 'scadnano.Domain', 'sc.Domain', (['(0)', '(False)', '(0)', '(16)'], {}), '(0, False, 0, 16)\n', (166, 183), True, 'import scadnano as sc\n'), ((205, 232)... |
import sys
from bs4 import BeautifulSoup
input_file_path = sys.argv[1]
output_file_path = sys.argv[2]
with open(input_file_path, "r") as myfile:
xml_str = myfile.read()
soup = BeautifulSoup(xml_str, "lxml")
placemarks = soup.find_all('placemark')
placemark_str_list = list()
for placemark in placemarks:
hosp... | [
"bs4.BeautifulSoup"
] | [((183, 213), 'bs4.BeautifulSoup', 'BeautifulSoup', (['xml_str', '"""lxml"""'], {}), "(xml_str, 'lxml')\n", (196, 213), False, 'from bs4 import BeautifulSoup\n')] |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"smu.smu_sqlite.SMUSQLite",
"csv.writer"
] | [((710, 763), 'smu.smu_sqlite.SMUSQLite', 'smu_sqlite.SMUSQLite', (['"""20220104_standard.sqlite"""', '"""r"""'], {}), "('20220104_standard.sqlite', 'r')\n", (730, 763), False, 'from smu import smu_sqlite\n'), ((1063, 1085), 'csv.writer', 'csv.writer', (['sys.stdout'], {}), '(sys.stdout)\n', (1073, 1085), False, 'impor... |
"""
This handles mapping the filenames in the export
to the corresponding functions and caching the results
"""
import os
import re
from pathlib import Path
from typing import (
Iterator,
Dict,
Callable,
Any,
Optional,
List,
Type,
Tuple,
cast,
)
from collections import defaultdict
... | [
"pathlib.Path",
"os.path.join",
"re.match",
"collections.defaultdict",
"typing.cast"
] | [((1573, 1599), 'typing.cast', 'cast', (['_CacheKeySingle', 'val'], {}), '(_CacheKeySingle, val)\n', (1577, 1599), False, 'from typing import Iterator, Dict, Callable, Any, Optional, List, Type, Tuple, cast\n'), ((13232, 13249), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (13243, 13249), False... |
import disnake
def create_components(current_page, embeds, print=False):
length = len(embeds)
if length == 1:
return []
if not print:
page_buttons = [
disnake.ui.Button(label="", emoji="◀️", style=disnake.ButtonStyle.grey, disabled=(current_page == 0),
... | [
"disnake.ui.Button",
"disnake.ui.ActionRow"
] | [((1367, 1389), 'disnake.ui.ActionRow', 'disnake.ui.ActionRow', ([], {}), '()\n', (1387, 1389), False, 'import disnake\n'), ((193, 318), 'disnake.ui.Button', 'disnake.ui.Button', ([], {'label': '""""""', 'emoji': '"""◀️"""', 'style': 'disnake.ButtonStyle.grey', 'disabled': '(current_page == 0)', 'custom_id': '"""Previo... |
import glob
import sys
import re
wildcard_path = sys.argv[1]
print("iteration,exact_match,first_word_accuracy")
for path in glob.glob(wildcard_path):
it_res = re.match(".*checkpoint-([0-9]+)[/].*", path)
it = it_res.group(1)
with open(path, "r") as res_file:
results = []
'''
# OLD BEHAVIOR
for ... | [
"re.match",
"glob.glob"
] | [((127, 151), 'glob.glob', 'glob.glob', (['wildcard_path'], {}), '(wildcard_path)\n', (136, 151), False, 'import glob\n'), ((164, 208), 're.match', 're.match', (['""".*checkpoint-([0-9]+)[/].*"""', 'path'], {}), "('.*checkpoint-([0-9]+)[/].*', path)\n", (172, 208), False, 'import re\n')] |
from scipy.io import loadmat
#Please change the path from where your file can be loaded , the dataset is not in this repository
# You can download the dataset from Kaggle
def getdata():
train = loadmat("../large_files/train_32x32.mat")
test = loadmat("../large_files/test_32x32.mat")
return train,test
| [
"scipy.io.loadmat"
] | [((203, 244), 'scipy.io.loadmat', 'loadmat', (['"""../large_files/train_32x32.mat"""'], {}), "('../large_files/train_32x32.mat')\n", (210, 244), False, 'from scipy.io import loadmat\n'), ((256, 296), 'scipy.io.loadmat', 'loadmat', (['"""../large_files/test_32x32.mat"""'], {}), "('../large_files/test_32x32.mat')\n", (26... |
#!/usr/bin/env python3
import sys, os, subprocess, psutil
from filelock import filelock
#TODO: Better interface existence checks
if len(sys.argv) < 3:
print("Usage: <intf one> <intf two>")
sys.exit(1)
intone = sys.argv[1]
inttwo = sys.argv[2]
rt_table = "/etc/iproute2/rt_tables"
def check_network_managers():
pi... | [
"subprocess.Popen",
"psutil.process_iter",
"filelock.filelock.FileLock",
"os.unlink",
"sys.exit"
] | [((194, 205), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (202, 205), False, 'import sys, os, subprocess, psutil\n'), ((2348, 2446), 'subprocess.Popen', 'subprocess.Popen', (["['ip', 'link', 'show', intf]"], {'stdout': 'subprocess.PIPE', 'stderr': 'subprocess.PIPE'}), "(['ip', 'link', 'show', intf], stdout=subproce... |
#!/usr/bin/env python3
import math
class UnitVectors:
"""List of unit vectors"""
def __init__(self, vectors):
self.vectors = vectors
def __getitem__(self, k):
return self.vectors[k % len(self.vectors)]
@staticmethod
def Create(count=8):
step = 360.0 / count
unit_v... | [
"math.cos",
"math.sin",
"argparse.ArgumentParser",
"math.radians"
] | [((582, 607), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (605, 607), False, 'import argparse\n'), ((384, 406), 'math.radians', 'math.radians', (['(i * step)'], {}), '(i * step)\n', (396, 406), False, 'import math\n'), ((440, 456), 'math.cos', 'math.cos', (['radian'], {}), '(radian)\n', (448... |
from pumpwood_djangoviews.routers import PumpWoodRouter
from django.conf.urls import url
from pumpwood_djangoauth.registration import views
pumpwoodrouter = PumpWoodRouter()
pumpwoodrouter.register(viewset=views.RestUser)
urlpatterns = [
url(r'^registration/login/$', views.login_view,
name='rest__registra... | [
"pumpwood_djangoviews.routers.PumpWoodRouter",
"django.conf.urls.url"
] | [((158, 174), 'pumpwood_djangoviews.routers.PumpWoodRouter', 'PumpWoodRouter', ([], {}), '()\n', (172, 174), False, 'from pumpwood_djangoviews.routers import PumpWoodRouter\n'), ((244, 329), 'django.conf.urls.url', 'url', (['"""^registration/login/$"""', 'views.login_view'], {'name': '"""rest__registration__login"""'})... |
#!/usr/bin/env python
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Prints all histogram names."""
from __future__ import print_function
import argparse
import os
import subprocess
import sys
import... | [
"subprocess.check_output",
"argparse.ArgumentParser",
"extract_histograms.ExtractHistogramsFromDom",
"extract_histograms.ExtractNames",
"merge_xml.MergeFiles",
"os.path.dirname",
"io.StringIO"
] | [((640, 677), 'merge_xml.MergeFiles', 'merge_xml.MergeFiles', ([], {'files': 'xml_files'}), '(files=xml_files)\n', (660, 677), False, 'import merge_xml\n'), ((705, 753), 'extract_histograms.ExtractHistogramsFromDom', 'extract_histograms.ExtractHistogramsFromDom', (['doc'], {}), '(doc)\n', (748, 753), False, 'import ext... |
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
"paddle.sign",
"math.pow",
"paddle.clip",
"paddle.abs",
"paddle.nn.initializer.Uniform"
] | [((1373, 1408), 'math.pow', 'math.pow', (['(self.iterations + 1.0)', 'mu'], {}), '(self.iterations + 1.0, mu)\n', (1381, 1408), False, 'import math\n'), ((1471, 1506), 'math.pow', 'math.pow', (['(self.iterations + 0.0)', 'mu'], {}), '(self.iterations + 0.0, mu)\n', (1479, 1506), False, 'import math\n'), ((1846, 1863), ... |
#!/usr/bin/env python
# coding: utf-8
'''
mongodb plugin
--------------
'''
__author__ = "<NAME> <<EMAIL>>"
# Import Python libs
import ssl
import time
import atexit
from collections import namedtuple
from datetime import datetime, timedelta
# Import third party libs
from pymongo import MongoClient
from flask import... | [
"collections.namedtuple",
"datetime.datetime.now",
"pymongo.MongoClient",
"time.time",
"atexit.register"
] | [((350, 380), 'collections.namedtuple', 'namedtuple', (['"""Client"""', "['host']"], {}), "('Client', ['host'])\n", (360, 380), False, 'from collections import namedtuple\n'), ((1730, 1761), 'atexit.register', 'atexit.register', (['logout', 'client'], {}), '(logout, client)\n', (1745, 1761), False, 'import atexit\n'), ... |
# coding:utf-8
import web
import logging
import traceback
import rpicard
import os
import rpicard.exception.errorcode as errorcode
from rpicard.exception.rpicardexp import RpiCarDExp
logger = logging.getLogger(__name__)
class Index:
def GET(self):
raise web.seeother('/resource?t=1&path=index')
class Res... | [
"logging.getLogger",
"traceback.format_exc",
"web.seeother",
"os.path.normpath",
"os.path.dirname",
"web.input",
"web.notfound",
"os.path.abspath",
"rpicard.exception.rpicardexp.RpiCarDExp",
"web.header"
] | [((194, 221), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (211, 221), False, 'import logging\n'), ((269, 309), 'web.seeother', 'web.seeother', (['"""/resource?t=1&path=index"""'], {}), "('/resource?t=1&path=index')\n", (281, 309), False, 'import web\n'), ((1170, 1223), 'web.header', 'w... |
# -*- coding: utf-8 -*-
"""Package contains CLI tools implementation related to admins"""
from click import echo
from vulyk.models.user import User
def list_admin() -> None:
"""
Outputs a list of emails of administrators.
"""
admin_users = list(User.objects(admin=True).scalar('email'))
if admin_... | [
"vulyk.models.user.User.objects.filter",
"click.echo",
"vulyk.models.user.User.objects"
] | [((868, 900), 'vulyk.models.user.User.objects.filter', 'User.objects.filter', ([], {'email': 'email'}), '(email=email)\n', (887, 900), False, 'from vulyk.models.user import User\n'), ((1053, 1065), 'click.echo', 'echo', (['"""Done"""'], {}), "('Done')\n", (1057, 1065), False, 'from click import echo\n'), ((335, 361), '... |
from unittest import TestCase
from tests.integration.it_utils import JSON_RPC_CLIENT
from tests.integration.reusable_values import WALLET
from xrpl.models.requests import AccountInfo
class TestAccountInfo(TestCase):
def test_basic_functionality(self):
response = JSON_RPC_CLIENT.request(
Accou... | [
"xrpl.models.requests.AccountInfo"
] | [((315, 358), 'xrpl.models.requests.AccountInfo', 'AccountInfo', ([], {'account': 'WALLET.classic_address'}), '(account=WALLET.classic_address)\n', (326, 358), False, 'from xrpl.models.requests import AccountInfo\n')] |
# Generated by Django 2.0.7 on 2018-07-06 14:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rorender', '0002_machine_running'),
]
operations = [
migrations.AddField(
model_name='machine',
name='corona_running... | [
"django.db.models.BooleanField"
] | [((341, 374), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(True)'}), '(default=True)\n', (360, 374), False, 'from django.db import migrations, models\n'), ((501, 534), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'default': '(True)'}), '(default=True)\n', (520, 534), False... |
''' Minimal example script in order to show how the scattering plane feature for
track fitting (only available when using the Kalman Filter) has to used.
'''
from beam_telescope_analysis.telescope.dut import ScatteringPlane
def run_analysis():
# Create scattering planes and specifying needed parameters. All ... | [
"beam_telescope_analysis.telescope.dut.ScatteringPlane"
] | [((481, 661), 'beam_telescope_analysis.telescope.dut.ScatteringPlane', 'ScatteringPlane', ([], {'name': '"""ScatteringPlane1"""', 'material_budget': '(0.01)', 'translation_x': '(0)', 'translation_y': '(0)', 'translation_z': '(1000.0)', 'rotation_alpha': '(0)', 'rotation_beta': '(0)', 'rotation_gamma': '(0)'}), "(name='... |
import sys
import os
import numpy as np
from matplotlib import pyplot as pl
from ..perform_dic import dic_raw_plots as dic_raw_plots
#processpool=None
def main(args=None):
if args is None:
args=sys.argv
pass
dic_scalefactor=5
dic_radius=20 # measured (I think) in the unscaled original ... | [
"sys.exit",
"matplotlib.pyplot.show"
] | [((611, 620), 'matplotlib.pyplot.show', 'pl.show', ([], {}), '()\n', (618, 620), True, 'from matplotlib import pyplot as pl\n'), ((514, 525), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (522, 525), False, 'import sys\n')] |
import pytest
import pandas as pd
from lib.graph_database_access import get_query_result
def test_get_query_result():
query = "MATCH (p:Pathway{stId:\"R-HSA-9634600\"}) RETURN p.displayName as Name"
result = get_query_result(query)
assert len(result) == 1
assert type(result) == pd.DataFrame
asser... | [
"lib.graph_database_access.get_query_result"
] | [((219, 242), 'lib.graph_database_access.get_query_result', 'get_query_result', (['query'], {}), '(query)\n', (235, 242), False, 'from lib.graph_database_access import get_query_result\n'), ((595, 618), 'lib.graph_database_access.get_query_result', 'get_query_result', (['query'], {}), '(query)\n', (611, 618), False, 'f... |
import folium
import folium.plugins
from branca.element import MacroElement
from folium.map import Layer
from jinja2 import Template
from climetlab.core.ipython import HTML, guess_which_ipython
class SVGOverlay(Layer):
_name = "SVGOverlay"
_template = Template(
"""
{% macro script(this, kwarg... | [
"climetlab.core.ipython.HTML",
"climetlab.core.ipython.guess_which_ipython",
"jinja2.Template",
"folium.Map",
"folium.plugins.Fullscreen"
] | [((263, 877), 'jinja2.Template', 'Template', (['"""\n {% macro script(this, kwargs) %}\n var svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");\n svgElement.setAttribute(\'xmlns\', "http://www.w3.org/2000/svg");\n svgElement.setAttribute(\'viewBox\', {{ t... |
"""Urls for the Zinnia entries short link"""
from django.urls import path
from zinnia.views.shortlink import EntryShortLink
urlpatterns = [
path('<token:token>',
EntryShortLink.as_view(),
name='entry_shortlink'),
]
| [
"zinnia.views.shortlink.EntryShortLink.as_view"
] | [((178, 202), 'zinnia.views.shortlink.EntryShortLink.as_view', 'EntryShortLink.as_view', ([], {}), '()\n', (200, 202), False, 'from zinnia.views.shortlink import EntryShortLink\n')] |
__author__ = '<NAME>'
"""
graph_builder is used by negative_samples_generator.py to get what is needed to build the negative samples.
"""
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
import corpus2graph.util as util
import corpus2graph.multi_processing
class NoGraph:
def __init__(sel... | [
"networkx.stochastic_graph",
"networkx.number_of_selfloops",
"networkx.is_directed",
"numpy.power",
"networkx.selfloop_edges",
"networkx.DiGraph",
"corpus2graph.util.read_valid_vocabulary",
"networkx.Graph",
"networkx.average_clustering",
"numpy.sum",
"numpy.zeros",
"numpy.matmul",
"networkx... | [((1731, 1765), 'numpy.zeros', 'np.zeros', (['(vocab_size, vocab_size)'], {}), '((vocab_size, vocab_size))\n', (1739, 1765), True, 'import numpy as np\n'), ((2954, 3002), 'numpy.sum', 'np.sum', (['stochastic_matrix'], {'axis': '(1)', 'keepdims': '(True)'}), '(stochastic_matrix, axis=1, keepdims=True)\n', (2960, 3002), ... |