code stringlengths 22 1.05M | apis listlengths 1 3.31k | extract_api stringlengths 75 3.25M |
|---|---|---|
#! /usr/bin/env python3
import os
import git
import subprocess
import glob
default_systemd = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "system.d/"))
build = "ntcl-build"
util = "ntcl-util"
data = "ntcl-data"
tensor = "ntcl-tensor"
algorithms = "ntcl-algorithms"
examples = "ntcl-examples"
part_lo... | [
"os.path.exists",
"os.environ.keys",
"argparse.ArgumentParser",
"git.Repo.clone_from",
"subprocess.run",
"os.path.join",
"os.getcwd",
"os.path.realpath",
"os.path.dirname",
"os.path.isdir",
"os.path.basename",
"os.mkdir",
"sys.exit",
"os.path.abspath",
"glob.glob"
] | [((3125, 3160), 'os.path.join', 'os.path.join', (['directory', 'repository'], {}), '(directory, repository)\n', (3137, 3160), False, 'import os\n'), ((3914, 3931), 'os.path.exists', 'os.path.exists', (['d'], {}), '(d)\n', (3928, 3931), False, 'import os\n'), ((3993, 4023), 'git.Repo.clone_from', 'git.Repo.clone_from', ... |
"""
Provide utils for command line interface.
"""
import json
import click
from cli.config import ConfigFile
def dict_to_pretty_json(data):
r"""
Convert dictionary to json with indents (human readable string).
From the following code:
{
"address": [
"The following ad... | [
"json.dumps",
"cli.config.ConfigFile"
] | [((778, 820), 'json.dumps', 'json.dumps', (['data'], {'indent': '(4)', 'sort_keys': '(True)'}), '(data, indent=4, sort_keys=True)\n', (788, 820), False, 'import json\n'), ((1409, 1421), 'cli.config.ConfigFile', 'ConfigFile', ([], {}), '()\n', (1419, 1421), False, 'from cli.config import ConfigFile\n')] |
# Uses python3
import sys
# Output image into console
def print_2d_array( image_matrix, mode = "Hex" ):
image_height = len( image_matrix )
image_width = len( image_matrix[0] )
for y in range( image_height ):
for x in range( image_width ):
if "Hex" == mode:
print(... | [
"sys.stdin.read"
] | [((3608, 3624), 'sys.stdin.read', 'sys.stdin.read', ([], {}), '()\n', (3622, 3624), False, 'import sys\n')] |
# cfitsio-specific version update checker
import os
import urllib.request
import tarfile
import copy
from ..plugins import plugin
class plugin(plugin.Plugin):
def __init__(self, params, ref_ver_data, tarball=None):
'''Download and extract key files from source tarball.
Read in header file.
... | [
"tarfile.open",
"os.path.basename",
"copy.deepcopy"
] | [((419, 451), 'copy.deepcopy', 'copy.deepcopy', (['self.ref_ver_data'], {}), '(self.ref_ver_data)\n', (432, 451), False, 'import copy\n'), ((745, 779), 'tarfile.open', 'tarfile.open', (['latest_tar'], {'mode': '"""r"""'}), "(latest_tar, mode='r')\n", (757, 779), False, 'import tarfile\n'), ((868, 897), 'os.path.basenam... |
from django.db import models
from django.contrib.auth.models import User
class Classroom(models.Model):
teacher = models.ForeignKey(User, on_delete=models.CASCADE)
name = models.CharField(max_length=100)
def __str__(self):
return self.name
def get_absolute_url(self):
return "/classro... | [
"django.db.models.OneToOneField",
"django.db.models.DateField",
"django.db.models.TextField",
"django.db.models.ForeignKey",
"django.db.models.ManyToManyField",
"django.db.models.CharField"
] | [((120, 169), 'django.db.models.ForeignKey', 'models.ForeignKey', (['User'], {'on_delete': 'models.CASCADE'}), '(User, on_delete=models.CASCADE)\n', (137, 169), False, 'from django.db import models\n'), ((181, 213), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(100)'}), '(max_length=100)\n', (... |
#!/usr/bin/env python3
# custom imports
from app import app, api, mongo
from resources import resources as res
api.add_resource(res.UserSignup, '/signup')
api.add_resource(res.UserSignin, '/signin')
api.add_resource(res.TokenRefresh, '/token/refresh')
api.add_resource(res.ConfirmToken, '/confirm')
api.add_resource(... | [
"app.api.add_resource",
"app.app.run",
"app.mongo.db.entries.create_index",
"app.mongo.db.users.create_index"
] | [((114, 157), 'app.api.add_resource', 'api.add_resource', (['res.UserSignup', '"""/signup"""'], {}), "(res.UserSignup, '/signup')\n", (130, 157), False, 'from app import app, api, mongo\n'), ((158, 201), 'app.api.add_resource', 'api.add_resource', (['res.UserSignin', '"""/signin"""'], {}), "(res.UserSignin, '/signin')\... |
import numpy as np
data= get_pricing("SPY", start_date="2003-1-1", end_date="2018-1-1")
prices= data['price']
import matplotlib.pyplot as pyplot
uppers= []
lowers= []
stat1=0
stat2=0
statN1=0
stat0=0
limit= 180
prevStat=1
print(len(prices))
for i in range(0, len(prices)):
if i < limit:
uppers.append(pri... | [
"matplotlib.pyplot.plot",
"numpy.min",
"matplotlib.pyplot.legend",
"numpy.max"
] | [((1294, 1350), 'matplotlib.pyplot.plot', 'pyplot.plot', (['prices.index', 'prices.values'], {'label': '"""prices"""'}), "(prices.index, prices.values, label='prices')\n", (1305, 1350), True, 'import matplotlib.pyplot as pyplot\n'), ((1351, 1399), 'matplotlib.pyplot.plot', 'pyplot.plot', (['prices.index', 'uppers'], {'... |
from codewatch.file_walker import FileWalker
MOCK_PATHS = [
('.', ['dir1', 'dir2'], ['file1', 'file2', 'file3']),
('./dir1', [], ['dir1_file1', 'dir1_file2']),
('./dir2', ['dir2_subdir'], ['dir2_file1']),
('./dir2/dir2_subdir', [], ['subdir_file1']),
]
MOCK_START_PATH = '/home/mock'
def _expected_fi... | [
"codewatch.file_walker.FileWalker"
] | [((884, 936), 'codewatch.file_walker.FileWalker', 'FileWalker', (['loader', 'MOCK_START_PATH'], {'walk_fn': 'walk_fn'}), '(loader, MOCK_START_PATH, walk_fn=walk_fn)\n', (894, 936), False, 'from codewatch.file_walker import FileWalker\n')] |
# Archivo: animaciones.py
# Basado en https://matplotlib.org/examples/animation/simple_anim.html
# Autor: <NAME>
# Fecha: 28 de diciembre de 2017
# Descripción: Ejemplo de animacion
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import random
PI = 3.1416
fig, ax = plt.sub... | [
"numpy.ma.array",
"numpy.sin",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.show"
] | [((313, 327), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (325, 327), True, 'import matplotlib.pyplot as plt\n'), ((333, 359), 'numpy.arange', 'np.arange', (['(0)', '(4 * PI)', '(0.01)'], {}), '(0, 4 * PI, 0.01)\n', (342, 359), True, 'import numpy as np\n'), ((1304, 1314), 'matplotlib.pyplot.show', ... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
from odoo.tests import tagged
from odoo.tests.common import Form
@tagged('post_install', '-at_install')
class TestPurchaseToInvoice(AccountTestInvo... | [
"odoo.tests.tagged"
] | [((239, 276), 'odoo.tests.tagged', 'tagged', (['"""post_install"""', '"""-at_install"""'], {}), "('post_install', '-at_install')\n", (245, 276), False, 'from odoo.tests import tagged\n')] |
import math
from rlbot.agents.base_agent import BaseAgent, SimpleControllerState
from rlbot.utils.structures.game_data_struct import GameTickPacket
class Vector3:
def __init__(self,a,b,c):
self.data = [a,b,c]
def __getitem__(self,key):
return self.data[key]
def __str__(self):
retur... | [
"math.sqrt",
"math.cos",
"math.atan2",
"rlbot.agents.base_agent.SimpleControllerState",
"math.sin"
] | [((6090, 6113), 'rlbot.agents.base_agent.SimpleControllerState', 'SimpleControllerState', ([], {}), '()\n', (6111, 6113), False, 'from rlbot.agents.base_agent import BaseAgent, SimpleControllerState\n'), ((6194, 6236), 'math.atan2', 'math.atan2', (['LocalTagret[1]', 'LocalTagret[0]'], {}), '(LocalTagret[1], LocalTagret... |
import hashlib
import os
from datetime import date, timedelta
from flask import render_template, request, flash, redirect, url_for, current_app, abort
from flask_login import login_required, current_user, logout_user
from sqlalchemy import func
from .forms import EditGameForm, EditUserForm, EditProfileForm, ChangePas... | [
"flask.render_template",
"flask.request.args.get",
"sqlalchemy.func.count",
"flask_login.current_user.verify_password",
"flask.flash",
"flask.request.form.getlist",
"os.path.join",
"flask.url_for",
"datetime.timedelta",
"flask.abort",
"datetime.date.today"
] | [((744, 801), 'flask.render_template', 'render_template', (['"""back/personal_center.html"""'], {'games': 'games'}), "('back/personal_center.html', games=games)\n", (759, 801), False, 'from flask import render_template, request, flash, redirect, url_for, current_app, abort\n'), ((2021, 2073), 'flask.render_template', '... |
import os
import glob
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from pysam import VariantFile
variant_df = pd.read_csv(snakemake.input[0], sep='\t').fillna(0.0)
variant_df = variant_df[["CHROM", "POS"] + [c for c in variant_df.columns if c.endswith("Freq")]]
## tidy d... | [
"matplotlib.pyplot.savefig",
"pandas.read_csv",
"seaborn.distplot",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.close",
"matplotlib.pyplot.title",
"seaborn.FacetGrid"
] | [((434, 470), 'seaborn.FacetGrid', 'sns.FacetGrid', (['tidy_df'], {'col': '"""Sample"""'}), "(tidy_df, col='Sample')\n", (447, 470), True, 'import seaborn as sns\n'), ((551, 562), 'matplotlib.pyplot.close', 'plt.close', ([], {}), '()\n', (560, 562), True, 'import matplotlib.pyplot as plt\n'), ((647, 688), 'matplotlib.p... |
from datetime import datetime, timedelta
import socket
from .opus20 import Frame
class Opus20FakeServer(object):
"""
A TCP server imitating (faking) the
behaviour of a Lufft OPUS20 device.
"""
def __init__(self, host='', port=52015):
self.host = host
self.port = port
self... | [
"datetime.datetime.strptime",
"datetime.timedelta",
"socket.socket"
] | [((396, 445), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (409, 445), False, 'import socket\n'), ((2057, 2099), 'datetime.datetime.strptime', 'datetime.strptime', (['dt', '"""%Y-%m-%dT%H:%M:%S"""'], {}), "(dt, '%Y-%m-%dT%H:%M:%S')\n", (2074... |
#!/usr/bin/env python
import argparse
import hail
from pprint import pprint
from utils.computed_fields_utils import get_expr_for_xpos, get_expr_for_orig_alt_alleles_set, \
get_expr_for_variant_id, get_expr_for_vep_gene_ids_set, get_expr_for_vep_transcript_ids_set, \
get_expr_for_vep_consequence_terms_set, get_... | [
"utils.elasticsearch_utils.export_kt_to_elasticsearch",
"argparse.ArgumentParser",
"utils.computed_fields_utils.get_expr_for_ref_allele",
"utils.computed_fields_utils.get_expr_for_xpos",
"hail.HailContext",
"utils.computed_fields_utils.get_expr_for_start_pos",
"utils.computed_fields_utils.get_expr_for_a... | [((721, 746), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (744, 746), False, 'import argparse\n'), ((1575, 1608), 'hail.HailContext', 'hail.HailContext', ([], {'log': '"""/hail.log"""'}), "(log='/hail.log')\n", (1591, 1608), False, 'import hail\n'), ((3087, 3182), 'utils.vds_schema_string_ut... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-01 07:17
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('agency', '0007_auto_20170731_1134'),
]
operations = [
migrations.RemoveField(
... | [
"django.db.migrations.RemoveField"
] | [((291, 357), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""teammember"""', 'name': '"""deviantart"""'}), "(model_name='teammember', name='deviantart')\n", (313, 357), False, 'from django.db import migrations\n'), ((402, 464), 'django.db.migrations.RemoveField', 'migrations.Remov... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '2d52470f8e49'
down_revision = u'<KEY>'
branc... | [
"sqlalchemy.Column",
"alembic.op.batch_alter_table"
] | [((380, 411), 'alembic.op.batch_alter_table', 'op.batch_alter_table', (['"""fda_dap"""'], {}), "('fda_dap')\n", (400, 411), False, 'from alembic import op\n'), ((643, 674), 'alembic.op.batch_alter_table', 'op.batch_alter_table', (['"""fda_dap"""'], {}), "('fda_dap')\n", (663, 674), False, 'from alembic import op\n'), (... |
# Generated by Django 3.2.9 on 2022-01-28 08:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0017_auto_20211123_1046'),
]
operations = [
migrations.AddField(
model_name='termsofservice',
name='flavour... | [
"django.db.models.CharField"
] | [((341, 439), 'django.db.models.CharField', 'models.CharField', ([], {'choices': "[('PRO', 'PRO'), ('CONSUMER', 'CONSUMER')]", 'max_length': '(32)', 'null': '(True)'}), "(choices=[('PRO', 'PRO'), ('CONSUMER', 'CONSUMER')],\n max_length=32, null=True)\n", (357, 439), False, 'from django.db import migrations, models\n... |
import os
import logging
from pathlib import Path
from typing import TYPE_CHECKING, Any, Dict, Optional, Union
from botocore.exceptions import ClientError
from botocore.client import Config
import boto3
from pydantic import BaseSettings, typing
if TYPE_CHECKING:
from mypy_boto3_ssm.client import SSMClient
logg... | [
"logging.getLogger",
"boto3.client",
"pathlib.Path",
"os.environ.get",
"botocore.client.Config"
] | [((325, 352), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (342, 352), False, 'import logging\n'), ((614, 660), 'boto3.client', 'boto3.client', (['"""ssm"""'], {'config': 'self.client_config'}), "('ssm', config=self.client_config)\n", (626, 660), False, 'import boto3\n'), ((790, 843), '... |
# -*- coding: utf-8 -*-
"""
Loss function for listwise ranking training.
"""
import torch
import torch.nn.functional as F
from itertools import permutations
PADDED_Y_VALUE = -1
DEFAULT_EPS = 1e-10
DEFAULT_TOPK = 2
def listNet_top_one(y_pred, y_true, eps=DEFAULT_EPS, padded_value_indicator=PADDED_Y_VALUE):
... | [
"torch.nn.functional.softmax",
"torch.log",
"torch.randperm",
"torch.Tensor",
"torch.sum",
"torch.nn.functional.kl_div",
"itertools.permutations",
"torch.gather"
] | [((987, 1011), 'torch.nn.functional.softmax', 'F.softmax', (['y_pred'], {'dim': '(1)'}), '(y_pred, dim=1)\n', (996, 1011), True, 'import torch.nn.functional as F\n'), ((1029, 1053), 'torch.nn.functional.softmax', 'F.softmax', (['y_true'], {'dim': '(1)'}), '(y_true, dim=1)\n', (1038, 1053), True, 'import torch.nn.functi... |
# Imports
import semver
import unittest
import mooss.serialize.__version__ as __version__
# Tests
class TestVersion(unittest.TestCase):
def test_version(self):
"""
Testing if the version follows the 'Semantic Versioning' format.
"""
# Assertion is done through the absence... | [
"unittest.main",
"semver.VersionInfo.parse"
] | [((446, 461), 'unittest.main', 'unittest.main', ([], {}), '()\n', (459, 461), False, 'import unittest\n'), ((360, 405), 'semver.VersionInfo.parse', 'semver.VersionInfo.parse', (['__version__.VERSION'], {}), '(__version__.VERSION)\n', (384, 405), False, 'import semver\n')] |
from buildkite_auth import BuildkiteAuth
from buildkite_base import BuildkiteBase
from buildkite_builds import BuildkiteBuilds
from buildkite_organizations import BuildkiteOrganizations
from buildkite_pipelines import BuildkitePipelines
class Buildkite(BuildkiteBase):
def __init__(self):
self.api_objects =... | [
"buildkite_auth.BuildkiteAuth",
"buildkite_organizations.BuildkiteOrganizations",
"buildkite_pipelines.BuildkitePipelines",
"buildkite_builds.BuildkiteBuilds"
] | [((343, 358), 'buildkite_auth.BuildkiteAuth', 'BuildkiteAuth', ([], {}), '()\n', (356, 358), False, 'from buildkite_auth import BuildkiteAuth\n'), ((389, 413), 'buildkite_organizations.BuildkiteOrganizations', 'BuildkiteOrganizations', ([], {}), '()\n', (411, 413), False, 'from buildkite_organizations import BuildkiteO... |
from dataclasses import dataclass
@dataclass(frozen=True)
class GraphExportConf:
graph_id: str
base_dir: str
hel_extent_fp: str
with_noise_data: bool
with_greenery_data: bool
conf = GraphExportConf(
'kumpula',
'graph_build/graph_export',
'graph_build/common/hel.geojson',
True,
... | [
"dataclasses.dataclass"
] | [((37, 59), 'dataclasses.dataclass', 'dataclass', ([], {'frozen': '(True)'}), '(frozen=True)\n', (46, 59), False, 'from dataclasses import dataclass\n')] |
#!/usr/local/bin/python3.7
# -*- coding: utf-8 -*-
from datatype.list_node import ListNode, MyListNode
def reverseBetween(head: ListNode, m: int, n: int) -> ListNode:
ptr, head_ptr = head, None
while m > 1:
m -= 1
n -= 1
head_ptr = head
head = head.next
between_tail = betwe... | [
"datatype.list_node.MyListNode"
] | [((2057, 2069), 'datatype.list_node.MyListNode', 'MyListNode', ([], {}), '()\n', (2067, 2069), False, 'from datatype.list_node import ListNode, MyListNode\n')] |
import sys
from webob import Request
from pydap.responses.error import ErrorResponse
from pydap.lib import __version__
import unittest
class TestErrorResponse(unittest.TestCase):
def setUp(self):
# create an exception that would happen in runtime
try:
1/0
except Exception:
... | [
"sys.exc_info",
"webob.Request.blank"
] | [((382, 400), 'webob.Request.blank', 'Request.blank', (['"""/"""'], {}), "('/')\n", (395, 400), False, 'from webob import Request\n'), ((351, 365), 'sys.exc_info', 'sys.exc_info', ([], {}), '()\n', (363, 365), False, 'import sys\n')] |
import os
import csv
import numpy as np
import matplotlib.pyplot as plt
plt.switch_backend('agg')
from keras.models import *
from keras import metrics
from keras.layers import *
from keras import optimizers
from keras.preprocessing import text
from keras.utils import to_categorical
from keras.preprocessing import s... | [
"os.path.exists",
"keras.preprocessing.text.Tokenizer",
"keras.callbacks.ModelCheckpoint",
"keras.utils.to_categorical",
"os.path.isfile",
"keras.optimizers.Nadam",
"keras.models.Model",
"os.mkdir",
"matplotlib.pyplot.switch_backend",
"keras.preprocessing.sequence.pad_sequences",
"numpy.load",
... | [((73, 98), 'matplotlib.pyplot.switch_backend', 'plt.switch_backend', (['"""agg"""'], {}), "('agg')\n", (91, 98), True, 'import matplotlib.pyplot as plt\n'), ((1608, 1650), 'numpy.load', 'np.load', (['"""data/vectorized/Train_title.npy"""'], {}), "('data/vectorized/Train_title.npy')\n", (1615, 1650), True, 'import nump... |
"""
Placeholder file for an actual interface to the ETDB
"""
from pydantic import BaseModel
from napari.utils.events import SelectableEventedList
from datetime import date, datetime
from typing import Optional
from .etdb_entries.placeholders import starfish, spheres
class Entry(BaseModel):
date: Optional[date] =... | [
"napari.utils.events.SelectableEventedList"
] | [((1015, 1057), 'napari.utils.events.SelectableEventedList', 'SelectableEventedList', (['[starfish, spheres]'], {}), '([starfish, spheres])\n', (1036, 1057), False, 'from napari.utils.events import SelectableEventedList\n')] |
# Generated by Django 3.0.5 on 2020-05-04 20:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("api", "0003_auto_20200504_2154"),
]
operations = [
migrations.AddField(
model_name="loggeddata",
name=... | [
"django.db.models.FloatField"
] | [((351, 379), 'django.db.models.FloatField', 'models.FloatField', ([], {'default': '(0)'}), '(default=0)\n', (368, 379), False, 'from django.db import migrations, models\n'), ((513, 541), 'django.db.models.FloatField', 'models.FloatField', ([], {'default': '(0)'}), '(default=0)\n', (530, 541), False, 'from django.db im... |
from datetime import datetime, timedelta
import os
import math
import queue, json
from apscheduler.schedulers.blocking import BlockingScheduler
from agency_api_service import AgencyApiService
from scrape_data import scrape_data
''' In this module we create a class Sheduler with methods:
read_settings() - reads job_c... | [
"datetime.datetime.datetime.now",
"agency_api_service.AgencyApiService",
"scrape_data.scrape_data",
"datetime.timedelta",
"apscheduler.schedulers.blocking.BlockingScheduler",
"datetime.datetime.now",
"json.load",
"queue.Queue",
"os.path.abspath"
] | [((1522, 1540), 'agency_api_service.AgencyApiService', 'AgencyApiService', ([], {}), '()\n', (1538, 1540), False, 'from agency_api_service import AgencyApiService\n'), ((1702, 1738), 'queue.Queue', 'queue.Queue', ([], {'maxsize': 'self.queue_size'}), '(maxsize=self.queue_size)\n', (1713, 1738), False, 'import queue, js... |
from imf import make_cluster
import pylab as pl
import imf
maxmass = [imf.make_cluster(500, verbose=False, silent=True).max() for ii in
range(10000)]
maxmass_sorted = [imf.make_cluster(500, stop_criterion='sorted', verbose=False,
silent=True).max() for ii in range(10000)]... | [
"pylab.legend",
"imf.make_cluster",
"pylab.hist",
"pylab.clf"
] | [((636, 644), 'pylab.clf', 'pl.clf', ([], {}), '()\n', (642, 644), True, 'import pylab as pl\n'), ((645, 715), 'pylab.hist', 'pl.hist', (['maxmass'], {'bins': '(50)', 'alpha': '(0.5)', 'label': '"""nearest"""', 'histtype': '"""step"""'}), "(maxmass, bins=50, alpha=0.5, label='nearest', histtype='step')\n", (652, 715), ... |
from conans import ConanFile, tools
import os
required_conan_version = ">=1.43.0"
class TimsortConan(ConanFile):
name = "timsort"
description = "A C++ implementation of timsort"
topics = ("timsort", "sorting", "algorithms")
url = "https://github.com/conan-io/conan-center-index"
homepage = "https:... | [
"conans.tools.check_min_cppstd",
"conans.tools.get",
"os.path.join",
"conans.tools.Version"
] | [((809, 920), '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", (818, 920), False, 'from conans import ConanFile, tools\n'), ((630, 657), 'conans.tools.Ver... |
import sys
import os
import numpy as np
sys.path.append(os.path.join(os.path.dirname(__file__), 'pathfind/build'))
from alphazero_general.Game import Game
from .QuoridorLogic import QuoridorBoard
class QuoridorGame(Game):
def __init__(self, n):
super().__init__()
self.n = n
self.action_... | [
"os.path.dirname",
"numpy.array"
] | [((71, 96), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (86, 96), False, 'import os\n'), ((3608, 3641), 'numpy.array', 'np.array', (['pi[pawn_moves:vwa_size]'], {}), '(pi[pawn_moves:vwa_size])\n', (3616, 3641), True, 'import numpy as np\n'), ((3722, 3745), 'numpy.array', 'np.array', (['pi[... |
import praw
# Reddit developer credentials
reddit = praw.Reddit(client_id="", client_secret="", username="", password="", user_agent="")
# Instagram password and username
IGusername = ""
IGpassword = ""
| [
"praw.Reddit"
] | [((53, 141), 'praw.Reddit', 'praw.Reddit', ([], {'client_id': '""""""', 'client_secret': '""""""', 'username': '""""""', 'password': '""""""', 'user_agent': '""""""'}), "(client_id='', client_secret='', username='', password='',\n user_agent='')\n", (64, 141), False, 'import praw\n')] |
from enum import Enum, auto
class StrEnum(Enum):
def _generate_next_value(name, start, count, last_values):
return name
def __repr__(self):
return self.name
def __str__(self):
return self.name
class RegRegOpcode(StrEnum):
HALT = auto()
IN = auto()
OUT = auto()
ADD = auto()
SUB = auto()
MUL = auto()
... | [
"enum.auto"
] | [((244, 250), 'enum.auto', 'auto', ([], {}), '()\n', (248, 250), False, 'from enum import Enum, auto\n'), ((257, 263), 'enum.auto', 'auto', ([], {}), '()\n', (261, 263), False, 'from enum import Enum, auto\n'), ((271, 277), 'enum.auto', 'auto', ([], {}), '()\n', (275, 277), False, 'from enum import Enum, auto\n'), ((28... |
import pickle
import torch
import torch.nn.functional as F
from datetime import datetime
class StochasticFWAdampAttack():
def __init__(self, step_size, epsilon, perturb_steps,
random_start=None):
self.step_size = step_size
self.epsilon = epsilon
self.perturb_steps = pertur... | [
"torch.max",
"torch.sign",
"torch.randn_like",
"torch.nn.functional.cross_entropy",
"torch.no_grad",
"torch.zeros_like",
"torch.clamp"
] | [((869, 888), 'torch.zeros_like', 'torch.zeros_like', (['y'], {}), '(y)\n', (885, 888), False, 'import torch\n'), ((902, 917), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (915, 917), False, 'import torch\n'), ((1240, 1269), 'torch.clamp', 'torch.clamp', (['x_plus', '(0.0)', '(1.0)'], {}), '(x_plus, 0.0, 1.0)\n'... |
import argparse
import itertools
import logging
import os
import time
from types import SimpleNamespace
import falcon
import pandas
import torch
from falcon_cors import CORS
import waitress
import numpy as np
import json
import re
from torch.utils.data import DataLoader
from tqdm import tqdm
from data import Data
fro... | [
"logging.basicConfig",
"logging.getLogger",
"falcon_cors.CORS",
"re.split",
"json.loads",
"itertools.chain",
"argparse.ArgumentParser",
"falcon.API",
"types.SimpleNamespace",
"tqdm.tqdm",
"os.path.join",
"torch.sigmoid",
"waitress.serve",
"torch.cuda.is_available",
"torch.utils.data.Data... | [((503, 579), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(asctime)-18s %(message)s"""'}), "(level=logging.INFO, format='%(asctime)-18s %(message)s')\n", (522, 579), False, 'import logging\n'), ((589, 608), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (606,... |
#-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: kol
#
# Created: 06.02.2020
# Copyright: (c) kol 2020
# Licence: <your licence>
#-------------------------------------------------------------------------------
import sys
import... | [
"img_utils.color_to_cv_color",
"cv2.imshow",
"numpy.array",
"cv2.destroyAllWindows",
"numpy.sin",
"sys.path.append",
"skimage.draw.bezier_curve",
"simpleaudio.stop_all",
"pathlib.Path",
"cv2.VideoWriter",
"numpy.linspace",
"cv2.VideoWriter_fourcc",
"gr.utils.resize3",
"cv2.waitKey",
"ite... | [((636, 662), 'sys.path.append', 'sys.path.append', (['"""..\\\\gbr"""'], {}), "('..\\\\gbr')\n", (651, 662), False, 'import sys\n'), ((16723, 16746), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (16744, 16746), False, 'import cv2\n'), ((2010, 2032), 'cv2.flip', 'cv2.flip', (['self.body', '(1)'],... |
"""
Created on Tue Mar 27 14:34:40 2012
@author: <NAME>
Creates a table of low-pass filter coefficients for demodulating signal.
We design for a pass band of 1/2 the IF frequency and a stop-band of the IF frequency.
We arbitrarily accept 3dB of loss in the pass band and want 30dB of suppression in the stop band.
""... | [
"numpy.arange"
] | [((409, 433), 'numpy.arange', 'np.arange', (['(0.01)', '(1)', '(0.01)'], {}), '(0.01, 1, 0.01)\n', (418, 433), True, 'import numpy as np\n')] |
# This example is a misuse/misunderstanding of futures, as the expression:
# (session.get(x).result().json() for x in url_set)
# re-serialises the asynchronous operation. This is confirmed through the concurrency graph of the program, which
# shows each additional thread spawning once the prior has finished processing.... | [
"concurrent.futures.ThreadPoolExecutor",
"time.time",
"json.dump",
"requests.get"
] | [((1142, 1153), 'time.time', 'time.time', ([], {}), '()\n', (1151, 1153), False, 'import time\n'), ((1368, 1379), 'time.time', 'time.time', ([], {}), '()\n', (1377, 1379), False, 'import time\n'), ((1790, 1831), 'json.dump', 'json.dump', (['orders_raw', 'f_output'], {'indent': '(4)'}), '(orders_raw, f_output, indent=4)... |
from awssg.Client_Config import Client_Config
from awssg.VPC_Client import VPC_Client
from danilocgsilvame_python_helpers.DcgsPythonHelpers import DcgsPythonHelpers
import os
args = DcgsPythonHelpers().command_line_argument_names(
'region', 'r',
'profile', 'p'
)
if not args.region:
print("You need to spec... | [
"awssg.Client_Config.Client_Config",
"danilocgsilvame_python_helpers.DcgsPythonHelpers.DcgsPythonHelpers",
"awssg.VPC_Client.VPC_Client"
] | [((642, 654), 'awssg.VPC_Client.VPC_Client', 'VPC_Client', ([], {}), '()\n', (652, 654), False, 'from awssg.VPC_Client import VPC_Client\n'), ((183, 202), 'danilocgsilvame_python_helpers.DcgsPythonHelpers.DcgsPythonHelpers', 'DcgsPythonHelpers', ([], {}), '()\n', (200, 202), False, 'from danilocgsilvame_python_helpers.... |
# coding=utf-8
import logging
import sys
from discord.colour import Color
from sqlalchemy.ext.declarative import declarative_base
# MAIN
VERSION = '5.2.2'
BOT_PREFIX = ',,'
DESCRIPTION = 'The only custom reaction bot you\'ll ever need'
BOT_MENTION_URL = '@386627978618077184'
EMBED_COLOR = Color.from_rgb(253, 4, 91)
... | [
"logging.getLogger",
"logging.StreamHandler",
"discord.colour.Color.from_rgb",
"logging.Formatter",
"sqlalchemy.ext.declarative.declarative_base"
] | [((292, 318), 'discord.colour.Color.from_rgb', 'Color.from_rgb', (['(253)', '(4)', '(91)'], {}), '(253, 4, 91)\n', (306, 318), False, 'from discord.colour import Color\n'), ((417, 435), 'sqlalchemy.ext.declarative.declarative_base', 'declarative_base', ([], {}), '()\n', (433, 435), False, 'from sqlalchemy.ext.declarati... |
from flask import Flask, render_template, request
app = Flask(__name__)
@app.route('/')
def upload():
return render_template('upload.html')
@app.route('/uploader', methods = ['GET', 'POST'])
def upload_file():
if request.method == 'POST':
f = request.files['file']
#f.save(secure_filename(f.filename... | [
"flask.render_template",
"flask.Flask"
] | [((57, 72), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (62, 72), False, 'from flask import Flask, render_template, request\n'), ((114, 144), 'flask.render_template', 'render_template', (['"""upload.html"""'], {}), "('upload.html')\n", (129, 144), False, 'from flask import Flask, render_template, reques... |
#!/usr/bin/env python
# Copyright (c) 2015 IBM. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | [
"unittest.main",
"cloudant.cloudant",
"cloudant.credentials.read_dot_cloudant",
"uuid.uuid4"
] | [((1684, 1699), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1697, 1699), False, 'import unittest\n'), ((992, 1029), 'cloudant.credentials.read_dot_cloudant', 'read_dot_cloudant', ([], {'filename': '"""~/.clou"""'}), "(filename='~/.clou')\n", (1009, 1029), False, 'from cloudant.credentials import read_dot_cloud... |
# uncompyle6 version 3.2.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)]
# Embedded file name: lib.coginvasion.gags.Inventory
from direct.directNotify.DirectNotifyGlobal import directNotify
from direct.showbase.DirectObject import ... | [
"direct.directNotify.DirectNotifyGlobal.directNotify.newCategory",
"direct.showbase.DirectObject.DirectObject.__init__"
] | [((378, 415), 'direct.directNotify.DirectNotifyGlobal.directNotify.newCategory', 'directNotify.newCategory', (['"""Inventory"""'], {}), "('Inventory')\n", (402, 415), False, 'from direct.directNotify.DirectNotifyGlobal import directNotify\n'), ((449, 476), 'direct.showbase.DirectObject.DirectObject.__init__', 'DirectOb... |
#!/usr/bin/env python
import sys
import os
sys.path.append(os.path.join(os.path.abspath('.'), 'lib'))
import re
from flask import request
import telegram
from actualapp import app
from bot_helper import bot, TOKEN, sendMsg, editMsg, editMsgReplyMarkup, makeInlineKeyboard
from io_helper import serialise, deserialise... | [
"chat_controller.showHist",
"bus_controller.replyBusInfo",
"chat_controller.showFav",
"io_helper.deserialise",
"bot_helper.bot.answerCallbackQuery",
"chat_controller.checkQueueUponStart",
"chat_controller.showStar",
"chat_controller.replyDailyLog",
"bus_controller.replyLocation",
"bot_helper.editM... | [((607, 657), 'actualapp.app.route', 'app.route', (["('/' + TOKEN + '/HOOK')"], {'methods': "['POST']"}), "('/' + TOKEN + '/HOOK', methods=['POST'])\n", (616, 657), False, 'from actualapp import app\n'), ((1789, 1816), 're.sub', 're.sub', (['"""^/"""', '""""""', 'lowerText'], {}), "('^/', '', lowerText)\n", (1795, 1816... |
import functools
import hashlib
from flask import jsonify, request, url_for, current_app, make_response, g
from .rate_limit import RateLimit
from .errors import too_many_requests, precondition_failed, not_modified
def json(f):
@functools.wraps(f)
def wrapped(*args, **kwargs):
rv = f(*args, **kwargs)
... | [
"flask.request.args.get",
"functools.wraps",
"flask.url_for",
"flask.make_response",
"flask.request.headers.get",
"flask.jsonify"
] | [((234, 252), 'functools.wraps', 'functools.wraps', (['f'], {}), '(f)\n', (249, 252), False, 'import functools\n'), ((3882, 3900), 'functools.wraps', 'functools.wraps', (['f'], {}), '(f)\n', (3897, 3900), False, 'import functools\n'), ((684, 695), 'flask.jsonify', 'jsonify', (['rv'], {}), '(rv)\n', (691, 695), False, '... |
#_*_ coding: UTF-8 _*_
from flask import request, redirect, render_template
from application import app
import datetime
import wtforms
import logging
import db
import data_models
import renderers
import properties
import views
import custom_fields
from role_types import RoleType
import urls
from . import grants
from... | [
"flask.render_template",
"views.create_action",
"views.view_entity",
"db.find_pending_grants",
"db.Supplier",
"application.app.route",
"properties.StringProperty",
"views.view_entity_list",
"properties.get_labels",
"views.view_breadcrumbs_list",
"views.handle_post",
"datetime.timedelta",
"vi... | [((1710, 1820), 'views.Action', 'views.Action', (['"""startTransfer"""', '"""Request Foreign Transfer"""', 'RoleType.PAYMENT_ADMIN', 'perform_start_transfer'], {}), "('startTransfer', 'Request Foreign Transfer', RoleType.\n PAYMENT_ADMIN, perform_start_transfer)\n", (1722, 1820), False, 'import views\n'), ((1869, 19... |
import bpy
import os
import mathutils
import math
import sys
import uuid
print()
print("========================================================================================================================================")
print("This is Blender Python script that calls obj23dtiles")
print("Author: <NAME>")
print(... | [
"os.system"
] | [((896, 926), 'os.system', 'os.system', (['obj23dtiles_command'], {}), '(obj23dtiles_command)\n', (905, 926), False, 'import os\n')] |
import asyncio
from concurrent.futures import ThreadPoolExecutor
from multiprocessing import cpu_count
class ThreadWorker:
def __init__(self):
self.executor = ThreadPoolExecutor(max_workers=cpu_count())
def run(self, func, *args, **kwargs):
return self.executor.submit(func, *args, **kwargs)
... | [
"asyncio.run_coroutine_threadsafe",
"asyncio.new_event_loop",
"time.sleep",
"multiprocessing.cpu_count",
"asyncio.sleep",
"random.random",
"time.time"
] | [((2063, 2069), 'time.time', 'time', ([], {}), '()\n', (2067, 2069), False, 'from time import sleep, time\n'), ((792, 816), 'asyncio.new_event_loop', 'asyncio.new_event_loop', ([], {}), '()\n', (814, 816), False, 'import asyncio\n'), ((903, 952), 'asyncio.run_coroutine_threadsafe', 'asyncio.run_coroutine_threadsafe', (... |
import requests
def test_post_rollout(base_url):
data = {
"deployment_id": 1,
"versionlock": [
"eig-hp-core_lib-20200527-1.5299e2c.el7.noarch",
"eig-hp-hp_common-20200527-1.bfc6a82.el7.noarch",
"eig-hp-hp_web-20200929-1.e3729c0.el7.noarch",
],
}
... | [
"requests.post"
] | [((331, 378), 'requests.post', 'requests.post', (["(base_url + '/rollout')"], {'json': 'data'}), "(base_url + '/rollout', json=data)\n", (344, 378), False, 'import requests\n'), ((789, 837), 'requests.post', 'requests.post', (["(base_url + '/rollback')"], {'json': 'data'}), "(base_url + '/rollback', json=data)\n", (802... |
"""An example of using async_strava package"""
import os
import datetime
from typing import List, NoReturn
import asyncio
from dotenv import load_dotenv
from async_strava import strava_connector
def read_file(file_name='strava_uris.txt'):
"""
Generator, which yield's file line by line
:param file_name: ... | [
"datetime.datetime",
"os.getenv",
"dotenv.load_dotenv",
"asyncio.Semaphore",
"asyncio.gather"
] | [((727, 749), 'asyncio.Semaphore', 'asyncio.Semaphore', (['(200)'], {}), '(200)\n', (744, 749), False, 'import asyncio\n'), ((1108, 1126), 'os.getenv', 'os.getenv', (['"""LOGIN"""'], {}), "('LOGIN')\n", (1117, 1126), False, 'import os\n'), ((1148, 1169), 'os.getenv', 'os.getenv', (['"""PASSWORD"""'], {}), "('PASSWORD')... |
# ### CALC ###
print("")
print("### CALC ###")
print("")
print("Hours in a year:")
print(24*365)
print("Minutes in a decade:")
print(60*24*365*10)
print("My age in seconds:")
print((365*27+6+2+31+30+31+30+16)*24*1440)
# Correct to the nearest day at the time of writing!
print("Andreea's age:")
print(48618000/(365... | [
"random.choice",
"random.randint"
] | [((1689, 1715), 'random.randint', 'random.randint', (['(1938)', '(1950)'], {}), '(1938, 1950)\n', (1703, 1715), False, 'import random\n'), ((640, 663), 'random.choice', 'random.choice', (['greeting'], {}), '(greeting)\n', (653, 663), False, 'import random\n')] |
import unittest
import counter
# NOTE: besides these, I did "integration" testing on the commandline with
# large text files. I didn't bother to include those tests here for a few
# reasons, including speed and not being 100% sure what the true trigram
# counts were for the texts. I didn't want to assume assertion val... | [
"counter.count",
"unittest.skip"
] | [((3719, 3796), 'unittest.skip', 'unittest.skip', (['"""Set to ignore because this takes upwards of 5 minutes to run"""'], {}), "('Set to ignore because this takes upwards of 5 minutes to run')\n", (3732, 3796), False, 'import unittest\n'), ((453, 472), 'counter.count', 'counter.count', (["['']"], {}), "([''])\n", (466... |
import argparse
from time import time
from xml.dom.minidom import parseString
from block import Block
from grid import Grid
from os.path import join
from pattern import Pattern
from pattern_utils import de_densify, measure_density, pattern_to_svg, shorten_jumps, \
remove_short
from stitch import Stitch
from svguti... | [
"brother.upload",
"pattern.Pattern",
"svgutils.posturize",
"pattern_utils.remove_short",
"stitch.Stitch",
"svgutils.make_equidistant",
"pattern_utils.shorten_jumps",
"svgutils.write_debug",
"pattern_utils.de_densify",
"svgpathtools.Line",
"argparse.ArgumentParser",
"svgwrite.rgb",
"matplotli... | [((1476, 1592), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Generate a pes file for brother sewing machines from an svg or png image"""'}), "(description=\n 'Generate a pes file for brother sewing machines from an svg or png image')\n", (1499, 1592), False, 'import argparse\n'), ((... |
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class CartsAppConfig(AppConfig):
name = 'wagtailcommerce.carts'
label = 'wagtailcommerce_carts'
verbose_name = _('Wagtail Commerce Carts')
| [
"django.utils.translation.ugettext_lazy"
] | [((215, 242), 'django.utils.translation.ugettext_lazy', '_', (['"""Wagtail Commerce Carts"""'], {}), "('Wagtail Commerce Carts')\n", (216, 242), True, 'from django.utils.translation import ugettext_lazy as _\n')] |
import psycopg2
import pytz
from datetime import datetime
from sqlalchemy.sql.expression import null
from config import config
day_list = []
content_list = []
course_name_list = []
students_list = []
def get_delivery():
try:
# read connection parameters
params = config()
# connect to the ... | [
"config.config",
"pytz.timezone",
"psycopg2.connect"
] | [((285, 293), 'config.config', 'config', ([], {}), '()\n', (291, 293), False, 'from config import config\n'), ((417, 443), 'psycopg2.connect', 'psycopg2.connect', ([], {}), '(**params)\n', (433, 443), False, 'import psycopg2\n'), ((1049, 1079), 'pytz.timezone', 'pytz.timezone', (['"""Asia/Calcutta"""'], {}), "('Asia/Ca... |
#!/usr/bin/env python3
import argparse
import yaml
import logging
import math
from statistics import median
import numpy as np
import tator
if __name__=="__main__":
parser = argparse.ArgumentParser(description=__doc__)
tator.get_parser(parser)
parser.add_argument("--tracklet-type-id", type=int, required=... | [
"argparse.ArgumentParser",
"math.sqrt",
"yaml.load",
"statistics.median",
"tator.get_api",
"numpy.argmin",
"tator.get_parser"
] | [((181, 225), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__'}), '(description=__doc__)\n', (204, 225), False, 'import argparse\n'), ((230, 254), 'tator.get_parser', 'tator.get_parser', (['parser'], {}), '(parser)\n', (246, 254), False, 'import tator\n'), ((640, 676), 'tator.get_api... |
from pyunity import Behaviour, ShowInInspector, RectTransform, Screen, Vector2, Input, CheckBox, Text, SceneManager, GameObject, Canvas, Texture2D, Gui, RectOffset, Logger, Image2D, FontLoader, RGB
import os
class Mover2D(Behaviour):
rectTransform = ShowInInspector(RectTransform)
speed = ShowInInspector(float,... | [
"pyunity.RectOffset.Rectangle",
"pyunity.Vector2",
"pyunity.RGB",
"pyunity.GameObject",
"pyunity.Input.GetAxis",
"os.path.abspath",
"pyunity.Gui.MakeCheckBox",
"pyunity.ShowInInspector",
"pyunity.SceneManager.AddScene",
"pyunity.SceneManager.LoadScene",
"pyunity.FontLoader.LoadFont",
"pyunity.... | [((255, 285), 'pyunity.ShowInInspector', 'ShowInInspector', (['RectTransform'], {}), '(RectTransform)\n', (270, 285), False, 'from pyunity import Behaviour, ShowInInspector, RectTransform, Screen, Vector2, Input, CheckBox, Text, SceneManager, GameObject, Canvas, Texture2D, Gui, RectOffset, Logger, Image2D, FontLoader, ... |
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 21 13:49:08 2020
@author: <NAME>
David --- use these two charts to paste to the screen
Import works!
"""
import getYahooData as yd
finalFrame, bestSelection = yd.getOptionsData(.9,7500)
#bidAskChart = yd.getDetailedQuote('DOW')
# make the stockPareto chart. This shou... | [
"getYahooData.getOptionsData"
] | [((210, 238), 'getYahooData.getOptionsData', 'yd.getOptionsData', (['(0.9)', '(7500)'], {}), '(0.9, 7500)\n', (227, 238), True, 'import getYahooData as yd\n')] |
import patch
import validata_core
import requests
import yaml
import functools
from urllib.parse import urlencode
from collections import defaultdict
import csv
import datetime
import sys
import json
import os
import textwrap
CSV_PATH = "data/data.csv"
COMMENT_SUBJECT = "Conformité au schéma"
USER_SLUG = "validation... | [
"textwrap.dedent",
"csv.DictReader",
"validata_core.validate",
"json.dumps",
"requests.get",
"yaml.safe_load",
"collections.defaultdict",
"urllib.parse.urlencode",
"functools.lru_cache",
"datetime.date.today",
"json.dump"
] | [((386, 407), 'functools.lru_cache', 'functools.lru_cache', ([], {}), '()\n', (405, 407), False, 'import functools\n'), ((604, 625), 'functools.lru_cache', 'functools.lru_cache', ([], {}), '()\n', (623, 625), False, 'import functools\n'), ((1147, 1201), 'requests.get', 'requests.get', (['f"""{DATAGOUV_API}/datasets/{da... |
import unittest
from selenium import webdriver
class Login(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Chrome()
#self.driver = webdriver.Firefox()
#self.driver = webdriver.Safari()
self.driver.implicitly_wait(5)
self.url = "http://localhost/litecart/admin/l... | [
"unittest.main",
"selenium.webdriver.Chrome"
] | [((1076, 1091), 'unittest.main', 'unittest.main', ([], {}), '()\n', (1089, 1091), False, 'import unittest\n'), ((124, 142), 'selenium.webdriver.Chrome', 'webdriver.Chrome', ([], {}), '()\n', (140, 142), False, 'from selenium import webdriver\n')] |
# flake8: noqa
from mongoengine.errors import NotUniqueError
from src.models.group import Group
from src.models.hacker import Hacker
from src.models.user import User, ROLES
from tests.base import BaseTestCase
from datetime import datetime
class TestGroupModel(BaseTestCase):
"""Tests for the Group Model"""
de... | [
"src.models.group.Group.createOne",
"datetime.datetime.now",
"src.models.hacker.Hacker.createOne"
] | [((364, 461), 'src.models.hacker.Hacker.createOne', 'Hacker.createOne', ([], {'username': '"""foobar"""', 'email': '"""<EMAIL>"""', 'password': '"""password"""', 'roles': 'ROLES.HACKER'}), "(username='foobar', email='<EMAIL>', password='password',\n roles=ROLES.HACKER)\n", (380, 461), False, 'from src.models.hacker ... |
# coding=utf-8
# Copyright (c) Microsoft Corporation. Licensed under the MIT license.
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use ... | [
"logging.getLogger",
"torch.max",
"torch.cuda.device_count",
"numpy.equal",
"torch.utils.data.distributed.DistributedSampler",
"torch.cuda.is_available",
"torch.distributed.barrier",
"transformers.DataCollatorForLanguageModeling",
"os.path.exists",
"transformers.glue_convert_examples_to_features",... | [((2079, 2106), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (2096, 2106), False, 'import logging\n'), ((2406, 2428), 'random.seed', 'random.seed', (['args.seed'], {}), '(args.seed)\n', (2417, 2428), False, 'import random\n'), ((2433, 2458), 'numpy.random.seed', 'np.random.seed', (['arg... |
import os,json,time,requests,task1,task8
from bs4 import BeautifulSoup
from pprint import pprint
def movies_byDirector_language(moviesLst):
mainDic={}
for dic in moviesLst:
subdic={}
for direc in dic["director"]:
if direc not in mainDic:
mainDic[direc]=subdic.copy()
for dic in moviesLst:
for d... | [
"task1.top_250movies",
"task8.movie_detailsLst"
] | [((1190, 1211), 'task1.top_250movies', 'task1.top_250movies', ([], {}), '()\n', (1209, 1211), False, 'import os, json, time, requests, task1, task8\n'), ((1214, 1249), 'task8.movie_detailsLst', 'task8.movie_detailsLst', (['movies_list'], {}), '(movies_list)\n', (1236, 1249), False, 'import os, json, time, requests, tas... |
import types
from dataclasses import dataclass
from typing import Callable, List, Union
from fastapi import Depends, FastAPI, HTTPException, Query
from sqlmodel import Field, Session, SQLModel, select
# Model generator + container -------------------------------------------------------------
@dataclass
class Multi... | [
"fastapi.HTTPException",
"fastapi.Query",
"sqlmodel.select",
"fastapi.Depends",
"sqlmodel.Field"
] | [((5955, 5982), 'fastapi.Query', 'Query', ([], {'default': '(100)', 'lte': '(100)'}), '(default=100, lte=100)\n', (5960, 5982), False, 'from fastapi import Depends, FastAPI, HTTPException, Query\n'), ((7999, 8026), 'fastapi.Query', 'Query', ([], {'default': '(100)', 'lte': '(100)'}), '(default=100, lte=100)\n', (8004, ... |
#!/usr/bin/env python
# coding: utf-8
# In[80]:
#Кластеризация Piplines
#1 only this implimented
# train BOF[:topN] 20k -> SentenceTransformer -> AgglomerativeClustering -> KNeighborsClassifier
# inference predict KNeighborsClassifier
#2 bs 700k sample -> SentenceTransformer -> BKmeans
#3 bs 50k sapmle -> SentenceT... | [
"sentence_transformers.SentenceTransformer",
"pandas.read_csv",
"torch.mean",
"pickle.load",
"itertools.chain.from_iterable",
"torch.tensor",
"src.utils.Preprocessing_text.PreprocText",
"numpy.linalg.norm"
] | [((1172, 1215), 'sentence_transformers.SentenceTransformer', 'SentenceTransformer', (['self.args.name_embeder'], {}), '(self.args.name_embeder)\n', (1191, 1215), False, 'from sentence_transformers import SentenceTransformer\n'), ((1572, 1607), 'pandas.read_csv', 'pd.read_csv', (['self.args.path_to_data'], {}), '(self.a... |
# -*- coding: utf-8 -*-
"""
Routes for the restfulapi addon.
"""
from framework.routing import Rule, json_renderer
from . import views
widget_routes = {
'rules': [
Rule(
[
'/project/<pid>/restfulapi/download/'
],
'post',
views.restfulapi_dow... | [
"framework.routing.Rule"
] | [((179, 279), 'framework.routing.Rule', 'Rule', (["['/project/<pid>/restfulapi/download/']", '"""post"""', 'views.restfulapi_download', 'json_renderer'], {}), "(['/project/<pid>/restfulapi/download/'], 'post', views.\n restfulapi_download, json_renderer)\n", (183, 279), False, 'from framework.routing import Rule, js... |
import logging
from django.core.management.base import BaseCommand
from django.db.transaction import atomic
from core.models import DataSource
from ...logic.sync import sync_identities_with_erms, sync_users_with_erms
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = 'Sync organizations b... | [
"logging.getLogger",
"core.models.DataSource.objects.get_or_create"
] | [((229, 256), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (246, 256), False, 'import logging\n'), ((486, 563), 'core.models.DataSource.objects.get_or_create', 'DataSource.objects.get_or_create', ([], {'short_name': '"""ERMS"""', 'type': 'DataSource.TYPE_API'}), "(short_name='ERMS', typ... |
from duck import DecoyDuck, MallardDuck, ModelDuck, RubberDuck
from fly_behavior import FlyRocketPowered
if __name__ == "__main__":
# Cria instâncias de patos
print("Mallard duck")
mallard = MallardDuck()
mallard.perform_quack()
mallard.perform_fly()
print("Rubber duck")
rubber = RubberDuc... | [
"duck.RubberDuck",
"duck.MallardDuck",
"duck.ModelDuck",
"fly_behavior.FlyRocketPowered",
"duck.DecoyDuck"
] | [((204, 217), 'duck.MallardDuck', 'MallardDuck', ([], {}), '()\n', (215, 217), False, 'from duck import DecoyDuck, MallardDuck, ModelDuck, RubberDuck\n'), ((311, 323), 'duck.RubberDuck', 'RubberDuck', ([], {}), '()\n', (321, 323), False, 'from duck import DecoyDuck, MallardDuck, ModelDuck, RubberDuck\n'), ((423, 434), ... |
# @author lucasmiranda42
# encoding: utf-8
# module deepof
"""
Testing module for deepof.train_utils
"""
import os
import numpy as np
import tensorflow as tf
from hypothesis import HealthCheck
from hypothesis import given
from hypothesis import settings
from hypothesis import strategies as st
from hypothesis.extra... | [
"numpy.ones",
"hypothesis.strategies.integers",
"os.path.join",
"hypothesis.strategies.floats",
"hypothesis.strategies.just",
"hypothesis.settings"
] | [((2220, 2311), 'hypothesis.settings', 'settings', ([], {'max_examples': '(16)', 'deadline': 'None', 'suppress_health_check': '[HealthCheck.too_slow]'}), '(max_examples=16, deadline=None, suppress_health_check=[HealthCheck\n .too_slow])\n', (2228, 2311), False, 'from hypothesis import settings\n'), ((3724, 3855), 'h... |
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import event
from sqlalchemy.engine import Engine
from sqlite3 import Connection as SQLite3Connection
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////Users/divyamadhuri/Documents/Python/ppty_mgmnt/Real_Estate/RES... | [
"flask_sqlalchemy.SQLAlchemy",
"sqlalchemy.event.listens_for",
"flask.Flask"
] | [((189, 204), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (194, 204), False, 'from flask import Flask\n'), ((377, 392), 'flask_sqlalchemy.SQLAlchemy', 'SQLAlchemy', (['app'], {}), '(app)\n', (387, 392), False, 'from flask_sqlalchemy import SQLAlchemy\n'), ((396, 432), 'sqlalchemy.event.listens_for', 'ev... |
from __future__ import annotations
from pathlib import Path, PurePosixPath
from typing import TYPE_CHECKING
from .base import ExecutionError, ExecutionResult, NotebookClientBase # noqa: F401
from .cache import NotebookClientCache
from .direct import NotebookClientDirect
from .inline import NotebookClientInline
if T... | [
"pathlib.Path"
] | [((1343, 1355), 'pathlib.Path', 'Path', (['source'], {}), '(source)\n', (1347, 1355), False, 'from pathlib import Path, PurePosixPath\n'), ((1359, 1371), 'pathlib.Path', 'Path', (['source'], {}), '(source)\n', (1363, 1371), False, 'from pathlib import Path, PurePosixPath\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from tabulate import tabulate
from base import BaseObject
from datamongo import BaseMongoClient
from datamongo import CendantCollection
from datamongo import CendantXdm
from datamongo import TransformCendantRecords
class RecordRetriever(BaseObject):
def __init__(s... | [
"tabulate.tabulate",
"datamongo.CendantXdm.dataframe",
"base.BaseObject.__init__",
"datamongo.TransformCendantRecords.to_dataframe",
"datamongo.CendantCollection"
] | [((1299, 1334), 'base.BaseObject.__init__', 'BaseObject.__init__', (['self', '__name__'], {}), '(self, __name__)\n', (1318, 1334), False, 'from base import BaseObject\n'), ((1599, 1721), 'datamongo.CendantCollection', 'CendantCollection', ([], {'is_debug': 'self._is_debug', 'some_base_client': 'self._mongo_client', 'so... |
import os,imaplib,email,subprocess,time
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.header import decode_header
from ansi2html import Ansi2HTMLConverter
from flask import Flask
app = Flask(__name__)
mail = ''
pas = ''
number = ''
imap_server = ''
def... | [
"imaplib.IMAP4_SSL",
"flask.Flask",
"email.message_from_string",
"time.sleep",
"ansi2html.Ansi2HTMLConverter",
"os.popen"
] | [((250, 265), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (255, 265), False, 'from flask import Flask\n'), ((366, 394), 'imaplib.IMAP4_SSL', 'imaplib.IMAP4_SSL', (['imap_host'], {}), '(imap_host)\n', (383, 394), False, 'import os, imaplib, email, subprocess, time\n'), ((659, 724), 'email.message_from_st... |
from datetime import datetime
class PrintLogger():
def __init__(self, name):
self.name = name
def __call__(self, arg):
print("{} | {} : {}".format(datetime.now(), self.name, arg)) | [
"datetime.datetime.now"
] | [((182, 196), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (194, 196), False, 'from datetime import datetime\n')] |
import sys
import logging
import psycopg2
import os
from datetime import datetime
import json
# rds settings
rds_host = os.environ.get('RDS_HOST')
rds_username = os.environ.get('RDS_USERNAME')
rds_user_pwd = os.environ.get('RDS_USER_PWD')
logger = logging.getLogger()
logger.setLevel(logging.INFO)
try:
conn_strin... | [
"logging.getLogger",
"psycopg2.connect",
"json.dumps",
"os.environ.get",
"sys.exit"
] | [((121, 147), 'os.environ.get', 'os.environ.get', (['"""RDS_HOST"""'], {}), "('RDS_HOST')\n", (135, 147), False, 'import os\n'), ((163, 193), 'os.environ.get', 'os.environ.get', (['"""RDS_USERNAME"""'], {}), "('RDS_USERNAME')\n", (177, 193), False, 'import os\n'), ((209, 239), 'os.environ.get', 'os.environ.get', (['"""... |
from flask import request
from flask_restx import Resource, reqparse, inputs
from ..service.service_helper import Auth
from ..utils.dto import AuthDto
api = AuthDto.api
_user_auth = AuthDto.user_auth
@api.doc(security=None)
@api.route('/login')
class LoginAPIController(Resource):
"""
User login Resource
... | [
"flask_restx.reqparse.RequestParser"
] | [((754, 778), 'flask_restx.reqparse.RequestParser', 'reqparse.RequestParser', ([], {}), '()\n', (776, 778), False, 'from flask_restx import Resource, reqparse, inputs\n')] |
import scipy.io as sio;
import numpy;
from numpy import sin, linspace, pi
from pylab import plot, show, title, xlabel, ylabel, subplot
from scipy import fft, arange
import time;
def getFFT(y, Fs):
L = len(y);
Y = numpy.fft.rfft(y);
freq = numpy.fft.fftfreq(L);
plot(freq, Y.real);
show();
x = sio.... | [
"numpy.asmatrix",
"pylab.plot",
"scipy.io.loadmat",
"numpy.fft.fftfreq",
"numpy.asarray",
"numpy.fft.rfft",
"pylab.show"
] | [((316, 352), 'scipy.io.loadmat', 'sio.loadmat', (['"""Sub1_singletarget.mat"""'], {}), "('Sub1_singletarget.mat')\n", (327, 352), True, 'import scipy.io as sio\n'), ((409, 438), 'numpy.asmatrix', 'numpy.asmatrix', (['eegData[0][0]'], {}), '(eegData[0][0])\n', (423, 438), False, 'import numpy\n'), ((544, 561), 'pylab.p... |
"""
Issue #4 - screen for complete genomes or segments
"""
from Bio import Entrez
from time import sleep
from csv import DictReader, DictWriter
Entrez.email = '<EMAIL>'
reader = DictReader(open('../data/viruses.csv'))
handle = open('../data/complete.csv', 'w')
writer = DictWriter(handle, fieldnames=reader.fieldnames... | [
"csv.DictWriter",
"Bio.Entrez.read",
"time.sleep"
] | [((273, 321), 'csv.DictWriter', 'DictWriter', (['handle'], {'fieldnames': 'reader.fieldnames'}), '(handle, fieldnames=reader.fieldnames)\n', (283, 321), False, 'from csv import DictReader, DictWriter\n'), ((448, 469), 'Bio.Entrez.read', 'Entrez.read', (['response'], {}), '(response)\n', (459, 469), False, 'from Bio imp... |
import re
import os
import io
import time
import shlex
import logging
import tempfile
import subprocess
from PIL import Image
from lxml import etree
class WaitforTimeout(RuntimeError):
pass
class CouldNotDumpScreen(RuntimeError):
pass
class NotReachedToActivityError(RuntimeError):
def __init__(self, ... | [
"subprocess.check_output",
"shlex.join",
"re.compile",
"shlex.split",
"subprocess.Popen",
"lxml.etree.XML",
"io.BytesIO",
"logging.warning",
"time.sleep",
"re.match",
"tempfile.gettempdir",
"time.time",
"re.search"
] | [((1017, 1095), 'subprocess.check_output', 'subprocess.check_output', (['cmd'], {'text': 'text', 'shell': '(True)', 'timeout': 'timeout'}), '(cmd, text=text, shell=True, timeout=timeout, **kwargs)\n', (1040, 1095), False, 'import subprocess\n'), ((1346, 1359), 'time.sleep', 'time.sleep', (['(5)'], {}), '(5)\n', (1356, ... |
from tkinter import Tk
from multiprocessing import Process
from application import Application
from config import Config
from upnp.upnp import Upnp
import asyncio
import websockets
import concurrent.futures
import json
async def open_port_register():
upnp=Upnp()
upnp.delete_port_mapping(tensorflow_port)
up... | [
"application.Application",
"upnp.upnp.Upnp",
"config.Config",
"multiprocessing.Process",
"json.dumps",
"tkinter.Tk",
"websockets.connect",
"asyncio.get_event_loop"
] | [((261, 267), 'upnp.upnp.Upnp', 'Upnp', ([], {}), '()\n', (265, 267), False, 'from upnp.upnp import Upnp\n'), ((688, 712), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (710, 712), False, 'import asyncio\n'), ((832, 840), 'config.Config', 'Config', ([], {}), '()\n', (838, 840), False, 'from conf... |
from io import TextIOWrapper
import json
from datetime import datetime, timedelta
import dateutil.parser
from cache.www import fetch_url
import errno
import os
class Mensa:
def __init__(self, api_version = 1, app_version = 1, language = "de"):
self.api_key = "<KEY>"
self.cache_timeout = timedelta(... | [
"json.loads",
"cache.www.fetch_url",
"json.load",
"datetime.datetime.now",
"os.path.abspath",
"datetime.timedelta",
"json.dump"
] | [((310, 330), 'datetime.timedelta', 'timedelta', ([], {'minutes': '(5)'}), '(minutes=5)\n', (319, 330), False, 'from datetime import datetime, timedelta\n'), ((562, 596), 'os.path.abspath', 'os.path.abspath', (["(__file__ + '/../')"], {}), "(__file__ + '/../')\n", (577, 596), False, 'import os\n'), ((1347, 1361), 'cach... |
"""AyudaEnPython: https://www.facebook.com/groups/ayudapython
TODO: add docstring and tests.
"""
import pandas as pd
from prototools import retrieve_argname, tabulate, red
HEADERS = ["Source", "A", "B", "C"]
source_1 = pd.DataFrame(
{
"A": [1, 2, 3],
"B": [4, 5, 6],
"C": [7, 8, 9]
}
)... | [
"pandas.DataFrame",
"prototools.retrieve_argname",
"prototools.tabulate",
"pandas.concat"
] | [((222, 284), 'pandas.DataFrame', 'pd.DataFrame', (["{'A': [1, 2, 3], 'B': [4, 5, 6], 'C': [7, 8, 9]}"], {}), "({'A': [1, 2, 3], 'B': [4, 5, 6], 'C': [7, 8, 9]})\n", (234, 284), True, 'import pandas as pd\n'), ((332, 403), 'pandas.DataFrame', 'pd.DataFrame', (["{'A': [10, 11, 12], 'B': [13, 14, 15], 'C': [16, 17, 18]}"... |
import os
if os.getenv("LEVEL") == "PRODUCTION":
print('RUN PRODUCTION MODE')
from .production import *
else:
print('RUN LOCAL MODE')
from .local import *
from .base import *
| [
"os.getenv"
] | [((14, 32), 'os.getenv', 'os.getenv', (['"""LEVEL"""'], {}), "('LEVEL')\n", (23, 32), False, 'import os\n')] |
from .learning_curves import LearningCurve
import matplotlib.pyplot as plt
import numpy as np
class LearningCurveCombined():
""" Provide helper functions to plot, fit and extrapolate learning curve using multiple learning curves."""
def __init__(self, n):
""" Instantiante a LearningCurveComb... | [
"numpy.mean",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.errorbar",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.fill_between",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"numpy.linspace",
"numpy.std",
"matplotlib.pyplot.leg... | [((2927, 2954), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': 'figsize'}), '(figsize=figsize)\n', (2937, 2954), True, 'import matplotlib.pyplot as plt\n'), ((3198, 3208), 'matplotlib.pyplot.grid', 'plt.grid', ([], {}), '()\n', (3206, 3208), True, 'import matplotlib.pyplot as plt\n'), ((3218, 3247), 'matplo... |
from __future__ import annotations
from collections.abc import Mapping
from typing import Optional
import pytest
from pdoc.render_helpers import relative_link, edit_url, split_identifier
@pytest.mark.parametrize(
"current,target,relative",
[
("foo", "foo", ""),
("foo", "bar", "bar.html"),
... | [
"pytest.mark.parametrize",
"pdoc.render_helpers.edit_url",
"pdoc.render_helpers.relative_link",
"pdoc.render_helpers.split_identifier"
] | [((193, 474), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""current,target,relative"""', "[('foo', 'foo', ''), ('foo', 'bar', 'bar.html'), ('foo.foo', 'foo',\n '../foo.html'), ('foo.foo', 'bar', '../bar.html'), ('foo.bar',\n 'foo.bar.baz', 'bar/baz.html'), ('foo.bar.baz', 'foo.qux.quux',\n '../qu... |
# Build graph from pairs of word with its weight
# Produce function to get all paths from one node to other node
# minhvvu 2017-05-25
import networkx as nx
import graph_utils as gutil
def create_from_pairs(pairs):
"""
Build graph from `pairs` of words.
Accumulate weight for the edges that appear multiple... | [
"graph_utils.write_edges",
"graph_utils.read_edges",
"networkx.DiGraph",
"networkx.all_simple_paths",
"networkx.dijkstra_path",
"graph_utils.print_graph"
] | [((343, 355), 'networkx.DiGraph', 'nx.DiGraph', ([], {}), '()\n', (353, 355), True, 'import networkx as nx\n'), ((925, 954), 'graph_utils.write_edges', 'gutil.write_edges', (['G', 'outname'], {}), '(G, outname)\n', (942, 954), True, 'import graph_utils as gutil\n'), ((1085, 1112), 'networkx.dijkstra_path', 'nx.dijkstra... |
from modulo import soma as s
print(s(7, 8))
| [
"modulo.soma"
] | [((36, 43), 'modulo.soma', 's', (['(7)', '(8)'], {}), '(7, 8)\n', (37, 43), True, 'from modulo import soma as s\n')] |
from rest_framework import viewsets
from rest_framework.permissions import AllowAny
from mliyweb.api.v2.serializers import InstanceSerializer
from mliyweb.models import Instance
class InstanceViewSet(viewsets.ModelViewSet):
queryset = Instance.objects.all().exclude(state__iexact='terminated')
serializer_class = In... | [
"mliyweb.models.Instance.objects.all"
] | [((239, 261), 'mliyweb.models.Instance.objects.all', 'Instance.objects.all', ([], {}), '()\n', (259, 261), False, 'from mliyweb.models import Instance\n')] |
# -*- coding: utf-8 -*-
"""
DRAFT: encoder
EXTRA:
@author: BenJammin
"""
from FISTA import FISTA
class Encoder:
# If you want to train a layer as a dictionary, i.e. treating its
# output as a code, add the module(s) here:
self._linear_pytorch_mods = [nn.Linear, nn.Biliniear, nn.LazyLinear,
... | [
"FISTA.FISTA"
] | [((1901, 1914), 'FISTA.FISTA', 'FISTA', (['config'], {}), '(config)\n', (1906, 1914), False, 'from FISTA import FISTA\n')] |
import pytest
tf = pytest.importorskip("tensorflow")
trt = pytest.importorskip("tensorrt")
uff = pytest.importorskip("uff")
engine_glob = ''
def create_dummy_engine(resourcepath):
global engine_glob
model = tf.placeholder(tf.float32, [None, 28, 28, 1], name='input')
model = tf.layers.conv2d(model, 64,... | [
"pytest.mark.engine",
"pytest.importorskip",
"os.path.join",
"numpy.zeros"
] | [((21, 54), 'pytest.importorskip', 'pytest.importorskip', (['"""tensorflow"""'], {}), "('tensorflow')\n", (40, 54), False, 'import pytest\n'), ((61, 92), 'pytest.importorskip', 'pytest.importorskip', (['"""tensorrt"""'], {}), "('tensorrt')\n", (80, 92), False, 'import pytest\n'), ((99, 125), 'pytest.importorskip', 'pyt... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2017-02-06 20:53
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('awards', '0058_auto_20170206_2032'),
]
operations = [
migrations.AddField(
... | [
"django.db.models.DecimalField"
] | [((421, 547), 'django.db.models.DecimalField', 'models.DecimalField', ([], {'blank': '(True)', 'decimal_places': '(2)', 'max_digits': '(20)', 'null': '(True)', 'verbose_name': '"""Potential Total Value of Award"""'}), "(blank=True, decimal_places=2, max_digits=20, null=True,\n verbose_name='Potential Total Value of ... |
#!/usr/bin/env python3
# checkallupdates
# Returns a nice formatted list of available Arch updates similar to the one provided by yaourt,
# but without the need for admin rights.
#
# TODO: * netup size doesn't work without updating the repos with pacman -Sy. how to get the
# size of the new version?
#
# depend... | [
"texttable.Texttable",
"subprocess.Popen"
] | [((712, 747), 'texttable.Texttable', 'texttable.Texttable', ([], {'max_width': '(1000)'}), '(max_width=1000)\n', (731, 747), False, 'import subprocess, texttable\n'), ((1292, 1357), 'subprocess.Popen', 'subprocess.Popen', (["(['pacman', '-Si'] + pkg)"], {'stdout': 'subprocess.PIPE'}), "(['pacman', '-Si'] + pkg, stdout=... |
import asyncio
import os
import textwrap
import urllib
from typing import Tuple
import caproto.server
from .archstats import Archstats
SUPPORTED_DATABASE_BACKENDS = {'elastic', }
def get_archiver_url() -> str:
"""Get the archiver appliance interface URL from the environment."""
archiver_url = os.environ.ge... | [
"textwrap.dedent",
"asyncio.get_event_loop",
"os.environ.get",
"urllib.parse.urlsplit"
] | [((307, 380), 'os.environ.get', 'os.environ.get', (['"""ARCHIVER_URL"""', '"""http://pscaa02.slac.stanford.edu:17665/"""'], {}), "('ARCHIVER_URL', 'http://pscaa02.slac.stanford.edu:17665/')\n", (321, 380), False, 'import os\n'), ((598, 633), 'urllib.parse.urlsplit', 'urllib.parse.urlsplit', (['archiver_url'], {}), '(ar... |
from precession.config import Config
import yaml
def test_config_load_dict():
config = Config.load({
"tEnd": 30,
"maxSteps": 50
})
assert config.tEnd == 30
assert config.maxSteps == 50
def test_config_serialize(tmp_path):
config = Config.load({
"tEnd": 30,
"maxSt... | [
"yaml.safe_dump",
"precession.config.Config.load"
] | [((93, 134), 'precession.config.Config.load', 'Config.load', (["{'tEnd': 30, 'maxSteps': 50}"], {}), "({'tEnd': 30, 'maxSteps': 50})\n", (104, 134), False, 'from precession.config import Config\n'), ((272, 313), 'precession.config.Config.load', 'Config.load', (["{'tEnd': 30, 'maxSteps': 50}"], {}), "({'tEnd': 30, 'maxS... |
import os
import glob
import csv
import pandas as pd
import numpy as np
from collections import deque
from itertools import chain
from utils import rotate_quat, rotate_cross_product
class Sensor(object):
def __init__(self, name, fieldnames, data):
self.name = name
self.fieldnames = fieldnames
... | [
"numpy.mean",
"collections.deque",
"numpy.searchsorted",
"os.path.join",
"os.path.split",
"numpy.sum",
"numpy.isnan",
"utils.rotate_quat",
"numpy.linalg.norm",
"numpy.argmin",
"csv.reader"
] | [((3483, 3490), 'collections.deque', 'deque', ([], {}), '()\n', (3488, 3490), False, 'from collections import deque\n'), ((6937, 6958), 'utils.rotate_quat', 'rotate_quat', (['acc', 'rot'], {}), '(acc, rot)\n', (6948, 6958), False, 'from utils import rotate_quat, rotate_cross_product\n'), ((8201, 8222), 'utils.rotate_qu... |
import datetime
import json
import sys
from caresjpsutil import PythonLogger
from pyproj import Proj, transform
import admsTest
from admsAplWriterShip import admsAplWriter
from admsInputDataRetrieverChimney import admsInputDataRetriever
from config import Constants
from adms_apl_builder import *
pythonLogger = PythonL... | [
"caresjpsutil.PythonLogger",
"json.loads",
"admsTest.get_bdn",
"admsInputDataRetrieverChimney.admsInputDataRetriever",
"pyproj.transform",
"datetime.datetime.now",
"admsTest.get_coordinates",
"pyproj.Proj"
] | [((313, 340), 'caresjpsutil.PythonLogger', 'PythonLogger', (['"""admsTest.py"""'], {}), "('admsTest.py')\n", (325, 340), False, 'from caresjpsutil import PythonLogger\n'), ((381, 403), 'pyproj.Proj', 'Proj', ([], {'init': '"""epsg:4326"""'}), "(init='epsg:4326')\n", (385, 403), False, 'from pyproj import Proj, transfor... |
from nacl.signing import SigningKey
from threesdk import english
import binascii
import requests
import base64
NETWORKS = {"mainnet": "explorer.grid.tf", "testnet": "explorer.testnet.grid.tf", "devnet": "explorer.devnet.grid.tf"}
class SDKContainers:
def __init__(self, core, args):
self.container = None
... | [
"requests.get",
"nacl.signing.SigningKey",
"base64.b64decode",
"binascii.unhexlify"
] | [((598, 637), 'base64.b64decode', 'base64.b64decode', (["user_app['publicKey']"], {}), "(user_app['publicKey'])\n", (614, 637), False, 'import base64\n'), ((649, 686), 'binascii.unhexlify', 'binascii.unhexlify', (['user_explorer_key'], {}), '(user_explorer_key)\n', (667, 686), False, 'import binascii\n'), ((830, 904), ... |
"""!
Utilities for random number generators.
See isle.random.RNGWrapper for the common interface of wrappers.
"""
from abc import ABC, abstractmethod
import numpy as np
class RNGWrapper(ABC):
"""!
Base for all RNG wrappers.
"""
@property
def NAME(self):
"""!Unique name of the RNG."""
... | [
"numpy.array",
"numpy.random.RandomState"
] | [((2907, 2934), 'numpy.random.RandomState', 'np.random.RandomState', (['seed'], {}), '(seed)\n', (2928, 2934), True, 'import numpy as np\n'), ((6203, 6226), 'numpy.array', 'np.array', (["group['keys']"], {}), "(group['keys'])\n", (6211, 6226), True, 'import numpy as np\n')] |
#!/usr/bin/env python
from dockdev.dockdev import parse_config
import os
from nose.tools import assert_equal
from nose.tools import assert_not_equal
from nose.tools import assert_raises
from nose.tools import assert_in
from nose.tools import raises
class TestConfig(object):
def test_empty(self):
parse_c... | [
"dockdev.dockdev.parse_config",
"nose.tools.assert_equal"
] | [((313, 347), 'dockdev.dockdev.parse_config', 'parse_config', (['"""{ "services": {} }"""'], {}), '(\'{ "services": {} }\')\n', (325, 347), False, 'from dockdev.dockdev import parse_config\n'), ((402, 523), 'dockdev.dockdev.parse_config', 'parse_config', (['"""{ "services": { "service1": { "git_repo": "abc", "docker_re... |