code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# -*- coding: utf-8 -*-
# Copyright (C) 2005-2013 Mag. <NAME>. All rights reserved
# Glasauergasse 32, A--1130 Wien, Austria. <EMAIL>
# ****************************************************************************
#
# This module is licensed under the terms of the BSD 3-Clause License
# <http://www.c-tanzer.at/license/b... | [
"_TFL.TFL._Export"
] | [((1871, 1887), '_TFL.TFL._Export', 'TFL._Export', (['"""*"""'], {}), "('*')\n", (1882, 1887), False, 'from _TFL import TFL\n')] |
from NJ_tree_analysis_functions import start_gui_explorer
# nov v omegaCen?
objs = [
140305003201095, 140305003201103, 140305003201185, 140307002601128, 140307002601147, 140311006101253,
140314005201008, 140608002501266, 150211004701104, 150428002601118, 150703002101192
]
# nov v NGC6774
objs = [
14070700... | [
"NJ_tree_analysis_functions.start_gui_explorer"
] | [((1358, 1458), 'NJ_tree_analysis_functions.start_gui_explorer', 'start_gui_explorer', (['objs'], {'manual': '(True)', 'initial_only': '(False)', 'loose': '(True)', 'kinematics_source': '"""ucac5"""'}), "(objs, manual=True, initial_only=False, loose=True,\n kinematics_source='ucac5')\n", (1376, 1458), False, 'from N... |
import os
import asyncio
import discord
from discord.ext import commands
# Try to get the bot token from file, quit if it fails
try:
with open('token') as file:
token = file.readline()
except IOError:
print("Missing token file containing the bot's token")
quit()
# Create config and cog folders if... | [
"os.makedirs",
"os.path.exists",
"os.listdir",
"discord.Intents.all"
] | [((743, 763), 'os.listdir', 'os.listdir', (['"""./cogs"""'], {}), "('./cogs')\n", (753, 763), False, 'import os\n'), ((345, 372), 'os.path.exists', 'os.path.exists', (['"""./config/"""'], {}), "('./config/')\n", (359, 372), False, 'import os\n'), ((378, 402), 'os.makedirs', 'os.makedirs', (['"""./config/"""'], {}), "('... |
import hazel
import glob
import os
def test_file_generators():
tmp = hazel.tools.File_observation(mode='single')
tmp.set_size(n_lambda=128, n_pixel=1)
tmp.save('test')
tmp = hazel.tools.File_observation(mode='multi')
tmp.set_size(n_lambda=128, n_pixel=10)
tmp.save('test2')
tmp = hazel.to... | [
"hazel.tools.File_chromosphere",
"os.remove",
"hazel.tools.File_observation",
"glob.glob",
"hazel.tools.File_photosphere"
] | [((75, 118), 'hazel.tools.File_observation', 'hazel.tools.File_observation', ([], {'mode': '"""single"""'}), "(mode='single')\n", (103, 118), False, 'import hazel\n'), ((193, 235), 'hazel.tools.File_observation', 'hazel.tools.File_observation', ([], {'mode': '"""multi"""'}), "(mode='multi')\n", (221, 235), False, 'impo... |
import osmnx as ox
import networkx as nx
ox.config(use_cache=True, log_console=False)
graph = ox.graph_from_address('953 Danby Rd, Ithaca, New York', network_type='walk')
fig, ax = ox.plot_graph(graph) | [
"osmnx.graph_from_address",
"osmnx.config",
"osmnx.plot_graph"
] | [((42, 86), 'osmnx.config', 'ox.config', ([], {'use_cache': '(True)', 'log_console': '(False)'}), '(use_cache=True, log_console=False)\n', (51, 86), True, 'import osmnx as ox\n'), ((96, 172), 'osmnx.graph_from_address', 'ox.graph_from_address', (['"""953 Danby Rd, Ithaca, New York"""'], {'network_type': '"""walk"""'}),... |
import pyspark
import pyspark.sql.functions as f
from airtunnel import PySparkDataAsset, PySparkDataAssetIO
def rebuild_for_store(asset: PySparkDataAsset, airflow_context):
spark_session = pyspark.sql.SparkSession.builder.getOrCreate()
student = PySparkDataAsset(name="student_pyspark")
programme = PySpa... | [
"airtunnel.PySparkDataAsset",
"airtunnel.PySparkDataAssetIO.write_data_asset",
"pyspark.sql.functions.count",
"pyspark.sql.SparkSession.builder.getOrCreate"
] | [((196, 242), 'pyspark.sql.SparkSession.builder.getOrCreate', 'pyspark.sql.SparkSession.builder.getOrCreate', ([], {}), '()\n', (240, 242), False, 'import pyspark\n'), ((258, 298), 'airtunnel.PySparkDataAsset', 'PySparkDataAsset', ([], {'name': '"""student_pyspark"""'}), "(name='student_pyspark')\n", (274, 298), False,... |
import cv2
import numpy as np
import math
# Func to cal eucledian dist b/w 2 pts:
def euc_dst(x1, y1, x2, y2):
pt_a = (x1 - x2)**2
pt_b = (y1 - y2)**2
return math.sqrt(pt_a + pt_b)
cap = cv2.VideoCapture(0)
while(True):
ret, frame = cap.read()
gray = cv2.cvtColor(frame, cv2.CO... | [
"cv2.line",
"cv2.HoughCircles",
"cv2.circle",
"math.sqrt",
"cv2.medianBlur",
"cv2.cvtColor",
"cv2.waitKey",
"cv2.imshow",
"cv2.VideoCapture",
"numpy.around",
"cv2.destroyAllWindows"
] | [((217, 236), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (233, 236), False, 'import cv2\n'), ((1899, 1922), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (1920, 1922), False, 'import cv2\n'), ((183, 205), 'math.sqrt', 'math.sqrt', (['(pt_a + pt_b)'], {}), '(pt_a + pt_b)\n', (1... |
from scripts.utils.helpful_scripts import get_account, LOCAL_BLOCKCHAIN_ENVIRONMENTS
from scripts.simple_collectible.deploy_and_create import deploy_and_create
from brownie import network
import pytest
def network_checker():
if network.show_active() not in LOCAL_BLOCKCHAIN_ENVIRONMENTS:
pytest.skip()
de... | [
"scripts.utils.helpful_scripts.get_account",
"scripts.simple_collectible.deploy_and_create.deploy_and_create",
"pytest.skip",
"brownie.network.show_active"
] | [((408, 427), 'scripts.simple_collectible.deploy_and_create.deploy_and_create', 'deploy_and_create', ([], {}), '()\n', (425, 427), False, 'from scripts.simple_collectible.deploy_and_create import deploy_and_create\n'), ((234, 255), 'brownie.network.show_active', 'network.show_active', ([], {}), '()\n', (253, 255), Fals... |
#!/usr/bin/env python
def simple():
from TestComponents import ComplexFacility
return ComplexFacility()
# End of file
| [
"TestComponents.ComplexFacility"
] | [((96, 113), 'TestComponents.ComplexFacility', 'ComplexFacility', ([], {}), '()\n', (111, 113), False, 'from TestComponents import ComplexFacility\n')] |
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
"""
Created on : Mon Jun 4 23:17:56 2018
@author : Sourabh
"""
# %%
import numpy as np
import pandas as pd
from sklearn.preprocessing import StandardScaler
from sklearn.svm import SVR
import matplotlib.pyplot as plt
# ============================================... | [
"matplotlib.pyplot.title",
"sklearn.svm.SVR",
"numpy.set_printoptions",
"sklearn.preprocessing.StandardScaler",
"matplotlib.pyplot.show",
"pandas.read_csv",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.legend",
"numpy.array",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((356, 393), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'threshold': 'np.nan'}), '(threshold=np.nan)\n', (375, 393), True, 'import numpy as np\n'), ((643, 665), 'pandas.read_csv', 'pd.read_csv', (['Data_File'], {}), '(Data_File)\n', (654, 665), True, 'import pandas as pd\n'), ((864, 880), 'sklearn.preproce... |
from django.contrib import admin
from .models import Car
@admin.register(Car)
class CarAdmin(admin.ModelAdmin):
list_display = ['name', 'updated', 'user']
| [
"django.contrib.admin.register"
] | [((60, 79), 'django.contrib.admin.register', 'admin.register', (['Car'], {}), '(Car)\n', (74, 79), False, 'from django.contrib import admin\n')] |
import pytest
from django_dynamic_fixture import G
from silver.models import Transaction, Proforma, Invoice, Customer
from silver import payment_processors
from silver_instamojo.models import InstamojoPaymentMethod
@pytest.fixture
def customer():
return G(Customer, currency='RON', address_1='9', address_2='9',
... | [
"silver.payment_processors.get_instance",
"django_dynamic_fixture.G"
] | [((261, 338), 'django_dynamic_fixture.G', 'G', (['Customer'], {'currency': '"""RON"""', 'address_1': '"""9"""', 'address_2': '"""9"""', 'sales_tax_number': '(0)'}), "(Customer, currency='RON', address_1='9', address_2='9', sales_tax_number=0)\n", (262, 338), False, 'from django_dynamic_fixture import G\n'), ((406, 457)... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | [
"pulumi.get",
"pulumi.getter",
"pulumi.set"
] | [((1946, 1979), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""principalId"""'}), "(name='principalId')\n", (1959, 1979), False, 'import pulumi\n'), ((2381, 2419), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""roleDefinitionId"""'}), "(name='roleDefinitionId')\n", (2394, 2419), False, 'import pulumi\n'), ((2... |
# -*- coding: utf-8 -*-
# @File : api.py
# @Date : 2021/2/25
# @Desc :
import random
import string
def get_random_str(len):
value = ''.join(random.sample(string.ascii_letters + string.digits, len))
return value
def data_return(code=500, data=None,
msg_zh="服务器发生错误,请检查服务器",
... | [
"random.sample"
] | [((149, 205), 'random.sample', 'random.sample', (['(string.ascii_letters + string.digits)', 'len'], {}), '(string.ascii_letters + string.digits, len)\n', (162, 205), False, 'import random\n')] |
from pathlib import Path
from .config import Config
from .command import get_command, command_exist
def is_command_disabled(channel: str, cmd: str):
if channel in cfg_disabled_commands.data:
if command_exist(cmd):
cmd = get_command(cmd).fullname
return cmd in cfg_disabled_commands[ch... | [
"pathlib.Path"
] | [((1061, 1102), 'pathlib.Path', 'Path', (['"""configs"""', '"""disabled_commands.json"""'], {}), "('configs', 'disabled_commands.json')\n", (1065, 1102), False, 'from pathlib import Path\n')] |
#!/usr/bin/env python3
help_str = """
roll is a tool for computing die rolls
Pass any number of arguments of the form
<number>d<number>
The first number refers to the number of dice to roll;
The second refers to the number of sides on the die.
For example, to roll 5, 6-sided dice, pass '5d6'.
It also computes rolls... | [
"random.random",
"sys.exit",
"re.compile"
] | [((2697, 2746), 're.compile', 're.compile', (['"""^([1-9][0-9]*)d([1-9][0-9]*)(a|d)?$"""'], {}), "('^([1-9][0-9]*)d([1-9][0-9]*)(a|d)?$')\n", (2707, 2746), False, 'import re\n'), ((2619, 2630), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (2627, 2630), False, 'import sys\n'), ((3037, 3048), 'sys.exit', 'sys.exit', (... |
"""
Utilities for working with command line strings and arguments
"""
import re
from typing import List, Dict, Optional
DOUBLE_QUOTED_GROUPS = re.compile(r"(\".+?\")")
DOUBLE_QUOTED_STRING = re.compile(r"^\".+\"?")
def argsplit(cmd: str) -> List[str]:
"""
Split a command line string on spaces into an argume... | [
"re.sub",
"re.compile"
] | [((145, 170), 're.compile', 're.compile', (['"""(\\\\".+?\\\\")"""'], {}), '(\'(\\\\".+?\\\\")\')\n', (155, 170), False, 'import re\n'), ((193, 217), 're.compile', 're.compile', (['"""^\\\\".+\\\\"?"""'], {}), '(\'^\\\\".+\\\\"?\')\n', (203, 217), False, 'import re\n'), ((1095, 1119), 're.sub', 're.sub', (['""" +"""', ... |
import unittest
from coldtype.pens.cairopen import CairoPen
from pathlib import Path
from coldtype.color import hsl
from coldtype.geometry import Rect
from coldtype.text.composer import StSt, Font
from coldtype.pens.datpen import DATPen, DATPens
from PIL import Image
import drawBot as db
import imagehash
import conte... | [
"unittest.main",
"coldtype.text.composer.Font.Cacheable",
"coldtype.color.hsl",
"coldtype.pens.cairopen.CairoPen.Composite",
"PIL.Image.open",
"coldtype.pens.datpen.DATPen",
"pathlib.Path",
"coldtype.geometry.Rect",
"coldtype.text.composer.StSt"
] | [((332, 381), 'coldtype.text.composer.Font.Cacheable', 'Font.Cacheable', (['"""assets/ColdtypeObviously-VF.ttf"""'], {}), "('assets/ColdtypeObviously-VF.ttf')\n", (346, 381), False, 'from coldtype.text.composer import StSt, Font\n'), ((393, 419), 'pathlib.Path', 'Path', (['"""test/renders/cairo"""'], {}), "('test/rende... |
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.decomposition import PCA, TruncatedSVD, FastICA
from sklearn.random_projection import GaussianRandomProjection, SparseRandomProjection
import abc
class ColumnBasedFeatureGenerationStrategyAbstract(BaseEstimator, TransformerMixin):
"""Provides ab... | [
"sklearn.decomposition.FastICA",
"sklearn.random_projection.GaussianRandomProjection",
"sklearn.decomposition.TruncatedSVD",
"sklearn.random_projection.SparseRandomProjection",
"sklearn.decomposition.PCA"
] | [((6255, 6299), 'sklearn.decomposition.PCA', 'PCA', ([], {'n_components': 'n_comps', 'random_state': '(1234)'}), '(n_components=n_comps, random_state=1234)\n', (6258, 6299), False, 'from sklearn.decomposition import PCA, TruncatedSVD, FastICA\n'), ((7042, 7095), 'sklearn.decomposition.TruncatedSVD', 'TruncatedSVD', ([]... |
# Imports modules
import argparse
import torch
from torchvision import transforms,datasets,models
from PIL import Image
import numpy as np
def get_input_args_train():
parser = argparse.ArgumentParser()
parser.add_argument('--data_dir', type = str, default = 'flowers',
help='data... | [
"argparse.ArgumentParser",
"torch.utils.data.DataLoader",
"torchvision.transforms.RandomHorizontalFlip",
"torchvision.transforms.RandomRotation",
"torchvision.transforms.Normalize",
"numpy.transpose",
"PIL.Image.open",
"torchvision.datasets.ImageFolder",
"numpy.array",
"torchvision.transforms.Cent... | [((188, 213), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (211, 213), False, 'import argparse\n'), ((1301, 1326), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1324, 1326), False, 'import argparse\n'), ((3097, 3156), 'torchvision.datasets.ImageFolder', 'datasets.Im... |
from pyjoystick.sdl2 import sdl2, Key, Joystick, ControllerEventLoop, get_mapping, set_mapping
if __name__ == '__main__':
import time
import argparse
devices = Joystick.get_joysticks()
print("Devices:", devices)
monitor = devices[0]
monitor_keytypes = [Key.AXIS]
for k, v in get_mapping(m... | [
"pyjoystick.sdl2.ControllerEventLoop",
"pyjoystick.sdl2.Joystick.get_joysticks",
"pyjoystick.sdl2.Key",
"pyjoystick.sdl2.get_mapping"
] | [((174, 198), 'pyjoystick.sdl2.Joystick.get_joysticks', 'Joystick.get_joysticks', ([], {}), '()\n', (196, 198), False, 'from pyjoystick.sdl2 import sdl2, Key, Joystick, ControllerEventLoop, get_mapping, set_mapping\n'), ((1183, 1241), 'pyjoystick.sdl2.ControllerEventLoop', 'ControllerEventLoop', (['print_add', 'print_r... |
import unittest
from fp.traindata_samplers import CompleteData
from fp.missingvalue_handlers import CompleteCaseAnalysis
from fp.scalers import NamedStandardScaler
from fp.learners import NonTunedLogisticRegression, NonTunedDecisionTree
from fp.pre_processors import NoPreProcessing
from fp.post_processors impor... | [
"unittest.main",
"fp.missingvalue_handlers.CompleteCaseAnalysis",
"fp.learners.NonTunedLogisticRegression",
"fp.scalers.NamedStandardScaler",
"fp.learners.NonTunedDecisionTree",
"fp.post_processors.NoPostProcessing",
"fp.pre_processors.NoPreProcessing",
"fp.traindata_samplers.CompleteData"
] | [((4582, 4597), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4595, 4597), False, 'import unittest\n'), ((892, 906), 'fp.traindata_samplers.CompleteData', 'CompleteData', ([], {}), '()\n', (904, 906), False, 'from fp.traindata_samplers import CompleteData\n'), ((945, 967), 'fp.missingvalue_handlers.CompleteCaseA... |
# -*- coding: utf-8 -*-
"""antimarkdown.handlers -- Element handlers for converting HTML Elements/subtrees to Markdown text.
"""
from collections import deque
from antimarkdown import nodes
def render(*domtrees):
if not domtrees:
return ''
root = nodes.Root()
for dom in domtrees:
build_r... | [
"antimarkdown.nodes.Root",
"collections.deque"
] | [((267, 279), 'antimarkdown.nodes.Root', 'nodes.Root', ([], {}), '()\n', (277, 279), False, 'from antimarkdown import nodes\n'), ((670, 686), 'collections.deque', 'deque', (['[domtree]'], {}), '([domtree])\n', (675, 686), False, 'from collections import deque\n')] |
"""
Fits PSPL model with parallax using EMCEE sampler.
"""
import os
import sys
import numpy as np
try:
import emcee
except ImportError as err:
print(err)
print("\nEMCEE could not be imported.")
print("Get it from: http://dfm.io/emcee/current/user/install/")
print("and re-run the script")
sys.e... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.xlim",
"MulensModel.MulensData",
"MulensModel.Model",
"matplotlib.pyplot.show",
"numpy.random.randn",
"emcee.EnsembleSampler",
"matplotlib.pyplot.legend",
"numpy.isfinite",
"numpy.isnan",
"numpy.percentile",
"matplotlib.pyplot.figure",
"sys.exit"... | [((1306, 1396), 'os.path.join', 'os.path.join', (['mm.DATA_PATH', '"""photometry_files"""', '"""OB05086"""', '"""starBLG234.6.I.218982.dat"""'], {}), "(mm.DATA_PATH, 'photometry_files', 'OB05086',\n 'starBLG234.6.I.218982.dat')\n", (1318, 1396), False, 'import os\n'), ((1412, 1464), 'MulensModel.MulensData', 'mm.Mul... |
import errno
import mimetypes
from datetime import datetime
import os
import six
from passlib.apps import django10_context as pwd_context
try:
import ujson as json
except:
import json as json
def mkdir(path):
try:
os.makedirs(path)
except OSError as exc:
if exc.errno == errno.EEXIST ... | [
"os.makedirs",
"json.loads",
"os.path.isdir",
"passlib.apps.django10_context.encrypt",
"json.dumps",
"passlib.apps.django10_context.verify",
"datetime.datetime.now",
"mimetypes.guess_type"
] | [((675, 691), 'json.dumps', 'json.dumps', (['data'], {}), '(data)\n', (685, 691), True, 'import json as json\n'), ((238, 255), 'os.makedirs', 'os.makedirs', (['path'], {}), '(path)\n', (249, 255), False, 'import os\n'), ((761, 777), 'json.loads', 'json.loads', (['data'], {}), '(data)\n', (771, 777), True, 'import json ... |
import board
import displayio
from adafruit_display_shapes.circle import Circle
import time
from pong_helpers import AutoPaddle, ManualBall
# width and height variables used to know where the bototm and right edge of the screen are.
SCREEN_WIDTH = 160
SCREEN_HEIGHT = 128
# FPS (Frames per second) setting, raise or l... | [
"displayio.Group",
"displayio.Bitmap",
"displayio.Palette",
"board.DISPLAY.show",
"displayio.TileGrid",
"pong_helpers.AutoPaddle",
"time.monotonic"
] | [((512, 540), 'displayio.Group', 'displayio.Group', ([], {'max_size': '(10)'}), '(max_size=10)\n', (527, 540), False, 'import displayio\n'), ((541, 567), 'board.DISPLAY.show', 'board.DISPLAY.show', (['splash'], {}), '(splash)\n', (559, 567), False, 'import board\n'), ((615, 663), 'displayio.Bitmap', 'displayio.Bitmap',... |
import numpy as np
import cv2
import heapq
import statistics
import math
def get_norm(t1 , t2):
(xa, ya, za) = t1
(xb, yb, zb) = t2
return math.sqrt((xa-xb)^2 + (ya-yb)^2 + (za-zb)^2)
def popularity(image,k):
(m,n,_) = image.shape
d = {}
for i in range(m):
for j in range(n):
... | [
"math.sqrt",
"cv2.waitKey",
"cv2.destroyAllWindows",
"cv2.imwrite",
"numpy.asarray",
"heapq.nlargest",
"cv2.imread",
"cv2.imshow"
] | [((1057, 1080), 'cv2.imread', 'cv2.imread', (['"""test1.png"""'], {}), "('test1.png')\n", (1067, 1080), False, 'import cv2\n'), ((1121, 1160), 'cv2.imshow', 'cv2.imshow', (['"""Popularity Cut image"""', 'img'], {}), "('Popularity Cut image', img)\n", (1131, 1160), False, 'import cv2\n'), ((1160, 1173), 'cv2.waitKey', '... |
import boto3
import csv
import logging
import io
import os
import requests
import scrapy
from datetime import date, datetime, timedelta
from jailscraper import app_config, utils
from jailscraper.models import InmatePage
# Quiet down, Boto!
logging.getLogger('boto3').setLevel(logging.CRITICAL)
logging.getLogger('botoc... | [
"io.StringIO",
"io.BytesIO",
"os.makedirs",
"scrapy.Request",
"csv.DictReader",
"jailscraper.models.InmatePage",
"datetime.date.today",
"datetime.datetime.strptime",
"boto3.resource",
"datetime.timedelta",
"requests.get",
"datetime.datetime.min.time",
"jailscraper.app_config.INMATE_URL_TEMPL... | [((423, 440), 'datetime.timedelta', 'timedelta', ([], {'days': '(1)'}), '(days=1)\n', (432, 440), False, 'from datetime import date, datetime, timedelta\n'), ((242, 268), 'logging.getLogger', 'logging.getLogger', (['"""boto3"""'], {}), "('boto3')\n", (259, 268), False, 'import logging\n'), ((296, 325), 'logging.getLogg... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import numpy as np
import os
import tensorflow as tf
import zipfile as zp
import subprocess
import glob
import json
from PIL import Image
from collections import OrderedDict
import shutil
import ... | [
"csv.reader",
"argparse.ArgumentParser",
"numpy.empty",
"os.walk",
"numpy.shape",
"sys.stdout.flush",
"glob.glob",
"os.path.join",
"os.path.abspath",
"os.path.dirname",
"numpy.transpose",
"os.path.exists",
"json.dump",
"os.chmod",
"os.stat",
"os.path.basename",
"subprocess.call",
"... | [((532, 550), 'sys.stdout.flush', 'sys.stdout.flush', ([], {}), '()\n', (548, 550), False, 'import sys\n'), ((697, 744), 'os.path.join', 'os.path.join', (['snpe_root', '"""benchmarks"""', 'dlc_path'], {}), "(snpe_root, 'benchmarks', dlc_path)\n", (709, 744), False, 'import os\n'), ((1193, 1213), 'subprocess.call', 'sub... |
#!/usr/bin/env python3
"""hybrid-analysis.com worker for the ACT platform
Copyright 2021 the ACT project <<EMAIL>>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all ... | [
"warnings.filterwarnings",
"act.workers.libs.worker.parseargs",
"functools.partialmethod",
"warnings.resetwarnings",
"act.workers.libs.worker.init_act",
"logging.info",
"traceback.format_exc",
"requests.get",
"requests.post"
] | [((1239, 1289), 'act.workers.libs.worker.parseargs', 'worker.parseargs', (['"""ACT hybrid-analysis.com Client"""'], {}), "('ACT hybrid-analysis.com Client')\n", (1255, 1289), False, 'from act.workers.libs import worker\n'), ((11795, 11816), 'act.workers.libs.worker.init_act', 'worker.init_act', (['args'], {}), '(args)\... |
from sss_beneficiarios_hospitales.data import DataBeneficiariosSSSHospital
def test_query_afiliado():
dbh = DataBeneficiariosSSSHospital(user='FAKE', password='<PASSWORD>')
res = dbh.query(dni='full-afiliado')
assert res['ok']
data = res['resultados']
assert data['title'] == "Superintendencia de S... | [
"sss_beneficiarios_hospitales.data.DataBeneficiariosSSSHospital"
] | [((114, 178), 'sss_beneficiarios_hospitales.data.DataBeneficiariosSSSHospital', 'DataBeneficiariosSSSHospital', ([], {'user': '"""FAKE"""', 'password': '"""<PASSWORD>"""'}), "(user='FAKE', password='<PASSWORD>')\n", (142, 178), False, 'from sss_beneficiarios_hospitales.data import DataBeneficiariosSSSHospital\n'), ((18... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: users/user.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _re... | [
"google.protobuf.symbol_database.Default",
"google.protobuf.descriptor.FieldDescriptor"
] | [((440, 466), 'google.protobuf.symbol_database.Default', '_symbol_database.Default', ([], {}), '()\n', (464, 466), True, 'from google.protobuf import symbol_database as _symbol_database\n'), ((1412, 1758), 'google.protobuf.descriptor.FieldDescriptor', '_descriptor.FieldDescriptor', ([], {'name': '"""originator"""', 'fu... |
import pandas as pd
file_romeo = open("./data/romeoandjuliet.csv", "r")
file_moby = open("./data/mobydick.csv", "r")
file_gatsby = open("./data/greatgatsby.csv", "r")
file_hamlet = open("./data/hamlet.csv", "r")
romeo = file_romeo.read()
moby = file_moby.read()
gatsby = file_gatsby.read()
hamlet = file_hamlet.read()... | [
"pandas.read_csv",
"pandas.merge",
"pandas.set_option"
] | [((382, 431), 'pandas.read_csv', 'pd.read_csv', (['"""./data/romeoandjuliet.csv"""'], {'sep': '""","""'}), "('./data/romeoandjuliet.csv', sep=',')\n", (393, 431), True, 'import pandas as pd\n'), ((460, 503), 'pandas.read_csv', 'pd.read_csv', (['"""./data/mobydick.csv"""'], {'sep': '""","""'}), "('./data/mobydick.csv', ... |
import connexion
from openapi_server.annotator.phi_types import PhiType
from openapi_server.get_annotations import get_annotations
from openapi_server.models.error import Error # noqa: E501
from openapi_server.models.text_location_annotation_request import TextLocationAnnotationRequest # noqa: E501
from openapi_serve... | [
"connexion.request.get_json",
"openapi_server.models.text_location_annotation_response.TextLocationAnnotationResponse",
"openapi_server.get_annotations.get_annotations"
] | [((1012, 1060), 'openapi_server.get_annotations.get_annotations', 'get_annotations', (['note'], {'phi_type': 'PhiType.LOCATION'}), '(note, phi_type=PhiType.LOCATION)\n', (1027, 1060), False, 'from openapi_server.get_annotations import get_annotations\n'), ((1097, 1140), 'openapi_server.models.text_location_annotation_r... |
#!/usr/bin/env python
"""
Southern California Earthquake Center Broadband Platform
Copyright 2010-2016 Southern California Earthquake Center
"""
from __future__ import division, print_function
# Import Python modules
import os
import sys
import shutil
import matplotlib as mpl
mpl.use('AGG', warn=False)
import pylab
im... | [
"pylab.close",
"numpy.sin",
"pylab.gcf",
"os.path.join",
"os.chdir",
"pylab.title",
"numpy.power",
"pylab.ylabel",
"pylab.xlabel",
"bband_utils.mkdirs",
"numpy.log10",
"pylab.legend",
"os.path.basename",
"pylab.grid",
"pylab.xscale",
"pylab.savefig",
"matplotlib.use",
"install_cfg.... | [((278, 304), 'matplotlib.use', 'mpl.use', (['"""AGG"""'], {'warn': '(False)'}), "('AGG', warn=False)\n", (285, 304), True, 'import matplotlib as mpl\n'), ((13765, 13810), 'pylab.title', 'pylab.title', (["('Station: %s' % station)"], {'size': '(12)'}), "('Station: %s' % station, size=12)\n", (13776, 13810), False, 'imp... |
""" module utils to method to files """
import logging
import hashlib
logger = logging.getLogger(__name__)
def write_file(path: str, source: str, mode="w") -> None:
""" write file in file system in unicode """
logger.debug("Gravando arquivo: %s", path)
with open(path, mode, encoding="utf-8") as f:
... | [
"hashlib.sha1",
"logging.getLogger"
] | [((81, 108), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (98, 108), False, 'import logging\n'), ((632, 646), 'hashlib.sha1', 'hashlib.sha1', ([], {}), '()\n', (644, 646), False, 'import hashlib\n')] |
import itertools as it
TEST1 = """
20
15
10
5
5
"""
INPUT = open('input17.txt').read()
# def count_ways(containers, total=150):
# ways = 0
# containers = sorted(containers, reverse=True)
# def count(containers, used, stack=0):
# print(containers, used, stack)
# for i in range(len(contai... | [
"itertools.combinations"
] | [((1133, 1163), 'itertools.combinations', 'it.combinations', (['containers', 'c'], {}), '(containers, c)\n', (1148, 1163), True, 'import itertools as it\n'), ((965, 995), 'itertools.combinations', 'it.combinations', (['containers', 'c'], {}), '(containers, c)\n', (980, 995), True, 'import itertools as it\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 23 21:14:48 2018
@author: ahmed
"""
# IMPORTATION
from pylab import *
#plt.style.use('dark_background')
#plt.style.use('ggplot')
import ephem as ep
# deux fonctions supplémentaires du module datetime sont nécessaires
from datetime import datetime ,... | [
"ephem.Observer",
"ephem.Mars",
"datetime.timedelta",
"datetime.datetime"
] | [((352, 365), 'ephem.Observer', 'ep.Observer', ([], {}), '()\n', (363, 365), True, 'import ephem as ep\n'), ((477, 486), 'ephem.Mars', 'ep.Mars', ([], {}), '()\n', (484, 486), True, 'import ephem as ep\n'), ((606, 626), 'datetime.datetime', 'datetime', (['(2018)', '(5)', '(1)'], {}), '(2018, 5, 1)\n', (614, 626), False... |
import os
import tempfile
import pytest
import subprocess
TEST_DIRECTORY = os.path.abspath(__file__+"/../")
DATA_DIRECTORY = os.path.join(TEST_DIRECTORY,"data")
GIT_TEST_REPOSITORY = DATA_DIRECTORY + "/test_repository/d3py.tar.gz"
| [
"os.path.abspath",
"os.path.join"
] | [((76, 110), 'os.path.abspath', 'os.path.abspath', (["(__file__ + '/../')"], {}), "(__file__ + '/../')\n", (91, 110), False, 'import os\n'), ((126, 162), 'os.path.join', 'os.path.join', (['TEST_DIRECTORY', '"""data"""'], {}), "(TEST_DIRECTORY, 'data')\n", (138, 162), False, 'import os\n')] |
import pygame
from pygame.sprite import Sprite
class BoyLife(Sprite):
def __init__(self):
"""Инициализирует графическое отображение жизней."""
super().__init__()
self.image = pygame.image.load('img/heart.png')
self.width = self.image.get_width()
self.height = self.image.get... | [
"pygame.image.load",
"pygame.transform.scale"
] | [((205, 239), 'pygame.image.load', 'pygame.image.load', (['"""img/heart.png"""'], {}), "('img/heart.png')\n", (222, 239), False, 'import pygame\n'), ((351, 424), 'pygame.transform.scale', 'pygame.transform.scale', (['self.image', '(self.width // 30, self.height // 30)'], {}), '(self.image, (self.width // 30, self.heigh... |
import pprint
import random
chessBoard = [[0 for j in range(8)] for i in range(8)]
chessBoard[0][0] = "R"
pprint.pprint(chessBoard)
#rook
def move():
x = 0
y = 0
getPosition = [0,0]
chessBoard[0][0] = 0
if random.uniform(0, 2) < 1:
x = int(random.uniform(0, 7))
else:
y = int(ran... | [
"pprint.pprint",
"random.uniform"
] | [((106, 131), 'pprint.pprint', 'pprint.pprint', (['chessBoard'], {}), '(chessBoard)\n', (119, 131), False, 'import pprint\n'), ((394, 419), 'pprint.pprint', 'pprint.pprint', (['chessBoard'], {}), '(chessBoard)\n', (407, 419), False, 'import pprint\n'), ((227, 247), 'random.uniform', 'random.uniform', (['(0)', '(2)'], {... |
# coding: utf-8
"""
Mailchimp Marketing API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 3.0.74
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import... | [
"six.iteritems"
] | [((6494, 6527), 'six.iteritems', 'six.iteritems', (['self.swagger_types'], {}), '(self.swagger_types)\n', (6507, 6527), False, 'import six\n')] |
import pytest
import numpy as np
import zmq
import h5py
import struct
import itertools
from .. import Writer
from .. import chunk_api
from ...messages import array as array_api
from .conftest import assert_chunk_allclose, assert_h5py_allclose
from zeeko.conftest import assert_canrecv
from ...tests.test_helpers import ... | [
"zeeko.conftest.assert_canrecv",
"h5py.File",
"pytest.mark.usefixtures",
"numpy.random.randn"
] | [((1220, 1254), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""rnotify"""'], {}), "('rnotify')\n", (1243, 1254), False, 'import pytest\n'), ((2517, 2539), 'zeeko.conftest.assert_canrecv', 'assert_canrecv', (['socket'], {}), '(socket)\n', (2531, 2539), False, 'from zeeko.conftest import assert_canrecv\n'), ... |
"""
Role tests
"""
import os
import pytest
from testinfra.utils.ansible_runner import AnsibleRunner
testinfra_hosts = AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize('name', [
('python-dev'),
('python-virtualenv'),
])
def test_packages(host, name):
""... | [
"pytest.mark.parametrize",
"testinfra.utils.ansible_runner.AnsibleRunner"
] | [((199, 267), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""name"""', "['python-dev', 'python-virtualenv']"], {}), "('name', ['python-dev', 'python-virtualenv'])\n", (222, 267), False, 'import pytest\n'), ((121, 173), 'testinfra.utils.ansible_runner.AnsibleRunner', 'AnsibleRunner', (["os.environ['MOLECULE... |
# SPDX-FileCopyrightText: 2021 <NAME>
# SPDX-License-Identifier: MIT
import board
from adafruit_led_animation.animation.sparkle import Sparkle
from adafruit_led_animation.color import PURPLE
from adafruit_led_animation.sequence import AnimationSequence
from adafruit_is31fl3741.adafruit_ledglasses import MUST_BUFFER, ... | [
"adafruit_led_animation.sequence.AnimationSequence",
"adafruit_led_animation.animation.sparkle.Sparkle",
"board.I2C",
"adafruit_is31fl3741.led_glasses_animation.LED_Glasses_Animation"
] | [((557, 587), 'adafruit_is31fl3741.led_glasses_animation.LED_Glasses_Animation', 'LED_Glasses_Animation', (['glasses'], {}), '(glasses)\n', (578, 587), False, 'from adafruit_is31fl3741.led_glasses_animation import LED_Glasses_Animation\n'), ((598, 627), 'adafruit_led_animation.animation.sparkle.Sparkle', 'Sparkle', (['... |
from pylearn2.blocks import Block
from pylearn2.utils.rng import make_theano_rng
from pylearn2.space import Conv2DSpace, VectorSpace
import theano
from theano.compile.mode import get_default_mode
class ScaleAugmentation(Block):
def __init__(self, space, seed=20150111, mean=1., std=.05, cpu_only=True):
sel... | [
"pylearn2.utils.rng.make_theano_rng",
"theano.compile.mode.get_default_mode",
"theano.function"
] | [((328, 374), 'pylearn2.utils.rng.make_theano_rng', 'make_theano_rng', (['seed'], {'which_method': "['normal']"}), "(seed, which_method=['normal'])\n", (343, 374), False, 'from pylearn2.utils.rng import make_theano_rng\n'), ((1071, 1107), 'theano.function', 'theano.function', (['[X]', 'out'], {'mode': 'mode'}), '([X], ... |
"""parses [PREDICT] section of config"""
import os
from pathlib import Path
import attr
from attr import converters, validators
from attr.validators import instance_of
from .validators import is_a_directory, is_a_file, is_valid_model_name
from .. import device
from ..converters import comma_separated_list, expanded_u... | [
"attr.validators.instance_of",
"os.getcwd",
"attr.ib",
"attr.converters.optional",
"attr.validators.optional"
] | [((3224, 3282), 'attr.ib', 'attr.ib', ([], {'converter': 'expanded_user_path', 'validator': 'is_a_file'}), '(converter=expanded_user_path, validator=is_a_file)\n', (3231, 3282), False, 'import attr\n'), ((3303, 3361), 'attr.ib', 'attr.ib', ([], {'converter': 'expanded_user_path', 'validator': 'is_a_file'}), '(converter... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'FeedType'
db.create_table('syndication_feedtype', (
('id', self.gf('django.db.mo... | [
"south.db.db.delete_table",
"south.db.db.create_unique",
"django.db.models.ForeignKey",
"django.db.models.AutoField",
"south.db.db.send_create_signal"
] | [((720, 770), 'south.db.db.send_create_signal', 'db.send_create_signal', (['"""syndication"""', "['FeedType']"], {}), "('syndication', ['FeedType'])\n", (741, 770), False, 'from south.db import db\n'), ((1065, 1111), 'south.db.db.send_create_signal', 'db.send_create_signal', (['"""syndication"""', "['Feed']"], {}), "('... |
"""Version 0.68.007
Revision ID: <KEY>
Revises: <PASSWORD>
Create Date: 2021-10-22 06:59:47.134546
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
from sqlalchemy import Enum
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = 'e3<PASSWORD>4da580'
bra... | [
"sqlalchemy.dialects.mysql.VARCHAR",
"alembic.op.drop_column",
"alembic.op.execute",
"sqlalchemy.Integer"
] | [((529, 738), 'alembic.op.execute', 'op.execute', (['"""ALTER TABLE `airflow_tasks` CHANGE COLUMN `sensor_soft_fail` `sensor_soft_fail` INTEGER NULL COMMENT \'Setting this to 1 will add soft_fail=True on sensor\' AFTER `sensor_timeout_minutes`"""'], {}), '(\n "ALTER TABLE `airflow_tasks` CHANGE COLUMN `sensor_soft_f... |
from __future__ import print_function, division, absolute_import
import pickle
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import pickle
def visualize_vertices(vertices:np.ndarray, bones:np.ndarray = None):
fig = plt.figure()
ax = Axes3D(fig)
ax.scatter(vertic... | [
"matplotlib.pyplot.show",
"mpl_toolkits.mplot3d.Axes3D",
"numpy.expand_dims",
"matplotlib.pyplot.figure",
"pickle.load",
"numpy.linalg.inv",
"numpy.vstack"
] | [((265, 277), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (275, 277), True, 'import matplotlib.pyplot as plt\n'), ((287, 298), 'mpl_toolkits.mplot3d.Axes3D', 'Axes3D', (['fig'], {}), '(fig)\n', (293, 298), False, 'from mpl_toolkits.mplot3d import Axes3D\n'), ((824, 834), 'matplotlib.pyplot.show', 'plt.s... |
"""
======================
Comparing CCA Variants
======================
A comparison of Kernel Canonical Correlation Analysis (KCCA) with three
different types of kernel to Deep Canonical Correlation Analysis (DCCA).
Each learns and computes kernels suitable for different situations. The point
of this tutorial is to ... | [
"mvlearn.embed.KCCA",
"mvlearn.embed.DCCA",
"mvlearn.datasets.GaussianMixture",
"numpy.eye",
"matplotlib.pyplot.subplots",
"seaborn.set_context"
] | [((1558, 1606), 'mvlearn.datasets.GaussianMixture', 'GaussianMixture', (['n_samples', 'centers', 'covariances'], {}), '(n_samples, centers, covariances)\n', (1573, 1606), False, 'from mvlearn.datasets import GaussianMixture\n'), ((1625, 1673), 'mvlearn.datasets.GaussianMixture', 'GaussianMixture', (['n_samples', 'cente... |
import processing.uploaders as uploaders
PREFIX_UPLOADERS = [
{
'context_url': 'registry.local:5000/context-dir',
'prefix': 'registry.local:5000',
'mangle': True,
'expected_target_ref': 'registry.local:5000/registry-source_local:1.2.3',
},
{
'context_url': 'registry... | [
"processing.uploaders.TagSuffixUploader",
"processing.uploaders.PrefixUploader"
] | [((724, 844), 'processing.uploaders.PrefixUploader', 'uploaders.PrefixUploader', ([], {'context_url': "uploader['context_url']", 'prefix': "uploader['prefix']", 'mangle': "uploader['mangle']"}), "(context_url=uploader['context_url'], prefix=\n uploader['prefix'], mangle=uploader['mangle'])\n", (748, 844), True, 'imp... |
#!/usr/bin/env python3
import argparse
import shlex
import sys
from subprocess import run
from typing import TextIO
def find_common_ancestor_distance(
taxon: str, other_taxon: str, taxonomy_db_path: str, only_canonical: bool
):
canonical = "--only_canonical" if only_canonical else ""
cmd_str = f"taxonomy... | [
"subprocess.run",
"shlex.split",
"argparse.ArgumentParser",
"argparse.FileType"
] | [((422, 442), 'shlex.split', 'shlex.split', (['cmd_str'], {}), '(cmd_str)\n', (433, 442), False, 'import shlex\n'), ((454, 500), 'subprocess.run', 'run', (['cmd'], {'encoding': '"""utf8"""', 'capture_output': '(True)'}), "(cmd, encoding='utf8', capture_output=True)\n", (457, 500), False, 'from subprocess import run\n')... |
import psutil #Library to get System details
import time
import pyttsx3 # Library for text to speech Offline
from win10toast import ToastNotifier # also need to install win32api (This is for Notifications)
import threading # To make notification and speech work at same time
toaster = ToastNotifier()
x=pyttsx3.init()
x... | [
"threading.Thread",
"pyttsx3.init",
"psutil.sensors_battery",
"time.sleep",
"win10toast.ToastNotifier"
] | [((286, 301), 'win10toast.ToastNotifier', 'ToastNotifier', ([], {}), '()\n', (299, 301), False, 'from win10toast import ToastNotifier\n'), ((304, 318), 'pyttsx3.init', 'pyttsx3.init', ([], {}), '()\n', (316, 318), False, 'import pyttsx3\n'), ((626, 641), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (636, 641... |
# Copyright 2014 DreamHost, LLC
#
# Author: DreamHost, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | [
"netaddr.IPAddress",
"logging.getLogger"
] | [((719, 746), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (736, 746), False, 'import logging\n'), ((1557, 1578), 'netaddr.IPAddress', 'netaddr.IPAddress', (['ip'], {}), '(ip)\n', (1574, 1578), False, 'import netaddr\n')] |
import os
code_lines = list()
notation_lines = list()
blank_lines = list()
def process_file(filename):
global code_lines
global notation_lines
global blank_lines
with open(filename, 'r') as file:
for line in file.readlines():
_line = line.strip()
if not _... | [
"os.path.join",
"os.listdir"
] | [((1028, 1044), 'os.listdir', 'os.listdir', (['path'], {}), '(path)\n', (1038, 1044), False, 'import os\n'), ((1166, 1190), 'os.path.join', 'os.path.join', (['path', 'file'], {}), '(path, file)\n', (1178, 1190), False, 'import os\n'), ((1218, 1242), 'os.path.join', 'os.path.join', (['path', 'file'], {}), '(path, file)\... |
from ocr import OCR
ocr=OCR(image_folder="test/")
if __name__ == "__main__":
ocr.keras_ocr_works()
ocr.easyocr_model_works()
ocr.pytesseract_model_works()
| [
"ocr.OCR"
] | [((25, 50), 'ocr.OCR', 'OCR', ([], {'image_folder': '"""test/"""'}), "(image_folder='test/')\n", (28, 50), False, 'from ocr import OCR\n')] |
import os
from setuptools import setup
def read(fname):
"""
Read README.md as long description if found.
Otherwise just return short description.
"""
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except IOError:
return "Simple git management applicatio... | [
"os.path.dirname"
] | [((210, 235), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (225, 235), False, 'import os\n')] |
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 7 10:57:53 2020
@author: pnter
"""
import torch
import gpytorch
# from gpytorch.utils.memoize import add_to_cache, is_in_cache
from gpytorch.lazy.root_lazy_tensor import RootLazyTensor
import copy
from UtilityFunctions import updateInverseCovarWoodbury
from math import ... | [
"torch.mean",
"copy.deepcopy",
"UtilityFunctions.updateInverseCovarWoodbury",
"torch.stack",
"gpytorch.distributions.MultivariateNormal",
"gpytorch.mlls.ExactMarginalLogLikelihood",
"torch.sqrt",
"torch.cat",
"gpytorch.settings.fast_pred_var",
"torch.max",
"torch.zeros",
"torch.no_grad",
"to... | [((7082, 7113), 'torch.stack', 'torch.stack', (['centersList'], {'dim': '(0)'}), '(centersList, dim=0)\n', (7093, 7113), False, 'import torch\n'), ((7921, 7949), 'torch.zeros', 'torch.zeros', (['distances.shape'], {}), '(distances.shape)\n', (7932, 7949), False, 'import torch\n'), ((15212, 15239), 'torch.stack', 'torch... |
from pathlib import Path
import environ
env = environ.Env(
# set casting, default value
DEBUG=(bool, False)
)
environ.Env.read_env()
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# SECURITY WARNING: keep the secret key used in production se... | [
"pathlib.Path",
"environ.Env.read_env",
"environ.Env"
] | [((47, 79), 'environ.Env', 'environ.Env', ([], {'DEBUG': '(bool, False)'}), '(DEBUG=(bool, False))\n', (58, 79), False, 'import environ\n'), ((119, 141), 'environ.Env.read_env', 'environ.Env.read_env', ([], {}), '()\n', (139, 141), False, 'import environ\n'), ((219, 233), 'pathlib.Path', 'Path', (['__file__'], {}), '(_... |
from typing import TYPE_CHECKING
import requests
if TYPE_CHECKING:
from undergen.lib.data import Character
url = "https://api.15.ai/app/getAudioFile5"
cdn_url = "https://cdn.15.ai/audio/"
headers = {'authority': 'api.15.ai',
'access-control-allow-origin': '*',
'accept': 'application/json, t... | [
"requests.post",
"requests.get"
] | [((1019, 1128), 'requests.post', 'requests.post', (['url'], {'json': "{'character': character_name, 'emotion': emotion, 'text': text}", 'headers': 'headers'}), "(url, json={'character': character_name, 'emotion': emotion,\n 'text': text}, headers=headers)\n", (1032, 1128), False, 'import requests\n'), ((1373, 1405),... |
from django.contrib.auth import get_user_model
from rest_framework import serializers
from apps.basics.op_drf.serializers import CustomModelSerializer
from apps.projects.efficiency.models import Efficiency
from apps.projects.efficiency.models import Module
UserProfile = get_user_model()
class EfficiencySerializer(... | [
"rest_framework.serializers.IntegerField",
"django.contrib.auth.get_user_model",
"rest_framework.serializers.CharField"
] | [((274, 290), 'django.contrib.auth.get_user_model', 'get_user_model', ([], {}), '()\n', (288, 290), False, 'from django.contrib.auth import get_user_model\n'), ((598, 655), 'rest_framework.serializers.IntegerField', 'serializers.IntegerField', ([], {'source': '"""parentId.id"""', 'default': '(0)'}), "(source='parentId.... |
"""
This file stores all the possible configurations for the Flask app.
Changing configurations like the secret key or the database
url should be stored as environment variables and imported
using the 'os' library in Python.
"""
import os
class BaseConfig:
SQLALCHEMY_TRACK_MODIFICATIONS = False
SSL = os.gete... | [
"os.getenv"
] | [((313, 346), 'os.getenv', 'os.getenv', (['"""POSTGRESQL_SSL"""', '(True)'], {}), "('POSTGRESQL_SSL', True)\n", (322, 346), False, 'import os\n'), ((446, 490), 'os.getenv', 'os.getenv', (['"""POSTGRESQL_DATABASE"""', '"""postgres"""'], {}), "('POSTGRESQL_DATABASE', 'postgres')\n", (455, 490), False, 'import os\n'), ((5... |
import os, sys
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
import configparser
import env
from envs.seoul_env import SeoulEnv, SeoulController
import numpy as np
import matplotlib
ilds_map ={'1_l', '1_r', '2_l', '2_r', '3_u', '3_d'}
class SeoulConuterEnv(SeoulEnv):
def __init__... | [
"env.reset",
"os.mkdir",
"configparser.ConfigParser",
"os.path.dirname",
"os.path.exists",
"envs.seoul_env.SeoulController"
] | [((1956, 1983), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (1981, 1983), False, 'import configparser\n'), ((1444, 1455), 'env.reset', 'env.reset', ([], {}), '()\n', (1453, 1455), False, 'import env\n'), ((1482, 1534), 'envs.seoul_env.SeoulController', 'SeoulController', (['self.env.node... |
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
from __future__ import absolute_import
import awkward as ak
np = ak.nplike.NumpyMetadata.instance()
def is_none(array, axis=0, highlevel=True, behavior=None):
raise NotImplementedError
# """
# Args:
# arra... | [
"awkward.nplike.NumpyMetadata.instance"
] | [((156, 190), 'awkward.nplike.NumpyMetadata.instance', 'ak.nplike.NumpyMetadata.instance', ([], {}), '()\n', (188, 190), True, 'import awkward as ak\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2016 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | [
"nparser.neural.linalg.linear"
] | [((1097, 1188), 'nparser.neural.linalg.linear', 'linear', (['inputs_list', 'self.output_size'], {'add_bias': '(True)', 'moving_params': 'self.moving_params'}), '(inputs_list, self.output_size, add_bias=True, moving_params=self.\n moving_params)\n', (1103, 1188), False, 'from nparser.neural.linalg import linear\n')] |
import arrow
import json
import requests
def kanban_webhook(event, context):
input_body = json.loads(event['body'])
print(event['body'])
action = input_body["action"]
action_type = action["type"]
if action_type == "createCard":
list_name, card_name = get_create_card(action["data"])
... | [
"arrow.now",
"json.loads",
"json.dumps"
] | [((97, 122), 'json.loads', 'json.loads', (["event['body']"], {}), "(event['body'])\n", (107, 122), False, 'import json\n'), ((1364, 1383), 'json.dumps', 'json.dumps', (['payload'], {}), '(payload)\n', (1374, 1383), False, 'import json\n'), ((1165, 1176), 'arrow.now', 'arrow.now', ([], {}), '()\n', (1174, 1176), False, ... |
# Generated by Django 3.2.6 on 2022-02-06 17:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('home', '0008_auto_20220202_1858'),
]
operations = [
migrations.RemoveField(
model_name='student',
name='activities',... | [
"django.db.migrations.RemoveField",
"django.db.models.ManyToManyField"
] | [((232, 295), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""student"""', 'name': '"""activities"""'}), "(model_name='student', name='activities')\n", (254, 295), False, 'from django.db import migrations, models\n'), ((444, 535), 'django.db.models.ManyToManyField', 'models.ManyToM... |
import pathlib
bib = pathlib.Path(__file__).parent.absolute() / 'bibliography.bib'
del(pathlib)
| [
"pathlib.Path"
] | [((22, 44), 'pathlib.Path', 'pathlib.Path', (['__file__'], {}), '(__file__)\n', (34, 44), False, 'import pathlib\n')] |
# Copyright 2021 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | [
"connexion.request.get_json",
"swagger_server.models.api_catalog_upload_response.ApiCatalogUploadResponse",
"traceback.format_exc",
"swagger_server.models.api_list_catalog_items_response.ApiListCatalogItemsResponse"
] | [((2853, 2965), 'swagger_server.models.api_list_catalog_items_response.ApiListCatalogItemsResponse', 'ApiListCatalogItemsResponse', ([], {'components': '[]', 'datasets': '[]', 'models': '[]', 'notebooks': '[]', 'pipelines': '[]', 'total_size': '(0)'}), '(components=[], datasets=[], models=[],\n notebooks=[], pipelin... |
"""Training GCMC model on the MovieLens data set.
The script loads the full graph to the training device.
"""
import os, time
import argparse
import logging
import random
import string
import dgl
import scipy.sparse as sp
import pandas as pd
import numpy as np
import torch as th
import torch.nn as nn
import torch.nn.f... | [
"numpy.random.seed",
"argparse.ArgumentParser",
"random.sample",
"utils.get_activation",
"numpy.argsort",
"numpy.argpartition",
"numpy.random.randint",
"numpy.mean",
"utils.to_etype_name",
"numpy.arange",
"torch.device",
"model.MLPDecoder",
"os.path.join",
"numpy.zeros_like",
"torch.Floa... | [((2008, 2037), 'numpy.ones_like', 'np.ones_like', (['rating_pairs[0]'], {}), '(rating_pairs[0])\n', (2020, 2037), True, 'import numpy as np\n'), ((2067, 2154), 'scipy.sparse.coo_matrix', 'sp.coo_matrix', (['(ones, rating_pairs)'], {'shape': '(num_user, num_movie)', 'dtype': 'np.float32'}), '((ones, rating_pairs), shap... |
from django.db import models
# Create your models here.
class Page(models.Model):
STATUS_CHOICES = (
(1, 'Active'),
(2, 'Inactive'),
)
PAGE_CHOICES = (
(1, 'Home'),
(2, 'About Us'),
)
page = models.PositiveSmallIntegerField(choices=PAGE_CHOICES,unique=True)
tit... | [
"django.db.models.CharField",
"django.db.models.ImageField",
"django.db.models.PositiveSmallIntegerField"
] | [((246, 313), 'django.db.models.PositiveSmallIntegerField', 'models.PositiveSmallIntegerField', ([], {'choices': 'PAGE_CHOICES', 'unique': '(True)'}), '(choices=PAGE_CHOICES, unique=True)\n', (278, 313), False, 'from django.db import models\n'), ((325, 380), 'django.db.models.CharField', 'models.CharField', ([], {'max_... |
"""
ShadeSketch
https://github.com/qyzdao/ShadeSketch
Learning to Shadow Hand-drawn Sketches
<NAME>, <NAME>, <NAME>
Copyright (C) 2020 The respective authors and Project HAT. All rights reserved.
Licensed under MIT license.
"""
import tensorflow as tf
# import keras
keras = tf.keras
K = keras.backend
Layer = keras.... | [
"tensorflow.tile"
] | [((17561, 17601), 'tensorflow.tile', 'tf.tile', (['xx_channels', '[1, dim1, 1, 1, 1]'], {}), '(xx_channels, [1, dim1, 1, 1, 1])\n', (17568, 17601), True, 'import tensorflow as tf\n'), ((18248, 18288), 'tensorflow.tile', 'tf.tile', (['yy_channels', '[1, dim1, 1, 1, 1]'], {}), '(yy_channels, [1, dim1, 1, 1, 1])\n', (1825... |
import json
class JsonFormatter:
def __init__(self):
pass
def format(self, message):
return json.dumps(message)
| [
"json.dumps"
] | [((119, 138), 'json.dumps', 'json.dumps', (['message'], {}), '(message)\n', (129, 138), False, 'import json\n')] |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
file="/Users/spanta/Documents/batch_aeneas_scripts/batch_directory/QC_data/BMQBSMN2DA_epo_eng_plot_cdf.csv"
data_req = pd.read_table(file, sep=",")
arr = data_req.values
arr.sort(axis=0)
data_req = pd.DataFrame(arr, index=data_req.index, columns=... | [
"pandas.DataFrame",
"matplotlib.pyplot.xlim",
"pandas.read_table",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.savefig"
] | [((191, 219), 'pandas.read_table', 'pd.read_table', (['file'], {'sep': '""","""'}), "(file, sep=',')\n", (204, 219), True, 'import pandas as pd\n'), ((272, 337), 'pandas.DataFrame', 'pd.DataFrame', (['arr'], {'index': 'data_req.index', 'columns': 'data_req.columns'}), '(arr, index=data_req.index, columns=data_req.colum... |
from abc import ABC, abstractmethod
from decimal import Decimal
import stripe
from django.conf import settings
class PaymentGateway(ABC):
@classmethod
@abstractmethod
def generate_checkout_session_id(
cls,
name: str,
description: str,
price: float,
) -> str:
pa... | [
"stripe.Customer.retrieve"
] | [((1741, 1778), 'stripe.Customer.retrieve', 'stripe.Customer.retrieve', (['customer_id'], {}), '(customer_id)\n', (1765, 1778), False, 'import stripe\n')] |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import time
import unittest
from telemetry import decorators
from telemetry.internal.backends.chrome_inspector import tracing_backend
from telemetry.interna... | [
"telemetry.timeline.tracing_config.TracingConfig",
"telemetry.testing.fakes.FakeInspectorWebsocket",
"telemetry.testing.simple_mock.MockTimer",
"telemetry.decorators.Disabled",
"telemetry.internal.backends.chrome_inspector.tracing_backend._DevToolsStreamReader",
"time.clock",
"telemetry.internal.backend... | [((1510, 1536), 'telemetry.decorators.Disabled', 'decorators.Disabled', (['"""win"""'], {}), "('win')\n", (1529, 1536), False, 'from telemetry import decorators\n'), ((2956, 2982), 'telemetry.decorators.Disabled', 'decorators.Disabled', (['"""win"""'], {}), "('win')\n", (2975, 2982), False, 'from telemetry import decor... |
from functools import partial
from catalyst import dl, SETTINGS
E2E = {
"de": dl.DeviceEngine,
"dp": dl.DataParallelEngine,
"ddp": dl.DistributedDataParallelEngine,
}
if SETTINGS.amp_required:
E2E.update(
{"amp-dp": dl.DataParallelAMPEngine, "amp-ddp": dl.DistributedDataParallelAMPEngine}
... | [
"functools.partial"
] | [((933, 1030), 'functools.partial', 'partial', (['dl.FullySharedDataParallelFairScaleEngine'], {'ddp_kwargs': "{'flatten_parameters': False}"}), "(dl.FullySharedDataParallelFairScaleEngine, ddp_kwargs={\n 'flatten_parameters': False})\n", (940, 1030), False, 'from functools import partial\n')] |
#!/usr/bin/env python
# Copyright 2018 by <NAME>
#
# https://github.com/martinmoene/kalman-estimator
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
import os
nt = 'double'
nt = 'fp32_t'
std = 'c++1... | [
"os.system"
] | [((734, 748), 'os.system', 'os.system', (['cmd'], {}), '(cmd)\n', (743, 748), False, 'import os\n')] |
from django.contrib.auth.models import Permission
def assign_perm(perm, group):
"""
Assigns a permission to a group
"""
if not isinstance(perm, Permission):
try:
app_label, codename = perm.split('.', 1)
except ValueError:
raise ValueError("For global permissions... | [
"django.contrib.auth.models.Permission.objects.get"
] | [((441, 517), 'django.contrib.auth.models.Permission.objects.get', 'Permission.objects.get', ([], {'content_type__app_label': 'app_label', 'codename': 'codename'}), '(content_type__app_label=app_label, codename=codename)\n', (463, 517), False, 'from django.contrib.auth.models import Permission\n'), ((960, 1036), 'djang... |
"""Definition for mockerena schema
.. codeauthor:: <NAME> <<EMAIL>>
"""
from copy import deepcopy
SCHEMA = {
"item_title": "schema",
"schema": {
"schema": {
"type": "string",
"minlength": 3,
"maxlength": 64,
"unique": True,
"required": Tru... | [
"copy.deepcopy"
] | [((2742, 2768), 'copy.deepcopy', 'deepcopy', (["SCHEMA['schema']"], {}), "(SCHEMA['schema'])\n", (2750, 2768), False, 'from copy import deepcopy\n')] |
# Copyright 2020 Stanford University, Los Alamos National Laboratory
#
# 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 ... | [
"flexflow.keras.datasets.cifar10.load_data",
"flexflow.keras.models.Model",
"flexflow.keras.layers.Dense",
"flexflow.keras.callbacks.VerifyMetrics",
"flexflow.keras.layers.MaxPooling2D",
"numpy.zeros",
"flexflow.keras.layers.Input",
"flexflow.keras.layers.Flatten",
"gc.collect",
"flexflow.keras.la... | [((1277, 1307), 'flexflow.keras.datasets.cifar10.load_data', 'cifar10.load_data', (['num_samples'], {}), '(num_samples)\n', (1294, 1307), False, 'from flexflow.keras.datasets import cifar10\n'), ((1327, 1381), 'numpy.zeros', 'np.zeros', (['(num_samples, 3, 229, 229)'], {'dtype': 'np.float32'}), '((num_samples, 3, 229, ... |
#!/usr/bin/env python
import asyncio
import logging
import hummingbot.connector.exchange.huobi.huobi_constants as CONSTANTS
from collections import defaultdict
from typing import (
Any,
Dict,
List,
Optional,
)
from hummingbot.connector.exchange.huobi.huobi_order_book import HuobiOrderBook
from hum... | [
"hummingbot.connector.exchange.huobi.huobi_order_book.HuobiOrderBook.diff_message_from_exchange",
"hummingbot.core.web_assistant.connections.data_types.RESTRequest",
"hummingbot.connector.exchange.huobi.huobi_utils.convert_to_exchange_trading_pair",
"hummingbot.connector.exchange.huobi.huobi_order_book.HuobiO... | [((2082, 2108), 'collections.defaultdict', 'defaultdict', (['asyncio.Queue'], {}), '(asyncio.Queue)\n', (2093, 2108), False, 'from collections import defaultdict\n'), ((2658, 2677), 'hummingbot.connector.exchange.huobi.huobi_utils.build_api_factory', 'build_api_factory', ([], {}), '()\n', (2675, 2677), False, 'from hum... |
#!/usr/bin/env python3
import argparse
import logging
import varifier
def main(args=None):
parser = argparse.ArgumentParser(
prog="varifier",
usage="varifier <command> <options>",
description="varifier: variant call adjudication",
)
parser.add_argument("--version", action="versio... | [
"argparse.ArgumentParser",
"logging.getLogger"
] | [((107, 246), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""varifier"""', 'usage': '"""varifier <command> <options>"""', 'description': '"""varifier: variant call adjudication"""'}), "(prog='varifier', usage=\n 'varifier <command> <options>', description=\n 'varifier: variant call adjudi... |
# Generated by Django 3.0.2 on 2020-01-13 19:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='account',
name='statut',
fi... | [
"django.db.models.CharField"
] | [((324, 441), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[('PROFESSOR', 'PROFESSOR'), ('STUDENT', 'STUDENT')]", 'default': '"""STUDENT"""', 'max_length': '(10)'}), "(choices=[('PROFESSOR', 'PROFESSOR'), ('STUDENT', 'STUDENT'\n )], default='STUDENT', max_length=10)\n", (340, 441), False, 'fro... |
import pytest
from decharges.parametre.models import ParametresDApplication
pytestmark = pytest.mark.django_db
def test_instanciate_parameters():
params = ParametresDApplication.objects.create()
assert f"{params}" == "Paramètres de l'application"
| [
"decharges.parametre.models.ParametresDApplication.objects.create"
] | [((163, 202), 'decharges.parametre.models.ParametresDApplication.objects.create', 'ParametresDApplication.objects.create', ([], {}), '()\n', (200, 202), False, 'from decharges.parametre.models import ParametresDApplication\n')] |
import numpy as np
import torch
import torch.nn as nn
# Adapted from https://github.com/gpeyre/SinkhornAutoDiff
# Adapted from https://github.com/gpeyre/SinkhornAutoDiff/blob/master/sinkhorn_pointcloud.py
class GTOT(nn.Module):
r"""
GTOT implementation.
"""
def __init__(self, eps=0.1, thresh=0.1,... | [
"torch.ones",
"torch.topk",
"torch.zeros_like",
"torch.norm",
"torch.empty",
"torch.abs",
"torch.rand",
"torch.sum",
"torch.log",
"torch.tensor",
"torch.transpose"
] | [((7204, 7238), 'torch.tensor', 'torch.tensor', (['a'], {'dtype': 'torch.float'}), '(a, dtype=torch.float)\n', (7216, 7238), False, 'import torch\n'), ((7247, 7281), 'torch.tensor', 'torch.tensor', (['b'], {'dtype': 'torch.float'}), '(b, dtype=torch.float)\n', (7259, 7281), False, 'import torch\n'), ((2077, 2097), 'tor... |
from admin_app_config import db
from models import (User, HazardSummary, HazardLocation)
from views.home_view import HomeView
from views.login_view import LoginView
from views.logout_view import LogoutView
from views.user_view import UserView
from views.mobile_view import (MobileLoginView, MobileView)
from views.user_d... | [
"views.mobile_view.MobileLoginView",
"views.mobile_view.MobileView",
"views.hazard_summary_view.HazardSummaryView",
"views.business_dash_view.BusinessDashView",
"views.home_view.HomeView",
"views.login_view.LoginView",
"views.user_view.UserView",
"views.logout_view.LogoutView",
"views.user_dash_view... | [((587, 625), 'views.home_view.HomeView', 'HomeView', ([], {'name': '"""Home"""', 'endpoint': '"""home"""'}), "(name='Home', endpoint='home')\n", (595, 625), False, 'from views.home_view import HomeView\n'), ((674, 734), 'views.mobile_view.MobileLoginView', 'MobileLoginView', ([], {'name': '"""Mobile Login"""', 'endpoi... |
import os
from plugin import connection
from cloudify import ctx
from cloudify.exceptions import NonRecoverableError
from cloudify.decorators import operation
# TODO Are methods like `_get_path_to_key_file()` necessary, since we do not
# save keys on the local filesystem?
@operation
def creation_validation(**_):
... | [
"os.remove",
"cloudify.exceptions.NonRecoverableError",
"os.chmod",
"cloudify.ctx.logger.error",
"cloudify.ctx.logger.debug",
"os.path.exists",
"cloudify.ctx.logger.info",
"cloudify.ctx.instance.runtime_properties.pop",
"os.path.split",
"os.path.expanduser",
"os.access",
"plugin.connection.Mis... | [((1535, 1568), 'plugin.connection.MistConnectionClient', 'connection.MistConnectionClient', ([], {}), '()\n', (1566, 1568), False, 'from plugin import connection\n'), ((2309, 2342), 'plugin.connection.MistConnectionClient', 'connection.MistConnectionClient', ([], {}), '()\n', (2340, 2342), False, 'from plugin import c... |
import numpy as np
import sys
from collections import Counter
class CFeval(object):
"""Classification evaluator class"""
def __init__(self, metrics, reshapeDims, classes):
"""
# Arguments
metrics: dictionary of metrics to be evaluated, currently supports only classification accuracy
reshapeDims: list of th... | [
"numpy.divide",
"numpy.nansum",
"numpy.minimum",
"numpy.maximum",
"numpy.sum",
"numpy.argmax",
"numpy.zeros",
"numpy.expand_dims",
"numpy.equal",
"numpy.cumsum",
"numpy.mean",
"numpy.array",
"collections.Counter"
] | [((7449, 7465), 'numpy.array', 'np.array', (['boxes1'], {}), '(boxes1)\n', (7457, 7465), True, 'import numpy as np\n'), ((7476, 7492), 'numpy.array', 'np.array', (['boxes2'], {}), '(boxes2)\n', (7484, 7492), True, 'import numpy as np\n'), ((8460, 8520), 'numpy.maximum', 'np.maximum', (['boxes1[:, [xmin, ymin]]', 'boxes... |
import contextlib
import os
from subprocess import check_call, CalledProcessError
import sys
from pynt import task
__license__ = "MIT License"
__contact__ = "http://rags.github.com/pynt-contrib/"
@contextlib.contextmanager
def safe_cd(path):
"""
Changes to a directory, yields, and changes back.
Additional... | [
"subprocess.check_call",
"pynt.task",
"os.getcwd",
"os.chdir",
"sys.exit"
] | [((592, 598), 'pynt.task', 'task', ([], {}), '()\n', (596, 598), False, 'from pynt import task\n'), ((481, 492), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (490, 492), False, 'import os\n'), ((510, 524), 'os.chdir', 'os.chdir', (['path'], {}), '(path)\n', (518, 524), False, 'import os\n'), ((560, 588), 'os.chdir', 'os... |
"""
Copyright (C) 2022 <NAME>
Released under MIT License. See the file LICENSE for details.
Module for some classes that describe sequences of images.
If your custom dataset stores images in some other way,
create a subclass of ImageSequence and use it.
"""
from typing import List
import numpy ... | [
"imageio.imread",
"imageio.get_reader"
] | [((806, 837), 'imageio.imread', 'iio.imread', (['self.images[im_num]'], {}), '(self.images[im_num])\n', (816, 837), True, 'import imageio as iio\n'), ((1096, 1120), 'imageio.get_reader', 'iio.get_reader', (['vid_file'], {}), '(vid_file)\n', (1110, 1120), True, 'import imageio as iio\n')] |
from time import time
import hashlib
import json
from urllib.parse import urlparse
import requests
# Class definition of our shellchain (Blockchain-like) object
class Shellchain:
def __init__(self): # constructor
self.current_transactions = []
self.chain = []
self.rivers = set()
... | [
"hashlib.sha256",
"json.dumps",
"time.time"
] | [((645, 651), 'time.time', 'time', ([], {}), '()\n', (649, 651), False, 'from time import time\n'), ((2341, 2374), 'json.dumps', 'json.dumps', (['shell'], {'sort_keys': '(True)'}), '(shell, sort_keys=True)\n', (2351, 2374), False, 'import json\n'), ((2399, 2427), 'hashlib.sha256', 'hashlib.sha256', (['shell_string'], {... |
"""\
Acora - a multi-keyword search engine based on Aho-Corasick trees.
Usage::
>>> from acora import AcoraBuilder
Collect some keywords::
>>> builder = AcoraBuilder('ab', 'bc', 'de')
>>> builder.add('a', 'b')
Generate the Acora search engine::
>>> ac = builder.build()
Search a string for all occ... | [
"acora._acora.merge_targets",
"acora._acora.build_trie",
"codecs.latin_1_encode",
"acora._acora.build_MachineState"
] | [((6550, 6566), 'acora._acora.build_MachineState', '_MachineState', (['(0)'], {}), '(0)\n', (6563, 6566), True, 'from acora._acora import insert_bytes_keyword, insert_unicode_keyword, build_trie as _build_trie, build_MachineState as _MachineState, merge_targets as _merge_targets\n'), ((9167, 9219), 'acora._acora.build_... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'CountryCode'
db.delete_table('iss_countrycode')
d... | [
"south.db.db.delete_table",
"south.db.db.send_create_signal"
] | [((278, 312), 'south.db.db.delete_table', 'db.delete_table', (['"""iss_countrycode"""'], {}), "('iss_countrycode')\n", (293, 312), False, 'from south.db import db\n'), ((742, 787), 'south.db.db.send_create_signal', 'db.send_create_signal', (['"""iss"""', "['CountryCode']"], {}), "('iss', ['CountryCode'])\n", (763, 787)... |
import sys, os
path = os.path.dirname(__file__)
path = os.path.join(path, '..', 'protein_inference')
if path not in sys.path:
sys.path.append(path) | [
"sys.path.append",
"os.path.dirname",
"os.path.join"
] | [((23, 48), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (38, 48), False, 'import sys, os\n'), ((56, 101), 'os.path.join', 'os.path.join', (['path', '""".."""', '"""protein_inference"""'], {}), "(path, '..', 'protein_inference')\n", (68, 101), False, 'import sys, os\n'), ((131, 152), 'sys.p... |
from re import compile, MULTILINE
import telethon as tg
from pyrobud.util.bluscream import UserStr, telegram_uid_regex
from .. import command, module
class DebugModuleAddon(module.Module):
name = "Debug Extensions"
@command.desc("Dump all the data of a message to your cloud")
@command.alias... | [
"pyrobud.util.bluscream.UserStr",
"pyrobud.util.bluscream.telegram_uid_regex.finditer"
] | [((889, 943), 'pyrobud.util.bluscream.telegram_uid_regex.finditer', 'telegram_uid_regex.finditer', (['reply_msg.text', 'MULTILINE'], {}), '(reply_msg.text, MULTILINE)\n', (916, 943), False, 'from pyrobud.util.bluscream import UserStr, telegram_uid_regex\n'), ((1378, 1397), 'pyrobud.util.bluscream.UserStr', 'UserStr', (... |
# coding: utf-8
# In[ ]:
import cv2
from keras.models import load_model
import numpy as np
from collections import deque
from keras.preprocessing import image
import keras
import os
# In[ ]:
model1 = load_model('mob_logo_model.h5')
val = ['Adidas','Apple','BMW','Citroen','Fedex','HP','Mcdonalds','Nike','none'... | [
"keras.models.load_model",
"cv2.GaussianBlur",
"cv2.bitwise_and",
"cv2.medianBlur",
"numpy.ones",
"keras.preprocessing.image.img_to_array",
"cv2.rectangle",
"cv2.erode",
"cv2.imshow",
"cv2.inRange",
"collections.deque",
"cv2.line",
"cv2.contourArea",
"cv2.dilate",
"cv2.cvtColor",
"cv2.... | [((210, 241), 'keras.models.load_model', 'load_model', (['"""mob_logo_model.h5"""'], {}), "('mob_logo_model.h5')\n", (220, 241), False, 'from keras.models import load_model\n'), ((399, 418), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (415, 418), False, 'import cv2\n'), ((419, 447), 'cv2.namedWindow... |
import json
from decimal import Decimal
from pymongo import MongoClient
from appkernel import PropertyRequiredException
from appkernel.configuration import config
from appkernel.repository import mongo_type_converter_to_dict, mongo_type_converter_from_dict
from .utils import *
import pytest
from jsonschema import valid... | [
"pymongo.MongoClient",
"pytest.raises",
"json.dumps"
] | [((380, 409), 'pymongo.MongoClient', 'MongoClient', ([], {'host': '"""localhost"""'}), "(host='localhost')\n", (391, 409), False, 'from pymongo import MongoClient\n'), ((641, 681), 'pytest.raises', 'pytest.raises', (['PropertyRequiredException'], {}), '(PropertyRequiredException)\n', (654, 681), False, 'import pytest\n... |
from itertools import permutations
import numpy as np
import pytest
from pyomeca import Angles, Rototrans, Markers
SEQ = (
["".join(p) for i in range(1, 4) for p in permutations("xyz", i)]
+ ["zyzz"]
+ ["zxz"]
)
SEQ = [s for s in SEQ if s not in ["yxz"]]
EPSILON = 1e-12
ANGLES = Angles(np.random.rand(4, ... | [
"pyomeca.Markers.from_random_data",
"numpy.eye",
"pyomeca.Angles.from_rototrans",
"numpy.testing.assert_array_equal",
"itertools.permutations",
"pyomeca.Rototrans.from_euler_angles",
"numpy.zeros",
"pyomeca.Rototrans.from_averaged_rototrans",
"pytest.raises",
"pyomeca.Angles.from_random_data",
"... | [((332, 367), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""seq"""', 'SEQ'], {}), "('seq', SEQ)\n", (355, 367), False, 'import pytest\n'), ((302, 327), 'numpy.random.rand', 'np.random.rand', (['(4)', '(1)', '(100)'], {}), '(4, 1, 100)\n', (316, 327), True, 'import numpy as np\n'), ((566, 636), 'pyomeca.Ro... |