code stringlengths 20 1.04M | apis list | extract_api stringlengths 75 9.94M |
|---|---|---|
from math import pi, radians, cos, sin, atan2
from typing import List
from pygeom.geom3d import Vector, Vector
from .latticestrip import LatticeStrip
fourPi = 4*pi
class LatticePanel(object):
lpid = None
pnts = None
cspc = None
cfr1 = None
cfr2 = None
pntc = None
pnti = None
pntg = Non... | [
"pygeom.geom3d.Vector",
"math.atan2",
"math.radians",
"math.sin",
"math.cos"
] | [((1251, 1282), 'math.atan2', 'atan2', (['self.leni.z', 'self.leni.y'], {}), '(self.leni.z, self.leni.y)\n', (1256, 1282), False, 'from math import pi, radians, cos, sin, atan2\n'), ((2432, 2456), 'math.radians', 'radians', (['self.strp.twist'], {}), '(self.strp.twist)\n', (2439, 2456), False, 'from math import pi, rad... |
import requests
from termcolor import cprint
import re
class recomsqli:
def __init__(self,url):
self.url = url
def checksql(self):
headers = {
"User-Agent": "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)",
"Content-Type": "application/x-w... | [
"re.search",
"termcolor.cprint",
"requests.get"
] | [((894, 936), 'requests.get', 'requests.get', ([], {'url': 'vulnurl', 'headers': 'headers'}), '(url=vulnurl, headers=headers)\n', (906, 936), False, 'import requests\n'), ((957, 1000), 're.search', 're.search', (['"""\\\\|\\\\w+\\\\|[a-zA-Z0-9]+"""', 'r.text'], {}), "('\\\\|\\\\w+\\\\|[a-zA-Z0-9]+', r.text)\n", (966, 1... |
# -*- coding: utf-8 -*-
# Copyright 2018 The Blueoil 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
#
# Unles... | [
"functools.partial",
"tensorflow.clip_by_value",
"tensorflow.compat.v1.variable_scope",
"lmnet.layers.conv2d",
"tensorflow.concat",
"tensorflow.compat.v1.summary.histogram",
"tensorflow.Variable",
"tensorflow.nn.leaky_relu",
"tensorflow.name_scope",
"tensorflow.compat.v1.trainable_variables"
] | [((1151, 1182), 'tensorflow.Variable', 'tf.Variable', (['(0)'], {'trainable': '(False)'}), '(0, trainable=False)\n', (1162, 1182), True, 'import tensorflow as tf\n'), ((2910, 3013), 'functools.partial', 'partial', (['darknet'], {'is_training': 'is_training', 'activation': 'self.activation', 'data_format': 'self.data_fo... |
import tensorflow as tf
import numpy as np
import cv2
from read_write_tfrecords import *
shape_name = ['one','ellipse','etc']
char_name = ['0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','default']
size = 48
n_shuffle = 1... | [
"tensorflow.one_hot",
"tensorflow.train.Saver",
"tensorflow.global_variables_initializer",
"numpy.asarray",
"tensorflow.reshape",
"tensorflow.layers.dense",
"tensorflow.layers.dropout",
"tensorflow.Session",
"tensorflow.nn.softmax_cross_entropy_with_logits_v2",
"tensorflow.placeholder",
"tensorf... | [((664, 729), 'tensorflow.placeholder', 'tf.placeholder', (['np.float32'], {'shape': '[None, size, size, 1]', 'name': '"""x"""'}), "(np.float32, shape=[None, size, size, 1], name='x')\n", (678, 729), True, 'import tensorflow as tf\n'), ((729, 788), 'tensorflow.placeholder', 'tf.placeholder', (['np.float32'], {'shape': ... |
# 红玲
# TODO:红玲
import os
from sty import fg, bg
from tqdm import tqdm
from conf.base import sz_col, sz_row
red1 = 196 # light red
red2 = 160
red3 = 124
red4 = 88
red5 = 52 # dark red
green1 = 46
green2 = 40
green3 = 34
green4 = 28
green5 = 22
blue1 = 51
blue2 = 45
blue3 = 39
blue4 = 33
blue5 = 27
white1 = 15
whit... | [
"tqdm.tqdm",
"tqdm.tqdm.write",
"os.system",
"sty.fg",
"sty.bg"
] | [((496, 514), 'os.system', 'os.system', (['"""clear"""'], {}), "('clear')\n", (505, 514), False, 'import os\n'), ((601, 619), 'tqdm.tqdm', 'tqdm', ([], {'total': '_total'}), '(total=_total)\n', (605, 619), False, 'from tqdm import tqdm\n'), ((2088, 2115), 'tqdm.tqdm.write', 'tqdm.write', (['_string'], {'end': '""""""'}... |
#!/usr/bin/env python
import collections
import warnings
from affine import Affine
import numpy
import pandas
from geoh5.kea import common as kc
from geoh5.kea.common import LayerType
from geoh5.kea.common import BandColourInterp
from geoh5.kea.common import RatFieldTypes
from geoh5.kea.common import RatDataTypes
fr... | [
"pandas.DataFrame",
"geoh5.kea.common.BandColourInterp",
"numpy.promote_types",
"numpy.dtype",
"geoh5.kea.common.LayerType",
"numpy.zeros",
"geoh5.kea.common.KeaDataType",
"geoh5.kea.common.RatDataTypes",
"affine.Affine.from_gdal",
"geoh5.kea.common.RatFieldTypes"
] | [((3461, 3489), 'affine.Affine.from_gdal', 'Affine.from_gdal', (['*transform'], {}), '(*transform)\n', (3477, 3489), False, 'from affine import Affine\n'), ((10472, 10513), 'pandas.DataFrame', 'pandas.DataFrame', (['data'], {'columns': 'col_names'}), '(data, columns=col_names)\n', (10488, 10513), False, 'import pandas\... |
# Copyright (c) 2018 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... | [
"unittest.main",
"paddle.static.data",
"paddle.static.default_main_program",
"paddle.CPUPlace",
"paddle.enable_static",
"numpy.ones",
"numpy.random.random",
"paddle.fluid.layers.fill_constant",
"numpy.array"
] | [((757, 779), 'paddle.enable_static', 'paddle.enable_static', ([], {}), '()\n', (777, 779), False, 'import paddle\n'), ((8061, 8076), 'unittest.main', 'unittest.main', ([], {}), '()\n', (8074, 8076), False, 'import unittest\n'), ((6169, 6231), 'paddle.static.data', 'paddle.static.data', ([], {'name': '"""x"""', 'shape'... |
import argparse
import logging
import os
import subprocess
import sys
import traceback
from typing import List, Optional
from . import __version__
from .core import get_next_version, get_version
from .errors import Error
from .logging import log
from .util import showcmd
def main(argv: Optional[List[str]] = None) -> ... | [
"sys.exit",
"traceback.print_exc",
"argparse.ArgumentParser",
"logging.basicConfig"
] | [((339, 433), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Show the version of a versioningit-enabled project"""'}), "(description=\n 'Show the version of a versioningit-enabled project')\n", (362, 433), False, 'import argparse\n'), ((1343, 1434), 'logging.basicConfig', 'logging.bas... |
import digitalio
import board
import time
import adafruit_bmp280
import radio
led = digitalio.DigitalInOut(board.GP25)
led.direction = digitalio.Direction.OUTPUT
led.value = True
print("CanSat Hello!")
test_value = 3.14159
print(test_value)
print("Test value {:d}". format(int(test_value)))
while True:
... | [
"digitalio.DigitalInOut",
"time.sleep",
"adafruit_bmp280.Adafruit_BMP280_I2C"
] | [((91, 125), 'digitalio.DigitalInOut', 'digitalio.DigitalInOut', (['board.GP25'], {}), '(board.GP25)\n', (113, 125), False, 'import digitalio\n'), ((476, 529), 'adafruit_bmp280.Adafruit_BMP280_I2C', 'adafruit_bmp280.Adafruit_BMP280_I2C', (['i2c'], {'address': '(118)'}), '(i2c, address=118)\n', (511, 529), False, 'impor... |
from CV_digits.generator import getCenteredTile
import numpy as np
from abc import ABC, abstractmethod
class SudokuDigitRecognizer(ABC):
@abstractmethod
def recognizeDigits(self, grid : np.ndarray) -> int:
""" Given 9x9xTxT array of sudoku tiles, identify each. """
pass
@abstractmethod
def recognizeDi... | [
"numpy.sum",
"numpy.argmax",
"numpy.zeros",
"CV_digits.generator.getCenteredTile",
"numpy.loadtxt"
] | [((789, 850), 'numpy.zeros', 'np.zeros', (['[10, self.tilesize_px, self.tilesize_px]'], {'dtype': 'int'}), '([10, self.tilesize_px, self.tilesize_px], dtype=int)\n', (797, 850), True, 'import numpy as np\n'), ((1244, 1271), 'numpy.zeros', 'np.zeros', (['[9, 9]'], {'dtype': 'int'}), '([9, 9], dtype=int)\n', (1252, 1271)... |
import torch
from ..base import Trainer
from ..utils import nats2bits
class VAETrainer(Trainer):
def __init__(self, model, train_loader, val_loader=None, test_loader=None, config={}):
super().__init__(model, train_loader, val_loader=val_loader, test_loader=test_loader, config=config)
# config opt... | [
"torch.load",
"torch.no_grad",
"torch.stack"
] | [((3499, 3539), 'torch.load', 'torch.load', (['filename'], {'map_location': '"""cpu"""'}), "(filename, map_location='cpu')\n", (3509, 3539), False, 'import torch\n'), ((1855, 1870), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (1868, 1870), False, 'import torch\n'), ((2502, 2517), 'torch.no_grad', 'torch.no_grad... |
"""Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | [
"unittest.main",
"perfkit.common.data_source_config.Environments.All",
"perfkit.common.big_query_client.BigQueryClient",
"logging.info",
"perfkit.common.credentials_lib.GetAuthorizedCredentials",
"perfkit.test_util.SetConfigPaths"
] | [((1709, 1724), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1722, 1724), False, 'import unittest\n'), ((935, 961), 'perfkit.test_util.SetConfigPaths', 'test_util.SetConfigPaths', ([], {}), '()\n', (959, 961), False, 'from perfkit import test_util\n'), ((1020, 1045), 'perfkit.common.data_source_config.Environme... |
from __future__ import print_function
import sys
PQC_KEM_PATHS = [
'./NTRU-HRSS-KEM-20171130/Optimized_Implementation/crypto_kem/ntruhrss701/pqc_cli',
'./SIKE/Optimized_Implementation/portable/SIKEp503/pqc_cli'
]
PQC_SIGN_PATHS = [
'./sphincs+-reference-implementation-20180313/crypto_sign/sphincs-haraka-... | [
"sys.exit"
] | [((816, 827), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (824, 827), False, 'import sys\n'), ((768, 779), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (776, 779), False, 'import sys\n')] |
import pytest
import dartpy
from tests.util import get_asset_path
def test_shape_is_accessible_from_shape_frame():
world = dartpy.utils.skel.readWorld(get_asset_path('skel/cubes.skel'))
assert world is not None
assert hasattr(world, 'getNumSkeletons')
assert world.getNumSkeletons() > 0
assert ha... | [
"tests.util.get_asset_path",
"pytest.main"
] | [((538, 551), 'pytest.main', 'pytest.main', ([], {}), '()\n', (549, 551), False, 'import pytest\n'), ((158, 191), 'tests.util.get_asset_path', 'get_asset_path', (['"""skel/cubes.skel"""'], {}), "('skel/cubes.skel')\n", (172, 191), False, 'from tests.util import get_asset_path\n')] |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
"airflow.contrib.operators.kubernetes_pod_operator.KubernetesPodOperator",
"airflow.DAG",
"airflow.contrib.operators.gcs_to_bq.GoogleCloudStorageToBigQueryOperator"
] | [((786, 953), 'airflow.DAG', 'DAG', ([], {'dag_id': '"""cfpb_complaints.complaint_database"""', 'default_args': 'default_args', 'max_active_runs': '(1)', 'schedule_interval': '"""@daily"""', 'catchup': '(False)', 'default_view': '"""graph"""'}), "(dag_id='cfpb_complaints.complaint_database', default_args=default_args,\... |
# -*- coding: utf-8 -*-
"""Class for the dupuitflow initial head file."""
from __future__ import absolute_import, division, print_function
from dupuitflow.fileclasses.base import ParameterFiles
import os
class DupuitFlowIn(ParameterFiles):
"""
Class for the dupuitflow DupuitFlow.IN file.
"""
def __in... | [
"os.path.join",
"os.path.exists",
"os.makedirs"
] | [((1079, 1109), 'os.path.exists', 'os.path.exists', (['self.task_root'], {}), '(self.task_root)\n', (1093, 1109), False, 'import os\n'), ((1123, 1150), 'os.makedirs', 'os.makedirs', (['self.task_root'], {}), '(self.task_root)\n', (1134, 1150), False, 'import os\n'), ((1654, 1698), 'os.path.join', 'os.path.join', (['sel... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2019-02-12 21:54
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('das', '0031_auto_20190209_0017'),
]
operations = [
... | [
"django.db.models.CharField",
"django.db.models.IntegerField",
"django.db.models.ForeignKey",
"django.db.models.AutoField"
] | [((421, 514), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (437, 514), False, 'from django.db import migrations, models\... |
# does the following actions:
# called by intent manager, reads json files
# 1) takes rdf input and first bw is determined, time topo, provision
# pass back rdf graph to manager
# 2) Checks the graph of query with schema
import os
import sys
import random
import json
import indi.knowledgelibrary
import datetime
fro... | [
"os.remove",
"dateutil.parser.parse",
"rdflib.Literal",
"os.path.dirname",
"random.choice",
"rdflib.URIRef",
"time.sleep",
"datetime.datetime.strptime",
"graphviz.Digraph",
"pytz.timezone",
"sys.exit",
"rdflib.ConjunctiveGraph"
] | [((1768, 1781), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (1778, 1781), False, 'import time\n'), ((1887, 1905), 'rdflib.ConjunctiveGraph', 'ConjunctiveGraph', ([], {}), '()\n', (1903, 1905), False, 'from rdflib import ConjunctiveGraph, Namespace, exceptions\n'), ((1952, 1975), 'rdflib.URIRef', 'URIRef', (['""... |
from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
main_menu = InlineKeyboardMarkup(row_width=4,
inline_keyboard=[
[
InlineKeyboardButton(text="🤖 О боте", callback_data="about_bot"),
... | [
"aiogram.types.InlineKeyboardButton"
] | [((247, 311), 'aiogram.types.InlineKeyboardButton', 'InlineKeyboardButton', ([], {'text': '"""🤖 О боте"""', 'callback_data': '"""about_bot"""'}), "(text='🤖 О боте', callback_data='about_bot')\n", (267, 311), False, 'from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton\n'), ((354, 423), 'aiogram.types.... |
# -*- coding: utf-8 -*-
import logging
from six import string_types
from hayes.indexing import CompletionSuggestField, DocumentIndex
from hayes.search import Search, SearchResults
from hayes.search.queries import Query, QueryStringQuery
from hayes.transport import BadRequestError, ESSession, NotFoundError
from hayes.... | [
"hayes.search.queries.QueryStringQuery",
"hayes.search.SearchResults",
"hayes.search.Search",
"hayes.transport.ESSession",
"hayes.utils.batch_iterable",
"logging.getLogger",
"hayes.utils.object_to_dict"
] | [((669, 695), 'logging.getLogger', 'logging.getLogger', (['"""Hayes"""'], {}), "('Hayes')\n", (686, 695), False, 'import logging\n'), ((794, 820), 'hayes.transport.ESSession', 'ESSession', ([], {'base_url': 'server'}), '(base_url=server)\n', (803, 820), False, 'from hayes.transport import BadRequestError, ESSession, No... |
#!/usr/bin/env python3
#
# Copyright 2020-2021 Hewlett Packard Enterprise Development LP
# Copyright 2004-2019 Cray Inc.
# Other additional copyright holders may be indicated within.
#
# The entirety of this work is licensed under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in... | [
"io.StringIO",
"argparse.ArgumentParser",
"re.match",
"pycparser.c_parser.ParseError",
"pycparser.parse_file",
"sys.exit",
"re.compile"
] | [((3735, 3826), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Generate C bindings for Chapel"""', 'prog': '"""c2chapel"""'}), "(description='Generate C bindings for Chapel', prog=\n 'c2chapel')\n", (3758, 3826), False, 'import argparse\n'), ((4992, 5002), 'io.StringIO', 'StringIO', (... |
import os
import re
"""
Reads donor acceptor matrix
"""
class DonAcceptor:
_instance = None
def __init__(self, path=os.path.join(os.path.dirname(__file__), 'DonAcc2.txt')):
daFile = open(path, 'r')
headers = []
self.das = []
isFirst = True
for l in daF... | [
"os.path.dirname",
"re.split"
] | [((152, 177), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (167, 177), False, 'import os\n'), ((366, 396), 're.split', 're.split', (['"""(?:\t+|\\\\s{2,})"""', 'l'], {}), "('(?:\\t+|\\\\s{2,})', l)\n", (374, 396), False, 'import re\n')] |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# @Time : 2017/12/7 下午2:13
# @Author : LennonChin
# @Email : <EMAIL>
# @File : apiview.py
# @Software: PyCharm
from rest_framework import status
from rest_framework.response import Response
from django_filters.rest_framework import DjangoFilterBackend
from rest_frame... | [
"rest_framework.response.Response"
] | [((2370, 2444), 'rest_framework.response.Response', 'Response', (['serializer.data'], {'status': 'status.HTTP_201_CREATED', 'headers': 'headers'}), '(serializer.data, status=status.HTTP_201_CREATED, headers=headers)\n', (2378, 2444), False, 'from rest_framework.response import Response\n'), ((2054, 2096), 'rest_framewo... |
import dnpy
from dnpy import *
# sendNotification.dnpy(title, message)
dnpy.sendNotification("Hello", "How Are You?")
dnpy.Help() | [
"dnpy.sendNotification",
"dnpy.Help"
] | [((76, 122), 'dnpy.sendNotification', 'dnpy.sendNotification', (['"""Hello"""', '"""How Are You?"""'], {}), "('Hello', 'How Are You?')\n", (97, 122), False, 'import dnpy\n'), ((124, 135), 'dnpy.Help', 'dnpy.Help', ([], {}), '()\n', (133, 135), False, 'import dnpy\n')] |
"""Utilities for the library."""
import hashlib
from typing import Dict, Iterator, Optional, TypeVar
import urllib.parse
IteratorType = TypeVar("IteratorType")
def next_or_none(iterator: Iterator[IteratorType]) -> Optional[IteratorType]:
"""Get the next value from an iterator, or return None when it is exhauste... | [
"typing.TypeVar",
"hashlib.md5"
] | [((138, 161), 'typing.TypeVar', 'TypeVar', (['"""IteratorType"""'], {}), "('IteratorType')\n", (145, 161), False, 'from typing import Dict, Iterator, Optional, TypeVar\n'), ((1382, 1395), 'hashlib.md5', 'hashlib.md5', ([], {}), '()\n', (1393, 1395), False, 'import hashlib\n')] |
import requests
from django.contrib import messages
from django.shortcuts import redirect, render
from django.urls import reverse_lazy
from django.views.generic import FormView, ListView, TemplateView
from django.contrib.auth.models import User
from django.contrib.auth import login, logout
from datetime import timedelt... | [
"django.shortcuts.redirect",
"django.urls.reverse_lazy",
"django.contrib.messages.error",
"django.utils.timezone.now",
"django.contrib.auth.models.User.objects.get_or_create",
"django.contrib.auth.logout",
"django.contrib.messages.info",
"datetime.timedelta",
"requests.get",
"django.shortcuts.rend... | [((1169, 1189), 'django.urls.reverse_lazy', 'reverse_lazy', (['"""home"""'], {}), "('home')\n", (1181, 1189), False, 'from django.urls import reverse_lazy\n'), ((5712, 5730), 'django.shortcuts.redirect', 'redirect', (['"""groups"""'], {}), "('groups')\n", (5720, 5730), False, 'from django.shortcuts import redirect, ren... |
#!/usr/bin/env python
# coding: utf-8
# In[2]:
import tifffile
from skimage import morphology, filters
import cc3d
import skan
import numpy as np
import copy
import matplotlib.pyplot as plt
from PIL import Image
import cv2
#3D skeletonisation
def skeletonise(input):
return morphology.skeletonize_3d(input)
#3D... | [
"copy.deepcopy",
"skan.skeleton_to_csgraph",
"cc3d.connected_components",
"numpy.bitwise_xor",
"skimage.morphology.skeletonize_3d",
"numpy.where",
"numpy.bitwise_and",
"tifffile.imread",
"numpy.bitwise_or",
"skimage.filters.gaussian"
] | [((283, 315), 'skimage.morphology.skeletonize_3d', 'morphology.skeletonize_3d', (['input'], {}), '(input)\n', (308, 315), False, 'from skimage import morphology, filters\n'), ((466, 493), 'copy.deepcopy', 'copy.deepcopy', (['binary_array'], {}), '(binary_array)\n', (479, 493), False, 'import copy\n'), ((529, 572), 'ski... |
#!/usr/bin/env python
"""Run Gammapy validation: CTA 1DC"""
import logging
import warnings
import click
from gammapy.data import DataStore
from gammapy.datasets import SpectrumDataset, MapDataset
from gammapy.modeling.models import PowerLawSpectralModel, SkyModel, PointSpatialModel
from gammapy.maps import MapAxis, Reg... | [
"gammapy.maps.MapAxis.from_energy_bounds",
"gammapy.modeling.models.PointSpatialModel",
"matplotlib.pyplot.savefig",
"click.option",
"gammapy.data.DataStore.from_dir",
"gammapy.datasets.SpectrumDataset.create",
"numpy.arange",
"astropy.coordinates.Angle",
"gammapy.maps.RegionGeom",
"warnings.simpl... | [((860, 887), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (877, 887), False, 'import logging\n'), ((890, 903), 'click.group', 'click.group', ([], {}), '()\n', (901, 903), False, 'import click\n'), ((1000, 1068), 'click.option', 'click.option', (['"""--show-warnings"""'], {'is_flag': '(... |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | [
"senlin.common.sdk.create_connection",
"senlin.openstack.orchestration.v1.stack.Stack.list",
"senlin.openstack.orchestration.v1.stack.Stack.new",
"senlin.common.sdk.ignore_not_found"
] | [((927, 957), 'senlin.common.sdk.create_connection', 'sdk.create_connection', (['context'], {}), '(context)\n', (948, 957), False, 'from senlin.common import sdk\n'), ((1094, 1119), 'senlin.openstack.orchestration.v1.stack.Stack.new', 'stack.Stack.new', ([], {}), '(**params)\n', (1109, 1119), False, 'from senlin.openst... |
import angr
from angr.sim_type import SimTypeLength, SimTypeTop
from .malloc import malloc
import logging
l = logging.getLogger(name=__name__)
######################################
# realloc
######################################
# FIXME: If ptr is a null pointer, realloc() shall be equivalent to malloc() for the s... | [
"logging.getLogger"
] | [((111, 143), 'logging.getLogger', 'logging.getLogger', ([], {'name': '__name__'}), '(name=__name__)\n', (128, 143), False, 'import logging\n')] |
#!/usr/bin/env python3
import io
import pathlib
import shutil
import subprocess
import sys
MAX_LINES = 200
def run_trim(cmd, ret_code):
with io.BytesIO() as ret:
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
with proc:
# it's safe to iterate over stdout directly,
# ... | [
"subprocess.run",
"io.BytesIO",
"subprocess.Popen",
"pathlib.Path",
"shutil.copyfileobj",
"sys.exit"
] | [((1461, 1486), 'pathlib.Path', 'pathlib.Path', (['sys.argv[1]'], {}), '(sys.argv[1])\n', (1473, 1486), False, 'import pathlib\n'), ((1546, 1571), 'pathlib.Path', 'pathlib.Path', (['sys.argv[4]'], {}), '(sys.argv[4])\n', (1558, 1571), False, 'import pathlib\n'), ((3810, 3834), 'sys.exit', 'sys.exit', (['EXIT_NOPREVIEW'... |
from tkinter import Tk
from tkinter.font import names, nametofont
r = Tk()
for fontname in names():
font = nametofont(fontname)
print('{}:\t {} {} {} {}'.format(
fontname,
font['family'],
font['size'],
font['weight'],
font['slant']
))
| [
"tkinter.font.nametofont",
"tkinter.Tk",
"tkinter.font.names"
] | [((71, 75), 'tkinter.Tk', 'Tk', ([], {}), '()\n', (73, 75), False, 'from tkinter import Tk\n'), ((92, 99), 'tkinter.font.names', 'names', ([], {}), '()\n', (97, 99), False, 'from tkinter.font import names, nametofont\n'), ((112, 132), 'tkinter.font.nametofont', 'nametofont', (['fontname'], {}), '(fontname)\n', (122, 13... |
import random
from captcha.image import ImageCaptcha
lower = "abcdefghijklmnopqrstuvwxyz"
upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
numbers = "0123456789"
mix = lower + upper + numbers
length = random.randrange(5,8)
random_Captcha = "".join(random.sample(mix,length))
image = ImageCaptcha(width = 280, height = 90)
captcha... | [
"captcha.image.ImageCaptcha",
"random.sample",
"random.randrange"
] | [((191, 213), 'random.randrange', 'random.randrange', (['(5)', '(8)'], {}), '(5, 8)\n', (207, 213), False, 'import random\n'), ((274, 308), 'captcha.image.ImageCaptcha', 'ImageCaptcha', ([], {'width': '(280)', 'height': '(90)'}), '(width=280, height=90)\n', (286, 308), False, 'from captcha.image import ImageCaptcha\n')... |
import sys
import pandas as pd
import numpy as np
import itertools
from sklearn.preprocessing import RobustScaler
from sklearn.svm import LinearSVC
from evaluate_model import evaluate_model
dataset = sys.argv[1]
pipeline_components = [RobustScaler, LinearSVC]
pipeline_parameters = {}
C_values = np.concatenate((np.ar... | [
"numpy.arange",
"evaluate_model.evaluate_model",
"itertools.product"
] | [((553, 662), 'itertools.product', 'itertools.product', (['C_values', 'loss_values', 'penalty_values', 'dual_values', 'fit_intercept_values', 'random_state'], {}), '(C_values, loss_values, penalty_values, dual_values,\n fit_intercept_values, random_state)\n', (570, 662), False, 'import itertools\n'), ((894, 959), 'e... |
# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
from pkg_resources import parse_version
import kaitaistruct
from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO
if parse_version(kaitaistruct.__version__) < parse_version('0.9'):
raise Exception("Incompati... | [
"pkg_resources.parse_version"
] | [((226, 265), 'pkg_resources.parse_version', 'parse_version', (['kaitaistruct.__version__'], {}), '(kaitaistruct.__version__)\n', (239, 265), False, 'from pkg_resources import parse_version\n'), ((268, 288), 'pkg_resources.parse_version', 'parse_version', (['"""0.9"""'], {}), "('0.9')\n", (281, 288), False, 'from pkg_r... |
# -*- coding: utf-8 -*-
# @Time : 2020-06-19 17:29
# @Author : yingyuankai
# @Email : <EMAIL>
# @File : lr_finder.py
import tensorflow as tf
import matplotlib.pyplot as plt
__all__ = [
"LRFinder"
]
class LRFinder(tf.keras.callbacks.Callback):
"""`Callback` that exponentially adjusts the learning ... | [
"tensorflow.keras.backend.set_value",
"matplotlib.pyplot.switch_backend",
"tensorflow.math.is_nan",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.FormatStrFormatter"
] | [((1290, 1350), 'tensorflow.keras.backend.set_value', 'tf.keras.backend.set_value', (['self.model.optimizer.lr', 'self.lr'], {}), '(self.model.optimizer.lr, self.lr)\n', (1316, 1350), True, 'import tensorflow as tf\n'), ((2258, 2283), 'matplotlib.pyplot.switch_backend', 'plt.switch_backend', (['"""Agg"""'], {}), "('Agg... |
from dataset import ImageFolder
from torchvision import transforms
from torch.utils.data import DataLoader
from networks import *
from utils import *
from glob import glob
class UGATIT(object) :
def __init__(self):
self.light = True
self.model_name = 'UGATIT'
self.ch=... | [
"torchvision.transforms.Normalize",
"torchvision.transforms.ToTensor",
"torch.utils.data.DataLoader",
"torchvision.transforms.Resize"
] | [((2092, 2138), 'torch.utils.data.DataLoader', 'DataLoader', (['testA'], {'batch_size': '(1)', 'shuffle': '(False)'}), '(testA, batch_size=1, shuffle=False)\n', (2102, 2138), False, 'from torch.utils.data import DataLoader\n'), ((1772, 1821), 'torchvision.transforms.Resize', 'transforms.Resize', (['(self.img_size, self... |
"""Jinja2 custom filters and functions loading."""
import glob
import importlib
import os
import pathlib
import sys
def import_py_files(module_dir):
"""
Import python files from template repo dir.
"""
if not os.path.exists(module_dir):
return
sys.path.append(module_dir)
py_files = gl... | [
"sys.path.append",
"importlib.import_module",
"os.path.exists",
"pathlib.Path",
"os.path.join"
] | [((275, 302), 'sys.path.append', 'sys.path.append', (['module_dir'], {}), '(module_dir)\n', (290, 302), False, 'import sys\n'), ((227, 253), 'os.path.exists', 'os.path.exists', (['module_dir'], {}), '(module_dir)\n', (241, 253), False, 'import os\n'), ((328, 360), 'os.path.join', 'os.path.join', (['module_dir', '"""*.p... |
# -*- coding: UTF-8 -*-
import datetime
import email
import enum
import flask
import hashlib
import json
import math
import random
import socket
import string
import sqlalchemy as sql
import sqlalchemy.ext.declarative as sqldec
import time
import traceback
import typing
import unicodedata
import werkzeug
# ---------- ... | [
"sqlalchemy.inspect",
"unicodedata.normalize",
"hashlib.md5",
"werkzeug.wrappers.response.Response",
"flask.current_app.config.get",
"math.sqrt",
"random.randint",
"time.gmtime",
"socket.socket",
"json.dumps",
"datetime.timedelta",
"werkzeug.exceptions.HTTPException",
"email.utils.parseaddr"... | [((662, 693), 'unicodedata.normalize', 'unicodedata.normalize', (['"""NFC"""', 's'], {}), "('NFC', s)\n", (683, 693), False, 'import unicodedata\n'), ((3384, 3397), 'hashlib.md5', 'hashlib.md5', ([], {}), '()\n', (3395, 3397), False, 'import hashlib\n'), ((4612, 4650), 'json.dumps', 'json.dumps', (['body'], {'indent': ... |
"""Utilities for summarizing and setting up optimization."""
import timeit
import numpy as np
import scipy as sci
from scipy import linalg
from tensortools.data.random_tensor import (rand_array, rand_ktensor,
randn_array, randn_ktensor)
from tensortools.tensors import KTens... | [
"tensortools.data.random_tensor.randn_array",
"tensortools.data.random_tensor.randn_ktensor",
"timeit.default_timer",
"numpy.linalg.norm",
"scipy.linalg.norm",
"tensortools.data.random_tensor.rand_array",
"tensortools.data.random_tensor.rand_ktensor"
] | [((1480, 1494), 'scipy.linalg.norm', 'linalg.norm', (['X'], {}), '(X)\n', (1491, 1494), False, 'from scipy import linalg\n'), ((1628, 1695), 'tensortools.data.random_tensor.randn_ktensor', 'randn_ktensor', (['X.shape', 'rank'], {'norm': 'normX', 'random_state': 'random_state'}), '(X.shape, rank, norm=normX, random_stat... |
import numpy as np
from PIL import Image
import torch
def image_from_path(image_path):
data_lowlight = Image.open(image_path)
data_lowlight = (np.asarray(data_lowlight) / 255.0)
data_lowlight = torch.from_numpy(data_lowlight).float()
return data_lowlight
def scale_image(data_lowlight, scale_factor, ... | [
"torch.from_numpy",
"numpy.asarray",
"torch.cuda.is_available",
"PIL.Image.open"
] | [((108, 130), 'PIL.Image.open', 'Image.open', (['image_path'], {}), '(image_path)\n', (118, 130), False, 'from PIL import Image\n'), ((152, 177), 'numpy.asarray', 'np.asarray', (['data_lowlight'], {}), '(data_lowlight)\n', (162, 177), True, 'import numpy as np\n'), ((207, 238), 'torch.from_numpy', 'torch.from_numpy', (... |
"""test_endpoints.py: validate endpoints return as expected"""
from os import path
import json
import copy
import jsonschema
import pytest
from flask import url_for
import slash_coins._version as _version
import helpers
@pytest.mark.usefixtures('client_class')
class TestVersionEndpoint:
"""validate /version res... | [
"jsonschema.validate",
"copy.deepcopy",
"json.dumps",
"flask.url_for",
"pytest.mark.usefixtures"
] | [((225, 264), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""client_class"""'], {}), "('client_class')\n", (248, 264), False, 'import pytest\n'), ((1597, 1636), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""client_class"""'], {}), "('client_class')\n", (1620, 1636), False, 'import pytest\n'),... |
# coding=utf-8
# ---------------------------
# Import Libraries
# ---------------------------
import codecs
import os
import json
import threading
from shutil import copy
import clr
clr.AddReference("IronPython.SQLite.dll")
clr.AddReference("IronPython.Modules.dll")
# ---------------------------
# [Required] Scr... | [
"json.dump",
"threading.Timer",
"json.load",
"json.loads",
"os.makedirs",
"codecs.open",
"os.path.dirname",
"os.path.exists",
"os.system",
"json.dumps",
"clr.AddReference",
"os.path.isfile",
"shutil.copy"
] | [((186, 227), 'clr.AddReference', 'clr.AddReference', (['"""IronPython.SQLite.dll"""'], {}), "('IronPython.SQLite.dll')\n", (202, 227), False, 'import clr\n'), ((228, 270), 'clr.AddReference', 'clr.AddReference', (['"""IronPython.Modules.dll"""'], {}), "('IronPython.Modules.dll')\n", (244, 270), False, 'import clr\n'),... |
# NOTE: Not importing monkey patched version here
import ccxt
import time
class Exchanges:
exchanges = {}
exchange_names = []
pair_matrix = {}
markets_loaded = False
def __init__(self, api_config):
self.config = api_config
for key, value in self.config.items():
self.a... | [
"time.sleep"
] | [((1970, 2007), 'time.sleep', 'time.sleep', (['(exchange.rateLimit / 1000)'], {}), '(exchange.rateLimit / 1000)\n', (1980, 2007), False, 'import time\n')] |
import argparse
import json
import logging
import subprocess
import sys
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Any, Dict, List, Tuple
from .gdb import GdbServer
from .loader import Loader
from .pt import Instruction, InstructionClass, decode
from .pwn_wrapper import Coredum... | [
"json.dump",
"json.load",
"tempfile.TemporaryDirectory",
"pathlib.Path",
"logging.getLogger"
] | [((474, 501), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (491, 501), False, 'import logging\n'), ((1988, 2000), 'json.load', 'json.load', (['f'], {}), '(f)\n', (1997, 2000), False, 'import json\n'), ((3315, 3335), 'tempfile.TemporaryDirectory', 'TemporaryDirectory', ([], {}), '()\n', ... |
#!/usr/bin/env python
# /***************************************************************************
#
# @package: franka_interface
# @metapackage: franka_ros_interface
# @author: <NAME> <<EMAIL>>
#
# **************************************************************************/
# /**********************************... | [
"rospy.logerr",
"argparse.ArgumentParser",
"franka_interface.RobotEnable",
"rospy.init_node",
"rospy.myargv"
] | [((1470, 1507), 'rospy.init_node', 'rospy.init_node', (['"""panda_robot_enable"""'], {}), "('panda_robot_enable')\n", (1485, 1507), False, 'import rospy\n'), ((1521, 1546), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1544, 1546), False, 'import argparse\n'), ((2562, 2592), 'franka_interface... |
'''
给你一个二叉树,请你返回其按 层序遍历 得到的节点值。 (即逐层地,从左到右访问所有节点)。
'''
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
from collections import deque
class Solution:
# BFS广度优先算法
def levelOrder1(self, root: TreeN... | [
"collections.deque"
] | [((402, 415), 'collections.deque', 'deque', (['[root]'], {}), '([root])\n', (407, 415), False, 'from collections import deque\n')] |
import torch
import torchvision
import torch.nn as nn
class Lenet(nn.Module):
def __init__(self):
super(Lenet, self).__init__()
self.conv = nn.Sequential(
nn.Conv2d(3, 6, 3, stride=1, padding=1),
nn.MaxPool2d(2, 2),
nn.Conv2d(6, 16, 5, stride=1, padding=0),
... | [
"torch.nn.MaxPool2d",
"torch.nn.Conv2d",
"torch.nn.Linear"
] | [((188, 227), 'torch.nn.Conv2d', 'nn.Conv2d', (['(3)', '(6)', '(3)'], {'stride': '(1)', 'padding': '(1)'}), '(3, 6, 3, stride=1, padding=1)\n', (197, 227), True, 'import torch.nn as nn\n'), ((241, 259), 'torch.nn.MaxPool2d', 'nn.MaxPool2d', (['(2)', '(2)'], {}), '(2, 2)\n', (253, 259), True, 'import torch.nn as nn\n'),... |
"""
删除单链表中的倒数第n个node
"""
from LinkNode import Node
from LinkNode import create_linklist,show_linklist
class Solution:
def removeNthFromEnd(self, head: Node, n: int) -> Node:
"""普通方式"""
nodes=[]
cur =head
while cur:
nodes.append(cur)
cur = cur.next
... | [
"LinkNode.create_linklist",
"LinkNode.show_linklist"
] | [((1025, 1046), 'LinkNode.create_linklist', 'create_linklist', (['nums'], {}), '(nums)\n', (1040, 1046), False, 'from LinkNode import create_linklist, show_linklist\n'), ((1051, 1070), 'LinkNode.show_linklist', 'show_linklist', (['head'], {}), '(head)\n', (1064, 1070), False, 'from LinkNode import create_linklist, show... |
"""Added Deployments type
Revision ID: 53fe9cd577ed
Revises: <KEY>
Create Date: 2015-05-15 12:59:02.949314
"""
# revision identifiers, used by Alembic.
revision = '53fe9cd577ed'
down_revision = '<KEY>'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - pleas... | [
"sqlalchemy.String",
"alembic.op.drop_column"
] | [((546, 586), 'alembic.op.drop_column', 'op.drop_column', (['"""cloud_profiles"""', '"""type"""'], {}), "('cloud_profiles', 'type')\n", (560, 586), False, 'from alembic import op\n'), ((388, 408), 'sqlalchemy.String', 'sa.String', ([], {'length': '(25)'}), '(length=25)\n', (397, 408), True, 'import sqlalchemy as sa\n')... |
from rest_framework import serializers
from rest_framework.serializers import ModelSerializer
from staff.models import (
Qualification,
Department,
Staff,
Appointment,
Promotion
)
class DepartmentSerializer(ModelSerializer):
'''Staff Department Serializer'''
class Meta:
model ... | [
"rest_framework.serializers.StringRelatedField"
] | [((3254, 3295), 'rest_framework.serializers.StringRelatedField', 'serializers.StringRelatedField', ([], {'many': '(True)'}), '(many=True)\n', (3284, 3295), False, 'from rest_framework import serializers\n'), ((3313, 3354), 'rest_framework.serializers.StringRelatedField', 'serializers.StringRelatedField', ([], {'many': ... |
import json
from django.http import JsonResponse, HttpResponseBadRequest, HttpResponse, Http404
from src.tipboard.app.applicationconfig import getRedisPrefix, getIsoTime
from src.tipboard.app.properties import PROJECT_NAME, LAYOUT_CONFIG, REDIS_DB, LOG, DEBUG
from src.tipboard.app.cache import getCache
from src.tipboar... | [
"src.tipboard.app.utils.getTimeStr",
"src.tipboard.app.FakeData.fake_data.buildFakeDataFromTemplate",
"django.http.HttpResponse",
"json.loads",
"src.tipboard.app.cache.getCache",
"django.http.HttpResponseBadRequest",
"django.http.JsonResponse",
"json.dumps",
"src.tipboard.app.applicationconfig.getIs... | [((2586, 2640), 'django.http.HttpResponse', 'HttpResponse', (['f"""{tile_key} data updated successfully."""'], {}), "(f'{tile_key} data updated successfully.')\n", (2598, 2640), False, 'from django.http import JsonResponse, HttpResponseBadRequest, HttpResponse, Http404\n'), ((3819, 3829), 'src.tipboard.app.cache.getCac... |
from django.test import TestCase
from django.template import Template, Context
from django.utils import translation
from ..models import DummyModel
class ValueListTest(TestCase):
def test_empty_list_should_show_none(self):
translation.deactivate()
out = Template(
'{% load mapentity_ta... | [
"django.utils.translation.deactivate",
"django.template.Context",
"django.template.Template"
] | [((238, 262), 'django.utils.translation.deactivate', 'translation.deactivate', ([], {}), '()\n', (260, 262), False, 'from django.utils import translation\n'), ((380, 402), 'django.template.Context', 'Context', (["{'items': []}"], {}), "({'items': []})\n", (387, 402), False, 'from django.template import Template, Contex... |
#!/usr/bin/env python
#python
import os
import shutil
import time
import numpy
#appion
from appionlib import appionScript
from appionlib import apStack
from appionlib import apFile
from appionlib import apParam
from appionlib import apXmipp
from appionlib import apImagicFile
from appionlib import apDisplay
from appion... | [
"appionlib.apXmipp.breakupStackIntoSingleFiles",
"os.path.isfile",
"appionlib.apParam.getLogHeader",
"appionlib.apDisplay.printError",
"appionlib.apFile.fileSize",
"os.path.join",
"time.asctime",
"os.path.abspath",
"appionlib.apStack.averageStack",
"appionlib.apStack.getOnlyStackData",
"appionli... | [((2374, 2422), 'appionlib.apStack.getOnlyStackData', 'apStack.getOnlyStackData', (["self.params['stackid']"], {}), "(self.params['stackid'])\n", (2398, 2422), False, 'from appionlib import apStack\n'), ((2436, 2494), 'os.path.join', 'os.path.join', (["stackdata['path']['path']", "stackdata['name']"], {}), "(stackdata[... |
# -*- coding: utf-8 -*-
# 开发人员:Tryrus
# 开发时间:2020/1/4 21:25
# 文件名称:app.py
# 开发工具:PyCharm
from flask import Flask, render_template
from flask_sqlalchemy import SQLAlchemy # 导入扩展类
import os
import sys
WIN = sys.platform.startswith('win')
if WIN: # 如果是 Windows 系统,使用三个斜线
prefix = 'sqlite:///'
else: # 否则使用四个斜线
... | [
"sys.platform.startswith",
"flask.Flask",
"click.option",
"click.echo",
"flask_sqlalchemy.SQLAlchemy",
"flask.render_template",
"os.path.join"
] | [((208, 238), 'sys.platform.startswith', 'sys.platform.startswith', (['"""win"""'], {}), "('win')\n", (231, 238), False, 'import sys\n'), ((350, 365), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (355, 365), False, 'from flask import Flask, render_template\n'), ((541, 556), 'flask_sqlalchemy.SQLAlchemy',... |
"""
small testing system for the compiler. It should be noted that this is not the
best testing system, and should probably eventually actually check that these
outputs are correct?
"""
import sys
import os
import re
from subprocess import call
def fail(name, exit_code):
"""
fail is to be called when a compil... | [
"re.match",
"subprocess.call",
"os.listdir",
"sys.exit"
] | [((446, 457), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (454, 457), False, 'import sys\n'), ((652, 663), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (660, 663), False, 'import sys\n'), ((668, 692), 'subprocess.call', 'call', (["['cargo', 'build']"], {}), "(['cargo', 'build'])\n", (672, 692), False, 'from subp... |
import socket
multicastIP = '192.168.127.12'
multicastPort = 5007
# regarding socket.IP_MULTICAST_TTL
# ---------------------------------
# for all packets sent, after two hops on the network the packet will not
# be re-sent/broadcast (see https://www.tldp.org/HOWTO/Multicast-HOWTO-6.html)
MULTICAST_TTL = 2
... | [
"socket.socket"
] | [((329, 397), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_DGRAM', 'socket.IPPROTO_UDP'], {}), '(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)\n', (342, 397), False, 'import socket\n')] |
import numpy as np
import os
from tqdm import tqdm
from copy import deepcopy
from termcolor import colored
from bc.model import log
from bc.model import utils as bc_utils
from sim2real import transformations
def set_up_training(save_dir):
if not os.path.isdir(save_dir):
os.makedirs(save_dir)
log.init... | [
"bc.model.utils.append_losses",
"copy.deepcopy",
"bc.model.utils.run_evaluation",
"os.makedirs",
"os.path.isdir",
"numpy.median",
"bc.model.utils.load_model",
"numpy.min",
"numpy.mean",
"sim2real.transformations.test",
"bc.model.utils.create_optimizer",
"bc.model.log.init_writers",
"bc.model... | [((312, 338), 'bc.model.log.init_writers', 'log.init_writers', (['save_dir'], {}), '(save_dir)\n', (328, 338), False, 'from bc.model import log\n'), ((539, 591), 'sim2real.transformations.test', 'transformations.test', (['train_loader.dataset', 'save_dir'], {}), '(train_loader.dataset, save_dir)\n', (559, 591), False, ... |
###############################################################################
# Application to run DSCensor #
# <NAME> (<EMAIL>) #
# <NAME> (<EMAIL>) #
#########################... | [
"panparser.panparser_prototype.main",
"flask.Flask",
"logging.StreamHandler",
"logging.Formatter",
"logging.getLogger"
] | [((762, 803), 'flask.Flask', 'Flask', (['__name__'], {'template_folder': '"""client"""'}), "(__name__, template_folder='client')\n", (767, 803), False, 'from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash\n'), ((1079, 1105), 'panparser.panparser_prototype.main', 'panparser_pro... |
from django import forms
from django.contrib.auth.models import User
class UserForm(forms.ModelForm):
POSITIONS = (
('student', 'Студент'),
('professor', 'Преподаватель'),
('cooperator', 'Сотрудник'),
('scientific_director', 'Научный руководитель'),
)
username = ... | [
"django.forms.CheckboxSelectMultiple",
"django.forms.CharField",
"django.forms.EmailField"
] | [((320, 366), 'django.forms.CharField', 'forms.CharField', ([], {'max_length': '(50)', 'label': '"""<NAME>"""'}), "(max_length=50, label='<NAME>')\n", (335, 366), False, 'from django import forms\n'), ((384, 446), 'django.forms.CharField', 'forms.CharField', ([], {'max_length': '(50)', 'required': '(True)', 'label': '"... |
import pandas as pd
import numpy as np
from sklearn import preprocessing
# standardizing data the mean will be zero and the standard deviation one.
def Standardization(data):
target=data.iloc[:,-1]
X=data.iloc[:,:-1]
indexes = X.index
columns = X.columns
std_scale = preprocessing.StandardScaler().fit(X)
std_... | [
"pandas.DataFrame",
"sklearn.preprocessing.MinMaxScaler",
"sklearn.preprocessing.StandardScaler"
] | [((362, 386), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': 'std_X'}), '(data=std_X)\n', (374, 386), True, 'import pandas as pd\n'), ((814, 841), 'pandas.DataFrame', 'pd.DataFrame', ([], {'data': 'minmax_X'}), '(data=minmax_X)\n', (826, 841), True, 'import pandas as pd\n'), ((277, 307), 'sklearn.preprocessing.Stand... |
import os
from random import randint
import aiofiles
import aiohttp
import requests
from bs4 import BeautifulSoup
from pyrogram import filters
from wbb import SUDOERS, app
from wbb.core.decorators.errors import capture_err
__MODULE__ = "Reverse"
__HELP__ = "/reverse - Reverse search an image. [SUDOERS ONLY]"
@app... | [
"os.remove",
"random.randint",
"aiofiles.open",
"pyrogram.filters.command",
"wbb.app.send_photo",
"aiohttp.ClientSession",
"requests.post"
] | [((332, 358), 'pyrogram.filters.command', 'filters.command', (['"""reverse"""'], {}), "('reverse')\n", (347, 358), False, 'from pyrogram import filters\n'), ((2236, 2262), 'aiofiles.open', 'aiofiles.open', (['image', '"""rb"""'], {}), "(image, 'rb')\n", (2249, 2262), False, 'import aiofiles\n'), ((2913, 2936), 'aiohttp... |
#!/bin/python_3.9
from typing import List, Union, Optional, Dict
from urllib.request import Request, urlopen
from bs4 import BeautifulSoup
from PyQt5 import QtCore
import time
import yaml
class GooGle_Dork():
def __init__(self) -> None:
pass
def dork(self, search: str) -> str:
url: str = 'h... | [
"PyQt5.QtCore.pyqtSignal",
"urllib.request.Request",
"PyQt5.QtCore.QThread.__init__",
"yaml.load_all",
"urllib.request.urlopen",
"time.sleep",
"PyQt5.QtCore.QCoreApplication.processEvents"
] | [((1667, 1692), 'PyQt5.QtCore.pyqtSignal', 'QtCore.pyqtSignal', (['object'], {}), '(object)\n', (1684, 1692), False, 'from PyQt5 import QtCore\n'), ((717, 748), 'urllib.request.Request', 'Request', (['newUrl'], {'headers': 'header'}), '(newUrl, headers=header)\n', (724, 748), False, 'from urllib.request import Request,... |
import pygame, sys
from pygame.locals import *
import pygame.camera
import os
import time
from sense_hat import SenseHat
import websocket
imageUploadURL=os.getenv("ImageUploadURL",default="http://mynodered.mybluemix.net/upload")
webSocketURL=os.getenv("WebSocketURL",default="wss://mynodered.mybluemix.net/ws/chat")
vid... | [
"sense_hat.SenseHat",
"websocket.WebSocket",
"os.system",
"pygame.init",
"time.time",
"time.sleep",
"pygame.camera.Camera",
"pygame.image.save_extended",
"pygame.camera.init",
"os.getenv"
] | [((154, 230), 'os.getenv', 'os.getenv', (['"""ImageUploadURL"""'], {'default': '"""http://mynodered.mybluemix.net/upload"""'}), "('ImageUploadURL', default='http://mynodered.mybluemix.net/upload')\n", (163, 230), False, 'import os\n'), ((243, 317), 'os.getenv', 'os.getenv', (['"""WebSocketURL"""'], {'default': '"""wss:... |
# flake8: noqa
import unittest
import pytest
from lmfit import Model
import raman_fitting
from raman_fitting.deconvolution_models.peak_validation import (
NotFoundAnyModelsWarning,
PeakModelValidator,
)
class TestPeakModelValidator(unittest.TestCase):
def setUp(self):
self.pmv = PeakModelValida... | [
"unittest.main",
"raman_fitting.deconvolution_models.peak_validation.PeakModelValidator"
] | [((2260, 2280), 'raman_fitting.deconvolution_models.peak_validation.PeakModelValidator', 'PeakModelValidator', ([], {}), '()\n', (2278, 2280), False, 'from raman_fitting.deconvolution_models.peak_validation import NotFoundAnyModelsWarning, PeakModelValidator\n'), ((2488, 2503), 'unittest.main', 'unittest.main', ([], {}... |
import pytest
@pytest.mark.parametrize('x', [True]*10)
def test_ok(x):
assert True
| [
"pytest.mark.parametrize"
] | [((16, 57), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""x"""', '([True] * 10)'], {}), "('x', [True] * 10)\n", (39, 57), False, 'import pytest\n')] |
# Copyright Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompan... | [
"sagemaker.workflow.conditions.ConditionNot",
"tests.unit.sagemaker.workflow.helpers.ordered",
"sagemaker.workflow.parameters.ParameterInteger",
"sagemaker.workflow.condition_step.ConditionStep",
"sagemaker.workflow.pipeline.Pipeline",
"sagemaker.workflow.conditions.ConditionEquals",
"sagemaker.workflow... | [((1212, 1218), 'mock.Mock', 'Mock', ([], {}), '()\n', (1216, 1218), False, 'from mock import Mock\n'), ((1253, 1306), 'mock.Mock', 'Mock', ([], {'name': '"""default_bucket"""', 'return_value': '"""s3_bucket"""'}), "(name='default_bucket', return_value='s3_bucket')\n", (1257, 1306), False, 'from mock import Mock\n'), (... |
#!/usr/bin/python
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__copyright__ = "(c) Copyright 2020 Dell Inc. or its subsidiaries. All rights reserved."
__metaclass__ = type
DOCUMENTATION = '''
module... | [
"collections.OrderedDict",
"ansible.module_utils._text.to_native",
"xmltodict.parse",
"traceback.format_exc"
] | [((1523, 1535), 'ansible.module_utils._text.to_native', 'to_native', (['e'], {}), '(e)\n', (1532, 1535), False, 'from ansible.module_utils._text import to_native\n'), ((1554, 1576), 'traceback.format_exc', 'traceback.format_exc', ([], {}), '()\n', (1574, 1576), False, 'import traceback\n'), ((1865, 1878), 'collections.... |
#!/usr/bin/env python
# Copyright 2016-2021 Biomedical Imaging Group Rotterdam, Departments of
# Medical Informatics and Radiology, Erasmus MC, Rotterdam, The Netherlands
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... | [
"os.remove",
"WORC.addexceptions.WORCKeyError",
"zipfile.ZipFile",
"pandas.read_hdf",
"argparse.ArgumentParser",
"WORC.processing.label_processing.findlabeldata",
"csv.writer",
"numpy.argmax",
"SimpleITK.ReadImage",
"os.path.dirname",
"numpy.asarray",
"numpy.argsort",
"numpy.mean",
"glob.g... | [((1181, 1248), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Plot distances to hyperplane"""'}), "(description='Plot distances to hyperplane')\n", (1204, 1248), False, 'import argparse\n'), ((4830, 4852), 'pandas.read_hdf', 'pd.read_hdf', (['estimator'], {}), '(estimator)\n', (4841, 48... |
#!/usr/bin/env python
############################################################################
#
# Copyright (C) 2015 <NAME>. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistrib... | [
"glob.glob"
] | [((1731, 1769), 'glob.glob', 'glob.glob', (['"""builtin_commands/COMMAND*"""'], {}), "('builtin_commands/COMMAND*')\n", (1740, 1769), False, 'import glob\n')] |
import os
os.chdir('.')
#Add more code
| [
"os.chdir"
] | [((10, 23), 'os.chdir', 'os.chdir', (['"""."""'], {}), "('.')\n", (18, 23), False, 'import os\n')] |
# This file is part of Genie
#
# Copyright 2019 The Board of Trustees of the Leland Stanford Junior University
#
# 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/lic... | [
"json.dump",
"extruct.extract",
"w3lib.html.get_base_url",
"requests.get",
"bs4.BeautifulSoup"
] | [((1208, 1226), 'requests.get', 'requests.get', (['next'], {}), '(next)\n', (1220, 1226), False, 'import requests\n'), ((1250, 1291), 'w3lib.html.get_base_url', 'get_base_url', (['response.text', 'response.url'], {}), '(response.text, response.url)\n', (1262, 1291), False, 'from w3lib.html import get_base_url\n'), ((13... |
# Insecam IP Scraper.
# Discord: L3#0001
from urllib.request import urlopen, Request
import urllib.request
import re
# File to write to
filename = "IP.txt"
# Regex to search for IP
regex = re.compile(r"(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):(\d{1,5})")
# HTTP Error 403: Forbidden without User Agent info. ... | [
"re.findall",
"urllib.request.Request",
"re.compile"
] | [((202, 270), 're.compile', 're.compile', (['"""(\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}):(\\\\d{1,5})"""'], {}), "('(\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}):(\\\\d{1,5})')\n", (212, 270), False, 'import re\n'), ((1115, 1152), 'urllib.request.Request', 'Request', ([], {'url': 'reg_url',... |
import os
from fsociety.core.repo import GitHubRepo
from fsociety.core.menu import confirm
class XsstrikeRepo(GitHubRepo):
def __init__(self):
super().__init__(
path="s0md3v/XSStrike",
install={"pip": "requirements.txt"},
description="Advanced XSS Detection Suite",
... | [
"fsociety.core.menu.confirm",
"os.system",
"os.chdir"
] | [((355, 379), 'os.chdir', 'os.chdir', (['self.full_path'], {}), '(self.full_path)\n', (363, 379), False, 'import os\n'), ((473, 505), 'fsociety.core.menu.confirm', 'confirm', (['"""Do you want to crawl?"""'], {}), "('Do you want to crawl?')\n", (480, 505), False, 'from fsociety.core.menu import confirm\n'), ((553, 602)... |
from nornir import InitNornir
from nornir.core.filter import F
from genie.utils import Dq
from genie.conf.base.utils import QDict
from nornir_netmiko import netmiko_send_command
class PTNR(object):
""" for Nornir specific config / runtime """
def __init__(self, filt=''):
self.nr = InitNornir(config_f... | [
"genie.utils.Dq",
"nornir.InitNornir",
"nornir.core.filter.F"
] | [((301, 338), 'nornir.InitNornir', 'InitNornir', ([], {'config_file': '"""config.yaml"""'}), "(config_file='config.yaml')\n", (311, 338), False, 'from nornir import InitNornir\n'), ((581, 588), 'nornir.core.filter.F', 'F', ([], {}), '(**fd)\n', (582, 588), False, 'from nornir.core.filter import F\n'), ((2348, 2368), 'g... |
from django.contrib.auth.models import User, Group
from django.contrib.sites.models import Site
from django.contrib.redirects.models import Redirect
from django import forms
from django.conf import settings as django_settings
# from enum import Enum
from drf_braces.serializers.form_serializer import FormSerializer
# f... | [
"rest_framework.serializers.CharField",
"rest_framework.serializers.DictField",
"rest_framework.serializers.IntegerField",
"django.forms.IntegerField"
] | [((1293, 1333), 'rest_framework.serializers.IntegerField', 'serializers.IntegerField', ([], {'read_only': '(True)'}), '(read_only=True)\n', (1317, 1333), False, 'from rest_framework import serializers\n'), ((1461, 1501), 'rest_framework.serializers.IntegerField', 'serializers.IntegerField', ([], {'read_only': '(True)'}... |
import logging
import pandas as pd
import numpy as np
from kipoiseq.dataclasses import Interval, Variant
from kipoi.data import Dataset
from kipoiseq.extractors import VariantSeqExtractor
from mmsplice.utils import encodeDNA
from pyfaidx import Fasta, FastaVariant
from cyvcf2 import VCF
from allel import read_vcf, rea... | [
"numpy.stack",
"kipoiseq.dataclasses.Interval",
"kipoiseq.dataclasses.Variant.from_cyvcf",
"allel.read_vcf_headers",
"pyfaidx.FastaVariant",
"pandas.read_csv",
"pyfaidx.Fasta",
"allel.read_vcf",
"cyvcf2.VCF",
"kipoiseq.dataclasses.Variant",
"mmsplice.utils.encodeDNA",
"logging.getLogger"
] | [((344, 373), 'logging.getLogger', 'logging.getLogger', (['"""mmsplice"""'], {}), "('mmsplice')\n", (361, 373), False, 'import logging\n'), ((812, 829), 'pyfaidx.Fasta', 'Fasta', (['fasta_file'], {}), '(fasta_file)\n', (817, 829), False, 'from pyfaidx import Fasta, FastaVariant\n'), ((1569, 1586), 'pyfaidx.Fasta', 'Fas... |
r"""
.. _sec-randindex:
Rand index
====================================================================================================
Description
----------------------------------------------------------------------------------------------------
The Rand index measures the similarity between two segmentations.
Fo... | [
"ruptures.metrics.hamming"
] | [((2234, 2255), 'ruptures.metrics.hamming', 'hamming', (['bkps1', 'bkps2'], {}), '(bkps1, bkps2)\n', (2241, 2255), False, 'from ruptures.metrics import hamming\n')] |
import io
import pytest
from .. import yaml_reader
from yamale.tests import get_fixture
parsers = ['pyyaml', 'PyYAML', 'ruamel']
TYPES = get_fixture('types.yaml')
NESTED = get_fixture('nested.yaml')
KEYWORDS = get_fixture('keywords.yaml')
@pytest.mark.parametrize('parser', parsers)
@pytest.mark.parametrize('use_stri... | [
"yamale.tests.get_fixture",
"pytest.raises",
"pytest.mark.parametrize",
"io.open"
] | [((138, 163), 'yamale.tests.get_fixture', 'get_fixture', (['"""types.yaml"""'], {}), "('types.yaml')\n", (149, 163), False, 'from yamale.tests import get_fixture\n'), ((173, 199), 'yamale.tests.get_fixture', 'get_fixture', (['"""nested.yaml"""'], {}), "('nested.yaml')\n", (184, 199), False, 'from yamale.tests import ge... |
# Create a sub function to print 3 digit numners. Use that function to print Billions, Millions, Thousands and Hundreds.
import re
class Solution:
def numberToWords(self, num: int) -> str:
if num==0:
return "Zero"
def num2words(num):
t_mapping... | [
"re.sub"
] | [((2040, 2064), 're.sub', 're.sub', (['"""\\\\s+"""', '""" """', 'res'], {}), "('\\\\s+', ' ', res)\n", (2046, 2064), False, 'import re\n'), ((1407, 1431), 're.sub', 're.sub', (['"""\\\\s+"""', '""" """', 'res'], {}), "('\\\\s+', ' ', res)\n", (1413, 1431), False, 'import re\n')] |
from helpers import prepare_batches, get_target_tensor
import torch
import torch.nn as nn
import time
from random import shuffle
def train(model, training_data, validation_data,
epochs, lr, evaluate_per, batch_size):
model.train() #short hand to begin tracking the gradient
optimizer = torch.optim.Ada... | [
"random.shuffle",
"helpers.get_target_tensor",
"torch.nn.CrossEntropyLoss",
"time.time",
"torch.cuda.is_available",
"helpers.prepare_batches"
] | [((496, 517), 'torch.nn.CrossEntropyLoss', 'nn.CrossEntropyLoss', ([], {}), '()\n', (515, 517), True, 'import torch.nn as nn\n'), ((530, 555), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (553, 555), False, 'import torch\n'), ((794, 805), 'time.time', 'time.time', ([], {}), '()\n', (803, 805)... |
"""
aoe2record-to-json JSONEncoder class.
"""
import _hashlib
import json
import mgz
import mgz.summary
class JSONEncoder(json.JSONEncoder):
"""A JSONEncoder for parsing Age of Empires II records."""
def default(self, obj: any) -> any:
"""
:param obj:
:rtype:
"""
if i... | [
"json.JSONEncoder.default"
] | [((864, 899), 'json.JSONEncoder.default', 'json.JSONEncoder.default', (['self', 'obj'], {}), '(self, obj)\n', (888, 899), False, 'import json\n')] |
# Keep getting ModuleNotFoundError: No module named 'app'
# Cannot for the life of me figure out what I am doing wrong; pytest aborted
from app.cstris import generate_code
from app.cstris import accept_challenge
def test_generate_code():
assert generate_code("test",12.75,2)[0] == 't'
assert generate_code("tes... | [
"app.cstris.accept_challenge",
"app.cstris.generate_code"
] | [((443, 530), 'app.cstris.accept_challenge', 'accept_challenge', (['"""CTrain963982653189383087304106411.0369488367480975665396228721"""'], {}), "(\n 'CTrain963982653189383087304106411.0369488367480975665396228721')\n", (459, 530), False, 'from app.cstris import accept_challenge\n'), ((251, 282), 'app.cstris.generat... |
#!/usr/bin/env python3
import h5py as h5
from netCDF4 import Dataset
import numpy as np
import pystare as ps
import json
from sortedcontainers import SortedDict, SortedList
import geodata as gd
# import os,fnmatch
import yaml
def hex16(i):
return "0x%016x"%i
with open("config.yaml") as f:
config = yaml.load... | [
"yaml.load",
"geodata.merra2_stare_time",
"geodata.spatial_terminator",
"json.dumps",
"geodata.goes10_img_stare_time",
"numpy.mean",
"numpy.arange",
"netCDF4.Dataset",
"pystare.from_latlon",
"numpy.full",
"numpy.meshgrid",
"geodata.spatial_clear_to_resolution",
"geodata.temporal_id_centered_... | [((515, 574), 'geodata.data_catalog', 'gd.data_catalog', (["config['data_sources']['goes_gvar_img_b5']"], {}), "(config['data_sources']['goes_gvar_img_b5'])\n", (530, 574), True, 'import geodata as gd\n'), ((630, 679), 'geodata.data_catalog', 'gd.data_catalog', (["config['data_sources']['merra2']"], {}), "(config['data... |
#
# General-purpose Photovoltaic Device Model - a drift diffusion base/Shockley-Read-Hall
# model for 1st, 2nd and 3rd generation solar cells.
# Copyright (C) 2008-2022 <NAME> r.c.i.m<EMAIL>ie at googlemail.com
#
# https://www.gpvdm.com
#
# This program is free software; you can redistribute it and/or ... | [
"PyQt5.QtWidgets.QWidget.__init__",
"gpvdm_json.gpvdm_data",
"cal_path.find_light_source"
] | [((1347, 1369), 'PyQt5.QtWidgets.QWidget.__init__', 'QWidget.__init__', (['self'], {}), '(self)\n', (1363, 1369), False, 'from PyQt5.QtWidgets import QWidget, QSizePolicy, QTabWidget, QSystemTrayIcon, QMenu, QComboBox, QMenuBar, QLabel\n'), ((1534, 1546), 'gpvdm_json.gpvdm_data', 'gpvdm_data', ([], {}), '()\n', (1544, ... |
# A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2018-2021 NV Access Limited, <NAME> (Open Source Systems, Ltd.)
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.
"""Utilities to re-register particular system COM interfaces needed by NVDA.
Relevant dis... | [
"logHandler.log.error",
"winVersion.getWinVer",
"subprocess.STARTUPINFO",
"logHandler.log.debug",
"os.environ.get",
"os.path.expandvars",
"os.path.isfile",
"os.path.join",
"subprocess.check_call"
] | [((685, 759), 'os.path.join', 'os.path.join', (['globalVars.appDir', '"""COMRegistrationFixes"""', '"""oleaccProxy.reg"""'], {}), "(globalVars.appDir, 'COMRegistrationFixes', 'oleaccProxy.reg')\n", (697, 759), False, 'import os\n'), ((819, 853), 'os.path.expandvars', 'os.path.expandvars', (['"""%SYSTEMROOT%"""'], {}), ... |
'''
@Name: Allocation.py
@Author: <NAME>
@Data: 04/01/2015
------------------------------
Allocation is a formal definition of the
allocation structure. It contains keys
that can be used to access data on an IBP
depot.
'''
from datetime import datetime
from lace import logging
from lace.logging import trace
fr... | [
"unis.models.schemaLoader.get_class"
] | [((479, 517), 'unis.models.schemaLoader.get_class', 'schemaLoader.get_class', (['IBP_EXTENT_URI'], {}), '(IBP_EXTENT_URI)\n', (501, 517), False, 'from unis.models import Lifetime, schemaLoader\n')] |
# -*- coding: utf-8 -*-
# @Time : 2019/10/23 14:55
# @Author : Run
# @File : for_github.py
# @Software : PyCharm
from RunSpiders.templates import _ENV
from RunSpiders.utils import *
import re
from bs4 import BeautifulSoup
from IPython.display import HTML
def get_popularity_info(project_github_url):
"... | [
"re.split",
"RunSpiders.templates._ENV.get_template",
"bs4.BeautifulSoup",
"re.search",
"IPython.display.HTML"
] | [((517, 559), 're.split', 're.split', (['"""[\\\\/\\\\\\\\]+"""', 'project_github_url'], {}), "('[\\\\/\\\\\\\\]+', project_github_url)\n", (525, 559), False, 'import re\n'), ((790, 817), 'bs4.BeautifulSoup', 'BeautifulSoup', (['cont', '"""lxml"""'], {}), "(cont, 'lxml')\n", (803, 817), False, 'from bs4 import Beautifu... |
from flask import current_app
from api.api import bp
@bp.route('/')
@bp.route('/status')
def status():
current_app.logger.info('/api/status')
return {'status': 'ok'}
| [
"flask.current_app.logger.info",
"api.api.bp.route"
] | [((56, 69), 'api.api.bp.route', 'bp.route', (['"""/"""'], {}), "('/')\n", (64, 69), False, 'from api.api import bp\n'), ((71, 90), 'api.api.bp.route', 'bp.route', (['"""/status"""'], {}), "('/status')\n", (79, 90), False, 'from api.api import bp\n'), ((109, 147), 'flask.current_app.logger.info', 'current_app.logger.inf... |
#
# Copyright (c) Ionplus AG and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for details.
#
from migration.table_mapping import TableMapping
customer = TableMapping('user_t', 'customer', (
('user_nr', 'number'),
('first_name',),
('las... | [
"migration.table_mapping.TableMapping"
] | [((223, 659), 'migration.table_mapping.TableMapping', 'TableMapping', (['"""user_t"""', '"""customer"""', "(('user_nr', 'number'), ('first_name',), ('last_name',), ('organisation',),\n ('institute',), ('address_1',), ('address_2',), ('town',), ('postcode',\n ), ('country',), ('phone_1',), ('phone_2',), ('fax',), ... |
from django.contrib import admin
from solo.admin import SingletonModelAdmin
from .models import SiteConfiguration, FotosPortada
class FotosInlines(admin.TabularInline):
model = FotosPortada
extra = 1
class SiteConfigAdmin(SingletonModelAdmin):
inlines = [FotosInlines]
admin.site.register(SiteConfigurat... | [
"django.contrib.admin.site.register"
] | [((286, 341), 'django.contrib.admin.site.register', 'admin.site.register', (['SiteConfiguration', 'SiteConfigAdmin'], {}), '(SiteConfiguration, SiteConfigAdmin)\n', (305, 341), False, 'from django.contrib import admin\n')] |
from modulegraph import zipio
import os
import time
import sys
import stat
if sys.version_info[:2] <= (2,6):
import unittest2 as unittest
else:
import unittest
TESTDATA=os.path.join(
os.path.dirname(os.path.abspath(__file__)),
'testdata')
class TestModuleGraph (unittest.TestCase):
def te... | [
"unittest.main",
"os.path.abspath",
"modulegraph.zipio.isdir",
"modulegraph.zipio.islink",
"os.unlink",
"os.stat",
"modulegraph.zipio.readlink",
"modulegraph.zipio._locate",
"time.mktime",
"os.path.getmtime",
"modulegraph.zipio.getmode",
"stat.S_IMODE",
"distutils.spawn.find_executable",
"... | [((11705, 11720), 'unittest.main', 'unittest.main', ([], {}), '()\n', (11718, 11720), False, 'import unittest\n'), ((218, 243), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (233, 243), False, 'import os\n'), ((6554, 6587), 'os.path.join', 'os.path.join', (['TESTDATA', '"""symlink"""'], {}),... |
#! /usr/bin/env python
# -*- coding: iso-8859-15 -*-
import mircx_pipeline as mrx
import argparse
import glob
import os
from mircx_pipeline import log, setup, files;
from astropy.io import fits;
from astropy.... | [
"mircx_pipeline.files.write",
"mircx_pipeline.log.check",
"mircx_pipeline.setup.uv_maxrel_distance",
"argparse.ArgumentParser",
"astropy.time.Time",
"mircx_pipeline.files.output",
"mircx_pipeline.setup.compute_base_uv",
"mircx_pipeline.log.info",
"mircx_pipeline.log.trace",
"astropy.io.fits.open",... | [((879, 1016), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'description', 'epilog': 'epilog', 'formatter_class': 'argparse.RawDescriptionHelpFormatter', 'add_help': '(False)'}), '(description=description, epilog=epilog,\n formatter_class=argparse.RawDescriptionHelpFormatter, add_help=F... |
#-*- coding: utf-8 -*-
from decimal import Decimal
from django.contrib.auth.models import User
from django.http import HttpResponseRedirect, HttpResponse
from django.test.testcases import TestCase
from shop.models.cartmodel import Cart, CartItem
from shop.models.productmodel import Product
from shop.tests.util import M... | [
"shop.views.cart.CartDetails",
"decimal.Decimal",
"django.contrib.auth.models.User.objects.create",
"shop.views.product.ProductDetailView",
"shop.models.cartmodel.Cart.objects.create",
"shop.models.cartmodel.CartItem.objects.create",
"shop.models.productmodel.Product",
"shop.tests.util.Mock",
"shop.... | [((520, 529), 'shop.models.productmodel.Product', 'Product', ([], {}), '()\n', (527, 529), False, 'from shop.models.productmodel import Product\n'), ((694, 708), 'decimal.Decimal', 'Decimal', (['"""1.0"""'], {}), "('1.0')\n", (701, 708), False, 'from decimal import Decimal\n'), ((766, 815), 'shop.views.product.ProductD... |
import unittest
import os
import shutil
import tempfile
from typing import List
import numpy as np
from .. import arimage
from .. import flatfield
_DARKS_DIR = "darks"
_MDARKS_DIR = "mdarks"
_FLATS_DIR = "flats"
_MFLATS_DIR = "mflats"
_LIGHTS_DIR = "lights"
_OUTPUT_DIR = "output"
# Hot pixels
_hot_data = [
np.... | [
"os.makedirs",
"numpy.median",
"os.path.exists",
"tempfile.mkdtemp",
"numpy.array",
"shutil.rmtree",
"os.path.join"
] | [((824, 900), 'numpy.array', 'np.array', (['[[25832, 23182, 15771], [5226, 9340, 27285], [13194, 17725, 8694]]'], {}), '([[25832, 23182, 15771], [5226, 9340, 27285], [13194, 17725, 8694]])\n', (832, 900), True, 'import numpy as np\n'), ((957, 1007), 'numpy.array', 'np.array', (['[[10, 30, 4], [96, 55, 43], [19, 8, 77]]... |
# Common imports
import os
# Where to save the figures and data files
DATA_ID = "Results/EnergyMin"
def data_path(dat_id):
return os.path.join(DATA_ID, dat_id)
infile = open(data_path("Energies.dat"),'r')
from numpy import std, mean, concatenate, arange, loadtxt, zeros, ceil
from numpy.random import randint
fro... | [
"numpy.std",
"numpy.zeros",
"time.time",
"numpy.mean",
"numpy.arange",
"numpy.loadtxt",
"numpy.random.randint",
"os.path.join"
] | [((1048, 1054), 'time.time', 'time', ([], {}), '()\n', (1052, 1054), False, 'from time import time\n'), ((1059, 1074), 'numpy.loadtxt', 'loadtxt', (['infile'], {}), '(infile)\n', (1066, 1074), False, 'from numpy import std, mean, concatenate, arange, loadtxt, zeros, ceil\n'), ((136, 165), 'os.path.join', 'os.path.join'... |
#!/usr/bin/env python3
from .metric import ReferencedMetric
from .texts import Predictions, References
from typing import Dict
from sacrebleu.metrics import TER as _TER
from itertools import zip_longest
class TER(ReferencedMetric):
"""Translation error rate (TER) from SacreBLEU."""
def __init__(self, norma... | [
"sacrebleu.metrics.TER",
"itertools.zip_longest"
] | [((397, 455), 'sacrebleu.metrics.TER', '_TER', ([], {'normalized': 'normalized', 'case_sensitive': 'case_sensitive'}), '(normalized=normalized, case_sensitive=case_sensitive)\n', (401, 455), True, 'from sacrebleu.metrics import TER as _TER\n'), ((693, 729), 'itertools.zip_longest', 'zip_longest', (['*references.untoken... |
import requests
import pandas as pd
import time
from random import randint
URL = "https://api-g.weedmaps.com/discovery/v1/listings?sort_by=position_distance&filter%5Bany_retailer_services%5D%5B%5D=delivery&page_size=25&page={}"
HEADERS = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537... | [
"random.randint",
"pandas.concat"
] | [((1776, 1829), 'pandas.concat', 'pd.concat', (['self.list_of_dataframes'], {'ignore_index': '(True)'}), '(self.list_of_dataframes, ignore_index=True)\n', (1785, 1829), True, 'import pandas as pd\n'), ((1492, 1505), 'random.randint', 'randint', (['(2)', '(7)'], {}), '(2, 7)\n', (1499, 1505), False, 'from random import ... |
import os
from azureml.core import Workspace, Environment
from azureml.core.dataset import Dataset
from azureml.pipeline.core import Pipeline
from ml_service.util.attach_compute import get_compute
from ml_service.util.env_variables import Env
def main():
e = Env()
# Get Azure machine learning workspace
am... | [
"azureml.core.dataset.Dataset.File.from_files",
"azureml.core.dataset.Dataset.get_by_name",
"ml_service.util.attach_compute.get_compute",
"azureml.pipeline.core.Pipeline",
"azureml.pipeline.steps.ParallelRunStep",
"azureml.core.Workspace.get",
"azureml.pipeline.core.PipelineData",
"ml_service.util.env... | [((265, 270), 'ml_service.util.env_variables.Env', 'Env', ([], {}), '()\n', (268, 270), False, 'from ml_service.util.env_variables import Env\n'), ((334, 442), 'azureml.core.Workspace.get', 'Workspace.get', ([], {'name': 'e.workspace_name', 'subscription_id': 'e.subscription_id', 'resource_group': 'e.resource_group'}),... |
"""
iorodeo-potentiostat
---------------------
Python interface to IO Rodeo's Potentiostat Shield for the teensy 3.2 development
board.
Example
--------
.. code:: python
from potentiostat import Potentiostat
dev = Potentiostat('/dev/ttyACM0')
dev.set_curr_range('100uA')
dev.set_sample_period(10)
... | [
"os.path.dirname",
"setuptools.find_packages"
] | [((976, 998), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (988, 998), False, 'from os import path\n'), ((2123, 2175), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['docs', 'tests', 'examples']"}), "(exclude=['docs', 'tests', 'examples'])\n", (2136, 2175), False, 'from setupt... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.