code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import frappe
from urllib.request import Request, urlopen
from urllib.error import URLError, HTTPError
import json
def communicate_with_uts(servicepath, servicerequestdatafields):
url = ""
company = frappe.defaults.get_user_default("Company")
# This should only be used if the integration is enabled
if... | [
"frappe.defaults.get_user_default",
"frappe.db.get_value",
"frappe.db.get_single_value",
"urllib.request.Request",
"frappe.whitelist",
"urllib.request.urlopen"
] | [((2258, 2276), 'frappe.whitelist', 'frappe.whitelist', ([], {}), '()\n', (2274, 2276), False, 'import frappe\n'), ((209, 252), 'frappe.defaults.get_user_default', 'frappe.defaults.get_user_default', (['"""Company"""'], {}), "('Company')\n", (241, 252), False, 'import frappe\n'), ((2320, 2393), 'frappe.db.get_single_va... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Third-party imports...
#from nose.tools import assert_true
# This test module is in development...
import sys
import os.path
folder = os.path.basename(os.path.dirname(os.path.abspath(__file__)))
if folder == "tests": # testing from within WingIDE, default folder is t... | [
"unittest.main",
"subprocess.run",
"sys.path.append"
] | [((329, 355), 'sys.path.append', 'sys.path.append', (['"""../libs"""'], {}), "('../libs')\n", (344, 355), False, 'import sys\n'), ((360, 388), 'sys.path.append', 'sys.path.append', (['"""../config"""'], {}), "('../config')\n", (375, 388), False, 'import sys\n'), ((393, 421), 'sys.path.append', 'sys.path.append', (['"""... |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('certificates', '0012_certificategenerationcoursesetting_include_hours_of_effort'),
]
operations = [
migrations.RemoveField(
model_name='certificategenerationcoursesetting',
... | [
"django.db.migrations.RemoveField"
] | [((223, 314), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""certificategenerationcoursesetting"""', 'name': '"""enabled"""'}), "(model_name='certificategenerationcoursesetting',\n name='enabled')\n", (245, 314), False, 'from django.db import migrations\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 25 14:36:02 2021
@author: endocv202<EMAIL>
"""
# import network
import os
import os.path as osp
import argparse
import numpy as np
import torch
import torch.nn as nn
from PIL import Image
import skimage
from skimage import io
from skimage.transfor... | [
"models.get_model.get_arch",
"os.path.exists",
"torch.cuda.Event",
"os.listdir",
"numpy.mean",
"PIL.Image.open",
"argparse.ArgumentParser",
"numpy.sort",
"os.path.join",
"torch.cuda.synchronize",
"skimage.io.imread",
"torch.cuda.is_available",
"os.mkdir",
"torchvision.transforms.Normalize"... | [((708, 746), 'os.path.join', 'os.path.join', (['directoryName', 'task_type'], {}), '(directoryName, task_type)\n', (720, 746), False, 'import os\n'), ((814, 834), 'os.listdir', 'os.listdir', (['infolder'], {}), '(infolder)\n', (824, 834), False, 'import os\n'), ((1006, 1020), 'numpy.sort', 'np.sort', (['flist'], {}), ... |
import time
import json
import requests
current_collaborators = []
def generate():
res = requests.get('http://127.0.0.1:8000/generatePayload')
assert res.status_code == 200, "generate Error"
payload_full = res.text
return payload_full
# expect jsonlines with DNS records
def collect(payload):
res... | [
"time.sleep",
"requests.get",
"sys.stdout.flush",
"time.time",
"sys.stdout.write"
] | [((96, 149), 'requests.get', 'requests.get', (['"""http://127.0.0.1:8000/generatePayload"""'], {}), "('http://127.0.0.1:8000/generatePayload')\n", (108, 149), False, 'import requests\n'), ((640, 651), 'time.time', 'time.time', ([], {}), '()\n', (649, 651), False, 'import time\n'), ((1087, 1100), 'time.sleep', 'time.sle... |
import click
# import utils
import utils.file as file_utils
import utils.language as lang_utils
"""
Copyright 2019 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http:... | [
"utils.file.create_file_with_license_notice",
"click.argument",
"utils.language.is_supported_language",
"utils.file.check_license_notice",
"click.echo",
"utils.file.create_empty_file",
"utils.file.create_license",
"click.command"
] | [((692, 707), 'click.command', 'click.command', ([], {}), '()\n', (705, 707), False, 'import click\n'), ((709, 746), 'click.argument', 'click.argument', (['"""file_name"""'], {'type': 'str'}), "('file_name', type=str)\n", (723, 746), False, 'import click\n'), ((881, 908), 'utils.file.create_license', 'file_utils.create... |
from operator import mul
import sys
import matplotlib.pyplot as plt
import numpy as np
from holoviews import opts
from scipy.signal.ltisys import dfreqresp
from scipy.spatial import Voronoi
from sklearn.cluster import KMeans
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA
from skl... | [
"IPython.display.display",
"sklearn.feature_selection.VarianceThreshold",
"holoviews.Graph.from_networkx",
"io.open",
"pandas.Index",
"matplotlib.pyplot.annotate",
"numpy.array",
"holoviews.opts.EdgePaths",
"sys.exit",
"seaborn.pairplot",
"pandas.to_datetime",
"pandas.date_range",
"pandas.re... | [((1152, 1174), 'seaborn.set', 'sns.set', ([], {'style': '"""ticks"""'}), "(style='ticks')\n", (1159, 1174), True, 'import seaborn as sns\n'), ((1175, 1196), 'holoviews.extension', 'hv.extension', (['"""bokeh"""'], {}), "('bokeh')\n", (1187, 1196), True, 'import holoviews as hv\n'), ((3500, 3563), 'matplotlib.pyplot.sc... |
# Generated by Django 2.0.6 on 2018-07-13 20:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('marketplace', '0027_projectscope'),
]
operations = [
migrations.AddField(
model_name='projectscope',
name='available... | [
"django.db.models.TextField",
"django.db.models.CharField"
] | [((346, 570), 'django.db.models.TextField', 'models.TextField', ([], {'blank': '(True)', 'help_text': '"""Describe the data available to use for this project. (Size, variables, completeness, availability, privacy, etc.)"""', 'max_length': '(5000)', 'null': '(True)', 'verbose_name': '"""Available data"""'}), "(blank=Tru... |
import functools
from typing import Any, Callable, TypeVar, Union, overload
from unittest import TestCase
from puma.context import Exit_1, Exit_2, Exit_3
from puma.helpers.testing.logging.capture_logs import CaptureLogs
from puma.logging import LogLevel
RT = TypeVar('RT') # _return type
@overload # noqa: F811
def... | [
"functools.wraps",
"typing.TypeVar"
] | [((261, 274), 'typing.TypeVar', 'TypeVar', (['"""RT"""'], {}), "('RT')\n", (268, 274), False, 'from typing import Any, Callable, TypeVar, Union, overload\n'), ((2165, 2186), 'functools.wraps', 'functools.wraps', (['func'], {}), '(func)\n', (2180, 2186), False, 'import functools\n')] |
import json
import os
import shutil
import stat
import tarfile
import urllib
import subprocess
import docker
from requirementslib import Requirement
from tqdm import tqdm
from .release import get_release
class NoReleaseCandidate(Exception):
def __init__(self, requirement):
super(NoReleaseCandidate, sel... | [
"tarfile.open",
"os.getuid",
"docker.APIClient",
"os.remove",
"os.listdir",
"urllib.request.urlretrieve",
"shutil.copy2",
"subprocess.Popen",
"os.chmod",
"os.path.isdir",
"os.popen",
"os.getgid",
"json.loads",
"requirementslib.Requirement.from_line",
"os.makedirs",
"tqdm.tqdm",
"os.e... | [((3521, 3571), 'urllib.request.urlretrieve', 'urllib.request.urlretrieve', (['url', 'download_filename'], {}), '(url, download_filename)\n', (3547, 3571), False, 'import urllib\n'), ((3582, 3621), 'tarfile.open', 'tarfile.open', (['download_filename', '"""r:gz"""'], {}), "(download_filename, 'r:gz')\n", (3594, 3621), ... |
# -*- coding: utf-8 -*-
# pragma pylint: disable=unused-argument, no-self-use
#
# (c) Copyright IBM Corp. 2010, 2018. All Rights Reserved.
#
"""
MlBernoulliNB
-------------
A machine learning model that uses the scikit-learn Bernoulli Naive Bayes algorithm.
https://scikit-learn.org/stable/modules/genera... | [
"sklearn.ensemble.AdaBoostClassifier",
"fn_machine_learning.lib.ml_model_common.MlModelCommon.__init__",
"sklearn.ensemble.BaggingClassifier",
"sklearn.naive_bayes.BernoulliNB.__init__",
"sklearn.naive_bayes.BernoulliNB",
"pandas.DataFrame"
] | [((919, 1045), 'fn_machine_learning.lib.ml_model_common.MlModelCommon.__init__', 'MlModelCommon.__init__', (['self'], {'imbalance_upsampling': 'imbalance_upsampling', 'class_weight': 'class_weight', 'method': 'method', 'log': 'log'}), '(self, imbalance_upsampling=imbalance_upsampling,\n class_weight=class_weight, me... |
from app import logger, engine, parser
from app.utilities import export_db_to_excel, create_dataframe_from_sql, resolve_domains, export_to_excel, \
check_valid_domain_name
from app.get_certs import get_cert_ids_by_org, parse_domains_and_update_certsmasterdb, get_cert_by_domain_name
from app.filter import filter_dom... | [
"app.utilities.check_valid_domain_name",
"app.get_certs.parse_domains_and_update_certsmasterdb",
"app.globalvars.input_phrase.rstrip",
"app.utilities.resolve_domains",
"app.get_certs.get_cert_by_domain_name",
"app.logger.debug",
"app.get_certs.get_cert_ids_by_org",
"app.utilities.export_db_to_excel",
... | [((6435, 6487), 'app.logger.info', 'logger.info', (['"""Cert Stash has finished processing..."""'], {}), "('Cert Stash has finished processing...')\n", (6446, 6487), False, 'from app import logger, engine, parser\n'), ((6488, 6510), 'app.logger.info', 'logger.info', (['"""Done!\n"""'], {}), "('Done!\\n')\n", (6499, 651... |
from experiments.eval_utils import eval_gpc_detector
import pandas as pd
import argparse
import time
import os
if __name__ == "__main__":
parser = argparse.ArgumentParser()
# Required arguments with reasonable default values
parser.add_argument("--dresden_dir", required=True, type=str, help="Path to folde... | [
"os.path.exists",
"argparse.ArgumentParser",
"experiments.eval_utils.eval_gpc_detector",
"time.strftime",
"os.path.join",
"os.mkdir",
"pandas.DataFrame"
] | [((153, 178), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (176, 178), False, 'import argparse\n'), ((728, 753), 'experiments.eval_utils.eval_gpc_detector', 'eval_gpc_detector', ([], {}), '(**args)\n', (745, 753), False, 'from experiments.eval_utils import eval_gpc_detector\n'), ((770, 792), ... |
#!/usr/bin/env python3
import logging
import os
import re
import sys
import traceback
from github3.exceptions import ForbiddenError
from github3 import login
from github3.repos.status import Status
try:
GITHUB_API_TOKEN = os.environ['GITHUB_API_TOKEN']
ORGANIZATION = os.environ['ORGANIZATION']
# PROJECT-... | [
"logging.getLogger",
"logging.StreamHandler",
"os.environ.get",
"github3.login",
"sys.exit"
] | [((648, 675), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (665, 675), False, 'import logging\n'), ((717, 750), 'logging.StreamHandler', 'logging.StreamHandler', (['sys.stdout'], {}), '(sys.stdout)\n', (738, 750), False, 'import logging\n'), ((374, 462), 'os.environ.get', 'os.environ.ge... |
import datetime
import pandas as pd
import numpy as np
from edgar3 import edgar_index
def get_13f_listings(date: datetime.datetime, populate: bool) -> pd.DataFrame:
ed_i = edgar_index.edgar_index()
df = ed_i.get_full_listing_as_pd(date)
df = df[df["Form Type"].isin(["13F-HR", "13F-HR/A", "13F-NT", "13F-NT... | [
"edgar3.edgar_index.edgar_index"
] | [((178, 203), 'edgar3.edgar_index.edgar_index', 'edgar_index.edgar_index', ([], {}), '()\n', (201, 203), False, 'from edgar3 import edgar_index\n')] |
import glob
from doitpy.pyflakes import Pyflakes
from doitpy import docs
from doitpy.package import Package
DOIT_CONFIG = {'default_tasks': ['pyflakes',]}
def task_pyflakes():
flakes = Pyflakes()
yield flakes.tasks('*.py')
yield flakes.tasks('tests/*.py')
CODE_FILES = glob.glob("pytest_incremental.... | [
"doitpy.docs.spell",
"doitpy.pyflakes.Pyflakes",
"doitpy.package.Package",
"glob.glob"
] | [((290, 324), 'glob.glob', 'glob.glob', (['"""pytest_incremental.py"""'], {}), "('pytest_incremental.py')\n", (299, 324), False, 'import glob\n'), ((338, 366), 'glob.glob', 'glob.glob', (['"""tests/test_*.py"""'], {}), "('tests/test_*.py')\n", (347, 366), False, 'import glob\n'), ((195, 205), 'doitpy.pyflakes.Pyflakes'... |
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import numpy as np
# part 1
with open('input.txt') as f:
lines = f.readlines()
# [horizontal_pos, depth]
loc = np.array([0,0])
# [horizontal_pos, depth]
command = {'forward': np.array([1, 0]),
... | [
"numpy.array"
] | [((210, 226), 'numpy.array', 'np.array', (['[0, 0]'], {}), '([0, 0])\n', (218, 226), True, 'import numpy as np\n'), ((665, 684), 'numpy.array', 'np.array', (['[0, 0, 0]'], {}), '([0, 0, 0])\n', (673, 684), True, 'import numpy as np\n'), ((288, 304), 'numpy.array', 'np.array', (['[1, 0]'], {}), '([1, 0])\n', (296, 304),... |
import pickle
import os
import numpy as np
import torch
import warnings
from tqdm import tqdm
from Metrics import evaluateTracking
from dataset.dataLoader import Data_Loader_MOT
from network.tubetk import TubeTK
from post_processing.tube_nms import multiclass_nms
from apex import amp
import argparse
import multiprocess... | [
"apex.amp.initialize",
"torch.distributed.is_available",
"torch.distributed.barrier",
"os.path.exists",
"os.listdir",
"argparse.ArgumentParser",
"numpy.concatenate",
"dataset.dataLoader.Data_Loader_MOT",
"network.tubetk.TubeTK",
"torch.nn.parallel.DistributedDataParallel",
"torch.distributed.get... | [((426, 459), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (449, 459), False, 'import warnings\n'), ((751, 785), 'torch.distributed.get_world_size', 'torch.distributed.get_world_size', ([], {}), '()\n', (783, 785), False, 'import torch\n'), ((829, 856), 'torch.distribute... |
from Child import Child
from Node import Node # noqa: I201
# These nodes are used only in code completion.
COMPLETIONONLY_NODES = [
# type
Node('CodeCompletionType', kind='Type',
children=[
Child('Base', kind='Type', is_optional=True),
Child('Period', kind='Token',
... | [
"Child.Child"
] | [((223, 267), 'Child.Child', 'Child', (['"""Base"""'], {'kind': '"""Type"""', 'is_optional': '(True)'}), "('Base', kind='Type', is_optional=True)\n", (228, 267), False, 'from Child import Child\n'), ((282, 385), 'Child.Child', 'Child', (['"""Period"""'], {'kind': '"""Token"""', 'token_choices': "['PeriodToken', 'Prefix... |
import matplotlib.pyplot as py
import numpy as np
import torch
from torch import nn, tensor,optim
import torch.nn.functional as F
from torchvision import datasets, transforms, models
import argparse
import helper
arg = argparse.ArgumentParser(description='Train.py')
# Command Line ardguments
arg.add_argument('data_d... | [
"helper.train_network",
"helper.netwk_setup",
"argparse.ArgumentParser",
"helper.load_data",
"helper.validation_data_set",
"helper.save_checkpoint"
] | [((221, 268), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Train.py"""'}), "(description='Train.py')\n", (244, 268), False, 'import argparse\n'), ((1261, 1287), 'helper.load_data', 'helper.load_data', (['from_loc'], {}), '(from_loc)\n', (1277, 1287), False, 'import helper\n'), ((1318, ... |
# -*- encoding: utf-8 -*-
import argparse
import logging
import sys
from ..video import main
VIDEO_PARSER = argparse.ArgumentParser(add_help=False)
VIDEO_PARSER.add_argument('-V', '--video-device', help='Video device ID '
'(default=%(default)s).', type=int, default=0)
VIDEO_PARSER.... | [
"logging.basicConfig",
"argparse.ArgumentParser"
] | [((117, 156), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'add_help': '(False)'}), '(add_help=False)\n', (140, 156), False, 'import argparse\n'), ((671, 764), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""DropBot chip video viewer"""', 'parents': '[VIDEO_PARSER]'}), "(de... |
#!/usr/bin/env python3
from typing import Any
from typeguard import check_type
from pynft.meta import OBJ_BASE
from pynft.exceptions import PyNFTException
from pynft.enumerations import CHAIN_PRIORITY
class NFT_OBJ(OBJ_BASE):
objname : str = ""
def bake(self, other:list=None):
subres = None
tobake = other i... | [
"typeguard.check_type"
] | [((1438, 1478), 'typeguard.check_type', 'check_type', (['field', 'attribute', 'field_type'], {}), '(field, attribute, field_type)\n', (1448, 1478), False, 'from typeguard import check_type\n')] |
import unittest2
from nose.plugins.attrib import attr
from nose.tools import assert_equals
@attr('test_nose_plugin')
class TestNosePlugin(unittest2.TestCase):
@classmethod
def setUpClass(cls):
raise Exception("error")
def test_one(self):
"""first test, simulation passing test"""
a... | [
"nose.tools.assert_equals",
"nose.plugins.attrib.attr"
] | [((94, 118), 'nose.plugins.attrib.attr', 'attr', (['"""test_nose_plugin"""'], {}), "('test_nose_plugin')\n", (98, 118), False, 'from nose.plugins.attrib import attr\n'), ((319, 338), 'nose.tools.assert_equals', 'assert_equals', (['(1)', '(1)'], {}), '(1, 1)\n', (332, 338), False, 'from nose.tools import assert_equals\n... |
import cv2
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime
from mpl_toolkits.mplot3d import Axes3D
# Initialize webcam input
cap = cv2.VideoCapture(0)
# Initialize video input
####BSL Corpus#####
#cap = cv2.VideoCapture("C:/Users/liangx/Desktop/Trajectoreis_test/BSL Corpus Data Resul... | [
"cv2.rectangle",
"matplotlib.pyplot.ylabel",
"cv2.imshow",
"numpy.array",
"cv2.destroyAllWindows",
"cv2.CascadeClassifier",
"cv2.erode",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"cv2.line",
"cv2.contourArea",
"cv2.waitKey",
"cv2.drawContours",
"numpy.ones",
"matplotlib.pyplo... | [((165, 184), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (181, 184), False, 'import cv2\n'), ((1324, 1429), 'cv2.VideoCapture', 'cv2.VideoCapture', (['"""C:/Users/liangx/Documents/Dunhill Project Data/Single Sign/Stomach/FARM.mp4"""'], {}), "(\n 'C:/Users/liangx/Documents/Dunhill Project Data/Si... |
import backtrader.indicators as btind
from . import compare_price as compare
from .base_indicator import iBaseIndicator
class iMomentumCompare(iBaseIndicator):
'''
因子:平均移动线比较数值
传入参数:
rule = {"args": ["5"], #ema周期
"logic":{"compare": "eq","byValue": 1,"byMax": 5,}, # 周期结果比较
... | [
"backtrader.indicators.Momentum",
"backtrader.indicators.CrossOver"
] | [((486, 538), 'backtrader.indicators.Momentum', 'btind.Momentum', (['self.data.close'], {'period': 'self.args[0]'}), '(self.data.close, period=self.args[0])\n', (500, 538), True, 'import backtrader.indicators as btind\n'), ((1109, 1161), 'backtrader.indicators.Momentum', 'btind.Momentum', (['self.data.close'], {'period... |
from selenium import webdriver
import time
from selenium.webdriver.support.ui import Select
driver= webdriver.Firefox()
driver.get("file:///C:/Users/Bhoomika%20Agarwal/Desktop/Exercise%20Files/CH03/03_02/html_code_03_02.html")
select= Select(driver.find_element_by_name('numReturnSelect'))
select.select_by_index(4)
ti... | [
"selenium.webdriver.Firefox",
"time.sleep"
] | [((101, 120), 'selenium.webdriver.Firefox', 'webdriver.Firefox', ([], {}), '()\n', (118, 120), False, 'from selenium import webdriver\n'), ((318, 331), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (328, 331), False, 'import time\n'), ((369, 382), 'time.sleep', 'time.sleep', (['(2)'], {}), '(2)\n', (379, 382), Fa... |
import ipaddress
import pytest
from ipset import parse_ipdeny
from .util import open_test_file
def test_valid() -> None:
with open_test_file("ipdeny/valid.zone") as text_input:
assert list(parse_ipdeny(text_input)) == [ipaddress.IPv4Network("127.0.0.0/24")]
def test_error() -> None:
with open_test_f... | [
"ipset.parse_ipdeny",
"ipaddress.IPv4Network",
"pytest.raises"
] | [((375, 400), 'pytest.raises', 'pytest.raises', (['ValueError'], {}), '(ValueError)\n', (388, 400), False, 'import pytest\n'), ((203, 227), 'ipset.parse_ipdeny', 'parse_ipdeny', (['text_input'], {}), '(text_input)\n', (215, 227), False, 'from ipset import parse_ipdeny\n'), ((233, 270), 'ipaddress.IPv4Network', 'ipaddre... |
"""
Ruggedising the duo piano
Wake Up:
detect duopiano connection
send midi message ( which?) to
Duo-piano
while port:
# Keep awake?
send keep_alive
"""
DUO_PIANO_STRING = "GENERAL:GENERAL MIDI 1"
import time
import rtmidi
import logging
log = logging.getLogger('duo_piano_mi... | [
"logging.getLogger",
"logging.basicConfig",
"rtmidi.MidiIn",
"rtmidi.MidiOut",
"time.sleep",
"time.time"
] | [((289, 324), 'logging.getLogger', 'logging.getLogger', (['"""duo_piano_midi"""'], {}), "('duo_piano_midi')\n", (306, 324), False, 'import logging\n'), ((325, 365), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (344, 365), False, 'import logging\n'), ((3286, ... |
#!/usr/bin/env python
"""
The VLBA Continuum Pipeline. The pipeline can be invoked from the command line
as, ::
$ VLBAContPipe AipsSetupScript PipelineParamScript
where the required arguments are
* *AipsSetupScript* = an AIPS setup script (an example of this file is stored in
``Obit/share/scripts``)
* *Pi... | [
"logging.getLogger",
"OErr.PInit",
"logging.basicConfig",
"six.moves.range",
"IDIFix.IDIFix",
"OErr.printErr",
"optparse.OptionParser",
"OSystem.Shutdown",
"logging.shutdown",
"logging.config.fileConfig",
"UV.newPAUV",
"sys.exit",
"OErr.printErrMsg",
"UV.PIsA"
] | [((861, 902), 'logging.config.fileConfig', 'logging.config.fileConfig', (['"""logging.conf"""'], {}), "('logging.conf')\n", (886, 902), False, 'import sys, pydoc, logging, logging.config\n'), ((916, 957), 'logging.getLogger', 'logging.getLogger', (['"""obitLog.VLBAContPipe"""'], {}), "('obitLog.VLBAContPipe')\n", (933,... |
import os
import yaml
def load_configuration(dir_path):
'''
Loads the other configuration from {dir_path}/other-configuration.yaml, returning a dict
'''
configuration_path = os.path.join(dir_path, 'other-configuration.yaml')
with open(configuration_path, 'r') as configure_yaml:
configuration = yaml.load(... | [
"os.path.exists",
"os.path.join",
"yaml.load",
"os.chdir",
"os.path.isfile",
"os.system"
] | [((183, 233), 'os.path.join', 'os.path.join', (['dir_path', '"""other-configuration.yaml"""'], {}), "(dir_path, 'other-configuration.yaml')\n", (195, 233), False, 'import os\n'), ((1261, 1279), 'os.chdir', 'os.chdir', (['dir_path'], {}), '(dir_path)\n', (1269, 1279), False, 'import os\n'), ((1523, 1541), 'os.system', '... |
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import numpy as np
data = np.loadtxt("sample.dat")
mean = data.mean()
sigma = data.std()
x = np.linspace(data.min(), data.max(), 100)
y = np.exp(-0.5 * ((x -mean)/sigma)**2)
y = y/(np.sqrt(2.0* np.pi * sigma**2))
plt.hist(data, alpha=0.5, bin... | [
"matplotlib.pyplot.savefig",
"numpy.sqrt",
"matplotlib.pyplot.ylabel",
"matplotlib.use",
"matplotlib.pyplot.xlabel",
"numpy.exp",
"numpy.loadtxt",
"matplotlib.pyplot.legend"
] | [((18, 39), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (32, 39), False, 'import matplotlib\n'), ((100, 124), 'numpy.loadtxt', 'np.loadtxt', (['"""sample.dat"""'], {}), "('sample.dat')\n", (110, 124), True, 'import numpy as np\n'), ((214, 254), 'numpy.exp', 'np.exp', (['(-0.5 * ((x - mean) / s... |
# *****************************************************************************
#
# Copyright (c) 2021, the pyEX authors.
#
# This file is part of the pyEX library, distributed under the terms of
# the Apache License 2.0. The full license can be found in the LICENSE file.
#
from functools import wraps
import json
impo... | [
"json.dumps",
"functools.wraps"
] | [((4501, 4517), 'functools.wraps', 'wraps', (['queryMeta'], {}), '(queryMeta)\n', (4506, 4517), False, 'from functools import wraps\n'), ((5510, 5522), 'functools.wraps', 'wraps', (['query'], {}), '(query)\n', (5515, 5522), False, 'from functools import wraps\n'), ((7120, 7139), 'functools.wraps', 'wraps', (['listDatas... |
#!/usr/bin/env python
"""This is the module that holds the GUI for the Activity Logger.
Classes:
ActivityLoggerGUI:
The class for the GUI for the Activity Logger.
You have to create an instance (no arguments taken) and then call show() on it to show the window.
Functions:
show_window() -> No... | [
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtWidgets.QTextEdit",
"library.get_filename_no_extension",
"PyQt5.QtWidgets.QHBoxLayout",
"os.getcwd",
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QApplication",
"PyQt5.QtWidgets.QVBoxLayout",
"PyQt5.QtGui.QKeySequence",
"library.write_entry",
"PyQt5.QtWidgets.QP... | [((6169, 6191), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['sys.argv'], {}), '(sys.argv)\n', (6181, 6191), False, 'from PyQt5.QtWidgets import QMainWindow, QApplication, QVBoxLayout, QHBoxLayout, QWidget, QShortcut\n'), ((1515, 1537), 'PyQt5.QtWidgets.QLabel', 'QtWidgets.QLabel', (['self'], {}), '(self)\n', (153... |
#!/usr/bin/env python
import argparse
import requests
import re
import json
from bs4 import BeautifulSoup
parser = argparse.ArgumentParser()
parser.add_argument('domains', metavar='D', type=str, nargs='+',
help='Domain to query')
parser.add_argument('--wildcard', '-w', action='store_true', help='... | [
"json.loads",
"requests.Session",
"argparse.ArgumentParser"
] | [((118, 143), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (141, 143), False, 'import argparse\n'), ((418, 436), 'requests.Session', 'requests.Session', ([], {}), '()\n', (434, 436), False, 'import requests\n'), ((590, 617), 'json.loads', 'json.loads', (['query_json.text'], {}), '(query_json.... |
import copy
from tqdm import tqdm
file = open('input.txt', 'r')
input = file.read().split(',')
turns = input + ['0']
turns_minus_last = copy.copy(input)
for i in range(len(turns), 2020):
if turns[i-1] in turns_minus_last:
turns.append(str((i) - (len(turns_minus_last) - turns_minus_last[::-1].index(turns[i... | [
"copy.copy"
] | [((137, 153), 'copy.copy', 'copy.copy', (['input'], {}), '(input)\n', (146, 153), False, 'import copy\n')] |
import requests
import sys
import json
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
fhir_server_uri = sys.argv[1]
token = sys.argv[2]
json_file_path = sys.argv[3]
headers = {'Authorization' : "Bearer " + token, 'Accept' : 'application/json', 'Content-Type' : 'application/jso... | [
"json.load",
"urllib3.disable_warnings",
"json.dumps"
] | [((55, 122), 'urllib3.disable_warnings', 'urllib3.disable_warnings', (['urllib3.exceptions.InsecureRequestWarning'], {}), '(urllib3.exceptions.InsecureRequestWarning)\n', (79, 122), False, 'import urllib3\n'), ((381, 401), 'json.load', 'json.load', (['json_file'], {}), '(json_file)\n', (390, 401), False, 'import json\n... |
import os, sys
sys.path.append(os.path.dirname(os.path.realpath(f'{__file__}/..')))
import pathlib
import numpy as np
from time import sleep
from src.GymEnvs import GiadogEnv, TerrainScene, QuadrupedRobot, GiadogEasyEnv
from src.__env__ import CONTROLLER_LATENCY_STEPS, GRAVITY_VECTOR, \
HISTORIAL_DATA, NON_PRIV... | [
"pathlib.Path",
"matplotlib.pyplot.plot",
"src.simulation.hills",
"src.GymEnvs.QuadrupedRobot",
"os.path.realpath",
"src.GymEnvs.TerrainScene",
"numpy.array",
"numpy.zeros",
"numpy.random.uniform",
"pybullet_utils.bullet_client.BulletClient",
"matplotlib.pyplot.show"
] | [((1048, 1088), 'pybullet_utils.bullet_client.BulletClient', 'bullet_client.BulletClient', (['pybullet.GUI'], {}), '(pybullet.GUI)\n', (1074, 1088), False, 'from pybullet_utils import bullet_client\n'), ((1098, 1199), 'src.GymEnvs.QuadrupedRobot', 'QuadrupedRobot', (['quadruped_urdf', 'client', 'UPDATE_METHODS', 'STATE... |
# 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
from .. import _utilitie... | [
"pulumi.get",
"pulumi.getter",
"pulumi.set",
"pulumi.InvokeOptions",
"pulumi.runtime.invoke"
] | [((4226, 4259), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""accountName"""'}), "(name='accountName')\n", (4239, 4259), False, 'import pulumi\n'), ((4426, 4458), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""autoScales"""'}), "(name='autoScales')\n", (4439, 4458), False, 'import pulumi\n'), ((5017, 5062), ... |
import unittest
import xr
class TestBool(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_bool(self):
self.assertTrue(True)
self.assertFalse(False)
self.assertTrue(xr.TRUE)
self.assertFalse(xr.FALSE)
self.assertTrue(xr.B... | [
"unittest.main",
"xr.Bool32"
] | [((409, 424), 'unittest.main', 'unittest.main', ([], {}), '()\n', (422, 424), False, 'import unittest\n'), ((316, 331), 'xr.Bool32', 'xr.Bool32', (['(True)'], {}), '(True)\n', (325, 331), False, 'import xr\n'), ((358, 374), 'xr.Bool32', 'xr.Bool32', (['(False)'], {}), '(False)\n', (367, 374), False, 'import xr\n')] |
import disnake
from disnake.ext import commands
import os
from keep_alive import keep_alive
intents = disnake.Intents.default()
intents.members = True
keep_alive()
testing = False
client = commands.Bot(
command_prefix = "m!",
case_insensitive = True,
intents=intents,
)
client.remove_command('help')
@c... | [
"os.listdir",
"disnake.Activity",
"os.environ.get",
"keep_alive.keep_alive",
"disnake.ext.commands.Bot",
"disnake.Intents.default"
] | [((103, 128), 'disnake.Intents.default', 'disnake.Intents.default', ([], {}), '()\n', (126, 128), False, 'import disnake\n'), ((153, 165), 'keep_alive.keep_alive', 'keep_alive', ([], {}), '()\n', (163, 165), False, 'from keep_alive import keep_alive\n'), ((193, 266), 'disnake.ext.commands.Bot', 'commands.Bot', ([], {'c... |
import copy
import collections
import itertools
import core.attributes as attributes
import core.properties as properties
from core.exceptions import WrongArityError
from core.TOS import _TOS
class BaseExpression( object ):
def __init__( self, children = [], line = -1 ):
self.head = self.__class__
... | [
"itertools.permutations",
"copy.copy",
"core.TOS._TOS.register"
] | [((19833, 19852), 'core.TOS._TOS.register', '_TOS.register', (['self'], {}), '(self)\n', (19846, 19852), False, 'from core.TOS import _TOS\n'), ((24644, 24658), 'copy.copy', 'copy.copy', (['ctx'], {}), '(ctx)\n', (24653, 24658), False, 'import copy\n'), ((26980, 26994), 'copy.copy', 'copy.copy', (['ctx'], {}), '(ctx)\n... |
import os
from datetime import datetime
from src.domain.model_couple import solve_couples
from src.services.csv_reader import CsvReader
from src.domain.solver import solve_routes
### Should
# HOTELS_DATA_FILE = os.path.join(os.path.dirname(__file__), '..', 'data', 'hotels-generalites.csv')
# EMPLOYEES_DATA_FILE = os... | [
"datetime.datetime.strptime",
"os.path.dirname",
"src.services.csv_reader.CsvReader",
"src.domain.solver.solve_routes",
"src.domain.model_couple.solve_couples"
] | [((448, 473), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (463, 473), False, 'import os\n'), ((560, 585), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (575, 585), False, 'import os\n'), ((665, 676), 'src.services.csv_reader.CsvReader', 'CsvReader', ([], {}), '(... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# pip install Pillow
from PIL import Image
image_file = "blur/input.jpg"
img = Image.open(image_file)
cropped_img = img.crop((175, 42, 336, 170))
cropped_img.show()
| [
"PIL.Image.open"
] | [((155, 177), 'PIL.Image.open', 'Image.open', (['image_file'], {}), '(image_file)\n', (165, 177), False, 'from PIL import Image\n')] |
from unittest import TestCase
import numpy as np
import numpy.testing as npt
from cavsim.base.fluids.base_fluid import BaseFluid
class DummyFluid(BaseFluid):
def __init__(self, one, two, three=5):
super(DummyFluid, self).__init__(1, 2, 3, 4)
self._one = one
self._two = two
self._th... | [
"numpy.testing.assert_almost_equal",
"numpy.testing.assert_allclose",
"cavsim.base.fluids.base_fluid.BaseFluid",
"numpy.asarray"
] | [((1086, 1107), 'cavsim.base.fluids.base_fluid.BaseFluid', 'BaseFluid', (['(1)', '(2)', '(3)', '(4)'], {}), '(1, 2, 3, 4)\n', (1095, 1107), False, 'from cavsim.base.fluids.base_fluid import BaseFluid\n'), ((1935, 1962), 'cavsim.base.fluids.base_fluid.BaseFluid', 'BaseFluid', (['(9)', '(8)', '(7)', '(6)', '(5)', '(4)'],... |
import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt
import itertools
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import odeint
import scipy.integrate
from sklearn.metrics import mean_squared_error
from scipy.linalg import svd
from scipy.... | [
"sys.path.insert",
"numpy.sqrt",
"numpy.linalg.pinv",
"numpy.array",
"numpy.cov",
"numpy.arange",
"holoviews.extension",
"numpy.dot",
"loader.query",
"numpy.random.normal",
"loader.convert_dates",
"sklearn.metrics.mean_squared_error",
"loader.load_data",
"scipy.linalg.svd",
"git.Repo",
... | [((515, 536), 'holoviews.extension', 'hv.extension', (['"""bokeh"""'], {}), "('bokeh')\n", (527, 536), True, 'import holoviews as hv\n'), ((567, 613), 'git.Repo', 'git.Repo', (['"""./"""'], {'search_parent_directories': '(True)'}), "('./', search_parent_directories=True)\n", (575, 613), False, 'import git\n'), ((641, 7... |
import os
from .wooey_settings import *
# Whether to allow anonymous job submissions, set False to disallow 'guest' job submissions
WOOEY_ALLOW_ANONYMOUS = True
## Celery related options
INSTALLED_APPS += (
'django_celery_results',
)
WOOEY_CELERY = True
CELERY_RESULT_BACKEND = 'django-db'
CELERY_BROKER_URL = 'am... | [
"os.path.join",
"os.environ.get"
] | [((551, 589), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""user_uploads"""'], {}), "(BASE_DIR, 'user_uploads')\n", (563, 589), False, 'import os\n'), ((718, 750), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""static"""'], {}), "(BASE_DIR, 'static')\n", (730, 750), False, 'import os\n'), ((1220, 1260), 'os.envi... |
from preprocessing_utilities import create_and_save_uniques, load_uniques_create_dict_map, count_array_feature
from Scripts.utilities import start_correct_cluster, read_dataset, save_dataset, parse_args
from preprocessing_utilities import dict_path, temp_output_path, dataset_path
import numpy as np
import pyarrow as p... | [
"preprocessing_utilities.create_and_save_uniques",
"preprocessing_utilities.load_uniques_create_dict_map",
"pyarrow.uint8",
"Scripts.utilities.start_correct_cluster",
"preprocessing_utilities.count_array_feature",
"pyarrow.uint32",
"Scripts.utilities.read_dataset",
"Scripts.utilities.parse_args"
] | [((496, 508), 'Scripts.utilities.parse_args', 'parse_args', ([], {}), '()\n', (506, 508), False, 'from Scripts.utilities import start_correct_cluster, read_dataset, save_dataset, parse_args\n'), ((517, 568), 'Scripts.utilities.start_correct_cluster', 'start_correct_cluster', (['is_test'], {'use_processes': '(False)'}),... |
from io import StringIO
from django.test import TestCase
from django.test.utils import captured_stdin
from django.contrib.auth import get_user_model
from django.core.management import call_command
from django.core.management.base import CommandError
from core.test.test_base import TEST_EMAIL
from core.utils.generic_h... | [
"django.contrib.auth.get_user_model",
"django.core.management.call_command",
"forecast.models.ForecastMonthlyFigure.objects.filter",
"costcentre.models.ArchivedCostCentre.objects.filter",
"forecast.models.FinancialCode.objects.all",
"costcentre.models.CostCentre.objects.all",
"core.utils.generic_helpers... | [((681, 691), 'io.StringIO', 'StringIO', ([], {}), '()\n', (689, 691), False, 'from io import StringIO\n'), ((712, 732), 'end_of_month.test.test_utils.MonthlyFigureSetup', 'MonthlyFigureSetup', ([], {}), '()\n', (730, 732), False, 'from end_of_month.test.test_utils import MonthlyFigureSetup\n'), ((829, 857), 'core.util... |
__author__ = 'anushabala'
import time
import datetime
#import src.config as config
class Status(object):
Waiting = "waiting"
Chat = "chat"
Finished = "finished"
Survey = "survey"
Redirected = "redirected"
Incomplete = "incomplete"
Reporting = "reporting"
class UnexpectedStatusException(E... | [
"datetime.datetime.now"
] | [((1566, 1589), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (1587, 1589), False, 'import datetime\n')] |
""" Quandl Model """
__docformat__ = "numpy"
import logging
import pandas as pd
import quandl
from gamestonk_terminal import config_terminal as cfg
from gamestonk_terminal.decorators import log_start_end
logger = logging.getLogger(__name__)
@log_start_end(log=logger)
def get_short_interest(ticker: str, nyse: bool... | [
"logging.getLogger",
"quandl.get",
"gamestonk_terminal.decorators.log_start_end"
] | [((217, 244), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (234, 244), False, 'import logging\n'), ((248, 273), 'gamestonk_terminal.decorators.log_start_end', 'log_start_end', ([], {'log': 'logger'}), '(log=logger)\n', (261, 273), False, 'from gamestonk_terminal.decorators import log_st... |
import re
import numpy as np
import pandas as pd
from utils.tokens import filter_by_num_tokens, normalize_text
# Prepare the emotion categories by removing disabled and non-ascii categories
emotions_raw = pd.read_csv('../data/emotions.csv')
emotions_clean = emotions_raw[emotions_raw.enabled & emotions_raw.name.str.fu... | [
"utils.tokens.filter_by_num_tokens",
"pandas.read_csv",
"utils.tokens.normalize_text",
"re.match",
"pandas.to_datetime"
] | [((207, 242), 'pandas.read_csv', 'pd.read_csv', (['"""../data/emotions.csv"""'], {}), "('../data/emotions.csv')\n", (218, 242), True, 'import pandas as pd\n'), ((583, 628), 'pandas.read_csv', 'pd.read_csv', (['"""../data/emotion_categories.csv"""'], {}), "('../data/emotion_categories.csv')\n", (594, 628), True, 'import... |
"""Dataset for topic model assessment."""
import json
from pathlib import Path
from typing import Dict, List, Set, Tuple
from envinorma.models.text_elements import EnrichedString
from envinorma.topics.patterns import TopicName
LABELS = {
0: {TopicName.BRUIT_VIBRATIONS},
1: {TopicName.EXECUTION},
2: {Topic... | [
"envinorma.models.text_elements.EnrichedString.from_dict",
"pathlib.Path"
] | [((10742, 10756), 'pathlib.Path', 'Path', (['__file__'], {}), '(__file__)\n', (10746, 10756), False, 'from pathlib import Path\n'), ((10424, 10455), 'envinorma.models.text_elements.EnrichedString.from_dict', 'EnrichedString.from_dict', (['dict_'], {}), '(dict_)\n', (10448, 10455), False, 'from envinorma.models.text_ele... |
import logging
import warnings
from contextlib import contextmanager, suppress
from typing import Dict, List, Optional, Type, Union
from weakref import WeakSet
from mesonic.backend import start_backend
from mesonic.backend.bases import B, Backend, EventHandler, Manager
from mesonic.events import Event
from mesonic.pla... | [
"logging.getLogger",
"mesonic.backend.start_backend",
"weakref.WeakSet",
"contextlib.suppress",
"mesonic.processor.BundleProcessor",
"mesonic.timeline.Timeline",
"mesonic.playback.Playback"
] | [((437, 464), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (454, 464), False, 'import logging\n'), ((10853, 10901), 'mesonic.backend.start_backend', 'start_backend', ([], {'backend': 'backend'}), '(backend=backend, **backend_kwargs)\n', (10866, 10901), False, 'from mesonic.backend impor... |
#! /usr/bin/python3
# -*- coding:utf-8 -*-
' distance help raspberry to check the distance using HC-SR04 '
__author__ = ' real dirty dark '
import RPi.GPIO as GPIO;
import time as time
TRIG = 32;
ECHO = 22;
def init():
GPIO.setmode(GPIO.BOARD)
GPIO.setup(TRIG, GPIO.OUT, initial=GPIO.LOW)
GPIO.setup(ECH... | [
"RPi.GPIO.cleanup",
"RPi.GPIO.setup",
"RPi.GPIO.output",
"time.sleep",
"RPi.GPIO.input",
"time.time",
"RPi.GPIO.setmode"
] | [((228, 252), 'RPi.GPIO.setmode', 'GPIO.setmode', (['GPIO.BOARD'], {}), '(GPIO.BOARD)\n', (240, 252), True, 'import RPi.GPIO as GPIO\n'), ((257, 301), 'RPi.GPIO.setup', 'GPIO.setup', (['TRIG', 'GPIO.OUT'], {'initial': 'GPIO.LOW'}), '(TRIG, GPIO.OUT, initial=GPIO.LOW)\n', (267, 301), True, 'import RPi.GPIO as GPIO\n'), ... |
import pytest
from api.auth import ers
import test
@test.vcr.use_cassette(test.cassettes['ers'])
def test_bad_creds():
with pytest.raises(ers.ErsInvalidLogin) as exc:
token = ers.login('', '')
@test.vcr.use_cassette(test.cassettes['ers'])
def test_login():
token = ers.login('username', 'password', s... | [
"api.auth.ers.roles",
"api.auth.ers.login",
"pytest.raises",
"test.vcr.use_cassette"
] | [((55, 99), 'test.vcr.use_cassette', 'test.vcr.use_cassette', (["test.cassettes['ers']"], {}), "(test.cassettes['ers'])\n", (76, 99), False, 'import test\n'), ((210, 254), 'test.vcr.use_cassette', 'test.vcr.use_cassette', (["test.cassettes['ers']"], {}), "(test.cassettes['ers'])\n", (231, 254), False, 'import test\n'),... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from model_utils import Choices
from django.utils.translation import gettext_lazy as _, ngettext as __
from django.db import models
from sndg.users.models import User
class BatchSubmission(models.Model):
BATCH_STATUS = Choices(
*[(i, x, _(x))... | [
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.utils.translation.gettext_lazy",
"django.db.models.PositiveIntegerField",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((504, 543), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'auto_now_add': '(True)'}), '(auto_now_add=True)\n', (524, 543), False, 'from django.db import models\n'), ((562, 593), 'django.db.models.DateTimeField', 'models.DateTimeField', ([], {'null': '(True)'}), '(null=True)\n', (582, 593), False, 'f... |
from distutils.core import setup
setup(
name='gitric',
version='0.4',
description='simple git-based deployment for fabric',
author='<NAME>',
author_email='<EMAIL>',
url='http://dan.bravender.us',
download_url='http://github.com/dbravender/gitric/tarball/0.4',
packages=['gitric'])
| [
"distutils.core.setup"
] | [((34, 295), 'distutils.core.setup', 'setup', ([], {'name': '"""gitric"""', 'version': '"""0.4"""', 'description': '"""simple git-based deployment for fabric"""', 'author': '"""<NAME>"""', 'author_email': '"""<EMAIL>"""', 'url': '"""http://dan.bravender.us"""', 'download_url': '"""http://github.com/dbravender/gitric/ta... |
"""Custom settings module for sansa-desa's data_cube_ui
We use this mostly to fetch additional settings from the environment
"""
import os
import typing
from configparser import ConfigParser
from pathlib import Path
from django.core.exceptions import ImproperlyConfigured
from .settings import *
def get_env_varia... | [
"django.core.exceptions.ImproperlyConfigured",
"configparser.ConfigParser",
"os.getenv",
"pathlib.Path"
] | [((552, 575), 'os.getenv', 'os.getenv', (['env_var_name'], {}), '(env_var_name)\n', (561, 575), False, 'import os\n'), ((1280, 1294), 'configparser.ConfigParser', 'ConfigParser', ([], {}), '()\n', (1292, 1294), False, 'from configparser import ConfigParser\n'), ((2120, 2134), 'pathlib.Path', 'Path', (['BASE_DIR'], {}),... |
import json
from collections import namedtuple
import aiohttp
import voluptuous as vol
class InverterError(Exception):
"""Indicates error communicating with inverter"""
class DiscoveryError(Exception):
"""Raised when unable to discover inverter"""
InverterResponse = namedtuple('InverterResponse',
... | [
"aiohttp.ClientSession",
"voluptuous.Required",
"json.loads",
"collections.namedtuple",
"voluptuous.Length",
"voluptuous.Range",
"voluptuous.Coerce"
] | [((282, 350), 'collections.namedtuple', 'namedtuple', (['"""InverterResponse"""', '"""data, serial_number, version, type"""'], {}), "('InverterResponse', 'data, serial_number, version, type')\n", (292, 350), False, 'from collections import namedtuple\n'), ((4285, 4306), 'json.loads', 'json.loads', (['formatted'], {}), ... |
import csv
import sys
"""
Given a standard mssql exported query results csv file,
Write a function that turns each exported record into an insert statement
"""
def create_insert_script(csv_file_path, table_name, database_name, *, add_audit_information=True):
with open(csv_file_path, "r", encoding="utf-8") as csv_... | [
"csv.reader"
] | [((376, 396), 'csv.reader', 'csv.reader', (['csv_file'], {}), '(csv_file)\n', (386, 396), False, 'import csv\n')] |
from flask import Blueprint, request
# from cerberus import Validator
# from admin.exception import BadRequest, YMException
main = Blueprint("main", __name__)
main.config = {}
# @main.record
# def record_params(setup_state):
# apps = setup_state.apps
# main.config = dict([(key, value) for (key, value) in app... | [
"flask.Blueprint"
] | [((132, 159), 'flask.Blueprint', 'Blueprint', (['"""main"""', '__name__'], {}), "('main', __name__)\n", (141, 159), False, 'from flask import Blueprint, request\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 8 09:54:43 2019
@author: <NAME>
"""
import pandas as pd
import numpy as np
import pyphi as phi
import pyphi_plots as pp
# Load the data from Excel
Raman_Spectra = pd.read_excel('Raman.xlsx', 'Raman', index_col=None, na_values=np.nan)
API_Con... | [
"pyphi_plots.plot_spectra",
"pyphi.snv",
"pyphi.pls",
"pyphi_plots.predvsobs",
"pandas.read_excel",
"pyphi.savgol"
] | [((242, 312), 'pandas.read_excel', 'pd.read_excel', (['"""Raman.xlsx"""', '"""Raman"""'], {'index_col': 'None', 'na_values': 'np.nan'}), "('Raman.xlsx', 'Raman', index_col=None, na_values=np.nan)\n", (255, 312), True, 'import pandas as pd\n'), ((333, 399), 'pandas.read_excel', 'pd.read_excel', (['"""Raman.xlsx"""', '""... |
from mpseg import MPseg
from spseg import SPseg
from pos import WordTagging
from score import Score, Score_hard
class ToolKit(MPseg, SPseg, WordTagging):
def __init__(self, wordFile: str = 'data/wordpieces.txt', seqFile: str = 'data/sequences.txt'):
super().__init__(wordFile=wordFile, seqFile=seqFil... | [
"score.Score",
"score.Score_hard"
] | [((1547, 1588), 'score.Score', 'Score', ([], {'pred': 'pred_mp', 'groundTrue': 'label_cut'}), '(pred=pred_mp, groundTrue=label_cut)\n', (1552, 1588), False, 'from score import Score, Score_hard\n'), ((1628, 1674), 'score.Score', 'Score', ([], {'pred': 'pred_mp_add1', 'groundTrue': 'label_cut'}), '(pred=pred_mp_add1, gr... |
# Copyright 2021 Axis Communications AB.
#
# For a full list of individual contributors, please see the commit history.
#
# 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.apac... | [
"logging.getLogger",
"tests.library.fake_request.FakeResponse",
"tests.library.fake_database.FakeDatabase",
"environment_provider.webserver.SubSuite",
"json.dumps",
"tests.library.fake_request.FakeRequest"
] | [((1043, 1070), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1060, 1070), False, 'import logging\n'), ((1591, 1605), 'tests.library.fake_database.FakeDatabase', 'FakeDatabase', ([], {}), '()\n', (1603, 1605), False, 'from tests.library.fake_database import FakeDatabase\n'), ((1841, 185... |
# -*- coding: utf-8 -*-
"""
抽取器,从响应结果中抽取部分数据
~~~~~~~~~~~
@Time: 2018/9/10 13:50
@author: ying.zhang01
@File: extractor.py
"""
import json
import jmespath
class JMESPathExtractor:
"""用JEMSPath实现对json格式数据的简单抽取。"""
def extract(self, query=None, body=None):
try:
return jmespath.search(quer... | [
"json.loads"
] | [((323, 339), 'json.loads', 'json.loads', (['body'], {}), '(body)\n', (333, 339), False, 'import json\n')] |
import requests
def is_campus_up():
response_threshold = 3
timeout = 5
url = "https://campus.exactas.uba.ar"
try:
response = requests.get(url, timeout=timeout)
response_time = response.elapsed.total_seconds()
response.raise_for_status()
msg = ""
if re... | [
"requests.get"
] | [((152, 186), 'requests.get', 'requests.get', (['url'], {'timeout': 'timeout'}), '(url, timeout=timeout)\n', (164, 186), False, 'import requests\n')] |
# minqlx - Extends Quake Live's dedicated server with extra functionality and scripting.
# Copyright (C) 2015 Mino <<EMAIL>>
# This file is part of minqlx.
# minqlx is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Founda... | [
"minqlx.Plugin.tempban",
"minqlx.Weapons",
"minqlx.set_weapon",
"minqlx.Vector3",
"minqlx.get_configstring",
"minqlx.PlayerInfo",
"minqlx.Plugin.slap",
"minqlx.Plugin.addadmin",
"minqlx.Powerups",
"minqlx.drop_holdable",
"minqlx.Flight",
"minqlx.set_health",
"minqlx.Plugin.kick",
"minqlx.P... | [((4059, 4087), 'minqlx.player_info', 'minqlx.player_info', (['self._id'], {}), '(self._id)\n', (4077, 4087), False, 'import minqlx\n'), ((6059, 6097), 'minqlx.set_configstring', 'minqlx.set_configstring', (['index', 'new_cs'], {}), '(index, new_cs)\n', (6082, 6097), False, 'import minqlx\n'), ((6393, 6426), 're.sub', ... |
"""
Analyze and Report ECM Alerts.
"""
import collections
import humanize
import shellish
import sys
from . import base
from .. import ui
def since(dt):
""" Return humanized time since for an absolute datetime. """
since = dt.now(tz=dt.tzinfo) - dt
return humanize.naturaltime(since)[:-4]
class Alerts(b... | [
"collections.OrderedDict",
"sys.stdout.isatty",
"humanize.naturaltime",
"shellish.progressbar"
] | [((271, 298), 'humanize.naturaltime', 'humanize.naturaltime', (['since'], {}), '(since)\n', (291, 298), False, 'import humanize\n'), ((1494, 1519), 'collections.OrderedDict', 'collections.OrderedDict', ([], {}), '()\n', (1517, 1519), False, 'import collections\n'), ((1653, 1672), 'sys.stdout.isatty', 'sys.stdout.isatty... |
"""
Reader for OVERFLOW test data.
"""
from openmdao.lib.datatypes.domain import Vector, read_plot3d_grid
from openmdao.util.log import NullLogger
from openmdao.util.stream import Stream
def read_q(grid_file, q_file, multiblock=True, blanking=False, logger=None):
"""
Read grid and solution files.
Returns... | [
"openmdao.lib.datatypes.domain.read_plot3d_grid",
"openmdao.util.stream.Stream",
"openmdao.util.log.NullLogger",
"openmdao.lib.datatypes.domain.Vector"
] | [((534, 710), 'openmdao.lib.datatypes.domain.read_plot3d_grid', 'read_plot3d_grid', (['grid_file', 'multiblock'], {'dim': '(3)', 'blanking': 'blanking', 'planes': '(False)', 'binary': '(True)', 'big_endian': '(False)', 'single_precision': '(False)', 'unformatted': '(True)', 'logger': 'logger'}), '(grid_file, multiblock... |
import cv2 as cv
import numpy as np
import time
import RPi.GPIO as GPIO
import sys
import select
import tracking
import drive
# Frame size
HEIGHT = 240
WIDTH = 320
#Filter
LOWER = np.array([68, 65, 31])
UPPER = np.array([100, 229, 167])
# Start capture
cap = cv.VideoCapture(0)
cap.set(3, WIDTH) # 3 CV_CAP_PROP_FRA... | [
"RPi.GPIO.cleanup",
"select.select",
"drive.backward",
"tracking.distance",
"drive.turn_right",
"time.sleep",
"numpy.array",
"drive.motor_setup",
"cv2.VideoCapture",
"drive.turn_left",
"drive.stop",
"tracking.steering_decision",
"drive.forward"
] | [((183, 205), 'numpy.array', 'np.array', (['[68, 65, 31]'], {}), '([68, 65, 31])\n', (191, 205), True, 'import numpy as np\n'), ((214, 239), 'numpy.array', 'np.array', (['[100, 229, 167]'], {}), '([100, 229, 167])\n', (222, 239), True, 'import numpy as np\n'), ((263, 281), 'cv2.VideoCapture', 'cv.VideoCapture', (['(0)'... |
import copy
import torch
from corgie import constants, exceptions
from corgie.log import logger as corgie_logger
from corgie.boundingcube import BoundingCube
from corgie.layers.base import register_layer_type, BaseLayerType
from corgie import helpers
class VolumetricLayer(BaseLayerType):
def __init__(self, data... | [
"corgie.boundingcube.BoundingCube",
"copy.deepcopy",
"corgie.helpers.Binarizer",
"corgie.layers.base.register_layer_type"
] | [((2546, 2572), 'corgie.layers.base.register_layer_type', 'register_layer_type', (['"""img"""'], {}), "('img')\n", (2565, 2572), False, 'from corgie.layers.base import register_layer_type, BaseLayerType\n'), ((3548, 3576), 'corgie.layers.base.register_layer_type', 'register_layer_type', (['"""field"""'], {}), "('field'... |
from __future__ import absolute_import, unicode_literals
import os
import dj_database_url
from . import get_env_variable
from .. import get_project_root_path
gettext = lambda s: s
# Full filesystem path to the project.
BASE_DIR = get_project_root_path()
WSGI_APPLICATION = 'code_annotate.wsgi.application'
# Inter... | [
"os.path.join"
] | [((2425, 2457), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""static"""'], {}), "(BASE_DIR, 'static')\n", (2437, 2457), False, 'import os\n'), ((3101, 3153), 'os.path.join', 'os.path.join', (['BASE_DIR', '"""code_annotate"""', '"""templates"""'], {}), "(BASE_DIR, 'code_annotate', 'templates')\n", (3113, 3153), Fals... |
import json
import sys
import github
access_key = sys.argv[-1]
git = github.Github(access_key)
symfem = git.get_repo("mscroggs/symfem")
branch = symfem.get_branch("main")
ref = symfem.get_git_ref("heads/main")
base_tree = symfem.get_git_tree(branch.commit.sha)
vfile1 = symfem.get_contents("VERSION", branch.commit.s... | [
"json.loads",
"github.Github"
] | [((71, 96), 'github.Github', 'github.Github', (['access_key'], {}), '(access_key)\n', (84, 96), False, 'import github\n'), ((453, 487), 'json.loads', 'json.loads', (['vfile2.decoded_content'], {}), '(vfile2.decoded_content)\n', (463, 487), False, 'import json\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import pdb
class ForkedPdb(pdb.Pdb):
"""A Pdb subclass that only be used from a forked multiprocessing child.
"""
def interaction(self, *args, **kwargs):
_stdin = sys.stdin
try:
sys.stdin = open(0)
pdb.Pdb.i... | [
"pdb.Pdb.interaction"
] | [((311, 353), 'pdb.Pdb.interaction', 'pdb.Pdb.interaction', (['self', '*args'], {}), '(self, *args, **kwargs)\n', (330, 353), False, 'import pdb\n')] |
#!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2009,2010,2011,2012,2013,2014,2015,2016 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... | [
"utils.import_depends",
"unittest.TextTestRunner",
"unittest.TestLoader"
] | [((864, 886), 'utils.import_depends', 'utils.import_depends', ([], {}), '()\n', (884, 886), False, 'import utils\n'), ((2472, 2493), 'unittest.TestLoader', 'unittest.TestLoader', ([], {}), '()\n', (2491, 2493), False, 'import unittest\n'), ((2543, 2579), 'unittest.TextTestRunner', 'unittest.TextTestRunner', ([], {'verb... |
'''This module includes utility functions.
'''
import time
import os.path
from ftplib import FTP
import multiprocessing as mp
from pub.corpus import Corpus
def downloader(file_links, dest_dir, sleep=2,
server_address="ftp.ncbi.nlm.nih.gov"):
''' Download files from a FTP server.
Args:
... | [
"ftplib.FTP",
"multiprocessing.Pool",
"time.sleep"
] | [((1763, 1790), 'multiprocessing.Pool', 'mp.Pool', ([], {'processes': 'num_proc'}), '(processes=num_proc)\n', (1770, 1790), True, 'import multiprocessing as mp\n'), ((804, 823), 'ftplib.FTP', 'FTP', (['server_address'], {}), '(server_address)\n', (807, 823), False, 'from ftplib import FTP\n'), ((896, 913), 'time.sleep'... |
"""fill project_id to secrets where missing
Revision ID: 161f8aceb687
Revises: <PASSWORD>
Create Date: 2015-06-22 15:58:03.131256
"""
# revision identifiers, used by Alembic.
revision = '161f8aceb687'
down_revision = '1bc885<PASSWORD>c76'
from alembic import op
import sqlalchemy as sa
def _get_database_metadata()... | [
"alembic.op.get_bind",
"alembic.op.create_foreign_key",
"alembic.op.drop_constraint",
"sqlalchemy.MetaData",
"sqlalchemy.String",
"alembic.op.get_context"
] | [((332, 345), 'alembic.op.get_bind', 'op.get_bind', ([], {}), '()\n', (343, 345), False, 'from alembic import op\n'), ((361, 382), 'sqlalchemy.MetaData', 'sa.MetaData', ([], {'bind': 'con'}), '(bind=con)\n', (372, 382), True, 'import sqlalchemy as sa\n'), ((1406, 1422), 'alembic.op.get_context', 'op.get_context', ([], ... |
'''
Created on Jun 14, 2013
@author: gcardwel
'''
import json
from paramtypes import SLOT
encodings = {}
encodings['boolean'] = { 0:'none', 1:''}
slots = {}
paramtraits = {}
slots['percent1'] = SLOT('percent1', '%', 1, 1, 0, 0, 'boolean1')
slots['boolean1'] = SLOT('boolean1', '', 1, 1, 0, 0... | [
"json.dumps",
"paramtypes.SLOT"
] | [((222, 267), 'paramtypes.SLOT', 'SLOT', (['"""percent1"""', '"""%"""', '(1)', '(1)', '(0)', '(0)', '"""boolean1"""'], {}), "('percent1', '%', 1, 1, 0, 0, 'boolean1')\n", (226, 267), False, 'from paramtypes import SLOT\n'), ((289, 325), 'paramtypes.SLOT', 'SLOT', (['"""boolean1"""', '""""""', '(1)', '(1)', '(0)', '(0)'... |
# -*- coding: utf-8 -*-
import json
import logging
import elasticsearch_dsl
from elasticsearch.exceptions import NotFoundError
from elasticsearch.helpers import parallel_bulk
from elasticsearch_dsl.connections import connections
from tg import config
from pyjobsweb import model
from pyjobsweb.lib.sqlalchemy_ import c... | [
"logging.getLogger",
"elasticsearch_dsl.connections.connections.get_connection",
"pyjobsweb.lib.sqlalchemy_.current_server_timestamp",
"elasticsearch.helpers.parallel_bulk",
"tg.config.get",
"elasticsearch_dsl.Index",
"pyjobsweb.lib.lock.acquire_inter_process_lock"
] | [((691, 718), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (708, 718), False, 'import logging\n'), ((4441, 4469), 'elasticsearch_dsl.connections.connections.get_connection', 'connections.get_connection', ([], {}), '()\n', (4467, 4469), False, 'from elasticsearch_dsl.connections import c... |
# -*- coding: utf-8 -*-
# Copyright (c) 2019-2020 <NAME>.
# All rights reserved.
# Licensed under BSD-3-Clause-Clear. See LICENSE file for details.
from django import template
from django.utils.html import escape
from django.utils.safestring import mark_safe
def filter_highlight(text, search_for):
""" highl... | [
"django.utils.safestring.mark_safe",
"django.utils.html.escape",
"django.template.Library"
] | [((1427, 1445), 'django.template.Library', 'template.Library', ([], {}), '()\n', (1443, 1445), False, 'from django import template\n'), ((1365, 1391), 'django.utils.safestring.mark_safe', 'mark_safe', (['(new_text + text)'], {}), '(new_text + text)\n', (1374, 1391), False, 'from django.utils.safestring import mark_safe... |
import dash
import numpy as np
import pandas as pd
import dash_core_components as dcc
import dash_html_components as html
from plotly import tools
from dash.dependencies import Input, Output
from cachetools import cached, TTLCache
import plotly.graph_objs as go
import geojson
import geopandas as gpd
cache = TTLCache(m... | [
"dash_html_components.I",
"geopandas.read_file",
"pandas.read_csv",
"dash.dependencies.Output",
"dash.dependencies.Input",
"cachetools.TTLCache",
"cachetools.cached",
"dash_core_components.Dropdown",
"numpy.around",
"dash_html_components.H1",
"plotly.graph_objs.Figure",
"dash.Dash",
"dash_co... | [((310, 340), 'cachetools.TTLCache', 'TTLCache', ([], {'maxsize': '(100)', 'ttl': '(300)'}), '(maxsize=100, ttl=300)\n', (318, 340), False, 'from cachetools import cached, TTLCache\n'), ((374, 403), 'pandas.read_csv', 'pd.read_csv', (['"""ls_cleaned.csv"""'], {}), "('ls_cleaned.csv')\n", (385, 403), True, 'import panda... |
# Copyright The IETF Trust 2021, 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 o... | [
"os.chdir",
"os.path.split"
] | [((1440, 1469), 'os.path.split', 'os.path.split', (['yang_file_path'], {}), '(yang_file_path)\n', (1453, 1469), False, 'import os\n'), ((1478, 1497), 'os.chdir', 'os.chdir', (['directory'], {}), '(directory)\n', (1486, 1497), False, 'import os\n'), ((3120, 3149), 'os.path.split', 'os.path.split', (['yang_file_path'], {... |
import pgzrun
WIDTH = 800
HEIGHT = 600
TITLE = "Balloon Fight"
game_over = False
up = False
balloon = Actor("balloon")
balloon.pos = 400, 300
def on_key_up(key):
global up
if key == keys.SPACE:
up = True
balloon.y -= 50
up = False
def update():
if not game_over:
if not ... | [
"pgzrun.go"
] | [((448, 459), 'pgzrun.go', 'pgzrun.go', ([], {}), '()\n', (457, 459), False, 'import pgzrun\n')] |
#!/usr/bin/python3
import discord
import asyncio
import json
from libs.gmusic import GpmSession
with open("../secrets/botrumz.secret.json", "r") as secretsFile:
secrets = json.load(secretsFile)
client = discord.Client()
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
... | [
"discord.Client",
"json.load",
"libs.gmusic.GpmSession",
"asyncio.sleep"
] | [((209, 225), 'discord.Client', 'discord.Client', ([], {}), '()\n', (223, 225), False, 'import discord\n'), ((1480, 1540), 'libs.gmusic.GpmSession', 'GpmSession', (["secrets['gPlayAppUser']", "secrets['gPlayAppPass']"], {}), "(secrets['gPlayAppUser'], secrets['gPlayAppPass'])\n", (1490, 1540), False, 'from libs.gmusic ... |
"""
Utilities, ...
Some stuff is likely not needed, and will be pruned, later...
"""
import re
import os
import sys
import random
from itertools import tee
import requests
# import contextily as ctx
from geographiclib.geodesic import Geodesic
from geopy.geocoders import Here
from geopy.distance import geodesic
from ... | [
"random.choice",
"ipyleaflet.CircleMarker",
"math.tan",
"math.degrees",
"requests.get",
"math.radians",
"math.cos",
"ipyleaflet.Polyline",
"geopy.geocoders.Here",
"itertools.tee",
"math.sinh",
"ipyleaflet.Marker",
"ipywidgets.HTML"
] | [((527, 565), 'geopy.geocoders.Here', 'Here', ([], {'app_id': 'app_id', 'app_code': 'app_code'}), '(app_id=app_id, app_code=app_code)\n', (531, 565), False, 'from geopy.geocoders import Here\n'), ((842, 858), 'math.radians', 'radians', (['lat_deg'], {}), '(lat_deg)\n', (849, 858), False, 'from math import radians, degr... |
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, FieldList, FormField
from wtforms.validators import DataRequired
MIN_VALIDATORS = 8
class VariablesForm(FlaskForm):
var_name = StringField('Name', validators=[DataRequired()])
var_dim = StringField('Dimension', validators=[DataRequ... | [
"wtforms.validators.DataRequired",
"wtforms.SubmitField",
"wtforms.FormField"
] | [((457, 489), 'wtforms.SubmitField', 'SubmitField', (['"""Find combination!"""'], {}), "('Find combination!')\n", (468, 489), False, 'from wtforms import StringField, SubmitField, FieldList, FormField\n'), ((692, 724), 'wtforms.SubmitField', 'SubmitField', (['"""Find combination!"""'], {}), "('Find combination!')\n", (... |
from etldjango.settings import DEBUG
from .utiles import get_client_and_log_resource
import io
import logging
import json
client, _LOG_RESOURCE = get_client_and_log_resource()
class StackDriverHandler(logging.Handler):
def __init__(self):
logging.Handler.__init__(self)
def emit(self, record):
... | [
"logging.Handler.__init__"
] | [((256, 286), 'logging.Handler.__init__', 'logging.Handler.__init__', (['self'], {}), '(self)\n', (280, 286), False, 'import logging\n')] |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This module implements Deep QL with two networks: Q-network and target-network
the DQL uses an MLP Q-network
it is retrained only after 'episodes' iterations
the training uses replay memory
"""
from copy import deepcopy
import numpy as np
import loggin... | [
"DQL.clone.clone_model",
"numpy.amax",
"copy.deepcopy"
] | [((3334, 3363), 'numpy.amax', 'np.amax', (['q_prediction'], {'axis': '(1)'}), '(q_prediction, axis=1)\n', (3341, 3363), True, 'import numpy as np\n'), ((2259, 2279), 'copy.deepcopy', 'deepcopy', (['self.model'], {}), '(self.model)\n', (2267, 2279), False, 'from copy import deepcopy\n'), ((2331, 2354), 'DQL.clone.clone_... |
# Automate the Boring Stuff With Python #
# Learning Concepts #
'''
# --- Five Times --- #
print('My name is')
i = 0
for i in range(5):
while i < 5:
print('<NAME> Times ' + str(i))
i = i + 1
# --- YourName --- #
name = ''
while True:
print('Please type your name')
name = input()
if name == 'your... | [
"re.compile"
] | [((4040, 4078), 're.compile', 're.compile', (['"""((?:\\\\d{3}\\\\-){2}\\\\d{4})"""'], {}), "('((?:\\\\d{3}\\\\-){2}\\\\d{4})')\n", (4050, 4078), False, 'import re\n')] |
#!/usr/bin/env python
# NOTE: this script is based on logeion_load.py to do a basic import of russian
from lattices.models import LatticeNode, LemmaNode
def create_lemma_node(lemma, lattice_node, context):
lemma_node, created = LemmaNode.objects.get_or_create(
context=context,
lemma=lemma,
... | [
"lattices.models.LatticeNode.objects.create",
"lattices.models.LatticeNode.objects.get_or_create",
"lattices.models.LemmaNode.objects.filter",
"lattices.models.LemmaNode.objects.get_or_create"
] | [((236, 335), 'lattices.models.LemmaNode.objects.get_or_create', 'LemmaNode.objects.get_or_create', ([], {'context': 'context', 'lemma': 'lemma', 'defaults': "{'node': lattice_node}"}), "(context=context, lemma=lemma, defaults={\n 'node': lattice_node})\n", (267, 335), False, 'from lattices.models import LatticeNode... |
# pylint: disable=missing-module-docstring,missing-class-docstring,missing-function-docstring,line-too-long
from unittest import TestCase
import eze.utils.windowslex as windowslex
class TestWindowslex(TestCase):
def test_join__with_at(self):
# Given
expected_output = 'trufflehog3 -json "mel@a$£" ... | [
"eze.utils.windowslex.quote",
"eze.utils.windowslex.join"
] | [((597, 624), 'eze.utils.windowslex.join', 'windowslex.join', (['test_input'], {}), '(test_input)\n', (612, 624), True, 'import eze.utils.windowslex as windowslex\n'), ((1129, 1156), 'eze.utils.windowslex.join', 'windowslex.join', (['test_input'], {}), '(test_input)\n', (1144, 1156), True, 'import eze.utils.windowslex ... |
#!/usr/bin/env python3
# Copyright (c) 2020, <NAME>
# MIT license. See the LICENSE file included in the package.
import sample_convex_combinations
import unittest
GATHER_FALSE_POSITIVE = 1e-10
def gather(d, span_origin, asserter):
actual = sample_convex_combinations.sample(d, span_origin=span_origin)
# ... | [
"unittest.TestCase",
"sample_convex_combinations.sample"
] | [((251, 312), 'sample_convex_combinations.sample', 'sample_convex_combinations.sample', (['d'], {'span_origin': 'span_origin'}), '(d, span_origin=span_origin)\n', (284, 312), False, 'import sample_convex_combinations\n'), ((1505, 1524), 'unittest.TestCase', 'unittest.TestCase', ([], {}), '()\n', (1522, 1524), False, 'i... |
"""
Misc features
<NAME>
Copyright (c) 2021. Pfizer Inc. All rights reserved.
"""
from skdh.features.core import Feature
from skdh.features.lib import extensions
__all__ = ["ComplexityInvariantDistance", "RangeCountPercentage", "RatioBeyondRSigma"]
class ComplexityInvariantDistance(Feature):
"""
A distance ... | [
"skdh.features.lib.extensions.range_count",
"skdh.features.lib.extensions.complexity_invariant_distance",
"skdh.features.lib.extensions.ratio_beyond_r_sigma"
] | [((1350, 1409), 'skdh.features.lib.extensions.complexity_invariant_distance', 'extensions.complexity_invariant_distance', (['x', 'self.normalize'], {}), '(x, self.normalize)\n', (1390, 1409), False, 'from skdh.features.lib import extensions\n'), ((2678, 2725), 'skdh.features.lib.extensions.range_count', 'extensions.ran... |
#!/usr/bin/env python
#
# util.py
#
# Utility classes
#
# Copyright 2017 <NAME>
# COBHUNI Project, Universität Hamburg
#
# 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.a... | [
"collections.namedtuple",
"os.scandir",
"os.path.splitext",
"pprint.pformat",
"os.path.realpath",
"configparser.ExtendedInterpolation"
] | [((1797, 1902), 'collections.namedtuple', 'namedtuple', (['"""_HadithMeta"""', "['PIDSTART', 'PIDEND', 'BOOKID', 'CHAPTERID', 'SUBCHAPTERID', 'SECTIONID']"], {}), "('_HadithMeta', ['PIDSTART', 'PIDEND', 'BOOKID', 'CHAPTERID',\n 'SUBCHAPTERID', 'SECTIONID'])\n", (1807, 1902), False, 'from collections import namedtupl... |
from django.core.management import BaseCommand
from guests import csv_import
class Command(BaseCommand):
args = 'filename'
def handle(self, filename, *args, **kwargs):
csv_import.import_guests(filename)
| [
"guests.csv_import.import_guests"
] | [((187, 221), 'guests.csv_import.import_guests', 'csv_import.import_guests', (['filename'], {}), '(filename)\n', (211, 221), False, 'from guests import csv_import\n')] |
import pandas as pd
import time
import random
import numpy as np
from datetime import timedelta
from datetime import datetime
import MAUC
import argparse
parser = argparse.ArgumentParser(usage='python3 evalOneSubmission.py',
description=r'''
TADPOLE Evaluation Script:
The program computes the following matrics:
... | [
"numpy.mean",
"numpy.abs",
"MAUC.MAUC",
"numpy.ones",
"pandas.read_csv",
"argparse.ArgumentParser",
"datetime.datetime.strptime",
"numpy.argmax",
"numpy.sum",
"numpy.isnan"
] | [((164, 642), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'usage': '"""python3 evalOneSubmission.py"""', 'description': '"""\n TADPOLE Evaluation Script:\n The program computes the following matrics:\n\n Clinical diagnosis prediction:\n\n 1. Multiclass area under the receiver operating curve (mAUC)\... |
# -*- coding=utf-8 -*-
import socket
import sys
import threading
from time import sleep
from datetime import datetime
def connect_domain_socket(file="/tmp/pisugar-server.sock"):
"""Connect pisugar server via unix domain socket file"""
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
conn = s.connect... | [
"datetime.datetime",
"socket.create_connection",
"socket.socket",
"time.sleep",
"datetime.datetime.fromisoformat",
"threading.Thread"
] | [((250, 299), 'socket.socket', 'socket.socket', (['socket.AF_UNIX', 'socket.SOCK_STREAM'], {}), '(socket.AF_UNIX, socket.SOCK_STREAM)\n', (263, 299), False, 'import socket\n'), ((335, 384), 'socket.socket', 'socket.socket', (['socket.AF_UNIX', 'socket.SOCK_STREAM'], {}), '(socket.AF_UNIX, socket.SOCK_STREAM)\n', (348, ... |
"""Explosive Sum
https://www.codewars.com/kata/52ec24228a515e620b0005ef/train/python
How many ways can you make the sum of a number?
From wikipedia: https://en.wikipedia.org/wiki/Partition_(number_theory)#
In number theory and combinatorics, a partition of a positive integer n, also called an integer partit... | [
"doctest.testmod"
] | [((2664, 2681), 'doctest.testmod', 'doctest.testmod', ([], {}), '()\n', (2679, 2681), False, 'import doctest\n')] |
from django.db import models
from cole.models import *
import uuid
import json
ELECTION_STATUS_DRAFT = '0'
ELECTION_STATUS_OPEN = '1'
ELECTION_STATUS_CLOSED = '2'
ELECTION_STATUS = [
(ELECTION_STATUS_DRAFT, 'borrador'),
(ELECTION_STATUS_OPEN, 'obertes'),
(ELECTION_STATUS_CLOSED, 'tancades'),
]
class Ele... | [
"django.db.models.UUIDField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.IntegerField",
"django.db.models.BooleanField",
"uuid.uuid4",
"django.db.models.DateTimeField",
"django.db.models.CharField"
] | [((350, 420), 'django.db.models.UUIDField', 'models.UUIDField', ([], {'primary_key': '(True)', 'default': 'uuid.uuid4', 'editable': '(False)'}), '(primary_key=True, default=uuid.uuid4, editable=False)\n', (366, 420), False, 'from django.db import models\n'), ((433, 550), 'django.db.models.ForeignKey', 'models.ForeignKe... |
"""Tests redirects from logging to logbook"""
from logging import getLogger
from logbook import StreamHandler
from logbook.compat import redirect_logging
from cStringIO import StringIO
redirect_logging()
log = getLogger('Test logger')
def run():
out = StringIO()
with StreamHandler(out):
for x in xra... | [
"logging.getLogger",
"cStringIO.StringIO",
"logbook.compat.redirect_logging",
"logbook.StreamHandler"
] | [((187, 205), 'logbook.compat.redirect_logging', 'redirect_logging', ([], {}), '()\n', (203, 205), False, 'from logbook.compat import redirect_logging\n'), ((212, 236), 'logging.getLogger', 'getLogger', (['"""Test logger"""'], {}), "('Test logger')\n", (221, 236), False, 'from logging import getLogger\n'), ((260, 270),... |