code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import time
from unittest import TestCase
from fsmodels.models import Field, ValidationError
def generic_validator(x):
return x == 1, {'detail': 'x must be 1.'}
class TestField(TestCase):
def test___init__(self):
# no required fields
f = Field()
with self.assertRaises((Validation... | [
"fsmodels.models.Field",
"time.time"
] | [((269, 276), 'fsmodels.models.Field', 'Field', ([], {}), '()\n', (274, 276), False, 'from fsmodels.models import Field, ValidationError\n'), ((500, 535), 'fsmodels.models.Field', 'Field', ([], {'validation': 'generic_validator'}), '(validation=generic_validator)\n', (505, 535), False, 'from fsmodels.models import Fiel... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
"model_utils.moxing_adapter.moxing_wrapper",
"model_utils.device_adapter.get_device_id",
"numpy.ones",
"mindspore.export",
"mindspore.context.set_context",
"os.path.join",
"src.utils.init_net",
"os.path.basename"
] | [((1048, 1133), 'mindspore.context.set_context', 'context.set_context', ([], {'mode': 'context.GRAPH_MODE', 'device_target': 'config.device_target'}), '(mode=context.GRAPH_MODE, device_target=config.device_target\n )\n', (1067, 1133), False, 'from mindspore import Tensor, export, context\n'), ((1240, 1256), 'model_u... |
# coding=UTF-8
# ex:ts=4:sw=4:et=on
# Copyright (c) 2013, <NAME>
# All rights reserved.
# Complete license can be found in the LICENSE file.
from math import pi, log
import numpy as np
from mvc.observers import ListObserver
from mvc.models.properties import (
StringProperty, SignalMixin, ReadOnlyMixin, FloatPro... | [
"numpy.radians",
"mvc.models.properties.BoolProperty",
"pyxrd.generic.utils.not_none",
"numpy.asanyarray",
"math.log",
"numpy.array",
"mvc.models.properties.StringProperty",
"pyxrd.calculations.peak_detection.peakdetect",
"mvc.observers.ListObserver",
"numpy.max",
"mvc.models.properties.LabeledP... | [((982, 1002), 'pyxrd.generic.io.storables.register', 'storables.register', ([], {}), '()\n', (1000, 1002), False, 'from pyxrd.generic.io import storables, Storable\n'), ((2025, 2171), 'mvc.models.properties.StringProperty', 'StringProperty', ([], {'default': '""""""', 'text': '"""Sample"""', 'visible': '(True)', 'pers... |
import krpc
import time
conn = krpc.connect(name="UI Test")
vessel = conn.space_center.active_vessel
kerbin_frame = vessel.orbit.body.reference_frame
orb_frame = vessel.orbital_reference_frame
srf_frame = vessel.surface_reference_frame
surface_gravity = vessel.orbit.body.surface_gravity
current_roll = conn.add_stre... | [
"krpc.connect",
"time.sleep"
] | [((34, 62), 'krpc.connect', 'krpc.connect', ([], {'name': '"""UI Test"""'}), "(name='UI Test')\n", (46, 62), False, 'import krpc\n'), ((1865, 1880), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (1875, 1880), False, 'import time\n'), ((2015, 2028), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (2025, 20... |
import codecs
import logging
import json
from concurrent.futures import ThreadPoolExecutor, as_completed
from pathlib import Path
from . import exceptions, config
from .storages import StorageMapper, EnvFile, partition_path
logger = logging.getLogger(__name__)
__escape_decoder = codecs.getdecoder('unicode_escape')
... | [
"logging.getLogger",
"pathlib.Path",
"concurrent.futures.ThreadPoolExecutor",
"concurrent.futures.as_completed",
"codecs.getdecoder"
] | [((235, 262), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (252, 262), False, 'import logging\n'), ((282, 317), 'codecs.getdecoder', 'codecs.getdecoder', (['"""unicode_escape"""'], {}), "('unicode_escape')\n", (299, 317), False, 'import codecs\n'), ((834, 844), 'pathlib.Path', 'Path', (... |
#!/usr/bin/env python3.8
# coding=UTF-8
'''
created by <NAME>
'''
import json
import urllib.request
import re
def request(action, **params):
return {'action': action, 'params': params, 'version': 6}
def invoke(action, **params):
requestJson = json.dumps(request(action, **params)).encode('utf-8')
respons... | [
"re.sub",
"re.split"
] | [((5119, 5140), 're.split', 're.split', (['""" +"""', 'words'], {}), "(' +', words)\n", (5127, 5140), False, 'import re\n'), ((4054, 4122), 're.sub', 're.sub', (["('\\\\b' + word + '\\\\b')", "('{{c1::' + word + '}}')", 'front_sentence'], {}), "('\\\\b' + word + '\\\\b', '{{c1::' + word + '}}', front_sentence)\n", (406... |
import requests
from time import sleep
from bs4 import BeautifulSoup as bs
def check(URL):
page = requests.get(URL)
soup = bs(page.content, "html.parser")
results = soup.find(id="pnlInventory")
stock = results.find_all("span", class_="inventoryCnt")
check = ""
for job_elem in stock:
... | [
"bs4.BeautifulSoup",
"requests.get"
] | [((104, 121), 'requests.get', 'requests.get', (['URL'], {}), '(URL)\n', (116, 121), False, 'import requests\n'), ((134, 165), 'bs4.BeautifulSoup', 'bs', (['page.content', '"""html.parser"""'], {}), "(page.content, 'html.parser')\n", (136, 165), True, 'from bs4 import BeautifulSoup as bs\n')] |
import pyaudio
import math, random
import numpy as np
import find_peaks as fp
from search_tree import SearchTree
from pydub import AudioSegment
import time
END = 10000 #Sample for 10 seconds
THRESH = 0.6
def match(audio_name, mv_name):
audio_file = AudioSegment.from_file(audio_name)[5000:(END + 5000)]
mv_f... | [
"random.shuffle",
"math.sqrt",
"search_tree.SearchTree",
"pydub.AudioSegment.from_file",
"numpy.frombuffer",
"time.time",
"find_peaks.get_sparse_map"
] | [((326, 357), 'pydub.AudioSegment.from_file', 'AudioSegment.from_file', (['mv_name'], {}), '(mv_name)\n', (348, 357), False, 'from pydub import AudioSegment\n'), ((374, 415), 'numpy.frombuffer', 'np.frombuffer', (['audio_file._data', 'np.int16'], {}), '(audio_file._data, np.int16)\n', (387, 415), True, 'import numpy as... |
import asyncio
from homeauto.api_vivint.pyvivintsky.vivint_device import VivintDevice
from homeauto.api_vivint.pyvivintsky.vivint_api import VivintAPI
from homeauto.api_vivint.pyvivintsky.vivint_wireless_sensor import VivintWirelessSensor
from homeauto.api_vivint.pyvivintsky.vivint_door_lock import VivintDoorLock
from ... | [
"logging.getLogger",
"homeauto.house.register_security_event"
] | [((535, 562), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (552, 562), False, 'import logging\n'), ((2923, 3030), 'homeauto.house.register_security_event', 'register_security_event', (["message[u'da'][u'seca'][u'n']", "self.ARM_STATES[message[u'da'][u'seca'][u's']]"], {}), "(message[u'd... |
import torch
from finetuning import TweetBatch, weights
from tqdm import tqdm, trange
import os
import numpy as np
from sklearn.metrics import mean_squared_error
import argparse
import pdb
from transformers import BertForSequenceClassification
def evaluate(args, model, eval_dataloader, wi, device, prefix="")... | [
"torch.cuda.device_count",
"torch.cuda.is_available",
"finetuning.TweetBatch",
"os.path.exists",
"argparse.ArgumentParser",
"finetuning.weights",
"numpy.squeeze",
"sklearn.metrics.mean_squared_error",
"transformers.BertForSequenceClassification.from_pretrained",
"torch.device",
"torch.cuda.get_d... | [((2919, 3059), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Test Bert finetuned for a regression task, to predict the tweet counts from the embbedings."""'}), "(description=\n 'Test Bert finetuned for a regression task, to predict the tweet counts from the embbedings.'\n )\n", (... |
from matplotlib import patches
from matplotlib import transforms
class RotatingRectangle(patches.Rectangle):
def __init__(self, xy, width: int, height: int, rel_point_of_rot=None, **kwargs):
super().__init__(xy, width, height, **kwargs)
self.rel_point_of_rot = (
0, 0) if rel_point_of_ro... | [
"matplotlib.transforms.BboxTransformTo",
"matplotlib.transforms.Affine2D"
] | [((740, 772), 'matplotlib.transforms.BboxTransformTo', 'transforms.BboxTransformTo', (['bbox'], {}), '(bbox)\n', (766, 772), False, 'from matplotlib import transforms\n'), ((791, 812), 'matplotlib.transforms.Affine2D', 'transforms.Affine2D', ([], {}), '()\n', (810, 812), False, 'from matplotlib import transforms\n')] |
from sunrisePy import sunrisePy
import time
import numpy as np
ip='172.31.1.148'
# ip='localhost'
iiwa=sunrisePy(ip)
iiwa.setBlueOn()
time.sleep(2)
iiwa.setBlueOff()
try:
while True:
print(iiwa.getJointsMeasuredTorques())
time.sleep(0.2)
except KeyboardInterrupt:
iiwa.close()
print('an error ... | [
"time.sleep",
"sunrisePy.sunrisePy"
] | [((103, 116), 'sunrisePy.sunrisePy', 'sunrisePy', (['ip'], {}), '(ip)\n', (112, 116), False, 'from sunrisePy import sunrisePy\n'), ((134, 147), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (144, 147), False, 'import time\n'), ((241, 256), 'time.sleep', 'time.sleep', (['(0.2)'], {}), '(0.2)\n', (251, 256), False,... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui/taskFrame.ui'
#
# Created by: PyQt5 UI code generator 5.14.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_taskFrame(object):
def setupUi(self, taskFrame):
tas... | [
"PyQt5.QtCore.QMetaObject.connectSlotsByName",
"PyQt5.QtWidgets.QFrame",
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QApplication",
"PyQt5.QtWidgets.QVBoxLayout"
] | [((2026, 2058), 'PyQt5.QtWidgets.QApplication', 'QtWidgets.QApplication', (['sys.argv'], {}), '(sys.argv)\n', (2048, 2058), False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((2075, 2093), 'PyQt5.QtWidgets.QFrame', 'QtWidgets.QFrame', ([], {}), '()\n', (2091, 2093), False, 'from PyQt5 import QtCore, QtGui, QtWidg... |
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import pandas as pd
import numpy as np
from app import octopusData, client, linePlot
app = FastAPI()
origins = ["http://localhost:3000", "http://127.0.0.1:3000"]
# assumes a suitable web server, e.g. "python -m http.server 9000"
app.add_... | [
"numpy.multiply",
"fastapi.FastAPI",
"pandas.Timestamp.now",
"pandas.Timedelta",
"app.octopusData.e_consumption.index.max",
"app.octopusData.update",
"app.octopusData.g_consumption.index.max",
"app.linePlot"
] | [((171, 180), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (178, 180), False, 'from fastapi import FastAPI\n'), ((497, 523), 'app.octopusData.update', 'octopusData.update', (['client'], {}), '(client)\n', (515, 523), False, 'from app import octopusData, client, linePlot\n'), ((874, 900), 'app.octopusData.update', 'o... |
import unittest
def a_method(number):
return 0
class PrimesTestCase(unittest.TestCase):
def test_something(self):
self.assertEqual(0, a_method(5))
if __name__ == '__main__':
unittest.main()
| [
"unittest.main"
] | [((198, 213), 'unittest.main', 'unittest.main', ([], {}), '()\n', (211, 213), False, 'import unittest\n')] |
from configparser import ConfigParser
from pathlib import Path
from sys import exit
class Codex:
def __init__(self, faction):
config = ConfigParser()
config.read(Path("codices", f"{faction}.cfg"))
self.faction = faction
self.units = []
for key in config:
if key... | [
"pathlib.Path",
"configparser.ConfigParser",
"sys.exit"
] | [((150, 164), 'configparser.ConfigParser', 'ConfigParser', ([], {}), '()\n', (162, 164), False, 'from configparser import ConfigParser\n'), ((1146, 1152), 'sys.exit', 'exit', ([], {}), '()\n', (1150, 1152), False, 'from sys import exit\n'), ((185, 218), 'pathlib.Path', 'Path', (['"""codices"""', 'f"""{faction}.cfg"""']... |
# -*- coding: utf-8 -*-
"""
Parse suspicious IP addresses in Rising Storm 2: Vietnam
server logs.
The output log file is in CSV format, where the first column
is the IP address and the second column is the number of the
matches for the IP address.
Number of matches equals the number of log lines the IP
address was s... | [
"collections.defaultdict",
"argparse.ArgumentParser",
"re.compile"
] | [((610, 674), 're.compile', 're.compile', (['""".*\\\\s(\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}).*"""'], {}), "('.*\\\\s(\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}).*')\n", (620, 674), False, 'import re\n'), ((679, 752), 're.compile', 're.compile', (['""".*PlayerIP:\\\\s(\\\\d{1,3}\\\\.\\\\... |
import os
import sys
from JciHitachi import __author__, __version__
git_repo_path = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
requirements_txt_path = os.path.join(git_repo_path, "requirements.txt")
requirements_test_txt_path = os.path.join(git_repo_path, "requirements_test.txt")
sys.path.append(gi... | [
"os.path.dirname",
"sys.path.append",
"os.path.join"
] | [((171, 218), 'os.path.join', 'os.path.join', (['git_repo_path', '"""requirements.txt"""'], {}), "(git_repo_path, 'requirements.txt')\n", (183, 218), False, 'import os\n'), ((248, 300), 'os.path.join', 'os.path.join', (['git_repo_path', '"""requirements_test.txt"""'], {}), "(git_repo_path, 'requirements_test.txt')\n", ... |
from argparse import ArgumentParser
from router import app
from blockchain import blockchain
from threading import Thread
from sync import sync
import mine
import apscheduler
from config import *
def run_blockchain():
sync.sync_overall()
if __name__ == '__main__':
sync.sync_overall()
from apscheduler... | [
"router.app.run",
"argparse.ArgumentParser",
"sync.sync.sync_overall",
"apscheduler.schedulers.background.BackgroundScheduler"
] | [((223, 242), 'sync.sync.sync_overall', 'sync.sync_overall', ([], {}), '()\n', (240, 242), False, 'from sync import sync\n'), ((275, 294), 'sync.sync.sync_overall', 'sync.sync_overall', ([], {}), '()\n', (292, 294), False, 'from sync import sync\n'), ((382, 418), 'apscheduler.schedulers.background.BackgroundScheduler',... |
from os import path
import numpy as np
import pandas as pd
import impyute as impy
from matplotlib import pyplot as plt
plt.close("all")
data_path = 'data'
# read geographic information for capitals
municipios = pd.read_csv(path.join(data_path, 'population_capitals.csv'))
# population density
municipios['density'] = m... | [
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.plot",
"os.path.join",
"matplotlib.pyplot.close",
"numpy.array",
"impyute.em",
"pandas.offsets.MonthBegin",
"pandas.DataFrame",
"pandas.date_range",
"matplotlib.pyplot.show"
] | [((119, 135), 'matplotlib.pyplot.close', 'plt.close', (['"""all"""'], {}), "('all')\n", (128, 135), True, 'from matplotlib import pyplot as plt\n'), ((1276, 1296), 'impyute.em', 'impy.em', (['data_output'], {}), '(data_output)\n', (1283, 1296), True, 'import impyute as impy\n'), ((1312, 1372), 'pandas.DataFrame', 'pd.D... |
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Activation
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.metrics import mean_squared_error
from agents.stew.utils import create_diff_matrix
import numpy as np
import gym
from agents.EwR... | [
"numpy.argmax",
"agents.EwRegularizer.KerasEWRegularizer",
"numpy.exp",
"numpy.array",
"tensorflow.keras.optimizers.Adam",
"numpy.random.uniform",
"gym.make",
"numpy.save",
"numpy.random.shuffle"
] | [((4269, 4292), 'gym.make', 'gym.make', (['"""CartPole-v1"""'], {}), "('CartPole-v1')\n", (4277, 4292), False, 'import gym\n'), ((5926, 5955), 'numpy.save', 'np.save', (['"""hello"""', 'all_returns'], {}), "('hello', all_returns)\n", (5933, 5955), True, 'import numpy as np\n'), ((4825, 4850), 'numpy.array', 'np.array',... |
import sys, os, unittest, datetime
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/..")
from services.articles import ArticleService
from pprint import pprint
class ArticleServiceTest(unittest.TestCase):
service = ArticleService()
def test_all(self):
articles = self.service.all()
for article in ar... | [
"services.articles.ArticleService",
"os.path.abspath",
"unittest.main",
"pprint.pprint"
] | [((231, 247), 'services.articles.ArticleService', 'ArticleService', ([], {}), '()\n', (245, 247), False, 'from services.articles import ArticleService\n'), ((625, 640), 'unittest.main', 'unittest.main', ([], {}), '()\n', (638, 640), False, 'import sys, os, unittest, datetime\n'), ((67, 92), 'os.path.abspath', 'os.path.... |
"""
http://docs.readthedocs.io/en/latest/getting_started.html#in-rst
pip install sphinx sphinx-autobuild
pip install sphinxcontrib-napoleon
pip install sphinx_rtd_theme
"""
def initialize_docs():
from os.path import join
import setup
setupkw = setup.setupkw
full_version = setup.parse_version()
sh... | [
"setup.parse_version",
"ubelt.cmd",
"ubelt.readfrom",
"os.path.join",
"redbaron.RedBaron"
] | [((292, 313), 'setup.parse_version', 'setup.parse_version', ([], {}), '()\n', (311, 313), False, 'import setup\n'), ((390, 407), 'os.path.join', 'join', (['"""."""', '"""docs"""'], {}), "('.', 'docs')\n", (394, 407), False, 'from os.path import join\n'), ((938, 963), 'ubelt.cmd', 'ub.cmd', (['cmdstr'], {'verbose': '(2)... |
#!/usr/bin/env python3
# coding:utf-8
import wave
w = wave.open("indian.wav", "rb")
h = wave.open("result.wav", "wb")
print(w.getnchannels()) # 1:单声道
print(w.getsampwidth()) # 2:采样字节长度
print(w.getframerate()) # 11025:采样频率
h.setnchannels(w.getnchannels())
h.setsampwidth(w.getsampwidth()//2)
h.setframerate(w.getfr... | [
"wave.open"
] | [((56, 85), 'wave.open', 'wave.open', (['"""indian.wav"""', '"""rb"""'], {}), "('indian.wav', 'rb')\n", (65, 85), False, 'import wave\n'), ((90, 119), 'wave.open', 'wave.open', (['"""result.wav"""', '"""wb"""'], {}), "('result.wav', 'wb')\n", (99, 119), False, 'import wave\n')] |
from gamedatacrunch.load import load
def convert_app_dict(app, include_slug=False):
app_id = int(app["i"])
app_name = app["n"]
app_slug = app["s"]
app_dict = dict()
app_dict["appid"] = app_id
app_dict["name"] = app_name
if include_slug:
app_dict["slug"] = app_slug
return app_... | [
"gamedatacrunch.load.load"
] | [((414, 448), 'gamedatacrunch.load.load', 'load', ([], {'file_name': 'file_name', 'url': 'url'}), '(file_name=file_name, url=url)\n', (418, 448), False, 'from gamedatacrunch.load import load\n'), ((843, 877), 'gamedatacrunch.load.load', 'load', ([], {'file_name': 'file_name', 'url': 'url'}), '(file_name=file_name, url=... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import codecs
from setuptools import setup
def read(fname):
file_path = os.path.join(os.path.dirname(__file__), fname)
return codecs.open(file_path, encoding='utf-8').read()
tests_require = [
'coverage',
'pep8',
'pyflakes',
'pylint',
... | [
"os.path.dirname",
"codecs.open"
] | [((148, 173), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (163, 173), False, 'import os\n'), ((193, 233), 'codecs.open', 'codecs.open', (['file_path'], {'encoding': '"""utf-8"""'}), "(file_path, encoding='utf-8')\n", (204, 233), False, 'import codecs\n')] |
from mangopaysdk.tools import enums
import logging
class Configuration:
"""Configuration class for MangoPay API SDK.
All fields are required.
"""
# Setting for client: client Id and client password
ClientID = ''
ClientPassword = ''
# Base URL to MangoPay API
BaseUrl = 'https://api.sa... | [
"logging.basicConfig"
] | [((839, 879), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (858, 879), False, 'import logging\n')] |
"""
Formatter for TSV output (with/without context).
"""
__author__ = "<NAME>"
__all__ = ['CSVFormatter', 'TSVFormatter', 'TextCSVFormatter', 'TextTSVFormatter']
import csv
from ._export import StreamFormatter, ContinuousEntityFormatter
from ..util.iterate import CacheOneIter
from ..util.misc import tsv_format
... | [
"csv.writer"
] | [((836, 872), 'csv.writer', 'csv.writer', (['stream'], {}), '(stream, **self.fmtparams)\n', (846, 872), False, 'import csv\n')] |
#!/usr/bin/env python
from collections import deque
def breadth_first_search(graph, start):
search_queue = deque()
search_queue += start
visited = set()
while search_queue:
node = search_queue.popleft()
for each in graph[node]:
if each not in visited:
sea... | [
"collections.deque"
] | [((115, 122), 'collections.deque', 'deque', ([], {}), '()\n', (120, 122), False, 'from collections import deque\n')] |
from collections import defaultdict
import sys
def subArraylen(arr, n, K):
mp = defaultdict(lambda: 0)
mp[arr[0]] = 0
for i in range(1, n):
arr[i] = arr[i] + arr[i - 1]
mp[arr[i]] = i
ln = sys.maxsize
for i in range(n):
if(arr[i] < K):
continue
else:
... | [
"collections.defaultdict"
] | [((86, 109), 'collections.defaultdict', 'defaultdict', (['(lambda : 0)'], {}), '(lambda : 0)\n', (97, 109), False, 'from collections import defaultdict\n')] |
""" Basic Mosenergosbyt API interaction. """
import asyncio
import json
import logging
from _ast import arg
from abc import ABC
from datetime import datetime, date
from enum import IntEnum
from functools import partial
from hashlib import md5
from types import MappingProxyType
from typing import Optional, List, Dict, U... | [
"logging.getLogger",
"aiohttp.ClientSession",
"json.loads",
"dateutil.relativedelta.relativedelta",
"datetime.datetime.utcnow",
"dateutil.tz.tz.gettz",
"types.MappingProxyType",
"json.dumps",
"asyncio.wait",
"aiohttp.ClientTimeout",
"datetime.datetime.now",
"functools.partial",
"datetime.dat... | [((529, 556), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (546, 556), False, 'import logging\n'), ((815, 840), 'dateutil.tz.tz.gettz', 'tz.gettz', (['"""Europe/Moscow"""'], {}), "('Europe/Moscow')\n", (823, 840), False, 'from dateutil.tz import tz\n'), ((863, 898), 'dateutil.relativede... |
import os
import intake
import pandas as pd
import pytest
here = os.path.abspath(os.path.dirname(__file__))
zarr_col = os.path.join(here, 'pangeo-cmip6-zarr.json')
cdf_col = os.path.join(here, 'cmip6-netcdf.json')
zarr_query = dict(
variable_id=['pr'],
experiment_id='ssp370',
activity_id='AerChemMIP',
... | [
"os.path.dirname",
"pytest.mark.parametrize",
"os.path.join",
"intake.open_esm_datastore"
] | [((121, 165), 'os.path.join', 'os.path.join', (['here', '"""pangeo-cmip6-zarr.json"""'], {}), "(here, 'pangeo-cmip6-zarr.json')\n", (133, 165), False, 'import os\n'), ((176, 215), 'os.path.join', 'os.path.join', (['here', '"""cmip6-netcdf.json"""'], {}), "(here, 'cmip6-netcdf.json')\n", (188, 215), False, 'import os\n'... |
"""
Functions associated with a molecule.
"""
from .measure import calculate_distance
from .atom_data import atomic_weights
import numpy as np
def build_bond_list(coordinates, max_bond=1.5, min_bond=0):
"""Return the bonds in a system based on bond distance criteria.
The pairwise distance between atoms is c... | [
"numpy.array"
] | [((2536, 2561), 'numpy.array', 'np.array', (['[0.0, 0.0, 0.0]'], {}), '([0.0, 0.0, 0.0])\n', (2544, 2561), True, 'import numpy as np\n')] |
import setuptools
setuptools.setup(
name="degenerate-dna",
version="0.0.9",
url="https://github.com/carlosp420/degenerate-dna",
author="<NAME>",
author_email="<EMAIL>",
description="Python implementation of the Degen Perl package by Zwick et al.",
long_description=open('README.rst').read(... | [
"setuptools.find_packages"
] | [((337, 363), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (361, 363), False, 'import setuptools\n')] |
from tkinter import *
import time
root = Tk()
class Clock:
def __init__(self):
self.time1 = ''
self.time2 = time.strftime('%H:%M:%S')
self.mFrame = Frame()
self.mFrame.pack(side=TOP,expand=YES,fill=X)
self.watch = Label(self.mFrame, text=self.time2, font=('times',12,'bold'... | [
"time.strftime"
] | [((130, 155), 'time.strftime', 'time.strftime', (['"""%H:%M:%S"""'], {}), "('%H:%M:%S')\n", (143, 155), False, 'import time\n'), ((450, 475), 'time.strftime', 'time.strftime', (['"""%H:%M:%S"""'], {}), "('%H:%M:%S')\n", (463, 475), False, 'import time\n')] |
# From http://code.activestate.com/recipes/498245/
import collections
import functools
from itertools import ifilterfalse
from heapq import nsmallest
from operator import itemgetter
class Counter(dict):
'Mapping where default values are zero'
def __missing__(self, key):
return 0
def lru_cache(maxsi... | [
"operator.itemgetter",
"random.choice",
"collections.deque"
] | [((1468, 1487), 'collections.deque', 'collections.deque', ([], {}), '()\n', (1485, 1487), False, 'import collections\n'), ((4972, 5024), 'collections.deque', 'collections.deque', (['(s for s in self.queue if s != key)'], {}), '(s for s in self.queue if s != key)\n', (4989, 5024), False, 'import collections\n'), ((9130,... |
import pika
import time
import gevent
from gevent import monkey;monkey.patch_all()
connection = pika.BlockingConnection(pika.URLParameters("amqp://guest:guest@127.0.0.1/"))
channel = connection.channel()
channel.queue_declare(queue='hello')
def test(ch, method, body):
print(" [x] Received %r" % (body,))
t1 = ... | [
"pika.URLParameters",
"time.time",
"gevent.spawn",
"gevent.monkey.patch_all"
] | [((64, 82), 'gevent.monkey.patch_all', 'monkey.patch_all', ([], {}), '()\n', (80, 82), False, 'from gevent import monkey\n'), ((120, 171), 'pika.URLParameters', 'pika.URLParameters', (['"""amqp://guest:guest@127.0.0.1/"""'], {}), "('amqp://guest:guest@127.0.0.1/')\n", (138, 171), False, 'import pika\n'), ((320, 331), '... |
from typing import Union
import numpy as np
def bspline_basis_manual(
knot_vector_t: Union[list, tuple],
knot_i: int = 0,
p: int = 0,
nti: int = 1,
verbose: bool = False,
):
"""Computes the B-spline polynomial basis,
currently limited to degree constant, linear, or quadratic.
Arg... | [
"numpy.array",
"numpy.arange"
] | [((2803, 2814), 'numpy.array', 'np.array', (['t'], {}), '(t)\n', (2811, 2814), True, 'import numpy as np\n'), ((2265, 2284), 'numpy.array', 'np.array', (['knots_rhs'], {}), '(knots_rhs)\n', (2273, 2284), True, 'import numpy as np\n'), ((2287, 2306), 'numpy.array', 'np.array', (['knots_lhs'], {}), '(knots_lhs)\n', (2295... |
from __future__ import absolute_import, division, print_function
import six.moves.cPickle as pickle
from dxtbx.model import Detector, Panel
from libtbx.test_utils import approx_equal
from scitbx.array_family import flex
def tst_get_gain(detector):
detector[0].set_gain(2.0)
assert abs(detector[0].get_gain() - 2.0)... | [
"cctbx.eltbx.attenuation_coefficient.get_table",
"random.uniform",
"dxtbx.model.Panel",
"scitbx.array_family.flex.grid",
"dxtbx.model.detector_helpers.set_mosflm_beam_centre",
"dxtbx.model.ParallaxCorrectedPxMmStrategy",
"libtbx.test_utils.approx_equal",
"dxtbx.model.Beam",
"scitbx.matrix.col",
"s... | [((2551, 2587), 'libtbx.test_utils.approx_equal', 'approx_equal', (['xy_px', 'pixels'], {'eps': 'eps'}), '(xy_px, pixels, eps=eps)\n', (2563, 2587), False, 'from libtbx.test_utils import approx_equal\n'), ((3998, 4018), 'scitbx.matrix.col', 'matrix.col', (['(1, 0.5)'], {}), '((1, 0.5))\n', (4008, 4018), False, 'from sc... |
#!/usr/bin/env python
"""
Compute a density raster for input geometries or sum a property.
"""
from __future__ import division
import affine
import click
import fiona as fio
import numpy as np
import rasterio as rio
import rasterio.dtypes
from rasterio.features import rasterize
import str2type.ext
def cb_res(ctx... | [
"click.argument",
"click.option",
"rasterio.open",
"affine.Affine.from_gdal",
"rasterio.features.rasterize",
"numpy.zeros",
"fiona.open",
"click.BadParameter",
"click.command"
] | [((1695, 1710), 'click.command', 'click.command', ([], {}), '()\n', (1708, 1710), False, 'import click\n'), ((1712, 1736), 'click.argument', 'click.argument', (['"""infile"""'], {}), "('infile')\n", (1726, 1736), False, 'import click\n'), ((1738, 1763), 'click.argument', 'click.argument', (['"""outfile"""'], {}), "('ou... |
import sqlite3
conn = sqlite3.connect('books.sqlite')
cursor = conn.cursor()
sql_query = """ CREATE TABLE book (
id integer PRIMARY KEY,
author text NOT NULL,
language text NOT NULL,
title text NOT NULL
)"""
cursor.execute(sql_query) | [
"sqlite3.connect"
] | [((23, 54), 'sqlite3.connect', 'sqlite3.connect', (['"""books.sqlite"""'], {}), "('books.sqlite')\n", (38, 54), False, 'import sqlite3\n')] |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 <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 limitati... | [
"json.loads",
"json.dumps",
"threading.RLock",
"ast.literal_eval",
"copy.deepcopy"
] | [((1809, 1826), 'threading.RLock', 'threading.RLock', ([], {}), '()\n', (1824, 1826), False, 'import threading\n'), ((3533, 3660), 'json.dumps', 'json.dumps', (['self.data'], {'indent': '(4 if self.output_pretty_json else None)', 'sort_keys': 'self.output_pretty_json', 'cls': 'util.MyEncoder'}), '(self.data, indent=4 i... |
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.cm as cm
from torch.nn import Softmax2d
import torch
from os.path import basename
class plt_loss(object):
def __call__(self, train_loss, valid_loss, figsize=(10, 10), savefig=None, display=False):
train_loss=np.array(train_loss)
v... | [
"matplotlib.pyplot.ylabel",
"numpy.array",
"numpy.arange",
"numpy.where",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"numpy.linspace",
"matplotlib.cm.ScalarMappable",
"numpy.argmax",
"torch.nn.Softmax2d",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.sh... | [((290, 310), 'numpy.array', 'np.array', (['train_loss'], {}), '(train_loss)\n', (298, 310), True, 'import numpy as np\n'), ((330, 350), 'numpy.array', 'np.array', (['valid_loss'], {}), '(valid_loss)\n', (338, 350), True, 'import numpy as np\n'), ((363, 390), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '... |
import base64
from collections import namedtuple
from datetime import datetime
import hashlib
import os
import secrets
import struct
import sys
import time
from fido2.client import Fido2Client
from fido2.ctap2 import CTAP2
from fido2.ctap2 import CredentialManagement
from fido2.hid import CtapHidDevice
from fido2.util... | [
"datetime.datetime.utcfromtimestamp",
"hashlib.sha256",
"collections.namedtuple",
"fido2.ctap2.CredentialManagement",
"fido2.utils.hmac_sha256",
"os.getenv",
"base64.encodebytes",
"fido2.client.Fido2Client",
"secrets.token_bytes",
"fido2.webauthn.PublicKeyCredentialCreationOptions",
"struct.pack... | [((466, 507), 'collections.namedtuple', 'namedtuple', (['"""SubPacket"""', "['type', 'body']"], {}), "('SubPacket', ['type', 'body'])\n", (476, 507), False, 'from collections import namedtuple\n'), ((682, 727), 'fido2.client.Fido2Client', 'Fido2Client', (['dev', 'origin'], {'verify': 'verify_rp_id'}), '(dev, origin, ve... |
#!/usr/bin/env python
"""
Real time detection of 30 actions.
Usage:
run_action_recognition.py [--camera_id=CAMERA_ID]
[--path_in=FILENAME]
[--path_out=FILENAME]
[--title=TITLE]
[--model_name=NAME]
... | [
"sense.controller.Controller",
"sense.downstream_tasks.nn_utils.Pipe",
"sense.loading.build_backbone_network",
"sense.downstream_tasks.nn_utils.LogisticRegression",
"sense.loading.get_relevant_weights",
"sense.downstream_tasks.postprocess.PostprocessClassificationOutput",
"docopt.docopt",
"sense.loadi... | [((1475, 1548), 'sense.loading.ModelConfig', 'ModelConfig', (['"""StridedInflatedEfficientNet"""', '"""pro"""', "['action_recognition']"], {}), "('StridedInflatedEfficientNet', 'pro', ['action_recognition'])\n", (1486, 1548), False, 'from sense.loading import ModelConfig\n'), ((1554, 1626), 'sense.loading.ModelConfig',... |
import copy
from musicscore.basic_functions import flatten
class Tree(object):
"""
A simple Tree class
"""
def __init__(self, label=None, *args, **kwargs):
super().__init__(*args, **kwargs)
self._children = []
self._up = None
self._leaves = []
self.label = lab... | [
"copy.copy"
] | [((5817, 5832), 'copy.copy', 'copy.copy', (['self'], {}), '(self)\n', (5826, 5832), False, 'import copy\n')] |
import os
import glob
import pickle
import cv2
from engine.FaceNet import FaceNet
def create_pickles():
directory = os.path.join("..","data","dataset")
# dirs = [x[0] for x in os.walk(directory)][1:]
dirs = glob.glob(directory+"\\*")
facenet = FaceNet()
index = 0
for dir in dirs:
print... | [
"engine.FaceNet.FaceNet",
"pickle.dump",
"os.path.join",
"cv2.imread",
"glob.glob"
] | [((122, 159), 'os.path.join', 'os.path.join', (['""".."""', '"""data"""', '"""dataset"""'], {}), "('..', 'data', 'dataset')\n", (134, 159), False, 'import os\n'), ((221, 249), 'glob.glob', 'glob.glob', (["(directory + '\\\\*')"], {}), "(directory + '\\\\*')\n", (230, 249), False, 'import glob\n'), ((262, 271), 'engine.... |
# Copyright 2014-2016 Insight Software Consortium.
# Copyright 2004-2008 <NAME>.
# Distributed under the Boost Software License, Version 1.0.
# See http://www.boost.org/LICENSE_1_0.txt
import unittest
import parser_test_case
from pygccxml import parser
from pygccxml import declarations
class tester_src_t(parser_tes... | [
"unittest.TestSuite",
"pygccxml.declarations.find_declaration",
"parser_test_case.parser_test_case_t.__init__",
"unittest.makeSuite",
"pygccxml.parser.parse",
"unittest.TextTestRunner"
] | [((2234, 2254), 'unittest.TestSuite', 'unittest.TestSuite', ([], {}), '()\n', (2252, 2254), False, 'import unittest\n'), ((474, 531), 'parser_test_case.parser_test_case_t.__init__', 'parser_test_case.parser_test_case_t.__init__', (['self', '*args'], {}), '(self, *args)\n', (518, 531), False, 'import parser_test_case\n'... |
#!/usr/bin/env python
"""
This module contains dyPolyChord's high-level functionality for
performing dynamic nested sampling calculations. This is done using the
algorithm described in Appendix F of "Dynamic nested sampling: an
improved algorithm for parameter estimation and evidence calculation"
(Higson et al., 2019).... | [
"numpy.where",
"os.path.join",
"numpy.asarray",
"os.path.isfile",
"copy.deepcopy",
"sys.stdout.flush",
"traceback.print_exc",
"os.remove"
] | [((8355, 8428), 'os.path.join', 'os.path.join', (["settings_dict_in['base_dir']", "settings_dict_in['file_root']"], {}), "(settings_dict_in['base_dir'], settings_dict_in['file_root'])\n", (8367, 8428), False, 'import os\n'), ((15643, 15674), 'copy.deepcopy', 'copy.deepcopy', (['settings_dict_in'], {}), '(settings_dict_... |
import pygame
from Controller import ControllerKeyTypes
class Player:
WIDTH = 15
screen_height = 100
points = 0
HIDE = pygame.Color("black") # color to hide the player with background
SHOW = pygame.Color("white") # color tho show the player
def __init__(self, start_pos_x, start_pos_y, scre... | [
"pygame.Color",
"pygame.draw.rect",
"pygame.Rect"
] | [((138, 159), 'pygame.Color', 'pygame.Color', (['"""black"""'], {}), "('black')\n", (150, 159), False, 'import pygame\n'), ((215, 236), 'pygame.Color', 'pygame.Color', (['"""white"""'], {}), "('white')\n", (227, 236), False, 'import pygame\n'), ((492, 602), 'pygame.Rect', 'pygame.Rect', (['(self.pos_x - self.WIDTH)', '... |
"""
@author: acfromspace
"""
import textwrap
def wrap1(string, max_width):
return "\n".join([string[i:i+max_width] for i in range(0, len(string), max_width)])
def wrap2(string, max_width):
return textwrap.fill(string, max_width)
def wrap3(string, max_width):
# Doesn't work as a solution to the proble... | [
"textwrap.fill"
] | [((209, 241), 'textwrap.fill', 'textwrap.fill', (['string', 'max_width'], {}), '(string, max_width)\n', (222, 241), False, 'import textwrap\n')] |
import json
import os
from dotenv import load_dotenv
import pytest
from ssaw import Client
@pytest.fixture(scope="session", autouse=True)
def load_env_vars(request):
curr_path = os.path.dirname(os.path.realpath(__file__))
env_path = os.path.join(curr_path, "tests/env_vars.sh")
load_dotenv(dotenv_path=e... | [
"os.path.join",
"os.environ.get",
"dotenv.load_dotenv",
"os.path.isfile",
"os.path.realpath",
"pytest.fixture"
] | [((97, 142), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""', 'autouse': '(True)'}), "(scope='session', autouse=True)\n", (111, 142), False, 'import pytest\n'), ((491, 522), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (505, 522), False, 'import pytest\... |
from defusedcsv import csv
import importlib
import logging
import os
import re
from pathlib import Path
from tempfile import mkstemp
from urllib.parse import urlparse
import pypandoc
from django.apps import apps
from django.conf import settings
from django.http import Http404, HttpResponse, HttpResponseBadRequest
from... | [
"logging.getLogger",
"pypandoc.get_pandoc_version",
"django.conf.settings.EXPORT_PANDOC_ARGS.get",
"re.search",
"os.remove",
"defusedcsv.csv.writer",
"pathlib.Path",
"django.http.HttpResponse",
"django.utils.translation.ugettext_lazy",
"importlib.import_module",
"re.match",
"os.path.isfile",
... | [((427, 454), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (444, 454), False, 'import logging\n'), ((4093, 4119), 'django.template.loader.get_template', 'get_template', (['template_src'], {}), '(template_src)\n', (4105, 4119), False, 'from django.template.loader import get_template\n'),... |
#!/usr/bin/env python
# coding=utf-8
import numpy as np
import sys
import lmoments as lmom
years = sys.argv[1]
yeare = sys.argv[2]
ysize = int(sys.argv[3])
xsize = int(sys.argv[4])
outdir = sys.argv[5]
var = sys.argv[6]
rp = sys.argv[7]
FUNC = sys.argv[8]
rivhgt = np.fromfile(outdir+'/map/rivhgt.bin', np.float32).res... | [
"lmoments.quagum",
"numpy.fromfile",
"lmoments.quape3",
"lmoments.quawak",
"lmoments.quagev",
"lmoments.quagam",
"numpy.zeros",
"lmoments.quawei"
] | [((349, 391), 'numpy.zeros', 'np.zeros', (['(ysize, xsize)'], {'dtype': 'np.float64'}), '((ysize, xsize), dtype=np.float64)\n', (357, 391), True, 'import numpy as np\n'), ((267, 318), 'numpy.fromfile', 'np.fromfile', (["(outdir + '/map/rivhgt.bin')", 'np.float32'], {}), "(outdir + '/map/rivhgt.bin', np.float32)\n", (27... |
import base64
import os
from cryptography.fernet import Fernet
from passlib.hash import argon2
from garage_sale import server_dir
pep_file = os.path.join(server_dir, "../pepper.bin")
key = Fernet.generate_key()
pep = Fernet(key) #
# WRITE Pepper
with open("../pepper.bin", 'wb') as file:
file.write(key)
with o... | [
"passlib.hash.argon2.verify",
"base64.b64encode",
"passlib.hash.argon2.using",
"os.path.join",
"base64.b64decode",
"cryptography.fernet.Fernet",
"cryptography.fernet.Fernet.generate_key"
] | [((144, 185), 'os.path.join', 'os.path.join', (['server_dir', '"""../pepper.bin"""'], {}), "(server_dir, '../pepper.bin')\n", (156, 185), False, 'import os\n'), ((193, 214), 'cryptography.fernet.Fernet.generate_key', 'Fernet.generate_key', ([], {}), '()\n', (212, 214), False, 'from cryptography.fernet import Fernet\n')... |
import numpy as np
from scipy.optimize import brentq
from yt.fields.field_detector import \
FieldDetector
from pygrackle import \
add_grackle_fields, \
FluidContainer, \
chemistry_data
from pygrackle.yt_fields import \
_data_to_fc, \
_get_needed_fields
from yt.config import ytcfg
from yt.funcs ... | [
"yt.funcs.get_pbar",
"scipy.optimize.brentq",
"pygrackle.add_grackle_fields",
"numpy.log",
"yt.funcs.DummyProgressBar",
"pygrackle.yt_fields._get_needed_fields",
"pygrackle.yt_fields._data_to_fc",
"numpy.exp",
"numpy.zeros",
"yt.config.ytcfg.getboolean",
"pygrackle.FluidContainer",
"yt.config.... | [((439, 476), 'pygrackle.yt_fields._get_needed_fields', '_get_needed_fields', (['fc.chemistry_data'], {}), '(fc.chemistry_data)\n', (457, 476), False, 'from pygrackle.yt_fields import _data_to_fc, _get_needed_fields\n'), ((908, 926), 'numpy.log', 'np.log', (['ct_0[calc]'], {}), '(ct_0[calc])\n', (914, 926), True, 'impo... |
""" Utilities for formatting data. Can be run as a standalone tool. """
import argparse
import binascii
import json
import string
DESCRIPTION = "Hexdump and formatting utils"
def main():
argparser = argparse.ArgumentParser(description=DESCRIPTION)
argparser.add_argument("input_file", type=str, help="file t... | [
"binascii.hexlify",
"json.dumps",
"argparse.ArgumentParser"
] | [((208, 256), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'DESCRIPTION'}), '(description=DESCRIPTION)\n', (231, 256), False, 'import argparse\n'), ((1108, 1167), 'json.dumps', 'json.dumps', (['json_object'], {'indent': 'indent', 'sort_keys': 'sort_keys'}), '(json_object, indent=indent, so... |
# Copyright 2017 Telstra Open Source
#
# 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 agre... | [
"kilda.probe.entity.message.create_dump_state",
"json.load"
] | [((847, 923), 'kilda.probe.entity.message.create_dump_state', 'create_dump_state', (["etalon_request['correlation_id']", "etalon_request['route']"], {}), "(etalon_request['correlation_id'], etalon_request['route'])\n", (864, 923), False, 'from kilda.probe.entity.message import create_dump_state\n'), ((808, 820), 'json.... |
from typing import TYPE_CHECKING
from django.conf import settings
from django.utils.translation import pgettext_lazy
from saleor.plugins.base_plugin import BasePlugin, ConfigurationTypeField
from . import GatewayConfig, authorize, capture, process_payment, refund, void
GATEWAY_NAME = "Paypal"
if TYPE_CHECKING:
... | [
"django.utils.translation.pgettext_lazy"
] | [((1143, 1221), 'django.utils.translation.pgettext_lazy', 'pgettext_lazy', (['"""Plugin help text"""', '"""Provide Paypal Client Id (public API key)"""'], {}), "('Plugin help text', 'Provide Paypal Client Id (public API key)')\n", (1156, 1221), False, 'from django.utils.translation import pgettext_lazy\n'), ((1274, 131... |
import tensorflow as tf
import numpy as np
from edward.models import RandomVariable
from tensorflow.contrib.distributions import (Distribution,
FULLY_REPARAMETERIZED)
# from tensorflow.python.ops.distributions.special_math import log_ndtr
from tf_gbds.utils import pad_extra... | [
"tensorflow.shape",
"tensorflow.pad",
"tensorflow.transpose",
"tensorflow.reduce_sum",
"tensorflow.nn.softplus",
"tensorflow.nn.softmax",
"tensorflow.cast",
"tensorflow.log",
"tensorflow.random_normal",
"tensorflow.concat",
"tensorflow.zeros_like",
"tensorflow.stack",
"tensorflow.zeros",
"... | [((6474, 6568), 'tensorflow.reshape', 'tf.reshape', (['NN_output[:, :, :self.K * self.dim]', '[self.B, -1, self.K, self.dim]', '"""all_mu"""'], {}), "(NN_output[:, :, :self.K * self.dim], [self.B, -1, self.K, self.\n dim], 'all_mu')\n", (6484, 6568), True, 'import tensorflow as tf\n'), ((7125, 7164), 'tensorflow.sub... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import scraper
from db import Dbinterface
from db.models import Publicacao_Original
import argparse
import calendar
import os
##
# Utils
def get_dates(year, month):
num_days = calendar.monthrange(year, month)[1]
return ['-'.join([str(year), str(month), str(day... | [
"scraper.scrap",
"argparse.ArgumentParser",
"db.models.Publicacao_Original",
"calendar.monthrange",
"db.Dbinterface"
] | [((397, 422), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (420, 422), False, 'import argparse\n'), ((877, 939), 'db.Dbinterface', 'Dbinterface', (["os.environ['DIARIOBOT_DATABASE_CONNECTIONSTRING']"], {}), "(os.environ['DIARIOBOT_DATABASE_CONNECTIONSTRING'])\n", (888, 939), False, 'from db i... |
import requests
import binascii
import os
# Credentials for basic authentication using a token
# personal_token =
# base_url =
# this creates the formdata we need to authenticate against SHAPI
def encode_multipart_formdata(fields):
boundary = binascii.hexlify(os.urandom(16)).decode('ascii')
body = (
... | [
"os.urandom"
] | [((266, 280), 'os.urandom', 'os.urandom', (['(16)'], {}), '(16)\n', (276, 280), False, 'import os\n')] |
#!/usr/bin/env python3
import numpy as np
#import scipy.linalg
def vector_lengths(a):
squared = a**2
euclidean = squared.sum(axis=1)
return np.sqrt(euclidean)
def main():
a = np.random.randint(0, 10, (3, 4))
print(a)
print(vector_lengths(a))
if __name__ == "__main__":
main()
| [
"numpy.random.randint",
"numpy.sqrt"
] | [((159, 177), 'numpy.sqrt', 'np.sqrt', (['euclidean'], {}), '(euclidean)\n', (166, 177), True, 'import numpy as np\n'), ((199, 231), 'numpy.random.randint', 'np.random.randint', (['(0)', '(10)', '(3, 4)'], {}), '(0, 10, (3, 4))\n', (216, 231), True, 'import numpy as np\n')] |
# Generated by Django 3.0.6 on 2021-08-24 21:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('careers', '0002_auto_20210813_2351'),
]
operations = [
migrations.RemoveField(
model_name='careerdetail',
name='role... | [
"django.db.migrations.RemoveField",
"django.db.models.TextField"
] | [((235, 323), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""careerdetail"""', 'name': '"""role_and_responsibilities"""'}), "(model_name='careerdetail', name=\n 'role_and_responsibilities')\n", (257, 323), False, 'from django.db import migrations, models\n'), ((468, 507), 'djan... |
from pyramid.config import Configurator
from pyramid.request import Request
from pyramid.traversal import DefaultRootFactory
from pytest import fixture, mark
from webtest import TestApp
from wiring import Graph, injected
from pyramid_wiring.mapper import WiringViewMapper
# Function-based views
def view(request):
... | [
"pyramid.config.Configurator",
"pytest.mark.parametrize",
"wiring.Graph",
"wiring.injected"
] | [((1694, 1880), 'pytest.mark.parametrize', 'mark.parametrize', (['"""view"""', '[view, context_view, injected_view, context_injected_view, ClassView,\n AttributeClassView, ContextClassView, InjectedClassView,\n InjectedContextClassView]'], {}), "('view', [view, context_view, injected_view,\n context_injected_v... |
"""
Bistability with NaP
Reference:
<NAME>-J (2008)
Attractor network models
In Encyclopedia of Neuroscience, volume 1, pp. 667-679 Edited by Squire LR. Oxford: Academic Press.
@author: <NAME> @ 2017/4
"""
from __future__ import division
from collections import OrderedDict
import random as pyrand # Import before Bri... | [
"collections.OrderedDict",
"random.seed"
] | [((2020, 2033), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (2031, 2033), False, 'from collections import OrderedDict\n'), ((3003, 3016), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (3014, 3016), False, 'from collections import OrderedDict\n'), ((3907, 3920), 'collections.OrderedDict', '... |
"""
About: Tools/Helpers for emulation scripts.
Should be used by ComNetEmu's users
"""
import re
from mininet.log import error
def parsePing(pingOutput):
"Parse ping output and return packets sent, received."
# Check for downed link
if "connect: Network is unreachable" in pingOutput:
ret... | [
"mininet.log.error",
"re.search"
] | [((401, 425), 're.search', 're.search', (['r', 'pingOutput'], {}), '(r, pingOutput)\n', (410, 425), False, 'import re\n'), ((452, 518), 'mininet.log.error', 'error', (["('*** Error: could not parse ping output: %s\\n' % pingOutput)"], {}), "('*** Error: could not parse ping output: %s\\n' % pingOutput)\n", (457, 518), ... |
import requests
from bs4 import BeautifulSoup
import re
from tqdm import tqdm
import math
import json
from datetime import datetime
# Taken from https://stackoverflow.com/questions/1345827/how-do-i-find-the-time-difference-between-two-datetime-objects-in-python
def get_duration( then, now = datetime.now(), interval = ... | [
"math.ceil",
"re.compile",
"requests.get",
"bs4.BeautifulSoup",
"datetime.datetime.now",
"json.load"
] | [((293, 307), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (305, 307), False, 'from datetime import datetime\n'), ((5732, 5753), 'requests.get', 'requests.get', (['url_art'], {}), '(url_art)\n', (5744, 5753), False, 'import requests\n'), ((7434, 7459), 'requests.get', 'requests.get', (['url_profile'], {})... |
from flask import request, jsonify, g
from ..schema.schemas import *
from ..models.user import User
from . import apiv1, login_required, News
from .api_helper import *
class UserController():
def __init__(self):
''''''
@staticmethod
@login_required
def me():
'''my personal profile
... | [
"flask.request.args.get"
] | [((1413, 1438), 'flask.request.args.get', 'request.args.get', (['"""query"""'], {}), "('query')\n", (1429, 1438), False, 'from flask import request, jsonify, g\n')] |
import os
from threading import Thread
from flask import Flask, redirect, url_for
from flask_mail import Mail, Message
from mail_html import get_mail_msg
app = Flask(__name__)
app.jinja_env.trim_blocks = True
app.jinja_env.lstrip_blocks = True
app.config.update(
SECRET_KEY=os.getenv('SECRET_KEY', 'secret string'... | [
"flask_mail.Mail",
"os.getenv",
"flask.Flask",
"flask.url_for",
"flask.redirect",
"mail_html.get_mail_msg",
"flask_mail.Message",
"threading.Thread"
] | [((162, 177), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (167, 177), False, 'from flask import Flask, redirect, url_for\n'), ((572, 581), 'flask_mail.Mail', 'Mail', (['app'], {}), '(app)\n', (576, 581), False, 'from flask_mail import Mail, Message\n'), ((637, 681), 'flask_mail.Message', 'Message', (['s... |
#!/usr/bin/env python3
# Copyright (c) 2018-2019, <NAME>
# SPDX-License-Identifier: ISC
"""
Updates an old .config file or creates a new one, by filling in default values
for all new symbols. This is the same as picking the default selection for all
symbols in oldconfig, or entering the menuconfig interface and immed... | [
"kconfiglib.standard_kconfig"
] | [((614, 650), 'kconfiglib.standard_kconfig', 'kconfiglib.standard_kconfig', (['__doc__'], {}), '(__doc__)\n', (641, 650), False, 'import kconfiglib\n')] |
# -*- coding:utf-8 -*-
# Copyright (c) 2020 Huawei Technologies Co.,Ltd.
#
# openGauss is licensed under Mulan PSL v2.
# You can use this software according to the terms
# and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
#
# http://license.coscl.org.cn/MulanPSL2
#
# THIS SOFTWARE... | [
"sys.path.insert",
"gspylib.common.Common.DefaultValue.getEnvironmentParameterValue",
"csv.DictReader",
"gspylib.common.Common.DefaultValue.getTmpDirFromEnv",
"gspylib.common.Common.DefaultValue.execCommandLocally",
"re.compile",
"time.sleep",
"gspylib.common.Common.DefaultValue.getClusterToolPath",
... | [((3605, 3622), 'sys.exit', 'sys.exit', (['retCode'], {}), '(retCode)\n', (3613, 3622), False, 'import sys\n'), ((3850, 3954), 'gspylib.threads.SshTool.SshTool', 'SshTool', (['self.context.clusterNodes', 'self.context.localLog', 'DefaultValue.TIMEOUT_PSSH_BINARY_UPGRADE'], {}), '(self.context.clusterNodes, self.context... |
from copy import copy
from typing import Union
import numpy as np
from fedot.core.data.data import InputData, OutputData
from fedot.core.data.multi_modal import MultiModalData
from fedot.core.operations.evaluation.operation_implementations.data_operations.ts_transformations import ts_to_table
from fedot.core.reposito... | [
"numpy.mean",
"numpy.isclose",
"numpy.hstack",
"fedot.core.data.multi_modal.MultiModalData",
"fedot.core.operations.evaluation.operation_implementations.data_operations.ts_transformations.ts_to_table",
"numpy.array",
"copy.copy",
"numpy.arange"
] | [((7328, 7349), 'copy.copy', 'copy', (['train_predicted'], {}), '(train_predicted)\n', (7332, 7349), False, 'from copy import copy\n'), ((9336, 9357), 'copy.copy', 'copy', (['train_predicted'], {}), '(train_predicted)\n', (9340, 9357), False, 'from copy import copy\n'), ((9384, 9404), 'numpy.array', 'np.array', (['all_... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-01-19 16:18
from __future__ import unicode_literals
import db.deletion
from django.conf import settings
from django.db import migrations, models
import share.models.core
class Migration(migrations.Migration):
dependencies = [
('share', '0017_me... | [
"django.db.models.AutoField",
"django.db.models.BinaryField"
] | [((462, 555), '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", (478, 555), False, 'from django.db import migrations, models\... |
# Generated by Django 3.1.5 on 2021-06-06 13:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rotator', '0025_remove_cropinteraction_is_positive'),
]
operations = [
migrations.AlterField(
model_name='cropinteraction',
... | [
"django.db.models.PositiveSmallIntegerField"
] | [((374, 634), 'django.db.models.PositiveSmallIntegerField', 'models.PositiveSmallIntegerField', ([], {'choices': "[(0, 'Współrzędne'), (1, 'Allelopatyczne'), (2, 'Następcze'), (3,\n 'W drugim roku'), (4, 'W trzecim roku'), (5, 'W dwóch kolejnych latach'\n ), (6, 'W kolejnym roku'), (7, 'W drugim i drzecim roku')]... |
#!/usr/local/bin/python3
#coding: utf-8
import sys
import ip_address_tool
from cmd import Cmd
class ip_tool_class(Cmd):
def __init__(self):
Cmd.__init__(self)
self.iat = ip_address_tool.IpAddressTool()
self.prompt = "> "
def default(self,line):
if self.iat.is_valid_ip(line):
... | [
"sys.stdout.write",
"cmd.Cmd.__init__",
"ip_address_tool.IpAddressTool"
] | [((153, 171), 'cmd.Cmd.__init__', 'Cmd.__init__', (['self'], {}), '(self)\n', (165, 171), False, 'from cmd import Cmd\n'), ((191, 222), 'ip_address_tool.IpAddressTool', 'ip_address_tool.IpAddressTool', ([], {}), '()\n', (220, 222), False, 'import ip_address_tool\n'), ((643, 674), 'ip_address_tool.IpAddressTool', 'ip_ad... |
# Checks mouse position on windows
import pyautogui as pa
import time
while True:
try:
pa.moveTo(2563, 171, duration=.25)
pa.click()
pa.moveRel(10, 0, duration=.25)
for i in range(12):
pa.moveRel(0, 50, duration=0.5)
time.sleep(3)
time.sleep(8)
except KeyboardInte... | [
"pyautogui.moveRel",
"pyautogui.moveTo",
"time.sleep",
"pyautogui.click"
] | [((98, 133), 'pyautogui.moveTo', 'pa.moveTo', (['(2563)', '(171)'], {'duration': '(0.25)'}), '(2563, 171, duration=0.25)\n', (107, 133), True, 'import pyautogui as pa\n'), ((139, 149), 'pyautogui.click', 'pa.click', ([], {}), '()\n', (147, 149), True, 'import pyautogui as pa\n'), ((156, 188), 'pyautogui.moveRel', 'pa.m... |
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('README.md', 'r') as rf:
README = rf.read()
install_requirements = [
# General utilities
'boto3==1.16.9',
'filetype==1.0.7',
]
setup(
name='yas3',
version='1.0',
description='Yet another simple S3 management too... | [
"setuptools.find_packages"
] | [((591, 623), 'setuptools.find_packages', 'find_packages', ([], {'exclude': '"""example"""'}), "(exclude='example')\n", (604, 623), False, 'from setuptools import setup, find_packages\n')] |
import os
from itertools import chain
import time
import numpy as np
from cffi import FFI
# The datatype that we use for computation. We always convert the given data
# to a double array to make sure we have enough bits for precise computation.
_double = np.dtype('d')
_ffi = FFI()
_ffi.cdef(r"""
void train(cons... | [
"itertools.chain",
"numpy.random.rand",
"cffi.FFI",
"numpy.exp",
"os.path.dirname",
"numpy.array",
"numpy.dtype",
"time.time"
] | [((257, 270), 'numpy.dtype', 'np.dtype', (['"""d"""'], {}), "('d')\n", (265, 270), True, 'import numpy as np\n'), ((280, 285), 'cffi.FFI', 'FFI', ([], {}), '()\n', (283, 285), False, 'from cffi import FFI\n'), ((2042, 2077), 'numpy.array', 'np.array', (['a_noise'], {'dtype': 'np.float64'}), '(a_noise, dtype=np.float64)... |
import logging
import os
import re
logger = logging.getLogger(__name__)
r_docker = re.compile("\d+:[\w=]+:/docker(-[ce]e)?/\w+")
def is_docker_cgroup():
pid = os.getpid()
cgroup_path = os.path.join("/proc/", str(pid), "/cgroup")
if not os.path.isfile(cgroup_path):
return False
with open(p... | [
"logging.getLogger",
"os.path.isfile",
"os.getpid",
"re.compile"
] | [((46, 73), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (63, 73), False, 'import logging\n'), ((87, 135), 're.compile', 're.compile', (['"""\\\\d+:[\\\\w=]+:/docker(-[ce]e)?/\\\\w+"""'], {}), "('\\\\d+:[\\\\w=]+:/docker(-[ce]e)?/\\\\w+')\n", (97, 135), False, 'import re\n'), ((169, 180... |
# SPDX-License-Identifier: Apache-2.0
# Copyright 2020 igo95862
# 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 ... | [
"time.sleep",
"notcurses.Notcurses"
] | [((666, 677), 'notcurses.Notcurses', 'Notcurses', ([], {}), '()\n', (675, 677), False, 'from notcurses import Notcurses\n'), ((1039, 1047), 'time.sleep', 'sleep', (['(5)'], {}), '(5)\n', (1044, 1047), False, 'from time import sleep\n')] |
import os
def delete_old_logs():
log_path = "logs"
error = False
for root, dirs, files in os.walk(log_path):
for file in files:
path = os.path.join(root, file)
try:
os.remove(path)
except Exception as e:
... | [
"os.path.join",
"os.walk",
"os.remove"
] | [((116, 133), 'os.walk', 'os.walk', (['log_path'], {}), '(log_path)\n', (123, 133), False, 'import os\n'), ((189, 213), 'os.path.join', 'os.path.join', (['root', 'file'], {}), '(root, file)\n', (201, 213), False, 'import os\n'), ((255, 270), 'os.remove', 'os.remove', (['path'], {}), '(path)\n', (264, 270), False, 'impo... |
import re
import string
from collections import defaultdict
import numpy as np
from nltk.corpus import stopwords
from nltk.stem import PorterStemmer
from nltk.tokenize import TweetTokenizer
from scipy import linalg
def process_tweet(tweet):
"""Process tweet function.
Input:
tweet: a string containing... | [
"scipy.linalg.eigh",
"nltk.tokenize.TweetTokenizer",
"nltk.corpus.stopwords.words",
"nltk.stem.PorterStemmer",
"numpy.squeeze",
"numpy.argsort",
"numpy.exp",
"numpy.zeros",
"numpy.dot",
"collections.defaultdict",
"numpy.array",
"re.sub",
"numpy.cov"
] | [((433, 448), 'nltk.stem.PorterStemmer', 'PorterStemmer', ([], {}), '()\n', (446, 448), False, 'from nltk.stem import PorterStemmer\n'), ((473, 499), 'nltk.corpus.stopwords.words', 'stopwords.words', (['"""english"""'], {}), "('english')\n", (488, 499), False, 'from nltk.corpus import stopwords\n'), ((555, 583), 're.su... |
from sqlalchemy.orm.exc import NoResultFound
from db.core.basedao import BaseDao
import logging
from db.core.history.historyset import HistorySet
logger = logging.getLogger('console')
class HistorySetDao(BaseDao):
'''
classdocs
'''
@classmethod
def getHistorySet(self, historySetId, session = No... | [
"logging.getLogger"
] | [((158, 186), 'logging.getLogger', 'logging.getLogger', (['"""console"""'], {}), "('console')\n", (175, 186), False, 'import logging\n')] |
import json
import os
import unittest
import uuid
import boto3
from helper import config
class ConfigDefaultTests(unittest.TestCase):
def setUp(self):
self.config = config.Config()
def test_application(self):
self.assertDictEqual(self.config.application, config.APPLICATION)
def test_d... | [
"helper.config.Config",
"json.dumps",
"boto3.client",
"uuid.uuid4"
] | [((182, 197), 'helper.config.Config', 'config.Config', ([], {}), '()\n', (195, 197), False, 'from helper import config\n'), ((974, 1032), 'boto3.client', 'boto3.client', (['"""s3"""'], {'endpoint_url': "os.environ['S3_ENDPOINT']"}), "('s3', endpoint_url=os.environ['S3_ENDPOINT'])\n", (986, 1032), False, 'import boto3\n... |
import os
import time
from celery.utils.collections import OrderedDict
from django.template import loader
from contents.models import ContentCategory
from goods.models import GoodsChannel
from meiduo_mall import settings
from meiduo_mall.settings import dev
def generate_static_index_html():
"""生成静态的首页"""
pri... | [
"time.ctime",
"os.path.join",
"goods.models.GoodsChannel.objects.order_by",
"contents.models.ContentCategory.objects.all",
"celery.utils.collections.OrderedDict",
"django.template.loader.get_template"
] | [((501, 530), 'contents.models.ContentCategory.objects.all', 'ContentCategory.objects.all', ([], {}), '()\n', (528, 530), False, 'from contents.models import ContentCategory\n'), ((836, 869), 'django.template.loader.get_template', 'loader.get_template', (['"""index.html"""'], {}), "('index.html')\n", (855, 869), False,... |
# Generated by Django 3.1.2 on 2020-10-12 20:33
import ckeditor.fields
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Categ... | [
"django.db.models.ManyToManyField",
"django.db.models.DateTimeField",
"django.db.migrations.AlterModelOptions",
"django.db.models.AutoField",
"django.db.models.ImageField",
"django.db.models.CharField"
] | [((889, 974), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', ([], {'name': '"""post"""', 'options': "{'ordering': ('-publicado',)}"}), "(name='post', options={'ordering': ('-publicado',)}\n )\n", (917, 974), False, 'from django.db import migrations, models\n'), ((1113, 1148), 'django.db.mo... |
# This file is part of the P3IV Simulator (https://github.com/fzi-forschungszentrum-informatik/P3IV),
# copyright by FZI Forschungszentrum Informatik, licensed under the BSD-3 license (see LICENSE file in main directory)
import unittest
import numpy as np
import matplotlib.pyplot as plt
import logging
from p3iv_utils_... | [
"logging.getLogger",
"logging.basicConfig",
"numpy.random.rand",
"numpy.asarray",
"numpy.array",
"numpy.linspace",
"numpy.sum",
"unittest.main",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((366, 385), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (383, 385), False, 'import logging\n'), ((476, 490), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (488, 490), True, 'import matplotlib.pyplot as plt\n'), ((586, 596), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (594... |
# Test script to check everything works.
import os
import sys
import pcraster
import pcraster.moc
dataPath = "../../Mldd/demo"
pcraster.setclone(os.path.join(dataPath, "DemIn"))
timeIncrement = 10
nrParticles = 5
raster = pcraster.readmap(os.path.join(dataPath, "DemIn"))
initialConcentration = (raster / raster) + 2... | [
"pcraster.report",
"os.path.join",
"pcraster.clone"
] | [((1025, 1076), 'pcraster.report', 'pcraster.report', (['concentration', '"""concentration.map"""'], {}), "(concentration, 'concentration.map')\n", (1040, 1076), False, 'import pcraster\n'), ((148, 179), 'os.path.join', 'os.path.join', (['dataPath', '"""DemIn"""'], {}), "(dataPath, 'DemIn')\n", (160, 179), False, 'impo... |
#-----------------------------------------------------------------------------
# Copyright (c) 2014, <NAME>
# All rights reserved.
#
# Distributed under the terms of the BSD 3-Clause ("BSD New") license.
#
# The full license is in the LICENSE file, distributed with this software.
#--------------------------------------... | [
"numpy.log2",
"numpy.zeros",
"numpy.asarray",
"numpy.empty"
] | [((943, 956), 'numpy.asarray', 'np.asarray', (['x'], {}), '(x)\n', (953, 956), True, 'import numpy as np\n'), ((1137, 1163), 'numpy.zeros', 'np.zeros', (['upshape', 'x.dtype'], {}), '(upshape, x.dtype)\n', (1145, 1163), True, 'import numpy as np\n'), ((1413, 1426), 'numpy.asarray', 'np.asarray', (['x'], {}), '(x)\n', (... |
#!/usr/bin/env python
import argparse
import datetime
import os
import pathlib
import posixpath
import re
import subprocess
import tarfile
import time
import sys
import shutil
import glob
from collections import defaultdict
import utilities.log_util as ut_log
import utilities.s3_util as s3u
import boto3
from boto3.s... | [
"posixpath.join",
"boto3.client",
"boto3.s3.transfer.TransferConfig",
"argparse.ArgumentParser",
"re.compile",
"pathlib.Path",
"os.environ.get",
"os.path.join",
"time.sleep",
"shutil.rmtree",
"utilities.s3_util.get_files",
"argparse.Namespace",
"os.path.basename",
"sys.exit",
"utilities.... | [((398, 475), 'argparse.Namespace', 'argparse.Namespace', ([], {'vcpus': '(16)', 'memory': '(64000)', 'storage': '(500)', 'ecr_image': '"""velocyto"""'}), "(vcpus=16, memory=64000, storage=500, ecr_image='velocyto')\n", (416, 475), False, 'import argparse\n'), ((1791, 1903), 'utilities.log_util.log_command', 'ut_log.lo... |
import unicodedata
import datetime
import os
import json
from os import listdir
import pandas as pd
import dateutil.parser
import metadata_funs
import xlrd
import datetime
from os.path import isfile, join
import ntpath
import uuid
import re
def read_data_dictionary():
ex_data_path = os.path.join(os.getcwd(),'meta... | [
"re.compile",
"os.getcwd",
"metadata_funs.get_hash",
"pandas.ExcelFile",
"unicodedata.normalize",
"pandas.read_excel",
"pandas.concat"
] | [((1583, 1614), 're.compile', 're.compile', (['"""([^\\\\sa-zA-Z]|_)+"""'], {}), "('([^\\\\sa-zA-Z]|_)+')\n", (1593, 1614), False, 'import re\n'), ((390, 416), 'pandas.ExcelFile', 'pd.ExcelFile', (['ex_data_path'], {}), '(ex_data_path)\n', (402, 416), True, 'import pandas as pd\n'), ((439, 483), 'pandas.read_excel', 'p... |
#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
""" Simple 1 input mixer node. This takes the input of M channels, and produces
an output of N channels, using simple matrix mulitplication.
"""
import labgraph as lg
import numpy as np
from ...messages.generic_signal_sample import Sig... | [
"numpy.dot",
"labgraph.publisher",
"labgraph.util.LabgraphError",
"labgraph.Topic",
"labgraph.subscriber"
] | [((514, 543), 'labgraph.Topic', 'lg.Topic', (['SignalSampleMessage'], {}), '(SignalSampleMessage)\n', (522, 543), True, 'import labgraph as lg\n'), ((567, 596), 'labgraph.Topic', 'lg.Topic', (['SignalSampleMessage'], {}), '(SignalSampleMessage)\n', (575, 596), True, 'import labgraph as lg\n'), ((603, 633), 'labgraph.su... |
# -*- coding: utf-8 -*-
"""This is import function scripts."""
import json
def make_json(diffs) -> str:
"""Form an intermediate json representation.
Args:
diffs: String.
Returns:
json_output(str): Json output
"""
formatted_dict = dict_formatting(diffs)
json_output: str = j... | [
"json.dumps"
] | [((319, 371), 'json.dumps', 'json.dumps', (['formatted_dict'], {'sort_keys': '(True)', 'indent': '(4)'}), '(formatted_dict, sort_keys=True, indent=4)\n', (329, 371), False, 'import json\n')] |
# -*- coding: utf-8 -*-
###############################################################################
###############################################################################
## ##
## _ ___ ___ ___ ___ ___ ... | [
"source.rotate.diurnal_dot",
"numpy.cross",
"source.rotate.nutation",
"numpy.array",
"numpy.zeros",
"source.rotate.precession",
"source.rotate.diurnal",
"numpy.linalg.norm",
"source.rotate.polewander"
] | [((2580, 2591), 'numpy.zeros', 'np.zeros', (['(3)'], {}), '(3)\n', (2588, 2591), True, 'import numpy as np\n'), ((3388, 3408), 'source.rotate.precession', 'rotate.precession', (['t'], {}), '(t)\n', (3405, 3408), False, 'from source import rotate\n'), ((3443, 3461), 'source.rotate.nutation', 'rotate.nutation', (['t'], {... |
# Original code from: https://github.com/isayev/ReLeaSE
import numpy as np
import torch
from irelease.utils import read_smi_file, tokenize, read_object_property_file, seq2tensor, pad_sequences
class GeneratorData(object):
def __init__(self, training_data_path, tokens=None, start_token='<',
end... | [
"irelease.utils.pad_sequences",
"irelease.utils.seq2tensor",
"irelease.utils.read_smi_file",
"irelease.utils.tokenize",
"numpy.random.randint",
"torch.cuda.is_available",
"torch.tensor",
"numpy.random.seed",
"irelease.utils.read_object_property_file"
] | [((2305, 2360), 'irelease.utils.read_object_property_file', 'read_object_property_file', (['training_data_path'], {}), '(training_data_path, **kwargs)\n', (2330, 2360), False, 'from irelease.utils import read_smi_file, tokenize, read_object_property_file, seq2tensor, pad_sequences\n'), ((2777, 2804), 'irelease.utils.to... |
from book import views
from django.urls import path
app_name = 'book'
urlpatterns = [
path('rent-book/create/', views.CreateBookRentView.as_view(), name='rent-create'),
path('book/list/', views.BookList.as_view(), name='book-list'),
path('search/', views.SearchBook.as_view(), name='search'),
path('r... | [
"book.views.SearchBook.as_view",
"book.views.BookList.as_view",
"book.views.CreateBookRentView.as_view",
"book.views.BookRentTableBillingView.as_view",
"book.views.BookRentTableView.as_view"
] | [((120, 154), 'book.views.CreateBookRentView.as_view', 'views.CreateBookRentView.as_view', ([], {}), '()\n', (152, 154), False, 'from book import views\n'), ((200, 224), 'book.views.BookList.as_view', 'views.BookList.as_view', ([], {}), '()\n', (222, 224), False, 'from book import views\n'), ((265, 291), 'book.views.Se... |
#!/usr/local/bin/python3
import os
import shutil
while not os.getcwd().lower().endswith("stasbar-app"):
os.chdir("..")
os.chdir("frontend")
subprocess.call(['npm', 'run', 'build'])
os.chdir("..")
shutil.rmtree("backend/src/main/resources/assets/static/js")
os.system("cp -rf frontend/build/ backend/src/main/resourc... | [
"os.chdir",
"os.system",
"os.getcwd",
"shutil.rmtree"
] | [((124, 144), 'os.chdir', 'os.chdir', (['"""frontend"""'], {}), "('frontend')\n", (132, 144), False, 'import os\n'), ((186, 200), 'os.chdir', 'os.chdir', (['""".."""'], {}), "('..')\n", (194, 200), False, 'import os\n'), ((201, 261), 'shutil.rmtree', 'shutil.rmtree', (['"""backend/src/main/resources/assets/static/js"""... |
"""
file: rectangular_solid_angle_calculator.py
brief: Calculator for solid angle of a rectangular solid at a given distance in centimeters.
author: <NAME>
date: July 30, 2016
"""
import math
def calc_percent_four_pi(omega):
"""
Calculate the solid angle as a percentage of a sphere
:param omega: The solid... | [
"math.sqrt",
"argparse.ArgumentParser"
] | [((1825, 1891), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""Rectangular solid angle calculations"""'}), "(description='Rectangular solid angle calculations')\n", (1839, 1891), False, 'from argparse import ArgumentParser\n'), ((1706, 1740), 'math.sqrt', 'math.sqrt', (['(numerator / denominator)... |
from config.addr_type import AddrType
from config.yaml_conf_parser import YamlConfParser
from exception.configuration import ConfigurationException
from model.baking_conf import FOUNDERS_MAP, OWNERS_MAP, BAKING_ADDRESS, SUPPORTERS_SET, EXCLUDED_DELEGATORS_SET, \
PYMNT_SCALE, PRCNT_SCALE, SERVICE_FEE, FULL_SUPPORTER... | [
"util.address_validator.AddressValidator",
"util.fee_validator.FeeValidator",
"exception.configuration.ConfigurationException",
"tzscan.tzscan_block_api.TzScanBlockApiImpl"
] | [((871, 905), 'tzscan.tzscan_block_api.TzScanBlockApiImpl', 'TzScanBlockApiImpl', (['network_config'], {}), '(network_config)\n', (889, 905), False, 'from tzscan.tzscan_block_api import TzScanBlockApiImpl\n'), ((2570, 2596), 'util.address_validator.AddressValidator', 'AddressValidator', (['map_name'], {}), '(map_name)\... |