code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
"numpy.array",
"deepspeech.io.utility.pad_sequence",
"deepspeech.utils.log.Log"
] | [((804, 817), 'deepspeech.utils.log.Log', 'Log', (['__name__'], {}), '(__name__)\n', (807, 817), False, 'from deepspeech.utils.log import Log\n'), ((2330, 2362), 'numpy.array', 'np.array', (['tokens'], {'dtype': 'np.int64'}), '(tokens, dtype=np.int64)\n', (2338, 2362), True, 'import numpy as np\n'), ((2484, 2523), 'dee... |
import asyncio
import logging
import time
from functools import partial
from signal import SIGINT, SIGTERM
from panic import \
datatypes as panic_datatypes
logger = logging.getLogger(__name__)
current_time = None
def update_current_time(loop):
"""
Caches the current time, since it is needed
at the e... | [
"logging.getLogger",
"functools.partial",
"time.time",
"asyncio.sleep"
] | [((172, 199), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (189, 199), False, 'import logging\n'), ((468, 479), 'time.time', 'time.time', ([], {}), '()\n', (477, 479), False, 'import time\n'), ((677, 709), 'functools.partial', 'partial', (['params.protocol', 'params'], {}), '(params.pro... |
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.widget import Widget
from kivy.uix.button import Button, Label
from kivy.properties import ListProperty, ObjectProperty
from game import Game
from player import Player
from helpers import new_targe... | [
"helpers.new_targets",
"kivy.uix.button.Button",
"game.Game",
"kivy.properties.ListProperty",
"kivy.uix.button.Label",
"kivy.app.App.get_running_app"
] | [((3463, 3479), 'kivy.properties.ListProperty', 'ListProperty', (['[]'], {}), '([])\n', (3475, 3479), False, 'from kivy.properties import ListProperty, ObjectProperty\n'), ((472, 488), 'kivy.uix.button.Button', 'Button', ([], {'text': '"""1"""'}), "(text='1')\n", (478, 488), False, 'from kivy.uix.button import Button, ... |
import jittor as jt
from jittor import nn
from jittor import Module
from jittor import init
from jittor.contrib import concat
from model.backbone import resnet50, resnet101
from model.backbone import res2net101
Backbone_List = ['resnet50', 'resnet101', 'res2net101']
class DeepLab(Module):
def __init__(self, outp... | [
"jittor.nn.Conv",
"model.backbone.res2net101",
"model.backbone.resnet101",
"jittor.nn.cross_entropy_loss",
"jittor.nn.Dropout",
"model.backbone.resnet50",
"jittor.nn.resize",
"jittor.nn.ReLU",
"jittor.mean",
"jittor.ones",
"jittor.contrib.concat",
"jittor.nn.BatchNorm"
] | [((5397, 5422), 'jittor.ones', 'jt.ones', (['[2, 3, 512, 512]'], {}), '([2, 3, 512, 512])\n', (5404, 5422), True, 'import jittor as jt\n'), ((1138, 1206), 'jittor.nn.resize', 'nn.resize', (['x'], {'size': '(input.shape[2], input.shape[3])', 'mode': '"""bilinear"""'}), "(x, size=(input.shape[2], input.shape[3]), mode='b... |
# Generated by Django 2.2 on 2020-03-30 15:03
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='SeoUrl',
fields=[
('head_title', models.CharF... | [
"django.db.models.TextField",
"django.db.models.CharField"
] | [((308, 378), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(55)', 'verbose_name': '"""head title"""'}), "(blank=True, max_length=55, verbose_name='head title')\n", (324, 378), False, 'from django.db import migrations, models\n'), ((418, 495), 'django.db.models.TextField', 'm... |
import os
from shutil import rmtree
from ..settings import DATA_PATH
class Thumbnail(object):
def __init__(self, model):
self.model = model
self.module = model.module
self.filename = os.path.join('thumbnails', model.__tablename__, self.module.id, model.id)
self.full_filename = os.... | [
"os.path.exists",
"os.path.join",
"os.remove"
] | [((1302, 1360), 'os.path.join', 'os.path.join', (['DATA_PATH', '"""medias"""', 'item.module_id', 'item.id'], {}), "(DATA_PATH, 'medias', item.module_id, item.id)\n", (1314, 1360), False, 'import os\n'), ((214, 287), 'os.path.join', 'os.path.join', (['"""thumbnails"""', 'model.__tablename__', 'self.module.id', 'model.id... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 15 11:43:21 2021
@author: Sander
"""
import random
# TODO: '/poll vote 88' has no output
# : invalid poll id gives no output
# Poll datastructure
#
# {
# "number or name of person":
# {
# "__id" : unique id for every poll
# "__name... | [
"random.randint"
] | [((3314, 3336), 'random.randint', 'random.randint', (['(1)', '(999)'], {}), '(1, 999)\n', (3328, 3336), False, 'import random\n')] |
# To add a new cell, type '# %%'
# To add a new markdown cell, type '# %% [markdown]'
# %% [markdown]
# # Laboratorio #3 - Predicción de textos
#
# * <NAME> - 17315
# * <NAME> - 17509
# * <NAME> - 17088
# %%
from keras.layers import Embedding
from keras.layers import LSTM
from keras.layers import Dense
from keras.mode... | [
"keras.preprocessing.text.Tokenizer",
"random.shuffle",
"nltk.corpus.stopwords.words",
"nltk.download",
"keras.utils.to_categorical",
"keras.models.Sequential",
"numpy.array",
"keras.layers.LSTM",
"keras.layers.Dense",
"pandas.DataFrame",
"re.sub",
"keras.preprocessing.sequence.pad_sequences",... | [((684, 710), 'nltk.download', 'nltk.download', (['"""stopwords"""'], {}), "('stopwords')\n", (697, 710), False, 'import nltk\n'), ((767, 793), 'nltk.corpus.stopwords.words', 'stopwords.words', (['"""english"""'], {}), "('english')\n", (782, 793), False, 'from nltk.corpus import stopwords\n'), ((6048, 6077), 'random.sh... |
import hashlib
import json
import math
import os
import dill
import base64
from sys import exit
import requests
from bson import ObjectId
from Crypto.Cipher import PKCS1_OAEP
from Crypto.Hash import SHA256
from Crypto.PublicKey import RSA
#from cryptography.hazmat.primitives.asymmetric import padding
#from cryptography... | [
"bson.ObjectId.is_valid",
"numpy.ones",
"hashlib.md5",
"requests_toolbelt.MultipartEncoderMonitor",
"math.pow",
"tqdm.tqdm",
"os.environ.get",
"json.dumps",
"math.log",
"os.path.dirname",
"dill.dumps"
] | [((3041, 3058), 'math.pow', 'math.pow', (['(1024)', 'i'], {}), '(1024, i)\n', (3049, 3058), False, 'import math\n'), ((7038, 7146), 'tqdm.tqdm', 'tqdm', ([], {'desc': 'f"""{NEURO_AI_STR} Uploading"""', 'unit': '"""B"""', 'unit_scale': '(True)', 'total': 'encoder_len', 'unit_divisor': '(1024)'}), "(desc=f'{NEURO_AI_STR}... |
from discord.ext import commands
import tasks
from datetime import datetime
import os
import traceback
bot = commands.Bot(command_prefix='/')
token = os.environ['DISCORD_BOT_TOKEN']
# 接続に必要なオブジェクトを生成
client = discord.Client()
#投稿する日時
dateTimeList = [
'2019/11/19 18:09',
'2019/11/19 18:15',
'2019/11/19 18:20',
]
#... | [
"discord.ext.commands.Bot",
"datetime.datetime.now",
"tasks.loop"
] | [((111, 143), 'discord.ext.commands.Bot', 'commands.Bot', ([], {'command_prefix': '"""/"""'}), "(command_prefix='/')\n", (123, 143), False, 'from discord.ext import commands\n'), ((501, 523), 'tasks.loop', 'tasks.loop', ([], {'seconds': '(30)'}), '(seconds=30)\n', (511, 523), False, 'import tasks\n'), ((588, 602), 'dat... |
""" Code to implement ScaleFactor:: decorator supported
in gtlike.
The gtlike feature is documented here:
https://confluence.slac.stanford.edu/display/ST/Science+Tools+Development+Notes?focusedCommentId=103582318#comment-103582318
Author: <NAME>
"""
import operator
from copy import deepcopy
... | [
"doctest.testmod",
"uw.like.Models.Constant",
"numpy.concatenate",
"copy.deepcopy"
] | [((5021, 5049), 'copy.deepcopy', 'deepcopy', (['model_class.gtlike'], {}), '(model_class.gtlike)\n', (5029, 5049), False, 'from copy import deepcopy\n'), ((6931, 6948), 'doctest.testmod', 'doctest.testmod', ([], {}), '()\n', (6946, 6948), False, 'import doctest\n'), ((5311, 5339), 'uw.like.Models.Constant', 'Constant',... |
import RPi.GPIO as GPIO
import time
s2 = 26
s3 = 27
signal = 17
NUM_CYCLES = 10
def setup():
GPIO.setmode(GPIO.BCM)
GPIO.setup(signal,GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(s2,GPIO.OUT)
GPIO.setup(s3,GPIO.OUT)
print("\n")
def loop():
temp = 1
while(1):
GPIO.output(s2,GPIO.LOW)
... | [
"RPi.GPIO.cleanup",
"RPi.GPIO.setup",
"RPi.GPIO.output",
"RPi.GPIO.wait_for_edge",
"time.sleep",
"time.time",
"RPi.GPIO.setmode"
] | [((99, 121), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BCM'], {}), '(GPIO.BCM)\n', (111, 121), True, 'import RPi.GPIO as GPIO\n'), ((124, 177), 'RPi.GPIO.setup', 'GPIO.setup', (['signal', 'GPIO.IN'], {'pull_up_down': 'GPIO.PUD_UP'}), '(signal, GPIO.IN, pull_up_down=GPIO.PUD_UP)\n', (134, 177), True, 'import RPi.GPIO ... |
import datetime
import peewee as p
from breeze import App, Resource, Serializable
db = p.SqliteDatabase('users.db')
class UserModel(p.Model):
username = p.CharField(unique=True)
password = p.CharField()
email = p.CharField()
join_date = p.DateTimeField(default=datetime.datetime.now)
class Met... | [
"peewee.CharField",
"peewee.SqliteDatabase",
"breeze.Serializable.DateTime",
"breeze.Serializable.String",
"peewee.DateTimeField",
"breeze.App"
] | [((91, 119), 'peewee.SqliteDatabase', 'p.SqliteDatabase', (['"""users.db"""'], {}), "('users.db')\n", (107, 119), True, 'import peewee as p\n'), ((960, 1000), 'breeze.App', 'App', (['User'], {'prefix': '"""/api/v1/"""', 'debug': '(True)'}), "(User, prefix='/api/v1/', debug=True)\n", (963, 1000), False, 'from breeze imp... |
#This is a class because it stores its model parameters and has a 'prediction' function which returns predictions for input data
import numpy as np
from baseModel import baseModel, ModellingError as me
from datetime import datetime
import pandas as pd
class ModellingError(me): pass
class ConstantMonthlyModel(baseMode... | [
"pandas.DataFrame.from_records",
"pandas.DatetimeIndex",
"numpy.random.randn"
] | [((823, 854), 'pandas.DataFrame.from_records', 'pd.DataFrame.from_records', (['data'], {}), '(data)\n', (848, 854), True, 'import pandas as pd\n'), ((958, 989), 'pandas.DatetimeIndex', 'pd.DatetimeIndex', (["data_pd['ts']"], {}), "(data_pd['ts'])\n", (974, 989), True, 'import pandas as pd\n'), ((1453, 1491), 'numpy.ran... |
# linear regression feature importance
from sklearn.datasets import make_regression
from sklearn.linear_model import LinearRegression
from matplotlib import pyplot
# define dataset
X, y = make_regression(n_samples=1000, n_features=10, n_informative=5, random_state=1)
# define the model
model = LinearRegression()
# fit ... | [
"sklearn.datasets.make_regression",
"sklearn.linear_model.LinearRegression",
"matplotlib.pyplot.show"
] | [((188, 267), 'sklearn.datasets.make_regression', 'make_regression', ([], {'n_samples': '(1000)', 'n_features': '(10)', 'n_informative': '(5)', 'random_state': '(1)'}), '(n_samples=1000, n_features=10, n_informative=5, random_state=1)\n', (203, 267), False, 'from sklearn.datasets import make_regression\n'), ((295, 313)... |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
"logging.getLogger",
"logging.StreamHandler",
"termcolor.colored",
"os.makedirs",
"os.path.join",
"os.path.isfile",
"os.path.isdir",
"logging.FileHandler",
"os.path.basename",
"shutil.rmtree",
"os.remove"
] | [((2526, 2551), 'logging.getLogger', 'logging.getLogger', (['"""PARL"""'], {}), "('PARL')\n", (2543, 2551), False, 'import logging\n'), ((2630, 2663), 'logging.StreamHandler', 'logging.StreamHandler', (['sys.stdout'], {}), '(sys.stdout)\n', (2651, 2663), False, 'import logging\n'), ((3287, 3307), 'os.path.isfile', 'os.... |
#!/usr/bin/env python
"""
juc2/examples/example_02.py
Move a rectangle across the terminal. <3
"""
from juc2 import art, Stage
stage = Stage(height=40, width=80, frame=True)
rectangle = art.Shapes.Rectangle(width=10, height=5, x=5, y=5)
while True:
stage.draw(rectangle, FPS=4)
if rectangle.x < 60:
... | [
"juc2.Stage",
"juc2.art.Shapes.Rectangle"
] | [((139, 177), 'juc2.Stage', 'Stage', ([], {'height': '(40)', 'width': '(80)', 'frame': '(True)'}), '(height=40, width=80, frame=True)\n', (144, 177), False, 'from juc2 import art, Stage\n'), ((190, 240), 'juc2.art.Shapes.Rectangle', 'art.Shapes.Rectangle', ([], {'width': '(10)', 'height': '(5)', 'x': '(5)', 'y': '(5)'}... |
r"""
This module is a ITK Web server application.
The following command line illustrates how to use it::
$ python .../server/itk-tube.py --data /.../path-to-your-data-file
--data
Path to file to load.
Any WSLink executable script comes with a set of standard arguments that ca... | [
"ctypes.addressof",
"ctypes.POINTER",
"itkTypes.itkCType.GetCType",
"wslink.register",
"tubeutils.GetTubePoints",
"itk.ImageIOFactory.CreateImageIO",
"twisted.internet.reactor.callLater"
] | [((8054, 8081), 'wslink.register', 'register', (['"""itk.volume.open"""'], {}), "('itk.volume.open')\n", (8062, 8081), False, 'from wslink import register\n'), ((8992, 9017), 'wslink.register', 'register', (['"""itk.tube.save"""'], {}), "('itk.tube.save')\n", (9000, 9017), False, 'from wslink import register\n'), ((928... |
# file eulxml/xmlmap/cerp.py
#
# Copyright 2010,2011 Emory University Libraries
#
# 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
#
... | [
"logging.getLogger",
"email.utils.parsedate_tz",
"eulxml.xmlmap.StringListField",
"eulxml.xmlmap.SimpleBooleanField",
"eulxml.xmlmap.NodeListField",
"eulxml.xmlmap.NodeField",
"eulxml.xmlmap.IntegerField",
"email.utils.mktime_tz",
"eulxml.utils.compat.u",
"eulxml.xmlmap.StringField"
] | [((838, 865), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (855, 865), False, 'import logging\n'), ((1489, 1518), 'eulxml.xmlmap.StringField', 'xmlmap.StringField', (['"""xm:Name"""'], {}), "('xm:Name')\n", (1507, 1518), False, 'from eulxml import xmlmap\n'), ((1531, 1561), 'eulxml.xmlm... |
import matplotlib.pyplot as plt
import librosa.display
plt.rcParams.update({'font.size': 16})
y, sr = librosa.load(librosa.util.example_audio_file())
plt.figure(figsize=(18, 7))
librosa.display.waveplot(y, sr=sr, x_axis='s')
print(sr)
plt.ylabel('Sampling Rate',fontsize=32)
plt.xlabel('Time (s)',fontsize=32)
plt.show(... | [
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.rcParams.update",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show"
] | [((55, 93), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (["{'font.size': 16}"], {}), "({'font.size': 16})\n", (74, 93), True, 'import matplotlib.pyplot as plt\n'), ((151, 178), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(18, 7)'}), '(figsize=(18, 7))\n', (161, 178), True, 'import matplo... |
# -*- coding: utf-8 -*-
'''
Autor: <NAME>, <NAME>, <NAME>, <NAME>
Version: 1.3
Server fuer das hosten des FaSta-Dashboards
Copyright 2018 The 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 o... | [
"psycopg2.connect",
"dash_table_experiments.DataTable",
"flask.Flask",
"dash_core_components.Location",
"dash_html_components.H3",
"dash.dependencies.Input",
"sys.exit",
"pymongo.MongoClient",
"sys.path.append",
"pandas.to_datetime",
"dash_html_components.Div",
"dash.Dash",
"threading.Thread... | [((1396, 1424), 'sys.path.append', 'sys.path.append', (['"""./Clients"""'], {}), "('./Clients')\n", (1411, 1424), False, 'import sys\n'), ((2257, 2284), 'os.environ.get', 'os.environ.get', (['"""MONGO_URI"""'], {}), "('MONGO_URI')\n", (2271, 2284), False, 'import os\n'), ((2301, 2331), 'os.environ.get', 'os.environ.get... |
# Trinket IO demo
# Welcome to CircuitPython 2.0.0 :)
import board
from digitalio import DigitalInOut, Direction, Pull
from analogio import AnalogOut, AnalogIn
import touchio
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keycode import Keycode
import adafruit_dotstar as dotstar
import time
import neop... | [
"adafruit_sht31d.SHT31D",
"busio.I2C"
] | [((405, 418), 'busio.I2C', 'I2C', (['SCL', 'SDA'], {}), '(SCL, SDA)\n', (408, 418), False, 'from busio import I2C\n'), ((429, 456), 'adafruit_sht31d.SHT31D', 'adafruit_sht31d.SHT31D', (['i2c'], {}), '(i2c)\n', (451, 456), False, 'import adafruit_sht31d\n')] |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the storage media RAW image support helper functions."""
import unittest
from dfvfs.lib import raw
from dfvfs.lib import definitions
from dfvfs.path import fake_path_spec
from dfvfs.path import raw_path_spec
from dfvfs.resolver import context
from dfvfs.vfs impor... | [
"dfvfs.lib.raw.RawGlobPathSpec",
"dfvfs.path.raw_path_spec.RawPathSpec",
"dfvfs.vfs.fake_file_system.FakeFileSystem",
"dfvfs.path.fake_path_spec.FakePathSpec",
"unittest.main",
"dfvfs.resolver.context.Context"
] | [((20665, 20680), 'unittest.main', 'unittest.main', ([], {}), '()\n', (20678, 20680), False, 'import unittest\n'), ((992, 1009), 'dfvfs.resolver.context.Context', 'context.Context', ([], {}), '()\n', (1007, 1009), False, 'from dfvfs.resolver import context\n'), ((1028, 1077), 'dfvfs.vfs.fake_file_system.FakeFileSystem'... |
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
import numpy as np
import sys
import time
def get_train_loss(line):
splitted_line = line.split(" ")
return float(splitted_line[2]), float(splitted_line[4])
def get_val_loss(line):
splitted_line = line.split(" ")
if len(spli... | [
"matplotlib.pyplot.subplots",
"time.sleep",
"matplotlib.pyplot.show"
] | [((1224, 1238), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (1236, 1238), True, 'import matplotlib.pyplot as plt\n'), ((2010, 2020), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (2018, 2020), True, 'import matplotlib.pyplot as plt\n'), ((1045, 1060), 'time.sleep', 'time.sleep', (['(0.1)']... |
from __future__ import annotations
import logging
import pathlib
from logging.handlers import TimedRotatingFileHandler
from os import getenv
from typing import Union, List, Mapping
from bundle.utils.recorder import Recorder
from bundle.utils.cache_file_helpers import CacheFolder, USER_DOCS_PATH
from bundle.seeker imp... | [
"logging.getLogger",
"os.getenv",
"logging.Formatter",
"bundle.utils.recorder.Recorder",
"bundle.utils.cache_file_helpers.CacheFolder",
"logging.handlers.TimedRotatingFileHandler"
] | [((563, 607), 'os.getenv', 'getenv', (['_CACHE_PATH_ENV_NAME', 'USER_DOCS_PATH'], {}), '(_CACHE_PATH_ENV_NAME, USER_DOCS_PATH)\n', (569, 607), False, 'from os import getenv\n'), ((426, 475), 'os.getenv', 'getenv', (['_CACHE_FOLDER_AUTO_DELETE_ENV_NAME', '(False)'], {}), '(_CACHE_FOLDER_AUTO_DELETE_ENV_NAME, False)\n', ... |
# Copyright 2018 <NAME>, <NAME>.
# (Strongly inspired by original Google BERT code and Hugging Face's code)
""" Fine-tuning on A Classification Task with pretrained Transformer """
import itertools
import csv
import fire
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
import toke... | [
"torch.nn.Dropout",
"torch.nn.CrossEntropyLoss",
"pandas.read_csv",
"fire.Fire",
"torch.nn.Tanh",
"torch.exp",
"os.walk",
"utils.truncate_tokens_pair",
"pandas.DataFrame",
"tokenization.FullTokenizer",
"torch.utils.data.Dataset.__init__",
"models.Config.from_json",
"utils.set_seeds",
"nump... | [((563, 601), 'pandas.read_csv', 'pd.read_csv', (['path'], {'sep': '"""\t"""', 'dtype': 'str'}), "(path, sep='\\t', dtype=str)\n", (574, 601), True, 'import pandas as pd\n'), ((7755, 7788), 'train.Config.from_json', 'train.Config.from_json', (['train_cfg'], {}), '(train_cfg)\n', (7777, 7788), False, 'import train\n'), ... |
import pytest
from teos.extended_appointment import ExtendedAppointment
@pytest.fixture
def ext_appointment_data(generate_dummy_appointment):
return generate_dummy_appointment().to_dict()
# Parent methods are not tested.
def test_init_ext_appointment(ext_appointment_data):
# The appointment has no checks... | [
"teos.extended_appointment.ExtendedAppointment.from_dict",
"pytest.raises",
"teos.extended_appointment.ExtendedAppointment"
] | [((453, 707), 'teos.extended_appointment.ExtendedAppointment', 'ExtendedAppointment', (["ext_appointment_data['locator']", "ext_appointment_data['encrypted_blob']", "ext_appointment_data['to_self_delay']", "ext_appointment_data['user_id']", "ext_appointment_data['user_signature']", "ext_appointment_data['start_block']"... |
# Copyright 2022 The gRPC Authors
#
# 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 writ... | [
"logging.getLogger",
"absl.testing.absltest.main",
"absl.flags.adopt_module_key_flags"
] | [((1161, 1188), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1178, 1188), False, 'import logging\n'), ((1189, 1239), 'absl.flags.adopt_module_key_flags', 'flags.adopt_module_key_flags', (['xds_url_map_testcase'], {}), '(xds_url_map_testcase)\n', (1217, 1239), False, 'from absl import f... |
# Training to a set of multiple objects (e.g. ShapeNet or DTU)
# tensorboard logs available in logs/<expname>
import sys
import os
sys.path.insert(
0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src"))
)
import warnings
import trainlib
from model import make_model, loss
from render import NeRF... | [
"util.get_cuda",
"torch.from_numpy",
"torch.nn.MSELoss",
"data.get_split_dataset",
"torchvision.utils.save_image",
"render.NeRFRenderer.from_conf",
"os.path.exists",
"util.gen_rays",
"torch.randint",
"model.loss.get_rgb_loss",
"util.batched_index_select_nd",
"numpy.random.choice",
"util.psnr... | [((630, 670), 'warnings.filterwarnings', 'warnings.filterwarnings', ([], {'action': '"""ignore"""'}), "(action='ignore')\n", (653, 670), False, 'import warnings\n'), ((2238, 2313), 'util.args.parse_args', 'util.args.parse_args', (['extra_args'], {'training': '(True)', 'default_ray_batch_size': '(128)'}), '(extra_args, ... |
"""
basic.py : Some basic classes encapsulating filter chains
* Copyright 2017-2020 Valkka Security Ltd. and <NAME>
*
* Authors: <NAME> <<EMAIL>>
*
* This file is part of the Valkka library.
*
* Valkka is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Publi... | [
"valkka.core.RGBShmemFrameFilter",
"valkka.core.AVThread",
"valkka.core.FrameFifoContext",
"time.sleep",
"valkka.api2.threads.LiveThread",
"valkka.core.SwScaleFrameFilter",
"valkka.api2.threads.OpenGLThread",
"valkka.core.TimeIntervalFrameFilter",
"valkka.core.ForkFrameFilter",
"valkka.api2.tools.... | [((11802, 11846), 'valkka.api2.threads.LiveThread', 'LiveThread', ([], {'name': '"""live_thread"""', 'verbose': '(True)'}), "(name='live_thread', verbose=True)\n", (11812, 11846), False, 'from valkka.api2.threads import LiveThread, OpenGLThread\n'), ((11889, 11943), 'valkka.api2.threads.OpenGLThread', 'OpenGLThread', (... |
import os.path
from uuid import uuid4
def save_image(image, save_to='.'):
"""
Save image to local dick
"""
suffix = '.jpg'
if image.mode == 'P':
image = image.convert('RGBA')
if image.mode == 'RGBA':
suffix = '.png'
filename = uuid4().hex + suffix
if not os.path.isd... | [
"uuid.uuid4"
] | [((276, 283), 'uuid.uuid4', 'uuid4', ([], {}), '()\n', (281, 283), False, 'from uuid import uuid4\n')] |
#
# File:
# color4.py
#
# Synopsis:
# Draws sixteen sample color boxs with RGB labels.
#
# Category:
# Colors
#
# Author:
# <NAME>
#
# Date of initial publication:
# January, 2006
#
# Description:
# This example draws sixteen color boxes using the RGB
# values for named colors. The boxes are... | [
"Ngl.polyline_ndc",
"Ngl.polygon_ndc",
"Ngl.Resources",
"Ngl.end",
"Ngl.open_wks",
"Ngl.text_ndc",
"numpy.zeros",
"Ngl.frame"
] | [((1636, 1651), 'Ngl.Resources', 'Ngl.Resources', ([], {}), '()\n', (1649, 1651), False, 'import Ngl\n'), ((1772, 1811), 'Ngl.open_wks', 'Ngl.open_wks', (['wks_type', '"""color4"""', 'rlist'], {}), "(wks_type, 'color4', rlist)\n", (1784, 1811), False, 'import Ngl\n'), ((2069, 2088), 'numpy.zeros', 'numpy.zeros', (['(5)... |
import random
from evaluator import ChessEval
class ChessAI(object):
INF = 8000
def __init__(self,game,color):
self.game = game
self.evaluator = ChessEval(game)
self.color = color
self.drunkMode = False
self.points = {'Pawn': 10, 'Knight': 30, 'Bishop': 30, 'Rook': 5... | [
"evaluator.ChessEval"
] | [((174, 189), 'evaluator.ChessEval', 'ChessEval', (['game'], {}), '(game)\n', (183, 189), False, 'from evaluator import ChessEval\n')] |
import bpy
def Render_Animation():
bpy.ops.object.camera_add(enter_editmode=False, align='VIEW', location=(0, 0, 0), rotation=(1.60443, 0.014596, 2.55805))
bpy.ops.object.light_add(type='SUN', location=(0, 0, 5)) #setting camera and lights for rendering
cam = bpy.data.objects["Camera"]
scene = bpy.cont... | [
"bpy.ops.view3d.camera_to_view_selected",
"bpy.ops.object.camera_add",
"bpy.ops.object.light_add"
] | [((40, 165), 'bpy.ops.object.camera_add', 'bpy.ops.object.camera_add', ([], {'enter_editmode': '(False)', 'align': '"""VIEW"""', 'location': '(0, 0, 0)', 'rotation': '(1.60443, 0.014596, 2.55805)'}), "(enter_editmode=False, align='VIEW', location=(0, \n 0, 0), rotation=(1.60443, 0.014596, 2.55805))\n", (65, 165), Fa... |
# ----------------------------------------------------------------------------------------------------------------------
# Body Weight test cases
# ----------------------------------------------------------------------------------------------------------------------
# imports
import unittest
import tempfile
import ... | [
"logging.getLogger",
"os.path.exists",
"os.path.join",
"src.Util.config.Config",
"tempfile.mkdtemp",
"shutil.rmtree"
] | [((643, 661), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (659, 661), False, 'import tempfile\n'), ((687, 733), 'os.path.join', 'os.path.join', (['self.logs_dir', '"""test_config.ini"""'], {}), "(self.logs_dir, 'test_config.ini')\n", (699, 733), False, 'import os\n'), ((756, 783), 'logging.getLogger', 'lo... |
import re
import time
import requests
from telethon import events
from userbot import CMD_HELP
from userbot.utils import register
import asyncio
import random
EMOJIS = [
"😂",
"😂",
"👌",
"💞",
"👍",
"👌",
"💯",
"🎶",
"👀",
"😂",
"👓",
"👏",
"👐",
"🍕",
"💥... | [
"userbot.utils.register",
"random.choice",
"random.getrandbits",
"re.sub",
"userbot.CMD_HELP.update",
"random.randint"
] | [((2774, 2827), 'userbot.utils.register', 'register', ([], {'outgoing': '(True)', 'pattern': '"""^.vapor(?: |$)(.*)"""'}), "(outgoing=True, pattern='^.vapor(?: |$)(.*)')\n", (2782, 2827), False, 'from userbot.utils import register\n'), ((3590, 3641), 'userbot.utils.register', 'register', ([], {'outgoing': '(True)', 'pa... |
# -----------------------------------------------------------------------------------
# <copyright company="Aspose" file="test_drawing_objects.py">
# Copyright (c) 2020 Aspose.Words for Cloud
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this softwar... | [
"os.path.join"
] | [((1994, 2041), 'os.path.join', 'os.path.join', (['self.local_test_folder', 'localFile'], {}), '(self.local_test_folder, localFile)\n', (2006, 2041), False, 'import os\n'), ((3044, 3091), 'os.path.join', 'os.path.join', (['self.local_test_folder', 'localFile'], {}), '(self.local_test_folder, localFile)\n', (3056, 3091)... |
import numpy as np
import matplotlib.pyplot as plt
import freqent.freqentn as fen
import dynamicstructurefactor.sqw as sqw
from itertools import product
import os
import matplotlib as mpl
mpl.rcParams['pdf.fonttype'] = 42
savepath = '/media/daniel/storage11/Dropbox/LLM_Danny/frequencySpaceDissipation/tests/freqentn_te... | [
"numpy.sqrt",
"numpy.asarray",
"freqent.freqentn._nd_gauss_smooth",
"matplotlib.pyplot.close",
"freqent.freqentn.corr_matrix",
"numpy.linspace",
"numpy.zeros",
"numpy.cos",
"numpy.meshgrid",
"dynamicstructurefactor.sqw.azimuthal_average_3D",
"matplotlib.pyplot.subplots",
"numpy.arange",
"mat... | [((326, 342), 'matplotlib.pyplot.close', 'plt.close', (['"""all"""'], {}), "('all')\n", (335, 342), True, 'import matplotlib.pyplot as plt\n'), ((1853, 1889), 'numpy.linspace', 'np.linspace', (['(-xmax / 2)', '(xmax / 2)', 'nx'], {}), '(-xmax / 2, xmax / 2, nx)\n', (1864, 1889), True, 'import numpy as np\n'), ((1897, 1... |
from flask import url_for
from flexmock import flexmock
from packit_service import models
from packit_service.models import CoprBuildModel
from packit_service.service.views import _get_build_info
from tests_requre.conftest import SampleValues
def test_get_build_logs_for_build_pr(clean_before_and_after, a_copr_build_... | [
"packit_service.models.CoprBuildModel.get_by_build_id",
"flexmock.flexmock",
"packit_service.service.views._get_build_info",
"flask.url_for"
] | [((450, 518), 'packit_service.service.views._get_build_info', '_get_build_info', (['a_copr_build_for_pr'], {'build_description': '"""COPR build"""'}), "(a_copr_build_for_pr, build_description='COPR build')\n", (465, 518), False, 'from packit_service.service.views import _get_build_info\n'), ((1143, 1220), 'packit_servi... |
# -*- coding: utf-8 -*-
""""
Bandidos estocásticos: introducción, algoritmos y experimentos
TFG Informática
Sección 8.4.4
Figuras 26, 27 y 28
Autor: <NAME>
"""
import math
import random
import scipy.stats as stats
import matplotlib.pyplot as plt
import numpy as np
def computemTeor(n,Delta):
if Del... | [
"matplotlib.pyplot.ylabel",
"scipy.stats.norm",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"math.sqrt",
"math.log",
"numpy.linspace",
"matplotlib.pyplot.figure",
"numpy.empty",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((486, 506), 'numpy.empty', 'np.empty', (['(n // 2 + 1)'], {}), '(n // 2 + 1)\n', (494, 506), True, 'import numpy as np\n'), ((512, 528), 'scipy.stats.norm', 'stats.norm', (['(0)', '(1)'], {}), '(0, 1)\n', (522, 528), True, 'import scipy.stats as stats\n'), ((1994, 2010), 'scipy.stats.norm', 'stats.norm', (['(0)', '(1... |
import os
import xml.etree.ElementTree as ET
from tempfile import NamedTemporaryFile
ENV_ASSET_DIR_V1 = os.path.join(os.path.dirname(__file__), 'assets_v1')
ENV_ASSET_DIR_V2 = os.path.join(os.path.dirname(__file__), 'assets_v2')
def full_v1_path_for(file_name):
return os.path.join(ENV_ASSET_DIR_V1, file_name)
... | [
"os.path.dirname",
"os.path.join",
"xml.etree.ElementTree.parse",
"os.path.split"
] | [((118, 143), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (133, 143), False, 'import os\n'), ((190, 215), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (205, 215), False, 'import os\n'), ((276, 317), 'os.path.join', 'os.path.join', (['ENV_ASSET_DIR_V1', 'file_na... |
"""
LCCS Level 3 Classification
| Class name | Code | Numeric code |
|----------------------------------|-----|-----|
| Cultivated Terrestrial Vegetated | A11 | 111 |
| Natural Terrestrial Vegetated | A12 | 112 |
| Cultivated Aquatic Vegetated | A23 | 123 |
| Natural Aquatic Vegetated | A24 | 124 |
| Art... | [
"numpy.uint8",
"numpy.zeros",
"logging.warning",
"numpy.zeros_like"
] | [((1476, 1533), 'numpy.zeros_like', 'numpy.zeros_like', (['classification_array'], {'dtype': 'numpy.uint8'}), '(classification_array, dtype=numpy.uint8)\n', (1492, 1533), False, 'import numpy\n'), ((1546, 1567), 'numpy.zeros_like', 'numpy.zeros_like', (['red'], {}), '(red)\n', (1562, 1567), False, 'import numpy\n'), ((... |
"""
# Sample code to perform I/O:
name = input() # Reading input from STDIN
print('Hi, %s.' % name) # Writing output to STDOUT
# Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail
"""
# Write your code here
from collections import defaultdict
n, m, ... | [
"collections.defaultdict"
] | [((370, 387), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (381, 387), False, 'from collections import defaultdict\n'), ((584, 600), 'collections.defaultdict', 'defaultdict', (['set'], {}), '(set)\n', (595, 600), False, 'from collections import defaultdict\n')] |
# Generated by Django 3.0.2 on 2020-02-19 18:12
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('level1', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='conjugation',
name='he_future',
),
... | [
"django.db.migrations.RemoveField"
] | [((215, 281), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""conjugation"""', 'name': '"""he_future"""'}), "(model_name='conjugation', name='he_future')\n", (237, 281), False, 'from django.db import migrations\n'), ((326, 391), 'django.db.migrations.RemoveField', 'migrations.Remov... |
from manimlib.imports import *
from srcs.utils import run
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.backends.backend_agg import FigureCanvasAgg
from sklearn import svm # sklearn = scikit-learn
from sklearn.datasets import make_moons
def mplfig_to_npimage(fig):
""" Converts a matplotlib ... | [
"numpy.arange",
"numpy.sinc",
"matplotlib.pyplot.close",
"sklearn.datasets.make_moons",
"numpy.linspace",
"matplotlib.backends.backend_agg.FigureCanvasAgg",
"numpy.sin",
"numpy.frombuffer",
"matplotlib.pyplot.subplots",
"srcs.utils.run",
"sklearn.svm.SVC"
] | [((452, 472), 'matplotlib.backends.backend_agg.FigureCanvasAgg', 'FigureCanvasAgg', (['fig'], {}), '(fig)\n', (467, 472), False, 'from matplotlib.backends.backend_agg import FigureCanvasAgg\n'), ((758, 792), 'numpy.frombuffer', 'np.frombuffer', (['buf'], {'dtype': 'np.uint8'}), '(buf, dtype=np.uint8)\n', (771, 792), Tr... |
import copy
import datetime
import os
import random
import traceback
import numpy as np
import torch
from torch.utils.data import DataLoader
from torchvision.utils import save_image
from inference.inference_utils import get_trange, get_tqdm
def init_random_seed(value=0):
random.seed(value)
np.random.seed(va... | [
"torch.manual_seed",
"traceback.format_exc",
"torch.utils.data.DataLoader",
"os.path.join",
"random.seed",
"torch.is_tensor",
"datetime.datetime.now",
"numpy.random.seed",
"numpy.concatenate",
"copy.deepcopy",
"torch.no_grad",
"torch.cuda.manual_seed",
"inference.inference_utils.get_trange",... | [((280, 298), 'random.seed', 'random.seed', (['value'], {}), '(value)\n', (291, 298), False, 'import random\n'), ((303, 324), 'numpy.random.seed', 'np.random.seed', (['value'], {}), '(value)\n', (317, 324), True, 'import numpy as np\n'), ((329, 353), 'torch.manual_seed', 'torch.manual_seed', (['value'], {}), '(value)\n... |
import zmq
import time
import sys
import struct
import multiprocessing
from examples.sim_trace import generate_trace
port = "5556"
if len(sys.argv) > 1:
port = sys.argv[1]
int(port)
socket_addr = "tcp://127.0.0.1:%s" % port
worker_count = multiprocessing.cpu_count() * 2 + 1
stop_signal = False
def worker(c... | [
"multiprocessing.Process",
"time.sleep",
"multiprocessing.cpu_count",
"zmq.Context.instance",
"zmq.Poller",
"examples.sim_trace.generate_trace"
] | [((522, 534), 'zmq.Poller', 'zmq.Poller', ([], {}), '()\n', (532, 534), False, 'import zmq\n'), ((252, 279), 'multiprocessing.cpu_count', 'multiprocessing.cpu_count', ([], {}), '()\n', (277, 279), False, 'import multiprocessing\n'), ((374, 396), 'zmq.Context.instance', 'zmq.Context.instance', ([], {}), '()\n', (394, 39... |
from django.test import TestCase
from django.urls import reverse
from django.utils import timezone
from model_bakery import baker
from app_covid19data.models import DataCovid19Item
from app_covid19data import views
class Covid19dataTest(TestCase):
def setUp(self):
""" Method which the testing framework ... | [
"django.utils.timezone.now",
"app_covid19data.views.get_resume_country",
"app_covid19data.views.get_detail_country",
"django.urls.reverse"
] | [((728, 754), 'django.urls.reverse', 'reverse', (['views.resume_view'], {}), '(views.resume_view)\n', (735, 754), False, 'from django.urls import reverse\n'), ((1025, 1058), 'app_covid19data.views.get_resume_country', 'views.get_resume_country', (['"""Spain"""'], {}), "('Spain')\n", (1049, 1058), False, 'from app_covid... |
from typing import Optional, List
from aiogram import types, Dispatcher, filters
from aiogram.dispatcher import FSMContext
from aiogram.dispatcher.filters.state import StatesGroup, State
from aiogram.types import ReplyKeyboardMarkup
from handlers.common_actions_handlers import process_manual_enter, process_option_sel... | [
"aiogram.filters.Text",
"aiogram.filters.Regexp",
"statistics.collect_statistic",
"handlers.common_actions_handlers.process_manual_enter",
"aiogram.dispatcher.filters.state.State",
"keyboards.get_next_actions_kb",
"handlers.common_actions_handlers.process_option_selection",
"handlers.common_actions_ha... | [((723, 768), 'statistics.collect_statistic', 'collect_statistic', ([], {'event_name': '"""essence:start"""'}), "(event_name='essence:start')\n", (740, 768), False, 'from statistics import collect_statistic\n'), ((1736, 1788), 'statistics.collect_statistic', 'collect_statistic', ([], {'event_name': '"""essence:show_exa... |
"""Module related to processing of an outbound message"""
from typing import Dict, Optional
from utilities import integration_adaptors_logger as log
from builder.pystache_message_builder import MessageGenerationError
from message_handling.message_sender import MessageSender
import xml.etree.ElementTree as ET
logger = ... | [
"utilities.integration_adaptors_logger.IntegrationAdaptorsLogger",
"builder.pystache_message_builder.MessageGenerationError"
] | [((320, 364), 'utilities.integration_adaptors_logger.IntegrationAdaptorsLogger', 'log.IntegrationAdaptorsLogger', (['"""MSG-HANDLER"""'], {}), "('MSG-HANDLER')\n", (349, 364), True, 'from utilities import integration_adaptors_logger as log\n'), ((2880, 2980), 'builder.pystache_message_builder.MessageGenerationError', '... |
#!/usr/bin/env python
# Copyright 2018 Informatics Matters Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"os.path.isfile",
"os.path.join",
"os.getcwd"
] | [((1893, 1926), 'os.path.join', 'os.path.join', (['directory', 'filename'], {}), '(directory, filename)\n', (1905, 1926), False, 'import os\n'), ((3088, 3121), 'os.path.join', 'os.path.join', (['directory', 'filename'], {}), '(directory, filename)\n', (3100, 3121), False, 'import os\n'), ((3129, 3166), 'os.path.isfile'... |
import numpy as np, pandas as pd
import math
from statsmodels.tsa.arima_model import ARIMA
from statsmodels.tsa.stattools import adfuller, kpss, acf
import matplotlib.pyplot as plt
plt.rcParams.update({'figure.figsize': (9, 7), 'figure.dpi': 120})
# Import data
def Read(name):
df = pd.read_csv(name + ... | [
"pandas.Series",
"math.ceil",
"pandas.read_csv",
"statsmodels.tsa.stattools.adfuller",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.fill_between",
"matplotlib.pyplot.rcParams.update",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
"statsmodels.tsa.arima_model.ARIMA",
"matplotlib.pyplot.l... | [((188, 254), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (["{'figure.figsize': (9, 7), 'figure.dpi': 120}"], {}), "({'figure.figsize': (9, 7), 'figure.dpi': 120})\n", (207, 254), True, 'import matplotlib.pyplot as plt\n'), ((301, 327), 'pandas.read_csv', 'pd.read_csv', (["(name + '.csv')"], {}), "(name... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 9 15:38:54 2020
@author: rayin
"""
# pic-sure api lib
import PicSureHpdsLib
import PicSureClient
# python_lib for pic-sure
# https://github.com/hms-dbmi/Access-to-Data-using-PIC-SURE-API/tree/master/NIH_Undiagnosed_Diseases_Network
from python_li... | [
"pandas.DataFrame",
"pandas.read_csv",
"os.chdir",
"collections.Counter",
"pandas.isna"
] | [((551, 612), 'os.chdir', 'os.chdir', (['"""/Users/rayin/Google Drive/Harvard/5_data/UDN/work"""'], {}), "('/Users/rayin/Google Drive/Harvard/5_data/UDN/work')\n", (559, 612), False, 'import os\n'), ((693, 733), 'pandas.read_csv', 'pd.read_csv', (['"""data/raw/raw_data_all.csv"""'], {}), "('data/raw/raw_data_all.csv')\... |
#!/usr/bin/env python3
import numpy as np
import h5py
import matplotlib.pyplot as plt
# import plotly.graph_objects as go
#========= Configuration ===========
DIR ="../data"
file_name = "particle"#"rhoNeutral" #"P"
h5 = h5py.File('../data/'+file_name+'.hdf5','r')
Lx = h5.attrs["Lx"]
Ly = h5.attrs["Ly"]
Lz = h5.at... | [
"matplotlib.pyplot.plot",
"h5py.File",
"numpy.array",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((225, 273), 'h5py.File', 'h5py.File', (["('../data/' + file_name + '.hdf5')", '"""r"""'], {}), "('../data/' + file_name + '.hdf5', 'r')\n", (234, 273), False, 'import h5py\n'), ((407, 453), 'numpy.arange', 'np.arange', ([], {'start': '(0)', 'stop': 'Nt', 'step': '(1)', 'dtype': 'int'}), '(start=0, stop=Nt, step=1, dt... |
import copy
import sys
from . import compat
from .compat import urlencode, parse_qs
class Request(compat.Request):
def __init__(self, url, parameters=None, headers=None):
self.parameters = parameters
if parameters is None:
data = None
else:
if sys.version_info >= (... | [
"copy.copy"
] | [((797, 812), 'copy.copy', 'copy.copy', (['self'], {}), '(self)\n', (806, 812), False, 'import copy\n')] |
# -*- coding: utf-8 -*-
"""
Iris classification example, pratice on using high-level API
Algorithms: Neutral Network
Reference: https://www.tensorflow.org/get_started/tflearn
Date: Jun 14, 2017
@author: <NAME>
@Library: tensorflow - high-level API with tf.contrib.learn
"""
from __future__ import absolute_import
fro... | [
"os.path.exists",
"tensorflow.contrib.learn.DNNClassifier",
"tensorflow.contrib.layers.real_valued_column",
"tensorflow.contrib.learn.datasets.base.load_csv_with_header",
"numpy.array",
"tensorflow.constant"
] | [((1176, 1303), 'tensorflow.contrib.learn.datasets.base.load_csv_with_header', 'tf.contrib.learn.datasets.base.load_csv_with_header', ([], {'filename': 'IRIS_TRAINING', 'target_dtype': 'np.int', 'features_dtype': 'np.float32'}), '(filename=IRIS_TRAINING,\n target_dtype=np.int, features_dtype=np.float32)\n', (1227, 1... |
import discord
import os
import openpyxl
from deep_translator import GoogleTranslator
client = discord.Client()
TOKEN = os.getenv('TOKEN')
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
@client.event
async def on_message(message):
if message.author ==... | [
"discord.Client",
"deep_translator.GoogleTranslator",
"os.getenv"
] | [((102, 118), 'discord.Client', 'discord.Client', ([], {}), '()\n', (116, 118), False, 'import discord\n'), ((128, 146), 'os.getenv', 'os.getenv', (['"""TOKEN"""'], {}), "('TOKEN')\n", (137, 146), False, 'import os\n'), ((1508, 1561), 'deep_translator.GoogleTranslator', 'GoogleTranslator', ([], {'source': 'firstlang', ... |
import unittest
from finetune.util.input_utils import validation_settings
class TestValidationSettings(unittest.TestCase):
def test_validation_settings(self):
"""
Ensure LM only training does not error out
"""
val_size, val_interval = validation_settings(dataset_size=30, batch_siz... | [
"finetune.util.input_utils.validation_settings"
] | [((274, 383), 'finetune.util.input_utils.validation_settings', 'validation_settings', ([], {'dataset_size': '(30)', 'batch_size': '(4)', 'val_size': '(0)', 'val_interval': 'None', 'keep_best_model': '(False)'}), '(dataset_size=30, batch_size=4, val_size=0, val_interval\n =None, keep_best_model=False)\n', (293, 383),... |
# Generated by Django 2.0.3 on 2018-03-16 00:17
from django.conf import settings
import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependenc... | [
"django.db.migrations.AlterUniqueTogether",
"django.db.models.ForeignKey",
"django.db.models.AutoField",
"django.db.migrations.swappable_dependency",
"django.db.models.CharField"
] | [((290, 347), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (321, 347), False, 'from django.db import migrations, models\n'), ((970, 1058), 'django.db.migrations.AlterUniqueTogether', 'migrations.AlterUniqueTogether', ... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('extras', '0060_customlink_button_class'),
]
operations = [
migrations.AddField(
model_name='customfield',
name='created',
field=models.DateField(auto_now... | [
"django.db.models.DateTimeField",
"django.db.models.DateField"
] | [((295, 341), 'django.db.models.DateField', 'models.DateField', ([], {'auto_now_add': '(True)', 'null': '(True)'}), '(auto_now_add=True, null=True)\n', (311, 341), False, 'from django.db import migrations, models\n'), ((472, 518), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now': '(True)', 'nu... |
from memsql.common import database
import sys
from datetime import datetime
DATABASE = 'PREPDB'
HOST = '10.1.100.12'
PORT = '3306'
USER = 'root'
PASSWORD = '<PASSWORD>'
def get_connection(db=DATABASE):
""" Returns a new connection to the database. """
return database.connect(host=HOST, port=PORT, user=USER, ... | [
"datetime.datetime.now",
"memsql.common.database.connect",
"sys.exit"
] | [((270, 355), 'memsql.common.database.connect', 'database.connect', ([], {'host': 'HOST', 'port': 'PORT', 'user': 'USER', 'password': 'PASSWORD', 'database': 'db'}), '(host=HOST, port=PORT, user=USER, password=PASSWORD,\n database=db)\n', (286, 355), False, 'from memsql.common import database\n'), ((613, 623), 'sys.... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand
from documents.tests.utils import generate_random_documents
from categories.models import Category
class Command(BaseCommand):
args = '<number_of_documents> <category_id>'
help = 'Creates a given number of random d... | [
"categories.models.Category.objects.get",
"documents.tests.utils.generate_random_documents"
] | [((460, 496), 'categories.models.Category.objects.get', 'Category.objects.get', ([], {'pk': 'category_id'}), '(pk=category_id)\n', (480, 496), False, 'from categories.models import Category\n'), ((506, 553), 'documents.tests.utils.generate_random_documents', 'generate_random_documents', (['nb_of_docs', 'category'], {})... |
import re
from typing import Any, Dict
from checkov.common.models.consts import DOCKER_IMAGE_REGEX
from checkov.common.models.enums import CheckResult
from checkov.kubernetes.checks.resource.base_container_check import BaseK8sContainerCheck
class ImagePullPolicyAlways(BaseK8sContainerCheck):
def __init__(self) -... | [
"re.findall"
] | [((1393, 1434), 're.findall', 're.findall', (['DOCKER_IMAGE_REGEX', 'image_val'], {}), '(DOCKER_IMAGE_REGEX, image_val)\n', (1403, 1434), False, 'import re\n')] |
import os
import glob
import sys
import argparse
import re
from collections import defaultdict
from celescope.__init__ import __CONDA__
from celescope.fusion.__init__ import __STEPS__, __ASSAY__
from celescope.tools.utils import merge_report, generate_sjm
from celescope.tools.utils import parse_map_col4, multi_opts, li... | [
"celescope.tools.utils.parse_map_col4",
"celescope.tools.utils.link_data",
"collections.defaultdict",
"celescope.tools.utils.generate_sjm",
"celescope.tools.utils.merge_report",
"celescope.tools.utils.multi_opts",
"os.system"
] | [((469, 486), 'celescope.tools.utils.multi_opts', 'multi_opts', (['assay'], {}), '(assay)\n', (479, 486), False, 'from celescope.tools.utils import parse_map_col4, multi_opts, link_data\n'), ((1220, 1254), 'celescope.tools.utils.parse_map_col4', 'parse_map_col4', (['args.mapfile', 'None'], {}), '(args.mapfile, None)\n'... |
# Generated by Django 2.2 on 2019-12-20 06:56
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('University', '0011_auto_20191219_1913'),
]
operations = [
migrations.RemoveField(
model_name='university',
name='user',
... | [
"django.db.migrations.RemoveField"
] | [((228, 288), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""university"""', 'name': '"""user"""'}), "(model_name='university', name='user')\n", (250, 288), False, 'from django.db import migrations\n'), ((333, 398), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([]... |
#importing lib
import pandas as pd
import numpy as np
#Take data
df = pd.DataFrame({"Name":['Kunal' , 'Mohit' , 'Rohit' ] ,"age":[np.nan , 23, 45] , "sex":['M' , np.nan , 'M']})
#check for nnull value
print(df.isnull().sum())
print(df.describe())
# ignore the nan rows
print(len(df.dropna()) , df.dropna())
#for ... | [
"pandas.DataFrame"
] | [((72, 179), 'pandas.DataFrame', 'pd.DataFrame', (["{'Name': ['Kunal', 'Mohit', 'Rohit'], 'age': [np.nan, 23, 45], 'sex': ['M',\n np.nan, 'M']}"], {}), "({'Name': ['Kunal', 'Mohit', 'Rohit'], 'age': [np.nan, 23, 45],\n 'sex': ['M', np.nan, 'M']})\n", (84, 179), True, 'import pandas as pd\n')] |
import datetime
from .consola import Consola
from .uiscreen import UIScreen
from ..core.reloj import Reloj
class AjustarReloj(UIScreen):
def __init__(self, unMain, unUsuario):
super().__init__(unMain)
self.usuario = unUsuario
def run(self):
self.consola.prnt("")
self.consola.prnt(" Ahora: %s" %... | [
"datetime.datetime.strptime"
] | [((1150, 1199), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (['inputDate', '"""%d/%m/%Y"""'], {}), "(inputDate, '%d/%m/%Y')\n", (1176, 1199), False, 'import datetime\n'), ((1663, 1712), 'datetime.datetime.strptime', 'datetime.datetime.strptime', (['inputTime', '"""%H:%M:%S"""'], {}), "(inputTime, '%H:%M... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import traceback
from selenium.webdriver import ChromeOptions
from signin.chrome import find_chrome_driver_path, JdSession
from signin.jd_job import jobs_all
from lib.log import logger
from lib.settings import PC_UA
from lib.settings import MOBILE_UA
class JDUser:
... | [
"signin.chrome.find_chrome_driver_path",
"selenium.webdriver.ChromeOptions",
"traceback.print_exc"
] | [((1941, 1966), 'signin.chrome.find_chrome_driver_path', 'find_chrome_driver_path', ([], {}), '()\n', (1964, 1966), False, 'from signin.chrome import find_chrome_driver_path, JdSession\n'), ((2120, 2135), 'selenium.webdriver.ChromeOptions', 'ChromeOptions', ([], {}), '()\n', (2133, 2135), False, 'from selenium.webdrive... |
from unittest import TestCase
from unittest.mock import Mock
from tests.test_types_generator import athena_task
class TestAwsAthenaTask(TestCase):
def test_run_task(self) -> None:
with self.assertRaises(NotImplementedError):
athena_task()._run_task(Mock())
| [
"unittest.mock.Mock",
"tests.test_types_generator.athena_task"
] | [((276, 282), 'unittest.mock.Mock', 'Mock', ([], {}), '()\n', (280, 282), False, 'from unittest.mock import Mock\n'), ((252, 265), 'tests.test_types_generator.athena_task', 'athena_task', ([], {}), '()\n', (263, 265), False, 'from tests.test_types_generator import athena_task\n')] |
from . import db
from flask import Flask, current_app
from . import create_app
import os
from . import db
app = create_app()
with app.app_context():
if os.path.exists("clearsky/config.json"):
pass
else:
with open('clearsky/config.json', 'w') as configuration:
print("Opened config ... | [
"os.path.exists"
] | [((159, 197), 'os.path.exists', 'os.path.exists', (['"""clearsky/config.json"""'], {}), "('clearsky/config.json')\n", (173, 197), False, 'import os\n'), ((660, 727), 'os.path.exists', 'os.path.exists', (["(current_app.instance_path + '/' + 'clearsky.sqlite')"], {}), "(current_app.instance_path + '/' + 'clearsky.sqlite'... |
import logging
from abc import ABC, abstractmethod
from file_read_backwards import FileReadBackwards
import threading
import os
class Logger(ABC):
def __init__(self,filename):
self.lock = threading.Lock()
self.dir = "Logs"
if(not os.path.isdir(self.dir)):
os.mkdir(self.dir)
... | [
"logging.getLogger",
"os.path.exists",
"threading.Lock",
"logging.Formatter",
"os.path.isdir",
"logging.FileHandler",
"os.mkdir",
"file_read_backwards.FileReadBackwards"
] | [((204, 220), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (218, 220), False, 'import threading\n'), ((830, 858), 'logging.Formatter', 'logging.Formatter', (['formatter'], {}), '(formatter)\n', (847, 858), False, 'import logging\n'), ((882, 917), 'logging.FileHandler', 'logging.FileHandler', (['self.file_name'... |
from path import path_code_dir
import sys
sys.path.insert(0, path_code_dir)
from amftrack.pipeline.functions.image_processing.extract_width_fun import *
from amftrack.pipeline.functions.image_processing.experiment_class_surf import Experiment, save_graphs, load_graphs
from amftrack.util import get_dates_datetime... | [
"amftrack.pipeline.functions.image_processing.experiment_class_surf.save_graphs",
"sys.path.insert",
"pandas.read_json"
] | [((46, 79), 'sys.path.insert', 'sys.path.insert', (['(0)', 'path_code_dir'], {}), '(0, path_code_dir)\n', (61, 79), False, 'import sys\n'), ((914, 967), 'pandas.read_json', 'pd.read_json', (['f"""{directory_scratch}temp/{op_id}.json"""'], {}), "(f'{directory_scratch}temp/{op_id}.json')\n", (926, 967), True, 'import pan... |
# Copyright 2019 <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 required by applicable law or agreed to... | [
"mxnet.autograd.record",
"time.sleep",
"mxnet.gpu",
"mxnet.init.Constant",
"datetime.timedelta",
"mxnet.gluon.nn.Sequential",
"os.path.exists",
"mxnet.np.dot",
"cv2.medianBlur",
"mxnet.image.imread",
"cv2.addWeighted",
"mxnet.npx.set_np",
"mxnet.nd.array",
"mxnet.npx.waitall",
"mxnet.np.... | [((1056, 1068), 'mxnet.npx.set_np', 'npx.set_np', ([], {}), '()\n', (1066, 1068), False, 'from mxnet import np, npx\n'), ((8332, 8364), 'os.path.join', 'os.path.join', (['output_folder', 'out'], {}), '(output_folder, out)\n', (8344, 8364), False, 'import os\n'), ((9150, 9202), 'cv2.resize', 'cv.resize', (['original_ima... |
''' Common Verify functions for IOX / app-hosting '''
import logging
import time
log = logging.getLogger(__name__)
# Import parser
from genie.utils.timeout import Timeout
from genie.metaparser.util.exceptions import SchemaEmptyParserError
def verify_app_requested_state(device, app_list=None, requested_st... | [
"logging.getLogger",
"genie.utils.timeout.Timeout"
] | [((94, 121), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (111, 121), False, 'import logging\n'), ((955, 1000), 'genie.utils.timeout.Timeout', 'Timeout', ([], {'max_time': 'max_time', 'interval': 'interval'}), '(max_time=max_time, interval=interval)\n', (962, 1000), False, 'from genie.u... |
# import scipy.signal
from gym.spaces import Box, Discrete
import numpy as np
import torch
from torch import nn
import IPython
# from torch.nn import Parameter
import torch.nn.functional as F
from torch.distributions import Independent, OneHotCategorical, Categorical
from torch.distributions.normal import Normal
# # fr... | [
"torch.as_tensor",
"torch.distributions.Categorical",
"torch.nn.Tanh",
"torch.nn.Sequential",
"torch.exp",
"torch.tanh",
"torch.nn.init.uniform_",
"torch.nn.Embedding",
"torch.nn.functional.mse_loss",
"torch.distributions.Normal",
"numpy.ones",
"torch.randn_like",
"torch.nn.functional.one_ho... | [((628, 650), 'torch.nn.Sequential', 'nn.Sequential', (['*layers'], {}), '(*layers)\n', (641, 650), False, 'from torch import nn\n'), ((1513, 1539), 'torch.distributions.Categorical', 'Categorical', ([], {'logits': 'logits'}), '(logits=logits)\n', (1524, 1539), False, 'from torch.distributions import Independent, OneHo... |
from django.shortcuts import render
from django.http import HttpResponse
import datetime as dt
from django.views import View
from photos.models import Image, category
# Create your views here.
def welcome(request):
return render(request, 'welcome.html')
def display_page(request):
image = Image.objects.all()... | [
"django.shortcuts.render",
"photos.models.category.objects.all",
"photos.models.Image.objects.all",
"photos.models.category.search_by_category"
] | [((229, 260), 'django.shortcuts.render', 'render', (['request', '"""welcome.html"""'], {}), "(request, 'welcome.html')\n", (235, 260), False, 'from django.shortcuts import render\n'), ((301, 320), 'photos.models.Image.objects.all', 'Image.objects.all', ([], {}), '()\n', (318, 320), False, 'from photos.models import Ima... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" This module provides a command line interface to news_munger. """
import datetime
import random
import argparse
from munger import DocumentCatalog, Munger
parser = argparse.ArgumentParser()
parser.parse_args()
## Classes ##
class MadLib(Munger):
"""Real soo... | [
"datetime.datetime.today",
"munger.DocumentCatalog",
"argparse.ArgumentParser"
] | [((218, 243), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (241, 243), False, 'import argparse\n'), ((2345, 2362), 'munger.DocumentCatalog', 'DocumentCatalog', ([], {}), '()\n', (2360, 2362), False, 'from munger import DocumentCatalog, Munger\n'), ((1780, 1805), 'datetime.datetime.today', 'da... |
"""This module contains the code related to the DAG and the scheduler."""
from pathlib import Path
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
from matplotlib.colors import LinearSegmentedColormap
from mpl_toolkits.axes_grid1 import make_axes_locatable
from networkx.drawing import nx_pydot... | [
"networkx.relabel_nodes",
"matplotlib.pyplot.savefig",
"networkx.topological_sort",
"pathlib.Path",
"networkx.drawing.nx_pydot.pydot_layout",
"networkx.DiGraph",
"matplotlib.colors.LinearSegmentedColormap.from_list",
"networkx.draw_networkx_nodes",
"matplotlib.pyplot.close",
"numpy.array",
"netw... | [((5769, 5802), 'networkx.topological_sort', 'nx.topological_sort', (['reversed_dag'], {}), '(reversed_dag)\n', (5788, 5802), True, 'import networkx as nx\n'), ((6347, 6377), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {'figsize': '(16, 12)'}), '(figsize=(16, 12))\n', (6359, 6377), True, 'import matplotlib.pyplo... |
import os, os.path, urllib.request, sys, getopt
def main(argv):
print(argv)
input_file = ''
download_dir = ''
try:
opts, args = getopt.getopt(argv,
"hi:d:",
["input-file=","download-dir="])
except getopt.GetoptError as ... | [
"getopt.getopt",
"os.path.join",
"os.getcwd",
"os.path.isfile",
"sys.exit"
] | [((153, 215), 'getopt.getopt', 'getopt.getopt', (['argv', '"""hi:d:"""', "['input-file=', 'download-dir=']"], {}), "(argv, 'hi:d:', ['input-file=', 'download-dir='])\n", (166, 215), False, 'import os, os.path, urllib.request, sys, getopt\n'), ((1223, 1255), 'os.path.join', 'os.path.join', (['download_dir', 'name'], {})... |
from spotify_auth import auth
from urllib import parse
import json
def search(track_name, artist, type='track'):
parsed = parse.quote_plus(query)
query = "artist:{}%20track:{}".format(artist, track_name)
response = auth.get(
'https://api.spotify.com/v1/search?q={}&type={}'.format(query, type))
... | [
"json.loads",
"urllib.parse.quote_plus"
] | [((128, 151), 'urllib.parse.quote_plus', 'parse.quote_plus', (['query'], {}), '(query)\n', (144, 151), False, 'from urllib import parse\n'), ((339, 364), 'json.loads', 'json.loads', (['response.text'], {}), '(response.text)\n', (349, 364), False, 'import json\n')] |
#!/usr/bin/env python
# coding: utf-8
# ## E2E Xgboost MLFLOW
# In[45]:
from pyspark.sql import SparkSession
from pyspark.sql.functions import col, pandas_udf,udf,lit
import azure.synapse.ml.predict as pcontext
import azure.synapse.ml.predict.utils._logger as synapse_predict_logger
import numpy as np
import panda... | [
"mlflow.pyfunc.save_model",
"numpy.random.rand",
"azure.synapse.ml.predict.bind_model",
"numpy.random.randint",
"pandas.DataFrame",
"xgboost.DMatrix",
"xgboost.XGBRFRegressor"
] | [((500, 521), 'numpy.random.rand', 'np.random.rand', (['(5)', '(10)'], {}), '(5, 10)\n', (514, 521), True, 'import numpy as np\n'), ((571, 599), 'numpy.random.randint', 'np.random.randint', (['(1)'], {'size': '(5)'}), '(1, size=5)\n', (588, 599), True, 'import numpy as np\n'), ((626, 656), 'xgboost.DMatrix', 'xgb.DMatr... |
from collections import defaultdict
from .common import IGraph
''' Remove edges to create even trees.
You are given a tree with an even number of nodes. Consider each connection between a parent and child node to be an "edge". You
would like to remove some of these edges, such that the disconnected subtrees that rem... | [
"collections.defaultdict"
] | [((1076, 1092), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (1087, 1092), False, 'from collections import defaultdict\n')] |
import sys
import cv2
from keras.models import load_model
from matplotlib import pyplot as plt
import time
model = load_model("models/model.h5")
def find_faces(image):
face_cascade = cv2.CascadeClassifier('data/haarcascade_frontalface_default.xml')
face_rects = face_cascade.detectMultiScale(
image,... | [
"cv2.rectangle",
"matplotlib.pyplot.imshow",
"keras.models.load_model",
"matplotlib.pyplot.title",
"cv2.resize",
"cv2.putText",
"matplotlib.pyplot.subplot",
"cv2.cvtColor",
"time.time",
"cv2.CascadeClassifier",
"cv2.getTextSize",
"cv2.imread",
"matplotlib.pyplot.show"
] | [((117, 146), 'keras.models.load_model', 'load_model', (['"""models/model.h5"""'], {}), "('models/model.h5')\n", (127, 146), False, 'from keras.models import load_model\n'), ((191, 256), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['"""data/haarcascade_frontalface_default.xml"""'], {}), "('data/haarcascade_front... |
import logging
from os.path import isfile, join as pjoin
from os import environ
try:
from delphin import tsdb
except ImportError:
raise ImportError(
'Could not import pyDelphin module. Get it from here:\n'
' https://github.com/goodmami/pydelphin'
)
# ECC 2021-07-26: the lambda for i-comm... | [
"delphin.tsdb.initialize_database",
"delphin.tsdb.read_schema",
"os.path.join",
"os.path.isfile",
"logging.error",
"delphin.tsdb.write"
] | [((2440, 2477), 'delphin.tsdb.read_schema', 'tsdb.read_schema', (["config['relations']"], {}), "(config['relations'])\n", (2456, 2477), False, 'from delphin import tsdb\n'), ((2520, 2584), 'delphin.tsdb.initialize_database', 'tsdb.initialize_database', (['outpath', "config['schema']"], {'files': '(False)'}), "(outpath,... |
import numpy as np
import matplotlib.pyplot as plt
import g_functions as g_f
R1 = 2
R2 = .6
M = 500
Delta = .1
NB_POINTS = 2**10
EPSILON_IMAG = 1e-8
parameters = {
'M' : M,
'R1' : R1,
'R2' : R2,
'NB_POINTS' : NB_POINTS,
'EPSILON_IMAG' : EPSILON_IMAG,
've... | [
"g_functions.find_rho",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"g_functions.denoiser",
"numpy.zeros",
"g_functions.find_spectrum",
"g_functions.make_sample",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show"
] | [((398, 432), 'g_functions.make_sample', 'g_f.make_sample', (['parameters', 'Delta'], {}), '(parameters, Delta)\n', (413, 432), True, 'import g_functions as g_f\n'), ((474, 505), 'g_functions.find_rho', 'g_f.find_rho', (['parameters', 'Delta'], {}), '(parameters, Delta)\n', (486, 505), True, 'import g_functions as g_f\... |
from django.contrib import admin
# Register your models here.
from .models import Register
admin.site.register(Register) | [
"django.contrib.admin.site.register"
] | [((93, 122), 'django.contrib.admin.site.register', 'admin.site.register', (['Register'], {}), '(Register)\n', (112, 122), False, 'from django.contrib import admin\n')] |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import statsmodels.api as sm
import datetime as dt
from statsmodels.stats.multitest import fdrcorrection
from pylab import savefig
# FUNCTIONS YOU CAN USE:
# analyses(filepath) spits out a nifty heatmap to let you check ... | [
"numpy.linalg.pinv",
"pandas.read_csv",
"numpy.isfinite",
"numpy.sin",
"statsmodels.api.OLS",
"pandas.to_datetime",
"matplotlib.pyplot.twinx",
"numpy.datetime64",
"pandas.DataFrame",
"matplotlib.pyplot.ylim",
"statsmodels.stats.multitest.fdrcorrection",
"matplotlib.pyplot.savefig",
"seaborn.... | [((1308, 1329), 'pandas.read_csv', 'pd.read_csv', (['filepath'], {}), '(filepath)\n', (1319, 1329), True, 'import pandas as pd\n'), ((2167, 2189), 'numpy.sin', 'np.sin', (['time_delta_rad'], {}), '(time_delta_rad)\n', (2173, 2189), True, 'import numpy as np\n'), ((2217, 2239), 'numpy.cos', 'np.cos', (['time_delta_rad']... |
import pytest
from eunomia.config._default import Default
from eunomia.config.nodes import ConfigNode
from tests.test_backend_obj import _make_config_group
# ========================================================================= #
# Test YAML & Custom Tags #
# ===... | [
"eunomia.config._default.Default",
"pytest.raises",
"tests.test_backend_obj._make_config_group"
] | [((799, 897), 'tests.test_backend_obj._make_config_group', '_make_config_group', ([], {'suboption': 'None', 'suboption2': 'None', 'package1': '"""<option>"""', 'package2': '"""asdf.fdsa"""'}), "(suboption=None, suboption2=None, package1='<option>',\n package2='asdf.fdsa')\n", (817, 897), False, 'from tests.test_back... |
import os
import logging
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Notify', '0.7')
from locale import atof, setlocale, LC_NUMERIC
from gi.repository import Notify
from itertools import islice
from subprocess import check_output, check_call, CalledProcessError
from ulauncher.api.client.Extension i... | [
"logging.getLogger",
"subprocess.check_output",
"locale.atof",
"locale.setlocale",
"subprocess.check_call",
"ulauncher.api.shared.action.RenderResultListAction.RenderResultListAction",
"os.environ.copy",
"gi.require_version",
"ulauncher.api.shared.action.ExtensionCustomAction.ExtensionCustomAction",... | [((36, 68), 'gi.require_version', 'gi.require_version', (['"""Gtk"""', '"""3.0"""'], {}), "('Gtk', '3.0')\n", (54, 68), False, 'import gi\n'), ((69, 104), 'gi.require_version', 'gi.require_version', (['"""Notify"""', '"""0.7"""'], {}), "('Notify', '0.7')\n", (87, 104), False, 'import gi\n'), ((739, 766), 'logging.getLo... |
from flask import current_app
from flask import g
from flask import request
from flask_restful.reqparse import RequestParser
from flask_restful import Resource
from models import db
from models.user import User
from utils.decorators import login_required
from utils.parser import image_file
from utils.storage import up... | [
"cache.user.UserProfileCache",
"flask_restful.reqparse.RequestParser",
"models.user.User.query.filter",
"models.db.session.commit"
] | [((511, 526), 'flask_restful.reqparse.RequestParser', 'RequestParser', ([], {}), '()\n', (524, 526), False, 'from flask_restful.reqparse import RequestParser\n'), ((895, 914), 'models.db.session.commit', 'db.session.commit', ([], {}), '()\n', (912, 914), False, 'from models import db\n'), ((812, 851), 'models.user.User... |
"""Implement the Unit class."""
import numpy as np
from .. import config, constants
__all__ = ["Pixels", "Degrees", "Munits", "Percent"]
class _PixelUnits:
def __mul__(self, val):
return val * config.frame_width / config.pixel_width
def __rmul__(self, val):
return val * config.frame_width ... | [
"numpy.array_equal"
] | [((399, 437), 'numpy.array_equal', 'np.array_equal', (['axis', 'constants.X_AXIS'], {}), '(axis, constants.X_AXIS)\n', (413, 437), True, 'import numpy as np\n'), ((495, 533), 'numpy.array_equal', 'np.array_equal', (['axis', 'constants.Y_AXIS'], {}), '(axis, constants.Y_AXIS)\n', (509, 533), True, 'import numpy as np\n'... |
from urllib.request import urlopen
from bs4 import BeautifulSoup as soup
import re
import pandas as pd
def getContainerInfo(container):
name = container.img['title']
itemInfo = container.find('div',class_='item-info')
itemBranding = itemInfo.find('div',class_ = 'item-branding')
brandName = itemBranding... | [
"pandas.DataFrame",
"bs4.BeautifulSoup",
"urllib.request.urlopen",
"re.search"
] | [((1238, 1378), 'pandas.DataFrame', 'pd.DataFrame', (['{columns[0]: name, columns[1]: brand, columns[2]: userRating, columns[3]:\n userCount, columns[4]: price, columns[5]: offer}'], {}), '({columns[0]: name, columns[1]: brand, columns[2]: userRating,\n columns[3]: userCount, columns[4]: price, columns[5]: offer}... |
import statistics
import hpbandster.core.result as hpres
# smallest value is best -> reverse_loss = True
# largest value is best -> reverse_loss = False
REVERSE_LOSS = True
EXP_LOSS = 1
OUTLIER_PERC_WORST = 0.1
OUTLIER_PERC_BEST = 0.0
def analyze_bohb(log_dir):
# load the example run from the log files
res... | [
"statistics.mean",
"hpbandster.core.result.logged_results_to_HBS_result"
] | [((326, 369), 'hpbandster.core.result.logged_results_to_HBS_result', 'hpres.logged_results_to_HBS_result', (['log_dir'], {}), '(log_dir)\n', (360, 369), True, 'import hpbandster.core.result as hpres\n'), ((524, 618), 'hpbandster.core.result.logged_results_to_HBS_result', 'hpres.logged_results_to_HBS_result', (['"""../r... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
2D linear elasticity example
Solve the equilibrium equation -\nabla \cdot \sigma(x) = f(x) for x\in\Omega
with the strain-displacement equation:
\epsilon = 1/2(\nabla u + \nabla u^T)
and the constitutive law:
\sigma = 2*\mu*\epsilon + \lambda*(\nabla\cdot u)I,... | [
"numpy.sqrt",
"utils.Geom_examples.QuarterAnnulus",
"numpy.array",
"tensorflow.keras.layers.Dense",
"numpy.arctan2",
"utils.tfp_loss.tfp_function_factory",
"tensorflow.dynamic_stitch",
"numpy.random.seed",
"matplotlib.pyplot.scatter",
"numpy.concatenate",
"tensorflow.convert_to_tensor",
"numpy... | [((1429, 1447), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (1443, 1447), True, 'import numpy as np\n'), ((1448, 1470), 'tensorflow.random.set_seed', 'tf.random.set_seed', (['(42)'], {}), '(42)\n', (1466, 1470), True, 'import tensorflow as tf\n'), ((2429, 2495), 'utils.Geom_examples.QuarterAnnulus'... |
from typing import Sequence, Any
import torch
def clamp_n(tensor: torch.Tensor, min_values: Sequence[Any], max_values: Sequence[Any]) -> torch.Tensor:
"""
Clamp a tensor with axis dependent values.
Args:
tensor: a N-d torch.Tensor
min_values: a 1D torch.Tensor. Min value is axis dependent... | [
"torch.min"
] | [((1181, 1210), 'torch.min', 'torch.min', (['tensor', 'max_values'], {}), '(tensor, max_values)\n', (1190, 1210), False, 'import torch\n')] |
from typing import Any, Dict
from meiga import Result, Error, Success
from petisco import AggregateRoot
from datetime import datetime
from taskmanager.src.modules.tasks.domain.description import Description
from taskmanager.src.modules.tasks.domain.events import TaskCreated
from taskmanager.src.modules.tasks.domain.t... | [
"meiga.Success",
"taskmanager.src.modules.tasks.domain.events.TaskCreated",
"datetime.datetime.utcnow"
] | [((984, 997), 'meiga.Success', 'Success', (['self'], {}), '(self)\n', (991, 997), False, 'from meiga import Result, Error, Success\n'), ((840, 857), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (855, 857), False, 'from datetime import datetime\n'), ((879, 899), 'taskmanager.src.modules.tasks.domain.... |
import stacks1
def is_match(ch1, ch2):
match_dict = {
")": "(",
"]": "[",
"}": "{"
}
return match_dict[ch1] == ch2
def is_balanced(s):
stack = stacks1.Stack()
for ch in s:
if ch == '(' or ch == '{' or ch == '[':
stack.push(ch)
if ch == ')' or... | [
"stacks1.Stack"
] | [((189, 204), 'stacks1.Stack', 'stacks1.Stack', ([], {}), '()\n', (202, 204), False, 'import stacks1\n')] |
# -*- coding: utf-8 -*-
"""
Created on Thu May 3 18:30:29 2018
@author: Koushik
"""
import pandas as pd
from IPython.display import display
import sys
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 29 19:04:35 2018
@author: Koushik
"""
#Python 2.x program for Speech Recognition
import re
#ent... | [
"pandas.DataFrame",
"re.split",
"pandas.read_csv"
] | [((1062, 1089), 'pandas.read_csv', 'pd.read_csv', (['"""products.csv"""'], {}), "('products.csv')\n", (1073, 1089), True, 'import pandas as pd\n'), ((1267, 1318), 're.split', 're.split', (['""" and |order |some | like | love |"""', 'text'], {}), "(' and |order |some | like | love |', text)\n", (1275, 1318), False, 'imp... |
# 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 required by app... | [
"paddle.fluid.unique_name.generate",
"paddle.fluid.framework.name_scope"
] | [((4899, 4937), 'paddle.fluid.framework.name_scope', 'framework.name_scope', (['"""fp16_allreduce"""'], {}), "('fp16_allreduce')\n", (4919, 4937), False, 'from paddle.fluid import core, framework, unique_name\n'), ((3124, 3170), 'paddle.fluid.unique_name.generate', 'unique_name.generate', (["(grad.name + '.cast_fp16')"... |
import re
import sys
import os
# Lists of same characters
alpha_equiv = ['Α','Ά','ά','ὰ','ά','ἀ','ἁ','ἂ','ἃ','ἄ','ἅ','ἆ','ἇ','Ἀ','Ἁ','Ἂ','Ἃ','Ἄ','Ἅ','Ἆ','Ἇ','ᾶ','Ᾰ','Ᾱ','Ὰ','Ά','ᾰ','ᾱ'] #Converts to α
alpha_subscripted = ['ᾀ','ᾁ','ᾂ','ᾃ','ᾄ','ᾅ','ᾆ','ᾇ','ᾈ','ᾉ','ᾊ','ᾋ','ᾌ','ᾍ','ᾎ','ᾏ','ᾲ','ᾴ','ᾷ','ᾼ','ᾳ'] #Converts to... | [
"re.sub",
"os.path.splitext",
"sys.exit"
] | [((1807, 1836), 're.sub', 're.sub', (['"""(\\\\[|\\\\])"""', '""""""', 'data'], {}), "('(\\\\[|\\\\])', '', data)\n", (1813, 1836), False, 'import re\n'), ((2786, 2830), 'sys.exit', 'sys.exit', (['"""Program needs a file to process."""'], {}), "('Program needs a file to process.')\n", (2794, 2830), False, 'import sys\n... |