code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
from splinter import Browser
from bs4 import BeautifulSoup
from time import sleep
import pandas as pd
import numpy as np
from iteration_utilities import unique_everseen
def init_browser():
executable_path = {"executable_path": "/usr/local/bin/chromedriver"}
return Browser("chrome", **executable_path, he... | [
"bs4.BeautifulSoup",
"splinter.Browser",
"pandas.read_html"
] | [((281, 332), 'splinter.Browser', 'Browser', (['"""chrome"""'], {'headless': '(True)'}), "('chrome', **executable_path, headless=True)\n", (288, 332), False, 'from splinter import Browser\n'), ((483, 517), 'bs4.BeautifulSoup', 'BeautifulSoup', (['html', '"""html.parser"""'], {}), "(html, 'html.parser')\n", (496, 517), ... |
# Generated by Django 3.2 on 2021-05-09 07:52
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Source",
fields=[
... | [
"django.db.models.OneToOneField",
"django.db.models.TextField",
"django.db.models.DateTimeField",
"django.db.models.BigAutoField",
"django.db.models.URLField",
"django.db.models.CharField"
] | [((369, 465), 'django.db.models.BigAutoField', 'models.BigAutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (388, 465), False, 'from django.db import migrations, m... |
from django.conf.urls import url, include
from django.views.generic import TemplateView
from django_comments.feeds import LatestCommentFeed
from . import feeds
from . import views
urlpatterns = [
url(r'^comments/feed', LatestCommentFeed()),
url(r'^comments/', ... | [
"django.views.generic.TemplateView.as_view",
"django.conf.urls.include",
"django_comments.feeds.LatestCommentFeed"
] | [((250, 269), 'django_comments.feeds.LatestCommentFeed', 'LatestCommentFeed', ([], {}), '()\n', (267, 269), False, 'from django_comments.feeds import LatestCommentFeed\n'), ((324, 355), 'django.conf.urls.include', 'include', (['"""django_comments.urls"""'], {}), "('django_comments.urls')\n", (331, 355), False, 'from dj... |
# coding: utf-8
#########################################################################
# 网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> #
# author yeeku.H.lee <EMAIL> #
# #
# version 1.0 ... | [
"matplotlib.pyplot.gca",
"matplotlib.pyplot.figure",
"numpy.linspace",
"numpy.sin",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show"
] | [((1106, 1118), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (1116, 1118), True, 'import matplotlib.pyplot as plt\n'), ((1157, 1202), 'numpy.linspace', 'np.linspace', (['(-np.pi)', 'np.pi', '(64)'], {'endpoint': '(True)'}), '(-np.pi, np.pi, 64, endpoint=True)\n', (1168, 1202), True, 'import numpy as np\n... |
from flask import request, render_template
from flask.views import MethodView
from flask_cas import login_required
from catCas import validate_professor
from common_functions import display_access_control_error
import logging
import gbmodel
class ViewReview(MethodView):
"""
A method view class that oversees t... | [
"flask.render_template",
"common_functions.display_access_control_error",
"gbmodel.reports",
"gbmodel.students",
"gbmodel.teams",
"flask.request.form.getlist",
"catCas.validate_professor"
] | [((1878, 1942), 'flask.render_template', 'render_template', (['"""viewReview.html"""'], {'error': '"""Something went wrong"""'}), "('viewReview.html', error='Something went wrong')\n", (1893, 1942), False, 'from flask import request, render_template\n'), ((2585, 2602), 'gbmodel.reports', 'gbmodel.reports', ([], {}), '(... |
#!/usr/bin/python
# encoding: utf-8
import re
import nltk
import sys
import getopt
import math
import csv
import os
import time
import asyncio
from nltk.stem import PorterStemmer
from nltk.corpus import stopwords
from concurrent.futures import ThreadPoolExecutor
import multiprocessing
from multiprocessin... | [
"csv.field_size_limit",
"getopt.getopt",
"nltk.corpus.stopwords.words",
"nltk.stem.PorterStemmer",
"multiprocessing.cpu_count",
"math.log",
"nltk.sent_tokenize",
"multiprocessing.Pool",
"sys.exit",
"re.sub",
"time.time"
] | [((638, 653), 'nltk.stem.PorterStemmer', 'PorterStemmer', ([], {}), '()\n', (651, 653), False, 'from nltk.stem import PorterStemmer\n'), ((442, 483), 're.sub', 're.sub', (['"""[@#$“%”“’‘。&^\'`*/°]"""', '""""""', 'phrase'], {}), '("[@#$“%”“’‘。&^\'`*/°]", \'\', phrase)\n', (448, 483), False, 'import re\n'), ((571, 602), ... |
from .models import Game, Solution
from django.shortcuts import render
from django.http.response import HttpResponse, JsonResponse
from django.shortcuts import redirect
from django.contrib.auth.decorators import login_required
from ws4redis.publisher import RedisPublisher
from ws4redis.redis_store import RedisMessage... | [
"django.http.response.HttpResponse",
"ws4redis.redis_store.RedisMessage",
"ws4redis.publisher.RedisPublisher",
"django.shortcuts.redirect",
"django.http.response.JsonResponse"
] | [((975, 992), 'django.shortcuts.redirect', 'redirect', (['"""index"""'], {}), "('index')\n", (983, 992), False, 'from django.shortcuts import redirect\n'), ((1057, 1074), 'django.shortcuts.redirect', 'redirect', (['"""index"""'], {}), "('index')\n", (1065, 1074), False, 'from django.shortcuts import redirect\n'), ((118... |
import os
import pandas as pd
import mygene
from util_path import get_path
from util_dei import filter_dei
res_dir = get_path("resource/Entrez")
gene_dir = get_path("vertex/gene")
mg = mygene.MyGeneInfo()
def read_gene2ensembl():
global res_dir
g2e_df = pd.read_csv(os.path.join(res_dir, "gene2ensembl_9606.t... | [
"pandas.isnull",
"mygene.MyGeneInfo",
"os.path.join",
"util_path.get_path",
"util_dei.filter_dei",
"pandas.concat"
] | [((118, 145), 'util_path.get_path', 'get_path', (['"""resource/Entrez"""'], {}), "('resource/Entrez')\n", (126, 145), False, 'from util_path import get_path\n'), ((157, 180), 'util_path.get_path', 'get_path', (['"""vertex/gene"""'], {}), "('vertex/gene')\n", (165, 180), False, 'from util_path import get_path\n'), ((187... |
from xxmaker.game.g1800 import create_1800
create_1800(output_file='output/1800')
| [
"xxmaker.game.g1800.create_1800"
] | [((44, 82), 'xxmaker.game.g1800.create_1800', 'create_1800', ([], {'output_file': '"""output/1800"""'}), "(output_file='output/1800')\n", (55, 82), False, 'from xxmaker.game.g1800 import create_1800\n')] |
import time
import uuid
from . import base_case
class WhenSendingUnkwnonEvent(
base_case.ClusterTestCase
):
def given_an_event_name(self):
self.event_name = 'test-' + str(uuid.uuid4())
def becauseWeSendAnUnknownEventName(self):
self.cluster.consul.event.fire(
self.event_name... | [
"time.sleep",
"uuid.uuid4"
] | [((756, 769), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (766, 769), False, 'import time\n'), ((191, 203), 'uuid.uuid4', 'uuid.uuid4', ([], {}), '()\n', (201, 203), False, 'import uuid\n')] |
# pip install urllib3
import urllib3
import json
def get_key(filename):
mod = int(input("decryption code:"))
with open(filename, 'r') as f:
key_str = f.read()
r_key = ([chr(ord(i)-mod) for i in key_str])
r_key = "".join(r_key)
return r_key
def wiki_qa(question:str):
acces... | [
"json.loads",
"json.dumps",
"urllib3.PoolManager"
] | [((612, 633), 'urllib3.PoolManager', 'urllib3.PoolManager', ([], {}), '()\n', (631, 633), False, 'import urllib3\n'), ((816, 841), 'json.loads', 'json.loads', (['response.data'], {}), '(response.data)\n', (826, 841), False, 'import json\n'), ((968, 1003), 'json.dumps', 'json.dumps', (['response_json'], {'indent': '(2)'... |
# -*- coding: utf-8 -*-
"""
Created on Thu May 16 13:06:17 2019
@author: Ayush
"""
import random, math
random.seed(0)
def r_matrix(m, n, a = -0.5, b = 0.5):
return [[random.uniform(a,b) for j in range(n)] for i in range(m)]
def sigmoid(x):
return 1.0/ (1.0 + math.exp(-x))
def d_sigmoid(y)... | [
"random.uniform",
"random.seed",
"math.exp"
] | [((115, 129), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (126, 129), False, 'import random, math\n'), ((186, 206), 'random.uniform', 'random.uniform', (['a', 'b'], {}), '(a, b)\n', (200, 206), False, 'import random, math\n'), ((287, 299), 'math.exp', 'math.exp', (['(-x)'], {}), '(-x)\n', (295, 299), False, '... |
import statistics
from database.user import SessionUser
import matplotlib.pyplot as plt
def calculate_mutual_tracks(key="real", plot_data=True):
"""
Finds the number of tracks that are in both the selected data and the given dataset in each time range.
The average and standard deviation are printed and ... | [
"statistics.mean",
"statistics.stdev",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show"
] | [((1181, 1195), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (1193, 1195), True, 'import matplotlib.pyplot as plt\n'), ((2011, 2021), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (2019, 2021), True, 'import matplotlib.pyplot as plt\n'), ((1054, 1087), 'statistics.mean', 'statistics.mean', ... |
"""Testing transforms."""
import random
import unittest
import torch
from pytoda.transforms import (
AugmentByReversing,
Compose,
LeftPadding,
ListToTensor,
ToTensor,
)
class TestTransforms(unittest.TestCase):
"""Testing transforms."""
def test_left_padding(self) -> None:
"""Tes... | [
"pytoda.transforms.ListToTensor",
"pytoda.transforms.ToTensor",
"random.seed",
"pytoda.transforms.AugmentByReversing",
"torch.is_tensor",
"pytoda.transforms.LeftPadding",
"torch.cuda.is_available",
"unittest.main"
] | [((3123, 3138), 'unittest.main', 'unittest.main', ([], {}), '()\n', (3136, 3138), False, 'import unittest\n'), ((1378, 1401), 'pytoda.transforms.ToTensor', 'ToTensor', ([], {'device': 'device'}), '(device=device)\n', (1386, 1401), False, 'from pytoda.transforms import AugmentByReversing, Compose, LeftPadding, ListToTen... |
#!/usr/bin/python3
#
# Copyright 2017 <NAME>, Inc.
# All rights reserved
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted providing that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of c... | [
"traceback.print_exc",
"os._exit",
"argparse.ArgumentParser",
"librpc.Client"
] | [((3957, 3968), 'os._exit', 'os._exit', (['(1)'], {}), '(1)\n', (3965, 3968), False, 'import os\n'), ((3996, 4021), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (4019, 4021), False, 'import argparse\n'), ((4133, 4148), 'librpc.Client', 'librpc.Client', ([], {}), '()\n', (4146, 4148), False, '... |
# NOTE : The API / Client couple here is DUAL to rest (because most of it is callback, not callforward)
# => the API is what the user should use directly (and not the client like for REST)
import asyncio
import typing
from aiokraken.rest import AssetPairs
from aiokraken.websockets.channelstream import SubStream
f... | [
"aiokraken.rest.AssetPairs",
"aiokraken.rest.client.RestClient",
"aiokraken.utils.get_kraken_logger",
"aiokraken.websockets.channelsubscribe.public_subscribed",
"aiokraken.websockets.schemas.subscribe.Subscription",
"aiokraken.websockets.connections.WssConnection",
"asyncio.get_running_loop"
] | [((1091, 1118), 'aiokraken.utils.get_kraken_logger', 'get_kraken_logger', (['__name__'], {}), '(__name__)\n', (1108, 1118), False, 'from aiokraken.utils import get_kraken_logger\n'), ((1140, 1195), 'aiokraken.websockets.connections.WssConnection', 'WssConnection', ([], {'websocket_url': '"""wss://beta-ws.kraken.com"""'... |
from pecan import conf
import os
import hashlib
from random import randrange
import six
from six.moves.urllib.parse import urlparse, parse_qs
from unittest import TestCase
from deuce.tests import FunctionalTest
class TestBlocksController(FunctionalTest):
def setUp(self):
super(TestBlocksController, self)... | [
"os.urandom",
"hashlib.sha1",
"six.moves.urllib.parse.urlparse",
"random.randrange"
] | [((1076, 1090), 'hashlib.sha1', 'hashlib.sha1', ([], {}), '()\n', (1088, 1090), False, 'import hashlib\n'), ((1235, 1249), 'hashlib.sha1', 'hashlib.sha1', ([], {}), '()\n', (1247, 1249), False, 'import hashlib\n'), ((3667, 3682), 'os.urandom', 'os.urandom', (['(100)'], {}), '(100)\n', (3677, 3682), False, 'import os\n'... |
import os
import re
import shutil
import json
from pathlib import Path
from click.testing import CliRunner
import pytest
from .util import working_directory
from ..ocrd_cli import ocrd_dinglehopper
data_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data')
def test_ocrd_cli(tmp_path):
"""Test... | [
"os.path.abspath",
"click.testing.CliRunner",
"pathlib.Path"
] | [((242, 267), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (257, 267), False, 'import os\n'), ((449, 463), 'pathlib.Path', 'Path', (['data_dir'], {}), '(data_dir)\n', (453, 463), False, 'from pathlib import Path\n'), ((726, 737), 'click.testing.CliRunner', 'CliRunner', ([], {}), '()\n', (73... |
import sys
from helper import print_directories, print_help_message
from directory import check_directory, delete_directories
def main():
args = sys.argv
delete = False
path = ""
if len(args) < 2:
print_help_message()
return
if args[1] == "-d":
if len(args) != 3:
print_help_message()... | [
"helper.print_help_message",
"directory.delete_directories",
"helper.print_directories",
"directory.check_directory"
] | [((415, 436), 'directory.check_directory', 'check_directory', (['path'], {}), '(path)\n', (430, 436), False, 'from directory import check_directory, delete_directories\n'), ((214, 234), 'helper.print_help_message', 'print_help_message', ([], {}), '()\n', (232, 234), False, 'from helper import print_directories, print_h... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import json
import logging.handlers
import os
import ansible
import firebase_admin
import hashids
from ansible.cli import CLI
from ansible.inventory.host import Host
from ansible.inventory.manager import InventoryManager
from ansible.parsi... | [
"firebase_admin.db.reference",
"ansible.template.Templar",
"firebase_admin.initialize_app",
"importlib.metadata.version",
"flask.Flask",
"json.dumps",
"os.path.join",
"ansible.inventory.manager.InventoryManager",
"ansible.cli.CLI.version_info",
"firebase_admin.credentials.Certificate",
"hashids.... | [((738, 753), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (743, 753), False, 'from flask import Flask, abort, render_template, request, send_from_directory\n'), ((794, 844), 'hashids.Hashids', 'hashids.Hashids', (['config.FIREBASE_URL'], {'min_length': '(6)'}), '(config.FIREBASE_URL, min_length=6)\n', (... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the Google Chrome Preferences file event formatter."""
import unittest
from plaso.formatters import chrome_preferences
from tests.formatters import test_lib
class ChromePreferencesPrimaryURLFormatterHelperTest(
test_lib.EventFormatterTestCase):
"""T... | [
"unittest.main",
"plaso.formatters.chrome_preferences.ChromePreferencesPrimaryURLFormatterHelper",
"plaso.formatters.chrome_preferences.ChromePreferencesSecondaryURLFormatterHelper"
] | [((2363, 2378), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2376, 2378), False, 'import unittest\n'), ((509, 572), 'plaso.formatters.chrome_preferences.ChromePreferencesPrimaryURLFormatterHelper', 'chrome_preferences.ChromePreferencesPrimaryURLFormatterHelper', ([], {}), '()\n', (570, 572), False, 'from plaso.... |
# Copyright (c) 2019 <NAME> (<EMAIL>)
"""
@author: <NAME>
base class for CG models and solvers
"""
import abc
from typing import Iterable
import numpy as np
#from cgmodsel.models.model_base import get_modeltype
from cgmodsel.models.model_pwsl import ModelPWSL
from cgmodsel.models.model_pw import ModelPW
from cgmodsel... | [
"cgmodsel.models.model_pw.ModelPW",
"numpy.prod",
"numpy.sqrt",
"numpy.log",
"numpy.diag",
"numpy.sum",
"numpy.zeros",
"cgmodsel.utils.grp_soft_shrink",
"numpy.empty",
"numpy.isnan",
"cgmodsel.models.model_pwsl.ModelPWSL",
"cgmodsel.utils.l21norm",
"numpy.cumsum"
] | [((955, 970), 'numpy.empty', 'np.empty', (['n_cat'], {}), '(n_cat)\n', (963, 970), True, 'import numpy as np\n'), ((1328, 1348), 'numpy.zeros', 'np.zeros', (['(dim, dim)'], {}), '((dim, dim))\n', (1336, 1348), True, 'import numpy as np\n'), ((1296, 1312), 'numpy.sqrt', 'np.sqrt', (['sigma_r'], {}), '(sigma_r)\n', (1303... |
import numpy as np
from scipy.special import j0 as BesselJ0, j1 as BesselJ1, jn as BesselJ
from scipy.optimize import root
def shoot_S1(central_value: float,
w: float,
R: np.ndarray,
coeffs: np.ndarray,
S_harmonics: np.ndarray = None) -> np.ndarray:
"""
Shoo... | [
"numpy.abs",
"numpy.empty_like",
"numpy.arange"
] | [((779, 795), 'numpy.empty_like', 'np.empty_like', (['R'], {}), '(R)\n', (792, 795), True, 'import numpy as np\n'), ((3829, 3839), 'numpy.abs', 'np.abs', (['S1'], {}), '(S1)\n', (3835, 3839), True, 'import numpy as np\n'), ((1904, 1932), 'numpy.arange', 'np.arange', (['(0)', 'N_harmonics', '(1)'], {}), '(0, N_harmonics... |
from collections import OrderedDict
class IndexedDict(OrderedDict):
def __init__(self,*args):
OrderedDict.__init__(self,args)
def index(self,i):
keys=list(self.keys())
try:
return keys[i],self[keys[i]]
except IndexError:
raise IndexError("Out of bounds a... | [
"collections.OrderedDict.__init__"
] | [((107, 139), 'collections.OrderedDict.__init__', 'OrderedDict.__init__', (['self', 'args'], {}), '(self, args)\n', (127, 139), False, 'from collections import OrderedDict\n')] |
from typing import List
from io import BytesIO
import numpy as np
from PIL import Image
from fastapi import FastAPI, Request, File, UploadFile
from fastapi.responses import HTMLResponse, StreamingResponse
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
app = FastAPI()
app.m... | [
"PIL.Image.fromarray",
"fastapi.FastAPI",
"fastapi.responses.StreamingResponse",
"PIL.Image.open",
"io.BytesIO",
"fastapi.templating.Jinja2Templates",
"numpy.array",
"fastapi.staticfiles.StaticFiles",
"fastapi.File"
] | [((304, 313), 'fastapi.FastAPI', 'FastAPI', ([], {}), '()\n', (311, 313), False, 'from fastapi import FastAPI, Request, File, UploadFile\n'), ((396, 434), 'fastapi.templating.Jinja2Templates', 'Jinja2Templates', ([], {'directory': '"""templates"""'}), "(directory='templates')\n", (411, 434), False, 'from fastapi.templa... |
# -*- coding: utf-8 -*-
"""Utils for date operations."""
from datetime import datetime as dt, timedelta
from .dateutils import DateUtils
class DateOperations(object):
"""
This class is a collection of allowed operations on date parsing
"""
@staticmethod
def month():
"""
Return mil... | [
"datetime.timedelta",
"datetime.datetime.utcnow"
] | [((1316, 1327), 'datetime.datetime.utcnow', 'dt.utcnow', ([], {}), '()\n', (1325, 1327), True, 'from datetime import datetime as dt, timedelta\n'), ((1964, 1981), 'datetime.timedelta', 'timedelta', ([], {'days': '(1)'}), '(days=1)\n', (1973, 1981), False, 'from datetime import datetime as dt, timedelta\n'), ((1522, 153... |
from io import BytesIO
from os.path import getmtime
import tempfile
from time import gmtime
import os
import shutil
import unittest
from webob import static
from webob.compat import bytes_
from webob.request import Request, environ_from_url
from webob.response import Response
def get_response(app, path='/', **req_kw... | [
"webob.static.FileIter",
"webob.response.Response",
"webob.request.environ_from_url",
"webob.static.FileApp",
"os.path.join",
"io.BytesIO",
"shutil.rmtree",
"webob.compat.bytes_",
"webob.request.Request",
"tempfile.mkdtemp",
"os.unlink",
"webob.static.DirectoryApp",
"tempfile.NamedTemporaryF... | [((578, 598), 'os.path.join', 'os.path.join', (['*paths'], {}), '(*paths)\n', (590, 598), False, 'import os\n'), ((395, 417), 'webob.request.environ_from_url', 'environ_from_url', (['path'], {}), '(path)\n', (411, 417), False, 'from webob.request import Request, environ_from_url\n'), ((756, 811), 'tempfile.NamedTempora... |
import matplotlib.pyplot as plt
from time import time
from random import randint, seed
from tqdm import tqdm
from CM3_triinsert import triinsert
from CM3_triselect import triselect
from CM4_trifusion import trifusion
seed(13)
rep = 10
pmax = 14
N = [2**p for p in range(pmax)]
TopsTS_m, TopsTS_mean, TopsTS_M = [], [... | [
"random.randint",
"matplotlib.pyplot.xscale",
"tqdm.tqdm",
"matplotlib.pyplot.plot",
"random.seed",
"matplotlib.pyplot.fill_between",
"CM3_triinsert.triinsert",
"CM4_trifusion.trifusion",
"time.time",
"CM3_triselect.triselect",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show"
] | [((219, 227), 'random.seed', 'seed', (['(13)'], {}), '(13)\n', (223, 227), False, 'from random import randint, seed\n'), ((427, 434), 'tqdm.tqdm', 'tqdm', (['N'], {}), '(N)\n', (431, 434), False, 'from tqdm import tqdm\n'), ((1317, 1386), 'matplotlib.pyplot.fill_between', 'plt.fill_between', (['N', 'TopsTS_m', 'TopsTS_... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | [
"numpy.abs",
"qiskit.circuit.QuantumCircuit",
"numpy.conj",
"numpy.conjugate",
"qiskit.circuit.QuantumRegister"
] | [((4755, 4787), 'qiskit.circuit.QuantumRegister', 'QuantumRegister', (['(1)', '"""work_qubit"""'], {}), "(1, 'work_qubit')\n", (4770, 4787), False, 'from qiskit.circuit import QuantumCircuit, QuantumRegister, ParameterVector, ParameterExpression\n'), ((4807, 4857), 'qiskit.circuit.QuantumCircuit', 'QuantumCircuit', (['... |
import sys
import re
r = open(sys.argv[1], 'r')
w = open(sys.argv[1] + '_detagged.txt', 'w')
regex = re.compile(r'<.*?>')
regex_tag_to_end_of_line = re.compile(r'<.*?\n')
regex_start_of_line_to_tag = re.compile(r'^.*?>')
for line in r:
line = regex.sub(' ', line)
line = regex_tag_to_end_of_line.sub('', lin... | [
"re.compile"
] | [((104, 123), 're.compile', 're.compile', (['"""<.*?>"""'], {}), "('<.*?>')\n", (114, 123), False, 'import re\n'), ((152, 173), 're.compile', 're.compile', (['"""<.*?\\\\n"""'], {}), "('<.*?\\\\n')\n", (162, 173), False, 'import re\n'), ((203, 222), 're.compile', 're.compile', (['"""^.*?>"""'], {}), "('^.*?>')\n", (213... |
import numpy as np
import cv2
def transform_matrix():
# Define 4 source points
#test1_src = np.float32([[499, 530], [844, 530], [1008, 630], [362, 630]])
straight2_src = np.float32([[557, 475], [729, 475], [961, 630], [345, 630]])
src = straight2_src
# Define 4 destination points
#test1_dst... | [
"cv2.warpPerspective",
"numpy.float32",
"cv2.getPerspectiveTransform"
] | [((184, 244), 'numpy.float32', 'np.float32', (['[[557, 475], [729, 475], [961, 630], [345, 630]]'], {}), '([[557, 475], [729, 475], [961, 630], [345, 630]])\n', (194, 244), True, 'import numpy as np\n'), ((404, 464), 'numpy.float32', 'np.float32', (['[[500, 300], [800, 300], [800, 680], [500, 680]]'], {}), '([[500, 300... |
import datetime
import pandas as pd
from pandas.util.testing import assert_frame_equal
from announcements import *
from announcement import *
from database_mysql import *
from nose import with_setup
import os
from unittest.mock import patch
from urllib import parse, request
directory = os.path.dirname(os.path.realpat... | [
"pandas.read_csv",
"os.path.join",
"os.path.realpath",
"pandas.to_datetime",
"pandas.util.testing.assert_frame_equal"
] | [((305, 331), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (321, 331), False, 'import os\n'), ((1245, 1310), 'os.path.join', 'os.path.join', (['directory', '"""../resources/testing/pre_sens_flag.csv"""'], {}), "(directory, '../resources/testing/pre_sens_flag.csv')\n", (1257, 1310), False,... |
import telebot
from telebot import types
from settings import TOKEN
bot = telebot.TeleBot(TOKEN)
name = ''
surname = ''
age = 0
@bot.message_handler(content_types=['text'])
def start(message):
if message.text == '/reg':
bot.send_message(message.from_user.id, "Как тебя зовут?")
b... | [
"telebot.types.InlineKeyboardButton",
"telebot.TeleBot",
"telebot.types.InlineKeyboardMarkup"
] | [((81, 103), 'telebot.TeleBot', 'telebot.TeleBot', (['TOKEN'], {}), '(TOKEN)\n', (96, 103), False, 'import telebot\n'), ((1107, 1135), 'telebot.types.InlineKeyboardMarkup', 'types.InlineKeyboardMarkup', ([], {}), '()\n', (1133, 1135), False, 'from telebot import types\n'), ((1151, 1209), 'telebot.types.InlineKeyboardBu... |
"""
A collection of PyTorch utility functions and module subclasses
"""
import torch
import torch.nn as nn
import numpy as np
from torch.autograd import grad
from torch.optim.lr_scheduler import _LRScheduler
from torch.distributions import constraints
from torch.distributions.transforms import Transform
_NP_TO_PT = {... | [
"torch.tanh",
"numpy.isclose",
"torch.log",
"torch.eye",
"torch.nn.Parameter",
"torch.autograd.grad",
"torch.finfo",
"torch.distributions.constraints.interval",
"torch.cat"
] | [((1342, 1361), 'numpy.isclose', 'np.isclose', (['vary', '(0)'], {}), '(vary, 0)\n', (1352, 1361), True, 'import numpy as np\n'), ((3316, 3344), 'torch.distributions.constraints.interval', 'constraints.interval', (['(-1)', '(+1)'], {}), '(-1, +1)\n', (3336, 3344), False, 'from torch.distributions import constraints\n')... |
import enolib
def test_querying_a_missing_field_on_the_document_when_all_elements_are_required_raises_the_expected_validationerror():
error = None
input = ("")
try:
document = enolib.parse(input)
document.all_elements_required()
document.field('field')
except enolib.V... | [
"enolib.parse"
] | [((2909, 2928), 'enolib.parse', 'enolib.parse', (['input'], {}), '(input)\n', (2921, 2928), False, 'import enolib\n'), ((3216, 3235), 'enolib.parse', 'enolib.parse', (['input'], {}), '(input)\n', (3228, 3235), False, 'import enolib\n'), ((3571, 3590), 'enolib.parse', 'enolib.parse', (['input'], {}), '(input)\n', (3583,... |
import pytest # type: ignore
from hopeit.app.config import AppConfig, AppDescriptor, \
EventDescriptor, EventType, EventPlugMode
from hopeit.server.config import ServerConfig, LoggingConfig
@pytest.fixture
def mock_plugin_config():
return AppConfig(
app=AppDescriptor(name='mock_plugin', version='tes... | [
"hopeit.server.config.LoggingConfig",
"hopeit.app.config.AppDescriptor",
"hopeit.app.config.EventDescriptor"
] | [((274, 323), 'hopeit.app.config.AppDescriptor', 'AppDescriptor', ([], {'name': '"""mock_plugin"""', 'version': '"""test"""'}), "(name='mock_plugin', version='test')\n", (287, 323), False, 'from hopeit.app.config import AppConfig, AppDescriptor, EventDescriptor, EventType, EventPlugMode\n'), ((538, 605), 'hopeit.app.co... |
#! /usr/bin/env python
import rospy
import sys
# Brings in the SimpleActionClient
import actionlib
import math
import tf2_ros
from geometry_msgs.msg import *
from std_srvs.srv import *
import time
"""Reference Path"""
#x = [1.5, 3.5, 5.5, 7, 5.5, 3.5, 1.5, 0, 1.5]
#y = [0.5, 0.5, 0.5, 2, 3.5, 3.5, 3.5, 2, 0.5]
#theta ... | [
"tf2_ros.TransformListener",
"rospy.init_node",
"rospy.get_rostime",
"math.sin",
"math.cos",
"tf2_ros.Buffer",
"rospy.Time",
"rospy.sleep",
"rospy.Publisher",
"time.time"
] | [((1008, 1027), 'rospy.get_rostime', 'rospy.get_rostime', ([], {}), '()\n', (1025, 1027), False, 'import rospy\n'), ((1228, 1252), 'math.sin', 'math.sin', (['(theta[i] * 0.5)'], {}), '(theta[i] * 0.5)\n', (1236, 1252), False, 'import math\n'), ((1281, 1305), 'math.cos', 'math.cos', (['(theta[i] * 0.5)'], {}), '(theta[i... |
# Code generated by `typeddictgen`. DO NOT EDIT.
"""V1VolumeAttachmentSourceDict generated type."""
from typing import TypedDict
from kubernetes_typed.client import V1PersistentVolumeSpecDict
V1VolumeAttachmentSourceDict = TypedDict(
"V1VolumeAttachmentSourceDict",
{
"inlineVolumeSpec": V1PersistentVo... | [
"typing.TypedDict"
] | [((225, 362), 'typing.TypedDict', 'TypedDict', (['"""V1VolumeAttachmentSourceDict"""', "{'inlineVolumeSpec': V1PersistentVolumeSpecDict, 'persistentVolumeName': str}"], {'total': '(False)'}), "('V1VolumeAttachmentSourceDict', {'inlineVolumeSpec':\n V1PersistentVolumeSpecDict, 'persistentVolumeName': str}, total=Fals... |
import torch
import torch.nn as nn
import torchvision
import torch.backends.cudnn as cudnn
import torch.optim
import os
import sys
import argparse
import time
import DCE.dce_model
import numpy as np
from torchvision import transforms
from PIL import Image
import glob
import time
from tqdm import tqdm
# os.environ['CUDA... | [
"PIL.Image.open",
"os.listdir",
"torch.load",
"tqdm.tqdm",
"numpy.asarray",
"torch.from_numpy",
"torch.no_grad",
"torchvision.utils.save_image",
"glob.glob"
] | [((418, 440), 'PIL.Image.open', 'Image.open', (['image_path'], {}), '(image_path)\n', (428, 440), False, 'from PIL import Image\n'), ((1129, 1186), 'torchvision.utils.save_image', 'torchvision.utils.save_image', (['enhanced_image', 'result_path'], {}), '(enhanced_image, result_path)\n', (1157, 1186), False, 'import tor... |
from django.apps import apps
from django.core.management.base import BaseCommand
from rayures.events import dispatch
class Command(BaseCommand):
help = 'Sync stripe events'
def handle(self, *args, **options):
# TODO: option to select only the one that have only failed or never processed
cls =... | [
"rayures.events.dispatch",
"django.apps.apps.get_model"
] | [((321, 355), 'django.apps.apps.get_model', 'apps.get_model', (['"""rayures"""', '"""Event"""'], {}), "('rayures', 'Event')\n", (335, 355), False, 'from django.apps import apps\n'), ((555, 570), 'rayures.events.dispatch', 'dispatch', (['event'], {}), '(event)\n', (563, 570), False, 'from rayures.events import dispatch\... |
import csv
import json
import os
import random
from genericpath import exists
from .base import ErConnector
from .address import add_address, get_address_type_id_by_name
from .communication import list_communication_methods, add_communication_method
from .owner import add_owner
class Seed(object):
def __init__(... | [
"csv.DictReader"
] | [((6447, 6493), 'csv.DictReader', 'csv.DictReader', (['csvfile'], {'skipinitialspace': '(True)'}), '(csvfile, skipinitialspace=True)\n', (6461, 6493), False, 'import csv\n')] |
import pandas as pd
import numpy as np
import random as rd
class Color_learning:
def __init__(self, feature, labls, entradas, oculta, saida, inst, lr, ephoca, ohl):
self.feature = feature
self.labels = labls
self.input = entradas
self.output = saida
self.hidden = ... | [
"numpy.log",
"numpy.exp",
"numpy.array",
"numpy.zeros",
"numpy.dot",
"numpy.vstack",
"numpy.savetxt",
"random.randint"
] | [((4575, 4604), 'numpy.vstack', 'np.vstack', (['[green, red, blue]'], {}), '([green, red, blue])\n', (4584, 4604), True, 'import numpy as np\n'), ((4615, 4655), 'numpy.array', 'np.array', (['([0] * 10 + [1] * 10 + [2] * 10)'], {}), '([0] * 10 + [1] * 10 + [2] * 10)\n', (4623, 4655), True, 'import numpy as np\n'), ((467... |
import argparse
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
from pylab import rcParams
import structuring
def plot_frame(data_path, frame_index):
"""Show landmarks of a frame into a graph.
Arguments:
csv {str} -- path to the .csv file
frame_index {int} -- index ... | [
"pandas.read_csv",
"argparse.ArgumentParser",
"structuring.get_row",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.show"
] | [((361, 404), 'structuring.get_row', 'structuring.get_row', (['data_path', 'frame_index'], {}), '(data_path, frame_index)\n', (380, 404), False, 'import structuring\n'), ((436, 453), 'matplotlib.pyplot.scatter', 'plt.scatter', (['x', 'y'], {}), '(x, y)\n', (447, 453), True, 'import matplotlib.pyplot as plt\n'), ((458, ... |
"""
Shows an empty window.
"""
from pylibui.core import App
from pylibui.controls import Window
class MyWindow(Window):
def onClose(self, data):
super().onClose(data)
app.stop()
app = App()
window = MyWindow('Window', 800, 600)
window.setMargined(True)
window.show()
app.start()
app.close()... | [
"pylibui.core.App"
] | [((212, 217), 'pylibui.core.App', 'App', ([], {}), '()\n', (215, 217), False, 'from pylibui.core import App\n')] |
import csv
from scipy import ndimage
import numpy as np
import cv2
#Reading data from CSV
lines = []
with open('data/driving_log.csv') as csvfile:
reader = csv.reader(csvfile)
i=0
for line in reader:
if(i==0):
i = i+1
else:
lines.append(li... | [
"keras.layers.Flatten",
"keras.layers.convolutional.Convolution2D",
"cv2.flip",
"keras.layers.pooling.MaxPooling2D",
"keras.layers.Lambda",
"keras.models.Sequential",
"scipy.ndimage.imread",
"numpy.array",
"keras.layers.Cropping2D",
"keras.layers.Dense",
"csv.reader"
] | [((1301, 1327), 'numpy.array', 'np.array', (['augmented_images'], {}), '(augmented_images)\n', (1309, 1327), True, 'import numpy as np\n'), ((1338, 1370), 'numpy.array', 'np.array', (['augmented_measurements'], {}), '(augmented_measurements)\n', (1346, 1370), True, 'import numpy as np\n'), ((1581, 1593), 'keras.models.... |
# Copyright 2018 The Google AI Language Team 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 ... | [
"os.path.join",
"os.walk",
"os.getcwd"
] | [((2617, 2643), 'os.walk', 'os.walk', (['predic_out_folder'], {}), '(predic_out_folder)\n', (2624, 2643), False, 'import os\n'), ((3619, 3630), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (3628, 3630), False, 'import os\n'), ((2883, 2924), 'os.path.join', 'os.path.join', (['predic_out_folder', 'filename'], {}), '(predi... |
import logging
from flask import Blueprint
import ckan.plugins.toolkit as tk
from ckanext.hdx_users.controller_logic.dashboard_dataset_logic import DashboardDatasetLogic
log = logging.getLogger(__name__)
render = tk.render
get_action = tk.get_action
request = tk.request
g = tk.g
h= tk.h
_ = tk._
hdx_user_dashboard... | [
"logging.getLogger",
"flask.Blueprint",
"ckanext.hdx_users.controller_logic.dashboard_dataset_logic.DashboardDatasetLogic"
] | [((179, 206), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (196, 206), False, 'import logging\n'), ((323, 391), 'flask.Blueprint', 'Blueprint', (['u"""hdx_user_dashboard"""', '__name__'], {'url_prefix': 'u"""/dashboard"""'}), "(u'hdx_user_dashboard', __name__, url_prefix=u'/dashboard')\... |
#!/usr/bin/env python
# -*-coding:utf-8-*-
#########################################################################
# > File Name: get_seqdata.py
# > Author: <NAME>
# > Mail: <EMAIL>
# > Created Time: 2019年03月20日 星期三 00时07分18秒
#########################################################################
from _... | [
"os.listdir",
"os.path.join",
"pickle.load",
"numpy.array",
"cv2.resize",
"numpy.transpose"
] | [((926, 974), 'os.path.join', 'os.path.join', (['self.data_dir', 'self.sample_fs[idx]'], {}), '(self.data_dir, self.sample_fs[idx])\n', (938, 974), False, 'import os\n'), ((790, 810), 'os.listdir', 'os.listdir', (['data_dir'], {}), '(data_dir)\n', (800, 810), False, 'import os\n'), ((1044, 1058), 'pickle.load', 'pickle... |
"""
Copyright (c) 2010-2013, Contrail consortium.
All rights reserved.
Redistribution and use in source and binary forms,
with or without modification, are permitted provided
that the following conditions are met:
1. Redistributions of source code must retain the
above copyright notice, this list of conditions
... | [
"conpaas.core.https.server.HttpJsonResponse",
"conpaas.core.expose.expose",
"conpaas.core.agent.BaseAgent.__init__"
] | [((2221, 2235), 'conpaas.core.expose.expose', 'expose', (['"""POST"""'], {}), "('POST')\n", (2227, 2235), False, 'from conpaas.core.expose import expose\n'), ((2550, 2563), 'conpaas.core.expose.expose', 'expose', (['"""GET"""'], {}), "('GET')\n", (2556, 2563), False, 'from conpaas.core.expose import expose\n'), ((2174,... |
import time
from .mod import Handler
from .pogoAPI.inventory import items
class inventoryHandler(Handler):
# Get profile
def getProfile(self):
self.logger.info("Printing Profile:")
profile = self.session.checkProfile()
self.logger.info(profile)
# Do Inventory stuff
def getIn... | [
"time.sleep"
] | [((685, 698), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (695, 698), False, 'import time\n'), ((930, 943), 'time.sleep', 'time.sleep', (['(1)'], {}), '(1)\n', (940, 943), False, 'import time\n'), ((2521, 2536), 'time.sleep', 'time.sleep', (['(0.2)'], {}), '(0.2)\n', (2531, 2536), False, 'import time\n')] |
#!/usr/bin/env python
import os,tarfile,fnmatch,datetime
from shutil import copy2
from ehive.runnable.IGFBaseProcess import IGFBaseProcess
from igf_data.utils.fileutils import get_temp_dir,remove_dir
from igf_data.utils.igf_irods_client import IGF_irods_uploader
from igf_data.igfdb.projectadaptor import ProjectAdaptor
... | [
"igf_data.utils.fileutils.get_temp_dir",
"igf_data.utils.fileutils.remove_dir",
"tarfile.open",
"shutil.copy2",
"datetime.datetime.strptime",
"igf_data.utils.igf_irods_client.IGF_irods_uploader",
"igf_data.igfdb.projectadaptor.ProjectAdaptor",
"os.path.join",
"fnmatch.fnmatch",
"os.path.basename",... | [((1298, 1352), 'igf_data.igfdb.projectadaptor.ProjectAdaptor', 'ProjectAdaptor', ([], {}), "(**{'session_class': igf_session_class})\n", (1312, 1352), False, 'from igf_data.igfdb.projectadaptor import ProjectAdaptor\n'), ((1830, 1859), 'os.path.basename', 'os.path.basename', (['report_html'], {}), '(report_html)\n', (... |
import random
import urllib
from flaskwallet import app
from flaskwallet import session
from settingsapp.helpers import get_setting
def real_format(account):
if account == '__DEFAULT_ACCOUNT__':
account = ''
return account
def human_format(account):
if account == '':
account = '__DEFAULT... | [
"settingsapp.helpers.get_setting",
"random.randint"
] | [((1119, 1163), 'random.randint', 'random.randint', (['cachetime_min', 'cachetime_max'], {}), '(cachetime_min, cachetime_max)\n', (1133, 1163), False, 'import random\n'), ((1017, 1048), 'settingsapp.helpers.get_setting', 'get_setting', (['"""cachetime_min"""', '(5)'], {}), "('cachetime_min', 5)\n", (1028, 1048), False,... |
import pandas as pd
import numpy as np
import matplotlib as plt
import openpyxl
State = ['KY', 'VA', 'OH', 'PA', 'WV']
def writeData(df, name, nan_excel):
data = df[df['State'].isin([name])]
data.to_excel(r"F:\360MoveData\Users\Dell\Desktop\2019MCM_C\2019MCM_C\data\2018_MCMProblemC_DATA\{0}.xlsx".format(name))
d... | [
"pandas.DataFrame",
"pandas.read_excel"
] | [((324, 479), 'pandas.read_excel', 'pd.read_excel', (['"""F:\\\\360MoveData\\\\Users\\\\Dell\\\\Desktop\\\\2019MCM_C\\\\2019MCM_C\\\\data\\\\2018_MCMProblemC_DATA\\\\MCM_NFLIS_Data.xlsx"""'], {'sheet_name': '"""Data"""'}), "(\n 'F:\\\\360MoveData\\\\Users\\\\Dell\\\\Desktop\\\\2019MCM_C\\\\2019MCM_C\\\\data\\\\2018_... |
# main.py -- put your code here!
from lib.servo import servo1, stop_servos_before_finishing
from lib.accelerometer import accelerometer
turn_left = True
# This will stop the servos if anything goes wrong
with stop_servos_before_finishing():
# Loop forever
while True:
x = accelerometer.x()
... | [
"lib.servo.servo1.forward",
"lib.servo.stop_servos_before_finishing",
"lib.servo.servo1.stop",
"lib.accelerometer.accelerometer.x",
"lib.servo.servo1.backward"
] | [((220, 250), 'lib.servo.stop_servos_before_finishing', 'stop_servos_before_finishing', ([], {}), '()\n', (248, 250), False, 'from lib.servo import servo1, stop_servos_before_finishing\n'), ((302, 319), 'lib.accelerometer.accelerometer.x', 'accelerometer.x', ([], {}), '()\n', (317, 319), False, 'from lib.accelerometer ... |
import psycopg2
#Connects to db
con = psycopg2.connect(
host = "localhost",
database = "tempdata",
user = "jack",
password = "<PASSWORD>")
#Create Cursor
cur = con.cursor()
#Execute Query
cur.execute("select distinct(country) from temperatures;")
#Catch all results as c... | [
"psycopg2.connect"
] | [((39, 134), 'psycopg2.connect', 'psycopg2.connect', ([], {'host': '"""localhost"""', 'database': '"""tempdata"""', 'user': '"""jack"""', 'password': '"""<PASSWORD>"""'}), "(host='localhost', database='tempdata', user='jack',\n password='<PASSWORD>')\n", (55, 134), False, 'import psycopg2\n')] |
# -*- coding: utf-8 -*-
"""
Created on Thu May 16 16:31:04 2019
@author: macfa
"""
import numpy as np
import scipy
import matplotlib.pyplot as plt
import librosa
import soundfile as sf
import os
from config import PARAS
import warnings
warnings.filterwarnings('ignore')
audio_path = '../../100_download/separated_data... | [
"librosa.util.normalize",
"os.makedirs",
"mel_dealer.mel_converter.signal_to_melspec",
"soundfile.write",
"numpy.split",
"mel_dealer.mel_converter.m",
"warnings.filterwarnings",
"os.walk",
"librosa.load"
] | [((239, 272), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (262, 272), False, 'import warnings\n'), ((503, 522), 'os.walk', 'os.walk', (['audio_path'], {}), '(audio_path)\n', (510, 522), False, 'import os\n'), ((766, 805), 'mel_dealer.mel_converter.signal_to_melspec', 'm... |
from api.db import db
from sqlalchemy import and_
from datetime import datetime
import re
class CommitteePost(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String)
officials_email = db.Column(db.String)
committee_id = db.Column(db.Integer, db.ForeignKey('committee.id'))
... | [
"api.db.db.Column",
"api.db.db.ForeignKey",
"datetime.datetime.now",
"api.db.db.relationship",
"sqlalchemy.and_"
] | [((132, 171), 'api.db.db.Column', 'db.Column', (['db.Integer'], {'primary_key': '(True)'}), '(db.Integer, primary_key=True)\n', (141, 171), False, 'from api.db import db\n'), ((183, 203), 'api.db.db.Column', 'db.Column', (['db.String'], {}), '(db.String)\n', (192, 203), False, 'from api.db import db\n'), ((226, 246), '... |
"""add order column
Revision ID: ffdd07363665
Revises: <PASSWORD>
Create Date: 2020-08-21 21:37:50.040572
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'ff<PASSWORD>'
down_revision = '<PASSWORD>'
branch_labels = None
depen... | [
"sqlalchemy.dialects.mysql.INTEGER",
"alembic.op.drop_column",
"sqlalchemy.text"
] | [((687, 739), 'alembic.op.drop_column', 'op.drop_column', (['"""discord_server_categories"""', '"""order"""'], {}), "('discord_server_categories', 'order')\n", (701, 739), False, 'from alembic import op\n'), ((482, 513), 'sqlalchemy.dialects.mysql.INTEGER', 'mysql.INTEGER', ([], {'display_width': '(11)'}), '(display_wi... |
"""
Enable construction of containers with uniform item type(s)
"""
# std libs
import warnings as wrn
from abc import ABCMeta
from collections import abc
# local libs
from recipes.iter import first_true_index
from recipes.functionals import echo0, raises as bork
class OfTypes(ABCMeta):
"""
Factory that cre... | [
"warnings.catch_warnings",
"recipes.iter.first_true_index",
"recipes.functionals.raises",
"warnings.filterwarnings"
] | [((6623, 6638), 'recipes.functionals.raises', 'bork', (['TypeError'], {}), '(TypeError)\n', (6627, 6638), True, 'from recipes.functionals import echo0, raises as bork\n'), ((7254, 7295), 'recipes.iter.first_true_index', 'first_true_index', (['(raises, warns, silent)'], {}), '((raises, warns, silent))\n', (7270, 7295), ... |
# coding=utf-8
"""
Build vocab with a set max vocab size.
Build token ids given the vocab.
Do get_data.py first.
"""
# from __future__ import unicode_literals, print_function, division
import os
import subprocess
import re
from unidecode import unidecode
from nltk import word_tokenize
from DeepLearning.Utils import C... | [
"subprocess.check_output",
"re.split",
"nltk.word_tokenize",
"re.compile",
"os.path.join",
"subprocess.call",
"unidecode.unidecode",
"DeepLearning.Utils.data_utils.create_vocabulary",
"DeepLearning.Utils.data_utils.data_to_token_ids"
] | [((869, 915), 'os.path.join', 'os.path.join', (['CACHE_DIR', 'PERSON_VOCAB_FILENAME'], {}), '(CACHE_DIR, PERSON_VOCAB_FILENAME)\n', (881, 915), False, 'import os\n'), ((936, 982), 'os.path.join', 'os.path.join', (['CACHE_DIR', 'DOCTOR_VOCAB_FILENAME'], {}), '(CACHE_DIR, DOCTOR_VOCAB_FILENAME)\n', (948, 982), False, 'im... |
from bzflag.networking.game_packet import GamePacket
from bzflag.networking.packet import Packet
class MsgShotEndPacket(GamePacket):
__slots__ = (
'player_id',
'shot_id',
'reason',
)
def __init__(self):
super().__init__()
self.packet_type: str = 'MsgShotEnd'
... | [
"bzflag.networking.packet.Packet.unpack_int16",
"bzflag.networking.packet.Packet.unpack_uint8",
"bzflag.networking.packet.Packet.unpack_uint16"
] | [((458, 490), 'bzflag.networking.packet.Packet.unpack_uint8', 'Packet.unpack_uint8', (['self.buffer'], {}), '(self.buffer)\n', (477, 490), False, 'from bzflag.networking.packet import Packet\n'), ((514, 547), 'bzflag.networking.packet.Packet.unpack_uint16', 'Packet.unpack_uint16', (['self.buffer'], {}), '(self.buffer)\... |
#!/usr/bin/env python3
import subprocess
import sys
subprocess.check_call([sys.executable, "-m", "pip", "install", "pip", "-U"])
# temporary workaroud for issue between main and develop
subprocess.check_call([sys.executable, "-m", "pip", "uninstall", "depthai", "--yes"])
subprocess.check_call([sys.executable, "-m", "... | [
"subprocess.check_call"
] | [((54, 130), 'subprocess.check_call', 'subprocess.check_call', (["[sys.executable, '-m', 'pip', 'install', 'pip', '-U']"], {}), "([sys.executable, '-m', 'pip', 'install', 'pip', '-U'])\n", (75, 130), False, 'import subprocess\n'), ((188, 277), 'subprocess.check_call', 'subprocess.check_call', (["[sys.executable, '-m', ... |
import numpy as np
import tensorflow as tf
import json
import pickle
import data_utils
import plotting
import model
import utils
from time import time
from eICU_synthetic_dataset_generation import batch_size
from mmd import median_pairwise_distance, mix_rbf_mmd2_and_ratio
tf.logging.set_verbosity(tf.logging.ERROR)
... | [
"utils.rgan_options_parser",
"tensorflow.logging.set_verbosity",
"utils.load_settings_from_file",
"numpy.save",
"plotting.visualise_at_epoch",
"data_utils.get_batch",
"model.train_epoch",
"tensorflow.placeholder",
"tensorflow.Session",
"mmd.mix_rbf_mmd2_and_ratio",
"mmd.median_pairwise_distance"... | [((276, 318), 'tensorflow.logging.set_verbosity', 'tf.logging.set_verbosity', (['tf.logging.ERROR'], {}), '(tf.logging.ERROR)\n', (300, 318), True, 'import tensorflow as tf\n'), ((402, 429), 'utils.rgan_options_parser', 'utils.rgan_options_parser', ([], {}), '()\n', (427, 429), False, 'import utils\n'), ((680, 723), 'd... |
import re
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
# this list of stopwords is a merge of multiple lists found in the web
stops = set(['[closed]', '[duplicate]', 'i', 'me', 'sometime', 'been',
'mostly', 'don\'t', 'don', 'hasnt', 'couldn\'t', 'couldn', '\'t',
't', 'don', 'your'... | [
"sys.setdefaultencoding"
] | [((34, 65), 'sys.setdefaultencoding', 'sys.setdefaultencoding', (['"""utf-8"""'], {}), "('utf-8')\n", (56, 65), False, 'import sys\n')] |
import datetime as _dt
import json as _json
import hashlib as _hashlib
class Blockchain:
def __init__(self) -> None:
self.chain = list()
genesis_block = self._create_block(
data="genesis block", proof=1, previous_hash="0", index=0
)
self.chain.append(genesis_block)
... | [
"hashlib.sha256",
"json.dumps",
"datetime.datetime.utcnow"
] | [((1683, 1717), 'json.dumps', '_json.dumps', (['block'], {'sort_keys': '(True)'}), '(block, sort_keys=True)\n', (1694, 1717), True, 'import json as _json\n'), ((1742, 1772), 'hashlib.sha256', '_hashlib.sha256', (['encoded_block'], {}), '(encoded_block)\n', (1757, 1772), True, 'import hashlib as _hashlib\n'), ((1953, 19... |
#!/usr/bin/python3
##
# This script helps to search in a html file. Currently it supports only searching for a value of a tag.
#
# Params:
# 1.: The HTML file.
# 2.: The result file.
# 3.: The name of the tag to search for.
##
# process args
import sys
pathHtml = sys.argv[1]
pathResult = sys.argv[2]
tag = sys.argv[3]... | [
"html.parser.HTMLParser.__init__"
] | [((467, 492), 'html.parser.HTMLParser.__init__', 'HTMLParser.__init__', (['self'], {}), '(self)\n', (486, 492), False, 'from html.parser import HTMLParser\n')] |
import moeda
p = float(input("Informe um valor qualquer: "))
print("\n")
print("-=-=-=-=- INÍCIO =-=-=-=")
print(f"A metade do valor {p:.2f} é: {moeda.metade(p)}")
print(f"O dobro do valor {p:.2f} é: {moeda.dobro(p)}")
print(f"Aumentando 10%, temos: {moeda.aumentar(p, 10)}")
print(f"Diminuindo 10%, temos: {moeda.dim... | [
"moeda.aumentar",
"moeda.metade",
"moeda.dobro",
"moeda.diminuir"
] | [((146, 161), 'moeda.metade', 'moeda.metade', (['p'], {}), '(p)\n', (158, 161), False, 'import moeda\n'), ((203, 217), 'moeda.dobro', 'moeda.dobro', (['p'], {}), '(p)\n', (214, 217), False, 'import moeda\n'), ((253, 274), 'moeda.aumentar', 'moeda.aumentar', (['p', '(10)'], {}), '(p, 10)\n', (267, 274), False, 'import m... |
#!/usr/bin/env python
# pipescaler/core/processor.py
#
# Copyright (C) 2020-2021 <NAME>
# All rights reserved.
#
# This software may be modified and distributed under the terms of the
# BSD license.
from __future__ import annotations
from abc import abstractmethod
from argparse import ArgumentParser
from ins... | [
"inspect.cleandoc"
] | [((1896, 1917), 'inspect.cleandoc', 'cleandoc', (['cls.__doc__'], {}), '(cls.__doc__)\n', (1904, 1917), False, 'from inspect import cleandoc\n')] |
import pytest
from tweet_nlp_toolkit.prep.token import Token, WeiboToken
from tweet_nlp_toolkit.prep.tokenizer import white_space_tokenize, tweet_tokenize, Detokenizer, chinese_tokenize, japanese_tokenize, \
_is_chinese, _is_japanese, thai_tokenize, _is_thai, weibo_tokenize
@pytest.mark.parametrize(("text", "exp... | [
"tweet_nlp_toolkit.prep.tokenizer.white_space_tokenize",
"tweet_nlp_toolkit.prep.tokenizer.thai_tokenize",
"tweet_nlp_toolkit.prep.tokenizer.tweet_tokenize",
"tweet_nlp_toolkit.prep.tokenizer._is_chinese",
"tweet_nlp_toolkit.prep.tokenizer.japanese_tokenize",
"tweet_nlp_toolkit.prep.tokenizer.chinese_toke... | [((283, 474), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (["('text', 'expected_tokens')", "[(' @remy: This is waaaaayyyy too much for you', ['@remy:', 'This', 'is',\n 'waaaaayyyy', 'too', 'much', 'for', 'you']), ('', [])]"], {}), "(('text', 'expected_tokens'), [(\n ' @remy: This is waaaaayyyy too much ... |
from __future__ import print_function, unicode_literals
import sys
from workflow import Workflow, web, ICON_ERROR, ICON_SETTINGS
from utils import parse_args, is_match
from settings import UPDATE_SETTINGS, HELP_URL, LEETCODE_URL, LC_TOPICS
class SearchResult(object):
def __init__(self, title, subtitle, url):
... | [
"utils.parse_args",
"workflow.Workflow",
"settings.LC_TOPICS.items",
"utils.is_match"
] | [((653, 670), 'settings.LC_TOPICS.items', 'LC_TOPICS.items', ([], {}), '()\n', (668, 670), False, 'from settings import UPDATE_SETTINGS, HELP_URL, LEETCODE_URL, LC_TOPICS\n'), ((1753, 1772), 'utils.parse_args', 'parse_args', (['wf.args'], {}), '(wf.args)\n', (1763, 1772), False, 'from utils import parse_args, is_match\... |
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: <EMAIL>
# Maintained By: <EMAIL>
"""Fix ProgramEditor permissions
Revision ID: 10adeac7b693
Revises: <PASSWORD>
Create Date: 2013-10-10 00:12:57.... | [
"sqlalchemy.sql.column",
"datetime.datetime.now",
"json.dumps"
] | [((594, 618), 'sqlalchemy.sql.column', 'column', (['"""id"""', 'sa.Integer'], {}), "('id', sa.Integer)\n", (600, 618), False, 'from sqlalchemy.sql import table, column\n'), ((624, 649), 'sqlalchemy.sql.column', 'column', (['"""name"""', 'sa.String'], {}), "('name', sa.String)\n", (630, 649), False, 'from sqlalchemy.sql... |
#3_Laes_InsertDB_2019M.py
from app.models import Klub, Konkurrence, Medlemmer, Deltager, Grunddata, Baner, PostBaner, deltager_strak
from app import db
import json
from operator import itemgetter
def find_medlemID(medlem):
''' Finder medlems ID '''
temp1 = db.session.query(Medlemmer).filter(Medlemmer.navn == ... | [
"app.db.session.commit",
"app.models.PostBaner",
"app.models.Deltager",
"app.db.session.merge",
"json.dumps",
"app.models.Konkurrence",
"operator.itemgetter",
"app.models.Baner",
"app.db.session.add",
"json.load",
"app.models.deltager_strak",
"app.db.session.query"
] | [((994, 1212), 'app.models.Deltager', 'Deltager', ([], {'bane': 'bane1', 'placering': 'plac', 'status': 'status', 'statuskode': 'Statuskode', 'tid': 'tid', 'tidSekunder': 'tid_sekunder', 'strak': 'strak', 'point': 'point', 'emit_Brik': 'emitbrik', 'medlemmer_id': 'MedlemID', 'konkurrence_id': 'Konkurrence_id'}), '(bane... |
import math
import random
from typing import Tuple
from .. import base
class Friedman(base.SyntheticDataset):
"""Friedman synthetic dataset.
Each observation is composed of 10 features. Each feature value is sampled uniformly in [0, 1].
The target is defined by the following function:
$$y = 10 sin(... | [
"random.Random",
"math.cos",
"math.exp",
"math.sin"
] | [((1500, 1524), 'random.Random', 'random.Random', (['self.seed'], {}), '(self.seed)\n', (1513, 1524), False, 'import random\n'), ((12845, 12869), 'random.Random', 'random.Random', (['self.seed'], {}), '(self.seed)\n', (12858, 12869), False, 'import random\n'), ((13036, 13060), 'random.Random', 'random.Random', (['self.... |
import logging
import time
import prometheus_client # type: ignore
from celery.signals import ( # type: ignore
after_task_publish,
beat_init,
before_task_publish,
task_postrun,
task_prerun,
worker_ready,
)
from .metrics import (
TASK_EXECUTION_TIME,
TASK_POSTRUN,
TASK_PRERUN,
... | [
"logging.getLogger",
"celery.signals.worker_ready.connect",
"celery.signals.beat_init.connect",
"time.monotonic",
"prometheus_client.REGISTRY.register",
"celery.signals.task_postrun.connect",
"celery.signals.after_task_publish.connect",
"celery.signals.task_prerun.connect",
"prometheus_client.start_... | [((563, 590), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (580, 590), False, 'import logging\n'), ((850, 892), 'celery.signals.worker_ready.connect', 'worker_ready.connect', (['self.on_worker_ready'], {}), '(self.on_worker_ready)\n', (870, 892), False, 'from celery.signals import after... |
from functools import reduce
import operator
from typing import List
from dataclasses import dataclass, field
import core.constants as constants
from core.player import Player
@dataclass
class Position:
x: int
y: int
@dataclass
class Board:
board: List[int] = field(
default_factory=lambda: [
... | [
"functools.reduce",
"dataclasses.field"
] | [((278, 477), 'dataclasses.field', 'field', ([], {'default_factory': '(lambda : [[constants.EMPTY, constants.EMPTY, constants.EMPTY], [constants.\n EMPTY, constants.EMPTY, constants.EMPTY], [constants.EMPTY, constants.\n EMPTY, constants.EMPTY]])'}), '(default_factory=lambda : [[constants.EMPTY, constants.EMPTY,\... |
"""
Copyright 2012-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 in writing, software
di... | [
"hqlib.domain.Project",
"unittest.mock.MagicMock",
"datetime.datetime.now",
"hqlib.metric.ActionActivity",
"hqlib.metric.StaleActions",
"hqlib.metric.OverDueActions",
"hqlib.metric.RiskLog",
"datetime.timedelta",
"unittest.mock.patch",
"hqlib.metric.IssueLogMetric"
] | [((4755, 4784), 'unittest.mock.patch', 'patch', (['"""hqlib.domain.Project"""'], {}), "('hqlib.domain.Project')\n", (4760, 4784), False, 'from unittest.mock import patch, MagicMock\n'), ((2264, 2382), 'hqlib.domain.Project', 'domain.Project', ([], {'metric_sources': '{metric_source.RiskLog: self.__board}', 'metric_sour... |
# documentation https://wikimedia.org/api/rest_v1/?doc
# What day in the first two weeks had the most views?
import requests
import json
from urllib.parse import quote
ENDPOINT = 'https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/'
#first, we gather the total views from all devices....
wp_code = 'en.wi... | [
"urllib.parse.quote"
] | [((546, 572), 'urllib.parse.quote', 'quote', (['page_title'], {'safe': '""""""'}), "(page_title, safe='')\n", (551, 572), False, 'from urllib.parse import quote\n')] |
# coding=utf-8
# Copyright 2022 The Google Research 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 applicab... | [
"abstract_nas.model.concrete.new_graph",
"math.ceil",
"abstract_nas.model.concrete.new_op",
"absl.logging.info",
"re.fullmatch",
"functools.partial",
"abstract_nas.model.block.Block"
] | [((2686, 2760), 'absl.logging.info', 'logging.info', (['"""round_filter input=%s output=%s"""', 'orig_filters', 'new_filters'], {}), "('round_filter input=%s output=%s', orig_filters, new_filters)\n", (2698, 2760), False, 'from absl import logging\n'), ((2915, 2953), 'math.ceil', 'math.ceil', (['(depth_coefficient * re... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
class backWarp(nn.Module):
"""
A class for creating a backwarping object.
This is used for backwarping to an image:
Given optical flow from frame I0 to I1 --> F_0_1 and frame I1,
it generates I0 <-... | [
"torch.nn.functional.grid_sample",
"torch.stack",
"torch.tensor",
"numpy.linspace",
"numpy.arange"
] | [((1976, 2002), 'torch.stack', 'torch.stack', (['(x, y)'], {'dim': '(3)'}), '((x, y), dim=3)\n', (1987, 2002), False, 'import torch\n'), ((2075, 2140), 'torch.nn.functional.grid_sample', 'torch.nn.functional.grid_sample', (['img', 'grid'], {'padding_mode': '"""border"""'}), "(img, grid, padding_mode='border')\n", (2106... |
# -*- coding: utf-8 -*-
# https://github.com/Hnfull/Intensio-Obfuscator
#---------------------------------------------------------- [Lib] -----------------------------------------------------------#
import re
import fileinput
import os
import sys
from progress.bar import Bar
try:
from intensio_obfuscator.core.u... | [
"re.match",
"os.getcwd",
"os.chdir",
"sys.stdout.write",
"fileinput.FileInput",
"core.utils.intensio_utils.Utils",
"progress.bar.Bar",
"re.sub",
"fileinput.input",
"re.search"
] | [((628, 635), 'core.utils.intensio_utils.Utils', 'Utils', ([], {}), '()\n', (633, 635), False, 'from core.utils.intensio_utils import Utils, Reg\n'), ((15774, 15785), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (15783, 15785), False, 'import os\n'), ((1384, 1459), 'progress.bar.Bar', 'Bar', (['"""Obfuscation """'], {'f... |
"""Вычисление среднего ариметического и геометрического ряда чисел."""
from typing import List
from cli import mainloop, ArrayFloatParameter
def arith_mean(array: List[float]) -> float:
"""Среднее арифметическое ряда чисел."""
return sum(array) / len(array)
def geom_mean(array: List[float]) -> float:
""... | [
"cli.ArrayFloatParameter",
"cli.mainloop"
] | [((481, 509), 'cli.ArrayFloatParameter', 'ArrayFloatParameter', (['"""Число"""'], {}), "('Число')\n", (500, 509), False, 'from cli import mainloop, ArrayFloatParameter\n'), ((690, 728), 'cli.mainloop', 'mainloop', (['(number,)', 'compute_and_print'], {}), '((number,), compute_and_print)\n', (698, 728), False, 'from cli... |
from plenum.server.monitor import RequestTimeTracker
INSTANCE_COUNT = 4
def test_request_tracker_start_adds_request():
req_tracker = RequestTimeTracker(INSTANCE_COUNT)
digest = "digest"
now = 1.0
req_tracker.start(digest, now)
assert digest in req_tracker
assert digest in [req for req, _ i... | [
"plenum.server.monitor.RequestTimeTracker"
] | [((141, 175), 'plenum.server.monitor.RequestTimeTracker', 'RequestTimeTracker', (['INSTANCE_COUNT'], {}), '(INSTANCE_COUNT)\n', (159, 175), False, 'from plenum.server.monitor import RequestTimeTracker\n'), ((459, 493), 'plenum.server.monitor.RequestTimeTracker', 'RequestTimeTracker', (['INSTANCE_COUNT'], {}), '(INSTANC... |
import numpy as np
np.random.seed(1337)
from keras.models import Sequential
from keras.layers import Dense
import matplotlib.pyplot as plt
model = Sequential()
model.add(Dense(units=50, input_dim=1, activation='relu'))
model.add(Dense(units=50, activation='relu'))
model.add(Dense(units=1, activation='sigmoid'))
model.... | [
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"keras.models.Sequential",
"numpy.array",
"matplotlib.pyplot.figure",
"numpy.random.seed",
"matplotlib.pyplot.scatter",
"keras.layers.Dense",
"matplotlib.pyplot.title",
"csv.reader",
"matplotlib.pyplot.legend",
... | [((19, 39), 'numpy.random.seed', 'np.random.seed', (['(1337)'], {}), '(1337)\n', (33, 39), True, 'import numpy as np\n'), ((148, 160), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (158, 160), False, 'from keras.models import Sequential\n'), ((722, 741), 'numpy.array', 'np.array', (['fr_corn_x'], {}), '(fr... |
#!/usr/bin/env python3
import os
from subprocess import Popen, PIPE, STDOUT
zfpath = "target/debug/zf"
testdir = 'tests'
FAILED = 0
PASSED = 0
def do_test(test):
test = testdir + "/" + test
testcode = ""
expect = ""
with open(test) as f:
testcode = f.read()
for line in testcode.split("\... | [
"subprocess.Popen",
"os.listdir"
] | [((455, 505), 'subprocess.Popen', 'Popen', (['cmd'], {'stdout': 'PIPE', 'stderr': 'STDOUT', 'stdin': 'PIPE'}), '(cmd, stdout=PIPE, stderr=STDOUT, stdin=PIPE)\n', (460, 505), False, 'from subprocess import Popen, PIPE, STDOUT\n'), ((764, 783), 'os.listdir', 'os.listdir', (['testdir'], {}), '(testdir)\n', (774, 783), Fal... |
"""A simple permutation for arbitrary length integers.
This file also includes a simple XORShift-based PRNG for expanding the seed.
Example code from http://www.jstatsoft.org/v08/i14/paper (public domain).
"""
import random
from .parameters import TRIPLETS
class Permutation(object):
"""Simple permutation object... | [
"random.randint"
] | [((498, 538), 'random.randint', 'random.randint', (['(0)', '((1 << bit_length) - 1)'], {}), '(0, (1 << bit_length) - 1)\n', (512, 538), False, 'import random\n')] |
from dataclasses import dataclass
from typing import Optional
import hyperstate as hs
@dataclass(eq=True)
class DeepInner:
x: int
@dataclass(eq=True)
class PPO:
inner: Optional[DeepInner] = None
cliprange: float = 0.2
gamma: float = 0.99
lambd: float = 0.95
entcoeff: float = 0.01
value_l... | [
"hyperstate.load",
"dataclasses.dataclass"
] | [((89, 107), 'dataclasses.dataclass', 'dataclass', ([], {'eq': '(True)'}), '(eq=True)\n', (98, 107), False, 'from dataclasses import dataclass\n'), ((139, 157), 'dataclasses.dataclass', 'dataclass', ([], {'eq': '(True)'}), '(eq=True)\n', (148, 157), False, 'from dataclasses import dataclass\n'), ((344, 362), 'dataclass... |
# -*- coding: utf-8 -*-
# user = www
# 1:连接数据库 2:编写sql 3:建立游标 4:执行
import pymysql
from common.read_config import ReadConfig
class MysqlUtil:
def __init__(self):
config = ReadConfig()
host = config.get('mysql', 'host')
user = config.get('mysql', 'usr')
password = config.get('mysql... | [
"common.read_config.ReadConfig",
"pymysql.connect"
] | [((186, 198), 'common.read_config.ReadConfig', 'ReadConfig', ([], {}), '()\n', (196, 198), False, 'from common.read_config import ReadConfig\n'), ((421, 532), 'pymysql.connect', 'pymysql.connect', ([], {'host': 'host', 'user': 'user', 'password': 'password', 'port': 'port', 'cursorclass': 'pymysql.cursors.DictCursor'})... |
# Phase 2 of accession info harvesting: read pickle file, write TSV
# Original by <NAME>, 27 January 2015
import argparse
import time
import sys, os
import pickle
DEFAULT_PICKLE_FILE = sys.argv[1] # 'Genbank.pickle'
DEFAULT_ACCESSION_MAP = sys.argv[2] # 'accessionid_to_taxonid.tsv'
parser = argparse.ArgumentParse... | [
"pickle.load",
"argparse.ArgumentParser"
] | [((298, 366), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Text genbank flatfile testing"""'}), "(description='Text genbank flatfile testing')\n", (321, 366), False, 'import argparse\n'), ((459, 482), 'pickle.load', 'pickle.load', (['picklefile'], {}), '(picklefile)\n', (470, 482), Fal... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import unittest
from draftjs_exporter.engines.html5lib import DOM_HTML5LIB
from draftjs_exporter.engines.lxml import DOM_LXML
from draftjs_exporter.engines.string import DOMString
class TestDOMEnginesDifferences(unittest.TestCase):
... | [
"draftjs_exporter.engines.html5lib.DOM_HTML5LIB.parse_html",
"draftjs_exporter.engines.html5lib.DOM_HTML5LIB.create_tag",
"draftjs_exporter.engines.html5lib.DOM_HTML5LIB.render_debug",
"draftjs_exporter.engines.string.DOMString.create_tag",
"draftjs_exporter.engines.lxml.DOM_LXML.parse_html",
"draftjs_exp... | [((1311, 1341), 'draftjs_exporter.engines.html5lib.DOM_HTML5LIB.create_tag', 'DOM_HTML5LIB.create_tag', (['"""svg"""'], {}), "('svg')\n", (1334, 1341), False, 'from draftjs_exporter.engines.html5lib import DOM_HTML5LIB\n'), ((1611, 1637), 'draftjs_exporter.engines.lxml.DOM_LXML.create_tag', 'DOM_LXML.create_tag', (['""... |
#!/usr/bin/env python3
import numpy as np
M = np.array(
(
[1, -1, 0, 0, 0, 0, 0, 0],
[0.4, 0.4, 0, -1, 0, 0, 0, 0],
[0.6, 0.6, -1, 0, 0, 0, 0, 0],
[0, 0, 0, -0.75, 0, 1, 0, 0],
[-1, 0, 0, 0, 1, 1, 0, 0],
[0, -1, 0, 0, 0, 0, 1, 1],
[0, 0, 0, -1, 0, 1, 0, 1],
... | [
"numpy.array",
"numpy.linalg.inv",
"numpy.matmul"
] | [((48, 298), 'numpy.array', 'np.array', (['([1, -1, 0, 0, 0, 0, 0, 0], [0.4, 0.4, 0, -1, 0, 0, 0, 0], [0.6, 0.6, -1, 0,\n 0, 0, 0, 0], [0, 0, 0, -0.75, 0, 1, 0, 0], [-1, 0, 0, 0, 1, 1, 0, 0], [\n 0, -1, 0, 0, 0, 0, 1, 1], [0, 0, 0, -1, 0, 1, 0, 1], [1, 1, 0, 0, 0, 0,\n 0, 0])'], {}), '(([1, -1, 0, 0, 0, 0, 0, ... |
"""
file : main.py
contains the entriepoint for pizstrip
"""
import logging
import logging.handlers
import time
from datetime import datetime
from queue import Empty, Queue
from threading import Event
from pizstrip.config import load_config
from pizstrip.excep import ColorClassError, TemperaturReadError
from pizstrip.... | [
"logging.getLogger",
"logging.StreamHandler",
"pizstrip.mqread.setup_mqtt",
"pizstrip.runner.Runner",
"logging.handlers.RotatingFileHandler",
"time.sleep",
"pizstrip.strip.get_color_class",
"pizstrip.helpers.clear_screen",
"queue.Queue",
"pizstrip.config.load_config"
] | [((484, 511), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (501, 511), False, 'import logging\n'), ((636, 655), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (653, 655), False, 'import logging\n'), ((835, 922), 'logging.handlers.RotatingFileHandler', 'logging.handlers.Rota... |
from flask import Flask
import json
from inference import API
app = Flask(__name__)
api = API()
@app.route("/")
def hello_world():
return app.send_static_file('index.html')
@app.route('/query_api/<text>/<query_type>')
def query_api(text, query_type):
print(text)
results, values = api.query(text, type=qu... | [
"json.dumps",
"inference.API",
"flask.Flask"
] | [((70, 85), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (75, 85), False, 'from flask import Flask\n'), ((92, 97), 'inference.API', 'API', ([], {}), '()\n', (95, 97), False, 'from inference import API\n'), ((470, 485), 'json.dumps', 'json.dumps', (['ret'], {}), '(ret)\n', (480, 485), False, 'import json\... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | [
"pulumi.get",
"pulumi.getter",
"pulumi.set",
"warnings.warn",
"pulumi.log.warn",
"pulumi.ResourceOptions"
] | [((10011, 10038), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""vpcId"""'}), "(name='vpcId')\n", (10024, 10038), False, 'import pulumi\n'), ((10889, 10921), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""clientCert"""'}), "(name='clientCert')\n", (10902, 10921), False, 'import pulumi\n'), ((11278, 11309), 'p... |
from __future__ import unicode_literals
import frappe
def execute():
frappe.db.sql(
"""
UPDATE `tabMaterial Request`
SET status = CASE
WHEN docstatus = 2 THEN 'Cancelled'
WHEN docstatus = 0 THEN 'Draft'
ELSE CASE
WHEN status = 'Stopped' THEN 'Stopped'
WHEN status != 'Stoppe... | [
"frappe.db.sql"
] | [((71, 870), 'frappe.db.sql', 'frappe.db.sql', (['"""\n\t\tUPDATE `tabMaterial Request`\n\t\t\tSET status = CASE\n\t\t\t\t\t\t\tWHEN docstatus = 2 THEN \'Cancelled\'\n\t\t\t\t\t\t\tWHEN docstatus = 0 THEN \'Draft\'\n\t\t\t\t\t\t\tELSE CASE\n\t\t\t\t\t\t\t\tWHEN status = \'Stopped\' THEN \'Stopped\'\n\t\t\t\t\t\t\t\tWHE... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
from django.contrib.auth import get_user_model
from django.core import signing
from django.http import Http404
from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.views import generic
from django.... | [
"django.shortcuts.render",
"dataops.ops.store_dataframe_in_db",
"django.contrib.auth.get_user_model",
"action.models.Action.objects.get",
"dataops.pandas_db.load_from_db",
"django_auth_lti.decorators.lti_role_required",
"django.http.HttpResponse",
"django.core.signing.loads",
"django.shortcuts.redir... | [((1059, 1103), 'django_auth_lti.decorators.lti_role_required', 'lti_role_required', (["['Instructor', 'Student']"], {}), "(['Instructor', 'Student'])\n", (1076, 1103), False, 'from django_auth_lti.decorators import lti_role_required\n'), ((993, 1019), 'django.shortcuts.redirect', 'redirect', (['"""workflow:index"""'],... |
#!/usr/bin/env python3
from setuptools import setup, find_packages
setup (
name='ash',
version='dev',
description='ash is a Markov chain based random poetry generator.',
author='<NAME>',
author_email='<EMAIL>',
url='https://github.com/isaac-rks/ash',
packages=['ash'],
package_data={'as... | [
"setuptools.setup"
] | [((69, 384), 'setuptools.setup', 'setup', ([], {'name': '"""ash"""', 'version': '"""dev"""', 'description': '"""ash is a Markov chain based random poetry generator."""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""https://github.com/isaac-rks/ash"""', 'packages': "['ash']", 'package_data': "{'... |
from fuzzywuzzy import fuzz
import jellyfish
from core.models import action
from core import auth, db, helpers
class _fuzzymatchString(action._action):
checkString = str()
matchString = str()
def run(self,data,persistentData,actionResult):
checkString = helpers.evalString(self.checkString,{"data" ... | [
"fuzzywuzzy.fuzz.ratio",
"core.helpers.evalList",
"core.helpers.evalString",
"jellyfish.match_rating_comparison"
] | [((276, 328), 'core.helpers.evalString', 'helpers.evalString', (['self.checkString', "{'data': data}"], {}), "(self.checkString, {'data': data})\n", (294, 328), False, 'from core import auth, db, helpers\n'), ((351, 403), 'core.helpers.evalString', 'helpers.evalString', (['self.matchString', "{'data': data}"], {}), "(s... |
#! /usr/bin/python
#===============================================================================
# File Name : .py
# Date : 12-20-2015
# Input Files : Nil
# Author : Satheesh <<EMAIL>>
# Description : This file just interfaces to neo4J and brings you the handle so that multiple files can... | [
"globalS.dictDb.update",
"tweepy.Cursor",
"tweepy.API",
"loggerRecord.get_logger",
"tweepy.OAuthHandler"
] | [((442, 467), 'loggerRecord.get_logger', 'loggerRecord.get_logger', ([], {}), '()\n', (465, 467), False, 'import loggerRecord, globalS\n'), ((839, 874), 'globalS.dictDb.update', 'globalS.dictDb.update', (['oAuthStrings'], {}), '(oAuthStrings)\n', (860, 874), False, 'import loggerRecord, globalS\n'), ((1087, 1182), 'twe... |
from abcust.celery import app
from abcust.tasks import audrey
from abcust.tasks import cathy
from abcust.tasks import slack
@app.task
def get_awair_inbox_items():
return cathy.get_inbox_items_batch()
@app.task
def turn_off_aircon_when_cold():
COLD_THRESHOLD = 21
message = '너무 춥지 않은지 체크합니다.'
slack.wr... | [
"abcust.tasks.audrey.turn_off.delay",
"abcust.tasks.cathy.get_inbox_items_batch",
"abcust.tasks.slack.write.delay",
"abcust.tasks.cathy.get_score"
] | [((176, 205), 'abcust.tasks.cathy.get_inbox_items_batch', 'cathy.get_inbox_items_batch', ([], {}), '()\n', (203, 205), False, 'from abcust.tasks import cathy\n'), ((312, 380), 'abcust.tasks.slack.write.delay', 'slack.write.delay', (['"""A. B. Cust"""', '"""danger"""'], {'message': 'message', 'log': '(True)'}), "('A. B.... |
#! /usr/bin/env python3
import numpy as np
FIRST_VALUE = 1
NVALUES = 16
LAST_VALUE = FIRST_VALUE + NVALUES
PACKET_LEN = 4
fin = open('input.txt', 'w') # 入力ファイル
fr11 = open('r11.txt', 'w') # 比較ファイル
fr12 = open('r12.txt', 'w') # 比較ファイル
fr22 = open('r22.txt', 'w') # 比較ファイル
fqt11 = open('qt11.txt', 'w') # 比較ファイル
fqt12 = ... | [
"numpy.array",
"numpy.linalg.qr"
] | [((437, 463), 'numpy.array', 'np.array', (['[[1, 2], [3, 4]]'], {}), '([[1, 2], [3, 4]])\n', (445, 463), True, 'import numpy as np\n'), ((471, 497), 'numpy.array', 'np.array', (['[[1, 2], [3, 9]]'], {}), '([[1, 2], [3, 9]])\n', (479, 497), True, 'import numpy as np\n'), ((505, 535), 'numpy.array', 'np.array', (['[[21, ... |