code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#!/usr/bin/env python
# coding: utf-8
# import packages
import re
import pandas as pd
from bs4 import BeautifulSoup
from collections import defaultdict
# Function definitions
def extract_all_characters(soup):
"""
Function to extract characters from XML file of a play.
Extracts the value of two tag attri... | [
"bs4.BeautifulSoup",
"pandas.DataFrame",
"collections.defaultdict",
"pandas.DataFrame.from_dict"
] | [((1799, 1815), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (1810, 1815), False, 'from collections import defaultdict\n'), ((2068, 2113), 'pandas.DataFrame.from_dict', 'pd.DataFrame.from_dict', (['edges'], {'orient': '"""index"""'}), "(edges, orient='index')\n", (2090, 2113), True, 'import panda... |
# MIT License
# Copyright (c) 2021 xadrianzetx
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, pu... | [
"hashlib.md5",
"os.path.join",
"requests.get",
"os.path.isfile",
"os.path.realpath",
"os.remove"
] | [((2031, 2085), 'os.path.join', 'os.path.join', (['(module_dir if not dst else dst)', 'filename'], {}), '(module_dir if not dst else dst, filename)\n', (2043, 2085), False, 'import os\n'), ((2094, 2118), 'os.path.isfile', 'os.path.isfile', (['filepath'], {}), '(filepath)\n', (2108, 2118), False, 'import os\n'), ((2247,... |
# movie recommendation program
import pandas as pd
import numpy as np
from sklearn.metrics.pairwise import cosine_similarity
from sklearn.feature_extraction.text import CountVectorizer
# load data
df = pd.read_csv('New.csv')
print(df.head(3))
# df['id']=df.index
# df.to_csv('New')
# get count of movies in the data... | [
"sklearn.feature_extraction.text.CountVectorizer",
"sklearn.metrics.pairwise.cosine_similarity",
"pandas.read_csv"
] | [((205, 227), 'pandas.read_csv', 'pd.read_csv', (['"""New.csv"""'], {}), "('New.csv')\n", (216, 227), True, 'import pandas as pd\n'), ((1201, 1222), 'sklearn.metrics.pairwise.cosine_similarity', 'cosine_similarity', (['cm'], {}), '(cm)\n', (1218, 1222), False, 'from sklearn.metrics.pairwise import cosine_similarity\n')... |
from newspaper import Article
# #A new article from TOI
# url = "https://www.indiatoday.in/india/story/surrogate-mother-need-not-to-be-close-relative-single-woman-can-avail-surrogacy-parliamentary-panel-1643545-2020-02-05"
# #For different language newspaper refer above table
# toi_article = Article(url, l... | [
"newspaper.Article"
] | [((560, 587), 'newspaper.Article', 'Article', (['url'], {'language': '"""en"""'}), "(url, language='en')\n", (567, 587), False, 'from newspaper import Article\n')] |
from SEAL import SplineSpace, create_knots
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
p = 2
n = 10
t = create_knots(0, 1, p, n)
S = SplineSpace(p, t)
c = [(0, 1, 0), (1, 2, 1), (1.5, 3, 2), (1.7, -1, 3), (1, -1.5, 4), (3, 3, 3), (4, 4, 3), (5, 2, 2), (6, 5, 4), (7, -1, 5)]
f = S(c)
x = S.... | [
"SEAL.create_knots",
"matplotlib.pyplot.figure",
"SEAL.SplineSpace",
"mpl_toolkits.mplot3d.Axes3D",
"matplotlib.pyplot.show"
] | [((133, 157), 'SEAL.create_knots', 'create_knots', (['(0)', '(1)', 'p', 'n'], {}), '(0, 1, p, n)\n', (145, 157), False, 'from SEAL import SplineSpace, create_knots\n'), ((162, 179), 'SEAL.SplineSpace', 'SplineSpace', (['p', 't'], {}), '(p, t)\n', (173, 179), False, 'from SEAL import SplineSpace, create_knots\n'), ((386... |
import io
from pathlib import Path
from tcga.utils import unlist1
# Returns the object from a list
# iff the list is a singleton
assert 43 == unlist1([43])
# An iterable will be consumed:
assert 36 == unlist1((x ** 2) for x in [6])
# These fail with a ValueError:
# unlist1([])
# unlist1([1, 2])
from tcga.utils import... | [
"tcga.utils.from_iterable",
"tcga.utils.seek_then_rewind",
"tcga.utils.at_most_n",
"tcga.utils.minidict",
"tcga.utils.first",
"tcga.utils.whatsmyname",
"io.StringIO",
"tcga.utils.unlist1"
] | [((1448, 1478), 'tcga.utils.minidict', 'minidict', (["{(1): 'A', (2): 'B'}"], {}), "({(1): 'A', (2): 'B'})\n", (1456, 1478), False, 'from tcga.utils import minidict\n'), ((143, 156), 'tcga.utils.unlist1', 'unlist1', (['[43]'], {}), '([43])\n', (150, 156), False, 'from tcga.utils import unlist1\n'), ((202, 230), 'tcga.u... |
import pandas as pd
import matplotlib.pyplot as plt
# Bagian 1 -- Load data dari sumbernya
df = pd.read_csv(
'https://raw.githubusercontent.com/datasets/covid-19/\
master/data/countries-aggregated.csv', parse_dates=['Date'])
# Bagian 2 -- Melakukan filter data untuk data Malaysia dan Indonesia
negara = ["Indonesi... | [
"matplotlib.pyplot.savefig",
"pandas.read_csv",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.figure"
] | [((97, 232), 'pandas.read_csv', 'pd.read_csv', (['"""https://raw.githubusercontent.com/datasets/covid-19/master/data/countries-aggregated.csv"""'], {'parse_dates': "['Date']"}), "(\n 'https://raw.githubusercontent.com/datasets/covid-19/master/data/countries-aggregated.csv'\n , parse_dates=['Date'])\n", (108, 232)... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# *****************************************************************************/
# * Authors: <NAME>, <NAME>
# *****************************************************************************/
from __future__ import absolute_import, division, print_function, unicode_literals... | [
"os.path.exists",
"random.shuffle",
"os.path.dirname",
"numpy.array",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.callbacks.ModelCheckpoint",
"json.load",
"tensorflow.keras.layers.Flatten"
] | [((703, 732), 'os.path.exists', 'os.path.exists', (['"""QDist_2.txt"""'], {}), "('QDist_2.txt')\n", (717, 732), False, 'import os, json, random\n'), ((737, 767), 'os.path.exists', 'os.path.exists', (['"""labels_1.txt"""'], {}), "('labels_1.txt')\n", (751, 767), False, 'import os, json, random\n'), ((1089, 1113), 'rando... |
from sql_gen.commands import CreateSQLTaskCommand
from sql_gen.database import Connector, EMDatabase
from emtask.database import addb
class RewireVerbSQLTask(object):
def create_rewire_verb_template(self, verb, new_path):
self._create_sql(
"rewire_verb.sql",
entity_def_id=verb._en... | [
"emtask.database.addb",
"sql_gen.commands.CreateSQLTaskCommand"
] | [((506, 602), 'sql_gen.commands.CreateSQLTaskCommand', 'CreateSQLTaskCommand', ([], {'template_name': 'args[0]', 'run_once': '(True)', 'template_values': 'template_values'}), '(template_name=args[0], run_once=True, template_values=\n template_values)\n', (526, 602), False, 'from sql_gen.commands import CreateSQLTask... |
# - *- coding: utf- 8 - *-
from typing import Optional
import aiohttp
# Асинхронная сессия для запросов
class RequestsSession:
def __init__(self) -> None:
self._session: Optional[aiohttp.ClientSession] = None
async def get_session(self) -> aiohttp.ClientSession:
if self._session is None:
... | [
"aiohttp.ClientSession"
] | [((343, 366), 'aiohttp.ClientSession', 'aiohttp.ClientSession', ([], {}), '()\n', (364, 366), False, 'import aiohttp\n')] |
import inspect
from estimagic.optimization import bhhh
from estimagic.optimization import cyipopt_optimizers
from estimagic.optimization import fides_optimizers
from estimagic.optimization import nag_optimizers
from estimagic.optimization import neldermead
from estimagic.optimization import nlopt_optimizers
from estim... | [
"inspect.getmembers"
] | [((807, 853), 'inspect.getmembers', 'inspect.getmembers', (['module', 'inspect.isfunction'], {}), '(module, inspect.isfunction)\n', (825, 853), False, 'import inspect\n')] |
from base64 import b64encode
def get_token(custos_settings):
tokenStr = custos_settings.CUSTOS_CLIENT_ID + ":" + custos_settings.CUSTOS_CLIENT_SEC
tokenByte = tokenStr.encode('utf-8')
encodedBytes = b64encode(tokenByte)
return encodedBytes.decode('utf-8')
| [
"base64.b64encode"
] | [((213, 233), 'base64.b64encode', 'b64encode', (['tokenByte'], {}), '(tokenByte)\n', (222, 233), False, 'from base64 import b64encode\n')] |
import sep
import numpy as np
import scarlet
from scarlet.wavelet import mad_wavelet, Starlet
from .utils import extract_obj, image_gaia_stars
from astropy.table import Table, Column
from astropy import units as u
from astropy.units import Quantity
from astropy.coordinates import SkyCoord
from kuaizi.mock import Data... | [
"scarlet.Frame",
"scarlet.interpolation.sinc_interp",
"numpy.size",
"astropy.coordinates.SkyCoord",
"numpy.argsort",
"scarlet.resampling.convert_coordinates",
"numpy.array",
"numpy.sum",
"scarlet.wavelet.mad_wavelet",
"astropy.table.Column",
"astropy.convolution.Gaussian2DKernel",
"scarlet.wav... | [((677, 756), 'scarlet.Frame', 'scarlet.Frame', (['data_lr.images.shape'], {'wcs': 'data_lr.wcs', 'channels': 'data_lr.channels'}), '(data_lr.images.shape, wcs=data_lr.wcs, channels=data_lr.channels)\n', (690, 756), False, 'import scarlet\n'), ((801, 880), 'scarlet.Frame', 'scarlet.Frame', (['data_hr.images.shape'], {'... |
# coding=utf-8
from django.urls import path
from BroadviewCOSS import views
app_name = 'BroadviewCOSS'
urlpatterns = [
path('', views.index),
path('index/', views.index, name='index'),
path('login/', views.login, name='login'),
path('logout/', views.logout, name='logout'),
path('mainframe/', views.... | [
"django.urls.path"
] | [((124, 145), 'django.urls.path', 'path', (['""""""', 'views.index'], {}), "('', views.index)\n", (128, 145), False, 'from django.urls import path\n'), ((151, 192), 'django.urls.path', 'path', (['"""index/"""', 'views.index'], {'name': '"""index"""'}), "('index/', views.index, name='index')\n", (155, 192), False, 'from... |
import numpy as np
import cv2
from keras.layers import Input
from keras.models import Model
from keras.models import load_model
decoder = load_model('roses_decoder.h5')
perceptron = load_model('decoder-perceptron.h5')
path = 'dataset/rose'
id=25 # sample code
param0 = np.loadtxt(path+'{:04d}.txt'.format(id))
id=26 ... | [
"numpy.copy",
"keras.models.load_model",
"numpy.asarray",
"cv2.imshow",
"numpy.zeros",
"cv2.waitKey",
"cv2.destroyAllWindows",
"cv2.resize",
"cv2.createTrackbar",
"cv2.namedWindow"
] | [((139, 169), 'keras.models.load_model', 'load_model', (['"""roses_decoder.h5"""'], {}), "('roses_decoder.h5')\n", (149, 169), False, 'from keras.models import load_model\n'), ((183, 218), 'keras.models.load_model', 'load_model', (['"""decoder-perceptron.h5"""'], {}), "('decoder-perceptron.h5')\n", (193, 218), False, '... |
# -*- coding: utf-8 -*-
# distrib.py
import pandas as pd
import numpy as np
import scipy.integrate
import scipy.interpolate
import matplotlib.pyplot as plt
import matplotlib.font_manager as font_manager
from .utils import grouper
from .plotting import plotVertBar
def integrate(xvec, yvec):
return abs(scipy.integ... | [
"numpy.abs",
"matplotlib.pyplot.grid",
"numpy.sqrt",
"numpy.median",
"matplotlib.pyplot.ylabel",
"numpy.average",
"matplotlib.pyplot.gca",
"matplotlib.font_manager.FontProperties",
"numpy.log",
"matplotlib.pyplot.plot",
"numpy.diff",
"numpy.sum",
"matplotlib.pyplot.figure",
"numpy.linspace... | [((2684, 2711), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(15, 5)'}), '(figsize=(15, 5))\n', (2694, 2711), True, 'import matplotlib.pyplot as plt\n'), ((6911, 6935), 'numpy.sqrt', 'np.sqrt', (['(var + mean ** 2)'], {}), '(var + mean ** 2)\n', (6918, 6935), True, 'import numpy as np\n'), ((6954, 6985),... |
import cryptoMath, sys
def getKey():
print('What is the first key?')
getKey_one = int(input())
print('What is the second key?')
getKey_two = int(input())
return getKey_one, getKey_two
def encrypt(message, key_one, key_two):
symbols = ' abcdefghjklmnopqrstuvwxyz'
new_message = ''
for ... | [
"sys.exit"
] | [((825, 835), 'sys.exit', 'sys.exit', ([], {}), '()\n', (833, 835), False, 'import cryptoMath, sys\n')] |
from django.contrib import admin
from keyvaluestore.models import KeyValueStore
class KeyValueStoreAdmin(admin.ModelAdmin):
list_display = ('key', 'value')
search_fields = ('key', 'value')
admin.site.register(KeyValueStore, KeyValueStoreAdmin)
| [
"django.contrib.admin.site.register"
] | [((202, 256), 'django.contrib.admin.site.register', 'admin.site.register', (['KeyValueStore', 'KeyValueStoreAdmin'], {}), '(KeyValueStore, KeyValueStoreAdmin)\n', (221, 256), False, 'from django.contrib import admin\n')] |
#!/bin/env python
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | [
"os.path.isfile",
"os.getenv"
] | [((987, 1009), 'os.getenv', 'os.getenv', (['"""GIT_PR_ID"""'], {}), "('GIT_PR_ID')\n", (996, 1009), False, 'import os\n'), ((824, 853), 'os.getenv', 'os.getenv', (['"""GITHUB_API_TOKEN"""'], {}), "('GITHUB_API_TOKEN')\n", (833, 853), False, 'import os\n'), ((1118, 1142), 'os.path.isfile', 'os.path.isfile', (['filename'... |
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | [
"onnx.helper.make_graph",
"onnx.helper.make_node",
"numpy.ones",
"os.makedirs",
"paddle.fluid.global_scope",
"onnx.helper.make_tensor_value_info",
"os.path.join",
"onnx.helper.make_model",
"os.path.isdir",
"math.fabs",
"onnx.helper.make_tensor",
"onnx.checker.check_model"
] | [((1961, 2030), 'onnx.helper.make_tensor', 'helper.make_tensor', ([], {'name': 'name', 'data_type': 'dtype', 'dims': 'dims', 'vals': 'value'}), '(name=name, data_type=dtype, dims=dims, vals=value)\n', (1979, 2030), False, 'from onnx import helper, onnx_pb\n'), ((2059, 2128), 'onnx.helper.make_node', 'helper.make_node',... |
import unittest
import sys
sys.path.insert(1, '..')
import easy_gui
class TestGUI(easy_gui.EasyGUI):
def __init__(self):
self.geometry('500x400')
self.add_section('test_section')
self.sections['test_section'].add_widget(type='button', text='Button1', command_func=lambda e: print('Button1 ... | [
"unittest.main",
"sys.path.insert"
] | [((27, 51), 'sys.path.insert', 'sys.path.insert', (['(1)', '""".."""'], {}), "(1, '..')\n", (42, 51), False, 'import sys\n'), ((723, 738), 'unittest.main', 'unittest.main', ([], {}), '()\n', (736, 738), False, 'import unittest\n')] |
# Copyright (C) 2021, Pyronear contributors.
# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.
import requests
from requests.models import Response
import logging
from urllib.parse import urljoin
import io
... | [
"logging.basicConfig",
"requests.post",
"io.BytesIO",
"requests.get",
"urllib.parse.urljoin",
"requests.put"
] | [((429, 450), 'logging.basicConfig', 'logging.basicConfig', ([], {}), '()\n', (448, 450), False, 'import logging\n'), ((2729, 2912), 'requests.post', 'requests.post', (["self.routes['token']"], {'data': 'f"""username={login}&password={password}"""', 'headers': "{'Content-Type': 'application/x-www-form-urlencoded', 'acc... |
import vtk
from paraview import simple
from .elevation import ElevationFilter
class SourceImage:
def __init__(self, grid, terrainFile):
self.zSpacing = 1
self.eScale = 0
self.proxiesToDelete = []
# Build up image grid
self.image = vtk.vtkImageData()
self.image.Set... | [
"paraview.simple.TrivialProducer",
"vtk.vtkImageData",
"paraview.simple.Delete"
] | [((279, 297), 'vtk.vtkImageData', 'vtk.vtkImageData', ([], {}), '()\n', (295, 297), False, 'import vtk\n'), ((632, 656), 'paraview.simple.TrivialProducer', 'simple.TrivialProducer', ([], {}), '()\n', (654, 656), False, 'from paraview import simple\n'), ((1998, 2018), 'paraview.simple.Delete', 'simple.Delete', (['proxy'... |
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.forms import PasswordInput
from django.contrib.auth import authenticate
from account.models import Account
class RegistrationForm(UserCreationForm):
email_errors = {
'required': 'Обязательное поле.',
'inval... | [
"django.contrib.auth.authenticate",
"account.models.Account.objects.exclude",
"django.forms.PasswordInput",
"account.models.Account.objects.filter",
"django.forms.ValidationError",
"django.forms.TextInput"
] | [((1290, 1359), 'django.forms.PasswordInput', 'PasswordInput', ([], {'attrs': "{'placeholder': 'Пароль', 'autocomplete': 'off'}"}), "(attrs={'placeholder': 'Пароль', 'autocomplete': 'off'})\n", (1303, 1359), False, 'from django.forms import PasswordInput\n'), ((1402, 1487), 'django.forms.PasswordInput', 'PasswordInput'... |
import logging
from homeassistant.core import HomeAssistant, State
from .service import ServiceExt
from .state import StateExt
class LightExt:
_logger = logging.getLogger(__name__)
ON_STATE = "on"
OFF_STATE = "off"
UNKNOWN_STATE = ""
@classmethod
def turn_on(cls, hass : Hom... | [
"logging.getLogger"
] | [((170, 197), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (187, 197), False, 'import logging\n')] |
from django.contrib import admin
# Register your models here.
from .models import Huser, Grouper, MemberOf
admin.site.register(Huser)
admin.site.register(Grouper)
admin.site.register(MemberOf)
| [
"django.contrib.admin.site.register"
] | [((110, 136), 'django.contrib.admin.site.register', 'admin.site.register', (['Huser'], {}), '(Huser)\n', (129, 136), False, 'from django.contrib import admin\n'), ((137, 165), 'django.contrib.admin.site.register', 'admin.site.register', (['Grouper'], {}), '(Grouper)\n', (156, 165), False, 'from django.contrib import ad... |
from typing import Optional, List
from thinc.types import Floats2d
from thinc.api import Model, with_cpu
from spacy.attrs import ID, ORTH, PREFIX, SUFFIX, SHAPE, LOWER
from spacy.util import registry
from spacy.tokens import Doc
# TODO: replace with registered layer after spacy v3.0.7
from spacy.ml import extract_ngra... | [
"spacy.util.registry.get",
"thinc.api.with_cpu",
"thinc.api.Model.define_operators",
"spacy.ml.extract_ngrams"
] | [((775, 809), 'spacy.util.registry.get', 'registry.get', (['"""layers"""', '"""chain.v1"""'], {}), "('layers', 'chain.v1')\n", (787, 809), False, 'from spacy.util import registry\n'), ((828, 868), 'spacy.util.registry.get', 'registry.get', (['"""layers"""', '"""reduce_mean.v1"""'], {}), "('layers', 'reduce_mean.v1')\n"... |
# /usr/bin/python
# encoding=utf-8
import os
import sys
import click
import functools
def singleton(cls):
_instance = {}
def inner(*args, **kwargs):
if cls not in _instance:
_instance[cls] = cls(*args, **kwargs)
return _instance[cls]
return inner
# class singleton(object):
# ... | [
"prettytable.PrettyTable",
"click.Choice",
"click.make_pass_decorator",
"click.group",
"click.option",
"functools.wraps",
"click.echo",
"random.random"
] | [((2851, 2898), 'click.make_pass_decorator', 'click.make_pass_decorator', (['Product'], {'ensure': '(True)'}), '(Product, ensure=True)\n', (2876, 2898), False, 'import click\n'), ((2902, 2977), 'click.group', 'click.group', ([], {'invoke_without_command': '(True)', 'context_settings': 'CONTEXT_SETTINGS'}), '(invoke_wit... |
#!/usr/bin/env python
import argparse
import csv
import datetime
import os
import pytz
import gspread
from oauth2client.service_account import ServiceAccountCredentials
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from stravalib.client import Client
from stravalib.model import Activity
fr... | [
"csv.DictWriter",
"pytz.timezone",
"db.ChallengeSqlDB.get_all_intania_users",
"db.ChallengeSqlDB.get_all_runs",
"db.ChallengeSqlDB.get_all_users",
"os.makedirs",
"argparse.ArgumentParser",
"gspread.authorize",
"os.path.join",
"db.ChallengeSqlDB.get_summary_ranger_distance",
"pydrive.auth.GoogleA... | [((2492, 2570), 'db.ChallengeSqlDB.init', 'ChallengeSqlDB.init', (['MYSQL_HOST', 'MYSQL_USERNAME', 'MYSQL_PASSWORD', 'MYSQL_DB_NAME'], {}), '(MYSQL_HOST, MYSQL_USERNAME, MYSQL_PASSWORD, MYSQL_DB_NAME)\n', (2511, 2570), False, 'from db import ChallengeSqlDB\n'), ((2681, 2719), 'db.ChallengeSqlDB.get_all_intania_users', ... |
from functools import partial
from asciimatics import widgets
from asciimatics.event import KeyboardEvent
from asciimatics.screen import Screen
from asciimatics.widgets import Layout
from groklog.filter_manager import FilterManager
from groklog.process_node import ShellProcessIO
from groklog.ui.filter_viewer import F... | [
"asciimatics.widgets.Layout",
"asciimatics.widgets.Divider",
"groklog.ui.terminal.Terminal",
"asciimatics.screen.Screen.ctrl",
"groklog.ui.filter_viewer.FilterViewer",
"functools.partial",
"asciimatics.widgets.VerticalDivider"
] | [((956, 986), 'asciimatics.widgets.Layout', 'Layout', (['[100]'], {'fill_frame': '(True)'}), '([100], fill_frame=True)\n', (962, 986), False, 'from asciimatics.widgets import Layout\n'), ((1172, 1201), 'asciimatics.widgets.Layout', 'Layout', (['[1, 0, 1, 1, 1, 1, 1]'], {}), '([1, 0, 1, 1, 1, 1, 1])\n', (1178, 1201), Fa... |
from kairon import cli
import logging
if __name__ == "__main__":
logging.basicConfig(level="DEBUG")
cli()
| [
"logging.basicConfig",
"kairon.cli"
] | [((70, 104), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': '"""DEBUG"""'}), "(level='DEBUG')\n", (89, 104), False, 'import logging\n'), ((109, 114), 'kairon.cli', 'cli', ([], {}), '()\n', (112, 114), False, 'from kairon import cli\n')] |
# -*- coding: utf-8 -*-
from setuptools import find_packages, setup
with open("README.md") as f:
long_description = f.read()
with open("requirements.txt", "r") as f:
required = f.read().splitlines()
setup(
name="alepython",
description="Python Accumulated Local Effects (ALE) package.",
author="<... | [
"setuptools.find_packages"
] | [((821, 847), 'setuptools.find_packages', 'find_packages', ([], {'where': '"""src"""'}), "(where='src')\n", (834, 847), False, 'from setuptools import find_packages, setup\n')] |
from http import HttpRequest, get_file_md5, HttpResponse
if __name__ == '__main__':
data = """GET /dir/test2.html HTTP/1.1
Host: detectportal.firefox.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0
Accept: */*
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en... | [
"http.HttpResponse"
] | [((1178, 1242), 'http.HttpResponse', 'HttpResponse', (['(200)', 'requ.path', '"""c293bc4cf5fe9da8d94898e38d9b5726"""'], {}), "(200, requ.path, 'c293bc4cf5fe9da8d94898e38d9b5726')\n", (1190, 1242), False, 'from http import HttpRequest, get_file_md5, HttpResponse\n'), ((1317, 1347), 'http.HttpResponse', 'HttpResponse', (... |
from django.urls import path
from . import views
urlpatterns = [
path('owner/<int:owner_id>', views.index),
]
| [
"django.urls.path"
] | [((70, 111), 'django.urls.path', 'path', (['"""owner/<int:owner_id>"""', 'views.index'], {}), "('owner/<int:owner_id>', views.index)\n", (74, 111), False, 'from django.urls import path\n')] |
import sys
import pyshorteners
def shorten_url(url):
s = pyshorteners.Shortener()
short_url = s.tinyurl.short(url)
return short_url
def get_code(authorize_url):
sys.stderr.write("\x1b[2J\x1b[H")
short_url = shorten_url(authorize_url)
"""Show authorization URL and return the code the user wrote... | [
"sys.stderr.write",
"pyshorteners.Shortener",
"builtins.input"
] | [((62, 86), 'pyshorteners.Shortener', 'pyshorteners.Shortener', ([], {}), '()\n', (84, 86), False, 'import pyshorteners\n'), ((179, 212), 'sys.stderr.write', 'sys.stderr.write', (['"""\x1b[2J\x1b[H"""'], {}), "('\\x1b[2J\\x1b[H')\n", (195, 212), False, 'import sys\n'), ((392, 414), 'sys.stderr.write', 'sys.stderr.write... |
from PyQt5 import QtGui, QtCore
from PyQt5.QtWidgets import QDialog
from src.custom_signals import CustomSignals
from src.qt_ui.dynamics_dialog_ui import Ui_DynamicsDialog
class DynamicsDialog(QDialog):
"""Widget provides input of two values: total_time - limit of time that all data collection would take,
an... | [
"src.qt_ui.dynamics_dialog_ui.Ui_DynamicsDialog",
"PyQt5.QtCore.QRegExp",
"src.custom_signals.CustomSignals",
"PyQt5.QtGui.QRegExpValidator"
] | [((488, 507), 'src.qt_ui.dynamics_dialog_ui.Ui_DynamicsDialog', 'Ui_DynamicsDialog', ([], {}), '()\n', (505, 507), False, 'from src.qt_ui.dynamics_dialog_ui import Ui_DynamicsDialog\n'), ((608, 623), 'src.custom_signals.CustomSignals', 'CustomSignals', ([], {}), '()\n', (621, 623), False, 'from src.custom_signals impor... |
# Copyright 2017 The Tulsi Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | [
"json.dumps",
"bazel_build_events._FileLineReader",
"bazel_build_events.BazelBuildEvent",
"unittest.main",
"io.StringIO",
"bazel_build_events.BazelBuildEventsWatcher"
] | [((3363, 3378), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3376, 3378), False, 'import unittest\n'), ((1533, 1546), 'io.StringIO', 'io.StringIO', ([], {}), '()\n', (1544, 1546), False, 'import io\n'), ((1647, 1692), 'bazel_build_events._FileLineReader', 'bazel_build_events._FileLineReader', (['test_file'], {}... |
from django.db import models
from apps.metadata.songs.models import Song
from apps.metadata.users.models import User
class UserPreference(models.Model):
user = models.ForeignKey(User, unique=False, on_delete=models.CASCADE)
song = models.ForeignKey(Song, unique=False, related_name='song', on_delete=models.CA... | [
"django.db.models.IntegerField",
"django.db.models.ForeignKey"
] | [((167, 230), 'django.db.models.ForeignKey', 'models.ForeignKey', (['User'], {'unique': '(False)', 'on_delete': 'models.CASCADE'}), '(User, unique=False, on_delete=models.CASCADE)\n', (184, 230), False, 'from django.db import models\n'), ((242, 331), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Song'], {'uniq... |
#
# PlotView.py -- base class for plot viewer
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import logging
import numpy as np
from ginga.misc import Callback, Settings
from ginga import AstroImage
from ginga.gw import Widgets
try:
from ginga.gw imp... | [
"ginga.gw.Widgets.build_info",
"ginga.gw.Widgets.SaveDialog",
"ginga.misc.Callback.Callbacks.__init__",
"ginga.util.plots.Plot",
"ginga.gw.Plot.PlotWidget",
"logging.Logger",
"ginga.misc.Settings.SettingGroup",
"ginga.gw.Widgets.VBox"
] | [((975, 1008), 'ginga.misc.Callback.Callbacks.__init__', 'Callback.Callbacks.__init__', (['self'], {}), '(self)\n', (1002, 1008), False, 'from ginga.misc import Callback, Settings\n'), ((1823, 1837), 'ginga.gw.Widgets.VBox', 'Widgets.VBox', ([], {}), '()\n', (1835, 1837), False, 'from ginga.gw import Widgets\n'), ((189... |
"""
glucoseDataFrame.py
Creates a dataframe of glucose related statistics
in diabetics for predictive analysis.
"""
import sys
import os
import math
from datetime import *
from dateutil.parser import parse
import pandas as pd
import numpy as np
sys.path.append("..") # proper file path for importing local modules
from... | [
"dateutil.parser.parse",
"pandas.read_csv",
"pythonScripts.jsonToCsv.convertToCsv",
"os.path.join",
"os.getcwd",
"numpy.array",
"pandas.concat",
"os.path.basename",
"pandas.DataFrame",
"pandas.notnull",
"sys.path.append"
] | [((247, 268), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (262, 268), False, 'import sys\n'), ((2268, 2282), 'pythonScripts.jsonToCsv.convertToCsv', 'convertToCsv', ([], {}), '()\n', (2280, 2282), False, 'from pythonScripts.jsonToCsv import convertToCsv\n'), ((2302, 2337), 'os.path.basename', ... |
import json
from importlib import resources
bpe_merges = []
for line in resources.open_text(__name__, 'bpe_merges.jsonl'):
bpe_merges.append(tuple(json.loads(line)))
| [
"importlib.resources.open_text",
"json.loads"
] | [((75, 124), 'importlib.resources.open_text', 'resources.open_text', (['__name__', '"""bpe_merges.jsonl"""'], {}), "(__name__, 'bpe_merges.jsonl')\n", (94, 124), False, 'from importlib import resources\n'), ((154, 170), 'json.loads', 'json.loads', (['line'], {}), '(line)\n', (164, 170), False, 'import json\n')] |
import logging
from .sources import wcota
logger = logging.getLogger()
def load_brazillian_dataset(source):
logger.info("Loading %s data", source)
if source == "wcota":
dataset = wcota.WCotaDataset()
else:
raise ValueError(f"Dataset Could not be Retrived: {source!r}, is it available?")
... | [
"logging.getLogger"
] | [((52, 71), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (69, 71), False, 'import logging\n')] |
# Copyright 2013-2021 The Salish Sea MEOPAR contributors
# and The University of British Columbia
#
# 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
#
# https://www.apache.org/licenses/... | [
"collections.namedtuple",
"salishsea_tools.wind_tools.wind_speed_dir",
"salishsea_tools.stormtools.storm_surge_risk_level",
"nowcast.figures.shared.plot_risk_level_marker",
"nowcast.figures.shared.get_tides",
"nowcast.figures.shared.find_ssh_max",
"matplotlib.pyplot.figure",
"matplotlib.gridspec.GridS... | [((4396, 4517), 'collections.namedtuple', 'namedtuple', (['"""PlotData"""', '"""ssh_ts, max_ssh, max_ssh_time, risk_levels, u_wind_4h_avg, v_wind_4h_avg, max_wind_avg"""'], {}), "('PlotData',\n 'ssh_ts, max_ssh, max_ssh_time, risk_levels, u_wind_4h_avg, v_wind_4h_avg, max_wind_avg'\n )\n", (4406, 4517), False, 'f... |
import logging
from datetime import datetime, timedelta
logger = logging.getLogger(__name__)
def print_full_report(sessions):
if len(sessions) > 1:
for index, session in enumerate(sessions):
finish_time = session.finishTime or datetime.now()
logger.warn("")
logger.warn... | [
"logging.getLogger",
"datetime.datetime.now",
"datetime.timedelta"
] | [((66, 93), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (83, 93), False, 'import logging\n'), ((1423, 1435), 'datetime.timedelta', 'timedelta', (['(0)'], {}), '(0)\n', (1432, 1435), False, 'from datetime import datetime, timedelta\n'), ((1509, 1523), 'datetime.datetime.now', 'datetime.... |
import json
from dataclasses import dataclass
from enum import *
from typing import List
import requests
class ConnectorError(Exception):
pass
class ResponseType(Enum):
ERROR = auto()
RESULT = auto()
FORBIDDEN = auto()
SUCCESS = auto()
SYNTAX_ERROR = auto()
class ResultType(Enum):
REL... | [
"json.dumps"
] | [((3876, 3895), 'json.dumps', 'json.dumps', (['payload'], {}), '(payload)\n', (3886, 3895), False, 'import json\n')] |
# SDP: Subscription Data Protocol
import traceback
from asyncio import get_event_loop
import asyncio
import websockets
import json
from datetime import datetime
#import pytz
from rethinkdb import r
#from flatten_dict import flatten, unflatten
#from dotenv import load_dotenv
#import os
#load_dotenv()
#URI_DATABASE = o... | [
"datetime.datetime.utcfromtimestamp",
"json.loads",
"json.dumps",
"traceback.print_tb",
"asyncio.get_event_loop",
"rethinkdb.r.connect"
] | [((391, 420), 'rethinkdb.r.connect', 'r.connect', (['"""localhost"""', '(28015)'], {}), "('localhost', 28015)\n", (400, 420), False, 'from rethinkdb import r\n'), ((2226, 2258), 'json.dumps', 'json.dumps', (['data'], {'default': 'helper'}), '(data, default=helper)\n', (2236, 2258), False, 'import json\n'), ((3858, 3893... |
# -*- coding: utf-8 -*-
# Copyright 2018 <NAME> <<EMAIL>>
#
# 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 ... | [
"logging.getLogger",
"schema.Optional",
"fnmatch.fnmatchcase",
"schema.Schema",
"os.putenv",
"os.environ.copy",
"deployer.result.Result",
"os.unsetenv",
"schema.And"
] | [((1126, 1153), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1143, 1153), False, 'import logging\n'), ((1256, 1271), 'schema.Optional', 'Optional', (['"""set"""'], {}), "('set')\n", (1264, 1271), False, 'from schema import Optional\n'), ((1313, 1330), 'schema.Optional', 'Optional', (['... |
#!/usr/bin/env python
import numpy as np
dim = 3
A = np.ones(shape=(dim, dim))
B = A.copy()
b = np.empty(dim)
for i in range(dim):
b[i] = i + 2
print('A')
print(A)
print('b')
print(b)
for j in range(dim):
A[:, j] *= b[j]
print('% (1)')
print(A)
print('% (2)')
print(B * b)
| [
"numpy.empty",
"numpy.ones"
] | [((56, 81), 'numpy.ones', 'np.ones', ([], {'shape': '(dim, dim)'}), '(shape=(dim, dim))\n', (63, 81), True, 'import numpy as np\n'), ((99, 112), 'numpy.empty', 'np.empty', (['dim'], {}), '(dim)\n', (107, 112), True, 'import numpy as np\n')] |
from google.oauth2 import service_account
from googleapiclient.discovery import build
from os import path
from googleapiclient.http import MediaFileUpload
class Gdrive:
"""A class represent google drive."""
def __init__(self, credentials_filepath, scopes, download_dir, upload_dir):
"""
:str c... | [
"os.path.join",
"googleapiclient.discovery.build",
"googleapiclient.http.MediaFileUpload",
"google.oauth2.service_account.Credentials.from_service_account_file"
] | [((995, 1100), 'google.oauth2.service_account.Credentials.from_service_account_file', 'service_account.Credentials.from_service_account_file', (['self.credentials_filepath'], {'scopes': 'self.scopes'}), '(self.\n credentials_filepath, scopes=self.scopes)\n', (1048, 1100), False, 'from google.oauth2 import service_ac... |
#
# python_grabber
#
import cv2
import numpy as np
def save_image(filename, img):
cv2.imwrite(filename, img)
def sepia(img):
kernel = np.float32([
[0.272, 0.534, 0.131],
[0.349, 0.686, 0.168],
[0.393, 0.769, 0.189]])
return cv2.transform(img, kernel)
def edge_preserving(img):
... | [
"cv2.imwrite",
"cv2.transform",
"cv2.pencilSketch",
"cv2.edgePreservingFilter",
"cv2.stylization",
"numpy.float32"
] | [((89, 115), 'cv2.imwrite', 'cv2.imwrite', (['filename', 'img'], {}), '(filename, img)\n', (100, 115), False, 'import cv2\n'), ((147, 233), 'numpy.float32', 'np.float32', (['[[0.272, 0.534, 0.131], [0.349, 0.686, 0.168], [0.393, 0.769, 0.189]]'], {}), '([[0.272, 0.534, 0.131], [0.349, 0.686, 0.168], [0.393, 0.769, \n ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
def match_sxz(noun):
return re.search('[sxz]$',noun)
def apply_sxz(noun):
return re.sub('$','es',noun)
def match_h(noun):
return re.search('[^aeioudgkprt]h$',noun)
def apply_h(noun):
return re.sub('$','es',noun)
def match_y(noun):
return re.... | [
"re.sub",
"re.search"
] | [((91, 116), 're.search', 're.search', (['"""[sxz]$"""', 'noun'], {}), "('[sxz]$', noun)\n", (100, 116), False, 'import re\n'), ((148, 171), 're.sub', 're.sub', (['"""$"""', '"""es"""', 'noun'], {}), "('$', 'es', noun)\n", (154, 171), False, 'import re\n'), ((200, 235), 're.search', 're.search', (['"""[^aeioudgkprt]h$"... |
# Extrahiert die Transaktionen aus dem Mempool
def getTxnsFromPool(MasterObj):
rwo = list()
for i in MasterObj.mempool: rwo.append(i); MasterObj.mempool.remove(i); print('Transaction {} selected'.format(i.getTxHash()))
return rwo
# Gibt die Höhe aller Gebühren welche verwendet werden an
def getTra... | [
"apollon.block.MinedBlock.fromConstructWithNonce",
"apollon.transaction.CoinbaseTransaction",
"binascii.hexlify",
"apollon.utxo.createFeeInputUtxo",
"multiprocessing.get_context",
"apollon.utxo.LagacyOutUtxo",
"time.sleep",
"threading.Thread",
"time.time",
"apollon.atime.ATimeString.now"
] | [((710, 721), 'time.time', 'time.time', ([], {}), '()\n', (719, 721), False, 'import time\n'), ((904, 927), 'binascii.hexlify', 'binascii.hexlify', (['hashy'], {}), '(hashy)\n', (920, 927), False, 'import time, datetime, struct, binascii, pycryptonight, time\n'), ((8224, 8261), 'threading.Thread', 'threading.Thread', (... |
from math import cos, sin, exp, pi
from scipy.special import roots_legendre
from typing import Callable as Call
class Integrator(object):
def __init__(self, lm: list[list[float]], n: list[int], fn: list[int]):
self.lm = lm
self.n = n
self.f1 = Integrator.simpson if (fn[0]) else Integrator.... | [
"math.cos",
"math.sin",
"scipy.special.roots_legendre"
] | [((1651, 1668), 'scipy.special.roots_legendre', 'roots_legendre', (['n'], {}), '(n)\n', (1665, 1668), False, 'from scipy.special import roots_legendre\n'), ((1006, 1012), 'math.sin', 'sin', (['x'], {}), '(x)\n', (1009, 1012), False, 'from math import cos, sin, exp, pi\n'), ((893, 899), 'math.cos', 'cos', (['x'], {}), '... |
from collections import defaultdict
import itertools
from skorch.net import NeuralNet
from skorch.dataset import Dataset
import pandas as pd
from sklearn import preprocessing
from tqdm import tqdm
import more_itertools as mit
import numpy as np
import skorch
import torch
import logging
logging.getLogger('matplotlib').... | [
"logging.getLogger",
"sklearn.preprocessing.LabelEncoder",
"logging.debug",
"numpy.where",
"tqdm.tqdm",
"torch.Tensor",
"numpy.stack",
"torch.tensor",
"torch.cuda.is_available",
"collections.defaultdict",
"numpy.isnan",
"skorch.dataset.Dataset",
"torch.no_grad",
"pandas.concat"
] | [((288, 319), 'logging.getLogger', 'logging.getLogger', (['"""matplotlib"""'], {}), "('matplotlib')\n", (305, 319), False, 'import logging\n'), ((1754, 1771), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (1765, 1771), False, 'from collections import defaultdict\n'), ((1843, 1895), 'logging.debu... |
#
# Copyright (c) 2020 Xilinx, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
# Bif file format
from roast.component.bif.generate import Header, Component, Block
tcase_type = "copymem"
result_msg = "Boot PDI Load: Done"
id_load_list = ["0x1C000000"]
bootheader = "image_config {{bh_auth_enable}}\n \
psk... | [
"roast.component.bif.generate.Component",
"roast.component.bif.generate.Header"
] | [((601, 626), 'roast.component.bif.generate.Header', 'Header', ([], {'name': '"""pmc_subsys"""'}), "(name='pmc_subsys')\n", (607, 626), False, 'from roast.component.bif.generate import Header, Component, Block\n'), ((897, 924), 'roast.component.bif.generate.Header', 'Header', ([], {'header': '"""metaheader"""'}), "(hea... |
# /*
# * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# * SPDX-License-Identifier: MIT-0
# *
# * 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 restrict... | [
"aws_cdk.aws_sns.Topic",
"aws_cdk.aws_sns.Subscription"
] | [((1294, 1369), 'aws_cdk.aws_sns.Topic', 'sns.Topic', (['self', '"""SNSAlertEmailTopic"""'], {'topic_name': '"""dms-failure-alert-topic"""'}), "(self, 'SNSAlertEmailTopic', topic_name='dms-failure-alert-topic')\n", (1303, 1369), True, 'import aws_cdk.aws_sns as sns\n'), ((1437, 1589), 'aws_cdk.aws_sns.Subscription', 's... |
'''https://practice.geeksforgeeks.org/problems/zigzag-tree-traversal/1
ZigZag Tree Traversal
Easy Accuracy: 49.78% Submissions: 50529 Points: 2
Given a Binary Tree. Find the Zig-Zag Level Order Traversal of the Binary Tree.
Example 1:
Input:
3
/ \
2 1
Output:
3 1 2
Example 2:
Input:
... | [
"collections.deque"
] | [((2539, 2546), 'collections.deque', 'deque', ([], {}), '()\n', (2544, 2546), False, 'from collections import deque\n')] |
from dagster import check
from dagster.core.host_representation.external_data import ExternalPartitionData
from dagster.core.host_representation.handle import RepositoryHandle
from .utils import execute_unary_api_cli_command
def sync_get_external_partition(repository_handle, partition_set_name, partition_name):
... | [
"dagster.cli.api.PartitionApiCommandArgs",
"dagster.check.inst_param",
"dagster.check.str_param"
] | [((377, 451), 'dagster.check.inst_param', 'check.inst_param', (['repository_handle', '"""repository_handle"""', 'RepositoryHandle'], {}), "(repository_handle, 'repository_handle', RepositoryHandle)\n", (393, 451), False, 'from dagster import check\n'), ((456, 513), 'dagster.check.str_param', 'check.str_param', (['parti... |
import contextlib
import os
import pathlib
import pytest
FIXTURE_DIR = pathlib.Path(os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'fixtures'
))
@pytest.fixture
def fixture_file():
def _fixture_file(*args):
return pathlib.Path(os.path.join(FIXTURE_DIR, *args))
return _fixture_fil... | [
"pathlib.Path.cwd",
"os.path.realpath",
"os.chdir",
"os.path.join"
] | [((396, 414), 'pathlib.Path.cwd', 'pathlib.Path.cwd', ([], {}), '()\n', (412, 414), False, 'import pathlib\n'), ((419, 433), 'os.chdir', 'os.chdir', (['path'], {}), '(path)\n', (427, 433), False, 'import os\n'), ((478, 495), 'os.chdir', 'os.chdir', (['curpath'], {}), '(curpath)\n', (486, 495), False, 'import os\n'), ((... |
#!/usr/bin/env python
# Script for running FSL motion correction
# It's run with the framewise displacement option thres 0.9 per Siegel et al. 2014 HBM
#
# ipython bold-fsl-pp-motcor.py
import numpy as np
import os
import glob
## Study directory
studydir = '/mnt/40TB-raid6/Experiments/FCTM_S/FCTM_S_Data/Analyses'
#... | [
"os.path.isfile",
"os.path.dirname",
"os.path.isdir",
"os.system",
"glob.glob"
] | [((663, 740), 'glob.glob', 'glob.glob', (["('%s/1[0-9][0-9][0-9][0-9]/func/B_hab_[1-9]_trrm.nii.gz' % studydir)"], {}), "('%s/1[0-9][0-9][0-9][0-9]/func/B_hab_[1-9]_trrm.nii.gz' % studydir)\n", (672, 740), False, 'import glob\n'), ((2147, 2195), 'os.system', 'os.system', (["('pandoc %s -o %s' % (outhtml, outpdf))"], {}... |
# No shebang line, this module is meant to be imported
#
# Copyright 2015 <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 r... | [
"pyfarm.core.config.Configuration",
"functools.partial",
"pyfarm.core.config.read_env_bool"
] | [((1094, 1129), 'functools.partial', 'partial', (['read_env'], {'log_result': '(False)'}), '(read_env, log_result=False)\n', (1101, 1129), False, 'from functools import partial\n'), ((1147, 1184), 'functools.partial', 'partial', (['read_env_bool'], {'default': '(False)'}), '(read_env_bool, default=False)\n', (1154, 118... |
#!/usr/bin/env python3
import os
import requests
import sys
from argparse import ArgumentParser
parser = ArgumentParser(
description=(
'weather: Get the current weather information'
'for your zipcode.'
)
)
parser.add_argument(
'zip',
help='zip code to get the weather for'
)
parser.add... | [
"requests.get",
"sys.exit",
"argparse.ArgumentParser",
"os.getenv"
] | [((108, 204), 'argparse.ArgumentParser', 'ArgumentParser', ([], {'description': '"""weather: Get the current weather informationfor your zipcode."""'}), "(description=\n 'weather: Get the current weather informationfor your zipcode.')\n", (122, 204), False, 'from argparse import ArgumentParser\n'), ((569, 593), 'os.... |
import pathlib
import typing
import urllib.parse
_PLUGIN_DIR = pathlib.Path(__file__).parent
PLUGIN_DIR = str(_PLUGIN_DIR)
CONFIGS_DIR = str(_PLUGIN_DIR.joinpath('configs'))
SCRIPTS_DIR = str(_PLUGIN_DIR.joinpath('scripts'))
def scan_sql_directory(root: str) -> typing.List[pathlib.Path]:
return [
path
... | [
"pathlib.Path"
] | [((64, 86), 'pathlib.Path', 'pathlib.Path', (['__file__'], {}), '(__file__)\n', (76, 86), False, 'import pathlib\n'), ((345, 363), 'pathlib.Path', 'pathlib.Path', (['root'], {}), '(root)\n', (357, 363), False, 'import pathlib\n')] |
from base64 import urlsafe_b64encode
import dash_core_components as dcc
import dash_bootstrap_components as dbc
import dash_html_components as html
from dash.dependencies import Input, Output
import dash_defer_js_import as dji
import dash_table as dt
from app import app, server
from pages import single_ticker, portfo... | [
"dash_bootstrap_components.NavLink",
"dash.dependencies.Output",
"dash_core_components.Location",
"dash_bootstrap_components.Container",
"dash.dependencies.Input",
"dash_defer_js_import.Import",
"dash_core_components.Markdown",
"app.app.run_server",
"dash_table.DataTable"
] | [((1484, 1518), 'dash.dependencies.Output', 'Output', (['"""page_content"""', '"""children"""'], {}), "('page_content', 'children')\n", (1490, 1518), False, 'from dash.dependencies import Input, Output\n'), ((1920, 1936), 'app.app.run_server', 'app.run_server', ([], {}), '()\n', (1934, 1936), False, 'from app import ap... |
""" A container to store latest known prices for a list of symbols """
import logging
from datetime import datetime
from market.tick_data import TickData
class MarketData:
def __init__(self):
self.__recent_ticks__ = dict()
def add_last_price(self,
time: datetime,
... | [
"market.tick_data.TickData"
] | [((584, 662), 'market.tick_data.TickData', 'TickData', ([], {'symbol': 'symbol', 'last_price': 'price', 'total_volume': 'volume', 'timestamp': 'time'}), '(symbol=symbol, last_price=price, total_volume=volume, timestamp=time)\n', (592, 662), False, 'from market.tick_data import TickData\n'), ((1261, 1284), 'market.tick_... |
""" This example shows, what a module for
providing dynamic weldx functions like parameter calculations, e.g. could look like """
import asdf
import weldx
import weldx.asdf
from weldx import Q_ # pint quantity from the weldx package
from weldx.asdf.extension import WeldxAsdfExtension, WeldxExtension
from weldx.weldin... | [
"weldx.welding.groove.iso_9692_1._create_test_grooves",
"weldx.asdf.util.write_buffer",
"asdf.AsdfFile",
"weldx.Q_",
"weldx.asdf.util.get_yaml_header",
"weldx.welding.processes.GmawProcess"
] | [((798, 822), 'asdf.AsdfFile', 'asdf.AsdfFile', (['file.tree'], {}), '(file.tree)\n', (811, 822), False, 'import asdf\n'), ((880, 893), 'weldx.Q_', 'Q_', (['(700)', '"""mm"""'], {}), "(700, 'mm')\n", (882, 893), False, 'from weldx import Q_\n'), ((1180, 1204), 'asdf.AsdfFile', 'asdf.AsdfFile', (['file.tree'], {}), '(fi... |
import os
import numpy as np
import torch
import matplotlib.pyplot as plt
import cv2
import rlkit.torch.sac.diayn
from .mode_actions_sampler import ModeActionSampler
from network import ModeDisentanglingNetwork
from env import DmControlEnvForPytorchBothObstype
class DisentanglingTester:
def __init__(self,
... | [
"torch.manual_seed",
"os.makedirs",
"torch.load",
"os.path.join",
"torch.from_numpy",
"torch.cuda.is_available",
"numpy.random.seed",
"cv2.VideoWriter_fourcc",
"torch.no_grad"
] | [((990, 1013), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (1007, 1013), False, 'import torch\n'), ((1022, 1042), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (1036, 1042), True, 'import numpy as np\n'), ((1260, 1297), 'os.makedirs', 'os.makedirs', (['video_dir'], {'exist... |
import day18.src as src
def test_part1():
assert src.part1(src.TEST1_INPUT_FILE, 4) == 4
def test_part1_full():
assert src.part1(src.FULL_INPUT_FILE) == 768
def test_part2():
assert src.part2(src.TEST2_INPUT_FILE, 5) == 17
def test_part2_full():
assert src.part2(src.FULL_INPUT_FILE) == 781
| [
"day18.src.part2",
"day18.src.part1"
] | [((55, 89), 'day18.src.part1', 'src.part1', (['src.TEST1_INPUT_FILE', '(4)'], {}), '(src.TEST1_INPUT_FILE, 4)\n', (64, 89), True, 'import day18.src as src\n'), ((131, 161), 'day18.src.part1', 'src.part1', (['src.FULL_INPUT_FILE'], {}), '(src.FULL_INPUT_FILE)\n', (140, 161), True, 'import day18.src as src\n'), ((200, 23... |
import requests
from os import system
import time
import warnings
import pyfiglet
from colorama import init
from termcolor import colored
result1 = pyfiglet.figlet_format("Ping Trace")
result2 = pyfiglet.figlet_format("By <NAME>", font = "digital" )
init()
print(colored(result1, 'green'))
print(colored(r... | [
"termcolor.colored",
"pyfiglet.figlet_format",
"requests.get",
"time.sleep",
"os.system",
"warnings.filterwarnings",
"colorama.init"
] | [((157, 193), 'pyfiglet.figlet_format', 'pyfiglet.figlet_format', (['"""Ping Trace"""'], {}), "('Ping Trace')\n", (179, 193), False, 'import pyfiglet\n'), ((205, 256), 'pyfiglet.figlet_format', 'pyfiglet.figlet_format', (['"""By <NAME>"""'], {'font': '"""digital"""'}), "('By <NAME>', font='digital')\n", (227, 256), Fal... |
import argparse
from pathlib import Path
from rabbit_context import RabbitContext
def publish_messages_from_json_file_path(queue_name: str, source_file_path: Path, destination_file_path: Path):
"""
NB: this exists to support the single (JSON) file model and should not be used with the new style (dump) files
... | [
"rabbit_context.RabbitContext",
"argparse.ArgumentParser"
] | [((1065, 1172), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Publish each file in a directory as a message to a rabbit queue"""'}), "(description=\n 'Publish each file in a directory as a message to a rabbit queue')\n", (1088, 1172), False, 'import argparse\n'), ((337, 373), 'rabbit... |
from dns_messages.utilities import decode_character_string
from typing import List
from .items import *
from .resource_record import ResourceRecord
from ...utilities.character_string_encoder_and_decoder import encode_character_string
class HINFO(ResourceRecord):
def __init__(self, name: str, rr_class: RRClass, tt... | [
"dns_messages.utilities.decode_character_string"
] | [((836, 929), 'dns_messages.utilities.decode_character_string', 'decode_character_string', ([], {'raw_bytes': 'raw_bytes', 'raw_bits': 'raw_bits', 'byte_offset': 'byte_offset'}), '(raw_bytes=raw_bytes, raw_bits=raw_bits, byte_offset\n =byte_offset)\n', (859, 929), False, 'from dns_messages.utilities import decode_ch... |
import unittest
from model.spent_time_records import WorkedDay, WorkedTask
class TestWorkedDay(unittest.TestCase):
def test_hours_normalization_one(self):
tasks = [
self.__workedTask('PZ--001.001', None, 'Scrum', '00:29:10'),
self.__workedTask('PZ--001.001', None, 'Infomeeting', '0... | [
"unittest.main",
"model.spent_time_records.WorkedDay",
"datetime.datetime.strptime"
] | [((1927, 1942), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1940, 1942), False, 'import unittest\n'), ((432, 448), 'model.spent_time_records.WorkedDay', 'WorkedDay', (['tasks'], {}), '(tasks)\n', (441, 448), False, 'from model.spent_time_records import WorkedDay, WorkedTask\n'), ((1326, 1342), 'model.spent_tim... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
def get_requirements(name):
with open(name) as f:
return f.read().splitlines()
install_requires = []
tests_require = [
'pytest',
'pytest-cov',
]
docs_require = [
'sphinx',
'sphinx_rtd_theme',
]
li... | [
"setuptools.find_packages"
] | [((646, 672), 'setuptools.find_packages', 'find_packages', ([], {'where': '"""src"""'}), "(where='src')\n", (659, 672), False, 'from setuptools import setup, find_packages\n')] |
from pyspark.sql import SparkSession
if __name__ == "__main__":
spark = SparkSession \
.builder \
.config("spark.python.profile", "true") \
.config("spark.sql.execution.arrow.enabled", "true") \
.getOrCreate()
df = spark.read.format("CustomDataSource").load()
df.printSchema()
pdf = d... | [
"pyspark.sql.SparkSession.builder.config"
] | [((78, 137), 'pyspark.sql.SparkSession.builder.config', 'SparkSession.builder.config', (['"""spark.python.profile"""', '"""true"""'], {}), "('spark.python.profile', 'true')\n", (105, 137), False, 'from pyspark.sql import SparkSession\n')] |
import sys
track_hub_text = """#############
track composite_name
compositeTrack on
type bigWig 0 1000
priority 9.5
visibility full
shortLabel composite_name
longLabel composite_name
track fw_name
parent composite_name
type bigWig 0 1000
visibility full
bigDataUrl fw_url
longLabel fw_name
shortLabel fw_name
negateVa... | [
"sys.exit"
] | [((2033, 2044), 'sys.exit', 'sys.exit', (['(1)'], {}), '(1)\n', (2041, 2044), False, 'import sys\n')] |
import unittest
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "../../../"))
import numpy as np
import tensorflow as tf
from sklearn.cross_validation import train_test_split
from sklearn.metrics import classification_report
from model.proposal.vector_rnn.model import VectoredRNN, VectoredR... | [
"os.path.exists",
"tensorflow.Graph",
"tensorflow.compat.as_str",
"os.makedirs",
"tensorflow.Session",
"model.proposal.vector_rnn.model.VectoredRNNInterface",
"model.proposal.vector_rnn.trainer.VectorRNNTrainer",
"os.path.dirname",
"model.dataset.dbd_reader.DbdReader",
"unittest.main"
] | [((3692, 3707), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3705, 3707), False, 'import unittest\n'), ((66, 91), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (81, 91), False, 'import os\n'), ((1449, 1552), 'model.dataset.dbd_reader.DbdReader', 'DbdReader', (['cls.DATA_DIR', 'cls.TA... |
#!/usr/bin/env python3
import sys
sys.path.append('/opt/attiny_daemon/') # add the path to our ATTiny module
import time
import smbus
import logging
from attiny_i2c import ATTiny
_time_const = 1.0 # used as a pause between i2c communications, the ATTiny is slow
_num_retries = 10 # the number of retries when r... | [
"logging.getLogger",
"sys.path.append",
"attiny_i2c.ATTiny"
] | [((37, 75), 'sys.path.append', 'sys.path.append', (['"""/opt/attiny_daemon/"""'], {}), "('/opt/attiny_daemon/')\n", (52, 75), False, 'import sys\n'), ((466, 485), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (483, 485), False, 'import logging\n'), ((574, 626), 'attiny_i2c.ATTiny', 'ATTiny', (['bus', '_i2... |
import pandas as pd
import urllib.request, io, csv
import os
import yfinance as yf
from datetime import datetime
def getStock(TickerList,TickerName,path,dataframe =None): #TickerListNeeds to be a list
newFile=True
if dataframe is not None:
df = dataframe
newFile = False
lastDate = df.i... | [
"datetime.datetime.today",
"yfinance.Ticker"
] | [((340, 360), 'yfinance.Ticker', 'yf.Ticker', (['path[:-9]'], {}), '(path[:-9])\n', (349, 360), True, 'import yfinance as yf\n'), ((508, 524), 'datetime.datetime.today', 'datetime.today', ([], {}), '()\n', (522, 524), False, 'from datetime import datetime\n')] |
#!/usr/bin/env python
import bz2
import gzip
import json
import optparse
import os
import shutil
import subprocess
import sys
import tarfile
import tempfile
import urllib.error
import urllib.parse
import urllib.request
import zipfile
from ftplib import FTP
CHUNK_SIZE = 2**20 # 1mb
def cleanup_before_exit(tmp_dir):
... | [
"os.path.exists",
"ftplib.FTP",
"tarfile.open",
"sys.exit",
"zipfile.ZipFile",
"json.dumps",
"os.path.join",
"os.symlink",
"optparse.OptionParser",
"shutil.rmtree",
"gzip.GzipFile",
"bz2.BZ2File",
"tempfile.mkdtemp",
"os.mkdir",
"tempfile.NamedTemporaryFile",
"json.load",
"os.remove"... | [((657, 699), 'tarfile.open', 'tarfile.open', ([], {'fileobj': 'file_obj', 'mode': '"""r:*"""'}), "(fileobj=file_obj, mode='r:*')\n", (669, 699), False, 'import tarfile\n'), ((850, 880), 'zipfile.ZipFile', 'zipfile.ZipFile', (['file_obj', '"""r"""'], {}), "(file_obj, 'r')\n", (865, 880), False, 'import zipfile\n'), ((1... |
import os
import shutil
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.client import Client
from django.utils import simplejson
from ocradmin.projects.models import Project
AJAX_HEADERS = {
"HTTP_X_REQUESTED_WITH": "XMLHttpRequest"
}... | [
"django.test.client.Client",
"ocradmin.projects.models.Project.objects.get",
"ocradmin.projects.models.Project.objects.count",
"django.contrib.auth.models.User.objects.create_user"
] | [((511, 573), 'django.contrib.auth.models.User.objects.create_user', 'User.objects.create_user', (['"""test_user"""', '"""<EMAIL>"""', '"""<PASSWORD>"""'], {}), "('test_user', '<EMAIL>', '<PASSWORD>')\n", (535, 573), False, 'from django.contrib.auth.models import User\n'), ((596, 604), 'django.test.client.Client', 'Cli... |
from django.shortcuts import redirect
from django.utils.deprecation import MiddlewareMixin
class AutuMiddleWares(MiddlewareMixin):
def process_request(self, request):
# 先拿到url路径
path = request.path
# 判断path是否是login或reg
path_list = ['/login/', '/reg/']
if path in path_list:
... | [
"django.shortcuts.redirect"
] | [((437, 456), 'django.shortcuts.redirect', 'redirect', (['"""/login/"""'], {}), "('/login/')\n", (445, 456), False, 'from django.shortcuts import redirect\n')] |
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import numpy as np
import matplotlib.pyplot as plt
from splane import pzmap, grpDelay, bodePlot, convert2SOS
from scipy import signal
# Esta es una liberia tomada de la comunidad [https://stackoverflow.com/questions/35304245/multiply-scipy... | [
"numpy.roots"
] | [((420, 497), 'numpy.roots', 'np.roots', (['[-256 * e, 0, -640 * e, 0, -560 * e, 0, -200 * e, 0, -25 * e, 0, 1]'], {}), '([-256 * e, 0, -640 * e, 0, -560 * e, 0, -200 * e, 0, -25 * e, 0, 1])\n', (428, 497), True, 'import numpy as np\n')] |
"""Функции проверки статуса дивидендов"""
from urllib.error import URLError
import numpy as np
import pandas as pd
from local.dividends import comony_ru
from local.dividends import dohod_ru
from local.dividends import smart_lab_ru
from local.dividends.sqlite import DividendsDataManager
from local.dividends.sqlite imp... | [
"numpy.isclose",
"local.dividends.sqlite.DividendsDataManager",
"local.dividends.smart_lab_ru.dividends_smart_lab",
"pandas.Timestamp",
"pandas.concat"
] | [((1072, 1106), 'local.dividends.smart_lab_ru.dividends_smart_lab', 'smart_lab_ru.dividends_smart_lab', ([], {}), '()\n', (1104, 1106), False, 'from local.dividends import smart_lab_ru\n'), ((1928, 1956), 'local.dividends.sqlite.DividendsDataManager', 'DividendsDataManager', (['ticker'], {}), '(ticker)\n', (1948, 1956)... |
import matplotlib.pyplot as plt
import numpy as np
import os
from scipy import stats
from transposonmapper.statistics import dataframe_from_pergenefile
def make_datafile(path_a,filelist_a,path_b,filelist_b):
"""Assembly the datafile name to analyze
Parameters
----------
path_a : str
Path o... | [
"numpy.mean",
"numpy.log10",
"os.path.join",
"os.path.isfile",
"transposonmapper.statistics.dataframe_from_pergenefile",
"scipy.stats.ttest_ind"
] | [((1143, 1170), 'os.path.join', 'os.path.join', (['path_a', 'files'], {}), '(path_a, files)\n', (1155, 1170), False, 'import os\n'), ((1186, 1210), 'os.path.isfile', 'os.path.isfile', (['datafile'], {}), '(datafile)\n', (1200, 1210), False, 'import os\n'), ((1337, 1364), 'os.path.join', 'os.path.join', (['path_b', 'fil... |
"""
See: `libfuturize.main`
"""
from __future__ import (absolute_import, print_function, unicode_literals)
import json
import logging
import optparse
import os
import shutil
import sys
from lib2to3 import refactor
from lib2to3.main import warn
import future.utils
from do_py import DataObject, R
from do_py.common.mana... | [
"logging.getLogger",
"dominate.tags.h1",
"dominate.tags.th",
"dominate.tags.thead",
"dominate.tags.a",
"dominate.tags.table",
"dominate.tags.tbody",
"do_py.common.managed_list.ManagedList",
"os.path.isdir",
"os.mkdir",
"py2to3cov.data_model.diff_summary.DiffSummary.list_all",
"dominate.documen... | [((1795, 1857), 'optparse.OptionParser', 'optparse.OptionParser', ([], {'usage': '"""futurize [options] file|dir ..."""'}), "(usage='futurize [options] file|dir ...')\n", (1816, 1857), False, 'import optparse\n'), ((6270, 6334), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(name)s: %(message)s"""'... |
from xml.etree.ElementTree import ElementTree
import glob
import subprocess
import os
import codecs
import threading
import time
taskParam_noThread = 10
taskParam_apklistfilename = './apklist.txt'
taskParam_resultfilename_F1 = 'F1_UPS_mani.txt'
taskParam_resultfilename_F2 = 'F2_UCS_mani.txt'
taskParam_resultfilename_F... | [
"xml.etree.ElementTree.ElementTree",
"threading.Lock",
"os.path.exists",
"threading.Thread.__init__"
] | [((777, 790), 'xml.etree.ElementTree.ElementTree', 'ElementTree', ([], {}), '()\n', (788, 790), False, 'from xml.etree.ElementTree import ElementTree\n'), ((15137, 15168), 'threading.Thread.__init__', 'threading.Thread.__init__', (['self'], {}), '(self)\n', (15162, 15168), False, 'import threading\n'), ((17440, 17456),... |
import logging
from typing import NamedTuple, Optional, Union
LOG = logging.getLogger(__name__)
class AdsRecord(NamedTuple):
supplier_domain: str
pub_id: str
supplier_relationship: str
cert_authority: Optional[str]
class AdsVariable(NamedTuple):
key: str
value: str
def process_row(row: s... | [
"logging.getLogger"
] | [((70, 97), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (87, 97), False, 'import logging\n')] |
from perception_msgs.msg import State
from geometry_msgs.msg import Point, Pose
def to_state_pose_msg_list(value_dict, filter_xyz_dict):
state_list = []
pose_list = []
for sig in value_dict:
state = State()
state.type = 'cnn'
state.name = str(sig)
state.value = value_dict[si... | [
"geometry_msgs.msg.Pose",
"perception_msgs.msg.State"
] | [((220, 227), 'perception_msgs.msg.State', 'State', ([], {}), '()\n', (225, 227), False, 'from perception_msgs.msg import State\n'), ((372, 378), 'geometry_msgs.msg.Pose', 'Pose', ([], {}), '()\n', (376, 378), False, 'from geometry_msgs.msg import Point, Pose\n')] |
# coding: utf-8
"""
Masking API
Schema for the Masking Engine API # noqa: E501
OpenAPI spec version: 5.1.8
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import... | [
"dxm.lib.masking_api.api_client.ApiClient",
"six.iteritems"
] | [((2992, 3023), 'six.iteritems', 'six.iteritems', (["params['kwargs']"], {}), "(params['kwargs'])\n", (3005, 3023), False, 'import six\n'), ((6782, 6813), 'six.iteritems', 'six.iteritems', (["params['kwargs']"], {}), "(params['kwargs'])\n", (6795, 6813), False, 'import six\n'), ((10905, 10936), 'six.iteritems', 'six.it... |
import streamlit as st
import streamlit.components.v1 as stc
from eda_app import run_eda_app
from ml_app import run_ml_app
html_temp = """
<div style="background-color:#3872fb;padding:10px;border-radius:10px">
<h1 style="color:white;text-align:center;">Early Stage DM Risk Data App </h1>
<h4 style="color:white;... | [
"eda_app.run_eda_app",
"ml_app.run_ml_app",
"streamlit.write",
"streamlit.text",
"streamlit.subheader",
"streamlit.sidebar.selectbox",
"streamlit.components.v1.html"
] | [((425, 444), 'streamlit.components.v1.html', 'stc.html', (['html_temp'], {}), '(html_temp)\n', (433, 444), True, 'import streamlit.components.v1 as stc\n'), ((492, 526), 'streamlit.sidebar.selectbox', 'st.sidebar.selectbox', (['"""Menu"""', 'menu'], {}), "('Menu', menu)\n", (512, 526), True, 'import streamlit as st\n'... |
from __future__ import print_function
import os
from setuptools import setup, find_packages
here = os.path.dirname(os.path.abspath(__file__))
node_root = os.path.join(here, 'js')
is_repo = os.path.exists(os.path.join(here, '.git'))
from distutils import log
log.set_verbosity(log.DEBUG)
log.info('setup.py ... | [
"setuptools.find_packages",
"os.path.join",
"setuptools.setup",
"distutils.log.info",
"distutils.log.set_verbosity",
"os.path.abspath"
] | [((160, 184), 'os.path.join', 'os.path.join', (['here', '"""js"""'], {}), "(here, 'js')\n", (172, 184), False, 'import os\n'), ((271, 299), 'distutils.log.set_verbosity', 'log.set_verbosity', (['log.DEBUG'], {}), '(log.DEBUG)\n', (288, 299), False, 'from distutils import log\n'), ((301, 329), 'distutils.log.info', 'log... |
__version__ = '0.1.13'
import logging
mpl_logger = logging.getLogger('matplotlib')
mpl_logger.setLevel(logging.WARNING)
from cartesian_explorer import lazy_imports
from cartesian_explorer.lib.lru_cache import lru_cache
from cartesian_explorer.lib.lru_cache_mproc import lru_cache as lru_cache_mproc
from cartesian_expl... | [
"logging.getLogger",
"numpy.exp",
"numpy.log",
"cartesian_explorer.Explorer.Explorer"
] | [((51, 82), 'logging.getLogger', 'logging.getLogger', (['"""matplotlib"""'], {}), "('matplotlib')\n", (68, 82), False, 'import logging\n'), ((837, 847), 'cartesian_explorer.Explorer.Explorer', 'Explorer', ([], {}), '()\n', (845, 847), False, 'from cartesian_explorer.Explorer import Explorer\n'), ((973, 994), 'numpy.exp... |
import torch
import argparse
import scipy
import numpy as np
import pickle
from deeprobust.graph.targeted_attack import Nettack
from deeprobust.graph.utils import *
from deeprobust.graph.data import Dataset
from deeprobust.graph.defense import *
from sklearn.preprocessing import normalize
from tqdm import tqdm
from sc... | [
"torch.LongTensor",
"torch.exp",
"torch.cuda.is_available",
"deeprobust.graph.targeted_attack.Nettack",
"numpy.linalg.norm",
"numpy.mean",
"argparse.ArgumentParser",
"numpy.dot",
"numpy.random.seed",
"numpy.random.choice",
"numpy.set_printoptions",
"torch.device",
"torch.manual_seed",
"dee... | [((442, 467), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (465, 467), False, 'import argparse\n'), ((1148, 1173), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (1171, 1173), False, 'import torch\n'), ((1183, 1227), 'torch.device', 'torch.device', (["('cuda' if args.... |
import argparse
import logging
log = logging.getLogger('flair')
def def_task(s):
try:
task, path = s.split(':')
except:
raise argparse.ArgumentTypeError('Task should be in format: TaskName:DataPath.')
return task, path
parser = argparse.ArgumentParser(description='Beam search decoding f... | [
"logging.getLogger",
"flair.models.language_model.MyLanguageMode.load_from_file",
"argparse.ArgumentParser",
"flair.models.sequence_tagger_model.evalute_beam_search",
"flair.models.SequenceTagger.load_from_file",
"argparse.ArgumentTypeError",
"flair.data_fetcher.NLPTaskDataFetcher.load_corpus"
] | [((38, 64), 'logging.getLogger', 'logging.getLogger', (['"""flair"""'], {}), "('flair')\n", (55, 64), False, 'import logging\n'), ((261, 368), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Beam search decoding for separately trained hybrid NER-LM model"""'}), "(description=\n 'Beam s... |
from typing import Any, List
import httpx
from healthpy._http import _check, _is_json
class _Request:
def __init__(self, url: str, **args):
with httpx.Client(timeout=args.pop("timeout", (1, 5)), **args) as client:
self.response = client.get(url)
def is_error(self) -> bool:
retur... | [
"healthpy._http._check"
] | [((2000, 2281), 'healthpy._http._check', '_check', ([], {'service_name': 'service_name', 'url': 'url', 'request_class': '_Request', 'status_extracting': 'status_extracting', 'failure_status': 'failure_status', 'affected_endpoints': 'affected_endpoints', 'additional_keys': 'additional_keys', 'error_status_extracting': '... |
# -*- coding: utf-8 -*-
# Author <NAME>
# mascot csv process v1.5
# import all csv files in a folder
import os
import re
combine = [] #combined protein list
dir_input = input('Please input folder path(e.g. D:\Study\Inbox): ')
print('input directory is: ', dir_input)
number_of_csv = 0 # to get how many... | [
"re.findall",
"os.listdir",
"re.match"
] | [((359, 380), 'os.listdir', 'os.listdir', (['dir_input'], {}), '(dir_input)\n', (369, 380), False, 'import os\n'), ((424, 458), 're.match', 're.match', (['"""F\\\\d+?\\\\.csv"""', 'filename'], {}), "('F\\\\d+?\\\\.csv', filename)\n", (432, 458), False, 'import re\n'), ((664, 694), 're.findall', 're.findall', (['"""\\\\... |
# Generated with FixedForceElongationMethod
#
from enum import Enum
from enum import auto
class FixedForceElongationMethod(Enum):
""""""
PRETENSION_LOCAL = auto()
PRETENSION_GLOBAL = auto()
BOTH_ENDS = auto()
CONSTANT_TENSION_WINCH = auto()
def label(self):
if self == FixedForceElonga... | [
"enum.auto"
] | [((166, 172), 'enum.auto', 'auto', ([], {}), '()\n', (170, 172), False, 'from enum import auto\n'), ((197, 203), 'enum.auto', 'auto', ([], {}), '()\n', (201, 203), False, 'from enum import auto\n'), ((220, 226), 'enum.auto', 'auto', ([], {}), '()\n', (224, 226), False, 'from enum import auto\n'), ((256, 262), 'enum.aut... |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | [
"OpenGL.platform.types",
"OpenGL.constant.Constant",
"ctypes.POINTER",
"OpenGL.platform.createFunction"
] | [((517, 557), 'OpenGL.constant.Constant', '_C', (['"""GL_BUFFER_IMMUTABLE_STORAGE"""', '(33311)'], {}), "('GL_BUFFER_IMMUTABLE_STORAGE', 33311)\n", (519, 557), True, 'from OpenGL.constant import Constant as _C\n'), ((582, 618), 'OpenGL.constant.Constant', '_C', (['"""GL_BUFFER_STORAGE_FLAGS"""', '(33312)'], {}), "('GL_... |
import numpy as np
import json
from os.path import join
from tqdm import tqdm
from scipy.optimize import least_squares
from pose_optimize.multiview_geo import reproject_error
DEBUG=False
def reproject_error_loss(p3d, p4, p6, cam_proj_4, cam_proj_6, num_kpt=23):
'''
Return:
kp4_e, kp6_e: error array, ... | [
"scipy.optimize.least_squares",
"tqdm.tqdm",
"numpy.square",
"numpy.array",
"numpy.dot",
"numpy.zeros",
"pose_optimize.multiview_geo.reproject_error",
"numpy.concatenate",
"sys.exit",
"json.load",
"json.dump"
] | [((2154, 2194), 'numpy.concatenate', 'np.concatenate', (['(l1 * kp4_e, l1 * kp6_e)'], {}), '((l1 * kp4_e, l1 * kp6_e))\n', (2168, 2194), True, 'import numpy as np\n'), ((2567, 2585), 'numpy.zeros', 'np.zeros', (['num_bone'], {}), '(num_bone)\n', (2575, 2585), True, 'import numpy as np\n'), ((2604, 2622), 'numpy.zeros',... |
import pseudopol.ppseudopol as p_pp
import numpy as np
import sys
max_val=int(sys.argv[1])
vals=list(np.random.randint(1,500000,5000, dtype=np.uint32))
print(p_pp.find_max_subsum(max_val, vals))
| [
"numpy.random.randint",
"pseudopol.ppseudopol.find_max_subsum"
] | [((103, 154), 'numpy.random.randint', 'np.random.randint', (['(1)', '(500000)', '(5000)'], {'dtype': 'np.uint32'}), '(1, 500000, 5000, dtype=np.uint32)\n', (120, 154), True, 'import numpy as np\n'), ((160, 195), 'pseudopol.ppseudopol.find_max_subsum', 'p_pp.find_max_subsum', (['max_val', 'vals'], {}), '(max_val, vals)\... |