code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#...the usual suspects.
import os, inspect
#...for the unit testing.
import unittest
#...for the logging.
import logging as lg
#...for the pixel wrapper class.
from pixel import Pixel
class PixelTest(unittest.TestCase):
def setUp(self):
pass
def tearD... | [
"unittest.main",
"logging.info",
"pixel.Pixel",
"logging.basicConfig"
] | [((844, 919), 'logging.basicConfig', 'lg.basicConfig', ([], {'filename': '"""log_test_pixel.txt"""', 'filemode': '"""w"""', 'level': 'lg.DEBUG'}), "(filename='log_test_pixel.txt', filemode='w', level=lg.DEBUG)\n", (858, 919), True, 'import logging as lg\n'), ((925, 936), 'logging.info', 'lg.info', (['""""""'], {}), "('... |
"""Helper methods for Module 2."""
import errno
import glob
import os.path
import pickle
import time
import calendar
import numpy
import pandas
import matplotlib.colors
import matplotlib.pyplot as pyplot
import sklearn.metrics
import sklearn.linear_model
import sklearn.tree
import sklearn.ensemble
from module_4 import... | [
"matplotlib.pyplot.title",
"numpy.absolute",
"pickle.dump",
"numpy.sum",
"pandas.read_csv",
"module_4.attributes_diagrams.plot_attributes_diagram",
"numpy.mean",
"module_4.roc_curves.plot_roc_curve",
"glob.glob",
"pandas.DataFrame",
"numpy.std",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot... | [((1929, 1962), 'matplotlib.pyplot.rc', 'pyplot.rc', (['"""font"""'], {'size': 'FONT_SIZE'}), "('font', size=FONT_SIZE)\n", (1938, 1962), True, 'import matplotlib.pyplot as pyplot\n'), ((1963, 2001), 'matplotlib.pyplot.rc', 'pyplot.rc', (['"""axes"""'], {'titlesize': 'FONT_SIZE'}), "('axes', titlesize=FONT_SIZE)\n", (1... |
#!/usr/bin/env python3
"""Normalize a BIOM table of counts to copies per million sequences (cpm).
Usage:
normalize_to_cpm.py input.biom output.biom
Notes:
This is a pure BIOM solution, in contrast to the more complicated and
slower Pandas solution.
"""
from sys import argv
from biom import load_table
fro... | [
"biom.util.biom_open",
"biom.load_table"
] | [((371, 390), 'biom.load_table', 'load_table', (['argv[1]'], {}), '(argv[1])\n', (381, 390), False, 'from biom import load_table\n'), ((487, 510), 'biom.util.biom_open', 'biom_open', (['argv[2]', '"""w"""'], {}), "(argv[2], 'w')\n", (496, 510), False, 'from biom.util import biom_open\n')] |
# -*- coding: utf-8 -*-
"""Functions for summarizing graphs.
This module contains functions that provide aggregate summaries of graphs including visualization with matplotlib,
printing summary information, and exporting summarized graphs
"""
import logging
import matplotlib.pyplot as plt
import pandas as pd
import ... | [
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.subplots",
"seaborn.barplot",
"logging.getLogger"
] | [((433, 460), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (450, 460), False, 'import logging\n'), ((1845, 1919), 'seaborn.barplot', 'sns.barplot', ([], {'x': '"""Count"""', 'y': '"""Function"""', 'data': 'function_df', 'ax': 'lax', 'orient': '"""h"""'}), "(x='Count', y='Function', data... |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from setuptools import setup, find_packages
from os import path
here = path.abspath(path.dirname(__file__))
# Get th... | [
"os.path.dirname",
"os.path.join",
"setuptools.find_packages"
] | [((286, 308), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (298, 308), False, 'from os import path\n'), ((370, 399), 'os.path.join', 'path.join', (['here', '"""README.rst"""'], {}), "(here, 'README.rst')\n", (379, 399), False, 'from os import path\n'), ((1127, 1142), 'setuptools.find_packages'... |
import atexit
import hashlib
import hmac
import re
import os
import sys
import time
from datetime import datetime, timedelta
import click
import requests
from pytz import timezone, utc
from urllib.parse import urlencode, urljoin
from . import notifiers
from .util import read_config
from .storage import Storage
from.e... | [
"urllib.parse.urljoin",
"urllib.parse.urlencode",
"click.option",
"re.match",
"time.sleep",
"os.environ.get",
"time.time",
"datetime.datetime.strptime",
"sys.stdout.flush",
"datetime.timedelta",
"requests.get",
"click.Path",
"pytz.timezone",
"click.group",
"datetime.datetime.now"
] | [((4314, 4327), 'click.group', 'click.group', ([], {}), '()\n', (4325, 4327), False, 'import click\n'), ((4528, 4582), 'click.option', 'click.option', (['"""--verbose"""'], {'default': '(False)', 'is_flag': '(True)'}), "('--verbose', default=False, is_flag=True)\n", (4540, 4582), False, 'import click\n'), ((4584, 4636)... |
from identity.ecrfs.setup.standard import SEX_MAP_1M2F3T_SEX
from identity.setup.participant_identifier_types import ParticipantIdentifierTypeName
from identity.setup.redcap_instances import REDCapInstanceDetail
from identity.setup.studies import StudyName
from identity.ecrfs.setup import crfs, RedCapEcrfDefinition
cr... | [
"identity.ecrfs.setup.RedCapEcrfDefinition"
] | [((336, 948), 'identity.ecrfs.setup.RedCapEcrfDefinition', 'RedCapEcrfDefinition', (["{'crfs': [{'instance': REDCapInstanceDetail.UHL_LIVE, 'study': StudyName.\n DREAM, 'projects': [8, 22]}, {'instance': REDCapInstanceDetail.UHL_HSCN,\n 'study': StudyName.DREAM, 'projects': [20, 21, 24]}],\n 'recruitment_date_... |
from django.urls import path
from django.views.generic import TemplateView
from product.views.product import CreateProductView
from product.views.variant import VariantView, VariantCreateView, VariantEditView
app_name = "product"
urlpatterns = [
# Variants URLs
path('variants/', VariantView.as_view(), name='... | [
"product.views.variant.VariantEditView.as_view",
"django.views.generic.TemplateView.as_view",
"product.views.variant.VariantView.as_view",
"product.views.variant.VariantCreateView.as_view",
"product.views.product.CreateProductView.as_view"
] | [((291, 312), 'product.views.variant.VariantView.as_view', 'VariantView.as_view', ([], {}), '()\n', (310, 312), False, 'from product.views.variant import VariantView, VariantCreateView, VariantEditView\n'), ((359, 386), 'product.views.variant.VariantCreateView.as_view', 'VariantCreateView.as_view', ([], {}), '()\n', (3... |
from pyxtal import pyxtal
from ase.io import read
from ase.spacegroup.symmetrize import prep_symmetry
from spglib import get_symmetry_dataset
#ans1 = get_symmetry_dataset(s, symprec=1e-2)
#print(ans1)
s = pyxtal()
s.from_seed('bug.vasp', tol=1e-2)
print(s)
#s1=s.subgroup(eps=0.1, group_type='t+k', max_cell=4)
#for a ... | [
"pyxtal.pyxtal"
] | [((207, 215), 'pyxtal.pyxtal', 'pyxtal', ([], {}), '()\n', (213, 215), False, 'from pyxtal import pyxtal\n')] |
import logging
from mailboxes.models import MailboxModel, MailboxGuestModel
from reports.models import ReportModel, MessageModel, MessageEvaluationModel
def get_user_guest_mailboxes(user):
"""
Returns guest mailboxes of a user.
"""
return (guest_mailbox.mailbox for guest_mailbox in MailboxGuestModel.o... | [
"reports.models.MessageModel.objects.filter",
"reports.models.MessageEvaluationModel.objects.create",
"reports.models.ReportModel.objects.filter",
"mailboxes.models.MailboxModel.objects.filter",
"reports.models.MessageModel.objects.create",
"mailboxes.models.MailboxGuestModel.objects.filter",
"reports.m... | [((2479, 2598), 'reports.models.ReportModel.objects.create', 'ReportModel.objects.create', ([], {'name': 'name', 'mailbox_id': 'mailbox_id', 'start_at': 'start_at', 'end_at': 'end_at', 'messages_counter': '(0)'}), '(name=name, mailbox_id=mailbox_id, start_at=\n start_at, end_at=end_at, messages_counter=0)\n', (2505,... |
import cv2
import numpy as np
from pyzbar.pyzbar import decode
#This is the barcode testing phase. This allowed me to create the validation of the accounts.
img = cv2.imread('/home/pi/Resources12/frame (1).png')
cap = cv2.VideoCapture(0)
cap.set(3, 640)
cap.set(4, 480)
with open('/home.pi/Resources12\myDataFile.text... | [
"cv2.putText",
"cv2.polylines",
"cv2.waitKey",
"pyzbar.pyzbar.decode",
"cv2.VideoCapture",
"cv2.imread",
"numpy.array",
"cv2.imshow"
] | [((165, 213), 'cv2.imread', 'cv2.imread', (['"""/home/pi/Resources12/frame (1).png"""'], {}), "('/home/pi/Resources12/frame (1).png')\n", (175, 213), False, 'import cv2\n'), ((220, 239), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (236, 239), False, 'import cv2\n'), ((432, 443), 'pyzbar.pyzbar.decod... |
import unittest
from expert_meme import reanimate
class TestReanimation(unittest.TestCase):
def test_reanimate(self):
"""Tests reanimation works as planned, with no unintended consequences, such as
evil monster barnacles"""
x = reanimate.Reanimator('Chet')
self.assertFalse(x.aliv... | [
"expert_meme.reanimate.Reanimator"
] | [((259, 287), 'expert_meme.reanimate.Reanimator', 'reanimate.Reanimator', (['"""Chet"""'], {}), "('Chet')\n", (279, 287), False, 'from expert_meme import reanimate\n'), ((501, 529), 'expert_meme.reanimate.Reanimator', 'reanimate.Reanimator', (['"""Chet"""'], {}), "('Chet')\n", (521, 529), False, 'from expert_meme impor... |
import subprocess
def execute_unix(inputcommand):
p = subprocess.Popen(inputcommand, stdout=subprocess.PIPE, shell=True)
(output, err) = p.communicate()
return output
a = input("enter the text :")
# create wav file
# w = 'espeak -w temp.wav "%s" 2>>/dev/null' % a
# execute_unix(w)
# tts using espeak
c = ... | [
"subprocess.Popen"
] | [((58, 124), 'subprocess.Popen', 'subprocess.Popen', (['inputcommand'], {'stdout': 'subprocess.PIPE', 'shell': '(True)'}), '(inputcommand, stdout=subprocess.PIPE, shell=True)\n', (74, 124), False, 'import subprocess\n')] |
"""Populate Figures site monthly metrics data
"""
from __future__ import absolute_import
from datetime import datetime
from django.db import connection
from django.db.models import IntegerField
from django.utils.timezone import utc
from dateutil.relativedelta import relativedelta
from figures.compat import RELEASE_L... | [
"figures.models.SiteMonthlyMetrics.add_month",
"dateutil.relativedelta.relativedelta",
"django.db.connection.cursor",
"datetime.datetime.utcnow",
"django.db.models.IntegerField",
"figures.sites.get_student_modules_for_site"
] | [((2356, 2494), 'figures.models.SiteMonthlyMetrics.add_month', 'SiteMonthlyMetrics.add_month', ([], {'site': 'site', 'year': 'month_for.year', 'month': 'month_for.month', 'active_user_count': 'mau_count', 'overwrite': 'overwrite'}), '(site=site, year=month_for.year, month=\n month_for.month, active_user_count=mau_co... |
from flask import Flask, request, render_template, redirect, jsonify, flash, session
from flask.config import ConfigAttribute
from flask.helpers import url_for
import requests
from functools import wraps
import json
import base64
from io import BytesIO
from matplotlib.backends.backend_agg import FigureCanvasAgg as Fig... | [
"matplotlib.pyplot.title",
"flask.flash",
"json.dumps",
"flask.jsonify",
"requests.post",
"matplotlib.backends.backend_agg.FigureCanvasAgg",
"flask.helpers.url_for",
"flask.render_template",
"requests.get",
"requests.put",
"seaborn.set",
"matplotlib.pyplot.subplots",
"io.BytesIO",
"request... | [((411, 426), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (416, 426), False, 'from flask import Flask, request, render_template, redirect, jsonify, flash, session\n'), ((480, 488), 'functools.wraps', 'wraps', (['f'], {}), '(f)\n', (485, 488), False, 'from functools import wraps\n'), ((1536, 1567), 'flas... |
import json
import logging
import os
import uuid
from collections import OrderedDict
from datetime import datetime
from typing import Callable
import jwt
import requests
from freetrade import Credentials
logger = logging.getLogger(__name__)
class Auth:
def __init__(self, credentials: Credentials, email: str, u... | [
"json.dump",
"uuid.uuid4",
"json.load",
"datetime.datetime.utcfromtimestamp",
"datetime.datetime.utcnow",
"os.path.isfile",
"requests.post",
"os.path.expanduser",
"logging.getLogger",
"jwt.decode"
] | [((216, 243), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (233, 243), False, 'import logging\n'), ((4603, 4688), 'requests.post', 'requests.post', (['url'], {'json': "{'token': self.custom_token, 'returnSecureToken': True}"}), "(url, json={'token': self.custom_token, 'returnSecureToken... |
import requests, json, os, pickle
import networkx as nx
import GOSTnets as gn
import matplotlib.pyplot as plt
from matplotlib import gridspec
from time import sleep
import pandas as pd
import geopandas as gpd
import rasterio
from rasterio.windows import Window
from rasterio.plot import *
from rasterio.mask import *
i... | [
"pickle.dump",
"osmnx.pois_from_polygon",
"geopandas.sjoin",
"matplotlib.pyplot.figure",
"pickle.load",
"numpy.arange",
"osmnx.pois_from_place",
"matplotlib.pyplot.Normalize",
"shapely.geometry.box",
"pandas.DataFrame",
"shapely.geometry.Point",
"contextily.add_basemap",
"GOSTnets.pandana_sn... | [((1396, 1410), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (1408, 1410), True, 'import pandas as pd\n'), ((2279, 2294), 'numpy.arange', 'np.arange', (['olen'], {}), '(olen)\n', (2288, 2294), True, 'import numpy as np\n'), ((3901, 3957), 'geopandas.sjoin', 'gpd.sjoin', (['origins', 'bounds'], {'how': '"""inne... |
import os
import OSDetect
def test_get_os():
OS = OSDetect.info.getOS()
TRAVIS_OS_NAME = os.getenv("TRAVIS_OS_NAME")
if TRAVIS_OS_NAME is None:
assert isinstance(OS, str)
elif TRAVIS_OS_NAME == "linux":
assert OS.lower() == TRAVIS_OS_NAME.lower()
| [
"os.getenv",
"OSDetect.info.getOS"
] | [((64, 85), 'OSDetect.info.getOS', 'OSDetect.info.getOS', ([], {}), '()\n', (83, 85), False, 'import OSDetect\n'), ((104, 131), 'os.getenv', 'os.getenv', (['"""TRAVIS_OS_NAME"""'], {}), "('TRAVIS_OS_NAME')\n", (113, 131), False, 'import os\n')] |
from sqlalchemy import select
from db.models import Domain, DomainModel
from db.database import get_session
def create_domain(domain_str):
session = get_session()
with session.begin():
domain = Domain(domain=domain_str)
session.add(domain)
return DomainModel.from_orm(domain)
def read_a... | [
"db.models.DomainModel.from_orm",
"db.database.get_session",
"db.models.Domain",
"sqlalchemy.select"
] | [((156, 169), 'db.database.get_session', 'get_session', ([], {}), '()\n', (167, 169), False, 'from db.database import get_session\n'), ((279, 307), 'db.models.DomainModel.from_orm', 'DomainModel.from_orm', (['domain'], {}), '(domain)\n', (299, 307), False, 'from db.models import Domain, DomainModel\n'), ((348, 361), 'd... |
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from compas.geometry import Point, Frame, Vector
from bridge_the_gap.assembly import BridgeAssembly
from bridge_the_gap.assembly import BridgeElement
my_assembly = BridgeAssembly()
myFrameSet = [
Frame(Point... | [
"compas.geometry.Vector",
"bridge_the_gap.assembly.BridgeAssembly",
"compas.geometry.Point"
] | [((275, 291), 'bridge_the_gap.assembly.BridgeAssembly', 'BridgeAssembly', ([], {}), '()\n', (289, 291), False, 'from bridge_the_gap.assembly import BridgeAssembly\n'), ((3624, 3638), 'compas.geometry.Point', 'Point', (['(0)', '(0)', '(0)'], {}), '(0, 0, 0)\n', (3629, 3638), False, 'from compas.geometry import Point, Fr... |
#!/usr/bin/env python
# coding: utf-8
# @Author: dehong
# @Date: 2020-06-09
# @Time: 18:05
# @Name: view_tools
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
from featexp import get_univariate_plots, get_trend_stats
def histogram_plot(data, feature):
"""
利用直方图查看特征数据的具体分布情况(常用来查看目标... | [
"pandas.DataFrame",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"seaborn.heatmap",
"seaborn.barplot",
"matplotlib.pyplot.subplots",
"featexp.get_trend_stats",
"seaborn.distplot",
"seaborn.pairplot",
"seaborn.set",
"seaborn.diverging_palette",
"featexp.get_univariate_plots"
] | [((422, 471), 'seaborn.distplot', 'sns.distplot', (['data[feature]'], {'kde': '(False)', 'color': '"""r"""'}), "(data[feature], kde=False, color='r')\n", (434, 471), True, 'import seaborn as sns\n'), ((712, 800), 'featexp.get_univariate_plots', 'get_univariate_plots', ([], {'data': 'data', 'target_col': 'label', 'featu... |
"""
Keyphrase extraction implementation based on the guidelines
given in the paper on TextRank by Mihalcea et al
This is
"""
import networkx as nx
import operator
import text_processing.preprocessing as preprocess
from utilities.read_write import read_file
WINDOW_SIZE = 2
INCLUDE_GRAPH_POS = ['NN', 'JJ', 'NNP', 'N... | [
"networkx.pagerank",
"utilities.read_write.read_file",
"text_processing.preprocessing.clean_to_doc",
"networkx.Graph",
"operator.itemgetter"
] | [((2281, 2291), 'networkx.Graph', 'nx.Graph', ([], {}), '()\n', (2289, 2291), True, 'import networkx as nx\n'), ((2591, 2620), 'text_processing.preprocessing.clean_to_doc', 'preprocess.clean_to_doc', (['text'], {}), '(text)\n', (2614, 2620), True, 'import text_processing.preprocessing as preprocess\n'), ((3307, 3349), ... |
#!/usr/bin/python
import os
import os.path
import random
import re
import requests
import shutil
import sys
import xml.etree.ElementTree as ET
class TempField:
"""
the template field in the giter8
"""
def __init__( self, fields_value ):
self._format_methods = { 'upper': self._upper,
... | [
"os.makedirs",
"xml.etree.ElementTree.fromstring",
"os.path.isdir",
"os.path.dirname",
"os.path.exists",
"os.system",
"re.match",
"random.choice",
"shutil.copyfile",
"os.path.join",
"os.listdir",
"sys.exit"
] | [((13814, 13837), 'os.path.isdir', 'os.path.isdir', (['root_dir'], {}), '(root_dir)\n', (13827, 13837), False, 'import os\n'), ((14725, 14751), 'os.path.dirname', 'os.path.dirname', (['file_name'], {}), '(file_name)\n', (14740, 14751), False, 'import os\n'), ((15719, 15754), 'os.system', 'os.system', (["('git clone %s'... |
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 31 09:24:17 2017
@author: gao
得到语音和噪声的混合数据 以.pkl的形式存放在mix_data中
"""
import librosa as lr
import numpy as np
import os
import pickle
import matplotlib.pyplot as plt
from ams_extract import ams_extractor
resample_rate=16000
nfft = 512
offset = int(nfft/2)
def genAndSave... | [
"librosa.zero_crossings",
"pickle.dump",
"numpy.abs",
"numpy.angle",
"numpy.ones",
"librosa.resample",
"numpy.exp",
"librosa.feature.mfcc",
"numpy.std",
"librosa.core.db_to_amplitude",
"librosa.core.pitch_tuning",
"numpy.median",
"librosa.core.pitch.piptrack",
"librosa.load",
"librosa.co... | [((4283, 4303), 'os.listdir', 'os.listdir', (['filepath'], {}), '(filepath)\n', (4293, 4303), False, 'import os\n'), ((4356, 4377), 'os.listdir', 'os.listdir', (['filepath1'], {}), '(filepath1)\n', (4366, 4377), False, 'import os\n'), ((375, 408), 'librosa.load', 'lr.load', (['speech_fileName'], {'sr': 'None'}), '(spee... |
from extraction import Extraction
from transform import Transform
from db_search import DbSearch
if __name__ == '__main__':
task = input('Buscar coincidencias de proyectos (y/n): ')
if task == 'y':
country = input('Country: ')
funding = input('Funding: ')
keywords = input('Keywords: '... | [
"extraction.Extraction",
"db_search.DbSearch",
"transform.Transform"
] | [((343, 379), 'db_search.DbSearch', 'DbSearch', (['country', 'funding', 'keywords'], {}), '(country, funding, keywords)\n', (351, 379), False, 'from db_search import DbSearch\n'), ((464, 640), 'extraction.Extraction', 'Extraction', (['"""../../../selenium_driver/chromedriver96.exe"""', '"""https://www.grants.gov/web/gr... |
import os
from pytest import approx
from pymt.component.component import Component
from pymt.framework.services import del_component_instances
def test_no_events(with_no_components):
del_component_instances(["AirPort"])
comp = Component("AirPort", uses=[], provides=[], events=[])
comp.go()
assert c... | [
"pymt.component.component.Component.from_string",
"pymt.component.component.Component",
"pymt.framework.services.del_component_instances",
"os.path.isfile",
"pytest.approx"
] | [((191, 227), 'pymt.framework.services.del_component_instances', 'del_component_instances', (["['AirPort']"], {}), "(['AirPort'])\n", (214, 227), False, 'from pymt.framework.services import del_component_instances\n'), ((240, 293), 'pymt.component.component.Component', 'Component', (['"""AirPort"""'], {'uses': '[]', 'p... |
"""Takes an input VCF file and convert it to an interval list
for use by Broad oxog metrics tool. This assumes that the
input VCF only contains SNPs.
@author: <NAME> <<EMAIL>>
"""
import pysam
from gdc_filtration_tools.logger import Logger
def create_oxog_intervals(input_vcf: str, output_file: str) -> None:
"""... | [
"gdc_filtration_tools.logger.Logger.get_logger",
"pysam.VariantFile"
] | [((583, 625), 'gdc_filtration_tools.logger.Logger.get_logger', 'Logger.get_logger', (['"""create_oxog_intervals"""'], {}), "('create_oxog_intervals')\n", (600, 625), False, 'from gdc_filtration_tools.logger import Logger\n'), ((806, 834), 'pysam.VariantFile', 'pysam.VariantFile', (['input_vcf'], {}), '(input_vcf)\n', (... |
import heapq
from dataclasses import dataclass, field
from typing import Any, Optional, Tuple
import torch
import torch.nn as nn
from torch_geometric.data import Data
def get_node_proba(net, x, edge_index, edge_attr, num_categories=20):
raise Exception("Use get_node_outputs instead!")
def get_node_value(net, x... | [
"torch.ones_like",
"torch.multinomial",
"torch.zeros_like",
"heapq.heapify",
"torch.softmax",
"dataclasses.field",
"heapq.heappop",
"torch.no_grad",
"torch.log",
"dataclasses.dataclass"
] | [((421, 436), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (434, 436), False, 'import torch\n'), ((2933, 2948), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (2946, 2948), False, 'import torch\n'), ((3889, 3904), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (3902, 3904), False, 'import torch\n'), ((... |
import pickle
import numpy as np
import sklearn as skl
import tensorflow as tf
import matplotlib.pyplot as plt
# Set up GPU
gpus = tf.config.experimental.list_physical_devices('GPU')
if gpus:
try:
for gpu in gpus:
tf.config.experimental.set_memory_growth(gpu, True)
except RuntimeError as e... | [
"tensorflow.config.experimental.list_physical_devices",
"tensorflow.config.experimental.set_memory_growth",
"tensorflow.keras.models.load_model"
] | [((133, 184), 'tensorflow.config.experimental.list_physical_devices', 'tf.config.experimental.list_physical_devices', (['"""GPU"""'], {}), "('GPU')\n", (177, 184), True, 'import tensorflow as tf\n'), ((898, 943), 'tensorflow.keras.models.load_model', 'tf.keras.models.load_model', (['"""models/model.h5"""'], {}), "('mod... |
from uuid import uuid4
from ee.clickhouse.models.event import create_event
from ee.clickhouse.queries.funnels.funnel_correlation_persons import FunnelCorrelationPersons
from ee.clickhouse.util import ClickhouseTestMixin
from posthog.constants import INSIGHT_FUNNELS
from posthog.models import Cohort, Filter
from postho... | [
"posthog.models.Filter",
"posthog.models.person.Person",
"uuid.uuid4",
"ee.clickhouse.models.event.create_event",
"posthog.models.person.Person.objects.create",
"ee.clickhouse.queries.funnels.funnel_correlation_persons.FunnelCorrelationPersons"
] | [((562, 593), 'posthog.models.person.Person.objects.create', 'Person.objects.create', ([], {}), '(**kwargs)\n', (583, 593), False, 'from posthog.models.person import Person\n'), ((605, 645), 'posthog.models.person.Person', 'Person', ([], {'id': 'person.uuid', 'uuid': 'person.uuid'}), '(id=person.uuid, uuid=person.uuid)... |
"""
Start the application
"""
import os
import getpass
from kibana_index_alert_tool import main
from dotenv import load_dotenv
home = os.path.expanduser("~")
load_dotenv(f'/{home}/.kibana_index_alert_tool')
if __name__ == '__main__':
main()
| [
"dotenv.load_dotenv",
"os.path.expanduser",
"kibana_index_alert_tool.main"
] | [((141, 164), 'os.path.expanduser', 'os.path.expanduser', (['"""~"""'], {}), "('~')\n", (159, 164), False, 'import os\n'), ((165, 213), 'dotenv.load_dotenv', 'load_dotenv', (['f"""/{home}/.kibana_index_alert_tool"""'], {}), "(f'/{home}/.kibana_index_alert_tool')\n", (176, 213), False, 'from dotenv import load_dotenv\n'... |
import math
import random
import numpy as np
class RandomErasing_Tensor(object):
""" Randomly selects a rectangle region in an image and erases its pixels.
'Random Erasing Data Augmentation' by Zhong et al.
See https://arxiv.org/pdf/1708.04896.pdf
Args:
probability: The probability th... | [
"argparse.ArgumentParser",
"random.randint",
"random.uniform",
"cv2.cvtColor",
"cv2.imwrite",
"math.sqrt",
"cv2.imread",
"torch.from_numpy"
] | [((4355, 4376), 'cv2.imread', 'cv2.imread', (['"""./1.jpg"""'], {}), "('./1.jpg')\n", (4365, 4376), False, 'import cv2\n'), ((4381, 4412), 'cv2.imwrite', 'cv2.imwrite', (['"""org.tmp.jpg"""', 'img'], {}), "('org.tmp.jpg', img)\n", (4392, 4412), False, 'import cv2\n'), ((4662, 4683), 'cv2.imread', 'cv2.imread', (['"""./... |
from setuptools import setup
setup(
name="datavisualization",
version="1.2.0",
author="<NAME>",
packages=['datavisualization'],
install_requires=['matplotlib','IPython']
)
| [
"setuptools.setup"
] | [((30, 176), 'setuptools.setup', 'setup', ([], {'name': '"""datavisualization"""', 'version': '"""1.2.0"""', 'author': '"""<NAME>"""', 'packages': "['datavisualization']", 'install_requires': "['matplotlib', 'IPython']"}), "(name='datavisualization', version='1.2.0', author='<NAME>', packages=\n ['datavisualization'... |
from conans import ConanFile, CMake, tools
import os
required_conan_version = ">=1.33.0"
class OpenColorIOConan(ConanFile):
name = "opencolorio"
description = "A color management framework for visual effects and animation."
license = "BSD-3-Clause"
homepage = "https://opencolorio.org/"
url = "htt... | [
"conans.tools.get",
"conans.tools.Version",
"conans.tools.patch",
"conans.CMake",
"conans.tools.check_min_cppstd",
"conans.tools.remove_files_by_mask",
"os.path.join",
"conans.tools.collect_libs"
] | [((1849, 1960), 'conans.tools.get', 'tools.get', ([], {'destination': 'self._source_subfolder', 'strip_root': '(True)'}), "(**self.conan_data['sources'][self.version], destination=self.\n _source_subfolder, strip_root=True)\n", (1858, 1960), False, 'from conans import ConanFile, CMake, tools\n'), ((2085, 2096), 'con... |
import xml.etree.ElementTree as ET
from urllib.request import urlopen
import json
data = urlopen('https://lenta.ru/rss').read().decode('utf8')
root = ET.fromstring(data)
items = root.find('channel').findall('item')
result = []
for item in items:
for tag in ['pubDate', 'title']:
result.append({tag: item.fin... | [
"json.dump",
"urllib.request.urlopen",
"xml.etree.ElementTree.fromstring"
] | [((151, 170), 'xml.etree.ElementTree.fromstring', 'ET.fromstring', (['data'], {}), '(data)\n', (164, 170), True, 'import xml.etree.ElementTree as ET\n'), ((389, 409), 'json.dump', 'json.dump', (['result', 'f'], {}), '(result, f)\n', (398, 409), False, 'import json\n'), ((90, 121), 'urllib.request.urlopen', 'urlopen', (... |
def _init():
import atexit
import os
import sys
try:
import readline
except Exception:
readline = None
import types
import time
import uuid
import json
import pprint
import hashlib
import subprocess
import datetime
try:
import __builtin__
... | [
"readline.parse_and_bind",
"atexit.register",
"subprocess.Popen",
"uuid.uuid4",
"os.path.abspath",
"os.makedirs",
"json.dumps",
"types.ModuleType",
"readline.read_history_file",
"uuid.UUID",
"os.path.expanduser"
] | [((462, 493), 'os.path.expanduser', 'os.path.expanduser', (['"""~/.pyhist"""'], {}), "('~/.pyhist')\n", (480, 493), False, 'import os\n'), ((2405, 2432), 'types.ModuleType', 'types.ModuleType', (['"""helpers"""'], {}), "('helpers')\n", (2421, 2432), False, 'import types\n'), ((511, 531), 'os.makedirs', 'os.makedirs', (... |
import os, logging, json, datetime
from flask import session, request, redirect, url_for, jsonify, render_template, send_file, abort
from flask_cors import cross_origin
from .. import app
from .. import mongo
from ..common.utils import import_sepal_auth, requires_auth, generate_id
from ..common.fusiontables import s... | [
"flask.abort",
"flask.session.get",
"flask_cors.cross_origin",
"datetime.datetime.utcnow",
"flask.jsonify",
"flask.request.json.get",
"logging.getLogger"
] | [((395, 422), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (412, 422), False, 'import os, logging, json, datetime\n'), ((544, 590), 'flask_cors.cross_origin', 'cross_origin', ([], {'origins': "app.config['CO_ORIGINS']"}), "(origins=app.config['CO_ORIGINS'])\n", (556, 590), False, 'from ... |
from django.db import models
# from django.contrib.auth.models import User
from django.urls import reverse
class UrlDetailes(models.Model):
"""
# user field for authanticate
user = models.OneToOneField(User)
# click_n_time means number of times link clicked
click_n_time = models.IntegerField... | [
"django.db.models.CharField",
"django.db.models.DateTimeField",
"django.db.models.SlugField"
] | [((447, 480), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(1000)'}), '(max_length=1000)\n', (463, 480), False, 'from django.db import models\n'), ((499, 517), 'django.db.models.SlugField', 'models.SlugField', ([], {}), '()\n', (515, 517), False, 'from django.db import models\n'), ((532, 571),... |
import os
import pytest
from tiflash.utils import devices
class TestDevices():
def test_get_devices_directory(self, t_env):
expected = os.path.normpath(t_env['CCS_PATH'] +
'/ccs_base/common/targetdb/devices')
result = devices.get_devices_directory(t_env['CCS_P... | [
"tiflash.utils.devices.get_devicetypes",
"tiflash.utils.devices.get_cpu_xml",
"tiflash.utils.devices.get_default_connection_xml",
"tiflash.utils.devices.get_devicetype",
"os.path.normpath",
"pytest.mark.parametrize",
"tiflash.utils.devices.get_device_from_serno",
"tiflash.utils.devices.get_devices_dir... | [((1982, 2252), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""serno,expected"""', "[('L100', 'CC2650F128'), ('L110', 'CC2652R1F'), ('L200', 'CC1310F128'), (\n 'L210', 'CC1312R1F3'), ('L201', 'CC1310F128'), ('L400', 'CC1350F128'),\n ('L401', 'CC1350F128'), ('L410', 'CC1352R1F3'), ('L420', 'CC1352P1F3... |
from collections import namedtuple
Alias = namedtuple('Alias', ['primary', 'alternate', 'primary_height'])
class AliasTable(object):
"""
here is
`a nice explanation of alias tables: <http://www.keithschwarz.com/darts-dice-coins/>`_
`Vose's algorithm <https://web.archive.org/web/20131029203736/http:... | [
"collections.namedtuple"
] | [((44, 107), 'collections.namedtuple', 'namedtuple', (['"""Alias"""', "['primary', 'alternate', 'primary_height']"], {}), "('Alias', ['primary', 'alternate', 'primary_height'])\n", (54, 107), False, 'from collections import namedtuple\n')] |
# Author: <NAME>
# Date: 2015
"""
Entry-point for generating synthetic text images, as described in:
@InProceedings{Gupta16,
author = "<NAME>. and <NAME>. and <NAME>.",
title = "Synthetic Data for Text Localisation in Natural Images",
booktitle = "IEEE Conference on Computer Vision a... | [
"os.remove",
"argparse.ArgumentParser",
"os.path.basename",
"random.shuffle",
"create_recognition_dataset.convert_floating_coordinates_to_int",
"wget.download",
"create_recognition_dataset.get_string_representation_of_bbox",
"create_recognition_dataset.order_points",
"tarfile.open"
] | [((4121, 4147), 'random.shuffle', 'random.shuffle', (['range_list'], {}), '(range_list)\n', (4135, 4147), False, 'import random\n'), ((6115, 6191), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Genereate Synthetic Scene-Text Images"""'}), "(description='Genereate Synthetic Scene-Text Im... |
from common_ports import ports_and_services
import socket, re
def get_open_ports(target, port_range, verbose=None):
open_ports = []
ports = range(port_range[0], port_range[1] + 1)
try:
host = socket.gethostbyname(target)
except:
if re.search('[a-zA-Z]', target):
return 'Er... | [
"socket.gethostbyaddr",
"socket.socket",
"re.search",
"socket.gethostbyname"
] | [((215, 243), 'socket.gethostbyname', 'socket.gethostbyname', (['target'], {}), '(target)\n', (235, 243), False, 'import socket, re\n'), ((267, 296), 're.search', 're.search', (['"""[a-zA-Z]"""', 'target'], {}), "('[a-zA-Z]', target)\n", (276, 296), False, 'import socket, re\n'), ((462, 488), 'socket.gethostbyaddr', 's... |
import os
import pytest
from intervaltree import Interval
from viridian_workflow import primers
this_dir = os.path.dirname(os.path.abspath(__file__))
data_dir = os.path.join(this_dir, "data", "primers")
def test_AmpliconSet_from_json():
with pytest.raises(NotImplementedError):
primers.AmpliconSet.from_j... | [
"viridian_workflow.primers.AmpliconSet.from_tsv",
"os.path.abspath",
"viridian_workflow.primers.AmpliconSet.from_tsv_viridian_workflow_format",
"viridian_workflow.primers.AmpliconSet.from_json",
"pytest.raises",
"viridian_workflow.primers.Primer",
"viridian_workflow.primers.Amplicon",
"os.path.join",
... | [((163, 204), 'os.path.join', 'os.path.join', (['this_dir', '"""data"""', '"""primers"""'], {}), "(this_dir, 'data', 'primers')\n", (175, 204), False, 'import os\n'), ((125, 150), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (140, 150), False, 'import os\n'), ((386, 436), 'os.path.join', 'o... |
# Generated by Django 3.0.4 on 2020-03-17 08:46
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('books', '0009_auto_20200315_2015'),
]
operations = [
migrations.AddField(
model_name='book',
name='i... | [
"django.db.models.BooleanField",
"datetime.datetime"
] | [((350, 392), 'django.db.models.BooleanField', 'models.BooleanField', ([], {'blank': '(True)', 'null': '(True)'}), '(blank=True, null=True)\n', (369, 392), False, 'from django.db import migrations, models\n'), ((548, 598), 'datetime.datetime', 'datetime.datetime', (['(2020)', '(3)', '(24)', '(11)', '(46)', '(27)', '(36... |
"""Compute stats on the results."""
import arviz as az
from datetime import datetime
import numpy as np
import pandas as pd
from pathlib import Path
from pystan.misc import _summary
from scipy.stats import nbinom
from tqdm.auto import tqdm
from warnings import warn
from .io import extract_samples
def get_rhat(fit) ... | [
"pandas.DataFrame",
"arviz.from_pystan",
"numpy.sum",
"pandas.read_csv",
"numpy.zeros",
"tqdm.auto.tqdm",
"numpy.shape",
"datetime.datetime.strptime",
"numpy.mean",
"pathlib.Path",
"numpy.exp",
"pandas.Series",
"numpy.where",
"arviz.waic",
"warnings.warn",
"arviz.loo",
"numpy.var",
... | [((523, 550), 'pystan.misc._summary', '_summary', (['fit', "['lp__']", '[]'], {}), "(fit, ['lp__'], [])\n", (531, 550), False, 'from pystan.misc import _summary\n'), ((565, 656), 'pandas.DataFrame', 'pd.DataFrame', (["x['summary']"], {'columns': "x['summary_colnames']", 'index': "x['summary_rownames']"}), "(x['summary'... |
import urllib.request
import urllib
import re
import time
import xml
from xml.dom import minidom
import csv
f = open('comedy_comparisons.testtamp')
csv_f = csv.reader(f)
f1= open("funny.txt","w")
f2= open("notfunny.txt","w")
f1d= open("funnyd.txt","w")
f2d= open("notfunnyd.txt","w")
for row in csv_f:... | [
"urllib.request.urlretrieve",
"xml.dom.minidom.parse",
"csv.reader"
] | [((166, 179), 'csv.reader', 'csv.reader', (['f'], {}), '(f)\n', (176, 179), False, 'import csv\n'), ((542, 571), 'urllib.request.urlretrieve', 'urllib.request.urlretrieve', (['u'], {}), '(u)\n', (568, 571), False, 'import urllib\n'), ((687, 708), 'xml.dom.minidom.parse', 'minidom.parse', (['url[0]'], {}), '(url[0])\n',... |
import os
import sys
import numpy as np
import qcdb
from ..utils import *
@using("nwchem")
def test_grad():
h2o = qcdb.set_molecule(
"""
O 0.00000000 0.00000000 0.00000000
H 0.00000000 1.93042809 -1.10715266
H 0.00000000 -1.93042809 -1.10715266
... | [
"qcdb.variable",
"qcdb.set_options",
"numpy.array",
"qcdb.gradient",
"qcdb.set_molecule"
] | [((123, 337), 'qcdb.set_molecule', 'qcdb.set_molecule', (['"""\n O 0.00000000 0.00000000 0.00000000\n H 0.00000000 1.93042809 -1.10715266\n H 0.00000000 -1.93042809 -1.10715266\n units au"""'], {}), '(\n """\n O 0.00000000 0.00000000 0.00000... |
import turtle
tina= turtle.Turtle()
tina.pencolor("#ffcc33")
tina.fillcolor("#ffcc33")
tina.pensize(5)
tina.begin_fill()
tina.circle (80,360)
tina.end_fill()
tina.penup()
tina.goto(-40,100)
tina.pendown()
tina.pencolor("#000000")
tina.setheading(30)
tina.circle ((-30),60)
tina.penup()
tina.goto(20,100)
tina.pendown()
... | [
"turtle.Turtle"
] | [((21, 36), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (34, 36), False, 'import turtle\n')] |
# for file mangement and exiting
import os
import sys
# Qt imports
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QMainWindow
from PyQt5.QtWidgets import QWidget
from PyQt5.QtWidgets import QVBoxLayout, QHBoxLayout, QGridLayout
from PyQt5.QtWidgets import QLabel
from P... | [
"PyQt5.QtWidgets.QComboBox",
"PyQt5.QtWidgets.QLabel",
"PyQt5.QtWidgets.QWidget",
"PyQt5.QtWidgets.QGridLayout",
"PyQt5.QtWidgets.QHBoxLayout",
"PyQt5.QtWidgets.QPushButton",
"os.path.exists",
"PyQt5.QtWidgets.QCheckBox",
"PyQt5.QtWidgets.QLineEdit",
"PyQt5.QtWidgets.QVBoxLayout",
"PyQt5.QtWidge... | [((10513, 10535), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['sys.argv'], {}), '(sys.argv)\n', (10525, 10535), False, 'from PyQt5.QtWidgets import QApplication\n'), ((1119, 1132), 'PyQt5.QtWidgets.QHBoxLayout', 'QHBoxLayout', ([], {}), '()\n', (1130, 1132), False, 'from PyQt5.QtWidgets import QVBoxLayout, QHBoxL... |
# ---------------------------------------------------------------------------
# Copyright 2018 The Open Source Electronic Health Record Alliance
#
# 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 a... | [
"ICRParser.generate_all",
"json.load",
"argparse.ArgumentParser",
"LogManager.initLogging",
"unittest.TextTestRunner",
"os.path.isdir",
"os.path.exists",
"ICRParser.generate_pdf",
"ArgParserHelper.createArgParser",
"unittest.TestLoader",
"ICRParser.generate_json",
"ICRParser.generate_html",
... | [((6645, 6662), 'ArgParserHelper.createArgParser', 'createArgParser', ([], {}), '()\n', (6660, 6662), False, 'from ArgParserHelper import createArgParser\n'), ((6676, 6754), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""VistA ICR Parser"""', 'parents': '[init_parser]'}), "(description='... |
import webbrowser
webbrowser.open('https://www.crummy.com/software/BeautifulSoup/bs4/doc/')
| [
"webbrowser.open"
] | [((19, 92), 'webbrowser.open', 'webbrowser.open', (['"""https://www.crummy.com/software/BeautifulSoup/bs4/doc/"""'], {}), "('https://www.crummy.com/software/BeautifulSoup/bs4/doc/')\n", (34, 92), False, 'import webbrowser\n')] |
import grpc
import csv
#from tables import Table
from enum import IntEnum
from dynagatewaytypes import datatypes_pb2
from dynagatewaytypes import enums_pb2
from dynagatewaytypes import general_types_pb2
from dynagatewaytypes import authentication_pb2_grpc
from dynagatewaytypes import authentication_pb2
from dynagate... | [
"dynagatewaytypes.action_pb2_grpc.ActionServiceStub",
"dynagatewaytypes.authentication_pb2.ServiceAuth",
"dynagatewaytypes.topology_pb2_grpc.TopologyServiceStub",
"dynagatewaytypes.label_pb2_grpc.LabelServiceStub",
"dynagatewaytypes.networkquery_pb2_grpc.NetworkServiceStub",
"dynagatewaytypes.query_pb2_gr... | [((1161, 1223), 'dynagatewaytypes.authentication_pb2_grpc.AuthenticateServiceStub', 'authentication_pb2_grpc.AuthenticateServiceStub', (['self._channel'], {}), '(self._channel)\n', (1208, 1223), False, 'from dynagatewaytypes import authentication_pb2_grpc\n'), ((1307, 1355), 'dynagatewaytypes.action_pb2_grpc.ActionServ... |
from random import randint
choices=["rock", "paper", "scissors"]
player_lives = 5
computer_lives = 5
total_lives = 5
computer=choices[randint(0,2)]
player = False | [
"random.randint"
] | [((138, 151), 'random.randint', 'randint', (['(0)', '(2)'], {}), '(0, 2)\n', (145, 151), False, 'from random import randint\n')] |
import util
def first(input_path: str):
passwords = 0
with open(input_path) as file:
lines = file.read().splitlines()
for line in lines:
split = line.split()
(min_count_str, max_count_str) = split[0].split('-')
min_count = int(min_count_str)
max_count = int(max_coun... | [
"util.file_exists",
"util.get_input_path"
] | [((1175, 1204), 'util.get_input_path', 'util.get_input_path', (['__file__'], {}), '(__file__)\n', (1194, 1204), False, 'import util\n'), ((1212, 1234), 'util.file_exists', 'util.file_exists', (['path'], {}), '(path)\n', (1228, 1234), False, 'import util\n'), ((1263, 1285), 'util.file_exists', 'util.file_exists', (['pat... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: fnels
"""
import numpy as np
import maze
import random
import cv2
class EnvCleaner(object):
def __init__(self, N_agent, map_size, seed):
self.map_size = map_size
self.seed = seed
self.occupancy = self.generate_maze(seed)
... | [
"random.randint",
"cv2.waitKey",
"numpy.zeros",
"numpy.ones",
"cv2.rectangle",
"cv2.imshow"
] | [((4161, 4204), 'numpy.zeros', 'np.zeros', (['(self.map_size, self.map_size, 3)'], {}), '((self.map_size, self.map_size, 3))\n', (4169, 4204), True, 'import numpy as np\n'), ((5213, 5275), 'numpy.ones', 'np.ones', (['(self.map_size * enlarge, self.map_size * enlarge, 3)'], {}), '((self.map_size * enlarge, self.map_size... |
from collections import deque
import random
import numpy as np
import gym
from gym.wrappers import AtariPreprocessing
class Game():
def __init__(self, game_name, start_noop=2, last_n_frames=4, frameskip=4, grayscale_obs=True, scale_obs=False):
self.start_noop = start_noop
self.last_n_frames = ... | [
"random.randint",
"gym.make",
"gym.wrappers.AtariPreprocessing",
"numpy.clip",
"collections.deque"
] | [((392, 421), 'collections.deque', 'deque', (['[]', 'self.last_n_frames'], {}), '([], self.last_n_frames)\n', (397, 421), False, 'from collections import deque\n'), ((442, 461), 'gym.make', 'gym.make', (['game_name'], {}), '(game_name)\n', (450, 461), False, 'import gym\n'), ((778, 888), 'gym.wrappers.AtariPreprocessin... |
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 29 15:50:11 2021
@author: <NAME>
"""
import cv2 as cv
img = cv.imread("Lena.bmp", 0)
img2 = cv.imread("Baboon.png", 0)
cv.imshow("FirstOriginal.Img",img)
cv.imshow("SecondOriginal.Img",img2)
pic = img[:200,:200]
pic2 = img2[img2.shape[0]-200:img2.shape... | [
"cv2.waitKey",
"cv2.imread",
"cv2.imshow",
"cv2.destroyAllWindows"
] | [((119, 143), 'cv2.imread', 'cv.imread', (['"""Lena.bmp"""', '(0)'], {}), "('Lena.bmp', 0)\n", (128, 143), True, 'import cv2 as cv\n'), ((152, 178), 'cv2.imread', 'cv.imread', (['"""Baboon.png"""', '(0)'], {}), "('Baboon.png', 0)\n", (161, 178), True, 'import cv2 as cv\n'), ((182, 217), 'cv2.imshow', 'cv.imshow', (['""... |
"""
Build ensemble models from ensemble of RandomForestRegressor models
"""
import sys
import numpy as np
import pandas as pd
import xarray as xr
import datetime as datetime
import sklearn as sk
from sklearn.ensemble import RandomForestRegressor
import glob
# import AC_tools (https://github.com/tsherwen/AC_tools.git)... | [
"sklearn.model_selection.GridSearchCV",
"sklearn.externals.joblib.dump",
"os.remove",
"numpy.random.seed",
"sparse2spatial.RFRanalysis.add_ensemble_avg_std_to_dataset",
"sklearn.model_selection.train_test_split",
"gc.collect",
"sparse2spatial.utils.mk_da_of_predicted_values",
"glob.glob",
"AC_tool... | [((2564, 2601), 'sparse2spatial.utils.get_file_locations', 'utils.get_file_locations', (['"""data_root"""'], {}), "('data_root')\n", (2588, 2601), True, 'import sparse2spatial.utils as utils\n'), ((3096, 3127), 'sparse2spatial.utils.get_hyperparameter_dict', 'utils.get_hyperparameter_dict', ([], {}), '()\n', (3125, 312... |
import json
import sys
from textwrap import dedent
import pytest
from faker import Factory, Faker
from elasticsearch_faker._generator import FakeDocGenerator
from elasticsearch_faker._provider import re_provider
class TestFakeDocGenerator:
@pytest.mark.skipif(sys.version_info < (3, 6), reason="requires python3.... | [
"textwrap.dedent",
"elasticsearch_faker._provider.re_provider.findall",
"faker.Faker.seed",
"json.dumps",
"elasticsearch_faker._generator.FakeDocGenerator",
"pytest.mark.skipif",
"faker.Factory.create"
] | [((249, 338), 'pytest.mark.skipif', 'pytest.mark.skipif', (['(sys.version_info < (3, 6))'], {'reason': '"""requires python3.6 or higher"""'}), "(sys.version_info < (3, 6), reason=\n 'requires python3.6 or higher')\n", (267, 338), False, 'import pytest\n'), ((390, 406), 'faker.Factory.create', 'Factory.create', ([], ... |
import typing
from datetime import datetime
from .models import Member, User, Message
from . import utils
class ReadyEvent:
"""
Event called when the client is ready.
Attributes:
gateway_version (int): The version used for the WebSockets gateway
user (User): The bot using the gateway
... | [
"datetime.datetime.fromtimestamp"
] | [((2219, 2260), 'datetime.datetime.fromtimestamp', 'datetime.fromtimestamp', (["data['timestamp']"], {}), "(data['timestamp'])\n", (2241, 2260), False, 'from datetime import datetime\n')] |
# coding: utf-8
#
import numpy as np
import json
from socket import *
import select
import pygame
from pygame.locals import *
import sys
HOST = gethostname()
PORT = 1113
BUFSIZE = 1024
ADDR = ("127.0.0.1", PORT)
USER = 'Server'
INTERVAL=0.01
VEROCITY=100
LIFETIME=1000
#Window.fullscreen=True
class DataReceiver:
d... | [
"pygame.quit",
"pygame.event.get",
"pygame.display.set_mode",
"numpy.frombuffer",
"numpy.zeros",
"pygame.init",
"numpy.isnan",
"pygame.time.wait",
"pygame.display.update",
"pygame.display.set_caption",
"sys.exit"
] | [((1600, 1613), 'pygame.init', 'pygame.init', ([], {}), '()\n', (1611, 1613), False, 'import pygame\n'), ((1630, 1665), 'pygame.display.set_mode', 'pygame.display.set_mode', (['(600, 400)'], {}), '((600, 400))\n', (1653, 1665), False, 'import pygame\n'), ((1667, 1708), 'pygame.display.set_caption', 'pygame.display.set_... |
import enum
class CameraType(enum.Enum):
Orthographic = enum.auto()
Perspective = enum.auto()
class Vendor(enum.Enum):
Nvidia = enum.auto()
Intel = enum.auto()
Amd = enum.auto()
WindowsSoftware = enum.auto()
Unknown = enum.auto() | [
"enum.auto"
] | [((61, 72), 'enum.auto', 'enum.auto', ([], {}), '()\n', (70, 72), False, 'import enum\n'), ((91, 102), 'enum.auto', 'enum.auto', ([], {}), '()\n', (100, 102), False, 'import enum\n'), ((143, 154), 'enum.auto', 'enum.auto', ([], {}), '()\n', (152, 154), False, 'import enum\n'), ((167, 178), 'enum.auto', 'enum.auto', ([]... |
"""Tools to scrape relevant compound data from Materials Project and label their ions' SSEs appropriately."""
from multiprocessing import Pool
from operator import itemgetter
from pathlib import Path
from typing import Optional, Tuple, Union
import pandas as pd
import pyarrow.feather as feather
import pymatgen
import ... | [
"smact.structure_prediction.structure.SmactStructure.from_py_struct",
"matminer.data_retrieval.retrieve_MP.MPDataRetrieval",
"pyarrow.feather.write_feather",
"smact.data_loader.lookup_element_sse_pauling_data",
"smact.data_loader.lookup_element_sse2015_data",
"pymatgen.Structure.from_str",
"multiprocess... | [((3979, 4037), 'smact.data_loader.lookup_element_sse2015_data', 'smact_data.lookup_element_sse2015_data', (['symbol'], {'copy': '(False)'}), '(symbol, copy=False)\n', (4017, 4037), True, 'import smact.data_loader as smact_data\n'), ((1681, 1715), 'pyarrow.feather.write_feather', 'feather.write_feather', (['df_mp', 'fi... |
import pandas as pd
import numpy as np
class SexMismatch:
"""
Class to detect sex mismatch
"""
def __init__(self, threshold):
self.threshold = threshold
def predict_sex(self, sample):
if sample.region_counts is None:
return np.nan
total_count = sample.region... | [
"pandas.DataFrame",
"pandas.isna"
] | [((855, 876), 'pandas.DataFrame', 'pd.DataFrame', (['results'], {}), '(results)\n', (867, 876), True, 'import pandas as pd\n'), ((1012, 1045), 'pandas.isna', 'pd.isna', (["results['predicted_sex']"], {}), "(results['predicted_sex'])\n", (1019, 1045), True, 'import pandas as pd\n')] |
#!/usr/bin/env python
import pprint
from src.data_question_class_statistics import QuestionClassStatistics
from src.data_statistics import PassageStatsCalculator, QuestionsAnswersMinMaxAvgStats
from src.data_statistics_closed_set_answers import ClosedSetAnswerChecker
from src.data_statistics_extractive_answer import E... | [
"src.get_root.get_root",
"src.data_statistics.PassageStatsCalculator",
"src.data_statistics_closed_set_answers.ClosedSetAnswerChecker",
"src.data_question_class_statistics.QuestionClassStatistics",
"src.datafile_parser.DatafileParser.get_resource",
"src.data_statistics_extractive_answer.RecoverableAnswerC... | [((553, 579), 'src.data_statistics_extractive_answer.RecoverableAnswerChecker', 'RecoverableAnswerChecker', ([], {}), '()\n', (577, 579), False, 'from src.data_statistics_extractive_answer import RecoverableAnswerChecker, AppendHandler\n'), ((594, 609), 'src.data_statistics_extractive_answer.AppendHandler', 'AppendHand... |
# -*- coding: utf-8 -*-
"""
Created on Mon May 14 17:29:16 2018
@author: jdkern
"""
from __future__ import division
import pandas as pd
import numpy as np
def exchange(year):
df_data = pd.read_csv('../Time_series_data/Synthetic_demand_pathflows/Sim_daily_interchange.csv',header=0)
paths = ['SALBRYNB', 'ROSET... | [
"pandas.read_csv",
"pandas.DataFrame",
"pandas.read_excel"
] | [((192, 298), 'pandas.read_csv', 'pd.read_csv', (['"""../Time_series_data/Synthetic_demand_pathflows/Sim_daily_interchange.csv"""'], {'header': '(0)'}), "(\n '../Time_series_data/Synthetic_demand_pathflows/Sim_daily_interchange.csv',\n header=0)\n", (203, 298), True, 'import pandas as pd\n'), ((1716, 1822), 'pand... |
from O365 import contact
import unittest
import json
import time
class Resp:
def __init__(self,json_string,code=None):
self.jsons = json_string
self.status_code = code
def json(self):
return json.loads(self.jsons)
contact_rep = open('contacts.json','r').read()
contacts_json = json.loads(contact_rep)
jeb = c... | [
"unittest.main",
"json.loads",
"O365.contact.Contact"
] | [((289, 312), 'json.loads', 'json.loads', (['contact_rep'], {}), '(contact_rep)\n', (299, 312), False, 'import json\n'), ((2925, 2940), 'unittest.main', 'unittest.main', ([], {}), '()\n', (2938, 2940), False, 'import unittest\n'), ((202, 224), 'json.loads', 'json.loads', (['self.jsons'], {}), '(self.jsons)\n', (212, 22... |
from __future__ import annotations
import enum
import inspect
import sys
import typing as tp
import pylox.misc_utils as mu
import pylox.token_classes as tc
DEFAULT_ERROR = "Something very wrong has happened"
ErrorLine = tp.Union[int, str]
class ReturnsNT(tp.NamedTuple):
code: int
type: str
class ErrorRe... | [
"inspect.trace"
] | [((1804, 1819), 'inspect.trace', 'inspect.trace', ([], {}), '()\n', (1817, 1819), False, 'import inspect\n')] |
#!/usr/bin/python
import time
from utils.utils import print_time_log
def sum_of_proper_divisors(number: int):
"""
Let d(n) be defined as the sum of proper divisors of n
(numbers less than n which divide evenly into n).
:param number:
:return:
"""
divisors = []
for n in range(1, numbe... | [
"utils.utils.print_time_log",
"time.time"
] | [((583, 594), 'time.time', 'time.time', ([], {}), '()\n', (592, 594), False, 'import time\n'), ((905, 939), 'utils.utils.print_time_log', 'print_time_log', (['start_time', 'result'], {}), '(start_time, result)\n', (919, 939), False, 'from utils.utils import print_time_log\n')] |
# Generated by Django 3.2.5 on 2021-07-12 05:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('resumes', '0004_remove_contactdetails_address_2'),
]
operations = [
migrations.AddField(
model_name='contactdetails',
... | [
"django.db.models.CharField"
] | [((358, 443), 'django.db.models.CharField', 'models.CharField', ([], {'default': '"""India"""', 'help_text': '"""Enter your Address"""', 'max_length': '(800)'}), "(default='India', help_text='Enter your Address',\n max_length=800)\n", (374, 443), False, 'from django.db import migrations, models\n')] |
# -*- coding: utf-8 -*-
import os,sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../../utility'))
sys.path.append(os.path.join(os.path.dirname(__file__), '../../network'))
import numpy as np
import tensorflow as tf
from agent import Agent
from eager_nn import ActorNet, CriticNet
from optimizer import *
fr... | [
"tensorflow.random.normal",
"eager_nn.ActorNet",
"eager_nn.CriticNet",
"os.path.dirname",
"OU_noise.OrnsteinUhlenbeckProcess",
"tensorflow.train.get_or_create_global_step",
"tensorflow.device",
"tensorflow.stop_gradient",
"tensorflow.minimum",
"tensorflow.reduce_mean",
"tensorflow.cast",
"tens... | [((67, 92), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (82, 92), False, 'import os, sys\n'), ((141, 166), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (156, 166), False, 'import os, sys\n'), ((539, 591), 'OU_noise.OrnsteinUhlenbeckProcess', 'OrnsteinUhlenbeckP... |
from generator import (
DefinitionDataset,
ObjectDefinition,
gravity_support_objects,
)
def test_getters_reuse_immutable_dataset():
dataset_1 = (
gravity_support_objects.get_symmetric_target_definition_dataset(
unshuffled=True
)
)
dataset_2 = (
gravity_suppo... | [
"generator.gravity_support_objects.get_asymmetric_target_definition_dataset",
"generator.gravity_support_objects.get_symmetric_target_definition_dataset",
"generator.gravity_support_objects.create_pole_template",
"generator.gravity_support_objects.get_visible_support_object_definition"
] | [((172, 257), 'generator.gravity_support_objects.get_symmetric_target_definition_dataset', 'gravity_support_objects.get_symmetric_target_definition_dataset', ([], {'unshuffled': '(True)'}), '(unshuffled=True\n )\n', (235, 257), False, 'from generator import DefinitionDataset, ObjectDefinition, gravity_support_object... |
# Este programa funciona como um jogo de Par ou Impár, com varios if dentro de uma estrutura
# de repetição com uma flag
import random
j1 = c2 = re = pi = 0
lista1 = [2,4]
lista2 = [1,3,5]
lista3 = [1, 2, 3, 4, 5]
stop = ''
print('Este e a brincadeira do Par ou Impár!')
while True:
j1 = int(input('\nD... | [
"random.choice"
] | [((460, 481), 'random.choice', 'random.choice', (['lista3'], {}), '(lista3)\n', (473, 481), False, 'import random\n'), ((593, 614), 'random.choice', 'random.choice', (['lista3'], {}), '(lista3)\n', (606, 614), False, 'import random\n')] |
"""The default recommended pipeline.
If you don't need to produce your own augmentations or specialized pipelines,
you can use this to generate more images.
"""
import random
from augraphy.base.paperfactory import PaperFactory
from augraphy.base.oneof import OneOf
from augraphy.base.augmentationsequence import Augmen... | [
"augraphy.augmentations.brightnesstexturize.BrightnessTexturizeAugmentation",
"augraphy.augmentations.jpeg.JpegAugmentation",
"augraphy.augmentations.inkbleed.InkBleedAugmentation",
"augraphy.base.paperfactory.PaperFactory",
"augraphy.augmentations.dirtyrollers.DirtyRollersAugmentation",
"augraphy.augment... | [((3638, 3690), 'augraphy.base.augmentationpipeline.AugraphyPipeline', 'AugraphyPipeline', (['ink_phase', 'paper_phase', 'post_phase'], {}), '(ink_phase, paper_phase, post_phase)\n', (3654, 3690), False, 'from augraphy.base.augmentationpipeline import AugraphyPipeline\n'), ((1467, 1489), 'augraphy.augmentations.inkblee... |
# Generated by Django 3.0.5 on 2020-04-01 20:15
import django.db.models.deletion
import easy_thumbnails.fields
from django.conf import settings
from django.db import migrations, models
import userena.models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_... | [
"django.db.models.URLField",
"django.db.models.TextField",
"django.db.migrations.swappable_dependency",
"django.db.models.OneToOneField",
"django.db.models.CharField",
"django.db.models.AutoField",
"django.db.models.DateField"
] | [((299, 356), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', (['settings.AUTH_USER_MODEL'], {}), '(settings.AUTH_USER_MODEL)\n', (330, 356), False, 'from django.db import migrations, models\n'), ((529, 622), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)... |
# -*- coding: utf-8 -*-
from kafka import KafkaProducer
class Kafka(object):
def __init__(self,servers,zookeeper=None):
self.zookeeper = zookeeper
self.producer = KafkaProducer(bootstrap_servers=servers)
def send(self,topic,data):
future = self.producer.send(
topic,
... | [
"kafka.KafkaProducer"
] | [((185, 225), 'kafka.KafkaProducer', 'KafkaProducer', ([], {'bootstrap_servers': 'servers'}), '(bootstrap_servers=servers)\n', (198, 225), False, 'from kafka import KafkaProducer\n')] |
# Author by CRS-club and wizard
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
import numpy as np
import datetime
import logging
logger = logging.getLogger(__name__)
class MetricsCalculator():
def __init__(sel... | [
"numpy.argsort",
"numpy.zeros",
"numpy.array",
"logging.getLogger"
] | [((243, 270), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (260, 270), False, 'import logging\n'), ((2244, 2291), 'numpy.zeros', 'np.zeros', (['(batch_size, top_k)'], {'dtype': 'np.float32'}), '((batch_size, top_k), dtype=np.float32)\n', (2252, 2291), True, 'import numpy as np\n'), ((24... |
from django.conf import settings
from grandchallenge.core.utils.email import send_templated_email
def send_file_uploaded_notification_email(**kwargs):
uploader = kwargs["uploader"]
challenge = kwargs["challenge"]
site = kwargs["site"]
title = f"[{challenge.short_name.lower()}] New Upload"
admins ... | [
"grandchallenge.core.utils.email.send_templated_email"
] | [((1075, 1179), 'grandchallenge.core.utils.email.send_templated_email', 'send_templated_email', (['title', '"""uploads/emails/file_uploaded_email.html"""', 'kwargs', 'admin_email_adresses'], {}), "(title, 'uploads/emails/file_uploaded_email.html',\n kwargs, admin_email_adresses)\n", (1095, 1179), False, 'from grandc... |
import shutil
from os import listdir
from os.path import isfile, join
from pathlib import Path
outlier_files = {f for f in listdir("outlier") if isfile(join("outlier", f))}
raw_outlier_files = {Path(f).stem + ".jpg" for f in listdir("raw_outlier_datasets/") if isfile(join("raw_outlier_datasets/", f))}
move_files =... | [
"pathlib.Path",
"os.path.join",
"os.listdir"
] | [((127, 145), 'os.listdir', 'listdir', (['"""outlier"""'], {}), "('outlier')\n", (134, 145), False, 'from os import listdir\n'), ((229, 261), 'os.listdir', 'listdir', (['"""raw_outlier_datasets/"""'], {}), "('raw_outlier_datasets/')\n", (236, 261), False, 'from os import listdir\n'), ((156, 174), 'os.path.join', 'join'... |
# Author: <NAME> 2016
# Practice random shuffles, and see their effectiveness
import random
import math
list = ["Hola", "no", "estoy", "aqui", "Javi", "assca"]
# Inplace shuffle
def shuffle(list):
for index in range(0, len(list)):
new_index = random.randint(0, len(list) - 1)
var = list[index]
list[index] = lis... | [
"math.sqrt"
] | [((1104, 1129), 'math.sqrt', 'math.sqrt', (['(coeficient / n)'], {}), '(coeficient / n)\n', (1113, 1129), False, 'import math\n')] |
"""Interface Test with Pytest."""
import pytest # type: ignore
from grid.interface import Interface
from grid.settings import DEFAULT_EASY
# Protected access used to test functions
# Used by fixtures functions
# pylint: disable=W0212, W0621
@pytest.fixture(scope="function")
def easy_interface():
"""Create easy ... | [
"grid.interface.Interface",
"pytest.fixture"
] | [((246, 278), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (260, 278), False, 'import pytest\n'), ((350, 376), 'grid.interface.Interface', 'Interface', (['(4)', 'DEFAULT_EASY'], {}), '(4, DEFAULT_EASY)\n', (359, 376), False, 'from grid.interface import Interface\n')] |
from django.contrib import admin
from .models import Upload
admin.site.register(Upload)
| [
"django.contrib.admin.site.register"
] | [((61, 88), 'django.contrib.admin.site.register', 'admin.site.register', (['Upload'], {}), '(Upload)\n', (80, 88), False, 'from django.contrib import admin\n')] |
# uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: __init__.py
import dsz
import dsz.cmd
import dsz.data
import dsz.lp
class UpTime(dsz.data.Task):
def __init__(self, cmd=None):
dsz.data... | [
"dsz.cmd.data.ObjectGet",
"dsz.data.Task.__init__",
"dsz.cmd.data.Get",
"dsz.data.RegisterCommand"
] | [((2137, 2179), 'dsz.data.RegisterCommand', 'dsz.data.RegisterCommand', (['"""UpTime"""', 'UpTime'], {}), "('UpTime', UpTime)\n", (2161, 2179), False, 'import dsz\n'), ((312, 345), 'dsz.data.Task.__init__', 'dsz.data.Task.__init__', (['self', 'cmd'], {}), '(self, cmd)\n', (334, 345), False, 'import dsz\n'), ((429, 474)... |
import cv2
import pyvirtualcam
import numpy as np
#from pynput import keyboard
from tf_pose import common
from tf_pose.estimator import TfPoseEstimator
from tf_pose.networks import get_graph_path, model_wh
import time
from tf_pose.common import CocoPart
from util import calcThetas
from comparator import compareBodies
i... | [
"tf_pose.networks.get_graph_path",
"pyvirtualcam.Camera",
"cv2.VideoCapture",
"util.calcThetas",
"video_filter.Filter"
] | [((1074, 1110), 'cv2.VideoCapture', 'cv2.VideoCapture', (['self.webcam_source'], {}), '(self.webcam_source)\n', (1090, 1110), False, 'import cv2\n'), ((1798, 1829), 'video_filter.Filter', 'Filter', (['self.width', 'self.height'], {}), '(self.width, self.height)\n', (1804, 1829), False, 'from video_filter import Filter\... |
# The functions here assume input as a list of tokens (ie tokenized sentences),
# where each token was information about whether it is a word or a number.
# The text is assumed to be either japanese of English (target application is
# Japanese text which may contain English or Romanji).
#
# The token type may be (1) Hi... | [
"jphones.num2kana.Converter",
"pykakasi.kakasi",
"japanese_numbers.to_arabic"
] | [((750, 762), 'pykakasi.kakasi', 'pkk.kakasi', ([], {}), '()\n', (760, 762), True, 'import pykakasi as pkk\n'), ((1037, 1057), 'jphones.num2kana.Converter', 'num2kana.Converter', ([], {}), '()\n', (1055, 1057), False, 'from jphones import num2kana\n'), ((1579, 1610), 'japanese_numbers.to_arabic', 'jnums.to_arabic', (["... |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt4 (Qt v4.8.7)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = b"\
\x00\x00\x91\xc2\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x01\x78\x0... | [
"PyQt4.QtCore.qRegisterResourceData",
"PyQt4.QtCore.qUnregisterResourceData"
] | [((873616, 873707), 'PyQt4.QtCore.qRegisterResourceData', 'QtCore.qRegisterResourceData', (['(1)', 'qt_resource_struct', 'qt_resource_name', 'qt_resource_data'], {}), '(1, qt_resource_struct, qt_resource_name,\n qt_resource_data)\n', (873644, 873707), False, 'from PyQt4 import QtCore\n'), ((873737, 873830), 'PyQt4.Q... |
"""drop sighting_users
Revision ID: 24fad<PASSWORD>
Revises: <KEY>
Create Date: 2017-10-22 11:45:40.968564
"""
from alembic import op
import sqlalchemy as sa
import sys
from pathlib import Path
monocle_dir = str(Path(__file__).resolve().parents[2])
if monocle_dir not in sys.path:
sys.path.append(monocle_dir)
from... | [
"sys.path.append",
"alembic.op.drop_table",
"alembic.op.f",
"sqlalchemy.PrimaryKeyConstraint",
"pathlib.Path",
"sqlalchemy.UniqueConstraint",
"sqlalchemy.Column",
"sqlalchemy.ForeignKeyConstraint",
"sqlalchemy.String"
] | [((287, 315), 'sys.path.append', 'sys.path.append', (['monocle_dir'], {}), '(monocle_dir)\n', (302, 315), False, 'import sys\n'), ((563, 594), 'alembic.op.drop_table', 'op.drop_table', (['"""sighting_users"""'], {}), "('sighting_users')\n", (576, 594), False, 'from alembic import op\n'), ((757, 810), 'sqlalchemy.Column... |
"""Header lists for the `csv.DictReader` when reading Hytek-produced CSVs."""
import xlrd
from hytek_parser._utils import safe_cast
from hytek_parser.types import StrOrBytesPath
from ._utils import (
ExportXlsParseError,
extract_plain_value,
extract_time_value,
get_first_row_index,
get_offsets_fro... | [
"xlrd.open_workbook",
"hytek_parser._utils.safe_cast"
] | [((1106, 1130), 'xlrd.open_workbook', 'xlrd.open_workbook', (['file'], {}), '(file)\n', (1124, 1130), False, 'import xlrd\n'), ((2546, 2578), 'hytek_parser._utils.safe_cast', 'safe_cast', (['int', 'row[0].value', '(-1)'], {}), '(int, row[0].value, -1)\n', (2555, 2578), False, 'from hytek_parser._utils import safe_cast\... |
#!/usr/bin/env python
# encoding=utf-8
#codeby 道长且阻
#email @ydhcui/QQ664284092
from lib.docxtpl import DocxTemplate,InlineImage,RichText
from lib.docx import Document
from lib.docx.shared import Mm, Inches, Pt
from lib.jinja2 import Environment
import time
import re
import uuid
import csv
import base64
import ... | [
"lib.jinja2.Environment",
"csv.reader",
"lib.docx.shared.Mm",
"csv.DictReader",
"base64.b64decode",
"lib.docxtpl.DocxTemplate",
"lib.docx.Document",
"re.findall",
"re.compile"
] | [((459, 481), 'lib.docxtpl.DocxTemplate', 'DocxTemplate', (['template'], {}), '(template)\n', (471, 481), False, 'from lib.docxtpl import DocxTemplate, InlineImage, RichText\n'), ((502, 515), 'lib.jinja2.Environment', 'Environment', ([], {}), '()\n', (513, 515), False, 'from lib.jinja2 import Environment\n'), ((852, 89... |
import numpy as np
from scipy.stats.mstats import theilslopes
from scipy.interpolate import CubicSpline
import matplotlib.pyplot as plt
# define constants
_c = 299792.458 # speed of light in km s^-1
class SpecAnalysis:
'''Analyse astronomy spectra.
'''
def __init__(self, wavelength, flux, flux_err=None)... | [
"matplotlib.pyplot.axvline",
"numpy.sum",
"matplotlib.pyplot.show",
"numpy.abs",
"numpy.polyfit",
"numpy.polyval",
"numpy.median",
"scipy.interpolate.CubicSpline",
"matplotlib.pyplot.legend",
"numpy.argmax",
"numpy.std",
"numpy.min",
"numpy.mean",
"numpy.array",
"numpy.max",
"numpy.lin... | [((8851, 8862), 'numpy.array', 'np.array', (['x'], {}), '(x)\n', (8859, 8862), True, 'import numpy as np\n'), ((8871, 8882), 'numpy.array', 'np.array', (['y'], {}), '(y)\n', (8879, 8882), True, 'import numpy as np\n'), ((8909, 8919), 'numpy.mean', 'np.mean', (['x'], {}), '(x)\n', (8916, 8919), True, 'import numpy as np... |
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import pycore.tikz as tikz
import pycore.blocks as blocks
import pycore.execute as execute
def create_architecture():
input = 40
base_width = 64
arch = []
arch += tikz.start()
arch += tikz.image(name... | [
"sys.platform.startswith",
"pycore.tikz.start",
"pycore.tikz.pool",
"pycore.execute.tex_to_pdf",
"pycore.tikz.legend",
"pycore.blocks.conv_relu",
"pycore.tikz.double_connection",
"pycore.tikz.coordinate",
"pycore.tikz.resample",
"os.path.join",
"os.path.abspath",
"pycore.tikz.results_upsamplin... | [((280, 292), 'pycore.tikz.start', 'tikz.start', ([], {}), '()\n', (290, 292), True, 'import pycore.tikz as tikz\n'), ((305, 381), 'pycore.tikz.image', 'tikz.image', ([], {'name': '"""image_0"""', 'file': '"""\\\\input_image"""', 'to': '"""-3,0,0"""', 'size': '(10, 10)'}), "(name='image_0', file='\\\\input_image', to='... |
from distutils.core import setup
setup(
name='twjnt',
version='0.0.1',
packages=[''],
url='',
license='MIT',
author='jntme',
author_email='<EMAIL>',
description='A simple tool that offers some features to administrate your twitter account.'
)
| [
"distutils.core.setup"
] | [((34, 255), 'distutils.core.setup', 'setup', ([], {'name': '"""twjnt"""', 'version': '"""0.0.1"""', 'packages': "['']", 'url': '""""""', 'license': '"""MIT"""', 'author': '"""jntme"""', 'author_email': '"""<EMAIL>"""', 'description': '"""A simple tool that offers some features to administrate your twitter account."""'... |
import numpy as np
#
class Rollout:
def __init__(self):
self.dict_obs = []
self.dict_next_obs = []
self.actions = []
self.rewards = []
self.terminals = []
self.agent_infos = []
self.env_infos = {}
self.path_length = 0
def __len__(self):
r... | [
"numpy.array",
"numpy.expand_dims"
] | [((909, 931), 'numpy.array', 'np.array', (['self.actions'], {}), '(self.actions)\n', (917, 931), True, 'import numpy as np\n'), ((1143, 1165), 'numpy.array', 'np.array', (['self.rewards'], {}), '(self.rewards)\n', (1151, 1165), True, 'import numpy as np\n'), ((1000, 1031), 'numpy.expand_dims', 'np.expand_dims', (['self... |
from rest_framework import serializers
from extras.models import CF_TYPE_SELECT, CustomFieldChoice, Graph
class CustomFieldSerializer(serializers.Serializer):
"""
Extends a ModelSerializer to render any CustomFields and their values associated with an object.
"""
custom_fields = serializers.Serialize... | [
"rest_framework.serializers.SerializerMethodField"
] | [((299, 334), 'rest_framework.serializers.SerializerMethodField', 'serializers.SerializerMethodField', ([], {}), '()\n', (332, 334), False, 'from rest_framework import serializers\n'), ((1734, 1769), 'rest_framework.serializers.SerializerMethodField', 'serializers.SerializerMethodField', ([], {}), '()\n', (1767, 1769),... |
import Adafruit_DHT
import requests
from time import sleep
req_url = 'http://localhost:7777/'
sensor = Adafruit_DHT.DHT22
pin = 4
def createRequestData(temperature, humidity, electricalOutlet):
json = '''{{ "temperature": {}, "humidity": {}, "electricalOutlet": {} }}'''
return json.format(temperature, humidit... | [
"requests.post",
"Adafruit_DHT.read_retry",
"time.sleep"
] | [((482, 515), 'requests.post', 'requests.post', (['req_url'], {'data': 'data'}), '(req_url, data=data)\n', (495, 515), False, 'import requests\n'), ((599, 635), 'Adafruit_DHT.read_retry', 'Adafruit_DHT.read_retry', (['sensor', 'pin'], {}), '(sensor, pin)\n', (622, 635), False, 'import Adafruit_DHT\n'), ((790, 799), 'ti... |
import unittest
from atoll import Pipeline
def lowercase(x):
return x.lower()
def tokenize(x, delimiter=' '):
return x.split(delimiter)
def word_counter(x):
return len(x)
def count_per_key(value):
return len(value)
def add(x, y):
return x + y
def make_list(x):
return ['a', x]
class Pipe... | [
"atoll.Pipeline"
] | [((1892, 1902), 'atoll.Pipeline', 'Pipeline', ([], {}), '()\n', (1900, 1902), False, 'from atoll import Pipeline\n'), ((2154, 2164), 'atoll.Pipeline', 'Pipeline', ([], {}), '()\n', (2162, 2164), False, 'from atoll import Pipeline\n'), ((2376, 2386), 'atoll.Pipeline', 'Pipeline', ([], {}), '()\n', (2384, 2386), False, '... |
import os
import BeeVeeH
import pytest
BVH_DIR = '%s/bvh_files' % os.path.dirname(__file__)
class TestCase():
def test_bvh_play(self):
file_path = '%s/0007_Cartwheel001.bvh' % BVH_DIR
if not BeeVeeH.start(file_path, test=True):
pytest.skip('Cannot launch the app due to SystemExit, reas... | [
"os.path.dirname",
"BeeVeeH.start",
"pytest.skip"
] | [((67, 92), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (82, 92), False, 'import os\n'), ((213, 248), 'BeeVeeH.start', 'BeeVeeH.start', (['file_path'], {'test': '(True)'}), '(file_path, test=True)\n', (226, 248), False, 'import BeeVeeH\n'), ((262, 330), 'pytest.skip', 'pytest.skip', (['"""... |
print('importing packages...')
import numpy as np
import cv2
import math
import random
import time
import rotate_brush as rb
import gradient
from thready import amap
import os
import threading
canvaslock = threading.Lock()
canvaslock.acquire()
canvaslock.release()
def lockgen(canvas,ym,yp,xm,xp):
# given roi, kno... | [
"os.mkdir",
"numpy.maximum",
"numpy.sum",
"numpy.mean",
"cv2.imshow",
"rotate_brush.get_brush",
"os.path.exists",
"threading.Lock",
"cv2.destroyAllWindows",
"cv2.resize",
"json.dump",
"cv2.waitKey",
"random.random",
"json.load",
"cv2.blur",
"time.time",
"gradient.get_phase",
"cv2.i... | [((207, 223), 'threading.Lock', 'threading.Lock', ([], {}), '()\n', (221, 223), False, 'import threading\n'), ((722, 742), 'cv2.imread', 'cv2.imread', (['filename'], {}), '(filename)\n', (732, 742), False, 'import cv2\n'), ((1378, 1393), 'random.random', 'random.random', ([], {}), '()\n', (1391, 1393), False, 'import r... |
from setuptools import setup, find_packages
if __name__ == "__main__":
setup(
name="snapx",
author="<EMAIL>",
version="0.0.1",
packages=find_packages(),
description="""SnapX: An experimental SNAP API with NetworkX-like interface"""
)
| [
"setuptools.find_packages"
] | [((173, 188), 'setuptools.find_packages', 'find_packages', ([], {}), '()\n', (186, 188), False, 'from setuptools import setup, find_packages\n')] |
# -*- coding: utf-8 -*-
import os
import unittest
from intercom.client import Client
from . import delete_company
from . import delete_user
from . import get_or_create_user
from . import get_or_create_company
from . import get_timestamp
intercom = Client(
os.environ.get('INTERCOM_PERSONAL_ACCESS_TOKEN'))
class ... | [
"os.environ.get"
] | [((262, 310), 'os.environ.get', 'os.environ.get', (['"""INTERCOM_PERSONAL_ACCESS_TOKEN"""'], {}), "('INTERCOM_PERSONAL_ACCESS_TOKEN')\n", (276, 310), False, 'import os\n')] |