code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
import katagames_sdk as katasdk
import katagames_engine as kengi
TetColors = kengi.struct.enum(
'Clear',
'Gray',
'Pink'
)
| [
"katagames_engine.struct.enum"
] | [((78, 120), 'katagames_engine.struct.enum', 'kengi.struct.enum', (['"""Clear"""', '"""Gray"""', '"""Pink"""'], {}), "('Clear', 'Gray', 'Pink')\n", (95, 120), True, 'import katagames_engine as kengi\n')] |
from django.conf import settings
from django.core.mail.backends.base import BaseEmailBackend
from djcelery_email.tasks import send_emails
def chunked(iterator, chunksize):
"""
Yields items from 'iterator' in chunks of size 'chunksize'.
>>> list(chunked([1, 2, 3, 4, 5], chunksize=2))
[(1, 2), (3, 4),... | [
"djcelery_email.tasks.send_emails.delay"
] | [((919, 961), 'djcelery_email.tasks.send_emails.delay', 'send_emails.delay', (['chunk', 'self.init_kwargs'], {}), '(chunk, self.init_kwargs)\n', (936, 961), False, 'from djcelery_email.tasks import send_emails\n')] |
from biothings.web.query.builder import *
from pprint import pprint as print
def test_sql():
builder = SQLQueryBuilder({
"album": "album",
"track": "track"
})
print(builder.build(
'term', scopes=['fieldA', 'fieldB'],
biothing_type='track'
))
print(builder.build(
... | [
"pprint.pprint"
] | [((2048, 2060), 'pprint.pprint', 'print', (['query'], {}), '(query)\n', (2053, 2060), True, 'from pprint import pprint as print\n')] |
#!/usr/bin/env python
import numpy as np
from pydantic.dataclasses import dataclass
from pydantic import BaseModel
from typing import Dict, List, Tuple, Text
from clu.phontools.alignment.realine import ReAline
class Metrics(object):
"""
Metrics take the output of ReAline and
calculates edit distance, phon... | [
"clu.phontools.alignment.realine.ReAline"
] | [((376, 385), 'clu.phontools.alignment.realine.ReAline', 'ReAline', ([], {}), '()\n', (383, 385), False, 'from clu.phontools.alignment.realine import ReAline\n')] |
from falcon import HTTP_200
from json import dumps
from mako.template import Template
class TestAngularApp:
"""Test Angular App to display data from test API"""
test_template = Template(filename='angular/templates/test.mako')
def on_get(self, request, response):
"""getter for the API call"""
... | [
"mako.template.Template"
] | [((188, 236), 'mako.template.Template', 'Template', ([], {'filename': '"""angular/templates/test.mako"""'}), "(filename='angular/templates/test.mako')\n", (196, 236), False, 'from mako.template import Template\n')] |
from flask_restplus import Resource
from werkzeug.exceptions import NotFound
from app.extensions import api
from app.api.now_submissions.models.application_nda import ApplicationNDA
from app.api.now_submissions.response_models import APPLICATIONNDA
from app.api.utils.access_decorators import requires_role_view_all
fro... | [
"app.extensions.api.marshal_with",
"app.extensions.api.doc"
] | [((430, 494), 'app.extensions.api.doc', 'api.doc', ([], {'description': '"""Fetch an application nda by id"""', 'params': '{}'}), "(description='Fetch an application nda by id', params={})\n", (437, 494), False, 'from app.extensions import api\n'), ((528, 570), 'app.extensions.api.marshal_with', 'api.marshal_with', (['... |
import json
from contextlib import contextmanager
from operator import attrgetter, methodcaller
import attr
from acme import challenges, errors, jose, jws, messages
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asym... | [
"twisted.web.http_headers.Headers",
"twisted.internet.task.Clock",
"testtools.matchers.Always",
"zope.interface.implementer",
"txacme.test.strategies.dns_names",
"txacme.test.strategies.urls",
"json.dumps",
"txacme.util.generate_private_key",
"txacme.client.Client._expect_response",
"testtools.mat... | [((2931, 2963), 'acme.jose.JWKRSA', 'jose.JWKRSA', ([], {'key': 'RSA_KEY_512_RAW'}), '(key=RSA_KEY_512_RAW)\n', (2942, 2963), False, 'from acme import challenges, errors, jose, jws, messages\n'), ((7943, 7966), 'zope.interface.implementer', 'implementer', (['IResponder'], {}), '(IResponder)\n', (7954, 7966), False, 'fr... |
from bs4 import BeautifulSoup
import urllib.request
import requests
url = "http://www.reddit.com/r/BabyYoda"
response = requests.get(url)
soup = BeautifulSoup(response.content, "html.parser")
images = soup.find_all("img", attrs={"alt":"Post image"})
number = 0
for image in images:
print(image["src"])
imag... | [
"bs4.BeautifulSoup",
"requests.get"
] | [((126, 143), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (138, 143), False, 'import requests\n'), ((152, 198), 'bs4.BeautifulSoup', 'BeautifulSoup', (['response.content', '"""html.parser"""'], {}), "(response.content, 'html.parser')\n", (165, 198), False, 'from bs4 import BeautifulSoup\n')] |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import unittest
from dotable import DotableDict, DotableList, Dotable
class ExtendedDotable(Dotable):
def __init__(self, myint, data=dict(), **kwargs):
super(ExtendedDotable, self).__init__(data)
class TestCore(unittest.TestCase):
def ... | [
"dotable.Dotable",
"dotable.DotableList",
"dotable.DotableDict"
] | [((1377, 1405), 'dotable.DotableDict', 'DotableDict', (['self.dictionary'], {}), '(self.dictionary)\n', (1388, 1405), False, 'from dotable import DotableDict, DotableList, Dotable\n'), ((1508, 1530), 'dotable.DotableList', 'DotableList', (['self.list'], {}), '(self.list)\n', (1519, 1530), False, 'from dotable import Do... |
from django.contrib import admin
from donor.models import *
class DonorAdmin(admin.ModelAdmin):
search_fields = ['cnn_name']
ordering = ('cnn_name',)
list_display = ('cnn_name','contribution_total_2020')
admin.site.register(Donor, DonorAdmin) | [
"django.contrib.admin.site.register"
] | [((218, 256), 'django.contrib.admin.site.register', 'admin.site.register', (['Donor', 'DonorAdmin'], {}), '(Donor, DonorAdmin)\n', (237, 256), False, 'from django.contrib import admin\n')] |
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
# Various runtime patches applied to Pip to work around issues or else bend Pip to Pex's needs.
import os
import runpy
# N.B.: The following environment variables are used by the Pex run... | [
"json.load",
"pip._vendor.packaging.tags.parse_tag",
"re.search",
"runpy.run_module",
"os.environ.pop",
"pip._internal.resolution.resolvelib.candidates.RequiresPythonCandidate"
] | [((398, 439), 'os.environ.pop', 'os.environ.pop', (['"""_PEX_SKIP_MARKERS"""', 'None'], {}), "('_PEX_SKIP_MARKERS', None)\n", (412, 439), False, 'import os\n'), ((463, 512), 'os.environ.pop', 'os.environ.pop', (['"""_PEX_PATCHED_MARKERS_FILE"""', 'None'], {}), "('_PEX_PATCHED_MARKERS_FILE', None)\n", (477, 512), False,... |
"""Global admin settings, options and preferences."""
from truestory.models.base import BaseModel, SingletonMixin, ndb
class PreferencesModel(SingletonMixin, BaseModel):
"""Singleton preferences and resources model."""
sites = ndb.JsonProperty(default={})
contradiction_threshold = ndb.FloatProperty(de... | [
"truestory.models.base.ndb.FloatProperty",
"truestory.models.base.ndb.JsonProperty"
] | [((241, 269), 'truestory.models.base.ndb.JsonProperty', 'ndb.JsonProperty', ([], {'default': '{}'}), '(default={})\n', (257, 269), False, 'from truestory.models.base import BaseModel, SingletonMixin, ndb\n'), ((300, 330), 'truestory.models.base.ndb.FloatProperty', 'ndb.FloatProperty', ([], {'default': '(0.5)'}), '(defa... |
# coding: utf-8
# In[101]:
get_ipython().run_cell_magic('javascript', '', '<!-- Ignore this block -->\nIPython.OutputArea.prototype._should_scroll = function(lines) {\n return false;\n}')
# In[102]:
get_ipython().run_line_magic('config', "InlineBackend.figure_format = 'retina'")
from __future__ import divis... | [
"matplotlib.pyplot.title",
"sklearn.model_selection.GridSearchCV",
"matplotlib.pyplot.show",
"sklearn.preprocessing.StandardScaler",
"matplotlib.pyplot.plot",
"pandas.read_csv",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.legend",
"sklearn.preprocessing.LabelEncoder",
"matplotli... | [((641, 701), 'pandas.read_csv', 'pd.read_csv', (["(directoryPath + '/winequality-red.csv')"], {'sep': '""";"""'}), "(directoryPath + '/winequality-red.csv', sep=';')\n", (652, 701), True, 'import pandas as pd\n'), ((999, 1084), 'sklearn.model_selection.train_test_split', 'train_test_split', (['wineData[selectedFeature... |
"""This module implements a class that..."""
from __future__ import print_function, unicode_literals
from builtins import range
import logging
from kivy.app import App
from kivy.core.window import Window
from kivy.lang import Builder
from kivy.properties import StringProperty
from kivy.uix.popup import Popup
from MU... | [
"kivy.core.window.Window.unbind",
"kivy.lang.Builder.load_string",
"kivy.properties.StringProperty",
"MUSCIMarker.utils.keypress_to_dispatch_key",
"logging.info",
"kivy.app.App.get_running_app",
"kivy.core.window.Window.bind",
"builtins.range"
] | [((1488, 1536), 'kivy.lang.Builder.load_string', 'Builder.load_string', (['mlclass_selection_dialog_kv'], {}), '(mlclass_selection_dialog_kv)\n', (1507, 1536), False, 'from kivy.lang import Builder\n'), ((1693, 1711), 'kivy.properties.StringProperty', 'StringProperty', (['""""""'], {}), "('')\n", (1707, 1711), False, '... |
import numpy as np
import pandas as pd
import predictor
data = pd.read_csv('CountryLatLong.csv')
for i in range(len(data)):
name = data['Country'][i]
lat = data['Latitude'][i]
long = data['Longitude'][i]
pred = predictor.predict([lat, long])
print('["', end='')
print(name, end='", ')
#pri... | [
"pandas.read_csv",
"predictor.predict"
] | [((64, 97), 'pandas.read_csv', 'pd.read_csv', (['"""CountryLatLong.csv"""'], {}), "('CountryLatLong.csv')\n", (75, 97), True, 'import pandas as pd\n'), ((229, 259), 'predictor.predict', 'predictor.predict', (['[lat, long]'], {}), '([lat, long])\n', (246, 259), False, 'import predictor\n')] |
# -*- coding: utf8 -*-
#
# Module ELEMENT
#
# Part of Nutils: open source numerical utilities for Python. Jointly developed
# by HvZ Computational Engineering, TU/e Multiscale Engineering Fluid Dynamics,
# and others. More info at http://nutils.org <<EMAIL>>. (c) 2014
"""
The transform module.
"""
from __future__ imp... | [
"numpy.eye",
"numpy.asarray",
"numpy.where",
"numpy.take",
"numpy.linalg.inv",
"numpy.array",
"numpy.dot",
"numpy.all"
] | [((11918, 11939), 'numpy.asarray', 'numpy.asarray', (['coords'], {}), '(coords)\n', (11931, 11939), False, 'import numpy\n'), ((2660, 2676), 'numpy.array', 'numpy.array', (['(1.0)'], {}), '(1.0)\n', (2671, 2676), False, 'import numpy\n'), ((2898, 2914), 'numpy.array', 'numpy.array', (['(1.0)'], {}), '(1.0)\n', (2909, 2... |
import asyncio
import os
import aiohttp.web
HOST = os.getenv( 'HOST', '0.0.0.0' )
PORT = int( os.getenv( 'PORT', 8080 ) )
async def testhandle( request ):
return aiohttp.web.Response( text = 'Test handle' )
async def websocket_handler( request ):
print( 'Websocket connection starting' )
ws = aiohttp.web.WebSocke... | [
"asyncio.get_event_loop",
"os.getenv"
] | [((53, 81), 'os.getenv', 'os.getenv', (['"""HOST"""', '"""0.0.0.0"""'], {}), "('HOST', '0.0.0.0')\n", (62, 81), False, 'import os\n'), ((96, 119), 'os.getenv', 'os.getenv', (['"""PORT"""', '(8080)'], {}), "('PORT', 8080)\n", (105, 119), False, 'import os\n'), ((676, 700), 'asyncio.get_event_loop', 'asyncio.get_event_lo... |
# Generated by Django 3.0.5 on 2020-04-19 00:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('chromatography', '0020_auto_20200419_0141'),
]
operations = [
migrations.AlterField(
model_name='gcsystem',
name='pr... | [
"django.db.models.CharField"
] | [((351, 437), 'django.db.models.CharField', 'models.CharField', ([], {'default': '"""GC-3855181"""', 'editable': '(False)', 'max_length': '(10)', 'unique': '(True)'}), "(default='GC-3855181', editable=False, max_length=10,\n unique=True)\n", (367, 437), False, 'from django.db import migrations, models\n'), ((557, 64... |
# -*- coding: utf-8 -*-
from nose.tools import assert_equal, assert_true
from tests.fixtures import DatabaseTest
from wikimetrics.models.centralauth import CentralAuthLocalUser as LocalUser
from wikimetrics.api import CentralAuthService
class CentralAuthServiceTest(DatabaseTest):
def setUp(self):
Database... | [
"wikimetrics.api.CentralAuthService",
"tests.fixtures.DatabaseTest.setUp",
"wikimetrics.models.centralauth.CentralAuthLocalUser",
"nose.tools.assert_equal"
] | [((312, 336), 'tests.fixtures.DatabaseTest.setUp', 'DatabaseTest.setUp', (['self'], {}), '(self)\n', (330, 336), False, 'from tests.fixtures import DatabaseTest\n'), ((1071, 1256), 'nose.tools.assert_equal', 'assert_equal', (["[{'raw_id_or_name': username_1, 'project': wiki_1}, {'raw_id_or_name':\n username_1, 'proj... |
import sruthi
records = sruthi.searchretrieve('https://suche.staatsarchiv.djiktzh.ch/SRU/', query='Zurich')
print("SRU version:", records.sru_version)
print("Count:", records.count)
print('')
for record in records:
# print fields from schema
print(record['reference'])
print(record['title'])
print(reco... | [
"sruthi.searchretrieve"
] | [((25, 113), 'sruthi.searchretrieve', 'sruthi.searchretrieve', (['"""https://suche.staatsarchiv.djiktzh.ch/SRU/"""'], {'query': '"""Zurich"""'}), "('https://suche.staatsarchiv.djiktzh.ch/SRU/', query=\n 'Zurich')\n", (46, 113), False, 'import sruthi\n')] |
#!/usr/bin/env python
"""Module containing a parser for a simple block enocded data format"""
import re
class ParseError(Exception):
"""Exception thrown when a parse error occurs"""
def __init__(self, msg):
Exception.__init__(self)
self.msg = msg
def __str__(self):
return repr(se... | [
"re.compile"
] | [((552, 573), 're.compile', 're.compile', (['"""\\\\s*#.*"""'], {}), "('\\\\s*#.*')\n", (562, 573), False, 'import re\n'), ((596, 629), 're.compile', 're.compile', (['"""\\\\s*begin\\\\s+(\\\\w+)"""'], {}), "('\\\\s*begin\\\\s+(\\\\w+)')\n", (606, 629), False, 'import re\n'), ((648, 679), 're.compile', 're.compile', ([... |
from securityheaders.models import Directive
from securityheaders.models.annotations import requireddirectives, requireddirectivevalues
@requireddirectivevalues('form-action','frame-ancestors','report-uri','report-to','require-sri-for','plugin-types','worker-src','style-src','object-src','manifest-src','frame-src','de... | [
"securityheaders.models.annotations.requireddirectivevalues"
] | [((138, 382), 'securityheaders.models.annotations.requireddirectivevalues', 'requireddirectivevalues', (['"""form-action"""', '"""frame-ancestors"""', '"""report-uri"""', '"""report-to"""', '"""require-sri-for"""', '"""plugin-types"""', '"""worker-src"""', '"""style-src"""', '"""object-src"""', '"""manifest-src"""', '"... |
import os
import re
import sys
sys.path.append('.')
from tasks import mimic_utils
import pandas as pd
def mp_in_hospital_mimic(mimic_dir: str, save_dir: str, seed: int, admission_only: bool):
"""
Extracts information needed for the task from the MIMIC dataset. Namely "TEXT" column from NOTEEVENTS.csv and
... | [
"sys.path.append",
"pandas.merge",
"tasks.mimic_utils.parse_args",
"tasks.mimic_utils.filter_notes",
"tasks.mimic_utils.save_mimic_split_patient_wise",
"os.path.join",
"re.compile"
] | [((32, 52), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (47, 52), False, 'import sys\n'), ((828, 924), 'tasks.mimic_utils.filter_notes', 'mimic_utils.filter_notes', (['mimic_notes', 'mimic_admissions'], {'admission_text_only': 'admission_only'}), '(mimic_notes, mimic_admissions, admission_text_o... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: <NAME>
# Date: Sept 2015
# License: GNU General Public License v3
# Developed for use by the EU H2020 MONROE project
"""
Subscribes to all MONROE.META events and stores them in JSON files.
This is the workaround version where I am using pollers to overc... | [
"json.load",
"json.loads",
"monroe_exporter.save_output",
"zmq.Poller",
"sys.exit",
"zmq.Context"
] | [((2101, 2113), 'zmq.Poller', 'zmq.Poller', ([], {}), '()\n', (2111, 2113), False, 'import zmq\n'), ((1651, 1664), 'zmq.Context', 'zmq.Context', ([], {}), '()\n', (1662, 1664), False, 'import zmq\n'), ((2741, 2753), 'zmq.Poller', 'zmq.Poller', ([], {}), '()\n', (2751, 2753), False, 'import zmq\n'), ((4612, 4665), 'monr... |
"""Module containing configurations for the date-based database data source"""
from datetime import date
from typing import Dict, Any, Optional, Type, Generator, Iterator
from sqlalchemy import text
from .config import DatabaseSourceDataModel
from ..base.date_based import DateBasedBaseSource
from ...destinations.dat... | [
"sqlalchemy.text"
] | [((1413, 1433), 'sqlalchemy.text', 'text', (['self.sql_query'], {}), '(self.sql_query)\n', (1417, 1433), False, 'from sqlalchemy import text\n')] |
#!/usr/bin/env python
import argparse
import numpy as np
import pandas as pd
from scipy import linalg
from tqdm import tqdm
import os
import logging
def get_args():
parser = argparse.ArgumentParser(description="calculate splicing scores per gene/cell")
parser.add_argument("--input", help="Name of the input file... | [
"pandas.DataFrame",
"logging.exception",
"argparse.ArgumentParser",
"logging.basicConfig",
"numpy.square",
"numpy.transpose",
"logging.info",
"scipy.linalg.svd",
"pandas.read_parquet",
"pandas.Series"
] | [((180, 258), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""calculate splicing scores per gene/cell"""'}), "(description='calculate splicing scores per gene/cell')\n", (203, 258), False, 'import argparse\n'), ((1029, 1184), 'logging.basicConfig', 'logging.basicConfig', ([], {'filename':... |
from setuptools import setup, find_packages
import os
version = '0.1'
setup(name='plonetheme.guria',
version=version,
description="An installable theme for Plone 3.0",
long_description=open("README.txt").read() + "\n" +
open(os.path.join("docs", "HISTORY.txt")).read(),
#... | [
"os.path.join",
"setuptools.find_packages"
] | [((750, 785), 'setuptools.find_packages', 'find_packages', ([], {'exclude': "['ez_setup']"}), "(exclude=['ez_setup'])\n", (763, 785), False, 'from setuptools import setup, find_packages\n'), ((268, 303), 'os.path.join', 'os.path.join', (['"""docs"""', '"""HISTORY.txt"""'], {}), "('docs', 'HISTORY.txt')\n", (280, 303), ... |
import contextlib
import os
import shutil
import subprocess
import tempfile
import time as pytime
from abc import ABC, abstractmethod
from pathlib import Path
from typing import IO, Any, List, NamedTuple, Optional, Union
SIGNALS = {
1: 'SIGHUP',
2: 'SIGINT',
3: 'SIGQUIT',
4: 'SIGILL',
5: 'SIGTRAP',... | [
"subprocess.run",
"shutil.which",
"contextlib.ExitStack",
"tempfile.TemporaryFile",
"pathlib.Path",
"time.monotonic"
] | [((1645, 1666), 'shutil.which', 'shutil.which', (['command'], {}), '(command)\n', (1657, 1666), False, 'import shutil\n'), ((2537, 2559), 'contextlib.ExitStack', 'contextlib.ExitStack', ([], {}), '()\n', (2557, 2559), False, 'import contextlib\n'), ((2980, 2998), 'time.monotonic', 'pytime.monotonic', ([], {}), '()\n', ... |
# -*- coding: utf-8 -*-
import numpy as np
from . import utils
def bias(predicted, reference):
"""
Calculate the bias between PREDICTED and REFERENCE.
B = mean(p) - mean(r)
where p is the predicted values, and r is the reference values.
Note that p & r must have the same number of values.
... | [
"numpy.mean"
] | [((727, 745), 'numpy.mean', 'np.mean', (['predicted'], {}), '(predicted)\n', (734, 745), True, 'import numpy as np\n'), ((748, 766), 'numpy.mean', 'np.mean', (['reference'], {}), '(reference)\n', (755, 766), True, 'import numpy as np\n')] |
#!/usr/bin/env python3
import argparse
import daemon
def main():
parser = argparse.ArgumentParser()
parser.add_argument('txid')
parser.add_argument('--dev', action='store_true')
parser.add_argument('--networkid')
parser.add_argument('--port')
args = parser.parse_args()
if args.dev:
... | [
"daemon.Daemon",
"argparse.ArgumentParser"
] | [((80, 105), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (103, 105), False, 'import argparse\n'), ((326, 402), 'daemon.Daemon', 'daemon.Daemon', ([], {'port': 'args.port', 'cookie_dir': 'f"""~/.tapyrus/dev-{args.networkid}"""'}), "(port=args.port, cookie_dir=f'~/.tapyrus/dev-{args.networkid}... |
"""Module for base class of Circle and Sphere."""
import numpy as np
from skspatial._functions import _contains_point
from skspatial.objects._base_spatial import _BaseSpatial
from skspatial.objects.point import Point
from skspatial.objects.vector import Vector
from skspatial.typing import array_like
class _BaseSpher... | [
"numpy.array_repr",
"skspatial.objects.point.Point",
"skspatial._functions._contains_point",
"skspatial.objects.vector.Vector.from_points"
] | [((558, 570), 'skspatial.objects.point.Point', 'Point', (['point'], {}), '(point)\n', (563, 570), False, 'from skspatial.objects.point import Point\n'), ((743, 768), 'numpy.array_repr', 'np.array_repr', (['self.point'], {}), '(self.point)\n', (756, 768), True, 'import numpy as np\n'), ((1241, 1279), 'skspatial._functio... |
import pytest
import doctest
import numpy as np
import pandas as pd
import neurokit as nk
import matplotlib
import os
run_tests_in_local = False
if __name__ == '__main__':
pytest.main()
doctest.testmod()
| [
"doctest.testmod",
"pytest.main"
] | [((179, 192), 'pytest.main', 'pytest.main', ([], {}), '()\n', (190, 192), False, 'import pytest\n'), ((197, 214), 'doctest.testmod', 'doctest.testmod', ([], {}), '()\n', (212, 214), False, 'import doctest\n')] |
import numpy
import openmm
import openmm.app
import openmm.unit
import qm3
import qm3.engines.openmm
import qm3.engines.xtb
import qm3.utils
import qm3.utils.hessian
import qm3.actions.minimize
import sys
import os
cwd = os.path.abspath( os.path.dirname( sys.argv[0] ) ) + os.sep
mol = qm3.molecule()
mol.p... | [
"qm3.engines.xtb.run",
"qm3.utils.hessian.numerical",
"qm3.utils.hessian.frequencies",
"qm3.utils.RT_modes",
"os.path.dirname",
"numpy.logical_not",
"qm3.molecule",
"qm3.utils.hessian.manage",
"qm3.actions.minimize.baker",
"openmm.app.charmmparameterset.CharmmParameterSet",
"numpy.array",
"ope... | [((300, 314), 'qm3.molecule', 'qm3.molecule', ([], {}), '()\n', (312, 314), False, 'import qm3\n'), ((360, 391), 'numpy.array', 'numpy.array', (['[40.0, 40.0, 40.0]'], {}), '([40.0, 40.0, 40.0])\n', (371, 391), False, 'import numpy\n'), ((476, 536), 'openmm.app.charmmpsffile.CharmmPsfFile', 'openmm.app.charmmpsffile.Ch... |
import numpy as np
import tensorflow as tf
from tensorflow.keras import Input, Model
from tensorflow.keras.layers import Dense
units = 4
enc = np.random.rand(4, 16, 32).reshape(4, -1, 32).astype('float32')
dec = np.random.rand(4, 32).reshape(4, 1, 32).astype('float32')
enc_h = Input(shape=(None, 32))
dec_h = Input(s... | [
"tensorflow.nn.softmax",
"tensorflow.reduce_sum",
"tensorflow.nn.tanh",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.Input",
"tensorflow.keras.Model",
"numpy.random.rand"
] | [((281, 304), 'tensorflow.keras.Input', 'Input', ([], {'shape': '(None, 32)'}), '(shape=(None, 32))\n', (286, 304), False, 'from tensorflow.keras import Input, Model\n'), ((313, 333), 'tensorflow.keras.Input', 'Input', ([], {'shape': '(1, 32)'}), '(shape=(1, 32))\n', (318, 333), False, 'from tensorflow.keras import Inp... |
"""
* Copyright (C) <NAME> - All Rights Reserved
* Written by <NAME> <<EMAIL>>, August 17th, 2017
* Licensing information can found in 'LICENSE', which is part of this source code package.
"""
import os
try:
import ujson as json
except:
import json
import yaml
import pytoml as toml
from panda3d.core impo... | [
"json.dump",
"yaml.load",
"json.load",
"os.makedirs",
"realtime.io.NetworkConnector.setup",
"panda3d.core.UniqueIdAllocator",
"realtime.io.NetworkConnector.shutdown",
"os.path.exists",
"yaml.dump",
"realtime.io.NetworkDatagram",
"pytoml.dump",
"direct.directnotify.DirectNotifyGlobal.directNoti... | [((6106, 6148), 'direct.directnotify.DirectNotifyGlobal.directNotify.newCategory', 'directNotify.newCategory', (['"""DatabaseServer"""'], {}), "('DatabaseServer')\n", (6130, 6148), False, 'from direct.directnotify.DirectNotifyGlobal import directNotify\n'), ((4555, 4600), 'panda3d.core.UniqueIdAllocator', 'UniqueIdAllo... |
## @file window.py
# @title Window object for game output
# @author <NAME>
# @date February 19, 2019
import pygame
from .constants import *
## @brief The class wraps pygame functionallity related to window sprite lists,
# clock speed, and rendering to a form that is easier to use for the
# pro... | [
"pygame.display.set_mode",
"pygame.time.Clock",
"pygame.display.flip"
] | [((427, 446), 'pygame.time.Clock', 'pygame.time.Clock', ([], {}), '()\n', (444, 446), False, 'import pygame\n'), ((469, 505), 'pygame.display.set_mode', 'pygame.display.set_mode', (['DEFAULT_RES'], {}), '(DEFAULT_RES)\n', (492, 505), False, 'import pygame\n'), ((963, 984), 'pygame.display.flip', 'pygame.display.flip', ... |
from urllib import urlencode
from json import loads
from tornado.web import authenticated
from tornado.websocket import WebSocketHandler
from amgut.handlers.base_handlers import BaseHandler
from amgut.connections import ag_data
from amgut import text_locale, media_locale
class AnimalSurveyHandler(BaseHandler):
... | [
"amgut.connections.ag_data.get_user_for_kit",
"amgut.connections.ag_data.getAnimalParticipants",
"amgut.connections.ag_data.getHumanParticipants"
] | [((4327, 4357), 'amgut.connections.ag_data.get_user_for_kit', 'ag_data.get_user_for_kit', (['skid'], {}), '(skid)\n', (4351, 4357), False, 'from amgut.connections import ag_data\n'), ((4387, 4428), 'amgut.connections.ag_data.getHumanParticipants', 'ag_data.getHumanParticipants', (['ag_login_id'], {}), '(ag_login_id)\n'... |
from math import ceil
import torch
from torch import nn
from torch.nn import functional as F
from torch_geometric.nn import DenseSAGEConv, dense_diff_pool
from torch_geometric.utils import to_dense_batch, to_dense_adj
from torch_geometric.transforms import ToDense
NUM_SAGE_LAYERS = 3
class SAGEConvolutions(nn.Modul... | [
"torch.nn.ReLU",
"math.ceil",
"torch.nn.ModuleList",
"torch_geometric.utils.to_dense_batch",
"torch.nn.BatchNorm1d",
"torch_geometric.nn.DenseSAGEConv",
"torch.cat",
"torch.nn.Softmax",
"torch.max",
"torch_geometric.nn.dense_diff_pool",
"torch.nn.Linear",
"torch_geometric.utils.to_dense_adj",
... | [((553, 596), 'torch_geometric.nn.DenseSAGEConv', 'DenseSAGEConv', (['in_channels', 'hidden_channels'], {}), '(in_channels, hidden_channels)\n', (566, 596), False, 'from torch_geometric.nn import DenseSAGEConv, dense_diff_pool\n'), ((616, 647), 'torch.nn.BatchNorm1d', 'nn.BatchNorm1d', (['hidden_channels'], {}), '(hidd... |
import gym
import torch
import ptan
from util import Agent, PGN
if __name__ == '__main__':
env = gym.make('CartPole-v1')
net = PGN(env.observation_space.shape[0], env.action_space.n)
net.load_state_dict(torch.load('cartpole_expert.mod'))
net.eval()
agent = Agent(net, apply_softmax=True,... | [
"torch.load",
"util.Agent",
"gym.make",
"util.PGN"
] | [((110, 133), 'gym.make', 'gym.make', (['"""CartPole-v1"""'], {}), "('CartPole-v1')\n", (118, 133), False, 'import gym\n'), ((145, 200), 'util.PGN', 'PGN', (['env.observation_space.shape[0]', 'env.action_space.n'], {}), '(env.observation_space.shape[0], env.action_space.n)\n', (148, 200), False, 'from util import Agent... |
#Uses transormed mask to deface raw images and saves defaced data
#conceptual idea and lines 13-18 from pydeface's __main__.py
#https://github.com/poldracklab/pydeface
#08/2018
import sys
from nibabel import load, Nifti1Image
subject = sys.argv[1]
session = sys.argv[2]
# multiply defacing mask by raw image and save
... | [
"nibabel.load"
] | [((393, 405), 'nibabel.load', 'load', (['infile'], {}), '(infile)\n', (397, 405), False, 'from nibabel import load, Nifti1Image\n'), ((420, 442), 'nibabel.load', 'load', (['"""invertmask.nii"""'], {}), "('invertmask.nii')\n", (424, 442), False, 'from nibabel import load, Nifti1Image\n')] |
"""Support for dScriptModule sensor devices."""
from __future__ import annotations
from typing import Final
import logging
import asyncio
from homeassistant.core import HomeAssistant
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .senso... | [
"logging.getLogger"
] | [((637, 664), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (654, 664), False, 'import logging\n')] |
# -*- coding: utf-8 -*-
import logging
import os
import pathlib
import click
@click.command()
@click.argument('kaggle_competition')
def main(kaggle_competition: str) -> None:
"""Fetches data files from Kaggle.
Retrieves all data files pertaining to the provided competition from the
Kaggle website. Dat... | [
"click.argument",
"logging.basicConfig",
"click.command",
"pathlib.Path",
"os.path.join",
"logging.getLogger"
] | [((81, 96), 'click.command', 'click.command', ([], {}), '()\n', (94, 96), False, 'import click\n'), ((98, 134), 'click.argument', 'click.argument', (['"""kaggle_competition"""'], {}), "('kaggle_competition')\n", (112, 134), False, 'import click\n'), ((621, 661), 'os.path.join', 'os.path.join', (['project_dir', '"""data... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib
from dataclasses import dataclass, field
from typing import List
import psutil
from ..common.base_collector import BaseCollector
"""
Collect all information on network based on:
- The psutil library (https://psutil.readthedocs.io/en/latest/#)
- The urlli... | [
"dataclasses.field",
"psutil.net_io_counters",
"urllib.request.urlopen"
] | [((1315, 1342), 'dataclasses.field', 'field', ([], {'default_factory': 'list'}), '(default_factory=list)\n', (1320, 1342), False, 'from dataclasses import dataclass, field\n'), ((1411, 1447), 'psutil.net_io_counters', 'psutil.net_io_counters', ([], {'pernic': '(False)'}), '(pernic=False)\n', (1433, 1447), False, 'impor... |
# -*- coding: utf-8 -*-
'''
################################
Acme::MetaSyntactic::wales_towns
################################
****
NAME
****
Acme::MetaSyntactic::wales_towns - Towns in Wales
***********
DESCRIPTION
***********
List of towns in Wales.
It would be nice to extend this to a list of all towns and ... | [
"random.shuffle",
"six.iteritems",
"random.choice",
"metasyntactic.base.parse_data"
] | [((4247, 4263), 'metasyntactic.base.parse_data', 'parse_data', (['DATA'], {}), '(DATA)\n', (4257, 4263), False, 'from metasyntactic.base import parse_data\n'), ((4478, 4502), 'six.iteritems', 'iteritems', (["data['names']"], {}), "(data['names'])\n", (4487, 4502), False, 'from six import iteritems\n'), ((4857, 4869), '... |
import requests
import re
import base64
def add_schema(url):
"""Returns a URL with scheme supplied given a URL string"""
if "http://" in url or "https://" in url:
return url
else:
return "http://" + url
def try_req(f):
def wrapper(*args, **kwargs):
try:
resp = f(*... | [
"re.match",
"requests.get"
] | [((2067, 2101), 'requests.get', 'requests.get', (['url'], {'headers': 'headers'}), '(url, headers=headers)\n', (2079, 2101), False, 'import requests\n'), ((2905, 2939), 'requests.get', 'requests.get', (['url'], {'headers': 'headers'}), '(url, headers=headers)\n', (2917, 2939), False, 'import requests\n'), ((4204, 4226)... |
#! /usr/bin/env python
import unittest
import Exchange
class TestOrder(unittest.TestCase):
def test_create(self):
o = Exchange.Order("A:AUDUSD:100:1.47\n")
self.assertEqual(o.qty, 100)
self.assertEqual(o.instrument, "AUDUSD")
self.assertEqual(o.id, "A")
self.assertEqual(o.p... | [
"unittest.main",
"Exchange.Order"
] | [((885, 900), 'unittest.main', 'unittest.main', ([], {}), '()\n', (898, 900), False, 'import unittest\n'), ((132, 169), 'Exchange.Order', 'Exchange.Order', (['"""A:AUDUSD:100:1.47\n"""'], {}), "('A:AUDUSD:100:1.47\\n')\n", (146, 169), False, 'import Exchange\n'), ((415, 453), 'Exchange.Order', 'Exchange.Order', (['"""A... |
from django.urls import path, re_path
from .views import *
urlpatterns = [
path('', project_search, name='home'),
# Project
path('project/create/', project_create, name='project_create'),
path('project/search/', project_search, name='project_search'),
path('project/update/<int:proj_id>', project_up... | [
"django.urls.re_path",
"django.urls.path"
] | [((80, 117), 'django.urls.path', 'path', (['""""""', 'project_search'], {'name': '"""home"""'}), "('', project_search, name='home')\n", (84, 117), False, 'from django.urls import path, re_path\n'), ((137, 199), 'django.urls.path', 'path', (['"""project/create/"""', 'project_create'], {'name': '"""project_create"""'}), ... |
# coding=utf-8
from __future__ import print_function # Python 2/3 compatibility
import boto3
from botocore.exceptions import ClientError
from ask_sdk_core.skill_builder import SkillBuilder
from ask_sdk_core.utils import is_request_type, is_intent_name
from ask_sdk_model import ui
from decimal import Decimal
import tim... | [
"random.randint",
"ask_sdk_core.skill_builder.SkillBuilder",
"decimal.Decimal",
"datetime.datetime.today",
"ask_sdk_core.utils.is_intent_name",
"ask_sdk_model.ui.StandardCard",
"json.dumps",
"time.time",
"ask_sdk_core.utils.is_request_type",
"boto3.resource",
"datetime.timedelta",
"requests.ge... | [((417, 468), 'boto3.resource', 'boto3.resource', (['"""dynamodb"""'], {'region_name': '"""us-west-2"""'}), "('dynamodb', region_name='us-west-2')\n", (431, 468), False, 'import boto3\n'), ((565, 579), 'decimal.Decimal', 'Decimal', (['(168.0)'], {}), '(168.0)\n', (572, 579), False, 'from decimal import Decimal\n'), ((1... |
# Generated by Django 2.1.7 on 2019-03-29 15:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('paytm', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='paytm_history',
name='MERC_UNQ_REF',
... | [
"django.db.models.CharField"
] | [((334, 413), 'django.db.models.CharField', 'models.CharField', ([], {'default': '"""not_set"""', 'max_length': '(30)', 'verbose_name': '"""MERC_UNQ_REF"""'}), "(default='not_set', max_length=30, verbose_name='MERC_UNQ_REF')\n", (350, 413), False, 'from django.db import migrations, models\n')] |
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
import scipy.integrate as integrate
plt.close('all')
# ------ defining constants ----- #
# -- using mks for convenience -- #
c = 2.998e8 # m / s
h = 6.626e-34 # m^s * kg / s
k = 1.31e-23 # J / K
b = 2.898e-3 # m * K
# ------ FU... | [
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.close",
"numpy.asarray",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"numpy.arange",
"numpy.loadtxt",
"numpy.exp",
"scipy.integrate.trapz",
"matplotlib.pyplot... | [((127, 143), 'matplotlib.pyplot.close', 'plt.close', (['"""all"""'], {}), "('all')\n", (136, 143), True, 'import matplotlib.pyplot as plt\n'), ((732, 771), 'numpy.loadtxt', 'np.loadtxt', (['"""UBV_ma06.txt"""'], {'skiprows': '(17)'}), "('UBV_ma06.txt', skiprows=17)\n", (742, 771), True, 'import numpy as np\n'), ((944,... |
# Tools for accessing system and machine functionality.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from flask import current_app, json
from glob import glob
import json
import os
import re
import time
from datetime import datetime
import subprocess
impo... | [
"os.remove",
"connecttools.post_to_adminservice",
"socket.socket",
"os.path.isfile",
"glob.glob",
"os.path.join",
"json.loads",
"os.uname",
"re.search",
"json.dump",
"os.stat",
"flask.current_app.logger.warn",
"os.path.basename",
"subprocess.check_output",
"re.match",
"subprocess.call"... | [((1223, 1455), 'connecttools.post_to_adminservice', 'post_to_adminservice', (['"""registerMachine"""', '(False)', "{'uuid': machine_info['system_uuid'], 'serialNumber': machine_info[\n 'system_serial'], 'model': machine_info['system_sku'], 'peripherals': {\n 'disks': machine_info['disks']}}"], {}), "('registerMa... |
#!/usr/bin/python
"""
(C) Copyright 2020 Intel Corporation.
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 ... | [
"apricot.skipForTicket",
"general_utils.run_task",
"time.sleep"
] | [((1303, 1329), 'apricot.skipForTicket', 'skipForTicket', (['"""DAOS-5504"""'], {}), "('DAOS-5504')\n", (1316, 1329), False, 'from apricot import TestWithServers, skipForTicket\n'), ((1713, 1726), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (1723, 1726), False, 'import time\n'), ((1767, 1780), 'time.sleep', 'ti... |
import numpy as np
import matplotlib.pyplot as plt
c = 0.2
g = lambda x: 1 if x > 1.0 else 0
R = 0.005
eta1 = lambda w, rho: -R*g(rho)*np.heaviside(w, 0)
eta2 = lambda w, rho: -R*g(rho)*np.heaviside(w, 0)
fa = lambda a, b, w1: w1*(a - a*b)
fb = lambda a, b, w2: -w2*(b - a*b)
def evolve( T, a0, b0, w1_0, w2_0 ):
... | [
"numpy.heaviside",
"matplotlib.pyplot.show",
"numpy.zeros",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.grid"
] | [((920, 938), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(1)', '(3)'], {}), '(1, 3)\n', (932, 938), True, 'import matplotlib.pyplot as plt\n'), ((1029, 1039), 'matplotlib.pyplot.grid', 'plt.grid', ([], {}), '()\n', (1037, 1039), True, 'import matplotlib.pyplot as plt\n'), ((1193, 1203), 'matplotlib.pyplot.show', ... |
import heapq
a = [1, 4, 7, 10]
b = [2, 5, 6, 11]
for c in heapq.merge( a, b ):
print( c ) | [
"heapq.merge"
] | [((59, 76), 'heapq.merge', 'heapq.merge', (['a', 'b'], {}), '(a, b)\n', (70, 76), False, 'import heapq\n')] |
#!/bin/env python
from tqdm import tqdm
import math
from itertools import product
import os
import requests
from multiprocessing.pool import ThreadPool
from argparse import ArgumentParser
from PIL import Image
path_local = "/home/morris/var/data/osm/{}/{}/{}"
url = {
'topo': "https://w1.oastatic.com/map/v1/to... | [
"PIL.Image.new",
"argparse.ArgumentParser",
"os.makedirs",
"multiprocessing.pool.ThreadPool",
"math.radians",
"math.tan",
"math.prod",
"os.path.exists",
"PIL.Image.open",
"requests.get"
] | [((854, 875), 'math.radians', 'math.radians', (['lat_deg'], {}), '(lat_deg)\n', (866, 875), False, 'import math\n'), ((2038, 2078), 'PIL.Image.new', 'Image.new', (['"""RGB"""', 'map_size'], {'color': '"""#fff"""'}), "('RGB', map_size, color='#fff')\n", (2047, 2078), False, 'from PIL import Image\n'), ((2092, 2130), 'PI... |
#!/usr/bin/env python3
from pathlib import Path
class Computer:
cursor = 0
def __init__(self, program):
self.program = program
def run(self):
while True:
k = self.program[self.cursor]
if 99 == k:
break
if 1 == k:
self.p... | [
"pathlib.Path"
] | [((700, 718), 'pathlib.Path', 'Path', (['"""input"""', '"""2"""'], {}), "('input', '2')\n", (704, 718), False, 'from pathlib import Path\n')] |
import json
import boto3
import time
import urllib
client = boto3.client('transcribe')
def lambda_handler(event, context):
# TODO implement
def extract_info(event):
put_info = event.get('Records')[-1]
bucket_key = put_info.get('s3').get('bucket').get('name')
audio_key = put_info.get('... | [
"urllib.request.urlopen",
"json.loads",
"boto3.client",
"time.sleep"
] | [((61, 87), 'boto3.client', 'boto3.client', (['"""transcribe"""'], {}), "('transcribe')\n", (73, 87), False, 'import boto3\n'), ((1438, 1451), 'time.sleep', 'time.sleep', (['(3)'], {}), '(3)\n', (1448, 1451), False, 'import time\n'), ((741, 764), 'json.loads', 'json.loads', (['script_json'], {}), '(script_json)\n', (75... |
import argparse
import logging
import requests
import time
class SaliansError(Exception):
pass
class NoResponseError(SaliansError):
pass
class PlayerInfo:
def __init__(self, active_planet, level, score, next_level_score):
self.active_planet = active_planet
self.level = level
se... | [
"argparse.ArgumentParser",
"logging.basicConfig",
"operator.methodcaller",
"time.sleep",
"requests.get",
"requests.post",
"logging.getLogger"
] | [((10018, 10057), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (10037, 10057), False, 'import logging\n'), ((10072, 10106), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""salians"""'], {}), "('salians')\n", (10095, 10106), False, 'import argparse\... |
# coding:utf-8
# 文档自定义模板过滤器
from app_doc.models import *
from django import template
register = template.Library()
# 获取文档的子文档
@register.filter(name='get_next_doc')
def get_next_doc(value):
data = Doc.objects.filter(parent_doc=value, status=1).values(
'id', 'name').order_by('sort')
return data
# 获取文... | [
"django.template.Library",
"traceback.print_exc"
] | [((97, 115), 'django.template.Library', 'template.Library', ([], {}), '()\n', (113, 115), False, 'from django import template\n'), ((3362, 3383), 'traceback.print_exc', 'traceback.print_exc', ([], {}), '()\n', (3381, 3383), False, 'import traceback\n'), ((5161, 5182), 'traceback.print_exc', 'traceback.print_exc', ([], ... |
# ############################################################
# Importing - Same For All Render Layer Tests
# ############################################################
import unittest
import os
import sys
from view_layer_common import *
# ############################################################
# Testing
# ... | [
"unittest.main",
"bpy.data.scenes.remove",
"bpy.data.scenes.new"
] | [((918, 933), 'unittest.main', 'unittest.main', ([], {}), '()\n', (931, 933), False, 'import unittest\n'), ((585, 611), 'bpy.data.scenes.new', 'bpy.data.scenes.new', (['"""New"""'], {}), "('New')\n", (604, 611), False, 'import bpy\n'), ((620, 649), 'bpy.data.scenes.remove', 'bpy.data.scenes.remove', (['scene'], {}), '(... |
# Create Dummies
# ==============================================================================
""" import sys
new_path = '../scripts/'
if new_path not in sys.path:
sys.path.append(new_path)"""
# ==============================================================================
import pandas as pd
from skle... | [
"pandas.get_dummies",
"pandas.concat"
] | [((403, 448), 'pandas.get_dummies', 'pd.get_dummies', (['df[var_name]'], {'prefix': 'var_name'}), '(df[var_name], prefix=var_name)\n', (417, 448), True, 'import pandas as pd\n'), ((495, 525), 'pandas.concat', 'pd.concat', (['[df, dummy]'], {'axis': '(1)'}), '([df, dummy], axis=1)\n', (504, 525), True, 'import pandas as... |
# Copyright 2017 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | [
"copy.deepcopy",
"utils.mathUtils.diffWithInfinites",
"utils.randomUtils.random"
] | [((3172, 3190), 'copy.deepcopy', 'copy.deepcopy', (['opt'], {}), '(opt)\n', (3185, 3190), False, 'import copy\n'), ((4159, 4211), 'utils.mathUtils.diffWithInfinites', 'mathUtils.diffWithInfinites', (['pt[objVar]', 'opt[objVar]'], {}), '(pt[objVar], opt[objVar])\n', (4186, 4211), False, 'from utils import InputData, Inp... |
# _*_ encoding:utf-8 _*_
"""
pip install you-get
https://you-get.org/
"""
__author__ = "aaron.qiu"
from you_get.common import any_download
from you_get.__main__ import main_dev
if __name__ == '__main__':
any_download(url="https://www.youtube.com/watch?v=QuPiZ86EFhQ", output_dir="E:\\", merge="E:\\")
# any_dow... | [
"you_get.common.any_download"
] | [((210, 311), 'you_get.common.any_download', 'any_download', ([], {'url': '"""https://www.youtube.com/watch?v=QuPiZ86EFhQ"""', 'output_dir': '"""E:\\\\"""', 'merge': '"""E:\\\\"""'}), "(url='https://www.youtube.com/watch?v=QuPiZ86EFhQ', output_dir=\n 'E:\\\\', merge='E:\\\\')\n", (222, 311), False, 'from you_get.com... |
from django.db import models
from django_lifecycle import LifecycleModel, BEFORE_CREATE, hook
class AbstractScoreCoinModel(LifecycleModel):
"""
Abstract score-coin model for using in
score-coin based models like upvote, like, etc.
"""
score = models.IntegerField(
verbose_name="امتیاز", ed... | [
"django.db.models.DateTimeField",
"django.db.models.IntegerField",
"django_lifecycle.hook"
] | [((266, 335), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'verbose_name': '"""امتیاز"""', 'editable': '(False)', 'default': '(0)'}), "(verbose_name='امتیاز', editable=False, default=0)\n", (285, 335), False, 'from django.db import models\n'), ((361, 427), 'django.db.models.IntegerField', 'models.Integ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-03 11:49
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("hordak", "0001_initial")]
operations = [
migrations.RunSQL(
"""
CREA... | [
"django.db.migrations.RunSQL"
] | [((265, 1163), 'django.db.migrations.RunSQL', 'migrations.RunSQL', (['"""\n CREATE OR REPLACE FUNCTION check_leg()\n RETURNS trigger AS\n $$\n DECLARE\n transaction_sum DECIMAL(13, 2);\n BEGIN\n\n IF (TG... |
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 27 16:12:58 2019
@author: LKK
"""
import numpy as np
from sys import getsizeof
import time
import copy
def dominate (record1, record2) :
result = record1.att - record2.att
if np.all(result>=0) :
return 1 #record dominate target
if np.all(result... | [
"copy.deepcopy",
"sys.getsizeof",
"numpy.all",
"time.time"
] | [((239, 258), 'numpy.all', 'np.all', (['(result >= 0)'], {}), '(result >= 0)\n', (245, 258), True, 'import numpy as np\n'), ((307, 325), 'numpy.all', 'np.all', (['(result < 0)'], {}), '(result < 0)\n', (313, 325), True, 'import numpy as np\n'), ((465, 476), 'time.time', 'time.time', ([], {}), '()\n', (474, 476), False,... |
import multiprocessing
import tensorflow as tf
import numpy as np
print("version de tensorflow:", tf.__version__)
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data', one_hot=True)
import matplotlib.pyplot as plt
# Los Ejemplos de entrenamiento estan en:
# mnist... | [
"PIL.Image.new",
"numpy.argmax",
"tensorflow.ConfigProto",
"tensorflow.matmul",
"tensorflow.truncated_normal",
"multiprocessing.cpu_count",
"tensorflow.nn.softmax",
"tensorflow.nn.relu",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.placeholder",
"matplotlib.pyplot.show",
"ten... | [((183, 236), 'tensorflow.examples.tutorials.mnist.input_data.read_data_sets', 'input_data.read_data_sets', (['"""MNIST_data"""'], {'one_hot': '(True)'}), "('MNIST_data', one_hot=True)\n", (208, 236), False, 'from tensorflow.examples.tutorials.mnist import input_data\n'), ((2504, 2549), 'tensorflow.placeholder', 'tf.pl... |
from typing import Iterable, Mapping
from sqlalchemy import create_engine, text
from sqlalchemy.engine import Engine, ResultProxy
from sqlalchemy.engine.row import RowProxy
from sqlalchemy.orm import Session, scoped_session, sessionmaker
from sqlalchemy.sql.elements import TextClause
from sqlalchemy.util import Thread... | [
"sqlalchemy.create_engine",
"sqlalchemy.text",
"sqlalchemy.orm.sessionmaker"
] | [((584, 612), 'sqlalchemy.create_engine', 'create_engine', (['url'], {}), '(url, **kwargs)\n', (597, 612), False, 'from sqlalchemy import create_engine, text\n'), ((1906, 1917), 'sqlalchemy.text', 'text', (['query'], {}), '(query)\n', (1910, 1917), False, 'from sqlalchemy import create_engine, text\n'), ((667, 697), 's... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-10-04 20:41
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('timesheets', '0002_auto_20171003_1408'),
]
operations = [
migrations.AlterF... | [
"django.db.models.CharField"
] | [((417, 793), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[('X', 'Regular Time'), ('V', 'Vacation'), ('S', 'Sick'), ('P', 'Personal'),\n ('B', 'Bereavement'), ('H', 'Holiday'), ('J', 'Jury Duty'), ('W',\n 'Workers Compensation'), ('UB', 'Union Duties'), ('training_conf_sem',\n 'Training... |
# random AI by <NAME>
from AI_base import *
import random
class AI_random(AI_base):
def __init__(self):
AI_base.__init__(self)
def select_move(self, board, is_red):
moves = board.get_all_moves(is_red)
if moves is not []:
return random.choice(moves)
else:
... | [
"random.choice"
] | [((276, 296), 'random.choice', 'random.choice', (['moves'], {}), '(moves)\n', (289, 296), False, 'import random\n')] |
import torch
import torch.nn as nn
def normalize_adj_mats(adj_mats):
mask = (adj_mats > 1e-3).float()
adj_mats = torch.softmax(adj_mats, dim=1) * mask
adj_mats = (1.0 / (adj_mats.sum(dim=1, keepdim=True) + 1e-8)) * adj_mats
return adj_mats
def create_activation(activation):
if activation == 'Sig... | [
"torch.nn.ReLU",
"torch.nn.ModuleList",
"torch.nn.Tanh",
"torch.softmax",
"torch.nn.Linear",
"torch.nn.Sigmoid"
] | [((123, 153), 'torch.softmax', 'torch.softmax', (['adj_mats'], {'dim': '(1)'}), '(adj_mats, dim=1)\n', (136, 153), False, 'import torch\n'), ((334, 346), 'torch.nn.Sigmoid', 'nn.Sigmoid', ([], {}), '()\n', (344, 346), True, 'import torch.nn as nn\n'), ((383, 392), 'torch.nn.ReLU', 'nn.ReLU', ([], {}), '()\n', (390, 392... |
import os
import yaml
file_dir = os.path.dirname(__file__)
with open(f'{file_dir}/general.yml', 'r') as f:
general_params = yaml.safe_load(f) | [
"os.path.dirname",
"yaml.safe_load"
] | [((34, 59), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (49, 59), False, 'import os\n'), ((130, 147), 'yaml.safe_load', 'yaml.safe_load', (['f'], {}), '(f)\n', (144, 147), False, 'import yaml\n')] |
#! /usr/bin/env python3
from enum import Enum
#from numba import jit
from random import choice, randrange, shuffle
from itertools import accumulate, chain, permutations
from math import factorial
from section_type import SectionType, short_section, long_section, INTRO, VERSE, PRE, CHORUS, BRIDGE, OUTRO
f... | [
"segment_cadence.random_segment_cadences",
"song_cadence0.reduce_map",
"bar_cadence.random_bar_cadence",
"song_structure.random_song_structure",
"phrase_cadence.random_phrase_cadences",
"random_util.subsets",
"song_cadence0.random_sc0",
"random.choice",
"section_cadence.random_section_cadences",
"... | [((4152, 4178), 'song_cadence0.reduce_map', 'reduce_map', (['ns', 'nmin', 'nmax'], {}), '(ns, nmin, nmax)\n', (4162, 4178), False, 'from song_cadence0 import random_sc0, reduce_map\n'), ((5297, 5316), 'random.randrange', 'randrange', (['(2)', '(3 + 1)'], {}), '(2, 3 + 1)\n', (5306, 5316), False, 'from random import cho... |
import logging
from decouple import config, Csv
from apscheduler.schedulers.blocking import BlockingScheduler
from google_news import GoogleNews
from open_weather import OpenWeatherAPI
from slack_notification import send_notification
# Configure and create a logger
logging.basicConfig(format='%(asctime)s [%(filename)s... | [
"decouple.Csv",
"logging.basicConfig",
"slack_notification.send_notification",
"decouple.config",
"google_news.GoogleNews",
"open_weather.OpenWeatherAPI",
"logging.getLogger"
] | [((267, 395), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s [%(filename)s:%(funcName)s:%(lineno)d] [%(levelname)s] %(name)s: %(message)s"""'}), "(format=\n '%(asctime)s [%(filename)s:%(funcName)s:%(lineno)d] [%(levelname)s] %(name)s: %(message)s'\n )\n", (286, 395), False, 'import ... |
import copy
class ErrorHandler:
default_handler = {
204 : ("T", []),
400 : ("T", []),
401 : ("T", []),
404 : ("T", []),
403 : ("T", []),
405 : ("T", []),
408 : ("E", [3, 3]),
429 : ("E", [3, 3]),
500 : ("E", [3, 3]),
502 : ("E", [3, 3... | [
"copy.deepcopy"
] | [((1833, 1868), 'copy.deepcopy', 'copy.deepcopy', (['self.default_handler'], {}), '(self.default_handler)\n', (1846, 1868), False, 'import copy\n')] |
# Intro to Python
# boolean values
T
t
True
# integer values
1234
-23
0
# float values
3.14
314e-2
.1
-.1
# string values
"Python's"
'she said "Python"'
"""String with <newline>
character"""
"This" "is" "one" "string"
# string operators
i_str = "Python"
i_str[1]
i_str[-1]
i_str[1:3]
i_str[1:7:2]
i_str[7:1:-2]
... | [
"math.log"
] | [((2217, 2230), 'math.log', 'math.log', (['(100)'], {}), '(100)\n', (2225, 2230), False, 'import math\n'), ((2260, 2268), 'math.log', 'log', (['(100)'], {}), '(100)\n', (2263, 2268), False, 'from math import log\n')] |
"""
Author: <NAME>
License: MIT
Copyright: 2019-2020
"""
from __future__ import print_function
import os
import csv
import radical.entk as re
from .executor import Executor
from ..discovery import Discovery
class Penguins(Executor):
'''
:Class Penguins:
This class instantiates the Penguins use case.
... | [
"csv.reader",
"radical.entk.Pipeline",
"os.environ.get",
"radical.entk.Stage",
"radical.entk.Task"
] | [((1547, 1576), 'os.environ.get', 'os.environ.get', (['"""VE_PENGUINS"""'], {}), "('VE_PENGUINS')\n", (1561, 1576), False, 'import os\n'), ((3325, 3338), 'radical.entk.Pipeline', 're.Pipeline', ([], {}), '()\n', (3336, 3338), True, 'import radical.entk as re\n'), ((3422, 3432), 'radical.entk.Stage', 're.Stage', ([], {}... |
import random
from bos_consensus.common import Ballot, BallotVotingResult
from bos_consensus.consensus import get_fba_module
IsaacConsensus = get_fba_module('isaac').Consensus
class DivergentVotingConsensus(IsaacConsensus):
faulty_frequency = None
faulty_ballot_ids = None # store the ballot to be fault
... | [
"random.randint",
"bos_consensus.common.Ballot",
"bos_consensus.consensus.get_fba_module"
] | [((145, 168), 'bos_consensus.consensus.get_fba_module', 'get_fba_module', (['"""isaac"""'], {}), "('isaac')\n", (159, 168), False, 'from bos_consensus.consensus import get_fba_module\n'), ((1467, 1543), 'bos_consensus.common.Ballot', 'Ballot', (['ballot.ballot_id', 'self.node_name', 'ballot.message', 'self.state', 'res... |
# Generated by Django 3.2.9 on 2021-11-07 08:03
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('stores', '0007_auto_20211107_0758'),
]
operations = [
migrations.RenameField(
model_name='storetext',
old_name='text',
... | [
"django.db.migrations.RenameField"
] | [((225, 314), 'django.db.migrations.RenameField', 'migrations.RenameField', ([], {'model_name': '"""storetext"""', 'old_name': '"""text"""', 'new_name': '"""contents"""'}), "(model_name='storetext', old_name='text', new_name=\n 'contents')\n", (247, 314), False, 'from django.db import migrations\n')] |
import sqlite3
from sqlite3 import Error
def create_connection(path):
connection = None
try:
connection = sqlite3.connect(path)
print("Connection to SQLite DB successful")
except Error as e:
print(f"The error '{e}' occurred")
return connection
if __name__ == '__main__':
co... | [
"sqlite3.connect"
] | [((123, 144), 'sqlite3.connect', 'sqlite3.connect', (['path'], {}), '(path)\n', (138, 144), False, 'import sqlite3\n')] |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
# Block below for Python 2&3 support
try:
input = raw_input
except NameError:
pass
""" Example of using Digital IO to write across both ports 0 and 1 of the Usb 6008"""
from pydaqmx_helper.digital_io import Digital_IO
myDigital_... | [
"pydaqmx_helper.digital_io.Digital_IO"
] | [((325, 337), 'pydaqmx_helper.digital_io.Digital_IO', 'Digital_IO', ([], {}), '()\n', (335, 337), False, 'from pydaqmx_helper.digital_io import Digital_IO\n')] |
"""empty message
Revision ID: e<PASSWORD>
Revises: None
Create Date: 2015-03-27 14:43:28.569705
"""
# revision identifiers, used by Alembic.
revision = 'e<PASSWORD>'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
... | [
"alembic.op.drop_table",
"sqlalchemy.Integer",
"sqlalchemy.String",
"sqlalchemy.PrimaryKeyConstraint"
] | [((667, 691), 'alembic.op.drop_table', 'op.drop_table', (['"""records"""'], {}), "('records')\n", (680, 691), False, 'from alembic import op\n'), ((511, 540), 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""id"""'], {}), "('id')\n", (534, 540), True, 'import sqlalchemy as sa\n'), ((370, 381), 'sqlal... |
import pickle
from typing import Dict, Union
import numpy as np
import pandas as pd
from sklearn.tree import DecisionTreeClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score, f1_score, roc_auc_score
SklearnClassifierModel = Union[LogisticRegression, DecisionTreeCl... | [
"pickle.dump",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.roc_auc_score",
"sklearn.metrics.f1_score",
"numpy.exp"
] | [((708, 724), 'numpy.exp', 'np.exp', (['predicts'], {}), '(predicts)\n', (714, 724), True, 'import numpy as np\n'), ((902, 916), 'numpy.exp', 'np.exp', (['target'], {}), '(target)\n', (908, 916), True, 'import numpy as np\n'), ((950, 982), 'sklearn.metrics.accuracy_score', 'accuracy_score', (['target', 'predicts'], {})... |
# -*- coding: utf-8 -*-
import numpy as np
import pytest
import astropy.units as u
from astropy.tests.helper import assert_quantity_allclose
from astropy.coordinates import (
CylindricalRepresentation, UnitSphericalRepresentation,
SphericalRepresentation, CartesianRepresentation)
from ... import sun
from ... | [
"astropy.units.Quantity",
"astropy.coordinates.SphericalRepresentation",
"astropy.tests.helper.assert_quantity_allclose",
"astropy.coordinates.CartesianRepresentation",
"astropy.coordinates.UnitSphericalRepresentation",
"pytest.mark.parametrize"
] | [((2307, 2418), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""args, kwargs"""', "(two_D_parameters + [(None, {'Tx': 0 * u.deg, 'Ty': 0 * u.arcsec})])"], {}), "('args, kwargs', two_D_parameters + [(None, {'Tx': 0 *\n u.deg, 'Ty': 0 * u.arcsec})])\n", (2330, 2418), False, 'import pytest\n'), ((3294, 3486... |
"""Miscellaneous bindings to ffmpeg."""
import os
from moviepy.config import FFMPEG_BINARY
from moviepy.decorators import convert_parameter_to_seconds, convert_path_to_string
from moviepy.tools import subprocess_call
@convert_path_to_string(("inputfile", "outputfile"))
@convert_parameter_to_seconds(("start_time", "... | [
"moviepy.decorators.convert_parameter_to_seconds",
"os.path.basename",
"moviepy.tools.subprocess_call",
"os.path.splitext",
"os.path.join",
"moviepy.decorators.convert_path_to_string"
] | [((222, 273), 'moviepy.decorators.convert_path_to_string', 'convert_path_to_string', (["('inputfile', 'outputfile')"], {}), "(('inputfile', 'outputfile'))\n", (244, 273), False, 'from moviepy.decorators import convert_parameter_to_seconds, convert_path_to_string\n'), ((275, 331), 'moviepy.decorators.convert_parameter_t... |
import collections
import gssapi
import socket
import struct
import sys
__all__ = ('remctl', 'Remctl', 'RemctlError', 'RemctlNotOpenedError', 'RemctlProtocolError',
'RemctlSimpleResult')
TOKEN_NOOP = 0x01
TOKEN_CONTEXT = 0x02
TOKEN_DATA = 0x04
TOKEN_CONTEXT_NEXT = 0x10
TOKEN_PROTOCOL = 0x40
MESSAGE_COMMAND... | [
"socket.create_connection",
"gssapi.SecurityContext",
"struct.unpack",
"gssapi.Name",
"struct.pack",
"collections.namedtuple"
] | [((803, 888), 'collections.namedtuple', 'collections.namedtuple', (['"""Output"""', "['type', 'output', 'stream', 'status', 'error']"], {}), "('Output', ['type', 'output', 'stream', 'status',\n 'error'])\n", (825, 888), False, 'import collections\n'), ((906, 982), 'collections.namedtuple', 'collections.namedtuple', ... |
from django.urls import path, include
from .views import signup, activate, profile, profileUpdate
urlpatterns = [
path('signup/', signup, name='signup'),
path('accounts/', include('django.contrib.auth.urls')),
path('activate/<uidb64>/<token>/', activate, name="activate"),
path('profile/', profile, nam... | [
"django.urls.path",
"django.urls.include"
] | [((119, 157), 'django.urls.path', 'path', (['"""signup/"""', 'signup'], {'name': '"""signup"""'}), "('signup/', signup, name='signup')\n", (123, 157), False, 'from django.urls import path, include\n'), ((224, 285), 'django.urls.path', 'path', (['"""activate/<uidb64>/<token>/"""', 'activate'], {'name': '"""activate"""'}... |
"""
Copyright 2017 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... | [
"requests.Session",
"json.loads",
"logging.getLogger"
] | [((680, 707), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (697, 707), False, 'import logging\n'), ((787, 803), 'json.loads', 'json.loads', (['text'], {}), '(text)\n', (797, 803), False, 'import json\n'), ((1118, 1127), 'requests.Session', 'Session', ([], {}), '()\n', (1125, 1127), Fals... |
import turtle
"<NAME> @imdarkcoder"
colors = ["orange", "red" , "pink" , "yellow" , "blue" , "green" ]
screen = turtle.Screen()
t=turtle.Turtle()
t.speed(0)
screen.bgcolor("black")
for x in range (360):
t.pencolor(colors[x%6])
t.width(x / 5 + 1)
t.forward(x)
t.left(20)
| [
"turtle.Screen",
"turtle.Turtle"
] | [((118, 133), 'turtle.Screen', 'turtle.Screen', ([], {}), '()\n', (131, 133), False, 'import turtle\n'), ((139, 154), 'turtle.Turtle', 'turtle.Turtle', ([], {}), '()\n', (152, 154), False, 'import turtle\n')] |
import numpy as np
import matplotlib.pyplot as plt
cfs_to_tafd = 2.29568411*10**-5 * 86400 / 1000
# we'll use the "loadtxt" function from numpy to read the CSV
# the delimiter is a comma (other options might be tab or space)
# we want to skip the header row and the first (0th) column
# In general it's better to use ... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"numpy.loadtxt",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((378, 453), 'numpy.loadtxt', 'np.loadtxt', (['"""data/SHA.csv"""'], {'delimiter': '""","""', 'skiprows': '(1)', 'usecols': '[1, 2, 3, 4]'}), "('data/SHA.csv', delimiter=',', skiprows=1, usecols=[1, 2, 3, 4])\n", (388, 453), True, 'import numpy as np\n'), ((615, 632), 'matplotlib.pyplot.plot', 'plt.plot', (['storage']... |
#-*- coding: utf-8 -*-
from django.conf.urls import patterns, url
urlpatterns = patterns(
'message.views',
url(r'^details/$', 'message_details', name="message_details"),
url(r'^list/$', 'message_list', name="message_list"),
) | [
"django.conf.urls.url"
] | [((117, 177), 'django.conf.urls.url', 'url', (['"""^details/$"""', '"""message_details"""'], {'name': '"""message_details"""'}), "('^details/$', 'message_details', name='message_details')\n", (120, 177), False, 'from django.conf.urls import patterns, url\n'), ((184, 235), 'django.conf.urls.url', 'url', (['"""^list/$"""... |
import json
from strategy import (Strategy, StrategyStore)
from constants import (JSON_INDENT, COMMON_INTERMEDIATE_PATH_KEY, MASTER_INTERMEDIATE_PATH_KEY, BRANCH_INTERMEDIATE_PATH_KEY)
from logger import logger
class IntermediatePersistenceStrategy(Strategy):
def persist(self, flat_master_schema, flat_branch_schem... | [
"logger.logger.info",
"strategy.StrategyStore",
"json.dumps"
] | [((2251, 2266), 'strategy.StrategyStore', 'StrategyStore', ([], {}), '()\n', (2264, 2266), False, 'from strategy import Strategy, StrategyStore\n'), ((540, 594), 'logger.logger.info', 'logger.info', (['"""using common file intermediate strategy"""'], {}), "('using common file intermediate strategy')\n", (551, 594), Fal... |
from typing import List
import torch
import torch.nn.functional as F
def pad_masks(masks: List[torch.tensor], max_objects: int) -> List[torch.Tensor]:
"""
Pads (and clips) each mask in masks to max_objects. Adds 0 filled masks if the number
of masks is less than the number of objects.
Args:
... | [
"torch.cat"
] | [((1633, 1657), 'torch.cat', 'torch.cat', (['final_tensors'], {}), '(final_tensors)\n', (1642, 1657), False, 'import torch\n')] |
#Program to draw peaks
#Import turtle libary for drawing
import turtle as trtl
#Set initial conditions for painter object
painter = trtl.Turtle()
painter.penup()
painter.pensize(3)
painter.speed(0)
painter.goto(-200, 0)
painter.pendown()
#Set initial postions and movement values
x = -200
y = 0
move_x... | [
"turtle.Screen",
"turtle.Turtle"
] | [((140, 153), 'turtle.Turtle', 'trtl.Turtle', ([], {}), '()\n', (151, 153), True, 'import turtle as trtl\n'), ((1296, 1309), 'turtle.Screen', 'trtl.Screen', ([], {}), '()\n', (1307, 1309), True, 'import turtle as trtl\n')] |
import os
import urllib.request
import cv2
from flytekit.common import utils
from flytekit.sdk.tasks import dynamic_task, inputs, outputs, python_task
from flytekit.sdk.types import Types
from flytekit.sdk.workflow import Input, workflow_class
default_images = [
'https://upload.wikimedia.org/wikipedia/commons/a/a... | [
"flytekit.sdk.workflow.Input",
"cv2.imwrite",
"flytekit.sdk.tasks.inputs",
"cv2.imread",
"cv2.warpAffine",
"flytekit.common.utils.AutoDeletingTempDir",
"flytekit.sdk.tasks.python_task",
"flytekit.sdk.tasks.outputs",
"os.path.join",
"cv2.getRotationMatrix2D"
] | [((597, 632), 'flytekit.sdk.tasks.inputs', 'inputs', ([], {'image_location': 'Types.String'}), '(image_location=Types.String)\n', (603, 632), False, 'from flytekit.sdk.tasks import dynamic_task, inputs, outputs, python_task\n'), ((634, 663), 'flytekit.sdk.tasks.outputs', 'outputs', ([], {'out_image': 'Types.Blob'}), '(... |
import numpy as np
from future._greyreconstruct import reconstruction_loop
from skimage.filters._rank_order import rank_order
y, x = np.mgrid[:20:0.5, :20:0.5]
bumps = np.sin(x) + np.sin(y)
h = 0.3
seed = bumps - h
mask = bumps
assert tuple(seed.shape) == tuple(mask.shape)
selem = np.ones([3] * seed.ndim, dtype=boo... | [
"numpy.full",
"skimage.filters._rank_order.rank_order",
"numpy.sum",
"numpy.zeros",
"numpy.ones",
"numpy.argsort",
"numpy.min",
"numpy.sin",
"numpy.array",
"numpy.int64"
] | [((286, 322), 'numpy.ones', 'np.ones', (['([3] * seed.ndim)'], {'dtype': 'bool'}), '([3] * seed.ndim, dtype=bool)\n', (293, 322), True, 'import numpy as np\n'), ((332, 373), 'numpy.array', 'np.array', (['[(d // 2) for d in selem.shape]'], {}), '([(d // 2) for d in selem.shape])\n', (340, 373), True, 'import numpy as np... |
import numpy as np
from scipy.fft import fft
def read_dna_seq(file_name):
fil = open(file_name,'r')
fil_list = fil.readlines()
fil.close
genome = {}
acession = ''
protien_name = ''
gene_seq = ''
for i in fil_list:
if i[0] == '>':
if list(genome.keys()) != []:
gene_seq = gene_seq.rep... | [
"scipy.fft.fft"
] | [((2171, 2177), 'scipy.fft.fft', 'fft', (['v'], {}), '(v)\n', (2174, 2177), False, 'from scipy.fft import fft\n')] |
#!/usr/bin/env python
#
# Copyright (c) 2009-2012, Fortylines LLC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# ... | [
"subprocess.Popen"
] | [((2076, 2188), 'subprocess.Popen', 'subprocess.Popen', (['cmdline'], {'stdin': 'subprocess.PIPE', 'stdout': 'subprocess.PIPE', 'stderr': 'subprocess.PIPE', 'env': 'cmdenv'}), '(cmdline, stdin=subprocess.PIPE, stdout=subprocess.PIPE,\n stderr=subprocess.PIPE, env=cmdenv)\n', (2092, 2188), False, 'import subprocess\n... |
import os
from pygame import mixer
class MusicMixer:
def __init__(self):
mixer.init()
self.__foundParticle = mixer.Sound(os.path.join(os.path.dirname(__file__), 'soundFiles', 'newParticle.wav'))
self.__foundParticle.set_volume(.05)
self.__backgroundMusic = mixer.Sound(os.path.join(o... | [
"pygame.mixer.fadeout",
"os.path.dirname",
"pygame.mixer.init"
] | [((86, 98), 'pygame.mixer.init', 'mixer.init', ([], {}), '()\n', (96, 98), False, 'from pygame import mixer\n'), ((727, 746), 'pygame.mixer.fadeout', 'mixer.fadeout', (['(1000)'], {}), '(1000)\n', (740, 746), False, 'from pygame import mixer\n'), ((155, 180), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(... |
from tkinter import ttk
from typing import TYPE_CHECKING
from core.gui.dialogs.dialog import Dialog
from core.gui.images import ImageEnum, Images
from core.gui.widgets import CodeText
if TYPE_CHECKING:
import grpc
from core.gui.app import Application
class ErrorDialog(Dialog):
def __init__(self, master,... | [
"core.gui.images.Images.get",
"core.gui.widgets.CodeText",
"tkinter.ttk.Label"
] | [((636, 667), 'core.gui.images.Images.get', 'Images.get', (['ImageEnum.ERROR', '(36)'], {}), '(ImageEnum.ERROR, 36)\n', (646, 667), False, 'from core.gui.images import ImageEnum, Images\n'), ((684, 716), 'tkinter.ttk.Label', 'ttk.Label', (['self.top'], {'image': 'image'}), '(self.top, image=image)\n', (693, 716), False... |