repo_name stringlengths 7 94 | repo_path stringlengths 4 237 | repo_head_hexsha stringlengths 40 40 | content stringlengths 10 680k | apis stringlengths 2 840k |
|---|---|---|---|---|
gfjiangly/AerialDetection | tools/aerial_detection.py | ee8a945c67c8e9ddef725900ac300d2d5a785e08 | # -*- encoding:utf-8 -*-
# @Time : 2021/1/3 15:15
# @Author : gfjiang
import os.path as osp
import mmcv
import numpy as np
import cvtools
import matplotlib.pyplot as plt
import cv2.cv2 as cv
from functools import partial
import torch
import math
from cvtools.utils.path import add_prefix_filename_suffix
from mmdet.... | [((26, 10, 26, 38), 'matplotlib.pyplot.figure', 'plt.figure', (), '', True, 'import matplotlib.pyplot as plt\n'), ((43, 4, 43, 15), 'matplotlib.pyplot.close', 'plt.close', ({}, {}), '()', True, 'import matplotlib.pyplot as plt\n'), ((59, 10, 59, 32), 'os.path.exists', 'osp.exists', ({(59, 21, 59, 31): 'image_name'}, {}... |
federico123579/Trading212-API | tradingAPI/low_level.py | 0fab20b71a2348e72bbe76071b81f3692128851f | # -*- coding: utf-8 -*-
"""
tradingAPI.low_level
~~~~~~~~~~~~~~
This module provides the low level functions with the service.
"""
import time
import re
from datetime import datetime
from pyvirtualdisplay import Display
from bs4 import BeautifulSoup
from splinter import Browser
from .glob import Glob
from .links imp... | [((25, 9, 25, 50), 'logging.getLogger', 'logging.getLogger', ({(25, 27, 25, 49): '"""tradingAPI.low_level"""'}, {}), "('tradingAPI.low_level')", False, 'import logging\n'), ((77, 24, 77, 33), 'pyvirtualdisplay.Display', 'Display', ({}, {}), '()', False, 'from pyvirtualdisplay import Display\n'), ((83, 27, 83, 50), 'spl... |
cvicens/lab-knative | .infra/setup/playbooks/roles/ansible.kubernetes-modules/library/openshift_v1_build_config_list.py | ef98aa111e566c6d33fd72c61f9c0d93a2c05b2f | #!/usr/bin/python
# -*- coding: utf-8 -*-
from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
DOCUMENTATION = '''
module: openshift_v1_build_config_list
short_description: OpenShift BuildConfigList
description:
- Retrieve a list of build_configs. List operations provide... | [((1904, 17, 1904, 66), 'ansible.module_utils.openshift_common.OpenShiftAnsibleModule', 'OpenShiftAnsibleModule', ({(1904, 40, 1904, 59): '"""build_config_list"""', (1904, 61, 1904, 65): '"""v1"""'}, {}), "('build_config_list', 'v1')", False, 'from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, Op... |
groorj/cloud-regions | aws-regions.py | f085491c71440d99000ad29a885e6090dfc9332a | import json
import logging
import os
import inspect
import urllib
import urllib.request
from urllib.error import HTTPError
# logger
logger = logging.getLogger()
logger_level = logging.getLevelName(os.environ['LOGGER_LEVEL'])
logger.setLevel(logger_level)
# validate access
def validate_access(event, context):
logg... | [((10, 9, 10, 28), 'logging.getLogger', 'logging.getLogger', ({}, {}), '()', False, 'import logging\n'), ((11, 15, 11, 63), 'logging.getLevelName', 'logging.getLevelName', ({(11, 36, 11, 62): "os.environ['LOGGER_LEVEL']"}, {}), "(os.environ['LOGGER_LEVEL'])", False, 'import logging\n'), ((37, 16, 37, 40), 'json.dumps',... |
guowenying111/SEKE | src/models/encoder.py | a913a19090eb690c3188036795559210a5262f2b | import math
import torch
import torch.nn as nn
from models.neural import MultiHeadedAttention, PositionwiseFeedForward
from models.rnn import LayerNormLSTM
class Classifier(nn.Module):
def __init__(self, hidden_size):
super(Classifier, self).__init__()
self.linear1 = nn.Linear(hidden_size, 1)
... | [((13, 23, 13, 48), 'torch.nn.Linear', 'nn.Linear', ({(13, 33, 13, 44): 'hidden_size', (13, 46, 13, 47): '1'}, {}), '(hidden_size, 1)', True, 'import torch.nn as nn\n'), ((14, 23, 14, 35), 'torch.nn.Sigmoid', 'nn.Sigmoid', ({}, {}), '()', True, 'import torch.nn as nn\n'), ((25, 13, 25, 38), 'torch.zeros', 'torch.zeros'... |
DemarcusL/django_wiki_lab | djangox/lib/python3.8/site-packages/allauth/socialaccount/providers/dropbox/views.py | 3b7cf18af7e0f89c94d10eb953ca018a150a2f55 | import requests
from allauth.socialaccount.providers.oauth2.views import (
OAuth2Adapter,
OAuth2CallbackView,
OAuth2LoginView,
)
from .provider import DropboxOAuth2Provider
class DropboxOAuth2Adapter(OAuth2Adapter):
provider_id = DropboxOAuth2Provider.id
access_token_url = "https://api.dropbox.c... | [((28, 14, 28, 64), 'allauth.socialaccount.providers.oauth2.views.OAuth2LoginView.adapter_view', 'OAuth2LoginView.adapter_view', ({(28, 43, 28, 63): 'DropboxOAuth2Adapter'}, {}), '(DropboxOAuth2Adapter)', False, 'from allauth.socialaccount.providers.oauth2.views import OAuth2Adapter, OAuth2CallbackView, OAuth2LoginView... |
Tatsh/upkeep | source/conf.py | 7fa99ff54104e3dec15d611eb174910337cf1870 | # SPDX-License-Identifier: MIT
# pylint: disable=redefined-builtin,invalid-name
"""See https://www.sphinx-doc.org/en/master/usage/configuration.html"""
from typing import Sequence
import os
import sys
# region Path setup
sys.path.insert(0, os.path.abspath('..'))
# endregion
# region Project information
project = 'Upk... | [((9, 19, 9, 40), 'os.path.abspath', 'os.path.abspath', ({(9, 35, 9, 39): '""".."""'}, {}), "('..')", False, 'import os\n')] |
sweptlaser/pclpy | generators/generate_pybind11_bindings.py | ab84da7ed264b5bc918af0d858e6d4063275aab9 | import os
import platform
import shutil
import sys
from collections import Counter
from collections import defaultdict, OrderedDict
from os.path import join
from typing import List, Dict, Set
from CppHeaderParser import CppHeaderParser
from CppHeaderParser.CppHeaderParser import CppMethod
import generators.dependency... | [((201, 22, 201, 64), 'generators.utils.read_header_file', 'read_header_file', ({(201, 39, 201, 50): 'header_path', (201, 52, 201, 63): 'skip_macros'}, {}), '(header_path, skip_macros)', False, 'from generators.utils import make_header_include_name, sort_headers_by_dependencies, generate_main_loader, make_namespace_cla... |
bcvsolutions/winrm-ad-connector | scripts_python3/exchange/deleteExchange.py | 9b45dae78d3ba24fe6b00e090f8763d3162e1570 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# All params from IdM is stored in environment and you can get them by os.environ["paramName"]
import sys, os
# this is needed for importing file winrm_wrapper from parent dir
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import winrm_wrapper
import codecs... | [((12, 0, 12, 49), 'winrm_wrapper.writeLog', 'winrm_wrapper.writeLog', ({(12, 23, 12, 48): "('Delete start for ' + uid)"}, {}), "('Delete start for ' + uid)", False, 'import winrm_wrapper\n'), ((15, 0, 15, 40), 'winrm_wrapper.writeLog', 'winrm_wrapper.writeLog', ({(15, 23, 15, 39): '"""loading script"""'}, {}), "('load... |
Walon1998/dace | tests/registry_test.py | 95ddfd3e9a5c654f0f0d66d026e0b64ec0f028a0 | # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
import unittest
from aenum import Enum, auto
from dace import registry
@registry.make_registry
class ExtensibleClass(object):
pass
class Extension(ExtensibleClass):
pass
@registry.extensible_enum
class ExtensibleEnumeration(Enum):... | [((18, 8, 18, 14), 'aenum.auto', 'auto', ({}, {}), '()', False, 'from aenum import Enum, auto\n'), ((19, 8, 19, 14), 'aenum.auto', 'auto', ({}, {}), '()', False, 'from aenum import Enum, auto\n'), ((72, 4, 72, 19), 'unittest.main', 'unittest.main', ({}, {}), '()', False, 'import unittest\n'), ((44, 9, 44, 51), 'dace.re... |
aviramha/aiologstash2 | tests/conftest.py | 08c5127bf77e3b66ddcb2e8acff82368dbc58af7 | import asyncio
import logging
from json import loads
import pytest
from aiologstash2 import create_tcp_handler
logging.getLogger().setLevel(logging.DEBUG)
class FakeTcpServer:
def __init__(self):
self.data = bytearray()
self.server = None
self.futs = set()
async def start(self):
... | [((10, 0, 10, 19), 'logging.getLogger', 'logging.getLogger', ({}, {}), '()', False, 'import logging\n'), ((98, 17, 98, 54), 'logging.getLogger', 'logging.getLogger', ({(98, 35, 98, 53): '"""aiologstash_test"""'}, {}), "('aiologstash_test')", False, 'import logging\n'), ((20, 28, 20, 83), 'asyncio.start_server', 'asynci... |
RichieB2B/tcex | tcex/playbooks/playbooks_base.py | eba20a67d4b8e3596c895b7c45325716267d7c85 | """TcEx Framework Playbook module"""
# standard library
import base64
import json
import re
from collections import OrderedDict
from collections.abc import Iterable
class PlaybooksBase:
"""TcEx Playbook Module Base Class
Args:
tcex (TcEx): Instance of TcEx class.
context (str): The Redis cont... | [((31, 31, 31, 73), 're.compile', 're.compile', ({(31, 42, 31, 72): 'f"""^{self._variable_pattern}$"""'}, {}), "(f'^{self._variable_pattern}$')", False, 'import re\n'), ((33, 31, 33, 65), 're.compile', 're.compile', ({(33, 42, 33, 64): 'self._variable_pattern'}, {}), '(self._variable_pattern)', False, 'import re\n'), (... |
puririshi98/benchmark | DeepLearningExamples/TensorFlow/LanguageModeling/BERT/run_classifier.py | 79f554f1e1cf36f62994c78e0e6e5b360f554022 | # coding=utf-8
# Copyright (c) 2019 NVIDIA CORPORATION. All rights reserved.
# Copyright 2018 The Google AI Language Team Authors.
#
# 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... | [((184, 10, 191, 30), 'modeling.BertModel', 'modeling.BertModel', (), '', False, 'import modeling\n'), ((227, 14, 227, 40), 'tensorflow.compat.v1.ConfigProto', 'tf.compat.v1.ConfigProto', ({}, {}), '()', True, 'import tensorflow as tf\n'), ((460, 2, 460, 19), 'utils.utils.setup_xla_flags', 'setup_xla_flags', ({}, {}), ... |
29rj/Fusion | FusionIIIT/applications/academic_information/views.py | bc2941a67532e183adeb0bc4042df0b182b9e3aa | import datetime
import json
import os
import xlrd
import logging
from io import BytesIO
from xlsxwriter.workbook import Workbook
from xhtml2pdf import pisa
from itertools import chain
from django.contrib.auth.models import User
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
from django.short... | [((111, 25, 111, 53), 'applications.academic_procedures.views.acad_proced_global_context', 'acad_proced_global_context', ({}, {}), '()', False, 'from applications.academic_procedures.views import acad_proced_global_context\n'), ((217, 11, 217, 51), 'django.shortcuts.render', 'render', ({(217, 18, 217, 25): 'request', (... |
laoyigrace/subject | subject/tests/functional/test_glance_replicator.py | e6ed989fdc250917a19788112b22322b73b3550f | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | [((29, 29, 29, 60), 'subject.tests.utils.execute', 'execute', (), '', False, 'from subject.tests.utils import execute\n')] |
OmoMicheal/marketanalysis | test/countries/test_united_states.py | ddc2476ec918a28658e64574e89d8944cee75617 | # -*- coding: utf-8 -*-
# marketanalysis
# ----------------
# A fast, efficient Python library for generating country, province and state
# specific sets of marketmarketholidayss on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Author: MichealO... | [((28, 31, 28, 65), 'marketanalysis.marketholidays.USA', 'marketholidays.USA', (), '', False, 'from marketanalysis import marketholidays\n'), ((29, 34, 29, 57), 'marketanalysis.markettradingdays.USA', 'markettradingdays.USA', ({}, {}), '()', False, 'from marketanalysis import markettradingdays\n'), ((63, 29, 63, 48), '... |
jungleni/ros_code_reading | src/ros_comm/rosmsg/setup.py | 499e98c0b0d309da78060b19b55c420c22110d65 | #!/usr/bin/env python
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
d = generate_distutils_setup(
packages=['rosmsg'],
package_dir={'': 'src'},
scripts=['scripts/rosmsg', 'scripts/rosmsg-proto', 'scripts/rossrv'],
requires=['genmsg', 'rosbag', 'roslib', ... | [((6, 4, 11, 1), 'catkin_pkg.python_setup.generate_distutils_setup', 'generate_distutils_setup', (), '', False, 'from catkin_pkg.python_setup import generate_distutils_setup\n'), ((13, 0, 13, 10), 'distutils.core.setup', 'setup', ({}, {}), '(**d)', False, 'from distutils.core import setup\n')] |
AlgoArt/algoart | unsorted/linked_list.py | 7a7a28f099351a6b6c1b360c794f697881c7e429 | #!/usr/bin/env python
# linked_list.py - Linked list implementation in Python by Sergey 2015
"""
Linked list implementation in Python
"""
# Standard modules
import unittest
import sys
import os
import argparse
import re
import random
import subprocess
import getpass
import shutil
# Additional modules
############... | [((104, 8, 104, 33), 'unittest.main', 'unittest.main', (), '', False, 'import unittest\n')] |
speglich/devito | examples/seismic/viscoacoustic/wavesolver.py | b636f7694eb6a1e19b0f2c48f44ff63613029a7b | from devito import VectorTimeFunction, TimeFunction, NODE
from devito.tools import memoized_meth
from examples.seismic import PointSource
from examples.seismic.viscoacoustic.operators import (ForwardOperator, AdjointOperator)
class ViscoacousticWaveSolver(object):
"""
Solver object that provides operators for... | [((49, 15, 51, 74), 'examples.seismic.viscoacoustic.operators.ForwardOperator', 'ForwardOperator', (), '', False, 'from examples.seismic.viscoacoustic.operators import ForwardOperator, AdjointOperator\n'), ((56, 15, 58, 74), 'examples.seismic.viscoacoustic.operators.AdjointOperator', 'AdjointOperator', (), '', False, '... |
NIL-zhuang/NJU-Data-Integration | StaticProcess/apriori.py | 78315d33cda6b69dd16a4704fa8e0dfc6fc359b6 | import pandas as pd
import os
from tqdm import tqdm
from collections import defaultdict
from mlxtend.preprocessing import TransactionEncoder
from mlxtend.frequent_patterns import apriori
dataPath = "data/static"
itemSetList = []
def loadDataSet():
with open(os.path.join(dataPath, "aprioriData.csv"), 'r') as f:
... | [((21, 9, 21, 29), 'mlxtend.preprocessing.TransactionEncoder', 'TransactionEncoder', ({}, {}), '()', False, 'from mlxtend.preprocessing import TransactionEncoder\n'), ((23, 9, 23, 50), 'pandas.DataFrame', 'pd.DataFrame', (), '', True, 'import pandas as pd\n'), ((30, 9, 30, 46), 'pandas.read_csv', 'pd.read_csv', ({(30, ... |
FuriKuri/faas-playground | gcp-python-fn/main.py | 52618e21064e327d2874d2b73cfe5fb247d3dd6e | def hello_world(request):
request_json = request.get_json()
name = 'World'
if request_json and 'name' in request_json:
name = request_json['name']
headers = {
'Access-Control-Allow-Origin': 'https://furikuri.net',
'Access-Control-Allow-Methods': 'GET, POST',
'Access-Contr... | [] |
move-ton/ton-client-py | tonclient/test/helpers.py | a9393a0e03b5da9bf5369a44c6873a3e720af229 | import os
from tonclient.client import TonClient
from tonclient.types import Abi, CallSet, Signer, ClientConfig, \
ParamsOfEncodeMessage, ParamsOfProcessMessage
BASE_DIR = os.path.dirname(__file__)
SAMPLES_DIR = os.path.join(BASE_DIR, 'samples')
GIVER_ADDRESS = '0:f5c2510bfe407363cb1db6b9d7bc1184a05f8b343aeaa8281... | [((7, 11, 7, 36), 'os.path.dirname', 'os.path.dirname', ({(7, 27, 7, 35): '__file__'}, {}), '(__file__)', False, 'import os\n'), ((8, 14, 8, 47), 'os.path.join', 'os.path.join', ({(8, 27, 8, 35): 'BASE_DIR', (8, 37, 8, 46): '"""samples"""'}, {}), "(BASE_DIR, 'samples')", False, 'import os\n'), ((11, 16, 11, 30), 'toncl... |
vthriller/flask-kajiki | tests/test_i18n.py | eadaa0aa45d23507066758b9e74091bddbc943c4 | from kajiki import i18n
from flask import request
from flask_kajiki import render_template
# N. B. settting i18n.gettext would affect tests from all modules,
# so we test for request path that only functions from this module could set
def gettext(s):
if request.path == '/test_i18n':
return s.upper()
r... | [((19, 19, 19, 47), 'flask_kajiki.render_template', 'render_template', ({(19, 35, 19, 46): '"""i18n.html"""'}, {}), "('i18n.html')", False, 'from flask_kajiki import render_template\n')] |
jstzwjr/mmdetection | mmdet/models/roi_heads/mask_heads/fcn_mask_head.py | 1c2878eb4f4da2978dcd9a05f9d0247726680213 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule, build_upsample_layer
from mmcv.ops import Conv2d
from mmcv.ops.carafe import CARAFEPack
from mmcv.runner import auto_fp16, force_fp32
from torch.nn.modules.utils import _pair
from mmdet.core import ma... | [((20, 1, 20, 24), 'mmdet.models.builder.HEADS.register_module', 'HEADS.register_module', ({}, {}), '()', False, 'from mmdet.models.builder import HEADS, build_loss\n'), ((118, 5, 118, 16), 'mmcv.runner.auto_fp16', 'auto_fp16', ({}, {}), '()', False, 'from mmcv.runner import auto_fp16, force_fp32\n'), ((138, 5, 138, 41... |
TangJiamin/Ultra_light_OCR_No.23 | PaddleOCR/deploy/hubserving/ocr_det/params.py | 594aa286dc2f88614141838ce45c164647226cdb | # -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
class Config(object):
pass
def read_params():
cfg = Config()
#params for text detector
cfg.det_algorithm = "DB"
cfg.det_model_dir = "./inference/ch_... | [] |
LArbys/ublarcvserver | networks/larflow/models/larflow_uresnet.py | 02381c937f49a2eab2f754017ab431c3f6fa70d7 | import torch.nn as nn
import torch as torch
import math
import torch.utils.model_zoo as model_zoo
###########################################################
#
# U-ResNet
# U-net witih ResNet modules
#
# Semantic segmentation network used by MicroBooNE
# to label track/shower pixels
#
# resnet implementation from pyto... | [] |
wzzju/PaddleNLP | examples/machine_reading_comprehension/DuReader-robust/run_du.py | 1757a4fc2a3cd5a45f75c6482746777752b414d8 | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
# Copyright 2018 The HuggingFace Inc. team.
#
# 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/licen... | [((54, 1, 54, 17), 'paddle.no_grad', 'paddle.no_grad', ({}, {}), '()', False, 'import paddle\n'), ((49, 4, 49, 26), 'random.seed', 'random.seed', ({(49, 16, 49, 25): 'args.seed'}, {}), '(args.seed)', False, 'import random\n'), ((50, 4, 50, 29), 'numpy.random.seed', 'np.random.seed', ({(50, 19, 50, 28): 'args.seed'}, {}... |
quangnguyendang/Reinforcement_Learning | Deep_Q_Network/DQN_for_FrozenLake_Discrete_Domain.py | 2551ce95068561c553500838ee6b976f001ba667 | # Credit to https://medium.com/emergent-future/simple-reinforcement-learning-with-tensorflow-part-0-q-learning-with-tables-and-neural-networks-d195264329d0
import gym
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
env = gym.make('FrozenLake-v0')
# NEURAL NETWORK IMPLEMENTATION
tf.reset_d... | [((9, 6, 9, 31), 'gym.make', 'gym.make', ({(9, 15, 9, 30): '"""FrozenLake-v0"""'}, {}), "('FrozenLake-v0')", False, 'import gym\n'), ((12, 0, 12, 24), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ({}, {}), '()', True, 'import tensorflow as tf\n'), ((15, 9, 15, 77), 'tensorflow.placeholder', 'tf.placehold... |
chanced/tink | testing/cross_language/util/supported_key_types.py | 9cc3a01ac0165b033ed51dc9d0812a98b4b6e305 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | [((155, 8, 158, 45), 'tink.proto.tink_pb2.KeyTemplate', 'tink_pb2.KeyTemplate', (), '', False, 'from tink.proto import tink_pb2\n')] |
chapeltech/remote-signer | signer.py | 83d083ed7e8c7123187ba70ee3132b898e8ef02e | #!/usr/bin/env python3
#########################################################
# Written by Carl Youngblood, carl@blockscale.net
# Copyright (c) 2018 Blockscale LLC
# released under the MIT license
#########################################################
from flask import Flask, request, Response, json, jsonify
fr... | [((14, 0, 14, 105), 'logging.basicConfig', 'logging.basicConfig', (), '', False, 'import logging\n'), ((16, 6, 16, 21), 'flask.Flask', 'Flask', ({(16, 12, 16, 20): '__name__'}, {}), '(__name__)', False, 'from flask import Flask, request, Response, json, jsonify\n'), ((33, 0, 33, 33), 'logging.info', 'logging.info', ({(... |
0x1F9F1/binja-msvc | unwind.py | be2577c22c8d37fd1e2e211f80b1c9a920705bd2 | from binaryninja import log
from .utils import BinjaStruct, read_pe_header, split_bits, update_percentage
# https://msdn.microsoft.com/en-us/library/ft9x1kdx.aspx
RUNTIME_FUNCTION_t = BinjaStruct('<III', names = ('BeginAddress', 'EndAddress', 'UnwindData'))
def read_runtime_function(view, address):
runtime_funct... | [] |
jmorlana/pixloc | pixloc/visualization/viz_3d.py | 90f7e968398252e8557b284803ee774cb8d80cd0 | """
3D visualization primitives based on Plotly.
We might want to instead use a more powerful library like Open3D.
Plotly however supports animations, buttons and sliders.
1) Initialize a figure with `fig = init_figure()`
2) Plot points, cameras, lines, or create a slider animation.
3) Call `fig.show()` to render the ... | [((19, 10, 19, 21), 'plotly.graph_objects.Figure', 'go.Figure', ({}, {}), '()', True, 'import plotly.graph_objects as go\n'), ((35, 9, 37, 49), 'plotly.graph_objects.Scatter3d', 'go.Scatter3d', (), '', True, 'import plotly.graph_objects as go\n'), ((45, 9, 48, 28), 'plotly.graph_objects.Cone', 'go.Cone', (), '', True, ... |
Net-Mist/advent_of_code2021 | day04/c.py | 124d773356bee2794294800de7673d5fac24db0a | import numpy as np
GRID_SIZE = 5
def read_bingo_grid(lines: list[str]) -> list[list[int]]:
return [[int(n) for n in line.split()] for line in lines]
def bingo_step(grids: np.ndarray, checked_grids: np.ndarray, number: int) -> None:
checked_grids[np.where(grids == number)] = True
def check_victory(check_g... | [((11, 18, 11, 43), 'numpy.where', 'np.where', ({(11, 27, 11, 42): '(grids == number)'}, {}), '(grids == number)', True, 'import numpy as np\n')] |
hugovk/altair | altair/vegalite/v2/examples/us_population_pyramid_over_time.py | a3c9f06790f7a8c5c7e2c98278d0f69e4630b5be | '''
US Population Pyramid Over Time
===============================
A population pyramid shows the distribution of age groups within a population.
It uses a slider widget that is bound to the year to visualize the age
distribution over time.
'''
# category: case studies
import altair as alt
from altair.expr import datu... | [((15, 9, 15, 55), 'altair.binding_range', 'alt.binding_range', (), '', True, 'import altair as alt\n'), ((16, 14, 16, 77), 'altair.selection_single', 'alt.selection_single', (), '', True, 'import altair as alt\n'), ((26, 8, 26, 36), 'altair.Axis', 'alt.Axis', (), '', True, 'import altair as alt\n'), ((27, 14, 28, 53),... |
ministryofjustice/mtp-api | mtp_api/apps/core/migrations/0004_token.py | b1c34c29e4aa9f48598cb060abe1368ae7686e0b | from django.db import migrations, models
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
('core', '0003_auto_20180404_1515'),
]
operations = [
migrations.CreateModel(
name='Token',
fields=[
... | [((16, 25, 16, 91), 'django.db.models.CharField', 'models.CharField', (), '', False, 'from django.db import migrations, models\n'), ((17, 26, 17, 44), 'django.db.models.TextField', 'models.TextField', ({}, {}), '()', False, 'from django.db import migrations, models\n'), ((18, 28, 18, 71), 'django.db.models.DateTimeFiel... |
m-hintz-42/a-palm-tree | palm_tree/coconut_1/models.py | 57656874335f4dfae13cf720668f2c5391621618 | from palm_tree import db
class Data(db.Model):
id = db.Column(db.Integer, primary_key=True)
uuid = db.Column(db.Integer)
response = db.Column(db.Text)
datetime = db.Column(db.DateTime)
def __init__(self, uuid, response, datetime):
self.uuid = uuid
self.response = response
... | [((5, 9, 5, 48), 'palm_tree.db.Column', 'db.Column', (), '', False, 'from palm_tree import db\n'), ((6, 11, 6, 32), 'palm_tree.db.Column', 'db.Column', ({(6, 21, 6, 31): 'db.Integer'}, {}), '(db.Integer)', False, 'from palm_tree import db\n'), ((7, 15, 7, 33), 'palm_tree.db.Column', 'db.Column', ({(7, 25, 7, 32): 'db.T... |
Zipfer/fuel-web | network_checker/dhcp_checker/utils.py | c6c4032eb6e29474e2be0318349265bdb566454c | # Copyright 2013 Mirantis, 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 ... | [((29, 11, 30, 51), 'subprocess.Popen', 'subprocess.Popen', (), '', False, 'import subprocess\n'), ((44, 20, 44, 60), 're.search', 're.search', ({(44, 30, 44, 52): '""".*<(?P<state>.*)>.*"""', (44, 54, 44, 59): 'state'}, {}), "('.*<(?P<state>.*)>.*', state)", False, 'import re\n'), ((146, 5, 146, 26), 'functools.wraps'... |
clarencejlee/jdp | paneldata_dash/backend/schemas/johnson_scanner_data.py | d3d31db0138ff06f2f5ec592d85317941af4f280 | from ma import ma
from models.johnson_scanner_data import JohnsonScannerDataModel
from schemas.brand import BrandSchema
from schemas.category import CategorySchema
from schemas.facts_in_data import FactsInDataSchema
from schemas.market import MarketSchema
from schemas.period import PeriodSchema
class JohnsonScannerDa... | [((11, 13, 11, 36), 'ma.ma.Nested', 'ma.Nested', ({(11, 23, 11, 35): 'MarketSchema'}, {}), '(MarketSchema)', False, 'from ma import ma\n'), ((12, 12, 12, 34), 'ma.ma.Nested', 'ma.Nested', ({(12, 22, 12, 33): 'BrandSchema'}, {}), '(BrandSchema)', False, 'from ma import ma\n'), ((13, 15, 13, 40), 'ma.ma.Nested', 'ma.Nest... |
farzanaaswin0708/CNN-for-Visual-recognition | Chest X-Ray Multilabel Image classification using CNN - Pytorch/Arch2.py | db65db0a0b60e1ed2a4a418069de61936aaa9e85 | #!/usr/bin/env python
# coding: utf-8
# In[ ]:
################################################################################
# CSE 253: Programming Assignment 3
# Winter 2019
# Code author: Jenny Hamer (+ modifications by Tejash Desai)
#
# Filename: baseline_cnn.py
#
# Description:
#
# This file contains the star... | [((56, 21, 56, 76), 'torch.nn.Conv2d', 'nn.Conv2d', (), '', True, 'import torch.nn as nn\n'), ((59, 28, 59, 45), 'torch.nn.BatchNorm2d', 'nn.BatchNorm2d', ({(59, 43, 59, 44): '4'}, {}), '(4)', True, 'import torch.nn as nn\n'), ((62, 8, 62, 52), 'torch.nn.init.xavier_normal_', 'torch_init.xavier_normal_', ({(62, 34, 62,... |
HydeJackal/TwitterWeeklyNewsBot | news_access.py | 64fc6b9e7d74bafd26f4dcdfe28e835ece1cee9b | import json
import urllib.request
import credentials
from datetime import datetime, timedelta
class NewsAPI:
def __init__(self, nyt_api):
self.nyt_access = nyt_api
def get_nyt_last_week_articles(self, topic, today):
delta = timedelta(weeks = 1)
last_week = today - delta
begin_... | [((31, 16, 31, 30), 'datetime.datetime.now', 'datetime.now', ({}, {}), '()', False, 'from datetime import datetime, timedelta\n'), ((12, 16, 12, 36), 'datetime.timedelta', 'timedelta', (), '', False, 'from datetime import datetime, timedelta\n')] |
owen-t/sagemaker-experiments-1 | tests/unit/test_trial_component.py | ef2af4009c3a5c6a63db5cec6b9de6c614dfdd66 | # Copyright 2019 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... | [((29, 10, 31, 5), 'smexperiments.trial_component.TrialComponent.create', 'trial_component.TrialComponent.create', (), '', False, 'from smexperiments import trial_component, api_types\n'), ((39, 10, 39, 54), 'datetime.datetime.now', 'datetime.datetime.now', ({(39, 32, 39, 53): 'datetime.timezone.utc'}, {}), '(datetime.... |
amylittleyang/OtraCAD | cadnano25/cadnano/part/xovercmds.py | 126360719704caf6850d42565fe96be53b66a22d | from cadnano.cnproxy import UndoCommand
from cadnano.strand import Strand
from cadnano import getBatch
import cadnano.preferences as prefs
import random
class CreateXoverCommand(UndoCommand):
"""
Creates a Xover from the 3' end of strand5p to the 5' end of strand3p
this needs to
1. preserve the old oli... | [((176, 16, 176, 50), 'cadnano.strand.Strand.setOligo', 'Strand.setOligo', ({(176, 32, 176, 38): 'strand', (176, 40, 176, 49): 'new_olg3p'}, {}), '(strand, new_olg3p)', False, 'from cadnano.strand import Strand\n'), ((215, 16, 215, 46), 'cadnano.strand.Strand.setOligo', 'Strand.setOligo', ({(215, 32, 215, 38): 'strand'... |
FabBrolMons/frbayart | src/temp2.py | c2b9dde730cf6d21f1c1492d0da0351c12a4dce9 | from w1thermsensor import W1ThermSensor
sensor = W1ThermSensor()
temperature_in_celsius = sensor.get_temperature()
temperature_in_fahrenheit = sensor.get_temperature(W1ThermSensor.DEGREES_F)
temperature_in_all_units = sensor.get_temperatures([W1ThermSensor.DEGREES_C, W1ThermSensor.DEGREES_F, W1ThermSensor.KELVIN])
pri... | [((3, 9, 3, 24), 'w1thermsensor.W1ThermSensor', 'W1ThermSensor', ({}, {}), '()', False, 'from w1thermsensor import W1ThermSensor\n')] |
jarnoln/exposures | tables/migrations/0004_auto_20200901_2004.py | bbae3f79078048d25b77e178db6c0801ffe9f97e | # Generated by Django 3.1.1 on 2020-09-01 17:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tables', '0003_exposure_category'),
]
operations = [
migrations.AlterField(
model_name='exposure',
name='location',
... | [((16, 18, 16, 74), 'django.db.models.CharField', 'models.CharField', (), '', False, 'from django.db import migrations, models\n')] |
kokinomura/reportlab | src/reportlab/graphics/charts/__init__.py | 18e39b85d7277c2b5e9218b30a7b7b0a644a3c02 | #Copyright ReportLab Europe Ltd. 2000-2016
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/charts/__init__.py
__version__='3.3.0'
__doc__='''Business charts'''
| [] |
AndrewLane/azure-cli | src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/_validators.py | 524491c580fc3c133f2d9859cef1c8251f4192e4 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | [((26, 9, 26, 29), 'knack.log.get_logger', 'get_logger', ({(26, 20, 26, 28): '__name__'}, {}), '(__name__)', False, 'from knack.log import get_logger\n'), ((37, 22, 37, 54), 'azure.cli.core.commands.client_factory.get_subscription_id', 'get_subscription_id', ({(37, 42, 37, 53): 'cmd.cli_ctx'}, {}), '(cmd.cli_ctx)', Fal... |
ednihs-yahska/unibrowser | scraping/faqscraper.py | c91aaf7df8b316c707e5a268f82e789615be9fb8 | import re
import httplib2
from bs4 import BeautifulSoup
from scraping.faqscrapperutil import stripExtra, removeDuplicates, removeBlackListedQuestions, getBlackListedQuestions, convertToJsonList, saveToMongo
from scraping.Constants import ENABLE_CUSTOM_QUESTIONS_FILTER, FAQ_LINKS, COLLECTION_NAME
d... | [((13, 11, 13, 41), 'scraping.faqscrapperutil.removeDuplicates', 'removeDuplicates', ({(13, 28, 13, 40): 'questionList'}, {}), '(questionList)', False, 'from scraping.faqscrapperutil import stripExtra, removeDuplicates, removeBlackListedQuestions, getBlackListedQuestions, convertToJsonList, saveToMongo\n'), ((78, 27, 7... |
ckousoulis/macos-messages | messages/term_utils.py | acf7ac94a81f7d097e2025c6ec7dd429de010795 | """Terminal utilities specific to message archives.
Creates colored text and helps write Messages output.
"""
from contextlib import contextmanager
import itertools
import readline
FG_COLORS = dict(itertools.chain(
zip(("black",
"red",
"green",
"yellow",
"blue",
"mage... | [((78, 2, 78, 34), 'readline.set_auto_history', 'readline.set_auto_history', ({(78, 28, 78, 33): '(False)'}, {}), '(False)', False, 'import readline\n'), ((82, 4, 82, 35), 'readline.set_auto_history', 'readline.set_auto_history', ({(82, 30, 82, 34): '(True)'}, {}), '(True)', False, 'import readline\n')] |
Project-MONAI/MONAI | tests/test_subpixel_upsample.py | 2bab12c67c3cc1d54a4847628ce1e879064be11c | # Copyright 2020 - 2021 MONAI Consortium
# 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 wri... | [((69, 5, 69, 45), 'parameterized.parameterized.expand', 'parameterized.expand', ({(69, 26, 69, 44): 'TEST_CASE_SUBPIXEL'}, {}), '(TEST_CASE_SUBPIXEL)', False, 'from parameterized import parameterized\n'), ((78, 4, 78, 19), 'unittest.main', 'unittest.main', ({}, {}), '()', False, 'import unittest\n'), ((71, 14, 71, 45)... |
magetron/secure-flow-prototype | gen-cfg.py | c683939620fec889f882ea095d2b27e3e4bb98fe | from staticfg import CFGBuilder
userCfg = CFGBuilder().build_from_file('user.py', './auction/user.py')
bidCfg = CFGBuilder().build_from_file('bid.py', './auction/bid.py')
auctionCfg = CFGBuilder().build_from_file('auction.py','./auction/auction.py')
#auctionEventCfg = CFGBuilder().build_from_file('auction_event.py','... | [((3, 10, 3, 22), 'staticfg.CFGBuilder', 'CFGBuilder', ({}, {}), '()', False, 'from staticfg import CFGBuilder\n'), ((4, 9, 4, 21), 'staticfg.CFGBuilder', 'CFGBuilder', ({}, {}), '()', False, 'from staticfg import CFGBuilder\n'), ((5, 13, 5, 25), 'staticfg.CFGBuilder', 'CFGBuilder', ({}, {}), '()', False, 'from staticf... |
dimitrov-dimitar/competitive-programming | CodeForces/A2OJ Ladder/softuni_problem.py | f2b022377baf6d4beff213fc513907b774c12352 | total_budget = 0
while True:
destination = input()
if destination == "End":
break
minimal_budget = float(input())
while True:
command = input()
if command == "End":
break
money = float(command)
total_budget += money
if total_budge... | [] |
rockzhu/footmark | footmark/ram/regioninfo.py | af2144e9139a63b475fa2b56c3307ddfd49c43e4 | from footmark.regioninfo import RegionInfo
class RAMRegionInfo(RegionInfo):
"""
Represents an ram Region
"""
def __init__(self, connection=None, name=None, id=None,
connection_cls=None):
from footmark.ram.connection import RAMConnection
super(RAMRegionInfo, self).__in... | [] |
sergiopasra/glue | glue/plugins/export_d3po.py | c25a217a122a11818382672c99cb21f57a30636f | from __future__ import absolute_import, division, print_function
import os
import json
from glue.core import Subset
DISPATCH = {}
def save_page(page, page_number, label, subset):
""" Convert a tab of a glue session into a D3PO page
:param page: Tuple of data viewers to save
:param label: Tab label
... | [((153, 16, 153, 46), 'os.path.join', 'os.path.join', ({(153, 29, 153, 33): 'path', (153, 35, 153, 45): '"""data.csv"""'}, {}), "(path, 'data.csv')", False, 'import os\n'), ((155, 8, 156, 55), 'astropy.table.Table', 'Table', (), '', False, 'from astropy.table import Table, Column\n'), ((200, 17, 200, 50), 'os.path.join... |
CarlosWillian/python | exercicios/ex 061 a 070/ex061.py | f863578245fbf402e5b46f844a247355afed0d62 | print('Crie sua P.A. de 10 termos')
n1 = int(input('Digite o primeiro termo da P.A.: '))
r = int(input('Digite a razão: '))
termo = n1
c = 1
print('A P.A. é (', end='')
while c <= 10:
print('{}'.format(termo), end='')
print(', ' if c < 10 else '', end='')
termo += r
c += 1
print(')')
| [] |
zmedico/pyrqlite | src/pyrqlite/connections.py | 17a22221e4e796a04c28aa578a93821cc3349b41 |
from __future__ import unicode_literals
import codecs
import logging
try:
from http.client import HTTPConnection, HTTPSConnection
except ImportError:
# pylint: disable=import-error
from httplib import HTTPConnection, HTTPSConnection
try:
from urllib.parse import urlparse
except ImportError:
# py... | [((104, 23, 104, 36), 'urlparse.urlparse', 'urlparse', ({(104, 32, 104, 35): 'uri'}, {}), '(uri)', False, 'from urlparse import urlparse\n'), ((106, 12, 106, 39), 'logging.getLogger', 'logging.getLogger', ({(106, 30, 106, 38): '__name__'}, {}), '(__name__)', False, 'import logging\n')] |
achoraev/SoftUni | PythonBasics/ConditionalStatements/Exercise/toy_shop.py | 0cc7db470a096cc33bbe0ca6bd90060b79120573 | price = float(input())
puzzles = int(input())
dolls = int(input())
bears = int(input())
minions = int(input())
trucks = int(input())
total_toys = puzzles + dolls + bears + minions + trucks
price_puzzles = puzzles * 2.6
price_dolls = dolls * 3
price_bears = bears * 4.1
price_minions = minions * 8.2
pric... | [] |
citrix-openstack-build/ironic | ironic/tests/api/utils.py | 4b9eed0aeba44739caa742a48b55d824eae8ec55 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# -*- encoding: utf-8 -*-
#
# 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
#
# Un... | [((60, 13, 60, 36), 'datetime.datetime.now', 'datetime.datetime.now', ({}, {}), '()', False, 'import datetime\n'), ((60, 39, 60, 68), 'datetime.timedelta', 'datetime.timedelta', (), '', False, 'import datetime\n')] |
thewordisbird/bookshelf | bookshelf/main/forms.py | 5166720bdc0dbffedc14b71b0f75ad78dc69b465 | import datetime
from flask_wtf import FlaskForm
from wtforms import (
StringField,
TextAreaField,
DateTimeField,
HiddenField,
PasswordField,
)
from wtforms.validators import DataRequired, ValidationError, Email, EqualTo
class NullableDateTimeField(DateTimeField):
"""Modify DateField to allow f... | [((36, 19, 36, 42), 'wtforms.StringField', 'StringField', ({(36, 31, 36, 41): '"""Headline"""'}, {}), "('Headline')", False, 'from wtforms import StringField, TextAreaField, DateTimeField, HiddenField, PasswordField\n'), ((37, 21, 37, 44), 'wtforms.TextAreaField', 'TextAreaField', ({(37, 35, 37, 43): '"""Review"""'}, {... |
DanielM24/Romanian-sub-dialect-identificator | main.py | 78b3e00f8ee768eb0b1e8cf832a2dc0b8504b04d | # -*- coding: utf-8 -*-
"""Proiect.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1TR1Frf0EX4PtFZkLlVdGtMTINqhoQwRw
"""
# Importarea librariilor
import numpy as np
import pandas as pd # pandas pentru citirea fisierelor
from sklearn import prepr... | [((20, 15, 20, 86), 'pandas.read_csv', 'pd.read_csv', (), '', True, 'import pandas as pd\n'), ((24, 16, 24, 88), 'pandas.read_csv', 'pd.read_csv', (), '', True, 'import pandas as pd\n'), ((28, 21, 28, 98), 'pandas.read_csv', 'pd.read_csv', (), '', True, 'import pandas as pd\n'), ((32, 20, 32, 96), 'pandas.read_csv', 'p... |
remmyzen/nqs-tensorflow2 | logger/__init__.py | 2af5d5ebb108eac4d2daa5082bdef11c8107bd1b | from .logger import Logger
from .logger_supervised import LoggerSupervised
| [] |
milton0825/flytekit | flytekit/core/workflow.py | 7667a154402d7c02e25006bd6cce926917382a1e | from __future__ import annotations
import collections
import inspect
from dataclasses import dataclass
from enum import Enum
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
from flytekit.common import constants as _common_constants
from flytekit.common.exceptions.user import FlyteValidation... | [((48, 20, 54, 1), 'flytekit.core.node.Node', 'Node', (), '', False, 'from flytekit.core.node import Node\n'), ((141, 10, 141, 64), 'flytekit.common.exceptions.user.FlyteValidationException', 'FlyteValidationException', ({(141, 35, 141, 63): '"""Binding type unrecognized."""'}, {}), "('Binding type unrecognized.')", Fa... |
madhukarkm/NeMo | nemo/collections/asr/parts/numba/rnnt_loss/rnnt_numpy.py | 648c97f076147684bee6aaada209f2f20adcaf5d | # Copyright (c) 2021, NVIDIA CORPORATION. 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... | [((78, 12, 78, 30), 'torch.max', 'torch.max', ({(78, 22, 78, 29): 'lengths'}, {}), '(lengths)', False, 'import torch\n'), ((79, 12, 79, 36), 'torch.max', 'torch.max', ({(79, 22, 79, 35): 'label_lengths'}, {}), '(label_lengths)', False, 'import torch\n'), ((107, 13, 107, 40), 'numpy.zeros', 'np.zeros', (), '', True, 'im... |
joeloskarsson/CGAN-regression | dataset_specifications/swirls.py | 1cbcced10d28c11df8500373fc625e5df493f21d | import numpy as np
import math
from dataset_specifications.dataset import Dataset
class SwirlsSet(Dataset):
def __init__(self):
super().__init__()
self.name = "swirls"
self.n_samples = {
"train": 2000,
"val": 1000,
"test": 1000,
}
self.... | [((23, 21, 23, 49), 'numpy.random.randint', 'np.random.randint', (), '', True, 'import numpy as np\n'), ((27, 16, 27, 37), 'numpy.random.randn', 'np.random.randn', ({(27, 32, 27, 33): 'n', (27, 35, 27, 36): '2'}, {}), '(n, 2)', True, 'import numpy as np\n'), ((34, 13, 34, 59), 'numpy.random.uniform', 'np.random.uniform... |
AndreasKaratzas/stonne | pytorch-frontend/tools/code_coverage/oss_coverage.py | 2915fcc46cc94196303d81abbd1d79a56d6dd4a9 | #!/usr/bin/env python
import time
from package.oss.cov_json import get_json_report
from package.oss.init import initialization
from package.tool.summarize_jsons import summarize_jsons
from package.util.setting import TestPlatform
def report_coverage() -> None:
start_time = time.time()
(options, test_list, in... | [((11, 17, 11, 28), 'time.time', 'time.time', ({}, {}), '()', False, 'import time\n'), ((12, 47, 12, 63), 'package.oss.init.initialization', 'initialization', ({}, {}), '()', False, 'from package.oss.init import initialization\n'), ((14, 4, 14, 39), 'package.oss.cov_json.get_json_report', 'get_json_report', ({(14, 20, ... |
dscohen75/twitoff | twitoff/predict.py | 62d5702e989a6b5fc54aaf9326e240dd63c9fd06 | import numpy as np
from sklearn.linear_model import LogisticRegression
from .models import User
from .twitter import vectorize_tweet
def predict_user(user1_name, user2_name, tweet_text):
"""
Determine and return which user is more likely to say a given Tweet.
Example: predict_user('ausen', 'elonmusk'... | [((16, 17, 16, 65), 'numpy.array', 'np.array', ({(16, 26, 16, 64): '[tweet.vect for tweet in user1.tweets]'}, {}), '([tweet.vect for tweet in user1.tweets])', True, 'import numpy as np\n'), ((17, 17, 17, 65), 'numpy.array', 'np.array', ({(17, 26, 17, 64): '[tweet.vect for tweet in user2.tweets]'}, {}), '([tweet.vect fo... |
emanuelfeld/groupthink | groupthink/version.py | d8a6f666080352d396b07096cbd6304391f7c38d | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of groupthink.
# https://github.com/emanuelfeld/groupthink
# This project is in the public domain within the United States.
# Additionally, the Government of the District of Columbia waives
# copyright and related rights in the work worldwide through t... | [] |
George-Polya/st-gcn | feeder/feeder_ucf.py | e3209796d6de160161063e4c93a00c62b35d3591 | # sys
import os
import sys
import numpy as np
import random
import pickle
import json
# torch
import torch
import torch.nn as nn
from torchvision import datasets, transforms
# operation
from . import tools
class Feeder_UCF(torch.utils.data.Dataset):
""" Feeder for skeleton-based action recognition in kinetics-sk... | [((60, 27, 60, 53), 'os.listdir', 'os.listdir', ({(60, 38, 60, 52): 'self.data_path'}, {}), '(self.data_path)', False, 'import os\n'), ((72, 21, 73, 64), 'numpy.array', 'np.array', ({(73, 12, 73, 63): "[label_info[id]['label_index'] for id in sample_id]"}, {}), "([label_info[id]['label_index'] for id in sample_id])", T... |
Visualway/Vitary | apps/core/migrations/0001_initial.py | c7db9a25837fa7390b2177b9db48e73c6f1ab3c8 | # Generated by Django 4.0.2 on 2022-03-02 03:29
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('vit'... | [((13, 8, 13, 65), 'django.db.migrations.swappable_dependency', 'migrations.swappable_dependency', ({(13, 40, 13, 64): 'settings.AUTH_USER_MODEL'}, {}), '(settings.AUTH_USER_MODEL)', False, 'from django.db import migrations, models\n'), ((21, 23, 21, 115), 'django.db.models.BigAutoField', 'models.BigAutoField', (), '',... |
epiphany-platform/cdl-temporary | tests/common/schema_registry.py | daa704f379c05d7b733c382058ff88a2549d33d7 | import os
import subprocess
import time
import grpc
import tests.rpc.proto.schema_registry_pb2 as pb2
import tests.rpc.proto.schema_registry_pb2_grpc as pb2_grpc
from tests.common.postgres import PostgresConfig
EXE = os.getenv('SCHEMA_REGISTRY_EXE') or 'schema-registry'
class SchemaRegistry:
def __init__(self,
... | [((10, 6, 10, 38), 'os.getenv', 'os.getenv', ({(10, 16, 10, 37): '"""SCHEMA_REGISTRY_EXE"""'}, {}), "('SCHEMA_REGISTRY_EXE')", False, 'import os\n'), ((44, 19, 44, 51), 'subprocess.Popen', 'subprocess.Popen', (), '', False, 'import subprocess\n'), ((45, 8, 45, 21), 'time.sleep', 'time.sleep', ({(45, 19, 45, 20): '(3)'}... |
dlaso99/3scale-tests | testsuite/tests/apicast/policy/routing/test_routing_policy_catch_all.py | b31a3b3596af6d632b393e383c0417ea56bd95ca | """
When a routing policy is set with an empty condition, it should be loaded correctly and should route all
the requests to a correct backend.
"""
from urllib.parse import urlparse
import pytest
from packaging.version import Version # noqa # pylint: disable=unused-import
from testsuite import TESTED_VERSION, rawobj ... | [((17, 1, 17, 31), 'pytest.fixture', 'pytest.fixture', (), '', False, 'import pytest\n'), ((25, 1, 25, 31), 'pytest.fixture', 'pytest.fixture', (), '', False, 'import pytest\n'), ((13, 4, 13, 58), 'pytest.mark.skipif', 'pytest.mark.skipif', ({(13, 23, 13, 57): '"""TESTED_VERSION < Version(\'2.11\')"""'}, {}), '("TESTED... |
vmturbo/ceilometer | ceilometer/data_processing/notifications.py | f856d3c915b738a64bce14967ba8114fe923c1af | # Copyright (c) 2014 Mirantis 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... | [((30, 0, 30, 28), 'oslo.config.cfg.CONF.register_opts', 'cfg.CONF.register_opts', ({(30, 23, 30, 27): 'OPTS'}, {}), '(OPTS)', False, 'from oslo.config import cfg\n'), ((25, 4, 27, 71), 'oslo.config.cfg.StrOpt', 'cfg.StrOpt', (), '', False, 'from oslo.config import cfg\n'), ((63, 14, 71, 28), 'ceilometer.sample.Sample.... |
JalajaTR/cQube | tests/src/Diksha_Reports/usage_by_textbook/download_all_collection_records.py | 6bf58ab25f0c36709630987ab730bbd5d9192c03 | import os
import time
from selenium.webdriver.support.select import Select
from Data.parameters import Data
from get_dir import pwd
from reuse_func import GetData
class All_records_download():
def __init__(self,driver):
self.driver = driver
self.filename =''
def test_download_csv(self):
... | [((17, 20, 17, 29), 'reuse_func.GetData', 'GetData', ({}, {}), '()', False, 'from reuse_func import GetData\n'), ((18, 17, 18, 22), 'get_dir.pwd', 'pwd', ({}, {}), '()', False, 'from get_dir import pwd\n'), ((25, 8, 25, 21), 'time.sleep', 'time.sleep', ({(25, 19, 25, 20): '(4)'}, {}), '(4)', False, 'import time\n'), ((... |
Naysabots/yt-dlp | yt_dlp/cookies.py | bef4697a6a4c225d010125d6ff6dfbfd4fb76e33 | import contextlib
import ctypes
import json
import os
import shutil
import struct
import subprocess
import sys
import tempfile
from datetime import datetime, timedelta, timezone
from enum import Enum, auto
from hashlib import pbkdf2_hmac
from .aes import (
aes_cbc_decrypt_bytes,
aes_gcm_decrypt_and_verify_byte... | [((487, 19, 487, 80), 'os.path.expanduser', 'os.path.expanduser', ({(487, 38, 487, 79): '"""~/Library/Cookies/Cookies.binarycookies"""'}, {}), "('~/Library/Cookies/Cookies.binarycookies')", False, 'import os\n'), ((654, 12, 654, 18), 'enum.auto', 'auto', ({}, {}), '()', False, 'from enum import Enum, auto\n'), ((655, 1... |
jaraco/hgtools | hgtools/tests/conftest.py | 1090d139e5dbdab864da8f1917a9e674331b6f9b | import os
import pytest
from hgtools import managers
def _ensure_present(mgr):
try:
mgr.version()
except Exception:
pytest.skip()
@pytest.fixture
def tmpdir_as_cwd(tmpdir):
with tmpdir.as_cwd():
yield tmpdir
@pytest.fixture
def hg_repo(tmpdir_as_cwd):
mgr = managers.Mercu... | [((23, 10, 23, 37), 'hgtools.managers.MercurialManager', 'managers.MercurialManager', ({}, {}), '()', False, 'from hgtools import managers\n'), ((26, 4, 26, 22), 'os.makedirs', 'os.makedirs', ({(26, 16, 26, 21): '"""bar"""'}, {}), "('bar')", False, 'import os\n'), ((38, 10, 38, 31), 'hgtools.managers.GitManager', 'mana... |
handsome3163/H2Dgame-Firefly | gfirefly/dbentrust/dbutils.py | 2d213928977dc490909f456327e5cae80998e60d | #coding:utf8
'''
Created on 2013-8-21
@author: lan (www.9miao.com)
'''
import itertools
import datetime
def safeunicode(obj, encoding='utf-8'):
r"""
Converts any given object to unicode string.
>>> safeunicode('hello')
u'hello'
>>> safeunicode(2)
u'2'
>>> safeunic... | [] |
tysonclugg/dddppp | dddppp/settings.py | 22f52d671ca71c2df8d6ac566a1626e5f05b3159 | """
Django settings for dddppp project.
Generated by 'django-admin startproject' using Django 1.8.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths... | [((147, 14, 147, 46), 'os.path.join', 'os.path.join', ({(147, 27, 147, 35): 'BASE_DIR', (147, 37, 147, 45): '"""static"""'}, {}), "(BASE_DIR, 'static')", False, 'import os\n'), ((38, 43, 38, 68), 'os.path.abspath', 'os.path.abspath', ({(38, 59, 38, 67): '__file__'}, {}), '(__file__)', False, 'import os\n'), ((74, 8, 74... |
dantas/wifi | setup.py | e9cd6df7d3411f1532843999f6c33f45369c3fe4 | #!/usr/bin/env python
from setuptools import setup
import os
__doc__ = """
Command line tool and library wrappers around iwlist and
/etc/network/interfaces.
"""
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
install_requires = [
'setuptools',
'pbkdf2',
]
try:
im... | [((12, 29, 12, 54), 'os.path.dirname', 'os.path.dirname', ({(12, 45, 12, 53): '__file__'}, {}), '(__file__)', False, 'import os\n')] |
severinbeauvais/sbc-auth | auth-api/src/auth_api/resources/org_products.py | c98f75ea8970a357c62093b6e9f7deab61ae87c5 | # Copyright © 2019 Province of British Columbia
#
# 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 agr... | [((30, 6, 30, 76), 'flask_restplus.Namespace', 'Namespace', (), '', False, 'from flask_restplus import Namespace, Resource, cors\n'), ((31, 9, 31, 30), 'auth_api.tracer.Tracer.get_instance', 'Tracer.get_instance', ({}, {}), '()', False, 'from auth_api.tracer import Tracer\n'), ((32, 7, 32, 32), 'auth_api.jwt_wrapper.JW... |
nicole331/TWLight | TWLight/applications/management/commands/send_coordinator_reminders.py | fab9002e76868f8a2ef36f9279c777de34243b2c | import logging
from collections import Counter
from django.core.management.base import BaseCommand
from django.db.models import Q
from TWLight.applications.models import Application
from TWLight.resources.models import Partner
from TWLight.applications.signals import Reminder
from TWLight.users.models import Editor
l... | [((11, 9, 11, 36), 'logging.getLogger', 'logging.getLogger', ({(11, 27, 11, 35): '__name__'}, {}), '(__name__)', False, 'import logging\n'), ((71, 25, 71, 62), 'TWLight.users.models.Editor.objects.get', 'Editor.objects.get', (), '', False, 'from TWLight.users.models import Editor\n'), ((79, 16, 85, 17), 'TWLight.applic... |
rapattack88/mcclanahoochie | python/3D-rrt/pvtrace/LightSources.py | 6df72553ba954b52e949a6847a213b22f9e90157 | # pvtrace is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# pvtrace is distributed in the hope that it will be useful,
# but WITHOUT... | [((35, 11, 35, 28), 'numpy.array', 'np.array', ({(35, 20, 35, 27): '[x, y, z]'}, {}), '([x, y, z])', True, 'import numpy as np\n'), ((32, 12, 32, 26), 'numpy.sqrt', 'np.sqrt', ({(32, 20, 32, 25): '(1 - s)'}, {}), '(1 - s)', True, 'import numpy as np\n'), ((51, 17, 51, 25), 'Trace.Photon', 'Photon', ({}, {}), '()', Fals... |
nthparty/circuitry | circuitry/circuitry.py | e8bc8bde93cf5056368a14a21086f18f1bcd934f | """Embedded DSL for assembling logic circuits.
Embedded domain-specific combinator library for
assembling abstract definitions of logic circuits
and synthesizing circuits from those definitions.
"""
from __future__ import annotations
from typing import Sequence
import doctest
from parts import parts
from circuit impo... | [((1135, 4, 1135, 21), 'doctest.testmod', 'doctest.testmod', ({}, {}), '()', False, 'import doctest\n'), ((1121, 20, 1121, 29), 'circuit.circuit', 'circuit', ({}, {}), '()', False, 'from circuit import op, gate, circuit, signature\n'), ((1061, 29, 1061, 54), 'parts.parts', 'parts', (), '', False, 'from parts import par... |
KanayBhandari/discord_bot_project | plot_user_activity.py | 4baa62c963c532b08060689bed872e36e72460f9 | import discord
import random
from datetime import datetime
import pandas as pd
import matplotlib.pyplot as plt
import csv
async def plot_user_activity(client, ctx):
plt.style.use('fivethirtyeight')
df = pd.read_csv('innovators.csv', encoding= 'unicode_escape')
author = df['author'].to_list()
... | [((10, 4, 10, 36), 'matplotlib.pyplot.style.use', 'plt.style.use', ({(10, 18, 10, 35): '"""fivethirtyeight"""'}, {}), "('fivethirtyeight')", True, 'import matplotlib.pyplot as plt\n'), ((11, 9, 11, 66), 'pandas.read_csv', 'pd.read_csv', (), '', True, 'import pandas as pd\n'), ((29, 4, 29, 77), 'matplotlib.pyplot.plot',... |
skojaku/fastnode2vec | setup.py | bb65f68469f00f489fa6744d35b8756200b4e285 | #!/usr/bin/env python3
import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="fastnode2vec",
version="0.0.5",
author="Louis Abraham",
license="MIT",
author_email="louis.abraham@yahoo.fr",
description="Fast ... | [((8, 29, 8, 54), 'os.path.dirname', 'os.path.dirname', ({(8, 45, 8, 53): '__file__'}, {}), '(__file__)', False, 'import os\n')] |
nhattvm11/flask-restful-boilerplate | app/main/config.py | a450c03c1b1db2886b4e00b2c30284a59d9b91e6 | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = os.getenv('SECRET_KEY', '')
DEBUG = False
class DevelopmentConfig(Config):
DEBUG = True
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'flask_main.db')
SQLALCHEMY_TRACK_MODIFICATIONS = False... | [((3, 26, 3, 51), 'os.path.dirname', 'os.path.dirname', ({(3, 42, 3, 50): '__file__'}, {}), '(__file__)', False, 'import os\n'), ((6, 17, 6, 44), 'os.getenv', 'os.getenv', ({(6, 27, 6, 39): '"""SECRET_KEY"""', (6, 41, 6, 43): '""""""'}, {}), "('SECRET_KEY', '')", False, 'import os\n'), ((12, 45, 12, 83), 'os.path.join'... |
djouani/Learning-Ansible-2.X-Third-Edition | Chapter07/library/check_user_py3.py | 34d6745c2bde8367ad2db7c9343bc8477b0643d7 | #!/usr/bin/env python
import pwd
from ansible.module_utils.basic import AnsibleModule
class User:
def __init__(self, user):
self.user = user
# Check if user exists
def check_if_user_exists(self):
try:
user = pwd.getpwnam(self.user)
success = True
ret_ms... | [((13, 19, 13, 42), 'pwd.getpwnam', 'pwd.getpwnam', ({(13, 32, 13, 41): 'self.user'}, {}), '(self.user)', False, 'import pwd\n')] |
GenomicsNX/cellxgene | backend/server/converters/schema/ontology.py | f9c744327a3be48c93b47bba71a480e1eeb97835 | """Methods for working with ontologies and the OLS."""
from urllib.parse import quote_plus
import requests
OLS_API_ROOT = "http://www.ebi.ac.uk/ols/api"
# Curie means something like CL:0000001
def _ontology_name(curie):
"""Get the name of the ontology from the curie, CL or UBERON for example."""
return cur... | [((56, 15, 56, 32), 'requests.get', 'requests.get', ({(56, 28, 56, 31): 'url'}, {}), '(url)', False, 'import requests\n'), ((79, 15, 79, 32), 'requests.get', 'requests.get', ({(79, 28, 79, 31): 'url'}, {}), '(url)', False, 'import requests\n'), ((23, 22, 23, 37), 'urllib.parse.quote_plus', 'quote_plus', ({(23, 33, 23, ... |
djaodjin/djaodjin-survey | survey/api/matrix.py | a6eb8a577fecd219850478c245d9ebe990438a64 | # Copyright (c) 2020, DjaoDjin inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... | [((44, 9, 44, 36), 'logging.getLogger', 'logging.getLogger', ({(44, 27, 44, 35): '__name__'}, {}), '(__name__)', False, 'import logging, re\n'), ((203, 15, 203, 52), 're.match', 're.match', ({(203, 24, 203, 38): '"""(\\\\S+)(-\\\\d+)"""', (203, 40, 203, 51): 'cohort_slug'}, {}), "('(\\\\S+)(-\\\\d+)', cohort_slug)", Fa... |
iFishy/DomainApp | remove_labels.py | 970ee96450859b1c40a86a9d654beb99c56aa00f | from __future__ import print_function
import httplib2
import os
import sys
import pickle
from apiclient import discovery
from apiclient import errors
from oauth2client import client
from oauth2client import tools
from oauth2client.file import Storage
try:
import argparse
flags = argparse.ArgumentParser(parents... | [((35, 14, 35, 37), 'os.path.expanduser', 'os.path.expanduser', ({(35, 33, 35, 36): '"""~"""'}, {}), "('~')", False, 'import os\n'), ((36, 20, 36, 58), 'os.path.join', 'os.path.join', ({(36, 33, 36, 41): 'home_dir', (36, 43, 36, 57): '""".credentials"""'}, {}), "(home_dir, '.credentials')", False, 'import os\n'), ((39,... |
danielmarostica/pygadgetreader | readgadget/modules/rs_structs.py | 977949da7fcb6585f3e0270019d369c6967b317c | import numpy as np
import sys
## ROCKSTAR ##
halostruct1 = np.dtype([('id',np.int64),
('pos',np.float32,(6,)),
('corevel',np.float32,(3,)),
('bulkvel',np.float32,(3,)),
('m',np.float32),
('r',np.floa... | [((5, 14, 46, 22), 'numpy.dtype', 'np.dtype', ({(5, 23, 46, 21): "[('id', np.int64), ('pos', np.float32, (6,)), ('corevel', np.float32, (3,)),\n ('bulkvel', np.float32, (3,)), ('m', np.float32), ('r', np.float32), (\n 'child_r', np.float32), ('vmax_r', np.float32), ('mgrav', np.float32),\n ('vmax', np.float32)... |
entropia/ics2entropiawiki | ics2entropiawiki.py | d77fa8073c2b18eade1c2b85feaccab8b6598c6b | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""ics2entropiawiki
Read an ics file with the entropia events and insert them in to the
entropia homepage wiki.
Example:
$ ics2entropiawiki.py --config /etc/ics2entropiawiki/config.ini
Inserts events not in the past to the "Termine" Wiki page and appends past
... | [((60, 4, 60, 49), 'locale.setlocale', 'locale.setlocale', ({(60, 21, 60, 34): 'locale.LC_ALL', (60, 36, 60, 48): '"""de_DE.utf8"""'}, {}), "(locale.LC_ALL, 'de_DE.utf8')", False, 'import locale\n'), ((205, 11, 205, 40), 'mwclient.Site', 'Site', (), '', False, 'from mwclient import Site\n'), ((249, 13, 249, 29), 'argpa... |
anand722000/algo_ds_101 | Arrays/LeftRotation.py | b3e25ce2b2e47e53024f8d349232b04de2837ce3 | #!/bin/python3
import math
import os
import random
import re
import sys
# Complete the rotLeft function below.
def rotLeft(a, d):
alist = list(a)
b = alist[d:]+alist[:d]
return b
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
nd = input().split()
n... | [] |
SaizhuoWang/carefree-learn | tests/unittests/test_zoo.py | 3bf7b00286cdef556cc00fa2fcba5c390b5b9d20 | import os
import cflearn
import platform
import unittest
from cfdata.tabular import TabularDataset
num_jobs = 0 if platform.system() == "Linux" else 2
logging_folder = "__test_zoo__"
class TestZoo(unittest.TestCase):
@staticmethod
def _test_zoo_core(model: str) -> None:
x, y = TabularDataset.iris().... | [((33, 4, 33, 19), 'unittest.main', 'unittest.main', ({}, {}), '()', False, 'import unittest\n'), ((8, 16, 8, 33), 'platform.system', 'platform.system', ({}, {}), '()', False, 'import platform\n'), ((16, 21, 16, 65), 'os.path.join', 'os.path.join', ({(16, 34, 16, 48): 'logging_folder', (16, 50, 16, 64): 'f"""__{model}_... |
duliodenis/python_master_degree | unit_13/26-Data_Structures/4_Merge_Sort_and_Linked_Lists/3_linked_list_merge_sort.py | 3ab76838ce2fc1606f28e988a3273dd27122a621 | #
# Data Structures: Linked List Merge Sort: The Conquer Step
# Python Techdegree
#
# Created by Dulio Denis on 3/24/19.
# Copyright (c) 2019 ddApps. All rights reserved.
# ------------------------------------------------
from linked_list import Node, LinkedList
def merge_sort(linked_list):
'''
Sorts a lin... | [((109, 4, 109, 16), 'linked_list.LinkedList', 'LinkedList', ({}, {}), '()', False, 'from linked_list import Node, LinkedList\n'), ((58, 13, 58, 25), 'linked_list.LinkedList', 'LinkedList', ({}, {}), '()', False, 'from linked_list import Node, LinkedList\n'), ((45, 21, 45, 33), 'linked_list.LinkedList', 'LinkedList', (... |
samyoo78/NearPy | nearpy/examples/example2.py | 1b534b864d320d875508e95cd2b76b6d8c07a90b | # -*- coding: utf-8 -*-
# Copyright (c) 2013 Ole Krause-Sparmann
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy,... | [((44, 9, 44, 20), 'time.time', 'time.time', ({}, {}), '()', False, 'import time\n'), ((47, 19, 47, 45), 'nearpy.hashes.HashPermutations', 'HashPermutations', ({(47, 36, 47, 44): '"""permut"""'}, {}), "('permut')", False, 'from nearpy.hashes import RandomBinaryProjections, HashPermutations, HashPermutationMapper\n'), (... |
8ka1alu/heroku-global-py | discordbot.py | 7968ff6c215d6d86149221c246b4aaa5cd04df59 | from discord.ext import commands, tasks # Bot Commands Frameworkをインポート
import traceback # エラー表示のためにインポート
import os
import discord
import r
TOKEN = os.environ['DISCORD_BOT_TOKEN']
prefix = os.environ['DISCORD_BOT_PREFIX'] #プレフィックス
# 読み込むコグの名前を格納しておく。
INITIAL_EXTENSIONS = [
'cogs.eval',
'cogs.glchat',
'cogs... | [((41, 13, 41, 24), 'r.connect', 'r.connect', ({}, {}), '()', False, 'import r\n'), ((31, 16, 31, 37), 'traceback.print_exc', 'traceback.print_exc', ({}, {}), '()', False, 'import traceback\n'), ((40, 71, 40, 128), 'discord.Game', 'discord.Game', (), '', False, 'import discord\n')] |
ealopez/pycroscopy | examples/plot_spectral_unmixing.py | 9f7c0543b67eaa0668296295fc5f492360c130a0 | """
=================================================================
Spectral Unmixing
=================================================================
Suhas Somnath, Rama K. Vasudevan, Stephen Jesse
* Institute for Functional Imaging of Materials
* Center for Nanophase Materials Sciences
Oak Ridge National Labora... | [((84, 17, 84, 61), 'wget.download', 'wget.download', (), '', False, 'import wget\n'), ((86, 10, 86, 46), 'h5py.File', 'h5py.File', (), '', False, 'import h5py\n'), ((90, 0, 90, 32), 'pycroscopy.hdf_utils.print_tree', 'px.hdf_utils.print_tree', ({(90, 24, 90, 31): 'h5_file'}, {}), '(h5_file)', True, 'import pycroscopy ... |
foliant-docs/foliantcontrib.downloadfile | test/test_downloadfile.py | 1af9481f9bc9142d8b1ac1eff93fa0c5577ccaec | import shutil
from pathlib import Path
from unittest import TestCase
from unittest.mock import Mock
from unittest.mock import patch
from foliant.config.downloadfile import download_file
from foliant.config.downloadfile import get_file_ext_from_url
from foliant.config.downloadfile import get_file_name_from_url
class... | [((21, 5, 21, 64), 'unittest.mock.patch', 'patch', (), '', False, 'from unittest.mock import patch\n'), ((39, 5, 39, 64), 'unittest.mock.patch', 'patch', (), '', False, 'from unittest.mock import patch\n'), ((58, 5, 58, 64), 'unittest.mock.patch', 'patch', (), '', False, 'from unittest.mock import patch\n'), ((19, 8, 1... |
Lilium765/momoko | question.py | c84b37cbe280055fedaac4ee9195d6410b234aba | import discord
client = discord.Client() # 接続に使用するオブジェクト
# 起動時
@client.event
async def on_ready():
print('ログイン成功')
# メッセージを監視
@client.event
async def on_message(message):
# 「/box」が頭についたメッセージならオウム返しする
if message.content.startswith('/box'):
# 文字から「/box」を抜く
question = message.content[len(... | [((3, 9, 3, 25), 'discord.Client', 'discord.Client', ({}, {}), '()', False, 'import discord\n')] |
DavisWeaver/fears | figure_code/rate_of_change_tc.py | 857cb959a3a111a41df4cf62c4c6a19d3abd33c0 | import matplotlib.pyplot as plt
import numpy as np
from fears.utils import results_manager, plotter, dir_manager
import os
suffix = '07212021_0001'
data_folder = 'results_' + suffix
exp_info_file = 'experiment_info_' + suffix + '.p'
exp_folders,exp_info = results_manager.get_experiment_results(data_folder,
... | [((10, 23, 11, 75), 'fears.utils.results_manager.get_experiment_results', 'results_manager.get_experiment_results', ({(10, 62, 10, 73): 'data_folder', (11, 61, 11, 74): 'exp_info_file'}, {}), '(data_folder, exp_info_file)', False, 'from fears.utils import results_manager, plotter, dir_manager\n'), ((17, 8, 17, 22), 'nu... |
microvm/pypy-mu | rpython/annotator/annrpython.py | 6b03fbe93052d0eb3a4c67152c987c16837b3484 | from __future__ import absolute_import
import types
from collections import defaultdict
from rpython.tool.ansi_print import AnsiLogger
from rpython.tool.pairtype import pair
from rpython.tool.error import (format_blocked_annotation_error,
gather_error, source_lines)
from rpython.flowspace... | [((18, 6, 18, 30), 'rpython.tool.ansi_print.AnsiLogger', 'AnsiLogger', ({(18, 17, 18, 29): '"""annrpython"""'}, {}), "('annrpython')", False, 'from rpython.tool.ansi_print import AnsiLogger\n'), ((74, 17, 74, 34), 'rpython.annotator.policy.AnnotatorPolicy', 'AnnotatorPolicy', ({}, {}), '()', False, 'from rpython.annota... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.