code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import rhinoscriptsyntax as rs
import Rhino.Geometry as rg
import System.Drawing as sd
import Rhino.RhinoDoc as rr
import scriptcontext as sc
sc.doc=rr.ActiveDoc
def createColoredPoint(x,y,z,r,g,b):
currentColor = [r,g,b]
pt = rs.AddPoint(x,y,z)
rs.ObjectColor(pt, currentColor)
rs.EnableRe... | [
"rhinoscriptsyntax.Redraw",
"rhinoscriptsyntax.ObjectColor",
"rhinoscriptsyntax.AddPoint",
"rhinoscriptsyntax.EnableRedraw"
] | [((309, 331), 'rhinoscriptsyntax.EnableRedraw', 'rs.EnableRedraw', (['(False)'], {}), '(False)\n', (324, 331), True, 'import rhinoscriptsyntax as rs\n'), ((483, 494), 'rhinoscriptsyntax.Redraw', 'rs.Redraw', ([], {}), '()\n', (492, 494), True, 'import rhinoscriptsyntax as rs\n'), ((247, 267), 'rhinoscriptsyntax.AddPoin... |
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('home.html')
@app.route('/puppy/<name>')
def pup_name(name):
return render_template('puppy.html', name=name)
if __name__ == "__main__":
app.run(debug=True)
| [
"flask.Flask",
"flask.render_template"
] | [((49, 64), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (54, 64), False, 'from flask import Flask, render_template\n'), ((106, 134), 'flask.render_template', 'render_template', (['"""home.html"""'], {}), "('home.html')\n", (121, 134), False, 'from flask import Flask, render_template\n'), ((196, 236), 'f... |
import numpy as np
import tensorflow as tf
from tools.tf_tools import binary_entropy, repeat_axis
class EntropyTest(tf.test.TestCase):
def test_binary_entropy_logits(self):
H1 = binary_entropy(logits=[0., 0.]) # i.e. sigmoid(logits) = 0.5
H0 = binary_entropy(logits=[100., -100.])
with s... | [
"tensorflow.test.main",
"numpy.random.rand",
"tensorflow.constant",
"tools.tf_tools.binary_entropy",
"numpy.repeat"
] | [((1072, 1086), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (1084, 1086), True, 'import tensorflow as tf\n'), ((193, 226), 'tools.tf_tools.binary_entropy', 'binary_entropy', ([], {'logits': '[0.0, 0.0]'}), '(logits=[0.0, 0.0])\n', (207, 226), False, 'from tools.tf_tools import binary_entropy, repeat_axis\... |
"""Serializers for Certificate API"""
import django_countries
from dj_rest_auth.serializers import UserDetailsSerializer
from django.contrib.auth import password_validation
from django_countries.serializers import CountryFieldMixin
from rest_framework import serializers
from certificate_engine.types import Certificat... | [
"x509_pki.models.DistinguishedName.objects.create",
"django_countries.Countries",
"django.contrib.auth.password_validation.validate_password",
"rest_framework.serializers.CharField",
"rest_framework.serializers.CurrentUserDefault",
"x509_pki.models.Certificate.objects.filter",
"x509_pki.models.Certifica... | [((409, 437), 'django_countries.Countries', 'django_countries.Countries', ([], {}), '()\n', (435, 437), False, 'import django_countries\n'), ((970, 1062), 'rest_framework.serializers.CharField', 'serializers.CharField', ([], {'max_length': '(200)', 'required': '(False)', 'allow_null': '(True)', 'allow_blank': '(True)'}... |
# -*- coding: utf-8 -*-
"""fileio module."""
import pandas as pd # create_conf_file
import csv # write_conf_header, create_conf_file
import json # create_conf_file
import os # read_c3d_file
import btk # C3D class
import bmch # C3D class
import numpy as np # C3D class
def write_conf_header(metadata_path):
"... | [
"json.load",
"json.dumps",
"bmch.util.GuiC3D",
"btk.btkAcquisitionFileReader",
"numpy.squeeze",
"os.path.join",
"os.listdir",
"csv.DictWriter"
] | [((2284, 2304), 'json.load', 'json.load', (['json_data'], {}), '(json_data)\n', (2293, 2304), False, 'import json\n'), ((4011, 4041), 'btk.btkAcquisitionFileReader', 'btk.btkAcquisitionFileReader', ([], {}), '()\n', (4039, 4041), False, 'import btk\n'), ((5891, 5924), 'bmch.util.GuiC3D', 'bmch.util.GuiC3D', (['targets'... |
import pandas as pd
def combine_reciprocal_hits(keep_df, other_df):
"""
"""
missed_samples = set(other_df.index.values).difference(
set(keep_df.index.values))
for each in missed_samples:
hit = other_df.loc[each, 'B_id']
if hit not in keep_df['B_id'].values:
... | [
"pandas.DataFrame",
"pandas.read_csv",
"pandas.concat"
] | [((940, 1035), 'pandas.DataFrame', 'pd.DataFrame', ([], {'index': 'uniprot.index.values', 'columns': "['UniProt.ID', 'UniProt.Name']", 'dtype': 'str'}), "(index=uniprot.index.values, columns=['UniProt.ID',\n 'UniProt.Name'], dtype=str)\n", (952, 1035), True, 'import pandas as pd\n'), ((1384, 1449), 'pandas.concat', ... |
import argparse
import getpass
import json
import os
import subprocess
import sys
from axolpy import configuration, logging, solidity
from web3 import Web3
def init_arg_parser() -> argparse.ArgumentParser:
"""
Initialize argument parser.
:return: An argument parser for inputs.
:rtype: :class:`argpar... | [
"json.dump",
"subprocess.Popen",
"argparse.ArgumentParser",
"axolpy.logging.show_milliseconds",
"axolpy.solidity.SolidityHelper.solcx_compile_standard",
"web3.Web3.HTTPProvider",
"getpass.getpass",
"os.path.basename",
"axolpy.configuration.AxolpyConfigManager.get_context",
"axolpy.logging.set_leve... | [((774, 805), 'axolpy.logging.set_level', 'logging.set_level', (['logging.INFO'], {}), '(logging.INFO)\n', (791, 805), False, 'from axolpy import configuration, logging, solidity\n'), ((806, 833), 'axolpy.logging.show_milliseconds', 'logging.show_milliseconds', ([], {}), '()\n', (831, 833), False, 'from axolpy import c... |
import torch
# Path or parameters for data
DATA_DIR = 'data'
SP_DIR = f'{DATA_DIR}/sp'
SRC_DIR = 'src'
TRG_DIR = 'trg'
SRC_RAW_DATA_NAME = 'raw_data.src'
TRG_RAW_DATA_NAME = 'raw_data.trg'
TRAIN_NAME = 'train.txt'
VALID_NAME = 'valid.txt'
TEST_NAME = 'test.txt'
# Parameters for sentencepiece tokenizer
pad_id = 0
sos_... | [
"torch.cuda.is_available",
"torch.device"
] | [((549, 574), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (572, 574), False, 'import torch\n'), ((525, 545), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (537, 545), False, 'import torch\n'), ((580, 599), 'torch.device', 'torch.device', (['"""cpu"""'], {}), "('cpu')\n"... |
import numpy as np
import cv2
import pandas as pd
import face_recognition as fc
import time
import random as rd
import smtplib
import xlrd
fcc=0
v=cv2.VideoCapture(0)
fd=cv2.CascadeClassifier(r"C:\Users\HP\AppData\Local\Programs\Python\Python36\Lib\site-packages\cv2\data\haarcascade_frontalface_alt2.xml")
... | [
"pandas.DataFrame",
"smtplib.SMTP",
"cv2.cvtColor",
"cv2.waitKey",
"face_recognition.face_encodings",
"time.sleep",
"cv2.VideoCapture",
"pandas.read_excel",
"random.random",
"cv2.CascadeClassifier",
"face_recognition.face_locations",
"cv2.imshow"
] | [((158, 177), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (174, 177), False, 'import cv2\n'), ((182, 339), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['"""C:\\\\Users\\\\HP\\\\AppData\\\\Local\\\\Programs\\\\Python\\\\Python36\\\\Lib\\\\site-packages\\\\cv2\\\\data\\\\haarcascade_frontalface... |
import json
from urllib.parse import unquote
from django.http import HttpRequest
from django.template.response import TemplateResponse
class CookieConsentMiddleware:
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
return self.get_response(reque... | [
"urllib.parse.unquote",
"json.JSONDecoder"
] | [((700, 718), 'json.JSONDecoder', 'json.JSONDecoder', ([], {}), '()\n', (716, 718), False, 'import json\n'), ((756, 778), 'urllib.parse.unquote', 'unquote', (['cookie_policy'], {}), '(cookie_policy)\n', (763, 778), False, 'from urllib.parse import unquote\n')] |
# Email received from Leopold Mozart:
#
# From: "<NAME>" <<EMAIL>>
# Date: Thu, 1 Sep 2016 01:39:31 -0700
# Message-ID: <<EMAIL>>
# Subject: Re: my broken zip Re: sorry
# MIME-Version: 1.0
# Content-Type: text/plain; charset=UTF-8
# Content-Transfer-Encoding: 7bit
# Content-Disposition: inline
# Precedence: bulk
# X-Au... | [
"md5.md5",
"StringIO.StringIO"
] | [((841, 863), 'StringIO.StringIO', 'StringIO.StringIO', (['src'], {}), '(src)\n', (858, 863), False, 'import StringIO\n'), ((726, 742), 'md5.md5', 'md5.md5', (['changed'], {}), '(changed)\n', (733, 742), False, 'import md5\n')] |
import time
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5 import QtCore
from QUANTAXIS.QASU.save_tdx import (QA_SU_save_stock_day,
QA_SU_save_stock_week,
QA_SU_save_stock_month,
... | [
"PyQt5.QtCore.pyqtSignal",
"QUANTAXIS.QASU.save_tdx.QA_SU_save_stock_xdxr",
"QUANTAXIS.QASU.save_tdx.QA_SU_save_etf_day",
"QUANTAXIS.QASU.save_tdx.QA_SU_save_stock_transaction",
"QUANTAXIS.QASU.save_tdx.QA_SU_save_index_day",
"QUANTAXIS.QASU.save_tdx.QA_SU_save_index_min",
"QUANTAXIS.QASU.save_tdx.QA_SU... | [((24627, 24649), 'PyQt5.QtCore.pyqtSignal', 'QtCore.pyqtSignal', (['str'], {}), '(str)\n', (24644, 24649), False, 'from PyQt5 import QtCore\n'), ((4445, 4554), 'QUANTAXIS.QASU.save_tdx.QA_SU_save_stock_day', 'QA_SU_save_stock_day', ([], {'client': 'DATABASE', 'ui_log': 'self.trigger_new_log', 'ui_progress': 'self.trig... |
import base64
import json
import pickle
from sys import argv
from time import sleep
import websocket
map_function = None
socket: websocket.WebSocketApp = None
def set_map_function(code: str):
global map_function
map_function = pickle.loads(base64.b64decode(code))
def execute_map(data):
decoded_data = ... | [
"websocket.WebSocketApp",
"json.loads",
"json.dumps",
"base64.b64decode",
"time.sleep",
"pickle.dumps"
] | [((595, 614), 'json.loads', 'json.loads', (['message'], {}), '(message)\n', (605, 614), False, 'import json\n'), ((761, 769), 'time.sleep', 'sleep', (['(1)'], {}), '(1)\n', (766, 769), False, 'from time import sleep\n'), ((925, 1046), 'websocket.WebSocketApp', 'websocket.WebSocketApp', (['websocket_url'], {'on_open': '... |
#
# This file is part of WinPexpect. WinPexpect is free software that is made
# available under the MIT license. Consult the file "LICENSE" that is
# distributed together with this file for the exact licensing terms.
#
# WinPexpect is copyright (c) 2008-2010 by the WinPexpect authors. See the
# file "AUTHORS" for a com... | [
"setuptools.setup"
] | [((503, 1145), 'setuptools.setup', 'setup', ([], {'name': '"""winpexpect"""', 'version': '"""1.6"""', 'description': '"""A version of pexpect that works under Windows."""', 'author': '"""<NAME>, <NAME>"""', 'author_email': '"""<EMAIL>, <EMAIL>"""', 'url': '"""https://bitbucket.org/weyou/winpexpect"""', 'license': '"""M... |
import warnings
import numpy as np
import pandas as pd
from matplotlib import patches
from sklearn.cluster import DBSCAN
from sklearn.decomposition import PCA
from sklearn.metrics import confusion_matrix
from sklearn.preprocessing import MinMaxScaler
from sklearn.preprocessing import OneHotEncoder, LabelEncoder
import ... | [
"csv.writer",
"warnings.filterwarnings",
"pandas.read_csv",
"sklearn.preprocessing.OneHotEncoder",
"sklearn.preprocessing.LabelEncoder"
] | [((509, 542), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (532, 542), False, 'import warnings\n'), ((558, 586), 'pandas.read_csv', 'pd.read_csv', (['"""kdd_train.csv"""'], {}), "('kdd_train.csv')\n", (569, 586), True, 'import pandas as pd\n'), ((601, 628), 'pandas.read_... |
#!/usr/bin/python3
import signal
import RPi.GPIO as GPIO
import logging
import coloredlogs
import sys
sys.path.append("..")
import argparse
import ruamel.yaml as YAML
import time
import threading
import asyncio
from neopixeldevice import NeopixelDevice, LED_PIN, LightMode, ws as ws_
from utils import *
from pn532 i... | [
"pn532.Pn532",
"kuzzle.kuzzle.KuzzleIOT",
"kuzzle.kuzzle.KuzzleIOT.server_info",
"RPi.GPIO.output",
"sys.path.append",
"asyncio.gather",
"tept5700.Tept5700",
"RPi.GPIO.cleanup",
"RPi.GPIO.setup",
"neopixeldevice.NeopixelDevice",
"ruamel.yaml.YAML",
"namedtupled.map",
"threading.Thread",
"R... | [((105, 126), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (120, 126), False, 'import sys\n'), ((395, 406), 'ruamel.yaml.YAML', 'YAML.YAML', ([], {}), '()\n', (404, 406), True, 'import ruamel.yaml as YAML\n'), ((439, 464), 'logging.getLogger', 'logging.getLogger', (['"""MAIN"""'], {}), "('MAIN'... |
#!/usr/bin/env python3
"""
App base.
- APP: flask app object
- DB: sqlalchemy database
- UTIL: utility methods
"""
import logging
from twitoff.app import make_app
APP, DB, REDIS = make_app()
application = APP
LOG = logging.getLogger("twitoff")
from twitoff import Routes
from twitoff.ser... | [
"logging.basicConfig",
"twitoff.service.util_service.UtilService",
"logging.getLogger",
"twitoff.app.make_app"
] | [((212, 222), 'twitoff.app.make_app', 'make_app', ([], {}), '()\n', (220, 222), False, 'from twitoff.app import make_app\n'), ((247, 275), 'logging.getLogger', 'logging.getLogger', (['"""twitoff"""'], {}), "('twitoff')\n", (264, 275), False, 'import logging\n'), ((365, 378), 'twitoff.service.util_service.UtilService', ... |
# #################################################################
# Python codes PENN for caching
# Codes have been tested successfully on Python 3.6.0 with TensorFlow 1.14.0.
# #################################################################
import scipy.io as sio
import numpy as np ... | [
"math.ceil",
"runner.run",
"numpy.sort",
"numpy.mean",
"numpy.reshape"
] | [((538, 560), 'math.ceil', 'math.ceil', (['(0.1 * num_H)'], {}), '(0.1 * num_H)\n', (547, 560), False, 'import math\n'), ((1300, 1340), 'numpy.reshape', 'np.reshape', (['Xtrain', '(d_past * K, num_tr)'], {}), '(Xtrain, (d_past * K, num_tr))\n', (1310, 1340), True, 'import numpy as np\n'), ((1341, 1376), 'numpy.reshape'... |
# Generated by Django 2.1.1 on 2020-08-03 04:47
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='pathtest',
name='district',
fie... | [
"django.db.models.CharField"
] | [((323, 368), 'django.db.models.CharField', 'models.CharField', ([], {'default': 'None', 'max_length': '(50)'}), '(default=None, max_length=50)\n', (339, 368), False, 'from django.db import migrations, models\n'), ((525, 570), 'django.db.models.CharField', 'models.CharField', ([], {'default': 'None', 'max_length': '(50... |
# -*- coding: utf8 -*-
"""
The main idea of this module, that you can combine
any number of any filters without any knowledge about their
implementation. You have only one requirement — user functions
should return a filter (or something that can be cast to a filter).
"""
from __future__ import absolu... | [
"shot_detector.filters.DelayFilter",
"builtins.range",
"shot_detector.filters.MeanSWFilter"
] | [((485, 498), 'shot_detector.filters.DelayFilter', 'DelayFilter', ([], {}), '()\n', (496, 498), False, 'from shot_detector.filters import DelayFilter, MeanSWFilter\n'), ((528, 550), 'shot_detector.filters.MeanSWFilter', 'MeanSWFilter', ([], {'cs': '(False)'}), '(cs=False)\n', (540, 550), False, 'from shot_detector.filt... |
from django.contrib.auth import get_user_model
from django.test import TestCase
from posts.models import Post, Group
User = get_user_model()
class PostModelTest(TestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
user = User.objects.create_user(username='TestUser')
cls.... | [
"posts.models.Post.objects.create",
"django.contrib.auth.get_user_model",
"posts.models.Group.objects.create"
] | [((126, 142), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (140, 142), False, 'from django.contrib.auth import get_user_model\n'), ((327, 401), 'posts.models.Post.objects.create', 'Post.objects.create', ([], {'text': '"""Text in post more then 15 simbols"""', 'author': 'user'}), "(text='Tex... |
import matplotlib.gridspec as gridspec
from nose.tools import assert_equal
def test_equal():
gs = gridspec.GridSpec(2, 1)
assert_equal(gs[0, 0], gs[0, 0])
assert_equal(gs[:, 0], gs[:, 0])
| [
"matplotlib.gridspec.GridSpec",
"nose.tools.assert_equal"
] | [((104, 127), 'matplotlib.gridspec.GridSpec', 'gridspec.GridSpec', (['(2)', '(1)'], {}), '(2, 1)\n', (121, 127), True, 'import matplotlib.gridspec as gridspec\n'), ((132, 164), 'nose.tools.assert_equal', 'assert_equal', (['gs[0, 0]', 'gs[0, 0]'], {}), '(gs[0, 0], gs[0, 0])\n', (144, 164), False, 'from nose.tools import... |
#Copyright 2020 Battelle Energy Alliance, LLC, ALL RIGHTS RESERVED.
#Buffered File with 0x00's
#Offset measured from center of chunk
#Adjustable slide %
#Added .Net Bytecode
#Added startup Notes
#Additional Error checking
#Added DotNet Bytecode
#Added Compiler Detection
#Added Percent Compressed or Encrypted
from tki... | [
"os.mkdir",
"zipfile.ZipFile",
"os.path.getsize",
"os.path.exists",
"tkinter.filedialog.askopenfilename",
"shutil.rmtree",
"os.path.join",
"os.listdir",
"shutil.copy"
] | [((557, 594), 'os.path.exists', 'os.path.exists', (["(programPath + 'Input')"], {}), "(programPath + 'Input')\n", (571, 594), False, 'import os\n'), ((646, 684), 'os.path.exists', 'os.path.exists', (["(programPath + 'Output')"], {}), "(programPath + 'Output')\n", (660, 684), False, 'import os\n'), ((737, 779), 'os.path... |
#! /usr/bin/env python3
"""
usage: bactopia-stats [-h] STR STR
bactopia-stats - Ouput files to be used by Bactopia-WDL
positional arguments:
STR Directory where Bactopia outputs are.
STR Sample name used in Bactopia run
optional arguments:
-h, --help show this help message and exit
"""
import ... | [
"json.load",
"os.path.exists",
"argparse.ArgumentParser",
"sys.exit"
] | [((1157, 1316), 'argparse.ArgumentParser', 'ap.ArgumentParser', ([], {'prog': 'PROGRAM', 'conflict_handler': '"""resolve"""', 'description': 'f"""{PROGRAM} - {DESCRIPTION}"""', 'formatter_class': 'ap.RawDescriptionHelpFormatter'}), "(prog=PROGRAM, conflict_handler='resolve', description=\n f'{PROGRAM} - {DESCRIPTION... |
import BartlebyMachine.main as bartleby
import BartlebyMachine.book as book
bartleby = bartleby.Bartleby()
bartleby.addTableOfContent('toc.ggded.yaml')
bartleby.markdownToLatex()
bartleby.writeLatex()
| [
"BartlebyMachine.main.Bartleby",
"BartlebyMachine.main.addTableOfContent",
"BartlebyMachine.main.markdownToLatex",
"BartlebyMachine.main.writeLatex"
] | [((88, 107), 'BartlebyMachine.main.Bartleby', 'bartleby.Bartleby', ([], {}), '()\n', (105, 107), True, 'import BartlebyMachine.main as bartleby\n'), ((108, 152), 'BartlebyMachine.main.addTableOfContent', 'bartleby.addTableOfContent', (['"""toc.ggded.yaml"""'], {}), "('toc.ggded.yaml')\n", (134, 152), True, 'import Bart... |
# Adapted from https://pytorch.org/tutorials/intermediate/reinforcement_q_learning.html
import argparse
import random
import sys
import time
from collections import namedtuple
from pathlib import Path
# Prevent numpy from using up all cpu
import os
os.environ['MKL_NUM_THREADS'] = '1' # pylint: disable=wrong-import-po... | [
"argparse.ArgumentParser",
"random.sample",
"utils.read_config",
"torch.nn.functional.smooth_l1_loss",
"pathlib.Path",
"torch.no_grad",
"utils.get_env_from_cfg",
"utils.write_config",
"torch.load",
"utils.get_state_and_output_visualization",
"torch.zeros",
"torch.cuda.is_available",
"torch.p... | [((556, 642), 'collections.namedtuple', 'namedtuple', (['"""Transition"""', "('state', 'action', 'reward', 'ministeps', 'next_state')"], {}), "('Transition', ('state', 'action', 'reward', 'ministeps',\n 'next_state'))\n", (566, 642), False, 'from collections import namedtuple\n'), ((2063, 2126), 'torch.zeros', 'torc... |
"""
dataclasses モジュールのサンプルです.
fronzen プロパティの指定について
REFERENCESS:: http://bit.ly/2KTZynw
http://bit.ly/2KJCnwk
http://bit.ly/2KHeNA9
http://bit.ly/2KFLGxc
"""
import dataclasses as dc
from trypython.common.commoncls import SampleBase
from trypython.common.commonfunc import pr
... | [
"trypython.common.commonfunc.pr",
"dataclasses.dataclass"
] | [((323, 348), 'dataclasses.dataclass', 'dc.dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (335, 348), True, 'import dataclasses as dc\n'), ((990, 1023), 'trypython.common.commonfunc.pr', 'pr', (['"""frozen な dataclass に値を設定"""', 'e'], {}), "('frozen な dataclass に値を設定', e)\n", (992, 1023), False, 'from trypy... |
import numpy as np
import scipy.io as sio
from GPy_ABCD.Models.modelSearch import *
from testConsistency import save_one_run
if __name__ == '__main__':
# np.seterr(all='raise') # Raise exceptions instead of RuntimeWarnings. The exceptions can then be caught by the debugger
datasets = ['01-airline', '02-sola... | [
"testConsistency.save_one_run",
"matplotlib.pyplot.show",
"scipy.io.loadmat"
] | [((537, 578), 'scipy.io.loadmat', 'sio.loadmat', (['f"""./Data/{dataset_name}.mat"""'], {}), "(f'./Data/{dataset_name}.mat')\n", (548, 578), True, 'import scipy.io as sio\n'), ((1399, 1409), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (1407, 1409), True, 'from matplotlib import pyplot as plt\n'), ((1415, 15... |
import torch
import torch.nn as nn
from .mpd import MultiPeriodDiscriminator
from .mrd import MultiResolutionDiscriminator
from omegaconf import OmegaConf
class Discriminator(nn.Module):
def __init__(self, hp):
super(Discriminator, self).__init__()
self.MRD = MultiResolutionDiscriminator(hp)
... | [
"omegaconf.OmegaConf.load",
"torch.randn"
] | [((467, 507), 'omegaconf.OmegaConf.load', 'OmegaConf.load', (['"""../config/default.yaml"""'], {}), "('../config/default.yaml')\n", (481, 507), False, 'from omegaconf import OmegaConf\n'), ((547, 571), 'torch.randn', 'torch.randn', (['(3)', '(1)', '(16384)'], {}), '(3, 1, 16384)\n', (558, 571), False, 'import torch\n')... |
import re
data = input()
pattern = r"\b([A-Z][a-z]+)\s([A-Z][a-z]+)\b"
matches = re.finditer(pattern, data)
for match in matches:
print(match.group(), end=" ")
| [
"re.finditer"
] | [((83, 109), 're.finditer', 're.finditer', (['pattern', 'data'], {}), '(pattern, data)\n', (94, 109), False, 'import re\n')] |
# -*- coding: utf-8 -*-
__author__ = "Yuchen"
__aim__ = 'rank top sentences in one topic'
__testCase__ = "../test/test_rankingTFIDF.py"
from sklearn.feature_extraction.text import CountVectorizer,TfidfTransformer
import sys
import argparse
import numpy as np
from termcolor import colored
from sklearn.metrics.pairwise ... | [
"sys.path.append",
"pushkin_gs.sum.tfidf_contentWords.main",
"sklearn.feature_extraction.text.CountVectorizer",
"sklearn.metrics.pairwise.cosine_similarity",
"argparse.ArgumentParser",
"numpy.argsort",
"numpy.array",
"operator.itemgetter",
"sklearn.feature_extraction.text.TfidfTransformer"
] | [((361, 385), 'sys.path.append', 'sys.path.append', (['"""../.."""'], {}), "('../..')\n", (376, 385), False, 'import sys\n'), ((6010, 6035), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (6033, 6035), False, 'import argparse\n'), ((6357, 6382), 'pushkin_gs.sum.tfidf_contentWords.main', 'tfidf_... |
# Copyright (c) 2021 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, ... | [
"telegram_payment_bot.misc.chat_members.ChatMembersList",
"telegram_payment_bot.misc.helpers.MemberHelper.IsValidMember",
"telegram_payment_bot.misc.user.User.FromUserObject",
"telegram_payment_bot.payment.payments_loader_factory.PaymentsLoaderFactory",
"telegram_payment_bot.misc.chat_members.ChatMembersGet... | [((3551, 3568), 'telegram_payment_bot.misc.chat_members.ChatMembersList', 'ChatMembersList', ([], {}), '()\n', (3566, 3568), False, 'from telegram_payment_bot.misc.chat_members import ChatMembersList, ChatMembersGetter\n'), ((4341, 4358), 'telegram_payment_bot.misc.chat_members.ChatMembersList', 'ChatMembersList', ([],... |
##########################################################################
#
# Copyright (c) 2019, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... | [
"json.dump",
"Gaffer.ValuePlug.clearCache",
"json.load",
"unittest.TextTestResult.wasSuccessful",
"unittest.TextTestResult.addSuccess",
"unittest.TextTestRunner.__init__",
"unittest.TextTestResult.addFailure",
"time.time",
"unittest.TextTestRunner.run",
"unittest.TextTestResult.startTest",
"unit... | [((2132, 2183), 'unittest.TextTestRunner.__init__', 'unittest.TextTestRunner.__init__', (['self'], {'verbosity': '(2)'}), '(self, verbosity=2)\n', (2164, 2183), False, 'import unittest\n'), ((4071, 4110), 'unittest.TextTestRunner.run', 'unittest.TextTestRunner.run', (['self', 'test'], {}), '(self, test)\n', (4098, 4110... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: Jared
"""
import pandas as pd
import pymongo
import json
from os import listdir
from os.path import isfile, join
import multiprocessing as mp
import numpy as np
import dbConfig
from builder.dummyCrystalBuilder import processDummyCrystals
from ml.feature impo... | [
"pymongo.MongoClient",
"os.listdir",
"builder.dummyCrystalBuilder.processDummyCrystals",
"pandas.read_csv",
"ml.feature.getCompFeature",
"multiprocessing.Pool",
"numpy.array_split",
"os.path.join",
"pandas.concat"
] | [((397, 418), 'pandas.read_csv', 'pd.read_csv', (['filename'], {}), '(filename)\n', (408, 418), True, 'import pandas as pd\n'), ((1600, 1632), 'numpy.array_split', 'np.array_split', (['df', 'numProcesses'], {}), '(df, numProcesses)\n', (1614, 1632), True, 'import numpy as np\n'), ((1645, 1676), 'multiprocessing.Pool', ... |
#ama_speech.py
import speech_recognition as spr
from gtts import gTTS
from playsound import playsound
from googletrans import Translator
import googletrans
import time
def RecognizeAndSpeech(sound1='th',sound2='zh-cn'):
time.sleep(2)
print('Recognizing..')
#print(googletrans.LANGUAGES)
##### RECOGN... | [
"playsound.playsound",
"gtts.gTTS",
"time.sleep",
"speech_recognition.Microphone",
"googletrans.Translator",
"speech_recognition.Recognizer"
] | [((235, 248), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (245, 248), False, 'import time\n'), ((341, 357), 'speech_recognition.Recognizer', 'spr.Recognizer', ([], {}), '()\n', (355, 357), True, 'import speech_recognition as spr\n'), ((643, 655), 'googletrans.Translator', 'Translator', ([], {}), '()\n', (653, 6... |
from enum import (
Enum,
auto,
unique,
IntEnum,
Flag,
IntFlag,
)
import enum
@unique
class Color(Enum):
RED = auto()
BLUE = auto()
YELLOW = "yellow"
CYAN = 3
GREEN = auto()
print(Color.RED.value)
print(Color.GREEN.value) | [
"enum.auto"
] | [((126, 132), 'enum.auto', 'auto', ([], {}), '()\n', (130, 132), False, 'from enum import Enum, auto, unique, IntEnum, Flag, IntFlag\n'), ((143, 149), 'enum.auto', 'auto', ([], {}), '()\n', (147, 149), False, 'from enum import Enum, auto, unique, IntEnum, Flag, IntFlag\n'), ((191, 197), 'enum.auto', 'auto', ([], {}), '... |
import pytest
import allure
from hamcrest import *
from shared.data_generators import Generators
@allure.issue("SAN-71", "Drafts")
@pytest.mark.parametrize('d_user', ["2 users"], indirect=True)
class TestConfigSync:
""" Tests for synchronization, setting and getting configs
"""
@allure.title("Test for dr... | [
"allure.issue",
"shared.data_generators.Generators.random_text_message",
"allure.step",
"allure.testcase",
"allure.title",
"pytest.mark.parametrize"
] | [((100, 132), 'allure.issue', 'allure.issue', (['"""SAN-71"""', '"""Drafts"""'], {}), "('SAN-71', 'Drafts')\n", (112, 132), False, 'import allure\n'), ((134, 195), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""d_user"""', "['2 users']"], {'indirect': '(True)'}), "('d_user', ['2 users'], indirect=True)\n",... |
import json
def checkForProcess(vmObject, processName):
vmObject.updateProcList()
if processName in ' '.join(vmObject.procList):
return True
else:
return False
def loadJsonFile(fileName):
try:
fileObject = open(fileName, 'r')
fileStr = fileObject.read()
fileObje... | [
"json.loads"
] | [((474, 493), 'json.loads', 'json.loads', (['fileStr'], {}), '(fileStr)\n', (484, 493), False, 'import json\n')] |
import codecs
from typing import Optional
from sqlalchemy.engine import create_engine
from config import webapp_settings
from model import Session
codecs.register(
lambda name: codecs.lookup('utf8') if name == 'utf8mb4' else None)
class ConnectionPooling(object):
def __init__(self, **params):
self.... | [
"model.Session.remove",
"codecs.lookup",
"model.Session.configure",
"model.Session",
"config.webapp_settings.get",
"sqlalchemy.engine.create_engine"
] | [((329, 389), 'sqlalchemy.engine.create_engine', 'create_engine', (["webapp_settings['mysql_connection']"], {}), "(webapp_settings['mysql_connection'], **params)\n", (342, 389), False, 'from sqlalchemy.engine import create_engine\n'), ((466, 510), 'config.webapp_settings.get', 'webapp_settings.get', (['"""mysql_extra_p... |
def polyFit(xData, yData, degree):
pass
fitValues = np.polyfit(xData, yData, degree)
yFit = np.zeros(len(xData))
for i in range(degree+1):
yFit = yFit + xData**(degree-i)*fitValues[i]
def function(x):
func = 0
for i in fitValues:
func = func*x + i
return f... | [
"pandas.read_csv",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"numpy.polyfit"
] | [((60, 92), 'numpy.polyfit', 'np.polyfit', (['xData', 'yData', 'degree'], {}), '(xData, yData, degree)\n', (70, 92), True, 'import numpy as np\n'), ((554, 611), 'pandas.read_csv', 'pd.read_csv', (['"""polyFit.csv"""'], {'header': 'None', 'names': "['x', 'y']"}), "('polyFit.csv', header=None, names=['x', 'y'])\n", (565,... |
"""Minimal implementation of Wasserstein GAN for MNIST."""
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.contrib import layers
from tensorflow.examples.tutorials.mnist import input_data
import threading
from rendering import draw_figure, export_video
def leaky_relu(x):
... | [
"tensorflow.reduce_sum",
"tensorflow.get_collection",
"tensorflow.maximum",
"tensorflow.contrib.layers.flatten",
"tensorflow.reshape",
"tensorflow.InteractiveSession",
"numpy.random.randn",
"tensorflow.variable_scope",
"tensorflow.placeholder",
"tensorflow.contrib.layers.conv2d_transpose",
"tens... | [((2786, 2809), 'tensorflow.InteractiveSession', 'tf.InteractiveSession', ([], {}), '()\n', (2807, 2809), True, 'import tensorflow as tf\n'), ((2942, 2981), 'tensorflow.examples.tutorials.mnist.input_data.read_data_sets', 'input_data.read_data_sets', (['"""MNIST_data"""'], {}), "('MNIST_data')\n", (2967, 2981), False, ... |
from polyaxon_schemas.environments import HorovodClusterConfig
from polyaxon_schemas.polyaxonfile.specification.frameworks import HorovodSpecification
from polyaxon_schemas.utils import TaskType
from scheduler.spawners.experiment_spawner import ExperimentSpawner
class HorovodSpawner(ExperimentSpawner):
MASTER_SER... | [
"polyaxon_schemas.environments.HorovodClusterConfig.from_dict",
"polyaxon_schemas.polyaxonfile.specification.frameworks.HorovodSpecification.get_worker_node_selectors",
"polyaxon_schemas.polyaxonfile.specification.frameworks.HorovodSpecification.get_worker_resources"
] | [((482, 610), 'polyaxon_schemas.polyaxonfile.specification.frameworks.HorovodSpecification.get_worker_resources', 'HorovodSpecification.get_worker_resources', ([], {'environment': 'self.spec.environment', 'cluster': 'cluster', 'is_distributed': 'is_distributed'}), '(environment=self.spec.environment,\n cluster=clust... |
from src.seededkm.seededkm import SeededKMeans
from src.constrainedkm.constrainedkm import ConstrainedKMeans
from sklearn import datasets
from src.utils.runnerutils import run_algo, run_KMeans
def cluster(n_clusters, seed_fraction, noise_fraction, incompleteness_fraction, manually_annotate, n_fold, run_KM):
iris =... | [
"sklearn.datasets.load_iris",
"src.utils.runnerutils.run_algo",
"src.utils.runnerutils.run_KMeans",
"src.constrainedkm.constrainedkm.ConstrainedKMeans",
"src.seededkm.seededkm.SeededKMeans"
] | [((321, 341), 'sklearn.datasets.load_iris', 'datasets.load_iris', ([], {}), '()\n', (339, 341), False, 'from sklearn import datasets\n'), ((391, 483), 'src.seededkm.seededkm.SeededKMeans', 'SeededKMeans', (['seed_fraction', 'noise_fraction', 'incompleteness_fraction', 'n_clusters', '"""iris"""'], {}), "(seed_fraction, ... |
"""Parsing of signal logs from experiments, and version logging."""
import datetime
import importlib
import json
import logging
import os
import pprint
import subprocess
import time
import git
import numpy as np
# these should be moved to other (optional) module
from openpromela import logic
from openpromela import slu... | [
"json.dump",
"subprocess.Popen",
"json.load",
"pprint.pformat",
"logging.FileHandler",
"importlib.import_module",
"os.uname",
"openpromela.slugs._to_slugs",
"time.strftime",
"git.Repo",
"time.time",
"datetime.timedelta",
"numpy.array",
"openpromela.logic.compile_spec",
"openpromela.slugs... | [((334, 361), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (351, 361), False, 'import logging\n'), ((476, 490), 'git.Repo', 'git.Repo', (['path'], {}), '(path)\n', (484, 490), False, 'import git\n'), ((947, 981), 'time.strftime', 'time.strftime', (['"""%Y-%b-%d-%A-%T-%Z"""'], {}), "('%Y... |
import pytest
from aiohttp import web
from pjrpc import exc
from pjrpc.common import v20
from pjrpc.server.integration import aiohttp as integration
from tests.common import _
@pytest.fixture
def path():
return '/test/path'
@pytest.fixture
def json_rpc(path):
json_rpc = integration.Application(path)
... | [
"pjrpc.exc.MethodNotFoundError",
"pjrpc.common.v20.Request",
"pjrpc.exc.ParseError",
"pjrpc.server.integration.aiohttp.Application",
"pytest.mark.parametrize",
"pjrpc.exc.JsonRpcError"
] | [((339, 611), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""request_id, params, result"""', "[(1, (1, 1.1, 'str', {}, False), [1, 1.1, 'str', {}, False]), ('abc', {\n 'int': 1, 'float': 1.1, 'str': 'str', 'dict': {}, 'bool': False}, {\n 'int': 1, 'float': 1.1, 'str': 'str', 'dict': {}, 'bool': False... |
#!/usr/bin/env python
import os
import toml
import sys
os.system('rm -f *wrl *h5')
# print('### RUNNING GEANT4 (design.wrl) ###')
# conf = toml.load('sfqed.toml')
# A = conf['PrimaryGenerator']
# A['PythoGenerator'] = 'sfqed.pattern_spray'
# A['NumEvents'] = 100
# with open('temp.toml', 'w') as fout:
# toml.dump(... | [
"toml.dump",
"toml.load",
"os.system"
] | [((56, 83), 'os.system', 'os.system', (['"""rm -f *wrl *h5"""'], {}), "('rm -f *wrl *h5')\n", (65, 83), False, 'import os\n'), ((593, 616), 'toml.load', 'toml.load', (['"""sfqed.toml"""'], {}), "('sfqed.toml')\n", (602, 616), False, 'import toml\n'), ((865, 911), 'os.system', 'os.system', (['"""pbpl-compton-mc temp.tom... |
from interbotix_xs_modules.locobot import InterbotixLocobotXS
# This script commands some arbitrary positions to the arm joints
#
# To get started, open a terminal and type...
# 'roslaunch interbotix_xslocobot_control xslocobot_python.launch robot_model:=locobot_wx250s show_lidar:=true'
# Then change to this directory... | [
"interbotix_xs_modules.locobot.InterbotixLocobotXS"
] | [((447, 523), 'interbotix_xs_modules.locobot.InterbotixLocobotXS', 'InterbotixLocobotXS', ([], {'robot_model': '"""locobot_wx250s"""', 'arm_model': '"""mobile_wx250s"""'}), "(robot_model='locobot_wx250s', arm_model='mobile_wx250s')\n", (466, 523), False, 'from interbotix_xs_modules.locobot import InterbotixLocobotXS\n'... |
'''
Once newer version of sklearn is used will need to change k alias from n_topics to n_components
https://stackoverflow.com/a/48121678
'''
from sklearn.decomposition import LatentDirichletAllocation as _LatentDirichletAllocation
from base import BaseAlgo, TransformerMixin
from codec import codecs_manager
from util.p... | [
"sklearn.decomposition.LatentDirichletAllocation",
"codec.codecs_manager.add_codec"
] | [((914, 954), 'sklearn.decomposition.LatentDirichletAllocation', '_LatentDirichletAllocation', ([], {}), '(**out_params)\n', (940, 954), True, 'from sklearn.decomposition import LatentDirichletAllocation as _LatentDirichletAllocation\n'), ((1296, 1415), 'codec.codecs_manager.add_codec', 'codecs_manager.add_codec', (['"... |
# MIT License
#
# Copyright (c) 2019 Red Hat, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge... | [
"flask.request.headers.get",
"packit_service.config.ServiceConfig.get_service_config",
"packit_service.celerizer.celery_app.send_task",
"packit_service.service.api.errors.ValidationFailed",
"flask.request.get_data",
"flask_restplus.fields.String",
"flask_restplus.Namespace",
"logging.getLogger"
] | [((1455, 1482), 'logging.getLogger', 'getLogger', (['"""packit_service"""'], {}), "('packit_service')\n", (1464, 1482), False, 'from logging import getLogger\n'), ((1492, 1526), 'packit_service.config.ServiceConfig.get_service_config', 'ServiceConfig.get_service_config', ([], {}), '()\n', (1524, 1526), False, 'from pac... |
from collections import namedtuple
from enum import Enum, unique
from functools import lru_cache
from core.errors import ParseError
@unique
class Associativity(Enum):
UNDEFINED = 0
LEFT = 1
RIGHT = 2
BinOpInfo = namedtuple('BinOpInfo', ['precedence', 'associativity'])
BUILTIN_OP = {
'=': BinOpInfo(2... | [
"core.errors.ParseError",
"collections.namedtuple"
] | [((227, 283), 'collections.namedtuple', 'namedtuple', (['"""BinOpInfo"""', "['precedence', 'associativity']"], {}), "('BinOpInfo', ['precedence', 'associativity'])\n", (237, 283), False, 'from collections import namedtuple\n'), ((1528, 1582), 'core.errors.ParseError', 'ParseError', (['f"""Undefined operator: "{value}\\... |
# -*- coding: utf-8 -*-
"""
This file is covered by the LICENSING file in the root of this project.
"""
import sys
sys.path.append("..")
import os
from os.path import realpath, dirname, isfile, abspath
import json
import time
import uuid
from werkzeug.datastructures import FileStorage
from io import IOBase
from hac... | [
"sys.path.append",
"json.dump",
"os.remove",
"os.makedirs",
"os.path.dirname",
"os.path.realpath",
"os.path.exists",
"time.strftime",
"os.path.isfile",
"uuid.uuid1",
"os.path.splitext"
] | [((117, 138), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (132, 138), False, 'import sys\n'), ((1465, 1477), 'os.path.isfile', 'isfile', (['path'], {}), '(path)\n', (1471, 1477), False, 'from os.path import realpath, dirname, isfile, abspath\n'), ((2044, 2062), 'os.path.dirname', 'dirname', ([... |
from flask import Blueprint, render_template
from flask_login import login_required, current_user
from ctf.models.Score import Score
from ctf import db
from sys import path
path.append("..")
scoreboard = Blueprint("scoreboard", __name__)
@scoreboard.route("/scoreboard")
def scoreboard_out():
scores = Score.query... | [
"sys.path.append",
"flask.render_template",
"flask.Blueprint",
"ctf.models.Score.Score.query.all"
] | [((173, 190), 'sys.path.append', 'path.append', (['""".."""'], {}), "('..')\n", (184, 190), False, 'from sys import path\n'), ((205, 238), 'flask.Blueprint', 'Blueprint', (['"""scoreboard"""', '__name__'], {}), "('scoreboard', __name__)\n", (214, 238), False, 'from flask import Blueprint, render_template\n'), ((309, 32... |
import pygame
import pygameMenu
import flatpakmanager_steamos
import pyflatpak
class gui():
def __init__(self, window_width, window_height, title):
self.window_width = window_width
self.window_height = window_height
self.title = title
self.framerate = 30
self.running = Fa... | [
"pygame.joystick.init",
"pygame.joystick.get_count",
"pygame.joystick.Joystick",
"pygame.event.get",
"pygame.display.set_mode",
"pygameMenu.Menu",
"pygame.init",
"pygame.display.update",
"pygame.font.Font",
"pygame.image.load",
"pygame.display.set_caption",
"pygame.time.Clock",
"pyflatpak.ma... | [((493, 512), 'pyflatpak.manager', 'pyflatpak.manager', ([], {}), '()\n', (510, 512), False, 'import pyflatpak\n'), ((578, 591), 'pygame.init', 'pygame.init', ([], {}), '()\n', (589, 591), False, 'import pygame\n'), ((614, 678), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(self.window_width, self.window_he... |
# -*- coding: utf-8 -*-
from karsender.database import get_collection
from karsender.services import validate_emails
__author__ = '<NAME> <<EMAIL>>'
from unittest import TestCase
class TestServices(TestCase):
def test_validate_emails(self):
validate_emails() | [
"karsender.services.validate_emails"
] | [((256, 273), 'karsender.services.validate_emails', 'validate_emails', ([], {}), '()\n', (271, 273), False, 'from karsender.services import validate_emails\n')] |
""" calculates certain quantities of interest using MESS+filesytem
"""
import os
import autofile
from mechanalyzer.inf import rxn as rinfo
from mechanalyzer.inf import spc as sinfo
from mechanalyzer.inf import thy as tinfo
from mechlib.amech_io import printer as ioprinter
from mechroutines.models import typ
from mechr... | [
"autofile.fs.scan",
"autofile.fs.high_spin",
"mechanalyzer.inf.thy.modify_orb_label",
"mechanalyzer.inf.spc.from_dct",
"mechlib.amech_io.printer.reading",
"mechroutines.models._vib.vib_analysis",
"os.path.exists",
"mechanalyzer.inf.rxn.ts_info",
"mechroutines.models.typ.is_atom",
"mechlib.amech_io... | [((1576, 1633), 'mechlib.amech_io.printer.info_message', 'ioprinter.info_message', (['"""- Calculating electronic energy"""'], {}), "('- Calculating electronic energy')\n", (1598, 1633), True, 'from mechlib.amech_io import printer as ioprinter\n'), ((2222, 2246), 'os.path.exists', 'os.path.exists', (['cnf_path'], {}), ... |
"""Tests for base classes."""
import datetime
import unittest
from unittest import mock
from unittest.mock import MagicMock
import requests
from georss_client import (
UPDATE_ERROR,
UPDATE_OK,
FeedEntry,
GeoRssDistanceHelper,
GeoRssFeed,
)
from georss_client.xml_parser.geometry import Point, Polyg... | [
"tests.MockGeoRssFeed",
"unittest.mock.MagicMock",
"georss_client.GeoRssDistanceHelper.distance_to_geometry",
"unittest.mock.PropertyMock",
"datetime.datetime",
"unittest.mock.patch",
"tests.utils.load_fixture",
"georss_client.GeoRssFeed",
"georss_client.xml_parser.geometry.Point",
"georss_client.... | [((514, 544), 'unittest.mock.patch', 'mock.patch', (['"""requests.Request"""'], {}), "('requests.Request')\n", (524, 544), False, 'from unittest import mock\n'), ((550, 580), 'unittest.mock.patch', 'mock.patch', (['"""requests.Session"""'], {}), "('requests.Session')\n", (560, 580), False, 'from unittest import mock\n'... |
from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
VERSION = "1.0.1"
setup(name='fast_rl',
version=VERSION,
description='Fastai for computer vision and tabular learning has been amazing. One would wish that this would '
'be t... | [
"setuptools.find_packages"
] | [((768, 783), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (781, 783), False, 'from setuptools import setup, find_packages\n')] |
import logging
from docserver.api import schemas
from docserver.config import config
from docserver.db import models as db_models
logger = logging.getLogger(__name__)
def delete_package(package: schemas.BasePackage, provided_permissions=None):
db = config.db.local_session()
packages = db_models.Package.rea... | [
"logging.getLogger",
"docserver.config.config.db.local_session"
] | [((142, 169), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (159, 169), False, 'import logging\n'), ((258, 283), 'docserver.config.config.db.local_session', 'config.db.local_session', ([], {}), '()\n', (281, 283), False, 'from docserver.config import config\n'), ((667, 692), 'docserver.c... |
from os import walk, remove
def get_all_files(directory):
""" Method for listing files within a directory
"""
f = []
for (_, _, filenames) in walk(directory):
f.extend(filenames)
return f
def remove_file(filename, directory):
""" Method for removing a file within a directory
"""
try:
remove(d... | [
"os.remove",
"os.walk"
] | [((151, 166), 'os.walk', 'walk', (['directory'], {}), '(directory)\n', (155, 166), False, 'from os import walk, remove\n'), ((312, 346), 'os.remove', 'remove', (["(directory + '/' + filename)"], {}), "(directory + '/' + filename)\n", (318, 346), False, 'from os import walk, remove\n')] |
import re
import argparse
from typing import Optional, List
from dataclasses import dataclass
from lark import Lark, Transformer, v_args
USAGE = "A command line calculator"
@dataclass
class Token:
name: str
value: str
calc_grammar = """
?start: sum
| NAME "=" sum -> assign_var
?sum: ... | [
"lark.v_args",
"argparse.ArgumentParser"
] | [((739, 758), 'lark.v_args', 'v_args', ([], {'inline': '(True)'}), '(inline=True)\n', (745, 758), False, 'from lark import Lark, Transformer, v_args\n'), ((1431, 1462), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""calc"""'], {}), "('calc')\n", (1454, 1462), False, 'import argparse\n')] |
from django.urls import path
from . import views
from .views import CustomLoginView, RegisterPage
from django.contrib.auth.views import LogoutView
urlpatterns = [
path('login/', CustomLoginView.as_view(),name='login'),
path('logout/', LogoutView.as_view(next_page='login'),name='logout'),
path('regi... | [
"django.contrib.auth.views.LogoutView.as_view",
"django.urls.path"
] | [((376, 426), 'django.urls.path', 'path', (['"""list/"""', 'views.list_todo_items'], {'name': '"""items"""'}), "('list/', views.list_todo_items, name='items')\n", (380, 426), False, 'from django.urls import path\n'), ((432, 501), 'django.urls.path', 'path', (['"""insert_todo/"""', 'views.insert_todo_item'], {'name': '"... |
import sklearn.tree
import os
import pandas as pd
import numpy as np
from hydroDL import kPath
from hydroDL.data import usgs, gageII
from hydroDL.post import axplot
import matplotlib.pyplot as plt
dirCQ = os.path.join(kPath.dirWQ, 'C-Q')
dfS = pd.read_csv(os.path.join(dirCQ, 'slope'), dtype={
'siteNo': str}).set_i... | [
"os.path.join",
"numpy.isnan",
"numpy.percentile",
"numpy.where",
"hydroDL.post.axplot.mapPoint",
"hydroDL.data.gageII.updateCode",
"hydroDL.data.gageII.readData",
"matplotlib.pyplot.subplots"
] | [((206, 238), 'os.path.join', 'os.path.join', (['kPath.dirWQ', '"""C-Q"""'], {}), "(kPath.dirWQ, 'C-Q')\n", (218, 238), False, 'import os\n'), ((682, 704), 'hydroDL.data.gageII.updateCode', 'gageII.updateCode', (['dfX'], {}), '(dfX)\n', (699, 704), False, 'from hydroDL.data import usgs, gageII\n'), ((713, 782), 'hydroD... |
import cv2
from gaze_tracking import GazeTracking
from imutils.video import VideoStream
import imutils
import argparse
import time
ap = argparse.ArgumentParser()
ap.add_argument("-v", "--video",
help="path to the (optional) video file")
args = vars(ap.parse_args())
gaze = GazeTracking()
# if a video path was not su... | [
"imutils.video.VideoStream",
"cv2.putText",
"argparse.ArgumentParser",
"cv2.imwrite",
"time.sleep",
"cv2.VideoCapture",
"time.time",
"gaze_tracking.GazeTracking",
"cv2.destroyAllWindows"
] | [((137, 162), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (160, 162), False, 'import argparse\n'), ((276, 290), 'gaze_tracking.GazeTracking', 'GazeTracking', ([], {}), '()\n', (288, 290), False, 'from gaze_tracking import GazeTracking\n'), ((565, 580), 'time.sleep', 'time.sleep', (['(2.0)'],... |
#!/usr/bin/env python3
import decimal
import mock
import wallycore as wally
import garecovery.two_of_three
from garecovery.clargs import DEFAULT_SUBACCOUNT_SEARCH_DEPTH
from gaservices.utils import txutil
from .util import AuthServiceProxy, datafile, get_output, parse_summary, raise_IOError
garecovery.bitcoin_confi... | [
"wallycore.tx_get_input_sequence",
"wallycore.tx_get_num_inputs",
"decimal.Decimal",
"mock.patch",
"gaservices.utils.txutil.from_hex",
"mock.Mock",
"wallycore.tx_get_locktime"
] | [((464, 530), 'mock.patch', 'mock.patch', (['"""garecovery.two_of_three.bitcoincore.AuthServiceProxy"""'], {}), "('garecovery.two_of_three.bitcoincore.AuthServiceProxy')\n", (474, 530), False, 'import mock\n'), ((1745, 1811), 'mock.patch', 'mock.patch', (['"""garecovery.two_of_three.bitcoincore.AuthServiceProxy"""'], {... |
import sys
import textwrap
from src.csvdiff2 import csvdiff
def test_show_difference(lhs, rhs, capfd):
lhs.write(textwrap.dedent('''
head1, head2, head3, head4, head5, head6
1, value1-2, key2-2, 1002, 20210921T035902, value4-2
1, value1-3, key2-3, 1003, 20210921T035904, value4-3
... | [
"textwrap.dedent",
"src.csvdiff2.csvdiff.main"
] | [((1204, 1218), 'src.csvdiff2.csvdiff.main', 'csvdiff.main', ([], {}), '()\n', (1216, 1218), False, 'from src.csvdiff2 import csvdiff\n'), ((3577, 3591), 'src.csvdiff2.csvdiff.main', 'csvdiff.main', ([], {}), '()\n', (3589, 3591), False, 'from src.csvdiff2 import csvdiff\n'), ((6225, 6239), 'src.csvdiff2.csvdiff.main',... |
from sklearn import svm
import numpy as np
X = np.array([[-1, -1], [-2, -1], [1, 1], [2, 1]])
y = np.array([1, 1, 2, 2])
model = svm.SVC(kernel='linear',C=1,gamma=1)
model.fit(X,y)
print(model.predict([[-0.8,-1]]))
| [
"numpy.array",
"sklearn.svm.SVC"
] | [((48, 94), 'numpy.array', 'np.array', (['[[-1, -1], [-2, -1], [1, 1], [2, 1]]'], {}), '([[-1, -1], [-2, -1], [1, 1], [2, 1]])\n', (56, 94), True, 'import numpy as np\n'), ((99, 121), 'numpy.array', 'np.array', (['[1, 1, 2, 2]'], {}), '([1, 1, 2, 2])\n', (107, 121), True, 'import numpy as np\n'), ((132, 170), 'sklearn.... |
from types import SimpleNamespace
class Page:
def __init__(self):
self.root = None
self.ui = SimpleNamespace() | [
"types.SimpleNamespace"
] | [((115, 132), 'types.SimpleNamespace', 'SimpleNamespace', ([], {}), '()\n', (130, 132), False, 'from types import SimpleNamespace\n')] |
'''
Faster brute-force adapter matcher
'''
import time
VERBOSE = False
BASES = ('A', 'C', 'G', 'T')
def addNewAdapterToSet(ad, adSet):
adSet.add(ad)
if VERBOSE:
print(f'Adding {ad}')
time.sleep(.1)
return adSet
def makeAdapters(adapter):
adapters = set()
adapters.add(adapter[:-8]... | [
"time.sleep"
] | [((210, 225), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (220, 225), False, 'import time\n')] |
"""
The purpose of this file is to install autograd and its dependencies and to
provide utility functions that are used when it is used in conjunction with
Qubiter.
When using autograd, one declares np to be the alias to module
numpy.autograd. If another file later declares np to be alias to numpy,
all sorts of error... | [
"autograd.numpy.sqrt",
"autograd.numpy.dot",
"autograd.numpy.cos",
"autograd.numpy.vstack",
"autograd.numpy.array",
"autograd.numpy.exp",
"autograd.numpy.zeros",
"autograd.numpy.reshape",
"autograd.numpy.eye",
"autograd.numpy.sin",
"autograd.jacobian"
] | [((1374, 1400), 'autograd.numpy.array', 'np.array', (['[[0, 1], [1, 0]]'], {}), '([[0, 1], [1, 0]])\n', (1382, 1400), True, 'import autograd.numpy as np\n'), ((1412, 1445), 'autograd.numpy.array', 'np.array', (['[[0, -1.0j], [1.0j, 0]]'], {}), '([[0, -1.0j], [1.0j, 0]])\n', (1420, 1445), True, 'import autograd.numpy as... |
#################################
# CSI function
#################################
#########################################################
# import libraries
import scipy.spatial.distance as ssd
import numpy as np
import scipy.io as sio
#########################################################
# Function... | [
"scipy.spatial.distance.euclidean",
"scipy.io.loadmat",
"numpy.asarray",
"numpy.zeros",
"scipy.io.savemat",
"numpy.ones",
"numpy.squeeze"
] | [((4331, 4353), 'numpy.asarray', 'np.asarray', (['dist_S_uav'], {}), '(dist_S_uav)\n', (4341, 4353), True, 'import numpy as np\n'), ((4470, 4492), 'numpy.asarray', 'np.asarray', (['dist_uav_F'], {}), '(dist_uav_F)\n', (4480, 4492), True, 'import numpy as np\n'), ((4614, 4637), 'numpy.asarray', 'np.asarray', (['dist_GT_... |
# Copyright 2021 <NAME>, BYU CCL
# please see the BYU CCl SpyDrNet license file for terms of usage.
from spydrnet.parsers.verilog.tokenizer import VerilogTokenizer
import spydrnet.parsers.verilog.verilog_tokens as vt
from spydrnet.ir import Netlist, Library, Definition, Port, Cable, Instance, OuterPin
from spydrnet.p... | [
"spydrnet.Instance",
"spydrnet.parsers.verilog.verilog_tokens.is_numeric",
"spydrnet.Definition",
"spydrnet.parsers.verilog.tokenizer.VerilogTokenizer",
"spydrnet.Netlist",
"spydrnet.parsers.verilog.verilog_tokens.string_to_port_direction",
"spydrnet.parsers.verilog.verilog_tokens.is_valid_identifier"
] | [((4072, 4103), 'spydrnet.parsers.verilog.tokenizer.VerilogTokenizer', 'VerilogTokenizer', (['self.filename'], {}), '(self.filename)\n', (4088, 4103), False, 'from spydrnet.parsers.verilog.tokenizer import VerilogTokenizer\n'), ((6412, 6425), 'spydrnet.Netlist', 'sdn.Netlist', ([], {}), '()\n', (6423, 6425), True, 'imp... |
#!/usr/bin/python3
import os
from brownie import VRFConsumer, accounts, config
STATIC_SEED = 123
def main():
dev = accounts.add(os.getenv(config['wallets']['from_key']))
# Get the most recent PriceFeed Object
vrf_contract = VRFConsumer[len(VRFConsumer) - 1]
vrf_contract.getRandomNumber(STATIC_SEED, {... | [
"os.getenv"
] | [((135, 175), 'os.getenv', 'os.getenv', (["config['wallets']['from_key']"], {}), "(config['wallets']['from_key'])\n", (144, 175), False, 'import os\n')] |
"""
Controller Class
-----------------
This class contains the controller logic for the application. This takes
input from the table and other interface objects and then manages change of
state for the database. It will also pass the state changes to the table
objects.
"""
__author__ = 'krishnab'
__version__ = '0.1.... | [
"pydhs.Database.DatabaseSqlalchemy",
"pydhs.Database.DatabasePsycopg2"
] | [((695, 762), 'pydhs.Database.DatabasePsycopg2', 'DatabasePsycopg2', (['dbname', '"""krishnab"""', '"""3kl4vx71"""', '"""localhost"""', '(5433)'], {}), "(dbname, 'krishnab', '3kl4vx71', 'localhost', 5433)\n", (711, 762), False, 'from pydhs.Database import DatabasePsycopg2\n'), ((935, 1004), 'pydhs.Database.DatabaseSqla... |
#!/usr/bin/python
# Copyright (C) <NAME> 2003. Permission to copy, use, modify, sell and
# distribute this software is granted provided this copyright notice appears in
# all copies. This software is provided "as is" without express or implied
# warranty, and with no claim as to its suitability for any purpose.
... | [
"BoostBuild.Tester"
] | [((499, 507), 'BoostBuild.Tester', 'Tester', ([], {}), '()\n', (505, 507), False, 'from BoostBuild import Tester, List\n')] |
#
# Copyright 2021 Red Hat Inc.
# SPDX-License-Identifier: Apache-2.0
#
from itertools import chain
from itertools import combinations
from unittest.mock import Mock
from django.test import TestCase
from api.common.permissions.openshift_all_access import OpenshiftAllAccessPermission
from api.iam.models import User
fr... | [
"itertools.combinations",
"unittest.mock.Mock",
"api.common.permissions.openshift_all_access.OpenshiftAllAccessPermission"
] | [((814, 844), 'api.common.permissions.openshift_all_access.OpenshiftAllAccessPermission', 'OpenshiftAllAccessPermission', ([], {}), '()\n', (842, 844), False, 'from api.common.permissions.openshift_all_access import OpenshiftAllAccessPermission\n'), ((915, 933), 'itertools.combinations', 'combinations', (['s', 'r'], {}... |
# Machine Learning/Data Science Precourse Work
# ###
# LAMBDA SCHOOL
# ###
# MIT LICENSE
# ###
# Free example function definition
# This function passes one of the 11 tests contained inside of test.py. Write the rest, defined in README.md, here,
# and execute python test.py to test. Passing this precourse work will g... | [
"numpy.dot",
"numpy.array",
"math.sqrt"
] | [((968, 987), 'math.sqrt', 'math.sqrt', (['sqvector'], {}), '(sqvector)\n', (977, 987), False, 'import math\n'), ((1013, 1038), 'numpy.array', 'np.array', (['[1, 1, 1, 1, 1]'], {}), '([1, 1, 1, 1, 1])\n', (1021, 1038), True, 'import numpy as np\n'), ((1064, 1083), 'numpy.array', 'np.array', (['[0, 0, 0]'], {}), '([0, 0... |
import tweepy
import pandas as pd
import re
import json
import os
import datetime
import stripe
import time
from fastapi import FastAPI, Request, BackgroundTasks, Response, Cookie
from fastapi.templating import Jinja2Templates
from fastapi.staticfiles import StaticFiles
from fastapi.responses import RedirectResponse
fr... | [
"pandas.DataFrame",
"tweepy.Paginator",
"json.load",
"stripe.checkout.Session.create",
"fastapi.Cookie",
"tweepy.Client",
"fastapi.templating.Jinja2Templates",
"re.findall",
"uvicorn.run",
"datetime.datetime.date",
"pandas.read_sql_query",
"sqlalchemy.create_engine",
"fastapi.responses.Redir... | [((3701, 3748), 'sqlalchemy.create_engine', 'create_engine', (["os.environ['DB_URL']"], {'echo': '(False)'}), "(os.environ['DB_URL'], echo=False)\n", (3714, 3748), False, 'from sqlalchemy import create_engine\n'), ((3756, 3765), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (3763, 3765), False, 'from fastapi import F... |
# August 21st 2018
# Author: <NAME>
# University of Guelph Masters Graduate
# This module is an OpenSim tool created for Static optimization and Computed Muscle Control data to achieve Joint Reaction forces and loads in model
def run(setup,resultsDirectory):
import os
import re
import shutil
i... | [
"opensim.AnalyzeTool",
"directories.main",
"os.system",
"opensim.Model"
] | [((1171, 1220), 'opensim.Model', 'osim.Model', (["(subResultsDir + '/' + subID + '.osim')"], {}), "(subResultsDir + '/' + subID + '.osim')\n", (1181, 1220), True, 'import opensim as osim\n'), ((1693, 1716), 'opensim.AnalyzeTool', 'osim.AnalyzeTool', (['setup'], {}), '(setup)\n', (1709, 1716), True, 'import opensim as o... |
from pathlib import Path
from alembic.command import upgrade
from alembic.config import Config
def make_config(dir_: Path, url_: str, config_='alembic.ini'):
"""
:param dir_: migrations script directory
:param url_: sqlalchemy database url
:param config_: config
:return:
"""
# retrieves c... | [
"alembic.config.Config",
"alembic.command.upgrade",
"pathlib.Path"
] | [((383, 408), 'alembic.config.Config', 'Config', ([], {'file_': 'config_file'}), '(file_=config_file)\n', (389, 408), False, 'from alembic.config import Config\n'), ((735, 758), 'alembic.command.upgrade', 'upgrade', (['config', '"""head"""'], {}), "(config, 'head')\n", (742, 758), False, 'from alembic.command import up... |
import json
import os
from freezegun import freeze_time
import pytest
import responses
import time
from nightfall.api import Nightfall, NightfallUserError
from nightfall.detection_rules import DetectionRule, Detector, LogicalOp, Confidence, ExclusionRule, ContextRule, \
WordList, MatchType, RedactionConfig, MaskC... | [
"nightfall.api.Nightfall",
"json.loads",
"responses.add",
"nightfall.detection_rules.RedactionConfig",
"nightfall.findings.Range",
"nightfall.detection_rules.Detector",
"nightfall.detection_rules.MaskConfig",
"pytest.raises",
"nightfall.detection_rules.WordList",
"freezegun.freeze_time",
"nightf... | [((24054, 24089), 'freezegun.freeze_time', 'freeze_time', (['"""2021-10-04T17:30:50Z"""'], {}), "('2021-10-04T17:30:50Z')\n", (24065, 24089), False, 'from freezegun import freeze_time\n'), ((24405, 24440), 'freezegun.freeze_time', 'freeze_time', (['"""2021-10-04T19:30:50Z"""'], {}), "('2021-10-04T19:30:50Z')\n", (24416... |
import datetime
import os
import wget
from parameters.GraphData import GraphData
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
def get_germany_mobility(graph_en: str):
out = 'Germany/mobility_counties_2019_baseline.csv'
url = 'https://files.de-1.osf.io/v1/resources/n53cz/provid... | [
"os.remove",
"os.walk",
"os.path.exists",
"datetime.date.today",
"wget.download",
"parameters.GraphData.GraphData"
] | [((1307, 1341), 'parameters.GraphData.GraphData', 'GraphData', (['data'], {'graph_en': 'graph_en'}), '(data, graph_en=graph_en)\n', (1316, 1341), False, 'from parameters.GraphData import GraphData\n'), ((1400, 1415), 'os.walk', 'os.walk', (['"""log/"""'], {}), "('log/')\n", (1407, 1415), False, 'import os\n'), ((525, 5... |
import json
from typing import Dict, List
from etk.knowledge_graph.schema import KGSchema
from etk.knowledge_graph.graph import Graph
from etk.knowledge_graph.subject import Subject
from etk.knowledge_graph.node import URI, Literal
from etk.utilities import deprecated
class KnowledgeGraph(Graph):
"""
This cla... | [
"etk.knowledge_graph.node.URI",
"json.dumps",
"etk.utilities.deprecated"
] | [((648, 660), 'etk.utilities.deprecated', 'deprecated', ([], {}), '()\n', (658, 660), False, 'from etk.utilities import deprecated\n'), ((2851, 2863), 'etk.utilities.deprecated', 'deprecated', ([], {}), '()\n', (2861, 2863), False, 'from etk.utilities import deprecated\n'), ((3935, 3950), 'etk.knowledge_graph.node.URI'... |
# -----------------------------------------------------------------------------
# Libraries
# -----------------------------------------------------------------------------
# Core libs
from typing import TYPE_CHECKING
# Third party libs
from django.db import models
# Project libs
# If type checking, __all__
if TYPE_C... | [
"django.db.models.ForeignKey",
"django.db.models.CharField",
"django.db.models.AutoField"
] | [((916, 950), 'django.db.models.AutoField', 'models.AutoField', ([], {'primary_key': '(True)'}), '(primary_key=True)\n', (932, 950), False, 'from django.db import models\n'), ((964, 1023), 'django.db.models.ForeignKey', 'models.ForeignKey', (['"""users.Client"""'], {'on_delete': 'models.CASCADE'}), "('users.Client', on... |
"""
Collect Host's basic metric
Thanks to Feng_Qi a lot of code in this file was borrow from him.
"""
import psutil
import time
import json
import copy
import logging
from rpc.transfer import send_data_to_transfer
from utils import g
def collect():
logging.debug('enter basic collect')
push_inte... | [
"psutil.virtual_memory",
"psutil.disk_partitions",
"logging.debug",
"logging.error",
"psutil.swap_memory",
"psutil.net_io_counters",
"psutil.cpu_times_percent",
"copy.copy",
"time.time",
"psutil.disk_usage",
"rpc.transfer.send_data_to_transfer",
"logging.info",
"psutil.disk_io_counters",
"... | [((269, 305), 'logging.debug', 'logging.debug', (['"""enter basic collect"""'], {}), "('enter basic collect')\n", (282, 305), False, 'import logging\n'), ((580, 606), 'psutil.cpu_times_percent', 'psutil.cpu_times_percent', ([], {}), '()\n', (604, 606), False, 'import psutil\n'), ((625, 648), 'psutil.virtual_memory', 'p... |
import lafs
import random
import math
# Returns an Identity Matrix of dimensions (n, n_col)
def I(n, n_col = None):
if type(n) == lafs.matrix.Matrix:
n_col = n.dim(1)
n = n.dim(0)
elif n_col == None:
n_col = n
ret = lafs.matrix.Matrix(n, n_col)
for i in range(min(n, n_col)):
... | [
"random.randint",
"math.sin",
"lafs.vector.Vec",
"math.cos",
"lafs.matrix.Matrix"
] | [((253, 281), 'lafs.matrix.Matrix', 'lafs.matrix.Matrix', (['n', 'n_col'], {}), '(n, n_col)\n', (271, 281), False, 'import lafs\n'), ((624, 652), 'lafs.matrix.Matrix', 'lafs.matrix.Matrix', (['n', 'n_col'], {}), '(n, n_col)\n', (642, 652), False, 'import lafs\n'), ((960, 988), 'lafs.matrix.Matrix', 'lafs.matrix.Matrix'... |
import h5py
import tools.pymus_utils as pymusutil
import numpy as np
import matplotlib.pyplot as plt
import logging
logging.basicConfig(level=logging.DEBUG)
class ImageFormatError(Exception):
pass
class EchoImage(object):
''' Echogeneicity grayscale image
'''
def __init__(self,scan):
self.scan = scan
self.d... | [
"logging.error",
"tools.pymus_utils.generic_hdf5_read",
"matplotlib.pyplot.show",
"logging.basicConfig",
"logging.debug",
"numpy.reshape",
"numpy.log10",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig",
"tools.pymus_utils.generic_hdf5_write"
] | [((117, 157), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (136, 157), False, 'import logging\n'), ((1185, 1247), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(1.0 + x_ratio * base_sz, 0.3 + base_sz)'}), '(figsize=(1.0 + x_ratio * base_sz,... |
'''
Created on 11.12.2018
@author: mirandaa
'''
import unittest
import pytest
from mztab_m_swagger_client.api_client import ApiClient
import json
from collections import namedtuple
from pprint import pprint
from mztab_m_io import mztab_parser
from pathlib import Path, PurePath
class MzTabParseTestCase(unittest.TestC... | [
"pathlib.Path",
"mztab_m_swagger_client.api_client.ApiClient",
"pathlib.PurePath",
"collections.namedtuple"
] | [((490, 546), 'pathlib.PurePath', 'PurePath', (['self.datapath', '"""lipidomics-example.mzTab.json"""'], {}), "(self.datapath, 'lipidomics-example.mzTab.json')\n", (498, 546), False, 'from pathlib import Path, PurePath\n'), ((664, 694), 'collections.namedtuple', 'namedtuple', (['"""Response"""', '"""data"""'], {}), "('... |
from django.utils import timezone
from django import forms
from clothing.models import ClothingItem, WornEvent
from users.models import User
class ItemCreationForm(forms.ModelForm):
name = forms.CharField(label='Item Name')
owner = forms.ModelChoiceField(widget=forms.HiddenInput(), queryset=User.objects.all())... | [
"django.forms.IntegerField",
"django.forms.HiddenInput",
"django.forms.CharField",
"clothing.models.ClothingItem.objects.all",
"users.models.User.objects.all"
] | [((194, 228), 'django.forms.CharField', 'forms.CharField', ([], {'label': '"""Item Name"""'}), "(label='Item Name')\n", (209, 228), False, 'from django import forms\n'), ((671, 688), 'django.forms.CharField', 'forms.CharField', ([], {}), '()\n', (686, 688), False, 'from django import forms\n'), ((753, 786), 'django.for... |
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 24 11:53:24 2021
@author: Ashoo
"""
from password_generator import generate_simple_password
def test_generate_simple_password():
assert generate_simple_password()=='abcd' | [
"password_generator.generate_simple_password"
] | [((190, 216), 'password_generator.generate_simple_password', 'generate_simple_password', ([], {}), '()\n', (214, 216), False, 'from password_generator import generate_simple_password\n')] |
from collections import MutableMapping
from os.path import expanduser, join
from glob import glob
from drivelink import Link
from drivelink.hash import hash
class _page(dict):
currentDepth = 0
class Dict(Link, MutableMapping):
"""
A dictionary class that maintains O(1) look up and write while keeping R... | [
"drivelink.hash.hash",
"os.path.expanduser",
"glob.glob"
] | [((2161, 2188), 'glob.glob', 'glob', (["(self._file_base + '*')"], {}), "(self._file_base + '*')\n", (2165, 2188), False, 'from glob import glob\n'), ((1649, 1664), 'os.path.expanduser', 'expanduser', (['"""~"""'], {}), "('~')\n", (1659, 1664), False, 'from os.path import expanduser, join\n'), ((3259, 3268), 'drivelink... |
import os
from flask_script import Manager
from blog import app
from blog.database import session, Entry
manager = Manager(app)
@manager.command
def run():
port = int(os.environ.get('PORT', 8080))
app.run(host='0.0.0.0', port=port)
@manager.command
def seed():
content = """TEST TEST TEST, these entries ... | [
"flask_script.Manager",
"blog.app.run",
"getpass.getpass",
"blog.database.session.query",
"os.environ.get",
"blog.database.session.add",
"blog.database.session.commit",
"werkzeug.security.generate_password_hash"
] | [((117, 129), 'flask_script.Manager', 'Manager', (['app'], {}), '(app)\n', (124, 129), False, 'from flask_script import Manager\n'), ((208, 242), 'blog.app.run', 'app.run', ([], {'host': '"""0.0.0.0"""', 'port': 'port'}), "(host='0.0.0.0', port=port)\n", (215, 242), False, 'from blog import app\n'), ((561, 577), 'blog.... |
#!/usr/bin/python3
# Copyright 2019 Adobe. All rights reserved.
# This file is licensed to you 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 requir... | [
"tld.get_fld",
"datetime.datetime.now",
"logging.getLogger"
] | [((1674, 1701), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1691, 1701), False, 'import logging\n'), ((6059, 6112), 'tld.get_fld', 'get_fld', (['value'], {'fix_protocol': '(True)', 'fail_silently': '(True)'}), '(value, fix_protocol=True, fail_silently=True)\n', (6066, 6112), False, 'f... |
'''
Function:
身份证信息查询小工具
Author:
Charles
微信公众号:
Charles的皮卡丘
'''
import sys
from PyQt5 import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5 import QtWidgets, QtGui
from id_validator import validator
'''身份证信息查询小工具'''
class IDCardQuery(QWidget):
def __ini... | [
"id_validator.validator.is_valid",
"id_validator.validator.fake_id",
"id_validator.validator.get_info"
] | [((2281, 2304), 'id_validator.validator.is_valid', 'validator.is_valid', (['id_'], {}), '(id_)\n', (2299, 2304), False, 'from id_validator import validator\n'), ((2470, 2493), 'id_validator.validator.get_info', 'validator.get_info', (['id_'], {}), '(id_)\n', (2488, 2493), False, 'from id_validator import validator\n'),... |
#!/usr/bin/env python3
# perfectgift: a tornado webapp for creating wish lists between friends
# Copyright (C) 2014, NCSS14 Group 4
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without re... | [
"tornado.ncss.Server",
"epyc._render",
"db.api.Product.search",
"db.api.User.search",
"login.get_current_user",
"db.api.User.find",
"epyc.render"
] | [((1439, 1465), 'login.get_current_user', 'get_current_user', (['response'], {}), '(response)\n', (1455, 1465), False, 'from login import logged_in, get_current_user\n'), ((1482, 1509), 'db.api.User.find', 'User.find', (['current_username'], {}), '(current_username)\n', (1491, 1509), False, 'from db.api import User, Pr... |
# -*- coding:utf-8 -*-
# pylint: disable=C0103, C0111, W0621
"""Implementation of MGCN model"""
import torch
import torch.nn as nn
from .layers import AtomEmbedding, RBFLayer, EdgeEmbedding, \
MultiLevelInteraction
from ...nn.pytorch import SumPooling
class MGCNModel(nn.Module):
"""
`Molecular Property ... | [
"torch.nn.Softplus",
"torch.cat",
"torch.tensor",
"torch.nn.Linear"
] | [((3138, 3171), 'torch.tensor', 'torch.tensor', (['mean'], {'device': 'device'}), '(mean, device=device)\n', (3150, 3171), False, 'import torch\n'), ((3200, 3232), 'torch.tensor', 'torch.tensor', (['std'], {'device': 'device'}), '(std, device=device)\n', (3212, 3232), False, 'import torch\n'), ((4259, 4288), 'torch.cat... |
# Generated by Django 3.2.6 on 2021-08-25 17:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('course', '0004_coursesmodel_thumbnail'),
]
operations = [
migrations.AddField(
model_name='coursesmodel',
name='slug... | [
"django.db.models.SlugField"
] | [((341, 369), 'django.db.models.SlugField', 'models.SlugField', ([], {'default': '""""""'}), "(default='')\n", (357, 369), False, 'from django.db import migrations, models\n')] |
from functools import partial
import numpy as np
import tensorflow as tf
from tensorflow.keras.callbacks import EarlyStopping, TensorBoard
from tensorflow.keras.optimizers import Adam
from nets.facenet import facenet
from nets.facenet_training import FacenetDataset, LFWDataset, triplet_loss
from utils.callbacks impor... | [
"utils.callbacks.LFW_callback",
"functools.partial",
"numpy.random.seed",
"numpy.random.shuffle",
"nets.facenet_training.triplet_loss",
"tensorflow.config.experimental.set_memory_growth",
"tensorflow.keras.optimizers.schedules.ExponentialDecay",
"nets.facenet_training.LFWDataset",
"nets.facenet.face... | [((897, 960), 'tensorflow.config.experimental.list_physical_devices', 'tf.config.experimental.list_physical_devices', ([], {'device_type': '"""GPU"""'}), "(device_type='GPU')\n", (941, 960), True, 'import tensorflow as tf\n'), ((982, 1033), 'tensorflow.config.experimental.set_memory_growth', 'tf.config.experimental.set... |
import urllib.request as req
import pyodbc
import requests
from bs4 import BeautifulSoup as bs
import time
import random
import json
def sqlquote( value ):
"""Naive SQL quoting
All values except NULL are returned as SQL strings in single quotes,
with any embedded quotes doubled.
"""
if value is No... | [
"json.loads",
"requests.get",
"random.uniform"
] | [((795, 811), 'json.loads', 'json.loads', (['html'], {}), '(html)\n', (805, 811), False, 'import json\n'), ((699, 733), 'requests.get', 'requests.get', (['url'], {'headers': 'headers'}), '(url, headers=headers)\n', (711, 733), False, 'import requests\n'), ((756, 776), 'random.uniform', 'random.uniform', (['(1)', '(4)']... |
# -*- coding: UTF-8 -*-
# Copyright 2017-2020 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""General demo data for Lino Avanti.
- Course providers and courses
"""
# from django.conf import settings
# from lino.utils import mti
from lino.utils import Cycler # join_words
from lino.utils.mldbc import ... | [
"lino.api.dd.plugins.courses.pupil_model.objects.all",
"lino_xl.lib.courses.choicelists.EnrolmentStates.objects",
"lino.api.rt.login",
"lino.api.dd.demo_date",
"lino.api._",
"lino.utils.mldbc.babel_named",
"lino.api.dd.plugins.courses.pupil_model.objects.order_by"
] | [((561, 573), 'lino.api._', '_', (['"""Dispens"""'], {}), "('Dispens')\n", (562, 573), False, 'from lino.api import rt, dd, _\n'), ((579, 598), 'lino.api._', '_', (['"""Eingeschrieben"""'], {}), "('Eingeschrieben')\n", (580, 598), False, 'from lino.api import rt, dd, _\n'), ((604, 622), 'lino.api._', '_', (['"""Abgesch... |
import argparse
import json
from tqdm import tqdm
def align_ws(old_token, new_token):
# Align trailing whitespaces between tokens
if old_token[-1] == new_token[-1] == " ":
return new_token
elif old_token[-1] == " ":
return new_token + " "
elif new_token[-1] == " ":
return new_t... | [
"argparse.ArgumentParser",
"json.loads"
] | [((2331, 2356), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2354, 2356), False, 'import argparse\n'), ((2865, 2881), 'json.loads', 'json.loads', (['line'], {}), '(line)\n', (2875, 2881), False, 'import json\n'), ((2671, 2687), 'json.loads', 'json.loads', (['line'], {}), '(line)\n', (2681, 2... |