seq_id string | text string | repo_name string | sub_path string | file_name string | file_ext string | file_size_in_byte int64 | program_lang string | lang string | doc_type string | stars int64 | dataset string | pt string | api list |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2946357970 | import heapq,copy,collections
from typing import List,Optional
from collections import deque
class ListNode:
def __init__(self, val = 0, next = None):
self.val = val
self.next = next
class Solution:
#排序链表:给你链表的头结点 head ,请将其按 升序 排列并返回 排序后的链表 。
def sortList(self, head: Optional[ListNode]) -... | gpj10054211/guoDeveloper | listnode.py | listnode.py | py | 3,590 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.Optional",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 46,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
... |
30148633270 | import logging
import time
from datetime import datetime
import pytz
from flask import Flask
from flask import json
from github import Github
import commands
import envvariables
from sendToRegression import bucket, administrative_issue, close
logging.basicConfig(level=logging.INFO)
logger = logging.get... | peterkungl/bucketservice | FlaskRest.py | FlaskRest.py | py | 1,635 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.basicConfig",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "logging.FileH... |
4999987358 | import asyncio
import json
import random
import re
import requests
from discord import Intents
from discord import Colour
from discord import Embed
from discord.ext import commands
from discord.utils import get
from environment_variables import (
DISCORD,
REDDIT,
OPTION_FLAGS
)
from links import (
hu... | Haskili/Thanatos | main.py | main.py | py | 17,397 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "discord.ext.commands.Bot",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "discord.ext.commands",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "discord.Intents.all",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "dis... |
40795182425 | import asyncio
from concurrent.futures import ThreadPoolExecutor
import nest_asyncio
from discord import Message, File
from ImageGenerator import ImageGenerator
from wiezenlibrary.Game import Game
_executor = ThreadPoolExecutor(10)
nest_asyncio.apply()
class DiscordWiezen(Game):
def __init__(self, bot, parent):... | FreekDS/De-Grote-Wiezen-Bot | bot/DiscordWiezen.py | DiscordWiezen.py | py | 1,751 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "concurrent.futures.ThreadPoolExecutor",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "nest_asyncio.apply",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "wiezenlibrary.Game.Game",
"line_number": 13,
"usage_type": "name"
},
{
"... |
20832781197 | from pocket_coffea.utils.configurator import Configurator
from pocket_coffea.lib.cut_definition import Cut
from pocket_coffea.lib.cut_functions import get_nObj_min, get_HLTsel, get_nBtagEq
from pocket_coffea.parameters.cuts import passthrough
from pocket_coffea.parameters.histograms import *
from pocket_coffea.paramete... | ryanm124/AnalysisConfigs | configs/ttHbb/example_config.py | example_config.py | py | 6,758 | python | en | code | null | github-code | 36 | [
{
"api_name": "cloudpickle.register_pickle_by_value",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "cloudpickle.register_pickle_by_value",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 18,
"usage_type": "call"
},
... |
73578590183 | # coding: utf-8
_all_ = [ 'processing', 'processing_outputs' ]
import os
import sys
parent_dir = os.path.abspath(__file__ + 3 * '/..')
sys.path.insert(0, parent_dir)
import inclusion
from inclusion.config import main
from inclusion.utils import utils
from inclusion.condor.job_writer import JobWriter
import re
impor... | bfonta/inclusion | inclusion/condor/processing.py | processing.py | py | 6,926 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.abspath",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "sys.path.insert",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number... |
24778042796 | """
From https://brian2.readthedocs.io/en/stable/resources/tutorials/3-intro-to-brian-simulations.html
An experiment to inject current into a neuron and change the amplitude randomly every 10 ms. Model that using a Hodgkin-Huxley type neuron.
"""
from brian2 import *
import matplotlib.pyplot as plt
start_scope()
# Pa... | seankmartin/NeuroModelling | hodgkin_huxley.py | hodgkin_huxley.py | py | 1,776 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 41,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.axvline",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "... |
16147236974 | from typing import List
from app.movements.base import Special
from app.movements.constants import Attacks
from app.movements.utils import replace_values_string
from app.settings import BASSIC_ATTACK_ENERGY, PLAYER_ENERGY
class Fighter:
def __init__(self, name, specials:List[Special]) -> None:
self.name = ... | FranciscoAczayacatl/GameRPG | app/fighters/fighter.py | fighter.py | py | 1,201 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "app.movements.base.Special",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "app.settings.PLAYER_ENERGY",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "app.m... |
18306677513 | import asyncio
from loguru import logger
from mipa.ext.commands import Bot
from mipac import (
Note,
NotificationFollowRequest,
LiteUser,
ClientManager,
NotificationFollow,
)
from catline.adapters import QueueStorageJSONAdapter, QueueStorageRedisAdapter
from catline.queue import IFQueueStorageAdapte... | TeamBlackCrystal/akari | main.py | main.py | py | 2,637 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "src.config.config.features",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "src.config.config",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "mipac.LiteUser",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "mipa... |
13492120891 | def read_msh(file, flag_plot):
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
#custom functions
from read_gmsh_V1 import read_gmsh
from elarea import elarea
#%% Create a structure for the output and assign
class structtype():
... | aydinu1/UA-fem | fem_util/read_msh.py | read_msh.py | py | 3,122 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "read_gmsh_V1.read_gmsh",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"lin... |
17883182675 | from PySide2.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QSpacerItem, QSizePolicy, QPushButton
from PySide2.QtCore import QSize, QCoreApplication
class PMReportWidget(QWidget):
def __init__(self):
super().__init__()
_translate = QCoreApplication.translate
self.setObjectName("tab_re... | pyminer/pyminer | pyminer/lib/ui/widgets/reportwidget.py | reportwidget.py | py | 1,899 | python | en | code | 77 | github-code | 36 | [
{
"api_name": "PySide2.QtWidgets.QWidget",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "PySide2.QtCore.QCoreApplication.translate",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "PySide2.QtCore.QCoreApplication",
"line_number": 8,
"usage_type": ... |
74796094503 | from flask import Flask, render_template, Response, jsonify, request
import settings
from flask import abort
app = Flask(__name__,
static_url_path='',
static_folder='static',
template_folder='templates')
log = settings.logging
@app.route('/')
def index():
return render_templa... | jarzab3/flask_docker | cq_iot/app.py | app.py | py | 1,346 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "settings.logging",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "flask.render_template",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.jsonify"... |
5049725299 | import configparser
import time
from operator import attrgetter
from pathlib import Path
from typing import Dict, List, Optional, Union
import numpy as np
import torch
import tensorrt_llm
import tensorrt_llm.logger as logger
from tensorrt_llm._utils import pad_vocab_size, str_dtype_to_np
from tensorrt_llm.mapping imp... | NVIDIA/TensorRT-LLM | examples/gptj/weight.py | weight.py | py | 40,329 | python | en | code | 3,328 | github-code | 36 | [
{
"api_name": "typing.Union",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "tensorrt_llm.quantization.Q... |
75076600744 | import os
import time
import json
"""
This Script is used to gather all the data from running all the combinations of inputs to ./main
It will then write the output to a file called "data.txt" which can be processed and changed
into json format using processData.py in the reports file.
"""
data_json = {}
testAmount = ... | DaveR27/Game-of-Life | DataGathering/GatherData.py | GatherData.py | py | 1,945 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.chdir",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.chdir",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 33,
"us... |
36324286850 | import json
import smtplib, ssl
import os
from email.message import EmailMessage
import db_functions
from datetime import datetime
## Helper functions Start
def elicit_slot(session_attributes, intent_name, slots, slot_to_elicit, message):
return {
'sessionAttributes': session_attributes,
'dialog... | anilreddy864/BBot | Lex_Code/lambda_function.py | lambda_function.py | py | 4,994 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.environ",
"line_number": 98,
"usage_type": "attribute"
},
{
"api_name": "email.message.EmailMessage",
"line_number": 115,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 116,
"usage_type": "attribute"
},
{
"api_name": "os.envir... |
14231634112 | #!/usr/bin/env python3
import fire
import logging
import os, sys, traceback
from IsoNet.util.dict2attr import Arg,check_parse,idx2list
from fire import core
from IsoNet.util.metadata import MetaData,Label,Item
class ISONET:
"""
ISONET: Train on tomograms and restore missing-wedge\n
for detail description, ... | IsoNet-cryoET/IsoNet | bin/isonet.py | isonet.py | py | 26,881 | python | en | code | 49 | github-code | 36 | [
{
"api_name": "IsoNet.util.metadata.MetaData",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "IsoNet.util.metadata.Item",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "Is... |
34181491873 | import json
import logging
import traceback
import warnings
from datetime import datetime
from collections import OrderedDict
from typing import Dict, Callable, Optional, Union, List, Any, Type, Sequence
from qiskit.providers.backend import BackendV1 as Backend
from qiskit.providers.provider import ProviderV1 as Provi... | Qiskit/qiskit-ibm-runtime | qiskit_ibm_runtime/qiskit_runtime_service.py | qiskit_runtime_service.py | py | 47,557 | python | en | code | 106 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "qiskit.providers.provider.ProviderV1",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 107,
"usage_type": "name"
},
{
"api_name"... |
42425916848 | import os
from dotenv import load_dotenv
DEFAULT_GUNICORN_WORKERS = 4
DEFAULT_CONFIG_PATH = ".env"
ACCESS_TOKEN_EXPIRE_MINUTES = 30 # 30 minutes
REFRESH_TOKEN_EXPIRE_MINUTES = 60 * 24 * 7 # 7 days
ALGORITHM = "HS256"
load_dotenv(DEFAULT_CONFIG_PATH)
JWT_SECRET_KEY = os.environ["JWT_SECRET_KEY"]
JWT_REFRESH_SECRET... | IslomK/family_budget | family_budget/core/const.py | const.py | py | 364 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
}
] |
12633123289 | #!/usr/bin/env python
# coding: utf-8
# In[3]:
# load libraries
import numpy as np
import scipy.sparse as sp
import cplex as cp
# In[4]:
def mixed_integer_linear_programming(direction, A, senses, b, c, l, u, types):
# create an empty optimization problem
prob = cp.Cplex()
# add decision variables to... | berdogan20/Operations-Research-Problems | TheCoinDistributionProblem/Solution.py | Solution.py | py | 2,514 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "cplex.Cplex",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "numpy.repeat",
"line_number":... |
27177310215 | #region libraries
import cv2
import numpy as np
#endregion
#region process
def process(img_path,template_path): # This Function takes the path and name of basic image and template image
img_bgr = cv2.imread(img_path) # read the image by opencv(cv2)
img_gray = cv2.cvtColor(img_bgr, cv2.COLOR_BGR2GRAY) # convert... | RealTourani/Match-Point | Match_Point.py | Match_Point.py | py | 1,547 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "cv2.imread",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_BGR2GRAY",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_n... |
19262571802 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import absolute_import
from datetime import datetime, timedelta
from pokemongo_bot.base_task import BaseTask
from pokemongo_bot.worker_result import WorkerResult
from pokemongo_bot import inventory
from pokemongo_bot.item_list import Item
... | PokemonGoF/PokemonGo-Bot | pokemongo_bot/cell_workers/heal_pokemon.py | heal_pokemon.py | py | 11,496 | python | en | code | 3,815 | github-code | 36 | [
{
"api_name": "pokemongo_bot.base_task.BaseTask",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pokemongo_bot.worker_result.WorkerResult.SUCCESS",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "pokemongo_bot.worker_result.WorkerResult",
"line_numbe... |
20220878757 | import pathlib
prj_path = str(pathlib.Path(__file__).parent.parent.parent.resolve())
from advent_of_code.lib import parse as aoc_parse
from advent_of_code.lib import aoc
@aoc.pretty_solution(1)
def part1(data):
horizontal = sum(x[1] for x in data if x[0] == 'forward')
depth = sum(
-x[1] if x[0] == 'u... | Perruccio/advent-of-code | advent_of_code/year2021/solutions/day02.py | day02.py | py | 1,006 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pathlib.Path",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "advent_of_code.lib.aoc.pretty_solution",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "advent_of_code.lib.aoc",
"line_number": 8,
"usage_type": "name"
},
{
"api_name"... |
2251372103 | from typing import List
import mlflow
import pandas as pd
import tensorflow as tf
from keras_preprocessing.image import ImageDataGenerator
from zenml.steps import BaseParameters, Output, step
class EvaluateClassifierConfig(BaseParameters):
"""Trainer params"""
input_shape: List[int] = (224, 224, 3)
batc... | thbinder/mlops_sea_animal_classification | src/domain/steps/mlflow_evaluator.py | mlflow_evaluator.py | py | 1,170 | python | en | code | 4 | github-code | 36 | [
{
"api_name": "zenml.steps.BaseParameters",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "tensorflow.keras",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "pandas.D... |
6752387766 | # -*- coding: utf-8 -*-
from PyQt5.QtWidgets import QDialog
from PyQt5.QtGui import QDoubleValidator
from PyQt5.QtCore import pyqtSlot, QDate
from warehouse.views.editregtuff import Ui_Dialog
from supplyer.controllers.supplyercontroller import SupplyerController
from stuff.controllers.stuffcontroller import StuffCon... | zxcvbnmz0x/gmpsystem | warehouse/modules/editregstuffmodule.py | editregstuffmodule.py | py | 10,777 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "PyQt5.QtWidgets.QDialog",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "warehouse.views.editregtuff.Ui_Dialog",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "user.powers",
"line_number": 27,
"usage_type": "attribute"
},
{
"ap... |
18909907329 | from prettytable import PrettyTable
class Database:
def __init__(self, database_name):
import mysql.connector as m1
self.var = "w"
self.conn = m1.connect(host="localhost", user="root", password="utkarsh")
self.cursor = self.conn.cursor()
self.cursor.execute("CREA... | Codineer/shop-management-sytem | database.py | database.py | py | 5,264 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "mysql.connector.connect",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "mysql.connector",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "prettytable.PrettyTable",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "{'m1': ... |
8196850520 | from django.contrib import admin
from .models import User
class UserAdmin(admin.ModelAdmin):
list_display = (
'pk', 'role', 'username', 'email',
'first_name', 'last_name',
)
search_fields = ('username', 'email',)
list_filter = ('email', 'username')
admin.site.register(User, UserAdmi... | lojiver/foodgram-project | backend/foodgram/users/admin.py | admin.py | py | 323 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.contrib.admin.site.register",
"line_number": 15,
"usage_type": "call"
},... |
39479422820 | from django.contrib.auth.models import Group, User
from datetime import datetime
from django.utils import timezone
from schedule.periods import Day
from datetime import timedelta
from apps.policies.models import SchedulePolicyRule
from apps.services.models import Service
"""def get_current_events_users(calendar):
... | openduty/openduty | apps/incidents/escalation_helper.py | escalation_helper.py | py | 4,082 | python | en | code | 121 | github-code | 36 | [
{
"api_name": "django.utils.timezone.now",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "django.utils.timezone",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "schedule.periods.Day",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "... |
15371935865 | from RsSmw import *
import json
try:
with open ("config.json") as config_f:
RsSmw.assert_minimum_version('5.0.44')
config = json.load(config_f)
IP_ADDRESS_GENERATOR = config["IP_ADDRESS_GENERATOR"]
PORT = config["PORT"]
CONNECTION_TYPE = config["CONNECTION_TYPE"]
TRA... | mgarczyk/channel-sounder-5g | generator.py | generator.py | py | 1,625 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "RsSmw.assert_minimum_version",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number": 7,
"usage_type": "call"
}
] |
43284653684 | import setuptools
from pathlib import Path
with open("README.md", "r") as file:
long_description = file.read()
with open("requirements.txt") as file:
REQUIREMENTS = file.read().split("\n")
setuptools.setup(
name="port_env",
version="0.0.3",
author="Moist-Cat",
author_email="moistanonpy@gm... | Moist-Cat/port_env | setup.py | setup.py | py | 898 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "setuptools.setup",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 23,
"usage_type": "call"
}
] |
41310446545 | from nltk import CFG
from nltk import ChartParser # parse_cfg, ChartParser
from random import choice
import re
from enum import Enum, auto
from argparse import ArgumentParser
from os import listdir
from os.path import isfile, join
import os
this_dir = os.path.dirname(os.path.abspath(__file__))
name_segment_... | Mimic-Tools/name-generation | src/name_generation/generate.py | generate.py | py | 12,855 | python | en | code | 12 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line... |
28483046981 | import numpy as np
import cv2
import sys
import argparse
# Creating the parser
ap = argparse.ArgumentParser()
ap.add_argument("-m", "--model", required=True,
help="path to the model used to make the prediction and generate the class activation maps")
# Parsing the arguments
args = vars(ap.parse_args())
from utilitie... | Selim78/real-time-human-detection | webcam_cam.py | webcam_cam.py | py | 2,632 | python | en | code | 3 | github-code | 36 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "utilities.gapModels.MobileNetGAP",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "utilities.classifier.Classifier",
"line_number": 20,
"usage_type": "call"
},
... |
20427901161 | # Written by P. Xydi, Feb 2022
######################################
# Import libraries
######################################
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib.cm as cm
color_1 = cm.get_cmap("Set2")(2) # set blue
color_2 = cm.get_cmap("S... | pxydi/Named-Entity-Recognition | src/tools.py | tools.py | py | 6,287 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.cm.get_cmap",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "matplotlib.cm",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "matplotlib.cm.get_cmap",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotli... |
8228541339 | from models.pointnet import PointNetDenseCls
import torch
import torch.nn as nn
import torch.nn.functional as F
import hydra
import os
from datasets import kpnet
import logging
from itertools import combinations
import numpy as np
from tqdm import tqdm
def pdist(vectors):
distance_matrix = -2 * vectors.mm(torch.t... | qq456cvb/SemanticTransfer | train_emb.py | train_emb.py | py | 6,581 | python | en | code | 11 | github-code | 36 | [
{
"api_name": "torch.t",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "itertools.combinations",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "torch.LongTensor",
"li... |
27433129284 | import sys
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits import mplot3d
import math
class Interpolator:
def __init__(self):
DEFAULT_STEP = 1 # 10 ** 5
self.c = 0.9 # Smoothing factor
self.e = 0.1 # sys.float_info.epsilon # Really small... | TimoLoomets/FSTT_dynamics | interpolator.py | interpolator.py | py | 6,172 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.linalg.norm",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.linalg",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "numpy.subtract",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "math.isnan",
"... |
25107333860 | from Actors.Actor import Actor
from Actors.Maze import Maze
from Actors.Direction import Direction
from Util.Timer import Timer
import pyrr
import math
import numpy
class Pacman(Actor):
# assume position is 2d vector (x cell, z cell)
def __init__(self, position : list, direction : Direction, speed : float... | VolodymyrVakhniuk/Pacman | src/Actors/Pacman.py | Pacman.py | py | 3,050 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "Actors.Actor.Actor",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "Actors.Direction.Direction",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "Util.Timer.Timer",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "Actors.... |
26388489404 | import os
import pickle
import types
import shutil
import time
import multiprocessing as mtp
packageSample={"mode":"join", "from":"id123", "to":["id234", "id789"], "time":"20181012122123","type":"unknown", "tag":["dog", "white"], "dataSet":"image object"}
class cellComm(object):
def __init__(self):
self.p... | babyproject/scripts | learn_python_commA.py | learn_python_commA.py | py | 2,162 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.dirname",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
33040434381 | import asyncio
import dataclasses
import time
from secrets import token_bytes
from typing import Callable, Dict, List, Optional, Tuple, Set
from blspy import AugSchemeMPL, G2Element
from chiabip158 import PyBIP158
import chia.server.ws_connection as ws
from chia.consensus.block_creation import create_unfinished_block... | snight1983/chia-rosechain | chia/full_node/full_node_api.py | full_node_api.py | py | 61,930 | python | en | code | 369 | github-code | 36 | [
{
"api_name": "chia.full_node.full_node.FullNode",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "typing.Callable",
"line_number": 48,
"usage_type": "name"
},
{
"api_name": "chia.protocols.full_node_protocol.RequestPeers",
"line_number": 65,
"usage_type": "attr... |
9037585810 | import tbapy
import pyperclip
event = input("Enter the event key: ")
def getEventMatchTeams(key):
tba = tbapy.TBA('KiFI9IObf1xbtTKuLzSu6clL006qHK1Lh5Xy65i1zSDutDcvsYJWwliU1svWKVzX')
matches = tba.event_matches(key, simple=True)
# set matches to be only keys of red and blue alliances
alliances = []
... | TotsIsTots/573_Scouting_2023 | teamfinder.py | teamfinder.py | py | 1,332 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tbapy.TBA",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pyperclip.copy",
"line_number": 33,
"usage_type": "call"
}
] |
30988523805 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
#关闭提示安全提示框
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("--disable-infobars")
driver = webdriver.Chrome(executable_path="/usr/bin/chromedriver",chrome_options=chrome... | lufeirider/python | crawl/selenium.py | selenium.py | py | 481 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "selenium.webdriver.chrome.options.Options",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 10,
"usage_type": "name"
},
{
... |
44648975893 | #!/usr/bin/env python
# coding: utf-8
from copy import deepcopy
import pandas as pd
import numpy as np
pd.set_option("display.max_colwidth", None)
def run_adult_experiments_trees_taxonomies(
name_output_dir="output",
type_experiment="one_at_time",
type_criterion="divergence_criterion",
min_support_tr... | elianap/h-divexplorer | experiments_adult_trees_taxonomies.py | experiments_adult_trees_taxonomies.py | py | 7,907 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "pandas.set_option",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number... |
650843683 | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
from pymongo import MongoClient
class AqdyPipeline(object):
def process_item(self, item, spider):
xfplay_link = {... | jihongzhu/python- | aqdy/aqdy/pipelines.py | pipelines.py | py | 887 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 21,
"usage_type": "call"
}
] |
74470689064 | import os
import datetime
import glob
import urllib.request
import tqdm
import gzip
import pandas as pd
import re
import utils
import random
from time import gmtime, strftime
from multiprocessing import Process
config = __import__('0_config')
def clean_row(row):
return row.decode('utf-8', 'ignore').strip()
def ... | Diego999/Risk-Analysis-using-Topic-Models-on-Annual-Reports | 1_download_data.py | 1_download_data.py | py | 8,603 | python | en | code | 6 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.path.isdir",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
28915101395 | import copy
from pathlib import Path
from collections import defaultdict
import pandas as pd
import numpy as np
import torch
from torch.utils.data import Dataset
try:
import datasets as hf_datasets
except ImportError:
pass
def get_texts_df(dir_path):
paths = [x for x in dir_path.iterdir() if x.is_file()... | jeffdshen/kaggle-public | feedback/datasets.py | datasets.py | py | 10,868 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.DataFrame",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "datasets.Dataset.from_p... |
18190854190 | from csv import DictReader, DictWriter
from io import StringIO
import functools
import tempfile
import os
# helper to map from column names in the CSV dump to the schema
dumpNameMapping = {
'_id': 'mongo_id',
'admin': 'admin',
'profile.adult': 'adult',
'status.completedProfile': 'completed',
'statu... | compsoc-edinburgh/htb20-voter | app/data.py | data.py | py | 3,307 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "tempfile.TemporaryDirectory",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "csv.DictReader"... |
31690737543 | import json
import os
from typing import TextIO
from ctranslate2.converters.transformers import TransformersConverter
def model_converter(model, model_output):
converter = TransformersConverter("openai/whisper-" + model)
try:
converter.convert(model_output, None, "float16", False)
except Exception... | ahmetoner/whisper-asr-webservice | app/faster_whisper/utils.py | utils.py | py | 3,802 | python | en | code | 1,105 | github-code | 36 | [
{
"api_name": "ctranslate2.converters.transformers.TransformersConverter",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 38,
"usage_type": "attribute"
},
{... |
7537133333 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on Jan 10, 2013
@author: daniel
This utility file provides a method for moving information between Sugar
instances.
'''
from collections import defaultdict
from sugarcrm import Sugarcrm
from code import interact
from sugarcrm.sugarentry import SugarEntry
co... | gddc/python_webservices_library | sugarcrm/utils/S2S.py | S2S.py | py | 2,952 | python | en | code | 46 | github-code | 36 | [
{
"api_name": "collections.defaultdict",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "sugarcrm.Sugarcrm",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "sugarcrm.Sugarcrm",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "sugarcrm.... |
24288441205 | # -*- coding: utf-8 -*-
"""
Created on Tue Mar 15 20:50:05 2022
@author: Yifang
"""
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import traceAnalysis as Ananlysis
import SPADdemod
def getSignalTrace (filename, traceType='Constant',HighFreqRemoval=True,getBinTrace=False,bin_window... | MattNolanLab/SPAD_in_vivo | SPAD_Python/mainAnalysis.py | mainAnalysis.py | py | 8,561 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "traceAnalysis.Read_trace",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "traceAnalysis.butter_filter",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "traceAnalysis.get_bin_trace",
"line_number": 20,
"usage_type": "call"
},
{
"... |
9495049897 | ### Add fixed time effects and controls for infection levels and national lockdown
# Initial imports
import pandas as pd
import statsmodels.api as sm
import numpy as np
from scipy import stats
import statsmodels.formula.api as smf
import seaborn as sns
import matplotlib.pyplot as plt
import seaborn as sns
#Import hou... | rg522/psych_owner | aggregate_model_4.py | aggregate_model_4.py | py | 1,484 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pandas.read_csv",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "statsmodels.formula.api.ols",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "statsmode... |
18370027108 | from flask import Flask, request, render_template
import json
import pickle
import nltk
import string
import re
#from nltk.classify import NaiveBayesClassifier
app = Flask(__name__)
#preprocess the text
def preprocess(sentence):
nltk.download('stopwords')
nltk.download('punkt')
def build_bow_features(wor... | AnasE17/SentimentAnalysis | app.py | app.py | py | 1,434 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords.words",... |
4157086617 | import os
import glob
import imageio.v2 as imageio
from wand.image import Image
import PySimpleGUI as sg
from moviepy.editor import ImageSequenceClip
# Function to create an MP4 movie from images.
def create_mp4(input_folder, output_path, fps):
# Get a sorted list of image paths.
image_paths = sorted... | avyaktam/ImageChef | ImageChef.py | ImageChef.py | py | 7,866 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "os.path.join",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "imageio.v2.imread",
"line_nu... |
37712754399 | from django.shortcuts import render
from custom_model_field_app.forms import PersonForm
# Create your views here.
def customview(request):
form = PersonForm()
if request.method == 'POST':
if form.is_valid():
form.save()
return render(request,'custom.html',{'form':for... | m17pratiksha/django_models | models/custom_model_field_app/views.py | views.py | py | 323 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "custom_model_field_app.forms.PersonForm",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 15,
"usage_type": "call"
}
] |
74853194983 | from langchain.chat_models import ChatVertexAI
from langchain.prompts.chat import (
ChatPromptTemplate,
HumanMessagePromptTemplate,
SystemMessagePromptTemplate,
)
from langchain.schema import HumanMessage, SystemMessage
chat = ChatVertexAI()
messages = [
SystemMessage(content="You are a helpful assist... | GoogleCloudPlatform/solutions-genai-llm-workshop | LAB001-2-ChatModel/0-run.py | 0-run.py | py | 927 | python | en | code | 55 | github-code | 36 | [
{
"api_name": "langchain.chat_models.ChatVertexAI",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "langchain.schema.SystemMessage",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "langchain.schema.HumanMessage",
"line_number": 13,
"usage_type": "call"
... |
42779512033 | from fastexcel import read_excel
from openpyxl import load_workbook
from xlrd import open_workbook
def pyxl_read(test_file_path: str):
wb = load_workbook(test_file_path, read_only=True, keep_links=False, data_only=True)
for ws in wb:
rows = ws.iter_rows()
rows = ws.values
for row in ro... | ToucanToco/fastexcel | python/tests/benchmarks/readers.py | readers.py | py | 787 | python | en | code | 16 | github-code | 36 | [
{
"api_name": "openpyxl.load_workbook",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "xlrd.open_workbook",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "fastexcel.read_excel",
"line_number": 25,
"usage_type": "call"
}
] |
28281049495 | import argparse
import pathlib
import itertools
import sys
import urllib
import docker
import tqdm
from compose import config
version = "0.8.0"
def _resolve_name(args, service):
if args.use_service_image_name_as_filename:
return urllib.parse.quote(service["image"], safe="")
return service["name"]
... | pohmelie/docker-compose-transfer | docker_compose_transfer/__init__.py | __init__.py | py | 3,985 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "urllib.parse.quote",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "urllib.parse",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "itertools.chain.from_it... |
19542054640 | import sys
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
# Change default path
# sys.path.append('PROGMOD_')
# Function for formatting file to array of specific variables
# data = txt file
# sh_index = state history index, i.e. controller or environment
# va... | Andreas691667/P1LeaderElection_Group2 | UML & Graphs/plot.py | plot.py | py | 2,036 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "matpl... |
35398321598 | from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
print_function, unicode_literals)
from pants.backend.core.tasks.check_exclusives import ExclusivesMapping
from pants.backend.jvm.tasks.jvm_task import JvmTask
from pants.base.exceptions import TaskErr... | fakeNetflix/square-repo-pants | tests/python/pants_test/tasks/test_jvm_task.py | test_jvm_task.py | py | 1,897 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "pants.backend.jvm.tasks.jvm_task.JvmTask",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "pants_test.task_test_base.TaskTestBase",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "pants.util.dirutil.safe_mkdtemp",
"line_number": 26,
"usa... |
26469668124 | from ...key import Address
from ...common import Int, concatBytes, _hint
from ...hint import MNFT_COLLECTION_POLICY, MNFT_COLLECTION_REGISTER_FORM, MNFT_MINT_FORM, MNFT_NFT_ID, MNFT_SIGNER, MNFT_SIGNERS
class CollectionRegisterForm:
def __init__(self, target, symbol, name, royalty, uri, whites):
assert ro... | ProtoconNet/mitum-py-util | src/mitumc/operation/nft/base.py | base.py | py | 5,368 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "common._hint",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "hint.MNFT_COLLECTION_REGISTER_FORM",
"line_number": 9,
"usage_type": "argument"
},
{
"api_name": "key.Address",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "common.... |
73885161703 | from PyQt5 import QtCore
from PyQt5.QtCore import QObject, QThreadPool, pyqtSignal
from PyQt5.QtWidgets import QWidget, QScrollArea
from cvstudio.util import GUIUtilities
from cvstudio.view.widgets import ImageButton
from cvstudio.view.widgets.loading_dialog import QLoadingDialog
from cvstudio.view.widgets.response_gr... | haruiz/CvStudio | cvstudio/view/widgets/tab_models.py | tab_models.py | py | 2,168 | python | en | code | 34 | github-code | 36 | [
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.QObject",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtCore.pyqtSignal",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "... |
2028059224 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 24 06:56:45 2018
@author: Javier Alejandro Acevedo Barroso
"""
import numpy as np
import matplotlib.pyplot as plt
x_obs = np.array([-2.0,1.3,0.4,5.0,0.1, -4.7, 3.0, -3.5,-1.1])
y_obs = np.array([ -1.931, 2.38, 1.88, -24.22, 3.31, -21.9, ... | ClarkGuilty/2018 | metodosComputacionales2/JavierAcevedo_Ejercicio6.py | JavierAcevedo_Ejercicio6.py | py | 3,157 | python | es | code | 0 | github-code | 36 | [
{
"api_name": "numpy.array",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.errorbar",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot"... |
20867944972 | import numpy as np
from utils import plot_output
# Defining parameters
N = 500
L = 5 # Topological charge number
A3 = np.zeros((N, N), dtype='complex_')
# Constructing SPP
x = np.array([i for i in range(N)])
y = np.array([i for i in range(N)])
X, Y = np.meshgrid(x, y)
theta = np.arctan2((X - N/2), (Y - N/2))
r = np.... | Diana-Kapralova/Diffractive_Optics_on_Python | 3.Advanced_Diffractive_Optical_Elements/3.Exersise/Ex.3.3.py | Ex.3.3.py | py | 667 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.zeros",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.meshgrid",
"line_number":... |
72639783783 | # https://pypi.org/project/RPi.bme280/
import smbus2
import bme280
import syslog
import threading
def logmsg(level, msg):
syslog.syslog(level, 'station: {}: {}'.format(threading.currentThread().getName(), msg))
def logdbg(msg):
logmsg(syslog.LOG_DEBUG, msg)
def loginf(msg):
logmsg(syslog.LOG_INFO, msg)
... | chkvch/fermentation_station | station.py | station.py | py | 2,558 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "syslog.syslog",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "threading.currentThread",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "syslog.LOG_DEBUG",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "syslog.LOG_... |
4124871021 | import abc
import numpy as np
from nn.utils.label_mapper import LabelMapper
from datetime import datetime
class LearningAlgorithmTypes(object):
SGD = "stochastic gradient descent"
class LearningAlgorithmFactory(object):
@staticmethod
def create_learning_algorithm_from_type(learning_algorithm_type):
... | ADozois/ML_Challenge | nn/models/learning/learning_algorithms.py | learning_algorithms.py | py | 4,743 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "abc.ABCMeta",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "abc.abstractmethod",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "dateti... |
26533716957 | '''
Fig1. Cascade Matrix heatmap
'''
import numpy as np
import matplotlib.pyplot as plt
# from numba import jit
import matplotlib.colors as colors
# @jit(nopython = True)
def random_cascade_matrix(mu_L, mu_U, sigma_L, sigma_U, gamma, N = 250):
J = np.zeros((N, N))
for i in range(N):
for j in rang... | LylePoley/Cascade-Model | Figures/Fig1.py | Fig1.py | py | 2,924 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.zeros",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "numpy.random.normal",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.normal... |
15982937093 | import numpy as np
from matplotlib.pyplot import *
from scipy import interpolate
dat=np.loadtxt("/home/davidvartanyan/presupernova.dat")
rad=dat[:,2]
rho1=dat[:,4]
i=0
while rad[i]/10**9 < 1:
i+=1
xlim([rad[0],rad[i]])
#loglog(rad[0:i],rho1[0:i],'k')
npoints=1000
radmin=rad[0]
radmax=10**9
radius=np.linspace(0.1,
... | dvartany/ay190 | ws12/ws12.py | ws12.py | py | 2,041 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.loadtxt",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "scipy.interpolate.splrep",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "scipy.interpolat... |
8868610859 | import logging
from aiogram import Dispatcher, types
from aiogram.dispatcher import FSMContext
import aiogram.utils.markdown as fmt
from aiogram.types.message import ContentType
from .. import userchoice
def check_none_name(name):
new_name = ''
if name is not None:
new_name = name
return new_nam... | KFeyn/naming_bot | app/handlers/common.py | common.py | py | 2,897 | python | ru | code | 0 | github-code | 36 | [
{
"api_name": "aiogram.types.Message",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "aiogram.types",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "aiogram.dispatcher.FSMContext",
"line_number": 18,
"usage_type": "name"
},
{
"api_name":... |
36289889662 | import os
import os.path
import shutil
import tarfile
import hashlib
import argparse
import fnmatch
import sys
STR_EMPTY = ''
STR_SLASH = '/'
STR_POINT = '.'
STR_TAB = '\t'
STR_EOL = '\n'
STR_CAT_EXT = '.cat'
STR_TAR_EXT = '.tar'
STR_GZ_EXT = '.tar.gz'
STR_BZ2_EXT = '.tar.bz2'
STR_DIR_LIST = 'DIR_LIST'
STR_DIR = 'DIR... | 2e8/siddar | siddar.py | siddar.py | py | 34,249 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "hashlib.sha256",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": ... |
43506783122 | #!/usr/bin/env python3
"""This modual holds the class created for task 3"""
import numpy as np
import matplotlib.pyplot as plt
class Neuron:
"""
Neuron - class for a neuron
nx = the number of input freatures to the neuron
"""
def __init__(self, nx):
if not isinstance(nx, int):
... | chriswill88/holbertonschool-machine_learning | supervised_learning/0x00-binary_classification/7-neuron.py | 7-neuron.py | py | 3,565 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.random.randn",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "numpy.dot",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_... |
7805060084 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import os, sys, datetime, json
from core import info_collection
from conf import settings
# import check python version model
from plugins.detector import check_version
class ArgvHandler(object):
def __init__(self, argvs):
self.argvs = argvs
self.parse... | szlyunnan/AntOpsv2 | antOpsClient/core/antMain.py | antMain.py | py | 7,879 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "core.info_collection.InfoCollection",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "core.info_collection",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "conf.settings.Params",
"line_number": 43,
"usage_type": "attribute"
},
{
... |
37840139507 | import logging
from django.utils.translation import ugettext_lazy as _
from mayan.apps.acls.classes import ModelPermission
from mayan.apps.common.apps import MayanAppConfig
from mayan.apps.common.menus import (
menu_object, menu_return, menu_secondary, menu_setup
)
from mayan.apps.events.classes import EventModel... | salmabader/mayan-edms | mayan/apps/credentials/apps.py | apps.py | py | 3,033 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "logging.getLogger",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "mayan.apps.common.apps.MayanAppConfig",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "django.utils.translation.ugettext_lazy",
"line_number": 34,
"usage_type": "call"
... |
17585811312 | import struct
import typing as t
from pathlib import Path
from starwhale import Link, GrayscaleImage
_TItem = t.Generator[t.Dict[str, t.Any], None, None]
def iter_mnist_item() -> _TItem:
root_dir = Path(__file__).parent.parent / "data"
with (root_dir / "t10k-images-idx3-ubyte").open("rb") as data_file, (
... | star-whale/starwhale | example/mnist/mnist/dataset.py | dataset.py | py | 2,105 | python | en | code | 171 | github-code | 36 | [
{
"api_name": "typing.Generator",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "typing.Dict",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "typing.Any",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
... |
7707679326 | import os
import sys
import time
import copy
import random
from reprint import output
MAX_oo = 65535
MIN_MAX = 65280
MIN_oo = -65535
'''
print("1111111",end="")
print("\r222222",end="")
╳〇
─━│┃┄┅┆┇┈┉┊┋┌┍┎┏┐┑┒┓└┕┖┗┘┙┚┛
├┝┞┟┠┡┢┣┤┥┦┧┨┩┪┫┬┭┮┯┰┱┲┳┴┵┶┷┸┹┺┻
┼┽┾┿╀╁╂╃╄╅╆╇╈╉╊╋
═║╒╓╔╕╖╗è]╚╛╜╝╞╟╠╡╢╣╤╥╦╧╨╩╪╫╬╳
╔ ╗╝╚ ╬ ═ ╓ ╩ ┠ ┨... | Mecheal-helloworld/Python-shell | demo/MIN_MAX.py | MIN_MAX.py | py | 4,714 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "copy.deepcopy",
"line_number": 115,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 127,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 144,
"usage_type": "call"
},
{
"api_name": "reprint.output",
"line_... |
39780727033 | import os
import sys
import numpy as np
import pickle
from matplotlib import pyplot as plt
from tqdm import tqdm
ZOOMIN_BUFFER = 1.0
def compute_epoch(result):
return result['epoch'] + result['step_within_epoch'] / result['epoch_length']
def compute_avg_acc(result, standard_or_own_domain):
d = result['zerosh... | kjmillerCURIS/vislang-domain-exploration | clip_finetuning_plot_utils.py | clip_finetuning_plot_utils.py | py | 3,093 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.mean",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 3... |
40806340636 | """
Problem 30: Digit fifth powers
https://projecteuler.net/problem=30
Surprisingly there are only three numbers that can be written
as the sum of fourth powers of their digits:
1634 = 1^4 + 6^4 + 3^4 + 4^4
8208 = 8^4 + 2^4 + 0^4 + 8^4
9474 = 9^4 + 4^4 + 7^4 + 4^4
As 1 = 1^4 is not a sum it is not included.
The sum ... | FranzDiebold/project-euler-solutions | test/test_p030_digit_fifth_powers.py | test_p030_digit_fifth_powers.py | py | 1,404 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "src.p030_digit_fifth_powers.can_be_written_as_sum_of_nth_power",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 21,
"usage_type": "at... |
28775606066 | #!/usr/bin/env python3.7
# Soubor: view.py
# Datum: 25.03.2019 13:11
# Autor: Marek Nožka, nozka <@t> spseol <d.t> cz
# Licence: GNU/GPL
############################################################################
from . import app, socketio
from flask import (render_template,
# Markup,
... | MarrekNozka/socketio-experiment | webface/routes.py | routes.py | py | 1,116 | python | de | code | 0 | github-code | 36 | [
{
"api_name": "serial.Serial",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "serial.readline",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "threading._start_new_thread",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "flask.flash... |
16539479262 | import json
from common.variables import *
def send_msg(socket, msg):
json_msg = json.dumps(msg)
coding_msg = json_msg.encode(ENCODING)
socket.send(coding_msg)
def get_msg(client):
json_response = client.recv(MAX_PACKAGE_LENGTH).decode(ENCODING)
response = json.loads(json_response)
if isinst... | MariaAfanaseva/app | HW_3_Afanaseva_Maria/common/utils.py | utils.py | py | 401 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "json.dumps",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 13,
"usage_type": "call"
}
] |
26745748297 | """
Workhorse file to perform analysis on data taken by Andor Cameras using CSPY
Author : Juan Bohorquez
Created on : 06/04/2021
Last Modified : 06/04/2021
"""
import h5py
import os
import numpy as np
import warnings
from typing import Tuple
from HamamatsuH5 import HMROI
def load_data(
results_file: h5py.Fi... | JuanBohorquez3/Hybrid_H5 | H5_python3/AndorH5.py | AndorH5.py | py | 2,231 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "h5py.File",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "HamamatsuH5.HMROI",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "numpy.zeros",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "warnings.warn",
"lin... |
4104421635 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 23 11:27:48 2018
@author: anup
"""
from elasticsearch import Elasticsearch
from bs4 import BeautifulSoup as BS
import glob
from preprocess_class import EsPreProcessor
import warnings
from html_processing import *
warnings.filterwarnings('ignore')
... | anupkhalam/es_xd_standalone | html_indexer.py | html_indexer.py | py | 2,752 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "elasticsearch.Elasticsearch",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "preproc... |
31068607886 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time : 15:00
# @Author : cold
# @File : python_mysql.py
from configparser import ConfigParser
import os
class MySQLConfig(ConfigParser):
def __init__(self, config, **kwargs):
# ConfigParser.__init__(self,allow_no_value=True)
super(MySQLConfig, s... | liangtaos/mysqlmanage | python_mysql.py | python_mysql.py | py | 1,876 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "os.path.exists",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
}
] |
28757254981 | import psycopg2
import psycopg2.pool
from psycopg2.extras import execute_values
import pandas.io.sql as psql
class Dbconnection:
def __init__(self, schema, database, user, password, dbhost, dbport):
self._properties = dict(
database=database,
user=user,
password=passwo... | csipiemonte/unlockpa-unlockbotrasa | code_actions/db/dbconnection.py | dbconnection.py | py | 3,262 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "psycopg2.pool.ThreadedConnectionPool",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "psycopg2.pool",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "psycopg2.extras.execute_values",
"line_number": 75,
"usage_type": "call"
}
] |
6200752155 | from __future__ import print_function
import torch.nn as nn
from torch.nn.utils.weight_norm import weight_norm
from utils import plot_variance
class FCNet(nn.Module):
"""Simple class for non-linear fully connect network"""
def __init__(
self, dims, activation=nn.ReLU, relu_init=False, var_analysis=Fa... | cliziam/VQA_project_Demo | demo-vqa-webcam/fc.py | fc.py | py | 1,847 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.nn.ReLU",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_n... |
1511337021 | import pandas as pd
import datetime
def load_analysis(analysis_id, data, metadata_record, projects, es, framework):
load_data(data, analysis_id, es, framework)
if framework == 'scp':
metadata_record['cell_count'] = data['annotation_metrics'].shape[0]
elif framework == 'mondrian':
metadata... | shahcompbio/alhenaloader | alhenaloader/load.py | load.py | py | 3,730 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "datetime.datetime.now",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "pandas.DataFrame",
"line_number": 95,
"usage_type": "call"
}
] |
73894898984 | __author__ = "Sebastian Heinlein <devel@glatzor.de>"
import datetime
import glob
import gzip
import locale
import logging
import os
import re
import subprocess
import tempfile
import time
import traceback
import uuid
import apt
import apt_pkg
from defer import inline_callbacks, return_value
from defer.utils import d... | thnguyn2/ECE_527_MP | mp4/SD_card/partition1/usr/share/pyshared/aptdaemon/pkcompat.py | pkcompat.py | py | 126,545 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "gi.repository.GObject.threads_init",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "gi.repository.GObject",
"line_number": 40,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_number": 42,
"usage_type": "call"
},
{
"api_na... |
70863160103 | import json
from datetime import datetime
from dataclasses import dataclass
from tabulate import tabulate
import requests
from exceptions import WrongCommandFormat
from tools import \
format_task, \
http_response_to_str, \
FORMATTED_TASK_COLUMNS
from config import URL, HELP_MSG
@dataclass
class Handle... | yabifurkator/appvelox_task | client/handlers.py | handlers.py | py | 3,325 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "dataclasses.dataclass",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "exceptions.WrongCommandFormat",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "config.URL",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "reques... |
2152603533 | import calendar
import unittest
from datetime import date, datetime, timedelta
from codenotes import parse_args
from codenotes.util.args import date_args_empty, dates_to_search
class TestDateArgsNeededEmpty(unittest.TestCase):
def test_no_args(self):
args = parse_args(["task", "search"])
self.as... | EGAMAGZ/codenotes | tests/util/test_args.py | test_args.py | py | 1,944 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "unittest.TestCase",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "codenotes.parse_args",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "codenotes.util.args.date_args_empty",
"line_number": 13,
"usage_type": "call"
},
{
"ap... |
16185556027 | import string
import sqlalchemy.sql as sasql
from ..util import random_string, sha256_hash
from ..adapter.repository import UserRepo, UserFollowRepo
from .exception import UsecaseException, NotFoundException
class UserUsecase:
_mobile_verify_codes = {}
_email_verify_codes = {}
def __init__(self, config... | jaggerwang/sanic-in-practice | weiguan/usecase/user.py | user.py | py | 5,796 | python | en | code | 42 | github-code | 36 | [
{
"api_name": "adapter.repository.UserRepo",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "adapter.repository.UserFollowRepo",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "exception.UsecaseException",
"line_number": 22,
"usage_type": "call"
},
... |
43168841119 | import settings
import os
import click
import inspect
import sys
from configure import db as dbs
from apps import app
from CustomerException import ParameterError
from apps.API.models import (
Model,
Device,
DeviceService,
DeviceServiceData
)
from asyncpg import create_pool
from utils.tab... | DemonXD/template_sanic_project | manager.py | manager.py | py | 2,643 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "apps.app.listener",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "apps.app",
"line_number": 49,
"usage_type": "name"
},
{
"api_name": "click.group",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "sys.modules",
"line_number... |
16248087762 | from .base import Scoring
from math import pi
import torch
__all__ = ["ComplEx"]
class ComplEx(Scoring):
"""ComplEx scoring function.
Examples
--------
>>> from ckb import models
>>> from ckb import datasets
>>> from ckb import scoring
>>> import torch
>>> _ = torch.manual_seed(... | raphaelsty/ckb | ckb/scoring/complex.py | complex.py | py | 2,492 | python | en | code | 20 | github-code | 36 | [
{
"api_name": "base.Scoring",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.chunk",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "torch.chunk",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "torch.chunk",
"line_number":... |
13413427634 | import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
from matplotlib.lines import Line2D
import pandas as pd
##############################################################
# Change these lines to apply on your custom datasets
#########################################################... | MiriUll/multimodal_ABSA_Elbphilharmonie | pca_vis_img_features.py | pca_vis_img_features.py | py | 3,060 | python | en | code | 2 | github-code | 36 | [
{
"api_name": "numpy.array",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.subplots",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "numpy.a... |
21119755777 | from typing import Counter, List
class Solution:
def mergeSimilarItems(self, items1: List[List[int]], items2: List[List[int]]) -> List[List[int]]:
map = Counter()
for a, b in items1:
map[a] += b
for a, b in items2:
map[a] += b
return sorted([a, b] for a, b i... | plattanus/leetcodeDAY | python/2363. 合并相似的物品.py | 2363. 合并相似的物品.py | py | 625 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "typing.Counter",
"line_number": 6,
"usage_type": "call"
}
] |
36493183781 | """archetypal StructureInformation."""
import collections
from validator_collection import validators
from archetypal.template.constructions.base_construction import ConstructionBase
from archetypal.template.materials.opaque_material import OpaqueMaterial
class MassRatio(object):
"""Handles the properties of t... | samuelduchesne/archetypal | archetypal/template/structure.py | structure.py | py | 8,696 | python | en | code | 11 | github-code | 36 | [
{
"api_name": "validator_collection.validators.float",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "validator_collection.validators",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "archetypal.template.materials.opaque_material.OpaqueMaterial",
"line_nu... |
4399694937 | #!/usr/bin/env python
# coding: utf-8
from codecs import open # to use a consistent encoding
from os import path
from subprocess import check_output
from setuptools import setup, find_packages
def get_version():
cmd = "git describe"
try:
result = check_output(
cmd.split(),
).dec... | openworkload/swm-python-client | setup.py | setup.py | py | 1,828 | python | en | code | 1 | github-code | 36 | [
{
"api_name": "subprocess.check_output",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
... |
8735286229 | import requests
def linkCheck(linksFound):
goodLinks = []
badLinks = []
for link in linksFound:
res = requests.get(link)
if res.status_code == 200:
print(link + " <<<<<<<<<< 200")
goodLinks.append(link)
else:
badLink = res.status_code... | zipinel/Selenium_and_BeautifulSoup | Base/linkChecker.py | linkChecker.py | py | 467 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
}
] |
2037492885 | #!/usr/bin/env python3
import argparse
import datetime
import importlib
import re
import site
import traceback
from pathlib import Path
import yaml
SECRET_FILENAME = "secrets.yaml"
SECRET_REGEX = re.compile(r"!secret\s(\w+)")
def main():
parser = argparse.ArgumentParser(description="Test sources.")
parser.... | geNAZt/home-assistant | custom_components/waste_collection_schedule/waste_collection_schedule/test/test_sources.py | test_sources.py | py | 5,022 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "re.compile",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "yaml.safe_load",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "yaml.YAMLError",
... |
26852296512 | from draw_rectangle import print_bbox
def get_tokens(txt:str):
if txt == "nan" or len(txt.strip()) == 0:
return []
else:
return txt.split()
import Levenshtein
def calculate_distance(data,findtxt):
if type(data) == str and type(findtxt) == str and len(findtxt) > 0:
return Levenshtein.distance(dat... | helderarr/patents_dataset | main.py | main.py | py | 6,975 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "Levenshtein.distance",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line... |
412173435 | import nltk
def init_wfst(tokens, grammar):
"""Updates diagonal elements of chart
Arguments:
---------
tokens (list):
List of words in input sentence
grammar (list):
List of production rules in the grammar
"""
num_tokens = len(tokens)
wfst = [[None... | aashishyadavally/MS_AI_Coursework | CS6900/Assignment06/homework6_1.py | homework6_1.py | py | 2,755 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "nltk.CFG.fromstring",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "nltk.CFG",
"line_number": 68,
"usage_type": "attribute"
},
{
"api_name": "nltk.CFG.fromstring",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "nltk.CFG",
... |
30382090301 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 7 13:32:28 2018
@author: jon
"""
#import sys
#from pyuvdata import UVData
from pynfft import NFFT
import numpy as np
import matplotlib.pyplot as plt
from scipy import constants
from mslib import MS_jon
def singleFrequency():
imsize = (256, 25... | lord-blueberry/p8-pipeline | sandbox/img_test/pynfft_test.py | pynfft_test.py | py | 2,295 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "numpy.asarray",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.radians",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "mslib.MS_jon",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "scipy.constants.c",
"lin... |
39498051069 | from __future__ import absolute_import
__author__ = "Angelo Ziletti"
__copyright__ = "Angelo Ziletti"
__maintainer__ = "Angelo Ziletti"
__email__ = "ziletti@fhi-berlin.mpg.de"
__date__ = "14/08/18"
import unittest
from ai4materials.models.clustering import design_matrix_to_clustering
import numpy as np
import sklearn... | angeloziletti/ai4materials | tests/test_clustering.py | test_clustering.py | py | 2,367 | python | en | code | 36 | github-code | 36 | [
{
"api_name": "numpy.random.seed",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "unittest.TestCase",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "numpy.rand... |
25050897663 | # coding: utf-8
from typing import Any, Dict, List, Optional, Tuple, Union
import matplotlib.pyplot as plt
from matplotlib.axes import Axes
from matplotlib.colors import Colormap
from matplotlib.figure import Figure as mplFigure
from plotly.graph_objects import Trace
from plotly.graph_objs import Figure as plotlyFigur... | iwasakishuto/TeiLab-BasicLaboratoryWork-in-LifeScienceExperiments | teilab/utils/plot_utils.py | plot_utils.py | py | 5,241 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "typing.Optional",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "matplotlib.colors.Colormap",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "matplotlib.py... |
22377527144 | #!/usr/bin/env python3
import nibabel as nib
from nibabel import processing
import numpy as np
import scipy
import matplotlib.pyplot as plt
import matplotlib
from scipy import ndimage
from scipy.interpolate import RegularGridInterpolator
from scipy import optimize
import os, glob
import json
import time
import shutil
... | erikglee/OSPREY_Containerization | code/localizer_alignment.py | localizer_alignment.py | py | 21,949 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "scipy.ndimage.center_of_mass",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "scipy.ndimage",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.matmul",... |
13030737473 | import sys
from PySide6.QtCore import Qt, QTimer, QSettings, QThread, QRegularExpression
from PySide6.QtGui import QIcon, QAction, QPixmap, QIntValidator, QRegularExpressionValidator
from PySide6.QtWidgets import QApplication, QSystemTrayIcon, QMenu, \
QLabel, QWidgetAction, QWidget, QHBoxLayout, QMessageBox, QForm... | gmc-norr/getmod | getmod.py | getmod.py | py | 13,431 | python | en | code | 0 | github-code | 36 | [
{
"api_name": "PySide6.QtWidgets.QWidget",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "PySide6.QtWidgets.QHBoxLayout",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "PySide6.QtWidgets.QLabel",
"line_number": 27,
"usage_type": "call"
},
{
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.