repo_name stringlengths 7 94 | repo_path stringlengths 4 237 | repo_head_hexsha stringlengths 40 40 | content stringlengths 10 680k | apis stringlengths 2 840k |
|---|---|---|---|---|
Manny27nyc/oci-python-sdk | src/oci/apm_traces/models/query_result_row_type_summary.py | de60b04e07a99826254f7255e992f41772902df7 | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | [((187, 15, 187, 40), 'oci.util.formatted_flat_dict', 'formatted_flat_dict', ({(187, 35, 187, 39): 'self'}, {}), '(self)', False, 'from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel\n')] |
salesforce/CodeGen | jaxformer/hf/sample.py | 2ca076874ca2d26c2437df2968f6c43df92748bc | # Copyright (c) 2022, salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
import os
import re
import time
import random
import argparse
import torch
from transformers import ... | [((40, 4, 40, 21), 'random.seed', 'random.seed', ({(40, 16, 40, 20): 'seed'}, {}), '(seed)', False, 'import random\n'), ((42, 4, 42, 27), 'torch.manual_seed', 'torch.manual_seed', ({(42, 22, 42, 26): 'seed'}, {}), '(seed)', False, 'import torch\n'), ((43, 7, 43, 32), 'torch.cuda.is_available', 'torch.cuda.is_available'... |
dev-11/mars-rover-challenge | tests/services/test_rover_runner_service.py | 67569fcc4b93e5ec4cbe466d7a2fd5b3e9a316b0 | import unittest
from services import RoverRunnerService
from tests.test_environment.marses import small_mars_with_one_rover_empty_commands
from tests.test_environment import mocks as m
from data_objects import Rover
class TestRoverRunnerService(unittest.TestCase):
def test_rover_runner_moves_rover_forward(self):... | [((13, 14, 13, 84), 'tests.test_environment.mocks.get_mocked_turn_command_selector_turn_left_from_north_command_only', 'm.get_mocked_turn_command_selector_turn_left_from_north_command_only', ({}, {}), '()', True, 'from tests.test_environment import mocks as m\n'), ((14, 14, 14, 69), 'tests.test_environment.mocks.get_mo... |
ericdaat/self-label | retrain_with_rotnet.py | 7c12f834c7b6bd5bee2f7f165aab33d4c4e50b51 | import argparse
import warnings
warnings.simplefilter("ignore", UserWarning)
import files
from tensorboardX import SummaryWriter
import os
import numpy as np
import time
import torch
import torch.optim
import torch.nn as nn
import torch.utils.data
import torchvision
import torchvision.transforms as tfs
from data impo... | [((3, 0, 3, 44), 'warnings.simplefilter', 'warnings.simplefilter', ({(3, 22, 3, 30): '"""ignore"""', (3, 32, 3, 43): 'UserWarning'}, {}), "('ignore', UserWarning)", False, 'import warnings\n'), ((24, 16, 24, 84), 'torchvision.transforms.Normalize', 'tfs.Normalize', (), '', True, 'import torchvision.transforms as tfs\n'... |
Jinwithyoo/han | tests/vie.py | 931a271e56134dcc35029bf75260513b60884f6c | # -*- coding: utf-8 -*-
from tests import HangulizeTestCase
from hangulize.langs.vie import Vietnamese
class VietnameseTestCase(HangulizeTestCase):
""" http://korean.go.kr/09_new/dic/rule/rule_foreign_0218.jsp """
lang = Vietnamese()
def test_1st(self):
"""제1항
nh는 이어지는 모음과 합쳐서 한 음절로 적는다.... | [((9, 11, 9, 23), 'hangulize.langs.vie.Vietnamese', 'Vietnamese', ({}, {}), '()', False, 'from hangulize.langs.vie import Vietnamese\n')] |
jackromo/mathLibPy | tests/test_functions/test_trig.py | b80badd293b93da85aaf122c3d3da022f6dab361 | from mathlibpy.functions import *
import unittest
class SinTester(unittest.TestCase):
def setUp(self):
self.sin = Sin()
def test_call(self):
self.assertEqual(self.sin(0), 0)
def test_eq(self):
self.assertEqual(self.sin, Sin())
def test_get_derivative_call(self):
sel... | [((51, 4, 51, 19), 'unittest.main', 'unittest.main', ({}, {}), '()', False, 'import unittest\n')] |
rajitbanerjee/leetcode | src/smallestLetter/target.py | 720fcdd88d371e2d6592ceec8370a6760a77bb89 | class Solution:
def nextGreatestLetter(self, letters: list, target: str) -> str:
if target < letters[0] or target >= letters[-1]:
return letters[0]
left, right = 0, len(letters) - 1
while left < right:
mid = left + (right - left) // 2
if letters[mid] > tar... | [] |
hyx0329/nonebot_plugin_anti_cpdaily | anti_cpdaily/command.py | 5868626fb95876f9638aaa1edd9a2f914ea7bed1 | import nonebot
from nonebot import on_command
from nonebot.rule import to_me
from nonebot.typing import T_State
from nonebot.adapters import Bot, Event
from nonebot.log import logger
from .config import global_config
from .schedule import anti_cpdaily_check_routine
cpdaily = on_command('cpdaily')
scheduler = nonebot... | [((12, 10, 12, 31), 'nonebot.on_command', 'on_command', ({(12, 21, 12, 30): '"""cpdaily"""'}, {}), "('cpdaily')", False, 'from nonebot import on_command\n'), ((13, 12, 13, 57), 'nonebot.require', 'nonebot.require', ({(13, 28, 13, 56): '"""nonebot_plugin_apscheduler"""'}, {}), "('nonebot_plugin_apscheduler')", False, 'i... |
gottaegbert/penter | matplotlib/gallery_python/pyplots/dollar_ticks.py | 8cbb6be3c4bf67c7c69fa70e597bfbc3be4f0a2d | """
============
Dollar Ticks
============
Use a `~.ticker.FormatStrFormatter` to prepend dollar signs on y axis labels.
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
# Fixing random state for reproducibility
np.random.seed(19680801)
fig, ax = plt.subplots()
ax.plot(100*np... | [((13, 0, 13, 24), 'numpy.random.seed', 'np.random.seed', ({(13, 15, 13, 23): '(19680801)'}, {}), '(19680801)', True, 'import numpy as np\n'), ((15, 10, 15, 24), 'matplotlib.pyplot.subplots', 'plt.subplots', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((18, 12, 18, 47), 'matplotlib.ticker.FormatStrForma... |
chiro2001/chibrary | Chibrary/utils.py | da31ef80df394cfb260fbe2c1e675f28717fea3e | import json
import re
from flask import request, abort, jsonify
from Chibrary import config
from Chibrary.config import logger
from Chibrary.exceptions import *
from functools import wraps
from urllib import parse
from Chibrary.server import db
def parse_url_query(url: str) -> dict:
if not url.lower().startswith(... | [((110, 11, 110, 27), 'json.dumps', 'json.dumps', ({(110, 22, 110, 26): 'data'}, {}), '(data)', False, 'import json\n'), ((138, 5, 138, 13), 'functools.wraps', 'wraps', ({(138, 11, 138, 12): 'f'}, {}), '(f)', False, 'from functools import wraps\n'), ((153, 5, 153, 13), 'functools.wraps', 'wraps', ({(153, 11, 153, 12): ... |
helq/pytropos | tests/inputs/loops/51-arrays-in-loop.py | 497ed5902e6e4912249ca0a46b477f9bfa6ae80a | import numpy as np
from something import Top
i = 0
while i < 10:
a = np.ndarray((10,4))
b = np.ones((10, Top))
i += 1
del Top
# show_store()
| [((6, 8, 6, 26), 'numpy.ndarray', 'np.ndarray', ({(6, 19, 6, 25): '(10, 4)'}, {}), '((10, 4))', True, 'import numpy as np\n'), ((7, 8, 7, 26), 'numpy.ones', 'np.ones', ({(7, 16, 7, 25): '(10, Top)'}, {}), '((10, Top))', True, 'import numpy as np\n')] |
Arfey/aiohttp_admin2 | tests/mappers/fields/test_float_field.py | 2b3782389ec9e25809635811b76ef8111b27d8ba | from aiohttp_admin2.mappers import Mapper
from aiohttp_admin2.mappers import fields
class FloatMapper(Mapper):
field = fields.FloatField()
def test_correct_float_type():
"""
In this test we check success convert to float type.
"""
mapper = FloatMapper({"field": 1})
mapper.is_valid()
ass... | [((6, 12, 6, 31), 'aiohttp_admin2.mappers.fields.FloatField', 'fields.FloatField', ({}, {}), '()', False, 'from aiohttp_admin2.mappers import fields\n')] |
jdlarsen-UA/flopy | autotest/t038_test.py | bf2c59aaa689de186bd4c80685532802ac7149cd | """
Try to load all of the MODFLOW-USG examples in ../examples/data/mfusg_test.
These are the examples that are distributed with MODFLOW-USG.
"""
import os
import flopy
# make the working directory
tpth = os.path.join("temp", "t038")
if not os.path.isdir(tpth):
os.makedirs(tpth)
# build list of name files to try... | [((10, 7, 10, 35), 'os.path.join', 'os.path.join', ({(10, 20, 10, 26): '"""temp"""', (10, 28, 10, 34): '"""t038"""'}, {}), "('temp', 't038')", False, 'import os\n'), ((15, 9, 15, 61), 'os.path.join', 'os.path.join', ({(15, 22, 15, 26): '""".."""', (15, 28, 15, 38): '"""examples"""', (15, 40, 15, 46): '"""data"""', (15,... |
relikd/botlib | botlib/cli.py | d0c5072d27db1aa3fad432457c90c9e3f23f22cc | #!/usr/bin/env python3
import os
from argparse import ArgumentParser, ArgumentTypeError, FileType, Namespace
from typing import Any
def DirType(string: str) -> str:
if os.path.isdir(string):
return string
raise ArgumentTypeError(
'Directory does not exist: "{}"'.format(os.path.abspath(string))... | [((8, 7, 8, 28), 'os.path.isdir', 'os.path.isdir', ({(8, 21, 8, 27): 'string'}, {}), '(string)', False, 'import os\n'), ((11, 48, 11, 71), 'os.path.abspath', 'os.path.abspath', ({(11, 64, 11, 70): 'string'}, {}), '(string)', False, 'import os\n'), ((28, 48, 28, 62), 'argparse.FileType', 'FileType', ({(28, 57, 28, 61): ... |
MatthiasValvekens/certvalidator | pyhanko_certvalidator/asn1_types.py | 246c5075ecdb6d50b14c93fdc97a9d0470f84821 | from typing import Optional
from asn1crypto import core, x509, cms
__all__ = [
'Target', 'TargetCert', 'Targets', 'SequenceOfTargets',
'AttrSpec', 'AAControls'
]
class TargetCert(core.Sequence):
_fields = [
('target_certificate', cms.IssuerSerial),
('target_name', x509.GeneralName, {'opt... | [] |
ruslankl9/ironpython_training | test/test_delete_group.py | 51eaad4da24fdce60fbafee556160a9e847c08cf | from model.group import Group
import random
def test_delete_some_group(app):
if len(app.group.get_group_list()) <= 1:
app.group.add_new_group(Group(name='test'))
old_list = app.group.get_group_list()
index = random.randrange(len(old_list))
app.group.delete_group_by_index(index)
new_list = ... | [((7, 32, 7, 50), 'model.group.Group', 'Group', (), '', False, 'from model.group import Group\n')] |
gurkirt/actNet-inAct | Evaluation/batch_detection.py | 1930bcb41553e50ddd83985a497a9d5ce4f1fcf2 | '''
Autor: Gurkirt Singh
Start data: 15th May 2016
purpose: of this file is read frame level predictions and process them to produce a label per video
'''
from sklearn.svm import LinearSVC
from sklearn.ensemble import RandomForestClassifier
import numpy as np
import pickle
import os
import time,json
import pylab as pl... | [] |
y2ghost/study | python/csv/csv_dict_writer.py | c5278611b0a732fe19e3d805c0c079e530b1d3b2 | import csv
def csv_dict_writer(path, headers, data):
with open(path, 'w', newline='') as csvfile:
writer = csv.DictWriter(csvfile, delimiter=',',
fieldnames=headers)
writer.writeheader()
for record in data:
writer.writerow(record)
if __name__ =... | [((6, 17, 7, 51), 'csv.DictWriter', 'csv.DictWriter', (), '', False, 'import csv\n')] |
moibenko/decisionengine | src/decisionengine/framework/modules/tests/test_module_decorators.py | 4c458e0c225ec2ce1e82d56e752724983331b7d1 | # SPDX-FileCopyrightText: 2017 Fermi Research Alliance, LLC
# SPDX-License-Identifier: Apache-2.0
import pytest
from decisionengine.framework.modules import Publisher, Source
from decisionengine.framework.modules.Module import verify_products
from decisionengine.framework.modules.Source import Parameter
def test_mu... | [((30, 5, 30, 27), 'decisionengine.framework.modules.Source.produces', 'Source.produces', (), '', False, 'from decisionengine.framework.modules import Publisher, Source\n'), ((50, 5, 50, 34), 'decisionengine.framework.modules.Source.produces', 'Source.produces', (), '', False, 'from decisionengine.framework.modules imp... |
RobinRojowiec/intent-recognition-in-doctor-patient-interviews | models/cnn_layer.py | b91c7a9f3ad70edd0f39b56e3219f48d1fcf2078 | import torch
import torch.nn as nn
from torch.nn.functional import max_pool1d
from utility.model_parameter import Configuration, ModelParameter
class CNNLayer(nn.Module):
def __init__(self, config: Configuration, vocab_size=30000, use_embeddings=True, embed_dim=-1, **kwargs):
super(CNNLayer, self).__init... | [((14, 23, 14, 48), 'torch.cuda.is_available', 'torch.cuda.is_available', ({}, {}), '()', False, 'import torch\n'), ((25, 25, 25, 69), 'torch.nn.Embedding', 'nn.Embedding', ({(25, 38, 25, 48): 'vocab_size', (25, 50, 25, 68): 'self.embedding_dim'}, {}), '(vocab_size, self.embedding_dim)', True, 'import torch.nn as nn\n'... |
alexgorji/music_score | musicscore/musicxml/types/complextypes/backup.py | b4176da52295361f3436826903485c5cb8054c5e | '''
<xs:complexType name="backup">
<xs:annotation>
<xs:documentation></xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:group ref="duration"/>
<xs:group ref="editorial"/>
</xs:sequence>
</xs:complexType>
'''
from musicscore.dtd.dtd import Sequence, GroupReference, Element
from musicscore.musicxml... | [((26, 8, 26, 25), 'musicscore.dtd.dtd.Element', 'Element', ({(26, 16, 26, 24): 'Duration'}, {}), '(Duration)', False, 'from musicscore.dtd.dtd import Sequence, GroupReference, Element\n'), ((27, 8, 27, 33), 'musicscore.dtd.dtd.GroupReference', 'GroupReference', ({(27, 23, 27, 32): 'Editorial'}, {}), '(Editorial)', Fal... |
AlexandrosPlessias/NLP-Greek-Presentations | NLP programmes in Python/9.Text Clustering/kmeans.py | 4ae9d635a777f24bae5238b9f195bd17d00040ea | import nltk
import re
import csv
import string
import collections
import numpy as np
from nltk.corpus import wordnet
from nltk.corpus import stopwords
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import WordPunctTokenizer
from sklearn.metrics import classification_report
from sklearn.metric... | [((82, 13, 82, 48), 'csv.reader', 'csv.reader', (), '', False, 'import csv\n'), ((99, 10, 99, 62), 'numpy.array', 'np.array', ({(99, 19, 99, 61): '[el for el in sms_labels[0:trainset_size]]'}, {}), '([el for el in sms_labels[0:trainset_size]])', True, 'import numpy as np\n'), ((105, 13, 105, 119), 'sklearn.feature_extr... |
paTRICK-swk/P-STMO | common/utils.py | def1bff3fcc4f1e3b1dd69c8d3c2d77f412e3b75 | import torch
import numpy as np
import hashlib
from torch.autograd import Variable
import os
def deterministic_random(min_value, max_value, data):
digest = hashlib.sha256(data.encode()).digest()
raw_value = int.from_bytes(digest[:4], byteorder='little', signed=False)
return int(raw_value / (2 ** 32 - 1... | [((81, 10, 81, 48), 'numpy.mean', 'np.mean', (), '', True, 'import numpy as np\n'), ((82, 10, 82, 51), 'numpy.mean', 'np.mean', (), '', True, 'import numpy as np\n'), ((94, 15, 94, 31), 'numpy.linalg.svd', 'np.linalg.svd', ({(94, 29, 94, 30): 'H'}, {}), '(H)', True, 'import numpy as np\n'), ((87, 20, 87, 63), 'numpy.su... |
Sailer43/CSE5914Project | personal_ad/advice/converter.py | ebb47bff9a6101fac5173b5520e6002563da67d5 | from ibm_watson import TextToSpeechV1, SpeechToTextV1, DetailedResponse
from os import system
from json import loads
class Converter:
k_s2t_api_key = "0pxCnJQ_r5Yy3SZDRhYS4XshrTMJyZEsuc45SbBcfGgf"
k_t2s_api_key = "euoR7ZdLMOBd29wP1fNaZFJsqwKt45TUmwcVwpzbQBcA"
k_s2t_url = "https://stream.watsonplatform.n... | [((18, 19, 18, 84), 'ibm_watson.SpeechToTextV1', 'SpeechToTextV1', (), '', False, 'from ibm_watson import TextToSpeechV1, SpeechToTextV1, DetailedResponse\n'), ((19, 19, 19, 84), 'ibm_watson.TextToSpeechV1', 'TextToSpeechV1', (), '', False, 'from ibm_watson import TextToSpeechV1, SpeechToTextV1, DetailedResponse\n')] |
neel4os/warg-client | warg_client/client/apis/controller/attack_controller.py | 4d97904977a6f6865610afd04ca00ddfbad38ff9 | from subprocess import run
def perform_shutdown(body):
arg = ""
if body["reboot"]:
_is_reboot = arg + "-r"
else:
_is_reboot = arg + "-h"
time_to_shutdown = str(body['timeToShutdown'])
result = run(["/sbin/shutdown", _is_reboot, time_to_shutdown])
return body
| [((11, 13, 11, 66), 'subprocess.run', 'run', ({(11, 17, 11, 65): "['/sbin/shutdown', _is_reboot, time_to_shutdown]"}, {}), "(['/sbin/shutdown', _is_reboot, time_to_shutdown])", False, 'from subprocess import run\n')] |
2600box/harvest | torrents/migrations/0011_auto_20190223_2345.py | 57264c15a3fba693b4b58d0b6d4fbf4bd5453bbd | # Generated by Django 2.1.7 on 2019-02-23 23:45
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('torrents', '0010_auto_20190223_0326'),
]
operations = [
migrations.AlterModelOptions(
name='realm',
options={'ordering': ('n... | [((13, 8, 16, 9), 'django.db.migrations.AlterModelOptions', 'migrations.AlterModelOptions', (), '', False, 'from django.db import migrations\n')] |
whyh/FavourDemo | common/__init__.py | 1b19882fb2e79dee9c3332594bf45c91e7476eaa | from . import (emoji as emj,
keyboards as kb,
telegram as tg,
phrases as phr,
finance as fin,
utils,
glossary,
bots,
gcp,
sed,
db)
| [] |
aneumeier/questions | questions/serializers.py | fe5451b70d85cd5203b4cb624103c1eb154587d9 | #!/usr/bin/env python
# -*- coding: utf-8
"""
:mod:`question.serializers` -- serializers
"""
from rest_framework import serializers
from .models import Question, PossibleAnswer
from category.models import Category
class PossibleAnswerSerializer(serializers.ModelSerializer):
class Meta:
model = PossibleA... | [((23, 15, 23, 47), 'rest_framework.serializers.StringRelatedField', 'serializers.StringRelatedField', ({}, {}), '()', False, 'from rest_framework import serializers\n'), ((24, 22, 24, 63), 'rest_framework.serializers.StringRelatedField', 'serializers.StringRelatedField', (), '', False, 'from rest_framework import seri... |
JaySon-Huang/SecertPhotos | widgets/ui_ShowResultDialog.py | e741cc26c19a5b249d45cc70959ac6817196cb8a | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'src/ui_ShowResultDialog.ui'
#
# Created: Sat May 16 17:05:43 2015
# by: PyQt5 UI code generator 5.4
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def s... | [((16, 30, 16, 59), 'PyQt5.QtWidgets.QVBoxLayout', 'QtWidgets.QVBoxLayout', ({(16, 52, 16, 58): 'Dialog'}, {}), '(Dialog)', False, 'from PyQt5 import QtCore, QtGui, QtWidgets\n'), ((18, 24, 18, 42), 'widgets.ImageLabel.ImageLabel', 'ImageLabel', ({(18, 35, 18, 41): 'Dialog'}, {}), '(Dialog)', False, 'from widgets.Image... |
zomGreg/mixcoatl | mixcoatl/admin/api_key.py | dd8d7e206682955b251d7f858fffee56b11df8c6 | """
mixcoatl.admin.api_key
----------------------
Implements access to the DCM ApiKey API
"""
from mixcoatl.resource import Resource
from mixcoatl.decorators.lazy import lazy_property
from mixcoatl.decorators.validations import required_attrs
from mixcoatl.utils import uncamel, camelize, camel_keys, uncamel_keys
impor... | [((97, 5, 97, 44), 'mixcoatl.decorators.validations.required_attrs', 'required_attrs', ({(97, 20, 97, 43): "['description', 'name']"}, {}), "(['description', 'name'])", False, 'from mixcoatl.decorators.validations import required_attrs\n'), ((22, 8, 22, 50), 'mixcoatl.resource.Resource.__init__', 'Resource.__init__', (... |
Johnny-QA/Python_training | Python tests/dictionaries.py | a15de68195eb155c99731db3e4ff1d9d75681752 | my_set = {1, 3, 5}
my_dict = {'name': 'Jose', 'age': 90}
another_dict = {1: 15, 2: 75, 3: 150}
lottery_players = [
{
'name': 'Rolf',
'numbers': (13, 45, 66, 23, 22)
},
{
'name': 'John',
'numbers': (14, 56, 80, 23, 22)
}
]
universities = [
{
'name': 'Oxford',... | [] |
ZhenghengLi/lcls2 | psdaq/psdaq/control_gui/QWTable.py | 94e75c6536954a58c8937595dcac295163aa1cdf |
"""Class :py:class:`QWTable` is a QTableView->QWidget for tree model
======================================================================
Usage ::
# Run test: python lcls2/psdaq/psdaq/control_gui/QWTable.py
from psdaq.control_gui.QWTable import QWTable
w = QWTable()
Created on 2019-03-28 by Mikhail D... | [((17, 9, 17, 36), 'logging.getLogger', 'logging.getLogger', ({(17, 27, 17, 35): '__name__'}, {}), '(__name__)', False, 'import logging\n'), ((221, 4, 221, 122), 'logging.basicConfig', 'logging.basicConfig', (), '', False, 'import logging\n'), ((222, 10, 222, 32), 'PyQt5.QtWidgets.QApplication', 'QApplication', ({(222,... |
vadmium/grailbrowser | src/grailbase/mtloader.py | ca94e6db2359bcb16c0da256771550d1327c6d33 | """Extension loader for filetype handlers.
The extension objects provided by MIMEExtensionLoader objects have four
attributes: parse, embed, add_options, and update_options. The first two
are used as handlers for supporting the MIME type as primary and embeded
resources. The last two are (currently) only used for pr... | [((17, 19, 17, 49), 'string.replace', 'string.replace', ({(17, 34, 17, 38): 'name', (17, 40, 17, 43): '"""-"""', (17, 45, 17, 48): '"""_"""'}, {}), "(name, '-', '_')", False, 'import string\n'), ((18, 29, 18, 56), 'string.split', 'string.split', ({(18, 42, 18, 50): 'new_name', (18, 52, 18, 55): '"""/"""'}, {}), "(new_n... |
IBM/eventstreams-python-sdk | eventstreams_sdk/adminrest_v1.py | cc898e6901c35d1b43e2be7d152c6d770d967b23 | # coding: utf-8
# (C) Copyright IBM Corp. 2021.
#
# 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 a... | [((51, 24, 51, 72), 'ibm_cloud_sdk_core.get_authenticator.get_authenticator_from_environment', 'get_authenticator_from_environment', ({(51, 59, 51, 71): 'service_name'}, {}), '(service_name)', False, 'from ibm_cloud_sdk_core.get_authenticator import get_authenticator_from_environment\n'), ((68, 8, 70, 57), 'ibm_cloud_s... |
BaseCampCoding/python-fundamentals | 3-functions/pytest-exercises/test_functions.py | 3804c07841d6604b1e5a1c15126b3301aa8ae306 | import functions
from pytest import approx
from bcca.test import should_print
def test_add_em_up():
assert functions.add_em_up(1, 2, 3) == 6
assert functions.add_em_up(4, 5, 6) == 15
def test_sub_sub_hubbub():
assert functions.sub_sub_hubbub(1, 2, 3) == -4
def test_square_area():
assert functions.... | [((35, 4, 35, 26), 'functions.sales_tax', 'functions.sales_tax', ({(35, 24, 35, 25): '(1)'}, {}), '(1)', False, 'import functions\n'), ((48, 4, 48, 30), 'functions.sales_tax', 'functions.sales_tax', ({(48, 24, 48, 29): '(99.99)'}, {}), '(99.99)', False, 'import functions\n'), ((61, 4, 61, 29), 'functions.sales_tax', 'f... |
apabaad/django_ecommerce | src/products/admin.py | ca04143477b306413158e5311062563f7418700c | from django.contrib import admin
from .models import Product
admin.site.register(Product) | [((4, 0, 4, 28), 'django.contrib.admin.site.register', 'admin.site.register', ({(4, 20, 4, 27): 'Product'}, {}), '(Product)', False, 'from django.contrib import admin\n')] |
beshrkayali/content-io | cio/plugins/txt.py | ae44aa4c4eba2234f940ca9d7a4bb310e25075b3 | # coding=utf-8
from __future__ import unicode_literals
from .base import BasePlugin
class TextPlugin(BasePlugin):
ext = 'txt'
| [] |
thejoeejoee/SUI-MIT-VUT-2020-2021 | ml-scripts/dump-data-to-learn.py | aee307aa772c5a0e97578da5ebedd3e2cd39ab91 | #!/usr/bin/env python3
# Project: VUT FIT SUI Project - Dice Wars
# Authors:
# - Josef Kolář <xkolar71@stud.fit.vutbr.cz>
# - Dominik Harmim <xharmi00@stud.fit.vutbr.cz>
# - Petr Kapoun <xkapou04@stud.fit.vutbr.cz>
# - Jindřich Šesták <xsesta05@stud.fit.vutbr.cz>
# Year: 2020
# Description: Genera... | [((20, 9, 20, 41), 'argparse.ArgumentParser', 'ArgumentParser', (), '', False, 'from argparse import ArgumentParser\n'), ((53, 4, 53, 35), 'signal.signal', 'signal', ({(53, 11, 53, 18): 'SIGCHLD', (53, 20, 53, 34): 'signal_handler'}, {}), '(SIGCHLD, signal_handler)', False, 'from signal import signal, SIGCHLD\n'), ((46... |
davidszotten/pdbpp | testing/conftest.py | 3d90d83902e1d19840d0419362a41c654f93251e | import functools
import sys
from contextlib import contextmanager
import pytest
_orig_trace = None
def pytest_configure():
global _orig_trace
_orig_trace = sys.gettrace()
@pytest.fixture(scope="session", autouse=True)
def term():
"""Configure TERM for predictable output from Pygments."""
from _pyt... | [((15, 1, 15, 46), 'pytest.fixture', 'pytest.fixture', (), '', False, 'import pytest\n'), ((28, 1, 28, 29), 'pytest.fixture', 'pytest.fixture', (), '', False, 'import pytest\n'), ((55, 1, 55, 32), 'pytest.fixture', 'pytest.fixture', (), '', False, 'import pytest\n'), ((60, 1, 60, 50), 'pytest.fixture', 'pytest.fixture'... |
utiasSTARS/thing-gym-ros | thing_gym_ros/envs/utils.py | 6e8a034ac0d1686f29bd29e2aaa63f39a5b188d4 | """ Various generic env utilties. """
def center_crop_img(img, crop_zoom):
""" crop_zoom is amount to "zoom" into the image. E.g. 2.0 would cut out half of the width,
half of the height, and only give the center. """
raw_height, raw_width = img.shape[:2]
center = raw_height // 2, raw_width // 2
cro... | [] |
arya-s/sentry | tests/sentry/utils/http/tests.py | 959ffbd37cb4a7821f7a2676c137be54cad171a8 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import mock
from exam import fixture
from sentry import options
from sentry.models import Project
from sentry.testutils import TestCase
from sentry.utils.http import (
is_same_domain, is_valid_origin, get_origins, absolute_uri, is_valid_ip,
)
clas... | [((47, 18, 47, 39), 'sentry.models.Project.objects.get', 'Project.objects.get', ({}, {}), '()', False, 'from sentry.models import Project\n'), ((54, 18, 54, 39), 'sentry.models.Project.objects.get', 'Project.objects.get', ({}, {}), '()', False, 'from sentry.models import Project\n'), ((62, 18, 62, 39), 'sentry.models.P... |
tongpa/bantak_program | comcenterproject/project/helpers.py | 66edfe225e8018f65c9c5a6cd7745c17ba557bd5 | # -*- coding: utf-8 -*-
"""WebHelpers used in project."""
#from webhelpers import date, feedgenerator, html, number, misc, text
from markupsafe import Markup
def bold(text):
return Markup('<strong>%s</strong>' % text) | [((9, 11, 9, 47), 'markupsafe.Markup', 'Markup', ({(9, 18, 9, 46): "('<strong>%s</strong>' % text)"}, {}), "('<strong>%s</strong>' % text)", False, 'from markupsafe import Markup\n')] |
arnaudsjs/YCSB-1 | Thesis/load/runRiakLoads.py | dc557d209244df72d68c9cb0a048d54e7bd72637 | import sys;
from Thesis.load.loadBenchmark import runLoadBenchmarkAsBatch;
from Thesis.cluster.RiakCluster import RiakCluster;
NORMAL_BINDING = 'riak';
CONSISTENCY_BINDING = 'riak_consistency';
IPS_IN_CLUSTER = ['172.16.33.14', '172.16.33.15', '172.16.33.16', '172.16.33.17', '172.16.33.18'];
def main():
if len(s... | [] |
Mozilla-GitHub-Standards/f9c78643f5862cda82001d4471255ac29ef0c6b2c6171e2c1cbecab3d2fef4dd | auto_nag/tests/test_round_robin.py | 28d999fcba9ad47d1dd0b2222880b71726ddd47c | # coding: utf-8
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import unittest
from mock import patch
from auto_nag.people import People
from auto_nag.round_robin im... | [((39, 13, 48, 5), 'auto_nag.people.People', 'People', ({(40, 8, 47, 9): "[{'mail': 'gh@mozilla.com', 'cn': 'G H', 'ismanager': 'FALSE', 'title':\n 'nothing'}]"}, {}), "([{'mail': 'gh@mozilla.com', 'cn': 'G H', 'ismanager': 'FALSE',\n 'title': 'nothing'}])", False, 'from auto_nag.people import People\n'), ((140, ... |
tacaswell/scipy | scipy/weave/inline_tools.py | 4d7e924a319299e39c9a9514e021fbfdfceb854e | # should re-write compiled functions to take a local and global dict
# as input.
from __future__ import absolute_import, print_function
import sys
import os
from . import ext_tools
from . import catalog
from . import common_info
from numpy.core.multiarray import _get_ndarray_c_version
ndarray_api_version = '/* NDARRA... | [((461, 31, 461, 57), 'os.path.split', 'os.path.split', ({(461, 45, 461, 56): 'module_path'}, {}), '(module_path)', False, 'import os\n'), ((12, 56, 12, 80), 'numpy.core.multiarray._get_ndarray_c_version', '_get_ndarray_c_version', ({}, {}), '()', False, 'from numpy.core.multiarray import _get_ndarray_c_version\n'), ((... |
sapcc/trove | trove/guestagent/common/configuration.py | c03ec0827687fba202f72f4d264ab70158604857 | # Copyright 2015 Tesora Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | [((214, 1, 214, 31), 'six.add_metaclass', 'six.add_metaclass', ({(214, 19, 214, 30): 'abc.ABCMeta'}, {}), '(abc.ABCMeta)', False, 'import six\n'), ((114, 23, 116, 40), 'trove.guestagent.common.operating_system.read_file', 'operating_system.read_file', (), '', False, 'from trove.guestagent.common import operating_system... |
sawyercade/Documentation | API-Reference-Code-Generator.py | 257b68c8ca2928e8a730ea44196297a400587437 | import pathlib
import yaml
documentations = {"Our Platform": "QuantConnect-Platform-2.0.0.yaml",
"Alpha Streams": "QuantConnect-Alpha-0.8.yaml"}
def RequestTable(api_call, params):
writeUp = '<table class="table qc-table">\n<thead>\n<tr>\n'
writeUp += f'<th colspan="2"><code>{api_call}</code... | [((353, 10, 353, 50), 'yaml.load', 'yaml.load', (), '', False, 'import yaml\n')] |
dmh126/forge-python-data-management-api | forge_api_client/hubs.py | 9c33f220021251a0340346065e3dd1998fc49a12 | from .utils import get_request, authorized
class Hubs:
@authorized
def getHubs(self):
url = self.api_url + '/project/v1/hubs'
headers = {
'Authorization': '%s %s' % (self.token_type, self.access_token)
}
return get_request(url, headers)
@authorized
def g... | [] |
munisisazade/create-django-app | tlp/django_app/app/urls.py | f62395af2adaacacc4d3a3857c6570c9647d13a1 | from django.conf.urls import url
# from .views import BaseIndexView
urlpatterns = [
# url(r'^$', BaseIndexView.as_view(), name="index"),
] | [] |
madelinemccombe/iron-skillet | tools/archive/create_loadable_configs.py | f7bb805ac5ed0f2b44e4b438f8c021eaf2f5c66b | # Copyright (c) 2018, Palo Alto Networks
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS... | [((156, 11, 156, 30), 'passlib.hash.md5_crypt.hash', 'md5_crypt.hash', ({(156, 26, 156, 29): 'txt'}, {}), '(txt)', False, 'from passlib.hash import md5_crypt\n'), ((166, 11, 166, 30), 'passlib.hash.des_crypt.hash', 'des_crypt.hash', ({(166, 26, 166, 29): 'txt'}, {}), '(txt)', False, 'from passlib.hash import des_crypt\... |
piotrantosz/pactman | pactman/verifier/pytest_plugin.py | 2838e273d79831721da9c1b658b8f9d249efc789 | import glob
import logging
import os
import warnings
import pytest
from _pytest.outcomes import Failed
from _pytest.reports import TestReport
from .broker_pact import BrokerPact, BrokerPacts, PactBrokerConfig
from .result import PytestResult, log
def pytest_addoption(parser):
group = parser.getgroup("pact speci... | [((217, 1, 217, 17), 'pytest.fixture', 'pytest.fixture', ({}, {}), '()', False, 'import pytest\n'), ((89, 4, 89, 45), 'logging.basicConfig', 'logging.basicConfig', (), '', False, 'import logging\n'), ((124, 20, 124, 61), 'glob.glob', 'glob.glob', (), '', False, 'import glob\n'), ((73, 50, 73, 83), 'os.environ.get', 'os... |
karttur/geoimagine02-grass | interface/docstring.py | 09c207707ddd0dae04a871e006e184409aa87d99 | # -*- coding: utf-8 -*-
def docstring_property(class_doc):
"""Property attribute for docstrings.
Took from: https://gist.github.com/bfroehle/4041015
>>> class A(object):
... '''Main docstring'''
... def __init__(self, x):
... self.x = x
... @docstring_property(__doc__)... | [] |
gsn9/autocnet | autocnet/matcher/cuda_matcher.py | ddcca3ce3a6b59f720804bb3da03857efa4ff534 | import warnings
try:
import cudasift as cs
except:
cs = None
import numpy as np
import pandas as pd
def match(edge, aidx=None, bidx=None, **kwargs):
"""
Apply a composite CUDA matcher and ratio check. If this method is used,
no additional ratio check is necessary and no symmetry check is requir... | [((29, 17, 29, 70), 'cudasift.PySiftData.from_data_frame', 'cs.PySiftData.from_data_frame', ({(29, 47, 29, 57): 'source_kps', (29, 59, 29, 69): 'source_des'}, {}), '(source_kps, source_des)', True, 'import cudasift as cs\n'), ((30, 17, 30, 70), 'cudasift.PySiftData.from_data_frame', 'cs.PySiftData.from_data_frame', ({(... |
FabienArcellier/blueprint-webapp-flask-restx | app/apis/__init__.py | 84bc9dbe697c4b0f6667d2a2d8144a3f934a307a | from flask_restx import Api
from app.apis.hello import api as hello
api = Api(
title='api',
version='1.0',
description='',
prefix='/api',
doc='/api'
)
api.add_namespace(hello)
| [((5, 6, 11, 1), 'flask_restx.Api', 'Api', (), '', False, 'from flask_restx import Api\n')] |
Kantouzin/brainfuck | tests/test_core.py | 812834320b080e2317d3fac377db64782057c8f4 | # coding: utf-8
import unittest
from test.support import captured_stdout
from brainfuck import BrainFuck
class TestCore(unittest.TestCase):
def test_hello_world(self):
bf = BrainFuck()
with captured_stdout() as stdout:
bf.run()
self.assertEqual(stdout.getvalue(), "Hello, wo... | [((54, 4, 54, 19), 'unittest.main', 'unittest.main', ({}, {}), '()', False, 'import unittest\n'), ((11, 13, 11, 24), 'brainfuck.BrainFuck', 'BrainFuck', ({}, {}), '()', False, 'from brainfuck import BrainFuck\n'), ((19, 13, 19, 24), 'brainfuck.BrainFuck', 'BrainFuck', ({}, {}), '()', False, 'from brainfuck import Brain... |
poltavski/social-network-frontend | main.py | ccc3410e23e42cfc65efd811aba262ec88163481 | from fastapi import FastAPI, Request, Response
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
from utils import get_page_data, process_initial
import uvicorn
app = FastAPI()
templates = Jinja2Templates(directory="templates")
app.mou... | [((8, 6, 8, 15), 'fastapi.FastAPI', 'FastAPI', ({}, {}), '()', False, 'from fastapi import FastAPI, Request, Response\n'), ((9, 12, 9, 50), 'fastapi.templating.Jinja2Templates', 'Jinja2Templates', (), '', False, 'from fastapi.templating import Jinja2Templates\n'), ((10, 21, 10, 52), 'fastapi.staticfiles.StaticFiles', '... |
Ku-Al/OpenManage-Enterprise | Core/Python/create_static_group.py | 5cc67435d7cedb091edb07311ed9dceeda43277f | #
# Python script using OME API to create a new static group
#
# _author_ = Raajeev Kalyanaraman <Raajeev.Kalyanaraman@Dell.com>
# _version_ = 0.1
#
# Copyright (c) 2020 Dell EMC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lic... | [((89, 4, 89, 71), 'urllib3.disable_warnings', 'urllib3.disable_warnings', ({(89, 29, 89, 70): 'urllib3.exceptions.InsecureRequestWarning'}, {}), '(urllib3.exceptions.InsecureRequestWarning)', False, 'import urllib3\n'), ((91, 13, 91, 95), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (), '', False, 'import arg... |
kagrze/ignite | examples/references/segmentation/pascal_voc2012/code/dataflow/dataloaders.py | 18708a76f86623545311d35bc48673eac9e55591 | from typing import Callable, Optional, Tuple, Union
import numpy as np
from torch.utils.data import DataLoader, Sampler
from torch.utils.data.dataset import Subset, ConcatDataset
import torch.utils.data.distributed as data_dist
from dataflow.datasets import get_train_dataset, get_val_dataset, TransformedDataset, get... | [((26, 15, 26, 43), 'dataflow.datasets.get_train_dataset', 'get_train_dataset', ({(26, 33, 26, 42): 'root_path'}, {}), '(root_path)', False, 'from dataflow.datasets import get_train_dataset, get_val_dataset, TransformedDataset, get_train_noval_sbdataset\n'), ((27, 13, 27, 39), 'dataflow.datasets.get_val_dataset', 'get_... |
autobotasia/saleor | saleor/core/jwt.py | e03e9f6ab1bddac308a6609d6b576a87e90ae655 | from datetime import datetime, timedelta
from typing import Any, Dict, Optional
import graphene
import jwt
from django.conf import settings
from django.core.handlers.wsgi import WSGIRequest
from ..account.models import User
from ..app.models import App
from .permissions import (
get_permission_names,
get_perm... | [((36, 14, 36, 31), 'datetime.datetime.utcnow', 'datetime.utcnow', ({}, {}), '()', False, 'from datetime import datetime, timedelta\n'), ((68, 11, 72, 5), 'jwt.encode', 'jwt.encode', ({(69, 8, 69, 15): 'payload', (70, 8, 70, 27): 'settings.SECRET_KEY', (71, 8, 71, 21): 'JWT_ALGORITHM'}, {}), '(payload, settings.SECRET_... |
pancaprima/locust | locust/configuration.py | dba803fcdd13ff2fada4e8b8ee37a163aa519a48 | import os, json, logging, jsonpath_rw_ext, jsonpath_rw
from jsonpath_rw import jsonpath, parse
from . import events
from ast import literal_eval
from flask import make_response
logger = logging.getLogger(__name__)
CONFIG_PATH = '/tests/settings/config.json'
class ClientConfiguration:
"""
This class is a handl... | [((7, 9, 7, 36), 'logging.getLogger', 'logging.getLogger', ({(7, 27, 7, 35): '__name__'}, {}), '(__name__)', False, 'import os, json, logging, jsonpath_rw_ext, jsonpath_rw\n'), ((43, 15, 43, 40), 'ast.literal_eval', 'literal_eval', ({(43, 28, 43, 39): 'config_text'}, {}), '(config_text)', False, 'from ast import litera... |
SIXMON/peps | data/migrations/0023_discardaction_answers.py | 48c09a951a0193ada7b91c8bb6efc4b1232c3520 | # Generated by Django 2.2.4 on 2019-11-14 16:48
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('data', '0022_discardaction'),
]
operations = [
migrations.AddField(
model_name='discardactio... | [] |
juanitodread/pitaya-falcon | app/models.py | f4b889f9fa39072aeb9f1c71fe5f3bb259082e93 | from json import JSONEncoder
from time import time
class Jsonable:
"""Abstract class to standardize the toJson method to be implemented by any class that wants to be
serialized to JSON"""
def toJson(self):
"""Abstract method"""
raise NotImplementedError('You should implement this method in... | [((46, 19, 46, 47), 'json.JSONEncoder.default', 'JSONEncoder.default', ({(46, 39, 46, 43): 'self', (46, 45, 46, 46): 'o'}, {}), '(self, o)', False, 'from json import JSONEncoder\n'), ((27, 30, 27, 36), 'time.time', 'time', ({}, {}), '()', False, 'from time import time\n')] |
jakobkogler/pi_memorize | compute_pi.py | c82c24f26407f1728ad1e73851b72dea9bf779f6 | """Compute pi."""
from decimal import Decimal, getcontext
import argparse
import itertools
class ComputePi:
"""Compute pi to a specific precision using multiple algorithms."""
@staticmethod
def BBP(precision):
"""Compute pi using the Bailey-Borwein-Plouffe formula."""
getcontext().prec = ... | [((61, 13, 61, 66), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (), '', False, 'import argparse\n'), ((15, 13, 15, 23), 'decimal.Decimal', 'Decimal', ({(15, 21, 15, 22): '0'}, {}), '(0)', False, 'from decimal import Decimal, getcontext\n'), ((16, 17, 16, 34), 'itertools.count', 'itertools.count', ({}, {}), '(... |
LaMemeBete/nodys-smart-contract | scripts/01_deploy_data_types.py | f67b88d98ebf7063b72f46cb2b014d5de96eb56d | #!/usr/bin/python3
import time
from brownie import (
DataTypes,
TransparentUpgradeableProxy,
ProxyAdmin,
config,
network,
Contract,
)
from scripts.helpful_scripts import get_account, encode_function_data
def main():
account = get_account()
print(config["networks"][network.show_active()... | [((15, 14, 15, 27), 'scripts.helpful_scripts.get_account', 'get_account', ({}, {}), '()', False, 'from scripts.helpful_scripts import get_account, encode_function_data\n'), ((33, 46, 35, 5), 'scripts.helpful_scripts.encode_function_data', 'encode_function_data', ({(34, 8, 34, 31): 'data_types.setDataTypes', (34, 33, 34... |
omni-us/pytorch-retinanet | modules/BidirectionalLSTM.py | 8d3ee38d50df0afec2ab4dfa0eabb8219eb399f5 | import torch.nn as nn
class BidirectionalLSTM(nn.Module):
# Module to extract BLSTM features from convolutional feature map
def __init__(self, nIn, nHidden, nOut):
super(BidirectionalLSTM, self).__init__()
self.rnn = nn.LSTM(nIn, nHidden, bidirectional=True)
self.embedding = nn.Linear... | [((9, 19, 9, 60), 'torch.nn.LSTM', 'nn.LSTM', (), '', True, 'import torch.nn as nn\n'), ((10, 25, 10, 53), 'torch.nn.Linear', 'nn.Linear', ({(10, 35, 10, 46): 'nHidden * 2', (10, 48, 10, 52): 'nOut'}, {}), '(nHidden * 2, nOut)', True, 'import torch.nn as nn\n')] |
tranconbv/ironpython-stubs | release/stubs.min/System/Windows/Forms/__init___parts/PaintEventArgs.py | a601759e6c6819beff8e6b639d18a24b7e351851 | class PaintEventArgs(EventArgs,IDisposable):
"""
Provides data for the System.Windows.Forms.Control.Paint event.
PaintEventArgs(graphics: Graphics,clipRect: Rectangle)
"""
def Instance(self):
""" This function has been arbitrarily put into the stubs"""
return PaintEventArgs()
def Dispose(self):... | [] |
JaekwangCha/my_pytorch_templet | main.py | 7b6b67116e9d69abd64631d90b38fedc79be6c8c | # written by Jaekwang Cha
# version 0.1
# ================== IMPORT CUSTOM LEARNING LIBRARIES ===================== #
from customs.train import train, test
from customs.dataset import load_dataset
from customs.model import load_model
# ================== TRAINING SETTINGS ================== #
import argparse... | [((13, 9, 13, 34), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ({}, {}), '()', False, 'import argparse\n'), ((51, 0, 51, 27), 'torch.manual_seed', 'torch.manual_seed', ({(51, 18, 51, 26): 'opt.seed'}, {}), '(opt.seed)', False, 'import torch\n'), ((75, 40, 75, 69), 'customs.dataset.load_dataset', 'load_dataset... |
ahnitz/pegasus | test/core/024-sc4-gridftp-http/Rosetta.py | e269b460f4d87eb3f3a7e91cd82e2c28fdb55573 | #!/usr/bin/env python3
import logging
import sys
import subprocess
from pathlib import Path
from datetime import datetime
from Pegasus.api import *
logging.basicConfig(level=logging.DEBUG)
# --- Work Dir Setup -----------------------------------------------------------
RUN_ID = "024-sc4-gridftp-http-" + datetime.no... | [((11, 0, 11, 40), 'logging.basicConfig', 'logging.basicConfig', (), '', False, 'import logging\n'), ((15, 10, 15, 20), 'pathlib.Path.cwd', 'Path.cwd', ({}, {}), '()', False, 'from pathlib import Path\n'), ((19, 4, 19, 24), 'pathlib.Path.mkdir', 'Path.mkdir', ({(19, 15, 19, 23): 'WORK_DIR'}, {}), '(WORK_DIR)', False, '... |
sisl/CEEM | tests/nls_smoother_test.py | 6154587fe3cdb92e8b7f70eedb1262caa1553cc8 | import torch
from ceem.opt_criteria import *
from ceem.systems import LorenzAttractor
from ceem.dynamics import *
from ceem.smoother import *
from ceem import utils
def test_smoother():
utils.set_rng_seed(1)
torch.set_default_dtype(torch.float64)
sigma = torch.tensor([10.])
rho = torch.tensor([28.... | [((12, 4, 12, 25), 'ceem.utils.set_rng_seed', 'utils.set_rng_seed', ({(12, 23, 12, 24): '(1)'}, {}), '(1)', False, 'from ceem import utils\n'), ((14, 4, 14, 42), 'torch.set_default_dtype', 'torch.set_default_dtype', ({(14, 28, 14, 41): 'torch.float64'}, {}), '(torch.float64)', False, 'import torch\n'), ((16, 12, 16, 31... |
godspeed5/qiskit-terra | qiskit/visualization/pulse_v2/device_info.py | a5d87c3e4a663ab962704585fba0caef15061246 | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | [((131, 28, 131, 45), 'collections.defaultdict', 'defaultdict', ({(131, 40, 131, 44): 'list'}, {}), '(list)', False, 'from collections import defaultdict\n'), ((120, 27, 120, 51), 'qiskit.pulse.DriveChannel', 'pulse.DriveChannel', ({(120, 46, 120, 50): 'qind'}, {}), '(qind)', False, 'from qiskit import pulse\n'), ((122... |
ParikhKadam/gotolong | django_gotolong/mfund/views.py | 839beb8aa37055a2078eaa289b8ae05b62e8905e | # Create your views here.
from .models import Mfund
import plotly.graph_objects as go
from plotly.offline import plot
from plotly.tools import make_subplots
from django.db.models import Q
from django.conf import settings
from django.shortcuts import redirect
from django.contrib.auth.decorators import login_require... | [((50, 5, 50, 37), 'django.utils.decorators.method_decorator', 'method_decorator', ({(50, 22, 50, 36): 'login_required'}, {}), '(login_required)', False, 'from django.utils.decorators import method_decorator\n'), ((125, 21, 125, 73), 'plotly.offline.plot', 'plot', (), '', False, 'from plotly.offline import plot\n'), ((... |
akria00/m3u8-Downloader-master | m3u8.py | 37bf4683b0390998a819d0bb5b8af18ffb2166f6 | #coding: utf-8
from gevent import monkey
monkey.patch_all()
from gevent.pool import Pool
import gevent
import requests
import urllib
import os
import time
import re
import ssl
class Downloader:
def __init__(self, pool_size, retry=3):
self.pool = Pool(pool_size)
self.session = self._get_http_sessio... | [((4, 0, 4, 18), 'gevent.monkey.patch_all', 'monkey.patch_all', ({}, {}), '()', False, 'from gevent import monkey\n'), ((16, 20, 16, 35), 'gevent.pool.Pool', 'Pool', ({(16, 25, 16, 34): 'pool_size'}, {}), '(pool_size)', False, 'from gevent.pool import Pool\n'), ((25, 22, 25, 40), 'requests.Session', 'requests.Session',... |
Danielvalev/kutiika | buzzbox/restaurants/migrations/0002_restaurant_description.py | 661b850163de942a137157a97d98d90553861044 | # Generated by Django 3.2.9 on 2021-12-06 10:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('restaurants', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='restaurant',
name='description',
... | [((16, 18, 16, 101), 'django.db.models.CharField', 'models.CharField', (), '', False, 'from django.db import migrations, models\n')] |
fraca7/dsremap | src/dsrlib/ui/utils.py | fb8f4fb13e74b512ed0cac05387fbe9694faebcf | #!/usr/bin/env python3
import os
import contextlib
from PyQt5 import QtCore, QtWidgets
from dsrlib.settings import Settings
class LayoutBuilder:
def __init__(self, target):
self.target = target
self._stack = []
@contextlib.contextmanager
def _layout(self, cls, *args, **kwargs):
... | [((135, 19, 135, 44), 'PyQt5.QtCore.pyqtSignal', 'QtCore.pyqtSignal', ({(135, 37, 135, 43): 'object'}, {}), '(object)', False, 'from PyQt5 import QtCore, QtWidgets\n'), ((94, 15, 94, 94), 'PyQt5.QtCore.QStandardPaths.writableLocation', 'QtCore.QStandardPaths.writableLocation', ({(94, 54, 94, 93): 'QtCore.QStandardPaths... |
mshonichev/example_pkg | src/tiden/tidenrunner.py | 556a703fe8ea4a7737b8cae9c5d4d19c1397a70b | #!/usr/bin/env python3
#
# Copyright 2017-2020 GridGain Systems.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [((136, 24, 136, 54), 'tiden.sshpool.AbstractSshPool', 'AbstractSshPool', ({(136, 40, 136, 53): "{'hosts': []}"}, {}), "({'hosts': []})", False, 'from tiden.sshpool import AbstractSshPool\n'), ((310, 17, 310, 62), 'importlib.import_module', 'import_module', ({(310, 31, 310, 61): "'suites.%s' % self.test_module"}, {}), ... |
ludwig-ai/ludw | ludwig/data/cache/manager.py | b9d95bbdb474bc22260269de1bc094bc5455f37c | import logging
import os
import re
import uuid
from pathlib import Path
from ludwig.constants import CHECKSUM, META, TEST, TRAINING, VALIDATION
from ludwig.data.cache.util import calculate_checksum
from ludwig.utils import data_utils
from ludwig.utils.fs_utils import delete, path_exists
logger = logging.getLogger(__n... | [((12, 9, 12, 36), 'logging.getLogger', 'logging.getLogger', ({(12, 27, 12, 35): '__name__'}, {}), '(__name__)', False, 'import logging\n'), ((17, 11, 17, 32), 're.sub', 're.sub', ({(17, 18, 17, 24): '"""\\\\W+"""', (17, 26, 17, 28): '""""""', (17, 30, 17, 31): 'v'}, {}), "('\\\\W+', '', v)", False, 'import re\n'), ((3... |
kshshkim/factorioCalcPy | test_calc_base.py | 2a7c6ca567a3bf0d2b19f3cf0bc05274f83d4205 | import pprint
from FactorioCalcBase.data.binary import sorted_recipe_list, production_machine_category_list_dict
from FactorioCalcBase.recipe import Recipe
from FactorioCalcBase.calculator_base import CalculatorBase
from FactorioCalcBase.dependency_dict_common_function import dict_add_number
import time
def test_chan... | [((10, 17, 10, 50), 'FactorioCalcBase.recipe.Recipe', 'Recipe', (), '', False, 'from FactorioCalcBase.recipe import Recipe\n'), ((12, 29, 12, 75), 'FactorioCalcBase.data.binary.production_machine_category_list_dict.get', 'production_machine_category_list_dict.get', ({(12, 71, 12, 74): 'cat'}, {}), '(cat)', False, 'from... |
ahfeel/thrift | lib/py/src/Thrift.py | 3ac3fa6fede4b2446209cfeb6fcae5900da543cc | # Copyright (c) 2006- Facebook
# Distributed under the Thrift Software License
#
# See accompanying file LICENSE or visit the Thrift site at:
# http://developers.facebook.com/thrift/
class TType:
STOP = 0
VOID = 1
BOOL = 2
BYTE = 3
I08 = 3
DOUBLE = 4
I16 = 6
I32 = 8
I64 = 10
STR... | [] |
nyumaya/wake-word-benchmark | engine.py | d2f7ac091d31403f3398bc3ef2e2de4876a4629e | #
# Copyright 2018 Picovoice Inc.
#
# 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 writ... | [((35, 18, 35, 65), 'collections.namedtuple', 'namedtuple', ({(35, 29, 35, 46): '"""SensitivityInfo"""', (35, 48, 35, 64): '"""min, max, step"""'}, {}), "('SensitivityInfo', 'min, max, step')", False, 'from collections import namedtuple\n'), ((84, 17, 84, 41), 'pocketsphinx.pocketsphinx.Decoder.default_config', 'Decode... |
thirschbuechler/didactic-barnacles | objO_and_ctxMgr/harakiri.py | 88d0a2b572aacb2cb45e68bb4f05fa5273224439 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 20 22:18:58 2020
@author: https://stackoverflow.com/questions/293431/python-object-deleting-itself
@editor: thirschbuechler
this is probably overkill to alternatively exit a with-context, rather than by exception,
but hey, maybe it will be needed, ... | [((24, 15, 24, 34), 'weakref.proxy', 'weakref.proxy', ({(24, 29, 24, 33): 'self'}, {}), '(self)', False, 'import weakref\n')] |
srimani-programmer/Opencv-with-Python-Blueprints-second-Edition | chapter2/gestures.py | 8762022a58a379229f02d7250d8344087d98516d | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""A module containing an algorithm for hand gesture recognition"""
import numpy as np
import cv2
from typing import Tuple
__author__ = "Michael Beyeler"
__license__ = "GNU GPL 3.0 or later"
def recognize(img_gray):
"""Recognizes hand gesture in a single-channel dep... | [((32, 15, 32, 56), 'cv2.cvtColor', 'cv2.cvtColor', ({(32, 28, 32, 35): 'segment', (32, 37, 32, 55): 'cv2.COLOR_GRAY2RGB'}, {}), '(segment, cv2.COLOR_GRAY2RGB)', False, 'import cv2\n'), ((56, 14, 56, 31), 'numpy.median', 'np.median', ({(56, 24, 56, 30): 'center'}, {}), '(center)', True, 'import numpy as np\n'), ((63, 1... |
jnippula/satt | satt/trace/logger/panic.py | aff4562b7e94f095d2e13eb10b9ac872484bb5cd | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
// Copyright (c) 2015 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... | [] |
csalcedo001/xlab | xlab/cli.py | 8c51f035a870dd57339ff0208a3ab27ef6b8b41f | import sys
import os
from . import filesys
MAIN_USAGE_MESSAGE = """
usage: xlab command ...
Options:
positional arguments:
command
project
"""
def project(args):
if len(args) != 1:
print("error: Invalid arguments.")
exit()
if args[0] == 'init':
root = os.getcwd()
... | [((22, 15, 22, 26), 'os.getcwd', 'os.getcwd', ({}, {}), '()', False, 'import os\n')] |
jzhang533/Paddle | python/paddle/optimizer/adamw.py | 3227b2c401a80104e0c01dedcef2061ffa1ebbed | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [((262, 11, 262, 40), 'paddle.is_compiled_with_xpu', 'paddle.is_compiled_with_xpu', ({}, {}), '()', False, 'import paddle\n'), ((255, 16, 256, 61), 'paddle.fluid.layers.assign', 'paddle.fluid.layers.assign', (), '', False, 'import paddle\n'), ((259, 16, 259, 76), 'paddle.fluid.layers.assign', 'paddle.fluid.layers.assig... |
VinLau/BAR_API | tests/resources/test_interactions.py | 0719a5fbc08872f667590b27347af9bfed669bca | from api import app
from unittest import TestCase
class TestIntegrations(TestCase):
maxDiff = None
def setUp(self):
self.app_client = app.test_client()
def test_get_itrns(self):
"""
This function test retrieving protein interactions for various species' genes.
"""
... | [((10, 26, 10, 43), 'api.app.test_client', 'app.test_client', ({}, {}), '()', False, 'from api import app\n')] |
16kozlowskim/Group-20-SE | src/dialogflow-java-client-master/samples/clients/VirtualTradingAssistant/src/main/java/ai/examples/scraper/historicalScrape.py | ceb8c319643964a3f478772d8f10090962df567c | # install BeautifulSoup4 before running
#
# prints out historical data in csv format:
#
# [date, open, high, low, close, volume]
#
import re, csv, sys, urllib2
from bs4 import BeautifulSoup
# If start date and end date is the same only one value will be returned and
# if not the multiple values which can be used to ma... | [((36, 11, 36, 31), 'urllib2.urlopen', 'urllib2.urlopen', ({(36, 27, 36, 30): 'url'}, {}), '(url)', False, 'import re, csv, sys, urllib2\n'), ((38, 11, 38, 45), 'bs4.BeautifulSoup', 'BeautifulSoup', ({(38, 25, 38, 29): 'page', (38, 31, 38, 44): '"""html.parser"""'}, {}), "(page, 'html.parser')", False, 'from bs4 import... |
odontomachus/hotbox | client/client.py | d42c48d7f056f2b1f7bd707ad674e737a3c2fe08 | import sys
import io
from collections import defaultdict
import struct
from time import sleep
import queue
import threading
import serial
from serial import SerialException
RUN_LABELS = ('Time left', 'Temp 1', 'Temp 2', 'Off Goal', 'Temp Change', 'Duty cycle (/30)', 'Heating', 'Cycle', 'Total time', 'Goal temp')
MSG... | [((41, 12, 41, 49), 'struct.unpack', 'struct.unpack', ({(41, 26, 41, 39): '"""=BBLBB?bbLB"""', (41, 41, 41, 48): 'message'}, {}), "('=BBLBB?bbLB', message)", False, 'import struct\n'), ((64, 21, 64, 50), 'struct.unpack', 'struct.unpack', ({(64, 35, 64, 40): '"""=LB"""', (64, 42, 64, 49): 'message'}, {}), "('=LB', messa... |
ComputerCraftr/devault | test/functional/abc-sync-chain.py | 546b54df85e3392f85e7ea5fcd4ea9b395ba8f4c | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Test that a node receiving many (potentially out of order) blocks exits
initial block download (IBD; this occur... | [((29, 14, 29, 27), 'test_framework.mininode.msg_headers', 'msg_headers', ({}, {}), '()', False, 'from test_framework.mininode import CBlockHeader, network_thread_start, P2PInterface, msg_block, msg_headers\n'), ((48, 8, 48, 30), 'test_framework.mininode.network_thread_start', 'network_thread_start', ({}, {}), '()', Fa... |
hongsemy/InstagramWithDjango | djangostagram/posts/models.py | 18cb273668809fb48d829e1ac11438c51505623a | from django.db import models
from djangostagram.users import models as user_model
# Create your models here.
# This class is used in other models as an inheritance.
# An often-used pattern
class TimeStamedModel(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeFi... | [((9, 17, 9, 56), 'django.db.models.DateTimeField', 'models.DateTimeField', (), '', False, 'from django.db import models\n'), ((10, 17, 10, 56), 'django.db.models.DateTimeField', 'models.DateTimeField', (), '', False, 'from django.db import models\n'), ((18, 13, 23, 13), 'django.db.models.ForeignKey', 'models.ForeignKe... |
rboixaderg/guillotina | guillotina/contrib/workflows/events.py | fcae65c2185222272f3b8fee4bc2754e81e0e983 | from guillotina.contrib.workflows.interfaces import IWorkflowChangedEvent
from guillotina.events import ObjectEvent
from zope.interface import implementer
@implementer(IWorkflowChangedEvent)
class WorkflowChangedEvent(ObjectEvent):
"""An object has been moved"""
def __init__(self, object, workflow, action, c... | [((6, 1, 6, 35), 'zope.interface.implementer', 'implementer', ({(6, 13, 6, 34): 'IWorkflowChangedEvent'}, {}), '(IWorkflowChangedEvent)', False, 'from zope.interface import implementer\n'), ((11, 8, 11, 42), 'guillotina.events.ObjectEvent.__init__', 'ObjectEvent.__init__', ({(11, 29, 11, 33): 'self', (11, 35, 11, 41): ... |
lrwb-aou/curation | data_steward/cdr_cleaner/cleaning_rules/covid_ehr_vaccine_concept_suppression.py | e80447e56d269dc2c9c8bc79e78218d4b0dc504c | """
Suppress COVID EHR vaccine concepts.
Original Issues: DC-1692
"""
# Python imports
import logging
# Project imports
from cdr_cleaner.cleaning_rules.deid.concept_suppression import AbstractBqLookupTableConceptSuppression
from constants.cdr_cleaner import clean_cdr as cdr_consts
from common import JINJA_ENV, CDM_T... | [((19, 9, 19, 36), 'logging.getLogger', 'logging.getLogger', ({(19, 27, 19, 35): '__name__'}, {}), '(__name__)', False, 'import logging\n'), ((23, 30, 67, 4), 'common.JINJA_ENV.from_string', 'JINJA_ENV.from_string', ({(23, 52, 67, 3): '"""\nCREATE OR REPLACE TABLE `{{project_id}}.{{sandbox_id}}.{{concept_suppression_lo... |
sum3105/pydbhub | pydbhub/httphub.py | 501ea2c0ec7785bc06a38961a1366c3c04d7fabd | import pydbhub
from typing import Any, Dict, List, Tuple
from json.decoder import JSONDecodeError
import requests
import io
def send_request_json(query_url: str, data: Dict[str, Any]) -> Tuple[List[Any], str]:
"""
send_request_json sends a request to DBHub.io, formatting the returned result as JSON
Param... | [((29, 19, 29, 71), 'requests.post', 'requests.post', (), '', False, 'import requests\n'), ((64, 19, 64, 71), 'requests.post', 'requests.post', (), '', False, 'import requests\n'), ((97, 19, 97, 84), 'requests.post', 'requests.post', (), '', False, 'import requests\n')] |
BrandonLeiran/bracket-scoring | test_calcscore.py | a099e9a56ee3083c3a9db7d085b11b1dc7fe77f8 | import pytest
from calcscore import round_score
# you'll be picking what teams make it to the next round
# - so picking 32, then 16, then 8, 4, 2, 1...i.e. round 1-6 winners
# teams will have a name & a seed
# seed doesn't change, so maybe make that not passed around w/ results
def test_round_score_invalid_round():... | [((10, 9, 10, 53), 'pytest.raises', 'pytest.raises', (), '', False, 'import pytest\n'), ((11, 8, 11, 22), 'calcscore.round_score', 'round_score', ({(11, 20, 11, 21): '(0)'}, {}), '(0)', False, 'from calcscore import round_score\n'), ((13, 9, 13, 53), 'pytest.raises', 'pytest.raises', (), '', False, 'import pytest\n'), ... |
bgyori/pyobo | tests/test_get.py | f199f62f65fc7faff307b56f979a369202c8ad33 | import unittest
from operator import attrgetter
import obonet
from pyobo import SynonymTypeDef, get
from pyobo.struct import Reference
from pyobo.struct.struct import (
iterate_graph_synonym_typedefs, iterate_graph_typedefs, iterate_node_parents, iterate_node_properties,
iterate_node_relationships, iterate_no... | [((20, 20, 20, 56), 'obonet.read_obo', 'obonet.read_obo', ({(20, 36, 20, 55): 'TEST_CHEBI_OBO_PATH'}, {}), '(TEST_CHEBI_OBO_PATH)', False, 'import obonet\n'), ((118, 14, 118, 63), 'pyobo.get', 'get', (), '', False, 'from pyobo import SynonymTypeDef, get\n'), ((32, 34, 32, 76), 'pyobo.struct.struct.iterate_graph_synonym... |
ymontilla/WebScrapingCatastro | src/commons.py | a184b5c92199305e28ca7346c01d1e78e0a92c13 | # -*- coding: utf-8 -*-
# +
## Utilidades comunes entre places y OSM.
# +
import csv
import ast
import codecs
from math import cos, asin, sqrt
# +
def read_csv_with_encoding(filename, delimiter="|", encoding="iso-8859-1"):
with codecs.open(filename, encoding=encoding) as fp:
reader = csv.reader(fp, deli... | [((44, 11, 44, 78), 'pandas.DataFrame', 'pd.DataFrame', ({(44, 24, 44, 77): "{'fid': [777], 'latitude': [lat], 'longitude': [lon]}"}, {}), "({'fid': [777], 'latitude': [lat], 'longitude': [lon]})", True, 'import pandas as pd\n'), ((71, 11, 73, 64), 'pandas.DataFrame', 'pd.DataFrame', ({(71, 24, 73, 63): "{'fid': final[... |
JamescMcE/BasketBet | GamesGetter.py | f87719ac793ea50822e8c52fc23191dba9ad6418 | #This script Imports Game Data from ESPN, and Odds from the ODDS-API, and then imports them into a MySQL table, example in workbench here https://puu.sh/HOKCj/ce199eec8e.png
import mysql.connector
import requests
import json
import datetime
import time
#Connection to the MYSQL Server.
mydb = mysql.connector.... | [((66, 15, 66, 87), 'requests.get', 'requests.get', (), '', False, 'import requests\n'), ((114, 11, 114, 37), 'datetime.datetime.utcnow', 'datetime.datetime.utcnow', ({}, {}), '()', False, 'import datetime\n'), ((131, 12, 131, 33), 'datetime.date.today', 'datetime.date.today', ({}, {}), '()', False, 'import datetime\n'... |
effigies/neurodocker | neurodocker/tests/test_neurodocker.py | 4b0f32d2915b8b0308e3e391d534e05eb29b8d09 | """Tests for neurodocker.main"""
# Author: Jakub Kaczmarzyk <jakubk@mit.edu>
from __future__ import absolute_import, unicode_literals
import sys
import pytest
from neurodocker.neurodocker import create_parser, parse_args, main
def test_generate():
args = ("generate -b ubuntu:17.04 -p apt"
" --arg ... | [((104, 16, 104, 33), 'json.dumps', 'json.dumps', ({(104, 27, 104, 32): 'specs'}, {}), '(specs)', False, 'import json\n'), ((120, 4, 120, 14), 'neurodocker.neurodocker.main', 'main', ({(120, 9, 120, 13): 'args'}, {}), '(args)', False, 'from neurodocker.neurodocker import create_parser, parse_args, main\n'), ((125, 4, 1... |
tmichalak/prjuray | fuzzers/011-cle-ffconfig/generate.py | 53f3c94b58ffc6d405ac20a3b340ae726717ed47 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The Project U-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
'''
FDCE Primitive: D Flip-Flop with Clock... | [((24, 8, 24, 49), 'utils.segmaker.Segmaker', 'Segmaker', (), '', False, 'from utils.segmaker import Segmaker\n')] |
JamesBrofos/Thresholds-in-Hamiltonian-Monte-Carlo | hmc/integrators/states/riemannian_leapfrog_state.py | 7ee1b530db0eb536666dbc872fbf8200e53dd49b | from typing import Callable
import numpy as np
from hmc.integrators.states.leapfrog_state import LeapfrogState
from hmc.integrators.fields import riemannian
from hmc.linalg import solve_psd
class RiemannianLeapfrogState(LeapfrogState):
"""The Riemannian leapfrog state uses the Fisher information matrix to provi... | [((61, 21, 61, 51), 'numpy.swapaxes', 'np.swapaxes', ({(61, 33, 61, 43): 'jac_metric', (61, 45, 61, 46): '0', (61, 48, 61, 50): '-1'}, {}), '(jac_metric, 0, -1)', True, 'import numpy as np\n'), ((62, 35, 62, 70), 'hmc.linalg.solve_psd', 'solve_psd', (), '', False, 'from hmc.linalg import solve_psd\n'), ((63, 29, 63, 85... |
StuartLiam/DroneNavigationOnboard | MultirangerTest.py | 11ac6a301dfc72b15e337ddf09f5ddc79265a03f | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 2... | [((63, 0, 63, 40), 'logging.basicConfig', 'logging.basicConfig', (), '', False, 'import logging\n'), ((81, 9, 81, 38), 'cflib.crazyflie.Crazyflie', 'Crazyflie', (), '', False, 'from cflib.crazyflie import Crazyflie\n'), ((90, 4, 90, 24), 'matplotlib.pyplot.plot', 'plt.plot', ({(90, 13, 90, 23): 'rangeArray'}, {}), '(ra... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.