code stringlengths 20 1.04M | apis list | extract_api stringlengths 75 9.94M |
|---|---|---|
from ..commandparser import Time
from utils import seconds_to_string
name = 'debugtime'
async def run(message, length: Time):
'Debugging command seconds_to_string test time'
await message.send(seconds_to_string(length))
| [
"utils.seconds_to_string"
] | [((198, 223), 'utils.seconds_to_string', 'seconds_to_string', (['length'], {}), '(length)\n', (215, 223), False, 'from utils import seconds_to_string\n')] |
__author__ = 'max'
import re
import numpy as np
def is_uni_punctuation(word):
match = re.match("^[^\w\s]+$]", word, flags=re.UNICODE)
return match is not None
def is_punctuation(word, pos, punct_set=None):
if punct_set is None:
return is_uni_punctuation(word)
else:
return pos in punc... | [
"re.match"
] | [((92, 141), 're.match', 're.match', (['"""^[^\\\\w\\\\s]+$]"""', 'word'], {'flags': 're.UNICODE'}), "('^[^\\\\w\\\\s]+$]', word, flags=re.UNICODE)\n", (100, 141), False, 'import re\n')] |
# coding: utf-8
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
from click.testing import CliRunner
import oraclebmc
import os
import pytest
import random
def pytest_addoption(parser):
parser.addoption("--fast", action="store_true", default=False, help="Skip slow tests, as marked w... | [
"os.remove",
"random.randint",
"oraclebmc.object_storage.ObjectStorageClient",
"os.path.dirname",
"pytest.fixture",
"os.environ.get",
"oraclebmc.config.from_file",
"click.testing.CliRunner",
"os.path.join"
] | [((351, 382), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (365, 382), False, 'import pytest\n'), ((1531, 1562), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (1545, 1562), False, 'import pytest\n'), ((1631, 1662), 'pytest.fi... |
#!/usr/bin/env python
import sys, os, shutil, subprocess, string, signal
import re
varList = [
("b0", "bool"),
("b8", "bool(8)"),
("b16", "bool(16)"),
("b32", "bool(32)"),
("b64", "bool(64)"),
("i8", "int(8)"),
("i16", "int(16)"),
("i32", "int(32)"),
("i64", "int(64)"),
("u8", "uint(8)"),
... | [
"sys.stdout.write"
] | [((1498, 1520), 'sys.stdout.write', 'sys.stdout.write', (['"""\n"""'], {}), "('\\n')\n", (1514, 1520), False, 'import sys, os, shutil, subprocess, string, signal\n')] |
import streamlit as st
from pybart import api as bart
from pattern.en import conjugate, PAST
@st.cache(allow_output_mutation=True)
def load(module):
print("importing spacy")
import spacy
print("loading module")
inner_nlp = spacy.load(module)
print("finished")
con = bart.Converter()
inner_n... | [
"streamlit.text_input",
"streamlit.cache",
"streamlit.write",
"spacy.load",
"streamlit.sidebar.selectbox",
"pattern.en.conjugate",
"pybart.api.Converter"
] | [((96, 132), 'streamlit.cache', 'st.cache', ([], {'allow_output_mutation': '(True)'}), '(allow_output_mutation=True)\n', (104, 132), True, 'import streamlit as st\n'), ((241, 259), 'spacy.load', 'spacy.load', (['module'], {}), '(module)\n', (251, 259), False, 'import spacy\n'), ((292, 308), 'pybart.api.Converter', 'bar... |
import random
import discord
import asyncpraw
from discord.ext import commands
import json
with open('reddit_details.json', 'r') as jsonFile:
data = json.load(jsonFile)
client_id = data.get('client_id')
client_secret = data.get('client_secret')
username = data.get('username')
password = data.get('password')
redd... | [
"json.load",
"discord.ext.commands.command",
"discord.Color.random",
"random.choice",
"asyncpraw.Reddit",
"discord.Colour.random"
] | [((325, 459), 'asyncpraw.Reddit', 'asyncpraw.Reddit', ([], {'client_id': 'client_id', 'client_secret': 'client_secret', 'username': 'username', 'password': 'password', 'user_agent': '"""pythonpraw"""'}), "(client_id=client_id, client_secret=client_secret, username\n =username, password=password, user_agent='pythonpr... |
#!/usr/bin/env python3
# Copyright <NAME> 2022
import sys
import os
import json
from subprocess import Popen, PIPE
ADD_PHOTO_TO_ALBUM_SCRIPT = """
on unixDate(datetime)
set command to "date -j -f '%A, %B %e, %Y at %I:%M:%S %p' '" & datetime & "'"
set command to command & " +%s"
se... | [
"subprocess.Popen",
"json.load",
"os.path.getsize",
"os.walk",
"json.dumps",
"os.path.isfile",
"os.path.join"
] | [((3041, 3065), 'os.path.isfile', 'os.path.isfile', (['LOG_FILE'], {}), '(LOG_FILE)\n', (3055, 3065), False, 'import os\n'), ((2943, 2981), 'json.dumps', 'json.dumps', (['processed_albums'], {'indent': '(2)'}), '(processed_albums, indent=2)\n', (2953, 2981), False, 'import json\n'), ((3409, 3427), 'os.walk', 'os.walk',... |
"""A module to query the here web api."""
from __future__ import annotations
import asyncio
import socket
from typing import Any, Mapping, Optional
import aiohttp
import async_timeout
from yarl import URL
from aiohere.enum import WeatherProductType
from .exceptions import (
HereError,
HereInvalidRequestErro... | [
"aiohttp.ClientSession",
"yarl.URL.build",
"async_timeout.timeout"
] | [((481, 535), 'yarl.URL.build', 'URL.build', ([], {'scheme': 'SCHEME', 'host': 'API_HOST', 'path': 'API_PATH'}), '(scheme=SCHEME, host=API_HOST, path=API_PATH)\n', (490, 535), False, 'from yarl import URL\n'), ((2603, 2626), 'aiohttp.ClientSession', 'aiohttp.ClientSession', ([], {}), '()\n', (2624, 2626), False, 'impor... |
import torch
from math import exp
from time import time
class RNN(torch.nn.Module):
def __init__(
self,
num_embeddings: int,
embedding_dim: int,
hidden_dim: int,
n_layers: int,
dropout: float
):
super(RNN, self).__init__()
... | [
"math.exp",
"torch.utils.data.DataLoader",
"torch.nn.LogSoftmax",
"torch.nn.Embedding",
"time.time",
"torch.nn.NLLLoss",
"torch.nn.Linear",
"torch.device",
"torch.zeros",
"torch.nn.LSTM",
"torch.tensor"
] | [((1417, 1435), 'torch.nn.NLLLoss', 'torch.nn.NLLLoss', ([], {}), '()\n', (1433, 1435), False, 'import torch\n'), ((4218, 4288), 'torch.utils.data.DataLoader', 'torch.utils.data.DataLoader', (['ds'], {'batch_size': 'batch_size', 'drop_last': '(True)'}), '(ds, batch_size=batch_size, drop_last=True)\n', (4245, 4288), Fal... |
#Import Libraries
import uproot
import numpy as np
import matplotlib.pyplot as plt
import sys
sys.path.append('../')
#print(sys.path)
import nc_kinematics as nck
import lindhard as lin
import R68_yield as R68y
#############
#Definitions#
#############
#Define the main function we'll be re-using
def f(model,k=0.178,q=... | [
"sys.path.append",
"lindhard.getLindhardSi_k",
"numpy.ndenumerate",
"R68_yield.ySor",
"uproot.open",
"numpy.sqrt"
] | [((94, 116), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (109, 116), False, 'import sys\n'), ((3092, 3114), 'numpy.ndenumerate', 'np.ndenumerate', (['a_list'], {}), '(a_list)\n', (3106, 3114), True, 'import numpy as np\n'), ((371, 393), 'lindhard.getLindhardSi_k', 'lin.getLindhardSi_k', (['k... |
import time
# FASTELEVATOR
# @program 13
# date 06-01-2019
continue_ON = True
current_level = 0
def operate(current_level, level_number):
print('Welcome to FASTELEVATOR! Current floor: ' + str(current_level))
if(current_level == level_number):
print ('You are already in that floor')
elif(current_... | [
"time.sleep"
] | [((492, 507), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (502, 507), False, 'import time\n'), ((745, 760), 'time.sleep', 'time.sleep', (['(0.1)'], {}), '(0.1)\n', (755, 760), False, 'import time\n')] |
from setuptools import setup
setup(
name='midilights',
version='0.2.0',
author='<NAME>',
author_email='<EMAIL>',
packages=['midilights'],
url='https://github.com/bookdude13/midilights',
license='LICENSE',
description='Interface between a midi keyboard and some dmx-controlled lights',
... | [
"setuptools.setup"
] | [((30, 356), 'setuptools.setup', 'setup', ([], {'name': '"""midilights"""', 'version': '"""0.2.0"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'packages': "['midilights']", 'url': '"""https://github.com/bookdude13/midilights"""', 'license': '"""LICENSE"""', 'description': '"""Interface between a midi ... |
"""
pygame-menu
https://github.com/ppizarror/pygame-menu
TEST EXAMPLES
Test example files.
"""
__all__ = ['ExamplesTest']
from test._utils import BaseRSTest, MenuUtils, PygameEventUtils, \
test_reset_surface
import pygame
import pygame_menu
import pygame_menu.examples.game_selector as game_selector
import pyga... | [
"pygame_menu.examples.game_selector.play_function",
"pygame_menu.examples.other.widget_positioning.menu.render",
"pygame_menu.examples.window_resize.on_resize",
"pygame_menu.examples.scroll_menu.main",
"pygame_menu.examples.game_selector.main",
"pygame_menu.examples.other.dynamic_button_append.main",
"p... | [((1230, 1250), 'test._utils.test_reset_surface', 'test_reset_surface', ([], {}), '()\n', (1248, 1250), False, 'from test._utils import BaseRSTest, MenuUtils, PygameEventUtils, test_reset_surface\n'), ((1404, 1433), 'pygame_menu.examples.game_selector.main', 'game_selector.main', ([], {'test': '(True)'}), '(test=True)\... |
from napari_plugin_engine import napari_hook_implementation
from typing import List, Tuple, Dict, Any
from imlib.IO.cells import save_cells
from imlib.cells.cells import Cell
from .utils import convert_layer_to_cells
@napari_hook_implementation(specname="napari_write_points")
def cellfinder_write_xml(path, data, me... | [
"imlib.IO.cells.save_cells",
"napari_plugin_engine.napari_hook_implementation"
] | [((222, 280), 'napari_plugin_engine.napari_hook_implementation', 'napari_hook_implementation', ([], {'specname': '"""napari_write_points"""'}), "(specname='napari_write_points')\n", (248, 280), False, 'from napari_plugin_engine import napari_hook_implementation\n'), ((815, 846), 'imlib.IO.cells.save_cells', 'save_cells... |
import sqlite3
connection = sqlite3.connect("classRoomDB.db")
cursor = connection.cursor()
# createTable = """
# CREATE TABLE classroom (
# student_id INTEGER PRIMARY_KEY,
# name VARCHAR,
# gender CHAR(1),
# physicsMarks INTEGER,
# mathsMarks INTEGER,
# chemistryMarks INTEGER
# )
# """
#
# cursor.execute(createTable... | [
"sqlite3.connect"
] | [((29, 62), 'sqlite3.connect', 'sqlite3.connect', (['"""classRoomDB.db"""'], {}), "('classRoomDB.db')\n", (44, 62), False, 'import sqlite3\n')] |
# Copyright 2021 <NAME>. 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 law or agreed to... | [
"tensorflow.keras.layers.GlobalMaxPooling2D",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.Reshape",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.layers.ReLU",
"tensorflow.initializers.Ones",
"tensorflow.math.softmax",
"tensorflow.keras.layers.GlobalAveragePooling2D"
] | [((973, 1004), 'tensorflow.keras.layers.GlobalAveragePooling2D', 'layers.GlobalAveragePooling2D', ([], {}), '()\n', (1002, 1004), False, 'from tensorflow.keras import layers\n'), ((1544, 1583), 'tensorflow.keras.layers.Reshape', 'layers.Reshape', (['(1, 1, self.in_channel)'], {}), '((1, 1, self.in_channel))\n', (1558, ... |
import unittest
from eosfactory.eosf import *
verbosity([Verbosity.INFO, Verbosity.OUT, Verbosity.TRACE, Verbosity.DEBUG])
class Test(unittest.TestCase):
def run(self, result=None):
super().run(result)
@classmethod
def setUpClass(cls):
SCENARIO('''
Create a contract from templat... | [
"unittest.main"
] | [((2760, 2775), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2773, 2775), False, 'import unittest\n')] |
""""Unit tests for directed_graph.py."""
import unittest
from src.utils.directed_graph import DirectedGraph
class TestDirectedGraph(unittest.TestCase):
def setUp(self):
self.graph = DirectedGraph()
def test_init(self):
self.assertEqual(self.graph.get_node_ids(), [])
def test_add_node_... | [
"unittest.main",
"src.utils.directed_graph.DirectedGraph"
] | [((1170, 1185), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1183, 1185), False, 'import unittest\n'), ((199, 214), 'src.utils.directed_graph.DirectedGraph', 'DirectedGraph', ([], {}), '()\n', (212, 214), False, 'from src.utils.directed_graph import DirectedGraph\n')] |
import strax
import numpy as np
from strax.processing.hitlets import highest_density_region_width
def test_highest_density_region():
"""
Unity test for highest density regions.
"""
# Some distribution:
distribution = np.array([0, 0, 3, 4, 2, 0, 1])
# Truth dict always stores fraction desired, ... | [
"numpy.isnan",
"numpy.array",
"numpy.ones",
"numpy.all"
] | [((239, 270), 'numpy.array', 'np.array', (['[0, 0, 3, 4, 2, 0, 1]'], {}), '([0, 0, 3, 4, 2, 0, 1])\n', (247, 270), True, 'import numpy as np\n'), ((1350, 1363), 'numpy.ones', 'np.ones', (['(1000)'], {}), '(1000)\n', (1357, 1363), True, 'import numpy as np\n'), ((1479, 1501), 'numpy.all', 'np.all', (['(indicies == -1)']... |
import enum
import fileinput
import os
from typing import Tuple, Optional
from flask_apscheduler import APScheduler
from flask_mail import Mail, Message
from flask.globals import session
import numpy as np
from pandas import DataFrame
import pandas as pd
import psycopg2
from flask import Flask, render_template, url_for... | [
"pandas.read_csv",
"time.strftime",
"flask_mail.Mail",
"numpy.isnan",
"pandas.DataFrame",
"os.path.abspath",
"os.path.exists",
"flask.render_template",
"datetime.datetime.now",
"datetime.datetime.today",
"os.path.basename",
"datetime.datetime.strptime",
"enum.auto",
"flask_apscheduler.APSc... | [((507, 520), 'flask_apscheduler.APScheduler', 'APScheduler', ([], {}), '()\n', (518, 520), False, 'from flask_apscheduler import APScheduler\n'), ((528, 570), 'flask.Flask', 'Flask', (['__name__'], {'static_url_path': '"""/static"""'}), "(__name__, static_url_path='/static')\n", (533, 570), False, 'from flask import F... |
# run_ideal_single.py: run scenarios where all assets except for one are deterministic. For testing purposes
# intended system: Tiger
# author: <NAME>
# email: <EMAIL>
# Created: June 16, 2021
import os
os.chdir("..")
import prescient_helpers.run_helpers as rh
import sys
path_template = "./scenario_ideal_"
solar_path... | [
"prescient_helpers.run_helpers.run_prescient",
"prescient_helpers.run_helpers.perturb_data",
"os.chdir",
"prescient_helpers.run_helpers.copy_directory"
] | [((204, 218), 'os.chdir', 'os.chdir', (['""".."""'], {}), "('..')\n", (212, 218), False, 'import os\n'), ((914, 928), 'os.chdir', 'os.chdir', (['""".."""'], {}), "('..')\n", (922, 928), False, 'import os\n'), ((929, 952), 'os.chdir', 'os.chdir', (['"""./downloads"""'], {}), "('./downloads')\n", (937, 952), False, 'impo... |
#
# Autogenerated by Thrift Compiler (0.14.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
from thrift.TRecursive impo... | [
"thrift.protocol.TProtocol.TProtocolException",
"thrift.TRecursive.fix_spec"
] | [((10528, 10549), 'thrift.TRecursive.fix_spec', 'fix_spec', (['all_structs'], {}), '(all_structs)\n', (10536, 10549), False, 'from thrift.TRecursive import fix_spec\n'), ((1993, 2054), 'thrift.protocol.TProtocol.TProtocolException', 'TProtocolException', ([], {'message': '"""Required field secure is unset!"""'}), "(mes... |
import json
from unittest.mock import patch
import httpretty
from rest_framework.reverse import reverse
from rest_framework.status import HTTP_200_OK, HTTP_400_BAD_REQUEST, HTTP_201_CREATED
from web.companies.models import DnbGetCompanyResponse
from web.companies.services import DnbServiceClient
from web.core.excepti... | [
"unittest.mock.patch.object",
"web.tests.factories.users.UserFactory",
"web.companies.services.DnbServiceClient",
"json.dumps",
"rest_framework.reverse.reverse",
"web.companies.models.DnbGetCompanyResponse.objects.filter",
"web.tests.factories.companies.CompanyFactory"
] | [((4159, 4252), 'unittest.mock.patch.object', 'patch.object', (['DnbServiceClient', '"""get_company"""'], {'return_value': "{'primary_name': 'Company 1'}"}), "(DnbServiceClient, 'get_company', return_value={'primary_name':\n 'Company 1'})\n", (4171, 4252), False, 'from unittest.mock import patch\n'), ((4250, 4473), ... |
from neuralqa.retriever import Retriever
from neuralqa.utils import parse_field_content
from elasticsearch import Elasticsearch, ConnectionError, NotFoundError
import logging
logger = logging.getLogger(__name__)
class ElasticSearchRetriever(Retriever):
def __init__(self, index_type="elasticsearch", host="localh... | [
"elasticsearch.Elasticsearch",
"neuralqa.retriever.Retriever.__init__",
"logging.getLogger",
"neuralqa.utils.parse_field_content"
] | [((186, 213), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (203, 213), False, 'import logging\n'), ((382, 418), 'neuralqa.retriever.Retriever.__init__', 'Retriever.__init__', (['self', 'index_type'], {}), '(self, index_type)\n', (400, 418), False, 'from neuralqa.retriever import Retriev... |
from os import listdir as _listdir
from os.path import dirname as _dirname
from copy import deepcopy
from importlib import import_module as _import_module
from openktn.utils.targets import names as _target_names
base_package = __name__.replace('.base','')
def _not_implemented_conversion(item):
raise NotImplemente... | [
"os.path.dirname",
"importlib.import_module"
] | [((842, 886), 'importlib.import_module', '_import_module', (["('.' + api_form)", 'base_package'], {}), "('.' + api_form, base_package)\n", (856, 886), True, 'from importlib import import_module as _import_module\n'), ((440, 458), 'os.path.dirname', '_dirname', (['__file__'], {}), '(__file__)\n', (448, 458), True, 'from... |
import datetime
import unittest
import os
import re
import shutil
import oeqa.utils.ftools as ftools
from oeqa.selftest.base import oeSelfTest
from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer
from oeqa.selftest.sstate import SStateBase
class SStateTests(SStateBase):
# Test sstate file... | [
"oeqa.utils.commands.bitbake",
"shutil.copytree",
"shutil.rmtree",
"oeqa.utils.commands.get_bb_var"
] | [((695, 711), 'oeqa.utils.commands.bitbake', 'bitbake', (['targets'], {}), '(targets)\n', (702, 711), False, 'from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer\n'), ((2205, 2241), 'oeqa.utils.commands.bitbake', 'bitbake', (["(['-ccleansstate'] + targets)"], {}), "(['-ccleansstate'] + targets)\... |
# -*- coding: utf-8 -*-
from towel_stuff import Towel
class Chocolate(object):
"""A piece of chocolate."""
def wrap_with_towel(self):
towel = Towel()
towel.wrap(self)
return towel
| [
"towel_stuff.Towel"
] | [((160, 167), 'towel_stuff.Towel', 'Towel', ([], {}), '()\n', (165, 167), False, 'from towel_stuff import Towel\n')] |
from keggAnalysis import ExtractKEGGDataControl, ExtractKEGGData
E = ExtractKEGGDataControl(final_model='LRCmodel.pkl')
E.multiConfusionMatrix(tagY='glycan', tagP='glycan',
target1='Label Name', target2='Pos')
| [
"keggAnalysis.ExtractKEGGDataControl"
] | [((71, 121), 'keggAnalysis.ExtractKEGGDataControl', 'ExtractKEGGDataControl', ([], {'final_model': '"""LRCmodel.pkl"""'}), "(final_model='LRCmodel.pkl')\n", (93, 121), False, 'from keggAnalysis import ExtractKEGGDataControl, ExtractKEGGData\n')] |
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
import time
import pandas as pd
import csv
#入力パート Input part
playlist_url = '' #input playllist URL
output_filename = 'test.csv' # input filename as .csv
#認証パート Authentication part
my_id ='0000000000000000000000' #client ID
my_secret = '00... | [
"pandas.DataFrame",
"csv.writer",
"time.sleep",
"spotipy.Spotify",
"spotipy.oauth2.SpotifyClientCredentials"
] | [((364, 430), 'spotipy.oauth2.SpotifyClientCredentials', 'SpotifyClientCredentials', ([], {'client_id': 'my_id', 'client_secret': 'my_secret'}), '(client_id=my_id, client_secret=my_secret)\n', (388, 430), False, 'from spotipy.oauth2 import SpotifyClientCredentials\n'), ((446, 493), 'spotipy.Spotify', 'spotipy.Spotify',... |
# $Id$
#
# Copyright (C) 2002-2008 <NAME> and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
"""unit testing code for th... | [
"unittest.main",
"io.BytesIO",
"traceback.print_exc",
"rdkit.Chem.Crippen.MolMR",
"rdkit.six.moves.cPickle.dump",
"rdkit.Chem.Crippen.MolLogP",
"numpy.argsort",
"rdkit.Chem.Crippen._Init",
"rdkit.Chem.Lipinski.NHOHCount",
"rdkit.six.moves.cPickle.load",
"rdkit.Chem.MolToSmiles",
"rdkit.Chem.Ad... | [((5777, 5792), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5790, 5792), False, 'import unittest, sys, os\n'), ((686, 751), 'os.path.join', 'os.path.join', (['RDConfig.RDCodeDir', '"""Chem/test_data"""', '"""Crippen.csv"""'], {}), "(RDConfig.RDCodeDir, 'Chem/test_data', 'Crippen.csv')\n", (698, 751), False, 'i... |
# -*- coding: utf-8 -*-
"""Tests for webhooks functions."""
import logging
import json
from types import SimpleNamespace as SimpleObject
from flask_login import login_user
from unittest.mock import MagicMock, patch
from orcid_hub import utils
from orcid_hub.models import Client, OrcidToken, Organisation, User, Token... | [
"unittest.mock.patch.object",
"orcid_hub.models.OrcidToken.select",
"unittest.mock.MagicMock",
"json.loads",
"orcid_hub.utils.disable_org_webhook",
"orcid_hub.models.OrcidToken.create",
"logging.StreamHandler",
"flask_login.login_user",
"orcid_hub.models.Client.get",
"unittest.mock.patch",
"orci... | [((331, 358), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (348, 358), False, 'import logging\n'), ((407, 430), 'logging.StreamHandler', 'logging.StreamHandler', ([], {}), '()\n', (428, 430), False, 'import logging\n'), ((1647, 1672), 'orcid_hub.models.User.get', 'User.get', ([], {'emai... |
#!/usr/bin/env python
import unittest, sys
from waelstow import discover_tests
def get_suite(labels=[]):
return discover_tests('tests', labels)
if __name__ == '__main__':
suite = get_suite(sys.argv[1:])
unittest.TextTestRunner(verbosity=1).run(suite)
| [
"waelstow.discover_tests",
"unittest.TextTestRunner"
] | [((117, 148), 'waelstow.discover_tests', 'discover_tests', (['"""tests"""', 'labels'], {}), "('tests', labels)\n", (131, 148), False, 'from waelstow import discover_tests\n'), ((218, 254), 'unittest.TextTestRunner', 'unittest.TextTestRunner', ([], {'verbosity': '(1)'}), '(verbosity=1)\n', (241, 254), False, 'import uni... |
#! python
import os, sys
print('my os.getcwd =>', os.getcwd()) # show my cwd execution dir
print('my sys.path =>', sys.path[:6]) # show first 6 import paths
input()
| [
"os.getcwd"
] | [((51, 62), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (60, 62), False, 'import os, sys\n')] |
import os
import torch
import ocnn
import unittest
import numpy as np
class OctreePropertyTest(unittest.TestCase):
def test_octree_property(self):
octree = ocnn.octree_batch(ocnn.octree_samples(['octree_1'] * 2)).cuda()
# test index
out = ocnn.octree_property(octree, 'index', 5)
out_gt = np.array(... | [
"unittest.main",
"numpy.zeros",
"numpy.expand_dims",
"numpy.ones",
"ocnn.octree_samples",
"numpy.array",
"ocnn.octree_property"
] | [((1068, 1083), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1081, 1083), False, 'import unittest\n'), ((257, 297), 'ocnn.octree_property', 'ocnn.octree_property', (['octree', '"""index"""', '(5)'], {}), "(octree, 'index', 5)\n", (277, 297), False, 'import ocnn\n'), ((311, 338), 'numpy.array', 'np.array', (['([... |
import torch
from torch import nn, optim
from torch.nn import functional as F
import numpy as np
from sklearn.isotonic import IsotonicRegression
import seaborn as sns
import networkx as nx
from matplotlib.pyplot import MultipleLocator
import matplotlib.pyplot as plt
import matplotlib as mpl
from utils import *
class _... | [
"matplotlib.pyplot.title",
"numpy.around",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.exp",
"matplotlib.pyplot.tick_params",
"torch.nn.MSELoss",
"torch.softmax",
"torch.zeros",
"matplotlib.pyplot.show",
"torch.where",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.legend",
"sklearn.i... | [((2143, 2171), 'torch.softmax', 'torch.softmax', (['logits'], {'dim': '(1)'}), '(logits, dim=1)\n', (2156, 2171), False, 'import torch\n'), ((2185, 2210), 'torch.nn.functional.one_hot', 'F.one_hot', (['labels', 'nclass'], {}), '(labels, nclass)\n', (2194, 2210), True, 'from torch.nn import functional as F\n'), ((2232,... |
#!/usr/bin/env python3
import numpy as np
import os
def add_parser(parser):
parser.add_argument("-i","--inclusionCounts",
action="store",
help="")
parser.add_argument("-c","--clusters",
action="store",
hel... | [
"argparse.ArgumentParser",
"numpy.std",
"time.time",
"numpy.mean",
"numpy.array",
"os.path.join",
"os.listdir"
] | [((4365, 4376), 'time.time', 'time.time', ([], {}), '()\n', (4374, 4376), False, 'import time\n'), ((5283, 5308), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (5306, 5308), False, 'import argparse\n'), ((1973, 2037), 'os.path.join', 'os.path.join', (['coverageDirectory', 'f"""{sample}_intron_... |
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.md')).read()
setup(
name='easy_excel',
version='0.0.7',
description='Python create excel',
long_description=README,
author='nick1994209',
author_emai... | [
"os.path.dirname",
"os.path.join",
"setuptools.setup"
] | [((160, 482), 'setuptools.setup', 'setup', ([], {'name': '"""easy_excel"""', 'version': '"""0.0.7"""', 'description': '"""Python create excel"""', 'long_description': 'README', 'author': '"""nick1994209"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https://github.com/Nick1994209/python_easy_excel/"""', 'license': '"... |
import os
import logging
import torch
import torch.optim as optim
from torch.optim.lr_scheduler import StepLR, MultiStepLR
import torch.backends.cudnn as cudnn
from networks.pspnet import Res_pspnet, BasicBlock, Bottleneck
from networks.sagan_models import Discriminator
from utils.criterion import CriterionDSN, Criter... | [
"utils.criterion.CriterionAdvForG",
"utils.criterion.CriterionDSN",
"torch.load",
"utils.criterion.CriterionIFV",
"networks.sagan_models.Discriminator",
"logging.info",
"os.path.isfile",
"utils.criterion.CriterionAdv",
"utils.criterion.CriterionKD",
"utils.criterion.CriterionAdditionalGP",
"torc... | [((431, 459), 'logging.info', 'logging.info', (['"""------------"""'], {}), "('------------')\n", (443, 459), False, 'import logging\n'), ((1568, 1596), 'logging.info', 'logging.info', (['"""------------"""'], {}), "('------------')\n", (1580, 1596), False, 'import logging\n'), ((1633, 1661), 'logging.info', 'logging.i... |
# -*- coding: utf-8 -*-
from PyQt4 import QtCore, QtGui
import numpy as np
import acq4.pyqtgraph as pg
from acq4.devices.Device import Device
from acq4.devices.OptomechDevice import OptomechDevice
from acq4.devices.Stage import Stage
from acq4.modules.Camera import CameraModuleInterface
from .cameraModTemplate import ... | [
"acq4.devices.OptomechDevice.OptomechDevice.setDeviceTransform",
"numpy.arctan2",
"PyQt4.QtGui.QWidget",
"acq4.pyqtgraph.GraphicsObject.__init__",
"acq4.pyqtgraph.mkBrush",
"PyQt4.QtCore.QRectF",
"acq4.pyqtgraph.SignalBlock",
"numpy.linalg.norm",
"acq4.pyqtgraph.ROI.__init__",
"acq4.devices.Device... | [((16307, 16328), 'PyQt4.QtCore.Signal', 'QtCore.Signal', (['object'], {}), '(object)\n', (16320, 16328), False, 'from PyQt4 import QtCore, QtGui\n'), ((1747, 1797), 'acq4.devices.Device.Device.__init__', 'Device.__init__', (['self', 'deviceManager', 'config', 'name'], {}), '(self, deviceManager, config, name)\n', (176... |
import collections
import json
import jsonpickle
import numpy as np
import tensorflow as tf
from tensorflow.python.framework import ops
from tensorflow.python.tpu import tpu_feed
from .. import tf_wrapper as tfw
from ..dataclass import ModelParameter
tf1 = tf.compat.v1
Dataset = tf1.data.Dataset
def place_dataload... | [
"numpy.empty",
"collections.defaultdict",
"tensorflow.python.framework.ops.device",
"tensorflow.data.Options",
"jsonpickle.dumps",
"tensorflow.io.gfile.exists",
"numpy.prod",
"tensorflow.io.gfile.GFile"
] | [((525, 554), 'collections.defaultdict', 'collections.defaultdict', (['list'], {}), '(list)\n', (548, 554), False, 'import collections\n'), ((1947, 1985), 'numpy.empty', 'np.empty', (['pnum_map_shape'], {'dtype': 'object'}), '(pnum_map_shape, dtype=object)\n', (1955, 1985), True, 'import numpy as np\n'), ((3951, 3979),... |
#---- prop.py
# Parse properties, or unit conversion utilities specified to QM9 dataset.
#----
#---- function parse_prop
# Parse standardized QM9 database molecule properties.
# The file with the input path should be provided by Faber et al. (2017)
# - Input:
# Prop_Path: string
# Sta... | [
"numpy.zeros"
] | [((829, 851), 'numpy.zeros', 'np.zeros', (['[133885, 13]'], {}), '([133885, 13])\n', (837, 851), True, 'import numpy as np\n'), ((868, 884), 'numpy.zeros', 'np.zeros', (['(133885)'], {}), '(133885)\n', (876, 884), True, 'import numpy as np\n')] |
from setuptools import find_packages, setup
version = __import__('mediafeed_module_podcast').__version__
with open('README.rst', 'rb') as f:
long_description = f.read().decode('utf-8')
setup(
name='mediafeed-module-podcast',
version=version,
packages=find_packages(),
install_requires=[
... | [
"setuptools.find_packages"
] | [((271, 286), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (284, 286), False, 'from setuptools import find_packages, setup\n')] |
from django.urls import path
from django.urls import include
from . import views
app_name = 'user'
urlpatterns = [
path('logout/', views.LogOut, name='logout'),
path('reset-password/', views.ResetPasswordEmailView.as_view(), name='reset-password-email'),
path('reset-password/<int:pk>/<str:token>/', vie... | [
"django.urls.path"
] | [((124, 168), 'django.urls.path', 'path', (['"""logout/"""', 'views.LogOut'], {'name': '"""logout"""'}), "('logout/', views.LogOut, name='logout')\n", (128, 168), False, 'from django.urls import path\n')] |
# Generated by Django 2.0.4 on 2018-06-16 14:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gallery', '0005_auto_20180615_0840'),
]
operations = [
migrations.AlterField(
model_name='album',
name='name',
... | [
"django.db.models.CharField"
] | [((333, 376), 'django.db.models.CharField', 'models.CharField', ([], {'blank': '(True)', 'max_length': '(50)'}), '(blank=True, max_length=50)\n', (349, 376), False, 'from django.db import migrations, models\n')] |
"""
Simple file to pretty-print attributes of a JSON file
"""
import json
import click
import pprint
@click.command(context_settings=dict(help_option_names=['-h', '--help']))
@click.option('--jsonfile', '-j', type=str, help='JSON file to parse', required=True)
@click.option('--jkey', '-k', type=str, help='JSON attribu... | [
"pprint.pprint",
"click.option",
"json.loads"
] | [((177, 265), 'click.option', 'click.option', (['"""--jsonfile"""', '"""-j"""'], {'type': 'str', 'help': '"""JSON file to parse"""', 'required': '(True)'}), "('--jsonfile', '-j', type=str, help='JSON file to parse',\n required=True)\n", (189, 265), False, 'import click\n'), ((263, 394), 'click.option', 'click.option... |
from typing import List
from flask import current_app, g, abort
from libs.database import db_session
from .models import Account
from apps.models import Business
class AccountView:
def __init__(self):
pass
def get_accounts(self):
'''Get all accounts owned by user'''
b... | [
"libs.database.db_session.commit",
"libs.database.db_session.add",
"libs.database.db_session.delete",
"flask.abort",
"libs.database.db_session.query"
] | [((1256, 1279), 'libs.database.db_session.add', 'db_session.add', (['account'], {}), '(account)\n', (1270, 1279), False, 'from libs.database import db_session\n'), ((1289, 1308), 'libs.database.db_session.commit', 'db_session.commit', ([], {}), '()\n', (1306, 1308), False, 'from libs.database import db_session\n'), ((1... |
import os
from datetime import datetime
def create_experiment_folders(dataset_folder, model_name, post_fix=''):
experiment_dir = 'experiments'
# create folder for experiments with current dataset
dataset_path = create_folder(os.path.join(experiment_dir, dataset_folder))
# create current experiment fol... | [
"datetime.datetime.now",
"os.mkdir",
"os.path.join",
"os.path.exists"
] | [((239, 283), 'os.path.join', 'os.path.join', (['experiment_dir', 'dataset_folder'], {}), '(experiment_dir, dataset_folder)\n', (251, 283), False, 'import os\n'), ((615, 665), 'os.path.join', 'os.path.join', (['dataset_path', 'experiment_folder_name'], {}), '(dataset_path, experiment_folder_name)\n', (627, 665), False,... |
from sqlalchemy import Column, Integer, String, func, Boolean
from app import db
class CnesEstablishment(db.Model):
__tablename__ = 'cnes_establishment'
year = Column(Integer, primary_key=True)
region = Column(String(1), primary_key=True)
mesoregion = Column(String(4), primary_key=True)
microregio... | [
"sqlalchemy.String",
"sqlalchemy.func.count",
"sqlalchemy.Column"
] | [((170, 203), 'sqlalchemy.Column', 'Column', (['Integer'], {'primary_key': '(True)'}), '(Integer, primary_key=True)\n', (176, 203), False, 'from sqlalchemy import Column, Integer, String, func, Boolean\n'), ((1564, 1579), 'sqlalchemy.Column', 'Column', (['Boolean'], {}), '(Boolean)\n', (1570, 1579), False, 'from sqlalc... |
# -*- coding: utf-8 -*-
# Copyright (c) 2014, 2015, wetapy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
wetapy backend for the IPython notebook (WebGL approach).
"""
from __future__ import division
from ..base import (BaseApplicationBackend, BaseCanvasBackend,
... | [
"tornado.ioloop.IOLoop.current",
"tornado.ioloop.PeriodicCallback",
"IPython.html.nbextensions.install_nbextension",
"os.path.dirname",
"IPython.display.display",
"wetapy.app.backends.ipython.wetapyWidget",
"os.path.join"
] | [((1737, 1757), 'os.path.dirname', 'op.dirname', (['__file__'], {}), '(__file__)\n', (1747, 1757), True, 'import os.path as op\n'), ((1770, 1810), 'os.path.join', 'op.join', (['pkgdir', '"""../../html/static/js/"""'], {}), "(pkgdir, '../../html/static/js/')\n", (1777, 1810), True, 'import os.path as op\n'), ((2010, 211... |
# Copyright 2018 Red Hat, Inc.
# 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... | [
"mock.patch.object",
"oslo_utils.importutils.try_import",
"mock.call",
"ironic.common.exception.MACAlreadyExists",
"mock.patch",
"ironic.drivers.modules.inspect_utils.create_ports_if_not_exist",
"mock.MagicMock",
"ironic.tests.unit.objects.utils.create_test_node",
"ironic.conductor.task_manager.acqu... | [((956, 987), 'oslo_utils.importutils.try_import', 'importutils.try_import', (['"""sushy"""'], {}), "('sushy')\n", (978, 987), False, 'from oslo_utils import importutils\n'), ((991, 1033), 'mock.patch', 'mock.patch', (['"""time.sleep"""', '(lambda sec: None)'], {}), "('time.sleep', lambda sec: None)\n", (1001, 1033), F... |
# Set the context so that parent/sibling packages can be imported
import context
import argparse
from neopixel import Color
from led_strip import *
from config import *
MIN_LED_INDEX = 0
MAX_LED_INDEX = settings.LED_COUNT - 1
def clamp(n, smallest, largest):
return max(smallest, min(n, largest))
def try_par... | [
"neopixel.Color",
"argparse.ArgumentParser"
] | [((1756, 1779), 'neopixel.Color', 'Color', (['red', 'green', 'blue'], {}), '(red, green, blue)\n', (1761, 1779), False, 'from neopixel import Color\n'), ((1954, 2048), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""lights"""', 'description': '"""Controls the lights on an LED strip"""'}), "(prog... |
#!/usr/bin/python
"""script to generate stimuli
"""
import numpy as np
from matplotlib import pyplot as plt
import itertools
import pandas as pd
import seaborn as sns
from . import utils
import os
import argparse
import pickle
from . import first_level_analysis
def mkR(size, exponent=1, origin=None):
'''make dist... | [
"matplotlib.pyplot.title",
"numpy.arctan2",
"numpy.random.seed",
"argparse.ArgumentParser",
"seaborn.heatmap",
"numpy.ones",
"os.path.isfile",
"numpy.sin",
"numpy.arange",
"pickle.load",
"numpy.round",
"seaborn.FacetGrid",
"os.path.join",
"pandas.DataFrame",
"numpy.power",
"matplotlib.... | [((2089, 2104), 'numpy.array', 'np.array', (['xramp'], {}), '(xramp)\n', (2097, 2104), True, 'import numpy as np\n'), ((2117, 2132), 'numpy.array', 'np.array', (['yramp'], {}), '(yramp)\n', (2125, 2132), True, 'import numpy as np\n'), ((2144, 2168), 'numpy.arctan2', 'np.arctan2', (['yramp', 'xramp'], {}), '(yramp, xram... |
import logging
from helpers.save_lanes import save_lanes
class InvalidHoursFormat(Exception):
pass
class InvalidDay(Exception):
pass
class InvalidHours(Exception):
pass
class InvalidPhoneNumber(Exception):
pass
class Bowling():
def __init__(self, name, address, phone, hours={}):
'''init... | [
"datetime.datetime.strptime",
"datetime.datetime"
] | [((2298, 2331), 'datetime.datetime.strptime', 'datetime.strptime', (['start', '"""%H:%M"""'], {}), "(start, '%H:%M')\n", (2315, 2331), False, 'from datetime import datetime\n'), ((2351, 2383), 'datetime.datetime.strptime', 'datetime.strptime', (['stop', '"""%H:%M"""'], {}), "(stop, '%H:%M')\n", (2368, 2383), False, 'fr... |
# MyLibrary.py
import sys, time, random, math, pygame
from pygame.locals import *
# calculates distance between two points
def distance(point1, point2):
delta_x = point1.x - point2.x
delta_y = point1.y - point2.y
dist = math.sqrt(delta_x*delta_x + delta_y*delta_y)
return dist
# calcul... | [
"math.sqrt",
"math.atan2",
"math.radians",
"pygame.display.get_surface",
"pygame.sprite.Sprite.__init__",
"pygame.image.load",
"math.degrees"
] | [((245, 293), 'math.sqrt', 'math.sqrt', (['(delta_x * delta_x + delta_y * delta_y)'], {}), '(delta_x * delta_x + delta_y * delta_y)\n', (254, 293), False, 'import sys, time, random, math, pygame\n'), ((648, 676), 'math.atan2', 'math.atan2', (['delta_y', 'delta_x'], {}), '(delta_y, delta_x)\n', (658, 676), False, 'impor... |
#-*- coding: utf-8 -*-
# This program is based on Python 3.
# The following libraries are required.
# [numpy] pip install numpy (pip3 install numpy)
# [matplotlib] pip install matplotlib (pip3 install matplotlib)
# [pygame] pip install pygame (pip3 install pygame) (option)
import test
import speech
import numpy as np... | [
"pygame.mixer.init",
"pygame.mixer.music.play",
"speech.recognition",
"speech.SpeechRecognition",
"pygame.mixer.music.load",
"test.Test"
] | [((345, 371), 'speech.SpeechRecognition', 'speech.SpeechRecognition', ([], {}), '()\n', (369, 371), False, 'import speech\n'), ((379, 390), 'test.Test', 'test.Test', ([], {}), '()\n', (388, 390), False, 'import test\n'), ((613, 632), 'pygame.mixer.init', 'pygame.mixer.init', ([], {}), '()\n', (630, 632), False, 'import... |
#!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015, 2016, 2017 <NAME>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... | [
"backtrader.utils.py3.queue.Queue",
"threading.Thread",
"json.loads",
"oandapy.OandaError",
"datetime.datetime",
"backtrader.utils.py3.with_metaclass",
"collections.defaultdict",
"time.sleep",
"datetime.datetime.utcnow",
"threading.Event",
"datetime.timedelta",
"collections.OrderedDict",
"co... | [((5697, 5734), 'backtrader.utils.py3.with_metaclass', 'with_metaclass', (['MetaSingleton', 'object'], {}), '(MetaSingleton, object)\n', (5711, 5734), False, 'from backtrader.utils.py3 import queue, with_metaclass\n'), ((6398, 6418), 'datetime.datetime', 'datetime', (['(1970)', '(1)', '(1)'], {}), '(1970, 1, 1)\n', (64... |
import os
import numpy as np
from keras import activations
from keras.models import Sequential, Model
#from keras.layers import Merge, Input
from keras.layers import Input, ConvLSTM2D
from keras.layers.core import Dense, Dropout, Activation, Flatten, Lambda, Reshape, Permute
from keras.layers.convolutional im... | [
"keras.layers.core.Lambda",
"keras.layers.core.Dense",
"models.customCallbacks.MyModelCheckpoint",
"keras.layers.core.Activation",
"keras.optimizers.Adam",
"models.customCallbacks.MyEarlyStopping",
"keras.models.Model",
"sklearn.metrics.roc_auc_score",
"numpy.mean",
"numpy.array",
"keras.layers.... | [((1297, 1327), 'keras.layers.Input', 'Input', ([], {'shape': 'X_train_shape[1:]'}), '(shape=X_train_shape[1:])\n', (1302, 1327), False, 'from keras.layers import Input, ConvLSTM2D\n'), ((2580, 2612), 'keras.models.Model', 'Model', ([], {'input': 'inputs', 'output': 'last'}), '(input=inputs, output=last)\n', (2585, 261... |
##### INITIALIZATION
# Import Modules
import pygame
from os import path
# Constants
WINDOW_WIDTH = 1280
WINDOW_HEIGHT = 960
GAME_WIDTH = 720
GAME_HEIGHT = 960
BLACK = (0, 0, 0)
RED = (255, 0, 0)
LIME = (0, 255, 0)
BLUE = (0, 0, 255)
WHITE = (255, 255, 255)
# Directories
img_dir = path.join(path.dirname(__file__), ... | [
"pygame.quit",
"pygame.event.get",
"pygame.display.set_mode",
"os.path.dirname",
"pygame.init",
"pygame.display.flip",
"pygame.sprite.Group",
"pygame.transform.scale",
"pygame.sprite.Sprite.__init__",
"os.path.join"
] | [((348, 361), 'pygame.init', 'pygame.init', ([], {}), '()\n', (359, 361), False, 'import pygame\n'), ((397, 451), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(WINDOW_WIDTH, WINDOW_HEIGHT)'], {}), '((WINDOW_WIDTH, WINDOW_HEIGHT))\n', (420, 451), False, 'import pygame\n'), ((708, 773), 'pygame.transform.scal... |
import numpy as np
from bs4 import BeautifulSoup
from bechdelai.data.scrap import get_data_from_url
from bechdelai.data.scrap import RequestException
MAIN_URL = "https://www.imdb.com"
URL_SEARCH = f"{MAIN_URL}/find?s=tt&q={{q}}"
def preprocess_search_result_list(suggestions):
"""Preprocess list of results from ... | [
"numpy.isin",
"bechdelai.data.scrap.RequestException",
"bechdelai.data.scrap.get_data_from_url",
"numpy.where",
"bs4.BeautifulSoup"
] | [((795, 817), 'bechdelai.data.scrap.get_data_from_url', 'get_data_from_url', (['url'], {}), '(url)\n', (812, 817), False, 'from bechdelai.data.scrap import get_data_from_url\n'), ((983, 1021), 'bs4.BeautifulSoup', 'BeautifulSoup', (['ans.text', '"""html.parser"""'], {}), "(ans.text, 'html.parser')\n", (996, 1021), Fals... |
#!/usr/bin/env python3
# Copyright 2014-2018 PUNCH Cyber Analytics Group
#
# 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
#
# Un... | [
"stoq.data_classes.StoqResponse",
"stoq.data_classes.PayloadResults.from_payload",
"stoq.data_classes.ArchiverResponse",
"stoq.helpers.merge_dicts",
"collections.defaultdict",
"os.path.join",
"stoq.data_classes.Payload",
"os.path.exists",
"configparser.ConfigParser",
"stoq.helpers.get_sha256",
"... | [((18049, 18062), 'stoq.utils.ratelimited', 'ratelimited', ([], {}), '()\n', (18060, 18062), False, 'from stoq.utils import ratelimited\n'), ((14033, 14059), 'os.path.realpath', 'os.path.realpath', (['base_dir'], {}), '(base_dir)\n', (14049, 14059), False, 'import os\n'), ((14167, 14213), 'configparser.ConfigParser', '... |
# SPDX-FileCopyrightText: 2019 <NAME> for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_featherwing.alphanum_featherwing`
====================================================
Helper for using the `14-Segment AlphaNumeric FeatherWing <https://www.adafruit.com/product/3139>`_.
* Author(s): <NAME>
... | [
"board.I2C",
"adafruit_ht16k33.segments.Seg14x4"
] | [((914, 944), 'adafruit_ht16k33.segments.Seg14x4', 'segments.Seg14x4', (['i2c', 'address'], {}), '(i2c, address)\n', (930, 944), True, 'import adafruit_ht16k33.segments as segments\n'), ((877, 888), 'board.I2C', 'board.I2C', ([], {}), '()\n', (886, 888), False, 'import board\n')] |
import re
from .constraints.constraint import Constraint
from .constraints.empty_constraint import EmptyConstraint
from .constraints.multi_constraint import MultiConstraint
from .constraints.wildcard_constraint import WilcardConstraint
from .helpers import normalize_version, _expand_stability
class VersionParser:
... | [
"re.split",
"re.match"
] | [((3099, 3147), 're.match', 're.match', (['"""(?i)^v?[xX*](\\\\.[xX*])*$"""', 'constraint'], {}), "('(?i)^v?[xX*](\\\\.[xX*])*$', constraint)\n", (3107, 3147), False, 'import re\n'), ((6420, 6507), 're.match', 're.match', (['"""^(!=|==)?v?(\\\\d+)(?:\\\\.(\\\\d+))?(?:\\\\.(\\\\d+))?(?:\\\\.[xX*])+$"""', 'constraint'], ... |
import torch
import argparse
import model
import data
import csv
import os
from metrics import Metrics
description = """
Custom driver for evaluating various neural
architectures for generative language models.
"""
parser = argparse.ArgumentParser(description=description)
parser.add_argument('--data', type=str, defaul... | [
"metrics.Metrics",
"os.makedirs",
"argparse.ArgumentParser",
"data.Corpus",
"os.path.exists",
"torch.device"
] | [((225, 273), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'description'}), '(description=description)\n', (248, 273), False, 'import argparse\n'), ((1699, 1725), 'data.Corpus', 'data.Corpus', (['path', 'verbose'], {}), '(path, verbose)\n', (1710, 1725), False, 'import data\n'), ((1762, 18... |
import netCDF4 as nc
import numpy as np
from smrf.distribute import image_data
from smrf.envphys import precip, Snow, storms
from smrf.utils import utils
class ppt(image_data.image_data):
"""
The :mod:`~smrf.distribute.precip.ppt` class allows for variable specific
distributions that go beyond the base ... | [
"netCDF4.Dataset",
"smrf.distribute.image_data.image_data.__init__",
"smrf.envphys.precip.adjust_for_undercatch",
"smrf.utils.utils.set_min_max",
"smrf.envphys.storms.clip_and_correct",
"numpy.zeros",
"numpy.any",
"smrf.envphys.precip.dist_precip_wind",
"smrf.utils.utils.water_day",
"smrf.envphys.... | [((4204, 4255), 'smrf.distribute.image_data.image_data.__init__', 'image_data.image_data.__init__', (['self', 'self.variable'], {}), '(self, self.variable)\n', (4234, 4255), False, 'from smrf.distribute import image_data\n'), ((4642, 4670), 'numpy.zeros', 'np.zeros', (['(topo.ny, topo.nx)'], {}), '((topo.ny, topo.nx))\... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import gzip
import os
import tarfile
import shutil
import urllib.request
from typing impo... | [
"tqdm.tqdm",
"os.path.join",
"os.unlink",
"os.path.basename",
"os.makedirs",
"os.path.dirname",
"os.path.exists",
"os.path.isfile",
"os.path.splitext",
"gzip.GzipFile",
"tarfile.open",
"shutil.copyfileobj",
"os.path.expanduser"
] | [((495, 522), 'os.path.splitext', 'os.path.splitext', (['gzip_path'], {}), '(gzip_path)\n', (511, 522), False, 'import os\n'), ((601, 622), 'os.path.exists', 'os.path.exists', (['fpath'], {}), '(fpath)\n', (615, 622), False, 'import os\n'), ((1073, 1095), 'os.path.dirname', 'os.path.dirname', (['fpath'], {}), '(fpath)\... |
from datetime import datetime
from enum import IntEnum
from typing import List, Union
from pydantic import BaseModel, Field
from .common import BaseClient, SideEnum, camelcase
from .constant import Url
__all__ = ["OrderTypeEnum", "CancelOrderRequest"]
class OrderTypeEnum(IntEnum):
MARKET = 1
LIMIT = 2
... | [
"pydantic.Field"
] | [((393, 415), 'pydantic.Field', 'Field', ([], {'alias': '"""orderID"""'}), "(alias='orderID')\n", (398, 415), False, 'from pydantic import BaseModel, Field\n'), ((694, 721), 'pydantic.Field', 'Field', ([], {'alias': '"""instrumentID"""'}), "(alias='instrumentID')\n", (699, 721), False, 'from pydantic import BaseModel, ... |
import numpy as np
import operator as op
from abc import ABCMeta
from core import Node, Setter, getval, zeros_like
class NumericNode(Node):
__array_priority__ = 100.0 # Ensure precedence of Node's __rmul__ over numpy's __mul__
__metaclass__ = ABCMeta
def __add__(self, other): return op.add(self, other)
... | [
"core.getval",
"numpy.ravel",
"operator.add",
"operator.pow",
"numpy.zeros",
"numpy.transpose",
"core.zeros_like",
"numpy.reshape",
"operator.div",
"numpy.squeeze",
"operator.mul",
"operator.sub",
"operator.neg"
] | [((299, 318), 'operator.add', 'op.add', (['self', 'other'], {}), '(self, other)\n', (305, 318), True, 'import operator as op\n'), ((358, 377), 'operator.add', 'op.add', (['self', 'other'], {}), '(self, other)\n', (364, 377), True, 'import operator as op\n'), ((417, 436), 'operator.sub', 'op.sub', (['self', 'other'], {}... |
import keras
import numpy as np
from keras import optimizers
from keras.datasets import cifar10
from keras.models import Sequential
from keras.layers import Conv2D, Dense, Flatten, MaxPooling2D
from keras.callbacks import LearningRateScheduler, TensorBoard
from keras.preprocessing.image import ImageDataGenerator... | [
"keras.preprocessing.image.ImageDataGenerator",
"keras.datasets.cifar10.load_data",
"keras.optimizers.SGD",
"keras.layers.Flatten",
"keras.callbacks.TensorBoard",
"keras.layers.Conv2D",
"keras.layers.Dense",
"keras.callbacks.LearningRateScheduler",
"keras.models.Sequential",
"keras.layers.MaxPooli... | [((500, 512), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (510, 512), False, 'from keras.models import Sequential\n'), ((1131, 1182), 'keras.optimizers.SGD', 'optimizers.SGD', ([], {'lr': '(0.1)', 'momentum': '(0.9)', 'nesterov': '(True)'}), '(lr=0.1, momentum=0.9, nesterov=True)\n', (1145, 1182), False,... |
# -*- coding: utf-8 -*-
"""
cupoftee.utils
~~~~~~~~~~~~~~
Various utilities.
:copyright: (c) 2009 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
_sort_re = re.compile(r'\w+', re.UNICODE)
def unicodecmp(a, b):
x, y = map(_sort_... | [
"re.compile"
] | [((244, 274), 're.compile', 're.compile', (['"""\\\\w+"""', 're.UNICODE'], {}), "('\\\\w+', re.UNICODE)\n", (254, 274), False, 'import re\n')] |
"""ROI and ROIList classes for storing and manipulating
regions of interests (ROIs).
ROI.ROI objects allow for storing of ROIs as either as a boolean mask of
included pixels, or as multiple polygons. Masks need not be continuous and
an ROI can be defined by multiple non-adjacent polygons.
In addition, each ROI can be a... | [
"pickle.dump",
"scipy.sparse.issparse",
"scipy.sparse.lil_matrix",
"pickle.load",
"numpy.arange",
"skimage.measure.find_contours",
"builtins.range",
"shapely.geometry.Point",
"shapely.geometry.Polygon",
"datetime.datetime.now",
"numpy.ceil",
"shapely.geometry.MultiPolygon",
"itertools.count"... | [((17083, 17112), 'numpy.zeros', 'np.zeros', (['im_size'], {'dtype': 'bool'}), '(im_size, dtype=bool)\n', (17091, 17112), True, 'import numpy as np\n'), ((18128, 18152), 'numpy.arange', 'np.arange', (['mask.shape[0]'], {}), '(mask.shape[0])\n', (18137, 18152), True, 'import numpy as np\n'), ((21644, 21668), 'shapely.ge... |
import os
from setuptools import setup, find_packages
def read(fname):
"""
Utility function to read the README file.
Used for the long_description. It's nice, because now 1) we have a top
level README file and 2) it's easier to type in the README file than to put
a raw string in below ...
"""... | [
"os.path.dirname"
] | [((348, 373), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (363, 373), False, 'import os\n')] |
import numpy as np
import pandas as pd
import sys
import os
import random
import time
from keras.models import Sequential
from keras.layers import Dense, InputLayer
import matplotlib.pylab as plt
import RoyStates
MainDirectory = os.getcwd()
os.chdir('DataFiles')
df = pd.read_excel('AXPData.xlsx')
os.chdir(MainDirec... | [
"pandas.DataFrame",
"RoyStates.History",
"os.getcwd",
"time.time",
"pandas.read_excel",
"matplotlib.pylab.plot",
"numpy.random.random",
"keras.layers.Dense",
"keras.layers.InputLayer",
"matplotlib.pylab.xlabel",
"numpy.array",
"numpy.random.randint",
"keras.models.Sequential",
"matplotlib.... | [((233, 244), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (242, 244), False, 'import os\n'), ((245, 266), 'os.chdir', 'os.chdir', (['"""DataFiles"""'], {}), "('DataFiles')\n", (253, 266), False, 'import os\n'), ((272, 301), 'pandas.read_excel', 'pd.read_excel', (['"""AXPData.xlsx"""'], {}), "('AXPData.xlsx')\n", (285, ... |
import os
import pytest
import time
from fastapi.testclient import TestClient
from sqlmodel import Session, create_engine
from main import app
from database import get_db
from settings import Settings
from alembic.command import upgrade, downgrade
from alembic.config import Config
@pytest.fixture(autouse=True)
def sl... | [
"alembic.config.Config",
"alembic.command.upgrade",
"os.remove",
"sqlmodel.create_engine",
"os.path.join",
"sqlmodel.Session",
"main.app.dependency_overrides.clear",
"pytest.fixture",
"os.path.exists",
"time.sleep",
"fastapi.testclient.TestClient",
"alembic.command.downgrade",
"settings.Sett... | [((285, 313), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)'}), '(autouse=True)\n', (299, 313), False, 'import pytest\n'), ((368, 399), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (382, 399), False, 'import pytest\n'), ((530, 560), 'pytest.fixture', 'pytes... |
import sys
from importlib import reload
import maya.cmds as cmds
import mtoa.utils as utils
import webbrowser
path = r"C:\Users\Kayla\Desktop\VStitcher2MayaTool" #YOUR PYTHON FILE PATH
sys.path.append(path)
IMG_PATH = path + "/img/"
def UI():
window = cmds.window(title= "VStitcherToMaya Tool", widthH... | [
"sys.path.append",
"maya.cmds.button",
"maya.cmds.rowColumnLayout",
"maya.cmds.text",
"maya.cmds.separator",
"maya.cmds.window",
"maya.cmds.textField",
"maya.cmds.floatField",
"maya.cmds.columnLayout",
"maya.cmds.showWindow"
] | [((193, 214), 'sys.path.append', 'sys.path.append', (['path'], {}), '(path)\n', (208, 214), False, 'import sys\n'), ((271, 336), 'maya.cmds.window', 'cmds.window', ([], {'title': '"""VStitcherToMaya Tool"""', 'widthHeight': '(600, 600)'}), "(title='VStitcherToMaya Tool', widthHeight=(600, 600))\n", (282, 336), True, 'i... |
# Copyright (c) 2018 Fujitsu Limited.
# 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 requ... | [
"mock.patch.object",
"neutron_fwaas.services.logapi.agents.drivers.iptables.log.IptablesLoggingDriver",
"neutron.agent.l3.l3_agent_extension_api.L3AgentExtensionAPI",
"oslo_log.log.getLogger",
"oslo_config.cfg.StrOpt",
"mock.patch",
"time.sleep",
"neutron.agent.linux.utils.execute",
"neutron_lib.con... | [((1143, 1170), 'oslo_log.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1160, 1170), True, 'from oslo_log import log as logging\n'), ((1578, 1640), 'oslo_config.cfg.StrOpt', 'cfg.StrOpt', (['"""extensions"""'], {'default': "['fwaas_v2', 'fwaas_v2_log']"}), "('extensions', default=['fwaas_v2'... |
import argparse
from com.designingnn.core import AppContext
from com.designingnn.service.DesignNeuralNetwork import DesignNeuralNetwork
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-dataset', help='Which data set')
args = parser.parse_args()
print("""
Starting the applic... | [
"com.designingnn.service.DesignNeuralNetwork.DesignNeuralNetwork",
"argparse.ArgumentParser"
] | [((164, 189), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (187, 189), False, 'import argparse\n'), ((453, 474), 'com.designingnn.service.DesignNeuralNetwork.DesignNeuralNetwork', 'DesignNeuralNetwork', ([], {}), '()\n', (472, 474), False, 'from com.designingnn.service.DesignNeuralNetwork imp... |
#!/bin/python
import RPi.GPIO as GPIO
import os
shutdown_pin=21
shutdown_led=20
#Replace YOUR_CHOSEN_GPIO_NUMBER_HERE with the GPIO pin number you wish to use
#Make sure you know which rapsberry pi revision you are using first
#The line should look something like this e.g. "gpio_pin_number=7"
GPIO.setmode(GPIO.BCM)
#... | [
"RPi.GPIO.setmode",
"RPi.GPIO.cleanup",
"RPi.GPIO.setup",
"os.system",
"RPi.GPIO.wait_for_edge",
"RPi.GPIO.output"
] | [((296, 318), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BCM'], {}), '(GPIO.BCM)\n', (308, 318), True, 'import RPi.GPIO as GPIO\n'), ((471, 530), 'RPi.GPIO.setup', 'GPIO.setup', (['shutdown_pin', 'GPIO.IN'], {'pull_up_down': 'GPIO.PUD_UP'}), '(shutdown_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)\n', (481, 530), True, 'imp... |
"""Plot GGN eigenvalue spectra."""
import os
import matplotlib.pyplot as plt
import numpy
from run_evals import (
architecture_cases,
batch_size_key,
device,
get_output_file,
num_params_key,
param_groups_cases,
)
from shared import eigenvalue_cutoff
from exp.utils.path import copy_to_fig, rea... | [
"matplotlib.pyplot.title",
"numpy.clip",
"matplotlib.pyplot.figure",
"os.path.join",
"os.path.abspath",
"matplotlib.pyplot.close",
"os.path.dirname",
"exp.utils.plot.TikzExport",
"numpy.max",
"numpy.linspace",
"numpy.log10",
"numpy.ones_like",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.y... | [((378, 403), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (393, 403), False, 'import os\n'), ((414, 435), 'os.path.dirname', 'os.path.dirname', (['HERE'], {}), '(HERE)\n', (429, 435), False, 'import os\n'), ((446, 483), 'os.path.join', 'os.path.join', (['HEREDIR', '"""fig"""', '"""evals"""... |
import cv2
import dropbox
import time
import random
start_time = time.time()
def take_snapshot():
number = random.randint(0,100)
#initializing cv2
videoCaptureObject = cv2.VideoCapture(0)
result = True
while(result):
#read the frames while the camera is on
ret,frame = videoCaptureO... | [
"random.randint",
"dropbox.Dropbox",
"cv2.imwrite",
"time.time",
"cv2.VideoCapture",
"cv2.destroyAllWindows"
] | [((66, 77), 'time.time', 'time.time', ([], {}), '()\n', (75, 77), False, 'import time\n'), ((113, 135), 'random.randint', 'random.randint', (['(0)', '(100)'], {}), '(0, 100)\n', (127, 135), False, 'import random\n'), ((182, 201), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (198, 201), False, 'import... |
import argparse
from datetime import date
import os.path
from shutil import copyfile
import sys
from pythiam.lib.iam_manager import IAMManager
from pythiam.lib.user_record import UserRecordManager, UserRecord
def parse_args(args):
parser = argparse.ArgumentParser(prog='pythiam', description='AWS IAM Helper', ad... | [
"pythiam.lib.user_record.UserRecordManager",
"datetime.date.today",
"argparse.ArgumentParser",
"pythiam.lib.iam_manager.IAMManager"
] | [((248, 336), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""pythiam"""', 'description': '"""AWS IAM Helper"""', 'add_help': '(True)'}), "(prog='pythiam', description='AWS IAM Helper',\n add_help=True)\n", (271, 336), False, 'import argparse\n'), ((1812, 1824), 'pythiam.lib.iam_manager.IAMMa... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from flask import request, jsonify
from flask import current_app as app
from flask_httpauth import HTTPBasicAuth
from werkzeug.security import generate_password_hash, check_password_hash
from functools import wraps
from app.utils import read_config
import jwt
... | [
"flask.request.args.get",
"app.utils.read_config",
"flask.jsonify",
"functools.wraps",
"flask_httpauth.HTTPBasicAuth",
"jwt.decode"
] | [((345, 360), 'flask_httpauth.HTTPBasicAuth', 'HTTPBasicAuth', ([], {}), '()\n', (358, 360), False, 'from flask_httpauth import HTTPBasicAuth\n'), ((1078, 1086), 'functools.wraps', 'wraps', (['f'], {}), '(f)\n', (1083, 1086), False, 'from functools import wraps\n'), ((1534, 1542), 'functools.wraps', 'wraps', (['f'], {}... |
from django.conf.urls import url
from . import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns=[
url(r'^$',views.instagram,name='post'),
url(r'^no_profile/$',views.welcome,name = 'welcome'),
url(r'^image/(\d+)',views.image,name ='image'),
url(r'^new/image$'... | [
"django.conf.urls.static.static",
"django.conf.urls.url"
] | [((148, 187), 'django.conf.urls.url', 'url', (['"""^$"""', 'views.instagram'], {'name': '"""post"""'}), "('^$', views.instagram, name='post')\n", (151, 187), False, 'from django.conf.urls import url\n'), ((192, 243), 'django.conf.urls.url', 'url', (['"""^no_profile/$"""', 'views.welcome'], {'name': '"""welcome"""'}), "... |
from dataclasses import dataclass, field
@dataclass()
class TrainingParams:
model_type: str = field(default="RandomForestRegressor")
random_state: int = field(default=255)
| [
"dataclasses.field",
"dataclasses.dataclass"
] | [((44, 55), 'dataclasses.dataclass', 'dataclass', ([], {}), '()\n', (53, 55), False, 'from dataclasses import dataclass, field\n'), ((100, 138), 'dataclasses.field', 'field', ([], {'default': '"""RandomForestRegressor"""'}), "(default='RandomForestRegressor')\n", (105, 138), False, 'from dataclasses import dataclass, f... |
def dragon(s):
return s + '0' + ''.join('0' if c == '1' else '1' for c in reversed(s))
def checksum(s):
while len(s) % 2 == 0:
s = ''.join('1' if a==b else '0' for a, b in zip(s[:-1:2], s[1::2]))
return s
def fill(start, n):
while len(start) < n:
start = dragon(start)
return star... | [
"aocd.models.Puzzle"
] | [((718, 734), 'aocd.models.Puzzle', 'Puzzle', (['(2016)', '(16)'], {}), '(2016, 16)\n', (724, 734), False, 'from aocd.models import Puzzle\n')] |
import click
M = N = 10
def print_grid(grid):
lines = []
for i in range(M):
lines.append(" ".join(str(x).rjust(2, " ") for x in grid[i]))
grid = "\n".join(lines)
click.secho(grid, fg="yellow")
# click.confirm("?")
def neighbours(i, j):
if i > 0:
if j > 0:
yield ... | [
"click.secho",
"click.echo",
"click.File",
"click.command"
] | [((1413, 1428), 'click.command', 'click.command', ([], {}), '()\n', (1426, 1428), False, 'import click\n'), ((190, 220), 'click.secho', 'click.secho', (['grid'], {'fg': '"""yellow"""'}), "(grid, fg='yellow')\n", (201, 220), False, 'import click\n'), ((1946, 1980), 'click.echo', 'click.echo', (['f"""Step {i}: {flashes}"... |
import json
import unittest
from pprint import pprint
from gnes.proto import gnes_pb2
from gnes.score_fn.base import get_unary_score, CombinedScoreFn, ModifierScoreFn
from gnes.score_fn.chunk import WeightedChunkScoreFn, WeightedChunkOffsetScoreFn, CoordChunkScoreFn, TFIDFChunkScoreFn, BM25ChunkScoreFn
from gnes.score... | [
"gnes.proto.gnes_pb2.Chunk",
"gnes.proto.gnes_pb2.Message",
"gnes.score_fn.normalize.Normalizer4",
"gnes.proto.gnes_pb2.Document",
"gnes.indexer.chunk.helper.ListKeyIndexer",
"gnes.score_fn.doc.CoordDocScoreFn",
"gnes.score_fn.base.CombinedScoreFn",
"gnes.score_fn.normalize.Normalizer1",
"json.loads... | [((709, 729), 'gnes.score_fn.base.get_unary_score', 'get_unary_score', (['(0.5)'], {}), '(0.5)\n', (724, 729), False, 'from gnes.score_fn.base import get_unary_score, CombinedScoreFn, ModifierScoreFn\n'), ((742, 762), 'gnes.score_fn.base.get_unary_score', 'get_unary_score', (['(0.7)'], {}), '(0.7)\n', (757, 762), False... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-06-30 05:03
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('iiits', '0047_researchstudent_photo'),
]
operations = [
migrations.AlterField(... | [
"django.db.models.ImageField"
] | [((407, 511), 'django.db.models.ImageField', 'models.ImageField', ([], {'blank': '(True)', 'null': '(True)', 'upload_to': "b'iiits/static/iiits/files/research/portfolio/'"}), "(blank=True, null=True, upload_to=\n b'iiits/static/iiits/files/research/portfolio/')\n", (424, 511), False, 'from django.db import migration... |
# -*- coding: utf-8 -*-
from eve.auth import BasicAuth
from eve.utils import config
from flask import request, Response, g
from flask import abort
from functools import wraps
from .verify_token import verify_token
AUTHEN_CLAIMS = 'authen_claims'
AUTHEN_ROLES = 'authen_roles'
AUTH_VALUE = 'auth_value'
class JWTAuth... | [
"flask.g.get",
"flask.request.args.get",
"flask.request.headers.get",
"flask.abort",
"functools.wraps",
"eve.utils.config.DOMAIN.get",
"flask.Response"
] | [((5472, 5496), 'flask.g.get', 'g.get', (['AUTHEN_CLAIMS', '{}'], {}), '(AUTHEN_CLAIMS, {})\n', (5477, 5496), False, 'from flask import request, Response, g\n'), ((5802, 5825), 'flask.g.get', 'g.get', (['AUTHEN_ROLES', '[]'], {}), '(AUTHEN_ROLES, [])\n', (5807, 5825), False, 'from flask import request, Response, g\n'),... |
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import math
from argparse import Namespace
from dataclasses import dataclass, f... | [
"omegaconf.II",
"torch.nn.functional.ctc_loss",
"fairseq.utils.item",
"torch.nn.functional.kl_div",
"torch.backends.cudnn.flags",
"dataclasses.field",
"math.log",
"fairseq.criterions.register_criterion",
"fairseq.metrics.log_scalar"
] | [((2496, 2555), 'fairseq.criterions.register_criterion', 'register_criterion', (['"""ctc_nat"""'], {'dataclass': 'CtcCriterionConfig'}), "('ctc_nat', dataclass=CtcCriterionConfig)\n", (2514, 2555), False, 'from fairseq.criterions import FairseqCriterion, register_criterion\n'), ((867, 1041), 'dataclasses.field', 'field... |
# core
import io
import os
import re
import gc
import time
import pytz
import glob
import zipfile
import datetime
# installed
import quandl
import pandas as pd
import requests as req
from requests.adapters import HTTPAdapter
from pytz import timezone
from concurrent.futures import ProcessPoolExecutor
import pandas_mar... | [
"os.mkdir",
"os.remove",
"pandas.read_csv",
"pandas_market_calendars.get_calendar",
"glob.glob",
"pandas.read_hdf",
"requests.adapters.HTTPAdapter",
"requests.Session",
"os.path.exists",
"datetime.timedelta",
"requests.get",
"pandas.Timedelta",
"file_utils.get_home_dir",
"datetime.datetime... | [((501, 527), 'pytz.timezone', 'timezone', (['"""America/Denver"""'], {}), "('America/Denver')\n", (509, 527), False, 'from pytz import timezone\n'), ((536, 562), 'datetime.datetime.now', 'datetime.datetime.now', (['MTN'], {}), '(MTN)\n', (557, 562), False, 'import datetime\n'), ((619, 633), 'file_utils.get_home_dir', ... |
from absl.testing import absltest
from fax import test_util
from fax.implicit import twophase
from jax.config import config
config.update("jax_enable_x64", True)
class TwoPhaseOpsTest(test_util.FixedPointTestCase):
def make_solver(self, param_func):
return twophase.two_phase_solver(
param_f... | [
"jax.config.config.update",
"absl.testing.absltest.main",
"fax.implicit.twophase.two_phase_solver"
] | [((126, 163), 'jax.config.config.update', 'config.update', (['"""jax_enable_x64"""', '(True)'], {}), "('jax_enable_x64', True)\n", (139, 163), False, 'from jax.config import config\n'), ((479, 494), 'absl.testing.absltest.main', 'absltest.main', ([], {}), '()\n', (492, 494), False, 'from absl.testing import absltest\n'... |
import numpy as np
import os
# new change
from sys import platform
# new change
from datasets import Dataset, load_dataset
from itertools import groupby
from overrides import overrides
from sklearn.metrics import classification_report
from tqdm import tqdm
from transformers import AutoTokenizer
from typing import Dict... | [
"datasets.load_dataset",
"thermostat.data.additional_configs.get_label_names",
"thermostat.data.tokenization.fuse_subwords",
"thermostat.visualize.normalize_attributions",
"numpy.asarray",
"os.path.realpath",
"sklearn.metrics.classification_report",
"transformers.AutoTokenizer.from_pretrained",
"the... | [((16558, 16645), 'datasets.load_dataset', 'load_dataset', ([], {'path': 'dataset_script_path', 'name': 'config_str', 'split': '"""test"""'}), "(path=dataset_script_path, name=config_str, split='test', **\n ld_kwargs)\n", (16570, 16645), False, 'from datasets import Dataset, load_dataset\n'), ((5741, 5793), 'thermos... |
#! ../env/bin/python
# -*- coding: utf-8 -*-
import pytest
create_user = True
@pytest.mark.usefixtures("testapp")
class TestURLs:
def test_login(self, testapp):
""" Tests if the login page loads """
rv = testapp.get('/login')
assert rv.status_code == 200
def test_logout(self, testa... | [
"pytest.mark.usefixtures"
] | [((83, 117), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""testapp"""'], {}), "('testapp')\n", (106, 117), False, 'import pytest\n')] |
# Copyright Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompan... | [
"sagemaker.lineage.query.LineageQuery",
"smexperiments.experiment.Experiment.create",
"sagemaker.lineage.association.Association.create",
"sagemaker.workflow.pipeline._PipelineExecution",
"sagemaker.lineage.context.EndpointContext.create",
"sagemaker.lineage.action.ModelPackageApprovalAction.load",
"sag... | [((14645, 14675), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (14659, 14675), False, 'import pytest\n'), ((2025, 2055), 'time.sleep', 'time.sleep', (['SLEEP_TIME_SECONDS'], {}), '(SLEEP_TIME_SECONDS)\n', (2035, 2055), False, 'import time\n'), ((2394, 2424), 'time.sleep', '... |
#:copyright: Copyright 2009-2010 by the Vesper team, see AUTHORS.
#:license: Dual licenced under the GPL or Apache2 licences, see LICENSE.
"""
General purpose utilities
"""
import os.path
import os, sys, threading, copy
import Queue
from stat import *
from time import *
from types import *
from binascii import unhe... | [
"threading.Thread",
"pprint.pformat",
"hashlib.sha1",
"os.stat",
"sha.update",
"Queue.Queue",
"copy.copy",
"threading.local",
"difflib.SequenceMatcher",
"os.path.normpath",
"sys.exc_info",
"sha.digest",
"os.listdir"
] | [((5354, 5389), 'difflib.SequenceMatcher', 'difflib.SequenceMatcher', (['None', 'a', 'b'], {}), '(None, a, b)\n', (5377, 5389), False, 'import difflib\n'), ((6017, 6056), 'difflib.SequenceMatcher', 'difflib.SequenceMatcher', (['None', 'new', 'old'], {}), '(None, new, old)\n', (6040, 6056), False, 'import difflib\n'), (... |
#main program
import value_return_functions
# #void_functions.first_program()
# value_return_functions.main()
#print(value_return_functions.get_random(1,100))
value_return_functions.display_random(1,100,7) | [
"value_return_functions.display_random"
] | [((162, 210), 'value_return_functions.display_random', 'value_return_functions.display_random', (['(1)', '(100)', '(7)'], {}), '(1, 100, 7)\n', (199, 210), False, 'import value_return_functions\n')] |
import tensorflow as tf
tf.set_random_seed(777)
# training set
X = [1, 2, 3]
Y = [1, 2, 3]
# 잘못된 weight 값을 initial value로 지정
W = tf.Variable(5.0)
# Linear regression model(y_hat) without intercept term
hypothesis = X * W
# cost/loss function(MSE)
cost = tf.reduce_mean(tf.square(hypothesis - Y))
# Minimize: Gradie... | [
"tensorflow.global_variables_initializer",
"tensorflow.Session",
"tensorflow.set_random_seed",
"tensorflow.Variable",
"tensorflow.square",
"tensorflow.train.GradientDescentOptimizer"
] | [((25, 48), 'tensorflow.set_random_seed', 'tf.set_random_seed', (['(777)'], {}), '(777)\n', (43, 48), True, 'import tensorflow as tf\n'), ((132, 148), 'tensorflow.Variable', 'tf.Variable', (['(5.0)'], {}), '(5.0)\n', (143, 148), True, 'import tensorflow as tf\n'), ((353, 405), 'tensorflow.train.GradientDescentOptimizer... |
#
# Copyright 2019 The FATE 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... | [
"pipeline.component.component_base.Component.__init__",
"pipeline.interface.Output",
"pipeline.interface.Input",
"pipeline.component.nn.models.sequantial.Sequential"
] | [((1717, 1764), 'pipeline.component.component_base.Component.__init__', 'Component.__init__', (['self'], {}), '(self, **explicit_parameters)\n', (1735, 1764), False, 'from pipeline.component.component_base import Component\n'), ((1991, 2026), 'pipeline.interface.Input', 'Input', (['self.name'], {'data_type': '"""multi"... |
import numpy as np
from glmpca.glmpca import glmpca
from .method_runner import MethodRunner
class GLMPCAMethodRunner(MethodRunner):
def __init__(self, data, verbose, n_latent=10, likelihood="poi"):
"""
Contains parameters for running GLMPCA normalization. n_latent is the number of latent dimensi... | [
"numpy.dot",
"glmpca.glmpca.glmpca"
] | [((711, 756), 'glmpca.glmpca.glmpca', 'glmpca', (['Y', 'self.n_latent'], {'fam': 'self.likelihood'}), '(Y, self.n_latent, fam=self.likelihood)\n', (717, 756), False, 'from glmpca.glmpca import glmpca\n'), ((801, 842), 'numpy.dot', 'np.dot', (["res['factors']", "res['loadings'].T"], {}), "(res['factors'], res['loadings'... |
#!/usr/bin/env python3
# coding: utf-8
import sys
import lib.core.inputHandler as inputHandler
if __name__ == '__main__':
if len(sys.argv) == 0:
getBanner.banner()
sys.exit(0)
inputHandler.handler()
| [
"lib.core.inputHandler.handler",
"sys.exit"
] | [((204, 226), 'lib.core.inputHandler.handler', 'inputHandler.handler', ([], {}), '()\n', (224, 226), True, 'import lib.core.inputHandler as inputHandler\n'), ((187, 198), 'sys.exit', 'sys.exit', (['(0)'], {}), '(0)\n', (195, 198), False, 'import sys\n')] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.