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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
72850796062 | import torch
import torch.nn as nn
# for static shape
CONST_K = 4000000
CONST_K1 = 6000000
class BalanceCrossEntropyLoss(nn.Module):
'''
Balanced cross entropy loss.
Shape:
- Input: :math:`(N, 1, H, W)`
- GT: :math:`(N, 1, H, W)`, same shape as the input
- Mask: :math:`(N, H, W)`, s... | Ascend/ModelZoo-PyTorch | PyTorch/built-in/cv/detection/DB_ID0706_for_PyTorch/decoders/balance_cross_entropy_loss.py | balance_cross_entropy_loss.py | py | 2,802 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "torch.Tensor",
"lin... |
9992864876 | #!/usr/bin/python
import utils
import organization
from adapters.eprov_adapter_v2 import EProvenanceAdapter
from adapters.native_adapter import NativeAdapter
from excel_input import ExcelInput
def data_input_parse_args():
# parse and print arguments
utils.parse_arguments()
if utils.global_args.mode ==... | IBM/transparent-supply-toolbox | python/src/data_input_v2.py | data_input_v2.py | py | 1,117 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "utils.parse_arguments",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "utils.global_args",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "utils.quit",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "utils.global_... |
8375217235 | """File containing utilities."""
from copy import deepcopy
from datetime import datetime
import functools
import json
import math
import matplotlib.pyplot as plt
import numpy as np
import os
import random
import shutil
from tqdm import tqdm
import wandb
import torch
import torch.nn as nn
from torchvision.transforms im... | tristanengst/SPS | utils/Utils.py | Utils.py | py | 8,667 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "torch.backends",... |
37751892230 | # coding=utf-8
from time import sleep
from SRC.common.decorator import codeException_dec
from SRC.unittest.case import TestCase
from SRC.webdriver.switchTo import SwitchTo
from script.common import utils
from selenium.webdriver import ActionChains
class EasyCase(TestCase):
def __init__(self, webDriver, paramsList):... | juntaoh1234/12122003 | script/testCase/Y3me项目/人力资源/员工服务/云直播.py | 云直播.py | py | 1,749 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "SRC.unittest.case.TestCase",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "script.common.utils",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "time.sleep"... |
15745903463 | # -*- coding: utf-8 -*-
"""
Local functions for all orientation codes
A. Doran and G. Laske
"""
#############################
# Import all packages for entire program
#############################
from numpy import *
from geographiclib.geodesic import *
import subprocess
import numpy as np
import scipy.signal as sig
... | jbrussell/DLOPy_v1.0 | pysave/locfuns.py | locfuns.py | py | 12,985 | python | en | code | 16 | github-code | 7 | [
{
"api_name": "numpy.pi",
"line_number": 103,
"usage_type": "attribute"
},
{
"api_name": "scipy.stats.hmean",
"line_number": 191,
"usage_type": "call"
},
{
"api_name": "numpy.random.choice",
"line_number": 264,
"usage_type": "call"
},
{
"api_name": "numpy.random",... |
16066761289 | # -*- coding: utf-8 -*-
import csv
import sys
import time
import random
import copy
import math
import os
sys.path.append(os.getcwd())
import os.path as pt
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import skimage.io as skimage
from skimage import transform as tr
import ... | funalab/QCANet | src/tools/graph_draw.py | graph_draw.py | py | 9,692 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.style.use",... |
21909546105 | import numpy as np
import pandas as pd
df=pd.read_csv('Books.csv',error_bad_lines=False,encoding='latin-1')
df1=pd.read_csv('Ratings.csv',error_bad_lines=False,encoding='latin-1')
df2=pd.read_csv('Users.csv',error_bad_lines=False,encoding='latin-1')
df=df[['ISBN','Book-Title','Book-Author','Year-Of-Publication','Publis... | Naveenvenkatampalli/Book-Recommender-System | book.py | book.py | py | 1,410 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "scipy.sparse.csr_matrix"... |
41089961641 | #!/usr/bin/env python3
import functools
def main():
with open("day9/input.txt", "r") as input:
lines = input.read().splitlines()
low_points =[]
for r in range(0, len(lines)):
for c in range(0, len(lines[r])):
cur_depth = int(lines[r][c])
if c-1 >=... | dimitrityan/aoc-2021 | python/day9/part1.py | part1.py | py | 842 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "functools.reduce",
"line_number": 20,
"usage_type": "call"
}
] |
10135168623 | from datetime import datetime, date, timedelta
import yaml
def daterange(start_date, end_date):
for n in range(int((end_date - start_date).days)):
yield start_date + timedelta(n)
def get_input_datetime(prompt):
while True:
try:
print(prompt)
input_date = input().split("... | CMU-313/CMU-313.github.io | docs/_data/generate_dates.py | generate_dates.py | py | 1,714 | python | en | code | 45 | github-code | 7 | [
{
"api_name": "datetime.timedelta",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "yaml.SafeDumper",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "yaml.dump",
... |
33213039174 | """
Parametric DC inversion with Dipole Dipole array
================================================
This is an example for a parametric inversion with a DC survey.
Resistivity structure of the subsurface is parameterized as following
parameters:
- sigma_background: background conductivity
- sigma_block: blo... | simpeg/simpeg | examples/04-dcip/plot_inv_dcip_dipoledipole_parametric_inversion.py | plot_inv_dcip_dipoledipole_parametric_inversion.py | py | 6,850 | python | en | code | 438 | github-code | 7 | [
{
"api_name": "numpy.random.seed",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 53,
"usage_type": "attribute"
},
{
"api_name": "SimPEG.electromagnetics.static.resistivity.IO",
"line_number": 55,
"usage_type": "call"
},
{
... |
10047576785 | import requests
# Following URL is used to retrieve metadata of gce instance.
# For more information check following link:
# https://cloud.google.com/compute/docs/storing-retrieving-metadata
METADATA_ATTRIBUTES_URL = (
'http://metadata.google.internal/computeMetadata/v1/instance/attributes/')
METADATA_HEADERS =... | oppia/oppia-ml | core/platform/metadata/gce_metadata_services.py | gce_metadata_services.py | py | 700 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 24,
"usage_type": "call"
}
] |
7631464580 | #!/usr/bin/env python3
import sys
import click
"""
Endpoint to ExCthulhu
"""
from cthulhu_src.utils import logger
# import commands
from cthulhu_src.routes.config import config
from cthulhu_src.routes.find_txn import find
from cthulhu_src.routes.exchanges import exchanges
from cthulhu_src.routes.available_io imp... | SemyonDerduga/ExCthulhu | cthulhu_src/main.py | main.py | py | 927 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "click.group",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "click.pass_context",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "cthulhu_src.routes.find_txn.find",
"line_number": 24,
"usage_type": "argument"
},
{
"api_name... |
29042253357 | import os,psutil,time,datetime as dttime,sys
from optparse import OptionParser
from paircarstools.access_ms import *
from paircarstools.basic_func import *
from paircarstools.flagger import *
from casatasks import *
from multiprocessing import current_process
os.system('rm -rf casa*log')
def split_single_ms(paramlist,... | devojyoti96/P-AIRCARS | paircarstasks/split_ms.py | split_ms.py | py | 4,313 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.system",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "multiprocessing.current_process",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
21008205120 | from __future__ import annotations
import logging
import traceback
from typing import Any
from nni.mutable import MutableExpression, Categorical, Numerical
_logger = logging.getLogger(__name__)
def conclude_assumptions(values: list[int | float]) -> dict[str, bool]:
"""Conclude some sympy assumptions based on t... | microsoft/nni | nni/nas/profiler/pytorch/utils/_expression.py | _expression.py | py | 6,595 | python | en | code | 13,409 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "nni.mutable.MutableExpression",
"line_number": 54,
"usage_type": "name"
},
{
"api_name": "sympy.Symbol",
"line_number": 65,
"usage_type": "name"
},
{
"api_name": "sympy.Exp... |
33899572811 | # -*- coding: utf-8 -*-
"""
Created on Thu Dec 10 13:35:19 2020
@author: ilail
"""
import pandas as pd
import re
import matplotlib.pyplot as plt
from os import path
import os
# %% Reads MPT or DTA to common data structure
class CyclicVoltammetry:
def __init__(self, path):
self.filepat... | mattiafelice-palermo/cv-analysis | read_input.py | read_input.py | py | 8,649 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "os.path.basename",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "os.path.splitext",
"line_nu... |
9856880052 |
def sys_bgcolor(pyplot):
"""Reads system preference and sets plt background accordingly"""
from winreg import ConnectRegistry, HKEY_CURRENT_USER, OpenKeyEx, QueryValueEx
root = ConnectRegistry(None, HKEY_CURRENT_USER)
policy_key = OpenKeyEx(root, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Perso... | Kipre/kipr | kipr/sys_utils.py | sys_utils.py | py | 2,435 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "winreg.ConnectRegistry",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "winreg.HKEY_CURRENT_USER",
"line_number": 5,
"usage_type": "argument"
},
{
"api_name": "winreg.OpenKeyEx",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "win... |
25564508289 | from flask import Flask, render_template,request
from flask_socketio import SocketIO, emit
from new import myinput_network
# https://flask-socketio.readthedocs.io/en/latest/
# https://github.com/socketio/socket.io-client
app = Flask(__name__)
app.config[ 'SECRET_KEY' ] = 'jsbcfsbfjefebw237u3gdbdc'
socketio = SocketIO... | dixitsh/NegativeMsg-Chat | chatup.py | chatup.py | py | 951 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_socketio.SocketIO",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "new.myinput_... |
38828115491 | """added columns in payment
Revision ID: dcd654518f68
Revises: e49f52e03497
Create Date: 2022-06-26 22:26:07.373514
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'dcd654518f68'
down_revision = 'e49f52e03497'
branch_labels = None
depends_on = None
def upgrad... | NwaforAugustine321/ktizo-backend | alembic/versions/dcd654518f68_added_columns_in_payment.py | dcd654518f68_added_columns_in_payment.py | py | 832 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "alembic.op.add_column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.String"... |
24832118122 | from transactions.models import Transaction
from django.contrib.auth import get_user_model
from django.contrib.auth.models import AbstractUser
from tests.factories import create_user_with_token
User: AbstractUser = get_user_model()
def create_transaction(user: AbstractUser) -> Transaction:
transaction_data = {
... | Kinsei-Tech/kinsei-cash-api | tests/factories/transaction_factories.py | transaction_factories.py | py | 556 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.contrib.auth.models.AbstractUser",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.AbstractUser",
"line_number": 9,
"usa... |
24893162390 | # gaussian process regression
# Theory: [y, y*] ~ N([mu, mu*], [K, K*][K*T, K**])
# - y(x) is the data given
# - y* is to be inferred
# Use theorem on Gaussians (convolution) to get
# conditional for y*: P(y* | y, x, mu, mu*, K*, K**)
# This is a Gaussian again. K* and K** are taken
# from a so-called kernel to be de... | mpu/ml | gpr.py | gpr.py | py | 1,324 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "numpy.newaxis",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.exp",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.abs",
"line_num... |
24269127968 | from __future__ import print_function, division, absolute_import
import inspect
from six import string_types, add_metaclass
from collections import defaultdict
import numpy as np
_non_override_list = ('__setattr__', '__getattr__', '__getattribute__',
'__subclasshook__', '__getnewargs__', '__red... | NemoCpp/odin | odin/utils/python_utils.py | python_utils.py | py | 4,169 | python | en | code | null | github-code | 7 | [
{
"api_name": "inspect.getmro",
"line_number": 61,
"usage_type": "call"
},
{
"api_name": "six.string_types",
"line_number": 96,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line_number": 96,
"usage_type": "attribute"
},
{
"api_name": "numpy.dtype",
... |
3664389714 | import requests
from bs4 import BeautifulSoup
import pprint
import lxml
def get_movie_EnglishName():
movie_list=[]
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 \
(KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36',
'Host': 'movie.dou... | yangtianyu92/internet-worm | (2)beautifulSoupMovie250.py | (2)beautifulSoupMovie250.py | py | 1,022 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pprint.pprint",
"line_number": 27,
"usage_type": "call"
}
] |
25570821719 | from rest_framework import serializers
from rest_framework.response import Response
from django.http import HttpResponse
from .models import Crop, Seed, Machinery, Others, PesticidesAndFertilizers, BuyRequest, CropSell, CropActivity
from v1apps.user.serializers import UserSerializer
class CropActivitySerializer(seri... | jishoy/Farmers-app | farmersapp/v1apps/crop/serializers.py | serializers.py | py | 2,747 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "rest_framework.serializers.ModelSerializer",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "models.CropActivity",
"line_number": 12,
"usage_type": "name"
... |
942392218 | import numpy as np
import GPy
DEBUG = True # Uncomment this line for debug purposes
if DEBUG:
import sys
import os
sys.path.append(os.path.abspath('Debug'))
from sequential_learning import ASGP
def c_consistence():
n = 200
n_var = 2
design = np.random.uniform(size=n * n_var).reshape((-1, ... | sakex/seq-learning | examples/gpy.py | gpy.py | py | 2,855 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
17102626489 | import matplotlib.pyplot as plt
# This should be the inputs of the function
AK = 10000
SR = 1000
i = 0.07
lz = 10
# Empty lists should be defined inside the function
entw_GK = []
entw_zinsen = []
entw_zinseszins = []
def spar_funktion (AK, SR, i, lz):
for k in range (1, lz + 1):
#ZInsen auf das bestehende... | Alessandro1984/exercises_python | homework1_sol_stud2.py | homework1_sol_stud2.py | py | 1,215 | python | de | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.bar",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.xlabel",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "matp... |
74936128544 | import numpy as np
#from builtins import range
boxtype = np.dtype([('x', np.float32), ('y', np.float32), ('w', np.float32), ('h', np.float32)])
def max_index(a, n): # float* and int
if n <= 0:
return -1
i = 0
max_i = 0
max_v = a[0]
for i in range(1, n):
if a[i] > max_v:
... | BrainGardenAI/keras-yolo | darknet/image_utils.py | image_utils.py | py | 5,025 | python | en | code | 25 | github-code | 7 | [
{
"api_name": "numpy.dtype",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_nu... |
35140432155 | import csv
import os
from os import DirEntry
from typing import List, Dict
import exceptions as ex, logging as log
import objects.TableData as td
import values as v
from configurations.ConfigurationXml import ConfigurationXml
from exceptions import Logger
class DataReader:
tables: Dict[str, td.TableData]
def __... | larszz/Anonymization | FileReader.py | FileReader.py | py | 3,015 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.Dict",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "objects.TableData.TableData",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "objects.TableData",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "object... |
31056514595 | """
3. Написать программу, которая обходит не взвешенный ориентированный граф без петель, в котором все вершины связаны,
по алгоритму поиска в глубину (Depth-First Search).
Примечания:
a. граф должен храниться в виде списка смежности;
b. генерация графа выполняется в отдельной функции, которая принимает на вход число в... | egreenius/ai.algorithms_python | lesson_8/les_8_hw_3.py | les_8_hw_3.py | py | 4,234 | python | ru | code | 0 | github-code | 7 | [
{
"api_name": "collections.deque",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "random.choice",
"l... |
21637592484 | """
This module includes functions for generating continuous graphs.
Examples can be found here:
https://github.com/alexcapstick/alexs-visualisation-tools/blob/main/examples/lineplot.ipynb
"""
import numpy as np
import pandas as pd
import typing
import matplotlib.colors as mcs
import matplotlib.pyplot as plt
from ma... | alexcapstick/alexs-visualisation-tools | avt/_lineplot.py | _lineplot.py | py | 14,398 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.DataFrame",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "typing.Union",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "typing.Union",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "typing.Unio... |
27768734639 | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import code
# `site` initializes the interactive mode (defines `exit`/`quit`, sets up
# copyright notice, etc.).
import site # pylint: disable=unused-import
from googlecloudsdk.api_lib.util import apis
from... | twistedpair/google-cloud-sdk | google-cloud-sdk/lib/googlecloudsdk/command_lib/meta/debug.py | debug.py | py | 4,810 | python | en | code | 55 | github-code | 7 | [
{
"api_name": "readline.set_completer",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "rlcompleter.Completer",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "readline.parse_and_bind",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "... |
33197022768 | from datetime import datetime, timedelta
from enum import Enum
from typing import List, Type
from foundation.value_objects import UserId
from pomodoros import GetTaskListByOwnerId, ProjectId, QueryTaskDto
from pomodoros.application.queries.tasks import GetRecentTasksByProjectId
from pomodoros.domain.entities import Ta... | kamil559/Pomodorr_backend_v2 | pomodoro_system/pomodoros_infrastructure/queries/tasks.py | tasks.py | py | 5,471 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pomodoros.application.queries.tasks.GetRecentTasksByProjectId",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Type",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "pomodoros_infrastructure.models.TaskModel",
"line_number": 19,
... |
35628153456 | """
Module for TCRseq V and C region counts analysis for paired-end fastq data
@author:David Redmond (email david.redmond@outlook.com)
"""
import sys, os, commands, csv, commands, operator, tempfile, subprocess, numpy
from itertools import groupby, count
from collections import Counter
from Bio.Blast import NCBIXML
#c... | ElementoLab/TCRVseq | tcrvseqfuncs.py | tcrvseqfuncs.py | py | 5,453 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "commands.getoutput",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "commands.getoutput",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.system",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.system",
"line... |
33665962454 | import os
import cv2
import numpy as np
import mediapipe as mp
import matplotlib.pyplot as plt
import pickle
# updated mediapipe API's but they are avialable for Preview
"""
model_path = './hand_landmarker.task'
BaseOptions = mp.tasks.BaseOptions
HandLandMarker = mp.tasks.vision.HandLandmarker
HandLan... | Abhi-0212000/Custom-HandGesture-Recognition | createDataSet.py | createDataSet.py | py | 2,734 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "mediapipe.solutions",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.solutions",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "mediapipe.solutions",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_na... |
35347319995 | # -*- coding: utf-8 -*-
from werkzeug.utils import secure_filename
from application import app,db
from common.libs.Helper import getCurrentDate
import datetime
import os,stat,uuid
from common.models.Image import Image
class UploadService():
@staticmethod
def uploadByFile( file ):
config_upload = app.config['UPLOAD... | mooc-class/python-flask-minapp | 完整源码/common/libs/UploadService.py | UploadService.py | py | 1,359 | python | en | code | 20 | github-code | 7 | [
{
"api_name": "application.app.config",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "application.app",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "werkzeug.utils.secure_filename",
"line_number": 13,
"usage_type": "call"
},
{
"api_na... |
36999066138 | import pandas as pd
import numpy as np
import datetime
import matplotlib
#matplotlib.use("TKAgg")
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix
from sklearn.metrics import roc_curve
from keras.models impo... | ElectronicGomez/Python | Bioingenieria/Trabajo Final Bioingenieria/prueba.py | prueba.py | py | 4,383 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "numpy.random.seed",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "datetime.da... |
27701264052 | from connect import *
import secrets
import time
import datetime
from query_handler.logger import log
from query_handler.table_titles import TableTitles
db = get_db()
cursor = db.cursor()
def get_chat(src, dst):
src_token = src["token"]
dst_token = dst["token"]
sql = """
select *
from `messages`
... | mr-amirfazel/locochat | query_handler/messages_utils.py | messages_utils.py | py | 2,559 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "query_handler.logger.log",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "query_handler.table_titles.TableTitles.MESSAGES",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "query_handler.table_titles.TableTitles",
"line_number": 36,
... |
38221509827 | import pandas as pd
import requests
import json
def get_response(start_date, end_date):
api_key = "f972f525c49443af899142826200111"
url = "https://api.worldweatheronline.com/premium/v1/past-weather.ashx?key=" + api_key + "&q=Surat&format=json&tp=24&date=" + start_date + "&enddate=" + end_date
res = json.loads(requ... | siramk/DS250_PROJECT_VEGETABLE_PRICE_ANALYSIS | data collection/weather.py | weather.py | py | 2,338 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "json.loads",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 69,
"usage_type": "call"
}
] |
578550883 | import datetime
from celery import task
from corine.models import Patch
from django.contrib.gis.db.models.functions import Area, Intersection
from django.db.models import Sum
from natura.models import Cover, IntersectionLog, Site
@task
def process_sites(sites):
now = '[{0}]'.format(datetime.datetime.now().strft... | geodesign/protar | apps/natura/tasks.py | tasks.py | py | 1,362 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "datetime.datetime.now",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "natura.models.Site.objects.filter",
"line_number": 16,
"usage_type": "call"
},
{
"ap... |
44495474689 | from tkinter import *
import sqlite3
import tkinter.messagebox
import os.path
import sys
sys.path.append(os.path.abspath(os.path.dirname(__file__) + '/' + '../..'))
from HospitalManagementDBMS import settings
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
db_path = os.path.join(BASE_DIR, "../databa... | OsmanDsilva/HospitalManagementDBMS | src/disease.py | disease.py | py | 2,105 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.path.abspath",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.path",
"l... |
42008585881 | #!/usr/bin/env python3
# coding:utf-8
import time, unittest
from selenium import webdriver
class BaiduSearch(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
self.driver.maximize_window()
self.driver.implicitly_wait(8)
def tearDown(self):
self.driver.quit... | lingzun/SeleniumTest | csdn/test_baidu.py | test_baidu.py | py | 789 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "unittest.TestCase",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.Firefox",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "tim... |
71566285342 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from queue import LifoQueue
import os
import boto3
from botocore.exceptions import ClientError
import logging
class Graph():
def __init__(self, entry_point, bucket):
self.vertices = {}
self.entry_point = entry_point
self.bucket = bucket
d... | zacheryirvin/awsTreeTraversal | tree_traversal.py | tree_traversal.py | py | 4,599 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.path.isfile",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "os.path.basename",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_numb... |
24055539280 | from torch.utils import data
from torch.utils.data import DataLoader
import torch
from librosa.util import find_files
import numpy as np
import os
from hparams import create_hparams
import pandas as pd
class MUSDB(data.Dataset):
def __init__(self, file_path, out_channels_list):
self.file_l... | jlqian98/mmdenselstm | dataset.py | dataset.py | py | 1,516 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.utils.data",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "librosa.util.find_files",
"line_number": 15,
"usage_type": "call"
},
{
"api_name":... |
8646971801 | #!/usr/bin/env python3
from tkinter import *
import os, webbrowser
import regex as re
import rsspider
class Application:
def __init__(self, master=None):
self.results = []
# --------------------------------------------
self.primeiroContainer = Frame(master)
self.primeiroContainer["... | JoaoVieira97/SPLN-Utils | Assignment3/rss_interface.py | rss_interface.py | py | 3,526 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "rsspider.refreshDB",
"line_number": 67,
"usage_type": "call"
},
{
"api_name": "regex.sub",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "regex.split",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "rsspider.procRequest",
"... |
71639151905 | import timeit
import anndata
import numpy as np
import pandas as pd
import pytest
import scipy
from scipy.sparse import csr_matrix, issparse
from sklearn.decomposition import PCA
# from utils import *
import dynamo as dyn
from dynamo.preprocessing import Preprocessor
from dynamo.preprocessing.cell_cycle import get_ce... | aristoteleo/dynamo-release | tests/test_preprocess.py | test_preprocess.py | py | 18,776 | python | en | code | 377 | github-code | 7 | [
{
"api_name": "dynamo.pl.highest_frac_genes",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "dynamo.pl",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "dynamo.pl.highest_frac_genes",
"line_number": 37,
"usage_type": "call"
},
{
"api_name... |
74201682782 | from mpl_toolkits import mplot3d
from mpl_toolkits.mplot3d import art3d as art
import numpy as np
import matplotlib.pyplot as plt
def fun(x1,x2):
return 6 + 2*np.power(x1,2) + 2*np.power(x2,2)
#Question 1
fig = plt.figure()
axis = plt.axes(projection= '3d')
x1 = np.arange(-5,5,0.1)
x2 = np.arange(-5,5,0.1)
X, Y =... | jediXNavi/Machine-Learning | plots_q2a2_test.py | plots_q2a2_test.py | py | 1,356 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.power",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "matplotlib.pypl... |
25429970573 | """
-t - сканировать tcp
-u - сканировать udp
-p N1 N2, --ports N1 N2 - диапазон портов
Вывод:
В одной строке информация об одном открытом порте (через пробел):
TCP 80 HTTP
UDP 128
UDP 123 SNTP
Если протокол не определен - сообщить об ошибке
"""
import argparse # для разбора аргументов
import socket
import thread... | Kira-sa/experiments_py | port_scan/port_scan.py | port_scan.py | py | 13,157 | python | ru | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "typing.Tuple",
"line_number": 56,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 65,
"usage_type": "name"
},
{
"api_name": "queue.Queue",
"l... |
24562106777 | from typing import Any
from unittest import mock
from langchain_community.vectorstores.nucliadb import NucliaDB
class attrdict(dict):
def __getitem__(self, key: str) -> Any:
value = dict.__getitem__(self, key)
return attrdict(value) if isinstance(value, dict) else value
__getattr__ = __getit... | langchain-ai/langchain | libs/community/tests/integration_tests/vectorstores/test_nucliadb.py | test_nucliadb.py | py | 3,163 | python | en | code | 68,990 | github-code | 7 | [
{
"api_name": "typing.Any",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 22,
... |
2710596412 | # -*- coding: utf-8 -*-
def add(a, b):
"""Add two numbers"""
if((type(a) is bool) and (type(b) is bool)):
return a or b
if((type(a) is bool) and not(type(b) is bool)):
return TypeError
if(not(type(a) is bool) and (type(b) is bool)):
return TypeError
if ((type(b) is str) or ... | rubenamador/Practica-1 | sample/core.py | core.py | py | 952 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "collections.Counter",
"line_number": 30,
"usage_type": "call"
}
] |
26301888393 | #!/usr/bin/env python
# 第 0005 题:你有一个目录,装了很多照片,把它们的尺寸变成都不大于 iPhone5 分辨率的大小。
# coding:utf-8
from PIL import Image
import glob
import os
def resizeToIphoneSize():
size = (1136, 640)
for files in glob.glob(r'*.jpg'):
file_name = files.split('.')[0]
im = Image.open(files)
size... | cbl315/dailyCode_python | python_practice/0005.py | 0005.py | py | 698 | python | zh | code | 1 | github-code | 7 | [
{
"api_name": "glob.glob",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "PIL.Image.ANTIALIAS",
"line_nu... |
6681800520 | from data.tile import Tile
import unittest
from data.attributes.attribute import Attribute
from data.attributes.attribute_id import AttributeId
from data.attributes.attribute_modifier import (AttributeModifier,
AttributeModType)
from data.attributes.stat_collection impor... | nikolr/PythonIsometricJRPG | data/tests/stat_test.py | stat_test.py | py | 2,654 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "unittest.TestCase",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "data.tile.Tile",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "data.sprite.Sprite",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "data.sprite.... |
75223442463 | import os
import json
from concurrent.futures import ThreadPoolExecutor
from pymongo import MongoClient
# 47.xxx.100.xx:27017
# haosexiansheng
# 7t7bPbWC5FJ2ZhHG
# root
# UdMKkCbmzLMr3D5k
# 连接到MongoDB数据库
client = MongoClient("mongodb://root:UdMKkCbmzLMr3D5k@47.xxx.100.xx:27017")
if client is not None:
print("C... | nicolastinkl/Crach-haosexiansheng | updateMongodbName.py | updateMongodbName.py | py | 1,088 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 15,
"usage_type": "call"
}
] |
73961787744 | from os.path import *
from os import makedirs
import pdb
import sys
sys.path.append('/mnt/experiments/privacy-GAN/')
from data import *
from utils.generic import load_model_config
from utils.data import load_data_config, load_dataset
class Config(object):
"""docstring for Config"""
def __init__(self, datase... | bpiyush/privacy-GAN | config.py | config.py | py | 1,185 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "utils.data.load_data_config",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "utils.generic... |
14195462785 | # from pudb import set_trace; set_trace()
from typing import List, Tuple
class Solution1:
def findNumberOfLIS(self, nums: List[int]) -> int:
"""27% ranking.
Very tough for me. I have to first revisit how LIS algorithm works, and
then based on that, I have to figure out how to keep track t... | FanchenBao/leetcode | 2020_10_challenge/10_30_2020.py | 10_30_2020.py | py | 4,659 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 66,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number": 82,
"usage_type": "name"
},
{
"api_name": "typing.Tuple",
"line_number"... |
34533164654 | import logging
from optparse import OptionParser
import sys
import snowTools
from snowTools.cleaner import Cleaner
from snowTools.common.config import Config
from snowTools.common.tools.logger import SLogger
from snowTools.daemon import Daemon
from snowTools.downloader import DownloaderOne, DownloaderManySimple, \
... | cern-snow/codesync | src/snowTools/common/parser.py | parser.py | py | 6,144 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "optparse.OptionParser",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "optparse.OptionParser.__init__",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "optparse.OptionParser",
"line_number": 41,
"usage_type": "name"
},
{
"api_na... |
27571355885 | import threading
import time
import pynput
import gspread
import os
from oauth2client.service_account import ServiceAccountCredentials
# Authentication for Google Sheets
scope = ["https://spreadsheets.google.com/feeds","https://www.googleapis.com/auth/drive"]
jsonkeyfile = input("Enter your json keyfile n... | MetaSlave/python-keylogger | Keylogger.py | Keylogger.py | py | 2,349 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials.from_json_keyfile_name",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "oauth2client.service_account.ServiceAccountCredentials",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "gspread.auth... |
32286635305 | """
This file is an example of a Python file for the example gallery. It uses lots of
things and this is the summary.
Some more text comes after the summary to make sure it makes sense.
"""
from pathlib import Path
HERE = Path(__file__).parent
for ff in HERE.iterdir():
print(ff.name)
| bryanwweber/sphinx-gooey | doc/examples/python/example.py | example.py | py | 292 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pathlib.Path",
"line_number": 9,
"usage_type": "call"
}
] |
11774721029 | import pygame as pg
import pygame as pg
import cards
import in_Game
in_game = in_Game.BattleScreen()
class minion(cards.Cards):
events = pg.event.get()
clicked = False
keys = in_game.FriendsDict.keys()
def __init__(self) -> None:
super().__init__()
def attack... | Mahmoudghabash/Eternal-Battles | Eternal_Battles/Minions.py | Minions.py | py | 2,197 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "in_Game.BattleScreen",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cards.Cards",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "pygame.event.get",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.event",
... |
25778177767 | from __future__ import annotations
import datetime
import re
from enum import Enum
from pathlib import Path
from typing import Any, Dict, List, Optional
import ffmpeg
import requests
from loguru import logger
from pydantic import BaseModel, Field, HttpUrl
PS_API = "https://psapi.nrk.no/"
session = requests.Session()... | marhoy/nrk-download | src/nrkdownload/nrk_tv.py | nrk_tv.py | py | 7,282 | python | en | code | 50 | github-code | 7 | [
{
"api_name": "requests.Session",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 2... |
39514318353 | import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import sys
# from torchvision import models
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import utils
from models.layers import *
class Transformer_swap_once(nn.Module):
def __init__(self, args):
... | haesoochung/LAN-HDR | models/Transformer.py | Transformer.py | py | 3,040 | python | en | code | 6 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
33916261517 | from typing import List, Tuple
import util
import random
import copy
def neighborhood_search(data: Tuple[List[int], List[int], List[int]]):
(items, bags) = util.process_data(data)
items.sort(key=lambda x: x.benefit, reverse=True)
bags.sort(key=lambda x: x.capacity, reverse=False)
# Greedy search
... | Lambozhuang/multidimensional-knapsack-problem | neighborhood_search.py | neighborhood_search.py | py | 3,603 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "typing.Tuple",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "util.process_data",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "util.sync",
"line_number"... |
35919440011 | import boto3
from opensearchpy import OpenSearch, RequestsHttpConnection,AWSV4SignerAuth
import csv
# Reference: https://docs.aws.amazon.com/opensearch-service/latest/developerguide/search-example.html
# Reference: https://docs.aws.amazon.com/lambda/latest/dg/python-package.html
region = 'us-east-1'
credentials = bot... | vvangmj/dining-concierge-assistant | lambda-function/OpenSearch.py | OpenSearch.py | py | 1,254 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "boto3.Session",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "opensearchpy.AWSV4SignerAuth",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "opensearchpy.OpenSearch",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "ope... |
41799048427 | import jax
import jax.numpy as jnp
def xy_grid(grid_points, x_max=1, y_max=1):
"""Createes a grid of size (grid_points**2, 2) in the range of [-x_max, x_max] x [-y_max, y_max]"""
x_grid_space = jnp.linspace(-x_max, x_max, num=grid_points)
y_grid_space = jnp.linspace(-x_max, y_max, num=grid_points)
X, ... | sudo-michael/atu3 | atu3/deepreach/dataio.py | dataio.py | py | 2,308 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "jax.numpy.linspace",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "jax.numpy",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "jax.numpy.linspace",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "jax.numpy",
"line_nu... |
846041736 | from collections import defaultdict
class ID:
def __init__(self, num, str):
self.num = num
self.str = str
inp = [ (i.split('\n'))[0] for i in open("AOC_19.txt").readlines()]
idx = inp.index('split')
inp_2 = inp[idx+1:]
inp = inp[0:idx]
print(inp)
print(inp_2)
#inp = inp[0:inp.find("split")]
#inp2 ... | mhbtz1/AOC_2020_Solutions | AOC_19.py | AOC_19.py | py | 4,047 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.defaultdict",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 20,
"usage_type": "call"
}
] |
73498514143 | import argparse
import os
parser = argparse.ArgumentParser(description='Convert VCF from delly to browser extendable format')
parser.add_argument('-i','--input', dest='input', help='Input delly vcf')
parser.add_argument('-s','--samplename', dest='samplename', help='Samplename')
parser.add_argument('-o','--outdir', des... | tommiran/oncNGS_test | delly/delly_vcf_to_bed.py | delly_vcf_to_bed.py | py | 4,741 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
"... |
37493108789 | import numpy as np
from scipy import signal, butter, filtfilt
data_in = np.zeros((37, 2000))
fs = 500
eeg_data = data_in[np.array([3, 4, 12, 13, 14, 21, 28, 29]), :]
eeg_data = signal.resample(eeg_data, int(eeg_data.shape[1] / 10), axis=1) # Resample along axis 1
fs = 50
def butter_highpass(cutoff, fs, order=2):
... | neuromorphs/selective-attention-demo | decode_attention.py | decode_attention.py | py | 1,896 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.zeros",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "scipy.signal.resample",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "scipy.signal",
"line_n... |
27378886475 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import errno
import os
import re
import sys
import zlib
from time import strftime
import PyPDF2
import dirarchpdf
import extrac
carp = input("¿En qué carpeta desea hacer la búsqueda? ")
rdf = input("Buscar en todo [1] o en un rango de fechas [2]: ")
if rdf == "2":
fec... | jairomelo/PDF_manipulators | python3/busqueda.py | busqueda.py | py | 2,025 | python | es | code | 0 | github-code | 7 | [
{
"api_name": "dirarchpdf.Dir",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "dirarchpdf.Dir",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "dirarchpdf.Dir.buspdfall",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "dirarchpdf.Dir... |
16882444517 | from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django.db import models
# Create your models here.
class UserDetails(models.Model):
user_id = models.ForeignKey(User,null=True, on_delete=models.DO_NOTHING)
wallet = models.CharField(max_length=100, null=T... | nick-casa/akash-drive | main/models.py | models.py | py | 801 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.db.models.Model",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "django.db.models.ForeignKey",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": ... |
42117450278 | # !/usr/bin/env python3
# encoding: utf-8
import requests
import json
import sys
host = "127.0.0.1"
port = 8500
# consul中微服务名称
serviceNames = ""
def get_service():
url = 'http://' + host + ':' + str(port) + '/v1/agent/services'
data = requests.get(url).json()
jsonStr = json.dumps(data)
print('json ... | fatbun/kickconsul-python-study | main.py | main.py | py | 1,088 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "requests.put",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 39... |
42645623611 | import asyncio
import pytest
import requests
from binance import AsyncClient, Client
from ftx import FtxClient
@pytest.fixture
def event_loop():
loop = asyncio.get_event_loop()
yield loop
loop.close()
def test_response_binance(event_loop):
client = AsyncClient()
response = event_loop.run_until_... | alveraboquet/SimpleTradeAllerting | Solution/tests/test_responses_from_clients.py | test_responses_from_clients.py | py | 923 | python | en | code | null | github-code | 7 | [
{
"api_name": "asyncio.get_event_loop",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pytest.fixture",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "binance.AsyncClient",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "ftx.Ftx... |
25051449963 | from typing import List
'''
In an alien language, surprisingly they also use english lowercase letters, but possibly in a different order. The order
of the alphabet is some permutation of lowercase letters.
Given a sequence of words written in the alien language, and the order of the alphabet, return true if and only ... | S-King/Leetcode | Verify Alien Dictionary.py | Verify Alien Dictionary.py | py | 2,499 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 34,
"usage_type": "name"
}
] |
38117963654 | import csv
import math
import random
import copy
from statistics import mean
from operator import add
import time
########
def randomNewPos():
centre = [53.958365,-1.080271]
radius = 0.00810135
pos = [0,0]
while ((math.pow(pos[0] - centre[0],2) + math.pow(pos[1] - centre[1],2)) > math.po... | GPIGB/Training-Data-Generator | generator.py | generator.py | py | 3,918 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "math.pow",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "random.uniform",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "math.pow",
"line_number": 22,
... |
16555230319 | #!/usr/bin/env python3
import bs4
import os
import re
XML_PATH : str = 'arq.xml'
HTML_DIR : str = 'out/'
HTML_PATH : str = 'index.html'
PATTERN : re.Pattern = re.compile(r'(.+)\.xml$')
HTML_BEGIN : str = '''
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
'''
HTML_END : str = '''
</b... | jtmr05/RPCW2023 | TPC2/html_generator.py | html_generator.py | py | 1,453 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "re.Pattern",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "re.compile",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "bs4.Tag",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number... |
72859268382 | from argparse import Namespace
from typing import Any, Dict, Optional, Union
from pytorch_lightning.core.lightning import LightningModule
from pytorch_lightning.loggers.base import LightningLoggerBase, rank_zero_experiment
from pytorch_lightning.utilities import _module_available
from pytorch_lightning.utilities.distr... | Ascend/ModelZoo-PyTorch | PyTorch/contrib/cv/classification/Centroids-reid/pytorch_lightning/loggers/test_tube.py | test_tube.py | py | 7,122 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "pytorch_lightning.utilities._module_available",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "test_tube.Experiment",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pytorch_lightning.loggers.base.LightningLoggerBase",
"line_number": 17,
... |
30461744685 | import torch.nn as nn
import torch
import os
from efficientnet_pytorch import EfficientNet
from torch.optim import lr_scheduler
from torchvision import transforms
from EfficientNet.attention import ChannelAttention, SpatialAttention
from Utils.loader import CustomDataset
from Utils.trainer import run_epochs_for_loop,... | OUC-iBird/iBird_model | EfficientNet/EffcientNetAttn.py | EffcientNetAttn.py | py | 3,812 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "efficientnet_pytorch.EfficientNet.from_pretrained",
"line_number": 18,
"usage_type": "call"
},
{
"a... |
40804988518 | import torch
from torch import nn
from einops import rearrange, repeat
from einops.layers.torch import Rearrange
import torch
import torch.nn as nn
import torch.nn.functional as F
class DoubleConv(nn.Module):
"""(convolution => [BN] => ReLU) * 2"""
def __init__(self, in_channels, out_channels... | wjieun/SKKU-AI-Project-Team2 | main/seg_model.py | seg_model.py | py | 8,377 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
72604053344 | #! usr/bin/env python
# -*- coding:utf-8 -*-
# created by zhaoguanhua 2017/9/25
# AtmosphericCorrection for Landsat8
import glob
import os
import sys
import tarfile
import re
import gdal
import numpy
from Py6S import *
from osgeo import gdal
import pdb
import shutil
import argparse
from .base import MeanDEM
def parse... | Zhaoguanhua/AtmosphericCorrection | AtmosphericCorrection_Landsat8.py | AtmosphericCorrection_Landsat8.py | py | 11,210 | python | en | code | 144 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line... |
8544098281 | import sys
from collections import deque
n,m,k = map(int,sys.stdin.readline().split())
graph = [[0 for _ in range(m)] for _ in range(n)]
for _ in range(k):
a,b = map(int,sys.stdin.readline().split())
graph[a-1][b-1] = 1
dx = [-1,1,0,0]
dy = [0,0,1,-1]
visit = [[0 for _ in range(m)] for _ in range(n)]
def ... | kimkihoon0515/CodingTest | DFS 와 BFS/1743/1743.py | 1743.py | py | 975 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "sys.stdin.readline",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin.readline",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"li... |
37093842999 | import dash
from dash import no_update
from dash.dependencies import Input,Output,State
import dash_bootstrap_components as dbc
import dash_html_components as html
import dash_core_components as dcc
from utilities import fetchilarity_score
app = dash.Dash(__name__,external_stylesheets=[dbc.themes.BOOTSTRAP])
server =... | russellromney/fetchilarity | webapp.py | webapp.py | py | 2,575 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "dash.Dash",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "dash_bootstrap_components.themes",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "dash_html_components.Div",
"line_number": 13,
"usage_type": "call"
},
{
"api_name... |
19653981193 | from collections import Counter
from typing import List
class Solution:
def isPossibleDivide(self, nums: List[int], k: int) -> bool:
nums.sort()
left = Counter(nums)
for n in nums:
if left[n] == 0:
continue
for i in range(n, n+k):
if... | KimJoonSeo/coding_practice | leetcode/_hash_table/1296.py | 1296.py | py | 417 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "collections.Counter",
"line_number": 8,
"usage_type": "call"
}
] |
29039856420 | from utils import *
from itertools import combinations
from math import comb, floor, ceil
import functools
def is_leaf(a):
return isinstance(a, list) and all(isinstance(x, int) for x in a)
def infix(root):
result = []
def sub(root):
if isinstance(root[0], int):
result.append((root, 0... | tkirill/adventofcode | 2021/18_snailfish .py | 18_snailfish .py | py | 2,250 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "math.floor",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "math.floor",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "math.ceil",
"line_number": 56,
... |
14682051363 | # Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
# useful for handling different item types with a single interface
from itemadapter import ItemAdapter
import sqlite3
class ProductLinkScraperPipel... | ajvikranth/scrapy-laptop_specs_and_reviews | laptop_spec_scraper/pipelines.py | pipelines.py | py | 6,705 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sqlite3.connect",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 145,
"usage_type": "call"
}
] |
42966796165 | #!/usr/bin/python
import string
import argparse
import random
import unidecode
import re
import load as Loader
from dictionaries import *
import onomono
from propernoun import *
from onomono import *
import unicodedata
from nltk.util import ngrams
import nltk
import nltk.tag
from textstat.textstat import textstat... | sarachour/triplex | hmm/preproc.py | preproc.py | py | 4,819 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "load.load_data_partial",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "nltk.__version__",
"line_number": 49,
"usage_type": "attribute"
},
{
"api_name": "... |
40625968871 |
from math import factorial
import numpy as np
import attr
from scipy import ndimage, signal, optimize
_TOPHAT_FACTOR = 0.01 #025 #05
_MEDWINSIZE = 299
_MEDMMSIZE = 1991
def b(txt):
""" return a binary string aka bytes """
return txt.encode('UTF-8')
def smooth_signal( raw_signal ):
""" smooth signal ... | trmznt/fatools | fatools/lib/fautil/traceutils.py | traceutils.py | py | 10,063 | python | en | code | 11 | github-code | 7 | [
{
"api_name": "scipy.ndimage.white_tophat",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "scipy.signal",
"line_number": 25,
"usage_type": "argument"
},
{
"api_name": "scipy.ndimage",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "numpy.repea... |
30347747922 | import cv2
import argparse
# img = cv2.imread("./logo.png")
# cv2.imshow("LOGO", img)
# cv2.waitKey(0)
# cv2.destroyAllWindows()
parse = argparse.ArgumentParser()
parse.add_argument("path_image", help="path to input the image")
args = parse.parse_args()
img = cv2.imread(args.path_image)
cv2.imshow("LOGO", img)
arg... | Incipe-win/C-CPP | linux_c/opencv_code/py/opencv4/05_opencv.py | 05_opencv.py | py | 499 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "cv2.imshow",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_n... |
13270003111 | #
# Author: KEEN LITTLE
#
# Date: 29 March 2021
#
# Assignment Step 214, Python Course
# The Tech Academy Software Development Bootcamp
#
# Purpose: to practice with python3 and sqlite3, showing how SQL queries can be
# written and automated with Python.
#
########################################################... | MeisterKeen/Python-Projects | pysql1.py | pysql1.py | py | 1,757 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "sqlite3.connect",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 44,
"usage_type": "call"
}
] |
39197872228 | """ Importamos el modelo del archivo en que lo definimos. """
from model_robots import StorageModel
""" matplotlib lo usaremos crear una animación de cada uno de los pasos
del modelo. """
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.animation as animation
plt.rcParams["animation.html... | JARE2001/ActIntegradoraSistemasMultiagentes | main.py | main.py | py | 1,963 | python | es | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.rcParams",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name... |
71734754464 | import os
import sys
import gzip
import pandas as pd
import numpy as np
from absl import app
from pysc2 import run_configs
from pysc2.bin.play import get_replay_version
from s2clientprotocol.common_pb2 import Size2DI
from s2clientprotocol.sc2api_pb2 import InterfaceOptions, RequestStartReplay, \
SpatialCameraSetup... | FrankSchaust/SC2CombatPredictor | bin/combat_observer_2.py | combat_observer_2.py | py | 15,542 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "lib.config.STANDARD_VERSION",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "lib.config.REPLAY_VERSION",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "os.walk",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path... |
43326330897 |
import os,wx
import numpy as np
from poiGUI_panels import POIPanel
from poiGUI_navigation import POINavigationControls
class POIFrame(wx.Frame):
def __init__(self, parent, id, title, metadata=None):
wx.Frame.__init__(self, parent, id, title)
self.POI = metadata.load_pois()
self.poi = s... | cclemente/ppp2 | poiGUI/poiGUI.py | poiGUI.py | py | 6,500 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "wx.Frame",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "wx.Frame.__init__",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "wx.Frame",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "wx.BoxSizer",
"line_... |
7126877157 | import sys
import time
from Point import Point
import matplotlib.pyplot as plt
from sampler import rectangular_sample, eliptical_sample
def distance(a,b,c):
y1 = a.y - b.y
y2 = a.y -c.y
x1 = a.x -b.x
x2 = a.x -c.x
x = y1 * y1 + x1 * x1
y = y2 * y2 + x2 * x2
if x == y:
return 0
elif x < y:
return -1
else:... | elMolda/Algorithms | ConvexHull/jarvis_march.py | jarvis_march.py | py | 2,356 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.argv",
"line_number": 74,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 75,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 76,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number... |
32850031597 | from string import Template
from skyfield.api import load
class Celestial:
def __init__(self, name):
self.name = name
self.caption = name.capitalize()
self.set_object()
def set_object(self):
planets = load('de421.bsp')
print(planets)
self.object = planets[self.n... | jakmat/2020-personal-api | classes/celestial.py | celestial.py | py | 1,398 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "skyfield.api.load",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "string.Template",
"line_number": 21,
"usage_type": "call"
}
] |
74875312542 | """Models module for revenueapp."""
from django.db import models
# Validation modules
from django.core.validators import MinLengthValidator
from django.conf import settings
class Genre(models.Model):
"""A class for genres."""
name = models.CharField(
max_length=50,
unique=True
)
def __... | Jonathanlouiskirk/reVENUE | revenue/revenueapp/models.py | models.py | py | 2,844 | python | en | code | 3 | github-code | 7 | [
{
"api_name": "django.db.models.Model",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "... |
72864122142 | import torch
import torch.nn as nn
import torch.nn.functional as F
from models.backbone.googlenet import GoogLeNet
class Model(nn.Module):
def __init__(self, n_parts=8,n_ID=300):
super(Model, self).__init__()
self.n_parts = n_parts
self.nID = n_ID
self.feat_conv = GoogLeNet()
... | Ascend/ModelZoo-PyTorch | PyTorch/contrib/cv/pose_estimation/AlphaPose/trackers/ReidModels/reid/image_part_aligned.py | image_part_aligned.py | py | 1,458 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "models.backbone.googlenet.GoogLeNet",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch... |
70794284702 | from flask import Flask
import tensorflow as tf
import librosa
import math
import os
import numpy as np
from flask import request
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
@app.route('/')
def hello_world():
return {"result":'Hello, World!'}
@app.route('/prediction',methods=['POST'... | AniketDas13/Music-Genre-Classification-System | flaskapp.py | flaskapp.py | py | 2,430 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tensorflow.keras.models.load_model",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tensorf... |
35988010805 | from collections.abc import Sequence
import logging
from gama.logging.machine_logging import TOKENS, log_event
from .components import Individual
log = logging.getLogger(__name__)
class OperatorSet:
""" Provides a thin layer for ea operators for logging, callbacks and safety. """
def __init__(
self... | emailhy/gama | gama/genetic_programming/operator_set.py | operator_set.py | py | 4,238 | python | en | code | null | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "collections.abc.Sequence",
"line_number": 51,
"usage_type": "argument"
},
{
"api_name": "gama.logging.machine_logging.log_event",
"line_number": 59,
"usage_type": "call"
},
{
... |
74164616224 | import socket
import json
import time
SERVER = "192.168.68.114"
PORT = 1337
HEADER = 8
DISCONNECT_MSG = "!DISCONNECT"
GET_MSG = "!GET"
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect((SERVER, PORT))
def send(msg):
# Finds the size of the message to send in the header
message = ms... | ezweber/weather-station | temperature.py | temperature.py | py | 813 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "socket.socket",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "socket.SOCK_STREAM",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "json.loads"... |
24846063090 |
from torchvision import transforms
from torch.utils.data import Dataset
from .dataset import MVB
import albumentations as A
from albumentations.pytorch import ToTensorV2
def get_augmentation(phase, input_size):
if phase == "train":
return A.Compose([
A.LongestMaxSize(max_size = input_... | nguyenphan99/Metric_Learning_Pipeline | datasets/make_dataset.py | make_dataset.py | py | 1,397 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "albumentations.Compose",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "albumentations.LongestMaxSize",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "albumentations.PadIfNeeded",
"line_number": 12,
"usage_type": "call"
},
{
"a... |
72069313184 | from twilio.rest import Client
import twilio_account
import time
import subprocess
import cv2
def send_to_mobile():
client = Client(twilio_account.sid,twilio_account.auth_token)
message = client.messages.create(
to = twilio_account.my_phone_number,
from_ = twilio_account.twilio_phone_number,
body = "Someone d... | Aura-Buddy/IoT_Security_Project | Demo.py | Demo.py | py | 1,073 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "twilio.rest.Client",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "twilio_account.sid",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "twilio_account.auth_token",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name":... |
10760469826 |
import numpy as np
import matplotlib.pyplot as plt
from PyQt5 import QtCore, QtWidgets
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
import tensorflow as tf
from tensorflow import keras
from sklearn.preprocessing import MinMaxScaler, StandardScaler
class MainWindow(QtWidgets.QMainWi... | MRX7999/Analyze-Singularuity-Spectrume-GUI-and-keras | parse.py | parse.py | py | 12,279 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "PyQt5.QtWidgets",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QWidget",
"line_number": 16,
"usage_type": "call"
},
{
"api_name... |
5039953637 | from copy import copy
import numpy as np
from nestmodel.utils import networkx_from_edges, graph_tool_from_edges, calc_color_histogram, switch_in_out, make_directed
from nestmodel.fast_wl import WL_fast, WL_both
from nestmodel.fast_rewire import rewire_fast, sort_edges, get_block_indices
class FastGraph:
"""A c... | Feelx234/nestmodel | nestmodel/fast_graph.py | fast_graph.py | py | 12,133 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "numpy.uint32",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.uint64",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.array",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "numpy.bincount",
... |
70127505184 | import numpy as np
from scipy import signal
from guidedfilter_MLRI import guidedfilter_MLRI
def interpolation(green, mosaic_color, mask_color, eps):
# parameters for guided upsampling
h, v = 5, 5
# Laplacian
F = np.array(
[
[0, 0, -1, 0, 0],
[0, 0, 0, 0, 0],
... | ADrozdova/demosaic | red_blue.py | red_blue.py | py | 933 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.array",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "guidedfilter_MLRI.guidedfilter_MLRI",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "scipy.signal.convolve2d",
"line_number": 24,
"usage_type": "call"
},
{
"api_name"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.