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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
70735315874 | # %%
import os
import glob
import random
import monai
from os import makedirs
from os.path import join
from tqdm import tqdm
from copy import deepcopy
from time import time
import numpy as np
import torch
from torch.utils.data import Dataset, DataLoader
from datetime import datetime
import cv2
import argparse
from mat... | bowang-lab/MedSAM | comparisons/DeepLabV3+/train_deeplabv3_res50.py | train_deeplabv3_res50.py | py | 8,501 | python | en | code | 1,269 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "torch.device",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.makedirs",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "torch.cuda.empty_cac... |
2837694708 | #!/usr/bin/env python
from setuptools import setup, find_packages
version = __import__('pipetter').VERSION
setup(
name='Pipetter',
version='.'.join([str(v) for v in version]),
description='Uniform registration and processing of inclusion tags for information pulled from other sources, such as websites.',
pac... | melinath/django-pipetter | setup.py | setup.py | py | 430 | python | en | code | 16 | github-code | 1 | [
{
"api_name": "setuptools.setup",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 11,
"usage_type": "call"
}
] |
3243322415 |
# Residual Dense Network for Image Super-Resolution
# https://arxiv.org/abs/1802.08797
from functools import partial
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from model import common
from model.matrix import *
def make_model(args, parent=False):
return MetaRDN(args)... | miracleyoo/Meta-SSSR-Pytorch-Publish | model/metafrdn.py | metafrdn.py | py | 8,590 | python | en | code | 4 | github-code | 1 | [
{
"api_name": "torch.nn.Module",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "torch.nn.Sequential",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"lin... |
20356849460 | from copy import deepcopy
from tqdm import tqdm
class Tokenizer:
"""
两种数据类型的映射的抽象类
"""
def tokenize_A2B(self,data):pass
def tokenize_B2A(self,data):pass
class DictTokenizer(Tokenizer):
def __init__(self,data2label):
"""
输入字典构建词典
如果是一对一的话构建反向词典
... | ReturnTR/PytorchModelCode | CommonTools/TorchTool.py | TorchTool.py | py | 2,338 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "copy.deepcopy",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "transformers.BertTokenizer.from_pretrained",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "transformers.BertTokenizer",
"line_number": 57,
"usage_type": "name"
},
{
... |
19157644863 | import json
from enum import Enum
"""
Innehåller funktioner för att serialisera paket. Alla paket skapas och skickas som ett JSON objekt.
"""
class Types(Enum):
"""
En lista med de olika packettyper, detta är en hårdkodad lista
"""
time = 0
play = 1
pause = 2
def serializeCreateRoom(_alias, ... | Simpag/PythonVideoPlayer | packet.py | packet.py | py | 6,890 | python | sv | code | 0 | github-code | 1 | [
{
"api_name": "enum.Enum",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "json.dumps",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 70,
... |
39560119331 | import numpy as np
import multiprocessing as mp
from itertools import repeat
import time
import pandas as pd
# Custom functions from other files we wrote
import PSOTestFuncs as tf
from PSOInit import pso_init
from PSOInit import qpso_init
from PSOUpdate import veloc_update
from PSOUpdate import point_update
from PSOU... | anyapriya/PSO | PSOMain.py | PSOMain.py | py | 12,258 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PSOInit.pso_init",
"line_number": 115,
"usage_type": "call"
},
{
"api_name": "PSOUpdate.veloc_update",
"line_number": 122,
"usage_type": "call"
},
{
"api_name": "PSOInit.qpso_init",
"line_number": 169,
"usage_type": "call"
},
{
"api_name": "numpy.co... |
5409197519 | from copy import deepcopy
from flask_camp.models import DocumentVersion, User
from flask_camp import current_api
from sqlalchemy.orm.attributes import flag_modified
from c2corg_api.models import ARTICLE_TYPE, XREPORT_TYPE
class DocumentRest:
# on v6, a document can be created and exists without a version.
... | c2corg/c2c_api-poc | c2corg_api/legacy/views/document.py | document.py | py | 1,673 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "c2corg_api.models.ARTICLE_TYPE",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "c2corg_api.models.XREPORT_TYPE",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.orm.attributes.flag_modified",
"line_number": 28,
"usage_type": ... |
26573286125 | import torch
import torchvision
import numpy as np
from torchvision import datasets
import torchvision.transforms as transforms
from torch.utils.data.sampler import SubsetRandomSampler
import torch.optim as optim
import torchvision.models as models
from torchvision.utils import make_grid
import time
import copy
class ... | Constanter/Kaggle | ComputerVision/ImageClassification/FlowersRecognition/PytorchSolution/main.py | main.py | py | 7,551 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.device",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "torchvision.tran... |
17540865999 | import torch
import scanpy as sc
import numpy as np
import pytorch_lightning as pl
from sklearn.preprocessing import LabelEncoder, OneHotEncoder
from torch_geometric.data import HeteroData, InMemoryDataset
from torch_geometric.loader import DataLoader
from data.helpers import downsample_adata, check_normalized
class ... | srdsam/TranscriptomicsGNN | data/CellGeneDataset.py | CellGeneDataset.py | py | 4,055 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch_geometric.data.InMemoryDataset",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.load",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "scanpy.read_h5ad",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "data... |
28303693280 | # Write py4DSTEM formatted .h5 files.
#
# See filestructure.txt for a description of the file structure.
import h5py
import numpy as np
from collections import OrderedDict
from os.path import exists
from os import remove as rm
from .read_utils import is_py4DSTEM_file, get_py4DSTEM_topgroups
from .metadata import meta... | magnunor/py4DSTEM | py4DSTEM/io/native/write.py | write.py | py | 13,944 | python | en | code | null | github-code | 1 | [
{
"api_name": "os.path.exists",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "read_utils.is_py4DSTEM_file",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "read_utils.get_py4DSTEM_topgroups",
"line_number": 37,
"usage_type": "call"
},
{
"api_... |
71464292195 | import pandas as pd
import plotly.express as px
from plotly.subplots import make_subplots
import plotly.graph_objs as go
df = pd.read_csv('data/info_data_job_market_research.csv')
def graph_npuestos_ciudad(df):
df_ub_da = df[df['Tipo puesto'] == 'Data Analyst']
df_ub_da = df_ub_da['Ubicación'].copy()
d... | cespanac/ds_job_market_research | graphs.py | graphs.py | py | 8,698 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.Series",
"li... |
73146219235 | import warnings
import matplotlib.pyplot as plt
from utils.utils import *
from utils.objective import *
if __name__ == '__main__':
warnings.simplefilter('ignore')
asset_list = ['VTI', 'VEA', 'VWO', 'IAU', 'DBC', 'XLB', 'XLE', 'XLF', 'XLI', 'XLK', 'XLP', 'XLU', 'XLV', 'XLY']
price_df = get_price_df(... | hobinkwak/Stock2Vec-Inverse-Volatility | main.py | main.py | py | 1,977 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "warnings.simplefilter",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "matpl... |
25156253486 | import re
import os
import copy
from collections import defaultdict
from collections import Counter
dir_path = os.path.dirname(os.path.realpath(__file__))
file = open(dir_path + '/inputs/day_15.txt', 'r')
lines = file.read().strip().split('\n')
input = [16,1,0,18,12,14,19]
keys = range(0, 30000000)
spoken = {key: No... | jonfriskics/advent_of_code2020 | day_15.py | day_15.py | py | 1,195 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.path.realpath",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "collections.Counter",
... |
11507239217 | import numpy as np
from scipy import io
import matplotlib.pyplot as plt
import hio
import dynamic_support
import Error_Reduction
# 讀檔
filepath = 'D:\IP_20220311_25a\IP_20220311\patched_rawdata_20220311.mat'
patch_data = io.loadmat(filepath)
measured_intensity = (patch_data['sym_rawdata'])
measured_amp = np.sqrt(measure... | github-ywtsai/PyCDI | IP_HIOpack.py | IP_HIOpack.py | py | 4,836 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "scipy.io.loadmat",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "scipy.io",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "numpy.sqrt",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.isnan",
"line_number": 1... |
411212400 | # pylint: disable=W0621,C0114,C0116,W0212,W0613
import pathlib
import textwrap
import pytest
from dae.annotation.annotation_pipeline import AnnotatorInfo, AttributeInfo
from dae.annotation.annotation_factory import AnnotationConfigParser
from dae.genomic_resources import build_genomic_resource_repository
from dae.geno... | iossifovlab/gpf | dae/dae/annotation/tests/test_annotation_pipeline_config.py | test_annotation_pipeline_config.py | py | 13,205 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pathlib.Path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "dae.testing.setup_directories",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "textwrap.dedent",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "textw... |
24901354288 | from hvac import Client
client = Client(
url='Your-Cluster-URL',
namespace='admin',
verify=False
)
client.auth.approle.login(
role_id='Your-Role-Id',
secret_id='Your-Secret-Id'
)
secret = client.read('Your-Secret-Path')
print(secret)
| AbdulManan10/hvac | main.py | main.py | py | 260 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "hvac.Client",
"line_number": 3,
"usage_type": "call"
}
] |
21979960588 | from flask import Flask
from flask import request
from flask import jsonify
from flask.json import dumps
from flask.wrappers import Response
from flask_pymongo import MongoClient
from datetime import datetime
import os
#import sys
#from pymongo import collection, mongo_client
from flask_cors import CORS
CON_STR=f"{os.... | Al3xDiaz/api-rest | backend/main.py | main.py | py | 2,390 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "flask.Flask",
"li... |
24421756975 | from django.urls import path
from .views import*
from .views import delete_user, accept_user,pause_client
urlpatterns = [
path('controle/', controle, name="control"),
path('log', login_admin, name="log"),
path('index2', index2_admin, name="index2_admin"),
path('pause', pause_client, name="pause_client"),
... | SeikaLamproug/Gestion-epargne | controle/urls.py | urls.py | py | 1,683 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
73111182754 | # -*- coding: utf-8 -*-
import scrapy
import time
import re
import datetime
from scrapy.http import Request
from loguru import logger
from SafetyInformation.items import SafeInfoItem
from SafetyInformation.settings import SLEEP_TIME, TOTAL_PAGES
class SecpulseSpider(scrapy.Spider):
name = 'secpulse'
allowed_... | Silentsoul04/SafetyInformation | SafetyInformation/spiders/secpulse.py | secpulse.py | py | 2,422 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "scrapy.Spider",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "loguru.logger.info",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "SafetyInformation... |
34144549460 | import numpy as np
from typing import Union
from sklearn.metrics import mutual_info_score
def mutual_info(
dataX: Union[str, bytes, list, tuple],
dataY: Union[str, bytes, list, tuple],
base=2,
):
"""
Return the mutual information of given dataX and dataY.
Parameters
----------
dataX: ... | Jim137/Entropy | src/mutual_info.py | mutual_info.py | py | 1,365 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "typing.Union",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "sklearn.metrics.mutual_info_score",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "numpy.log",... |
10236991454 | from __future__ import division
import argparse
import logging
import os
import random
import time
import torch
import torch.nn as nn
import torch.optim as optim
from torch import FloatTensor
from torch.autograd import Variable, grad
from torch.utils.data import DataLoader
import torchvision.utils as vu... | CirQ/AnimeNet | main.py | main.py | py | 10,620 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "logging.... |
27933091980 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from sklearn.model_selection import train_test_split
import numpy as np
import tensorflow as tf
import pickle
import scipy.ndimage as img
tf.logging.set_verbosity(tf.logging.INFO)
def cnn_model_fn(f... | mrosen95/COMP551_A3 | CNN1.py | CNN1.py | py | 9,960 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "tensorflow.logging.set_verbosity",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "tensorflow.logging",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.reshape",
"line_number": 15,
"usage_type": "call"
},
{
"api_n... |
38663862525 | # -------------------------------------------------------
# Assignment 1
# Written by Raghav Sharda
# For COMP 472 Section ABJX – Summer 2020
# --------------------------------------------------------
import numpy as np
import shapefile as shp
import matplotlib as mpl
import matplotlib.pyplot as plt
import time
from i... | raghavsharda/Rover | index.py | index.py | py | 5,764 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "itertools.product",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.histogram2d",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.percentile",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplo... |
25314578639 | import uuid
from config import USR_ORG_MONGO_COLLECTION, USR_MONGO_COLLECTION
import db
from models.response import post_error
import logging
log = logging.getLogger('file')
class OrgUtils:
def __init__(self):
pass
#orgId generation
@staticmethod
def generate_org_id():
"""UUID gener... | ishudahiya2001/ULCA-IN-ulca-Public | backend/api/ulca-ums-service/user-management/utilities/orgUtils.py | orgUtils.py | py | 2,852 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "uuid.uuid4",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "db.get_db",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "config.USR_ORG_MONGO_COLLECTION... |
30129412325 | from pymongo import MongoClient
# mongodb instance where database is running
connection_string = "mongodb://localhost:27017"
client = MongoClient(connection_string)
db = client.get_database("idk")
# similar to mysql tables to store data
collection = db.get_collection("information")
# document to insert inside of m... | MasoudKarimi4/MenuMate | server/test.py | test.py | py | 502 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pymongo.MongoClient",
"line_number": 5,
"usage_type": "call"
}
] |
6685906309 | from song import Song
from date_parser import TimeParser
from functools import reduce
import random
from prettytable import PrettyTable
import json
from collections import OrderedDict
class Playlist:
def __init__(self, name='', repeat=False, shuffle=False):
self.name = name
self.repeat = repeat
... | Nimor111/MusicPlayer | src/playlist.py | playlist.py | py | 4,384 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "functools.reduce",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "song.artist",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "song.artist",
"line_number": 52,
"usage_type": "attribute"
},
{
"api_name": "song.artist",
... |
74934231074 | from tools import ToolsCmd
import time
from rich.console import Console
import re
console = Console()
def init_mysql(port, db_v):
console.print('\n7-开始初始化MySQL', style="bold yellow", highlight=True)
if '5.6' in db_v:
init_result = ToolsCmd('/dbs/mysqls/mysql{0}/service/scripts/mysql_install_db --def... | xxyhhd/my_scripts | agent/install_mysql/h_init_mysql.py | h_init_mysql.py | py | 1,581 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "rich.console.Console",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "tools.ToolsCmd",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tools.ToolsCmd",
"l... |
15767671976 | from pyspark import SparkConf, SparkContext
import collections
conf = SparkConf().setMaster("local").setAppName("RatingsHistogram")
sc = SparkContext(conf=conf)
lines = sc.textFile("file:///SparkCourse/ml-100k/u.data")
popular_movies = lines.map(lambda x: (int(x.split()[1]), 1)).reduceByKey(lambda x, y: x+y)
popular_... | TalhaAsmal/Taming-Big-Data-Pyspark-Udemy | popular-movies.py | popular-movies.py | py | 520 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pyspark.SparkConf",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pyspark.SparkContext",
"line_number": 5,
"usage_type": "call"
}
] |
7662295610 | import pygame, functions, sys
class Button(pygame.Rect):
List = []
def __init__(self, action, x, y, width, height, text, textcolor=(0,0,0), color=(255,255,255)):
self.text = text
self.textcolor = textcolor
self.x = x
self.y = y
self.width = width
self.height = height
self.action = action
self.colo... | shhmon/PointBlocks | menuC.py | menuC.py | py | 632 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pygame.Rect",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "pygame.draw.rect",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "functions.text_to_s... |
30416561761 | """Identify RC4 compared to random and RC4A output with the ciphertext's second byte"""
import secrets
import RC4
# random
zeroes = 0
for i in range(65536):
secret = secrets.token_bytes(4)
if int(secret[1]) == 0:
zeroes += 1
print("Random")
print(f"Expected: 256")
print(f"Reality: {zeroes}")
print(f"D... | slightlyskepticalpotat/rc4-variants | identify.py | identify.py | py | 1,047 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "secrets.token_bytes",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "secrets.token_hex",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "RC4.RC4A",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "secrets.token_hex",
... |
72495892835 | import torch
def drmsd(structure_1, structure_2, mask=None):
def prep_d(structure):
d = structure[..., :, None, :] - structure[..., None, :, :]
d = d ** 2
d = torch.sqrt(torch.sum(d, dim=-1))
return d
d1 = prep_d(structure_1)
d2 = prep_d(structure_2)
drmsd = d1 - d2
... | aqlaboratory/openfold | openfold/utils/validation_metrics.py | validation_metrics.py | py | 1,442 | python | en | code | 2,165 | github-code | 1 | [
{
"api_name": "torch.sqrt",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.sum",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.sum",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "torch.min",
"line_number": 19,
"... |
73751347235 | # Recupera las ofertas de la página de Amazon.
# Usamos herramientas de manipulación de strings para no entrar en selenium.
# Al ser una web dinámica y descargarla sin que se ejecute JavaScrip, nos limita solo a
# 8 ofertas, aunqe se puedan recuperar más Ids
#
# EJEMPLO DE USO
#
# app = Amazon()
# data = app.get_data()... | alfonsoma75/web_scraping | amazon.py | amazon.py | py | 6,764 | python | es | code | 1 | github-code | 1 | [
{
"api_name": "file_handle.FileHandle",
"line_number": 69,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 106,
"usage_type": "call"
}
] |
71660254754 | #! /usr/bin/python3
import sys
import serial, time
import os, stat
from os.path import exists
from os import access, R_OK, W_OK
import paho.mqtt.client as mqtt
import configparser
import argparse
parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter,
des... | xn--nding-jua/pv_mqtt_controller | dpm86xx2mqtt.py | dpm86xx2mqtt.py | py | 7,771 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "argparse.RawDescriptionHelpFormatter",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "configparser.RawConfigParser",
"line_number": 17,
"usage_type": "call"
... |
72387697954 | from collections import defaultdict
import heapq
def solution(gems: list[str]):
answer = []
# 우선순위큐 : 데이터를 담을 temp array 생성
temp = []
collected_gem = []
collected_gem = defaultdict(int)
# 최소 스타트 [0] => 보석이름,[1] => 보석 위치
min_start = ''
for idx,gem in enumerate(gems):
collec... | cafe-jun/codingTest-Algo | programmers/2020카카오인턴십/보석쇼핑.py | 보석쇼핑.py | py | 2,236 | python | ko | code | 0 | github-code | 1 | [
{
"api_name": "collections.defaultdict",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "heapq.heappush",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "heapq.heappop",
... |
11506375548 | import tcod
from random import randint
from random_utils import random_choice_from_dict, from_dungeon_level
from entity import Entity
from map_objects.tile import Tile
from map_objects.rect import Rect
from components.ai import Brute
from components.combatant import Combatant
from components.item import Item
from compo... | propfeds/project-regular | map_objects/game_map.py | game_map.py | py | 7,788 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "map_objects.tile.Tile",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "random.randint",
... |
71705104033 | #!/usr/bin/env python
import sys
import json
import logging
import pika
from os import environ
from artnet import dmx
from os.path import realpath, dirname, join
class ArtNetTransmitter(object):
FPS = 15
ARTNET_BROADCAST_IP = "2.255.255.255"
RABBIT_HOST = '192.168.0.42'
def __init__(self):
sel... | arbalet-project/frontage-artnet | transmitter.py | transmitter.py | py | 4,257 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "artnet.dmx",
"line... |
31900400729 | # -*- coding: utf-8 -*-
"""
@File : findTargetSumWays.py
@Author : wenhao
@Time : 2023/2/20 15:55
@LC : 494
"""
from typing import List
from functools import cache
class Solution:
# dp 递推写法 优化:使用 1 个数组
# 为了避免覆盖掉前面的数据,要从右向左更新数组
def findTargetSumWays3(self, nums: List[int], target: int) -> int:... | callmewenhao/leetcode | 基础算法精讲/动态规划/01背包 完全背包 多重背包/findTargetSumWays.py | findTargetSumWays.py | py | 3,772 | python | zh | code | 0 | github-code | 1 | [
{
"api_name": "typing.List",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": ... |
24618527866 | import os
import sys
import numpy as np
import pandas as pd
pd.options.display.float_format = "{:,.2f}".format
import logging
from datetime import datetime, timedelta
from features import quantize
# from __main__ import logger_name
logger_name = "simple_average"
log = logging.getLogger(logger_name)
class SimpleAv... | aleksei-mashlakov/parking-forecast | src/PMV4Cast/simple_average.py | simple_average.py | py | 2,470 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pandas.options",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "numpy.array",
... |
7447934892 | # -*- coding: utf-8 -*-
from OFS.Image import Image
from zope.interface import implements
from zope.component import getUtility
from zope.publisher.interfaces import IPublishTraverse, NotFound
from zope.component import getUtilitiesFor
from Products.Five import BrowserView
from Products.Five.browser.pagetemplatefile im... | UPCnet/ulearn.theme | ulearn/theme/browser/user_profile.py | user_profile.py | py | 4,468 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "Products.Five.BrowserView",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "zope.interface.implements",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "zope.publisher.interfaces.IPublishTraverse",
"line_number": 18,
"usage_type": "argume... |
17398511199 | from math import *
from random import *
import pygame
pygame.init()
win=pygame.display.set_mode((1800,900))
S1=pygame.Surface((200,100))
S2=pygame.image.load("MAP.xcf")
run=True
font=pygame.font.SysFont("papyrus",20)
Sags=pygame.Surface((1,100))
Sags.set_colorkey((0,0,0))
Sags.set_alpha(100)
Glassground=pyg... | makazis/Five-Nights-at-AVG | FNAG.py | FNAG.py | py | 6,701 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygame.init",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "pygame.Surface",... |
40471160368 | import cv2
from cv2 import HOUGH_GRADIENT
import numpy as np
from matplotlib import pyplot as plt
sct_img = cv2.imread('coins.png')
def nothing(x):
pass
H = 103
S = 255
V = 255
Hl = 0
Sl = 191
Vl = 119
while True:
hsv = cv2.cvtColor(sct_img, cv2.COLOR_RGB2HSV)
cv2.imshow('image',hsv)
lower_bl... | GitRekton/EETAC-Applied-Image-Processing | otherMethod.py | otherMethod.py | py | 1,289 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.imread",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "cv2.COLOR_RGB2HSV",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "cv2.imshow",
"line_... |
10053148775 | from typing import Any, Dict, Optional, Tuple
import xml.etree.ElementTree as ET
import chc.util.IndexedTable as IT
def has_control_characters(s: str) -> bool:
for c in s:
if ord(c) < 32 or ord(c) > 126:
return True
else:
return False
def byte_to_string(b: int) -> str:
retu... | static-analysis-engineering/CodeHawk-C | chc/util/StringIndexedTable.py | StringIndexedTable.py | py | 4,513 | python | en | code | 20 | github-code | 1 | [
{
"api_name": "typing.Tuple",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "chc.util.IndexedTable.IndexedTableSuperclass",
"line_number": 66,
"usage_type": "attribute"
},
{
"api_name": "chc.util.IndexedTable",
"line_number": 66,
"usage_type": "name"
},
{
... |
73501757154 | """
Author: Brian Mascitello
Date: 12/16/2017
Websites: http://adventofcode.com/2017/day/14
Info: --- Day 14: Disk Defragmentation ---
--- Part Two ---
"""
import copy
from functools import reduce
def construct_dense_hash(sparse_hash):
constructed_hash = list()
groups_of_sixteen... | Brian-Mascitello/Advent-of-Code | Advent of Code 2017/Day 14 2017/Day14Q2 2017.py | Day14Q2 2017.py | py | 4,323 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "functools.reduce",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "copy.copy",
"line_number": 56,
"usage_type": "call"
}
] |
75082514912 | import os
from collections import Counter
from string import punctuation
import glob
import re
class Transcript:
"""This class is a representation of a transcript following the norm from
the CHILDES database. As long as the raw transcript file follows that norm,
all kinds of informations and extractions f... | KasperFyhn/ChildLangAcqui | src/childes_transcripts.py | childes_transcripts.py | py | 10,751 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.basename",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "string.punctuation",
"line_number": 109,
"usage_type": "name"
},
{
"api_name": "re.split",
"lin... |
32196464996 | """
Scraper for fire alerts in Los Angeles
http://groups.google.com/group/LAFD_ALERT/
RSS: http://groups.google.com/group/LAFD_ALERT/feed/rss_v2_0_msgs.xml?num=50
"""
from ebdata.retrieval.scrapers.base import ScraperBroken
from ebdata.retrieval.scrapers.list_detail import RssListDetailScraper, SkipRecord
from ebdata... | brosner/everyblock_code | everyblock/everyblock/cities/la/fire_alerts/retrieval.py | retrieval.py | py | 4,793 | python | en | code | 130 | github-code | 1 | [
{
"api_name": "ebdata.retrieval.scrapers.newsitem_list_detail.NewsItemListDetailScraper",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "ebdata.retrieval.scrapers.list_detail.RssListDetailScraper",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "datetime.date... |
33653947346 | # encoding: utf-8
import argparse
import os
import sys
import torch
from torch.backends import cudnn
sys.path.append('.')
from config import cfg
from data import make_data_loader
from engine.trainer import do_train, do_train_with_center
from modeling import build_model
from layers import make_loss, make_loss_with_ce... | CASIA-IVA-Lab/ISP-reID | tools/train.py | train.py | py | 3,739 | python | en | code | 90 | github-code | 1 | [
{
"api_name": "sys.path.append",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "data.make_data_loader",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "config.cfg",
... |
30130945625 | from ExtendDT import ext_dt
from Sequence import *
#> Find the optimal sequence for a single node when its children are optimized
def PruneOptimalSingle(xdt, main_seq, root_id):
current_seq = copy.copy(main_seq[root_id])
#* if optimized is not available, make it
if not current_seq.optimized:
#* Be... | masoudinejad/dt_pruning | orapMethod.py | orapMethod.py | py | 5,353 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "multiprocessing.cpu_count",
"line_number": 77,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Pool",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "ExtendDT.ext_dt",
"line_number": 107,
"usage_type": "call"
},
{
"api_name": "Exten... |
27666434875 | import numpy as np
import os
import cv2
from sklearn.feature_extraction import image
import random
import csv
import shutil
def colors_new_train_patches_to_npy_file():
path = '/Users/eloymarinciudad/Downloads/colors_new/train'
label = {'black': 0, 'blue': 1, 'brown': 2, 'green': 3, 'grey': 4, 'orange': 5, '... | eloymc98/ClusterGAN | util.py | util.py | py | 14,002 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "os.listdir",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "os.path.isdir",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number":... |
19612913911 | import os
from os import listdir
from zipfile import ZipFile
import img2pdf
#Get Current Working Directory
zipfolder = os.getcwd()
# read all zip files in folder
for zip_files in os.listdir(zipfolder):# 這三行可以用來避免'.DS_Store' problem in Mac
if not zip_files.endswith(".zip"):
if not zip_files.endswith(".rar"... | jeddstudio/Qunzip | Qunzip.py | Qunzip.py | py | 1,877 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.getcwd",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.path.splitext",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 15,... |
19774523735 | '''
LeetCode #701 - Insert Into a Binary Search Tree prompt:
You are given the root node of a binary search tree (BST) and a
value to insert into the tree. Return the root node of the BST
after the insertion. It is guaranteed that the new value does
not exist in the original BST.
Notice that there may exist multip... | Reddimus/LeetCode_Notes | Trees/LeetCode #701 - Insert into a Binary Search Tree.py | LeetCode #701 - Insert into a Binary Search Tree.py | py | 3,225 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.Optional",
"line_number": 44,
"usage_type": "name"
}
] |
27474072980 | #!/usr/bin/env python3
import pprint, argparse, pickle, json
import maze
def fail(message):
return {
'score' : 0,
'output' : message,
'visibility': 'visible',
}
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description = 'CS440 MP1 Autograder',... | xxxfzxxx/AI-MPs | maze search/grade.py | grade.py | py | 6,537 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentDefaultsHelpFormatter",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "json.dumps",
"line_number": 29,
"usage_type": "call"
},
{
"ap... |
9536429374 | import subprocess
from itertools import product, combinations
import numpy as np
def runner():
SEQ = 'MQYKLILNGKTLKGETTTEAVDAATAEKVFKQYANDNGVDGEWTYDDATKTFTVTE'
AA = ['A', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'K', 'L',
'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'Y']
AA_dict = dict((k,v) for v,k ... | leerang77/UniRep_Epistasis_Prediction | Utils/run_main.py | run_main.py | py | 3,208 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.array",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.savetxt",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.savetxt",
"line_numbe... |
31660008971 | import socket
import os
import multiprocessing
def send_message(s_socket, client_address):
message = 'Hi ' + client_address[0] + ':' + str(client_address[1]) + '. This is server ' + str(
os.getpid())
s_socket.sendto(str.encode(message), client_address)
print('Sent to client: ', message)
... | digitalhhz/DSTutorial_Programmierprojekt | simplepoolserver.py | simplepoolserver.py | py | 1,094 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "os.getpid",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Pool",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "socket.socket",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "socket.AF_INET",
"lin... |
36292377175 | from PIL import Image
im1 = Image.open("lena.png")
im2 = Image.open("lena_modified.png")
#im.show()
width, height = im1.size
print(width)
print(height)
for y in range(height):
for x in range(width):
rgba1 = im1.getpixel( (x, y) )
rgba2 = im2.getpixel( (x, y) )
#print(rgba)
if rgb... | Zrump159/ML2017 | hw0/HW0_Q2.py | HW0_Q2.py | py | 593 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "PIL.Image.open",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 4... |
2209668303 | from rest_framework import serializers
from . import twitterhelper
from .register import register_social_user
import os
from rest_framework.exceptions import AuthenticationFailed
class TwitterAuthSerializer(serializers.Serializer):
"""Handles serialization of twitter related data"""
access_token_key = seriali... | charlesDavid009/tweety | python_tips/social_auth/serializers.py | serializers.py | py | 1,295 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "rest_framework.serializers.Serializer",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.serializers",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "rest_framework.serializers.CharField",
"line_number": 10,
"usage_type... |
15876514759 |
import transformers
from utils import printf
import copy
class prompt:
def __init__(self, tokenizer, max_len, add_eos=True):
self.tokenizer = tokenizer
self.max_len = max_len
self.add_eos=add_eos
class instruct_prompt(prompt):
prompt = (
"Below is an instruction that describes... | Facico/Chinese-Vicuna | prompt.py | prompt.py | py | 9,178 | python | en | code | 4,045 | github-code | 1 | [
{
"api_name": "transformers.DataCollatorForLanguageModeling",
"line_number": 76,
"usage_type": "call"
},
{
"api_name": "utils.printf",
"line_number": 80,
"usage_type": "call"
},
{
"api_name": "utils.printf",
"line_number": 83,
"usage_type": "call"
},
{
"api_name":... |
33489243945 | from dotenv import load_dotenv
from logging import error
import telegram
import requests
import os
import logging
from telegram.ext import CommandHandler, Updater, Filters, MessageHandler
from telegram.message import Message
from pprint import pprint
load_dotenv()
logging.basicConfig(
level=logging.INFO,
form... | Mikhail-Kushnerev/kittybot | kittybot.py | kittybot.py | py | 2,076 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.getenv",
... |
5037552319 | import xml.etree.ElementTree as ET
import subprocess
import asyncio
import sys
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
async def execu... | delyura/FindSameCert | FindSameCert.py | FindSameCert.py | py | 2,909 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "asyncio.create_subprocess_shell",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "asyncio.subprocess",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": ... |
37080385953 | from flask import request
from flask.json import jsonify
from . import habits
from .models import Habit
from .dbmodel import Habitdb
import json
from bson import json_util
from flask_jwt_extended import get_jwt_identity,jwt_required
@habits.route('/',methods=['POST'])
@jwt_required()
def create():
current_user = ... | isaac152/APIHabitsTracker | app/habits/views.py | views.py | py | 1,684 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask_jwt_extended.get_jwt_identity",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "models.Habit",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.request.json",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name... |
24879624643 | from pydantic import ValidationError
from saltapi.web.schema.common import ProposalCode
import pytest
@pytest.mark.parametrize("code", ["2021-1-SCI-001", "2022-2-ORP-007", "2023-1-DDT-001"])
def test_valid_proposal_code(code: str):
assert ProposalCode.validate(code) == code
@pytest.mark.parametrize(
"inval... | saltastroops/salt-api | tests/schema/test_proposal_code_input.py | test_proposal_code_input.py | py | 920 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "saltapi.web.schema.common.ProposalCode.validate",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "saltapi.web.schema.common.ProposalCode",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 7,
"usage_t... |
4185758536 | from PIL import Image, ImageTk
import tkinter
from . import battleship
from .battleshipconfig import *
from .errortypes import BadLocationError, PlacementError
from .gamecanvas import GameCanvas
from .targetgridcanvas import TargetGridCanvas
from .startmenucanvas import StartMenuCanvas
from .imageloader import instanc... | jtaylorsoftware/pyships | pyships/oceangridcanvas.py | oceangridcanvas.py | py | 22,728 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "gamecanvas.GameCanvas",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "tkinter.Tk",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "imageloader.instance.load",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "image... |
4407500695 | import scrapy
import re
from competition.items import CompetitionItem
class CiasiSpider(scrapy.Spider):
name = 'ciasi'
allowed_domains = ['ciasi.org.cn']
# start_urls = ['http://www.ciasi.org.cn/Home/safety/index?sid=15&bid=&cid=&sss=1&year=51,50']
start_urls = ['http://www.ciasi.org.cn/Home/safety/ind... | caojikeai/spider | competition/competition/spiders/ciasi.py | ciasi.py | py | 6,386 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "scrapy.Spider",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "competition.items.CompetitionItem",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "scrapy.Request",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "re... |
42165658616 | #!/usr/bin/python3
#
# Script for dumping/programming SPI flash chips with Hydrabus.
# Based on HydraBus BBIO documentation: https://github.com/hydrabus/hydrafw/wiki/HydraFW-Binary-SPI-mode-guide
#
# Author: MrKalach [https://github.com/MrKalach]
# License: GPLv3 (https://choosealicense.com/licenses/gpl-3.0/)
#
import... | hydrabus/hydrafw | contrib/SPI_flasher/HydraSPI.py | HydraSPI.py | py | 12,969 | python | en | code | 305 | github-code | 1 | [
{
"api_name": "serial.Serial",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "hexdump.dump",
"line_number": 126,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 294,
"usage_type": "call"
},
{
"api_name": "argparse.Argumen... |
1620437423 | import spacy
import re
import pickle
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
from sklearn.linear_model import LogisticRegression
from sklearn.naive_bayes import MultinomialNB
from sklearn.neural_network import MLPClassifier
from sklearn.linear_model import SGDClassifier
from sklearn... | EdiZ935/Clasificaci-n-de-20-noticias | clasification.py | clasification.py | py | 7,032 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "spacy.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 4... |
11037745361 | """Script that starts a P300 Speller. Run with 'python p300_speller' to show config window.
Default configuration loaded at startup is stored in /config_files/default.cfg. Creates an LSL stream of type
'P300_Marker' with one channel of 'int8' sending a marker every time an image flashes.
The script consists of three ... | bstadlbauer/lsl-p300-speller | src/bstadlbauer/p300speller/p300_speller.py | p300_speller.py | py | 21,451 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "configparser.RawConfigParser",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "tkinter.IntVar",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "tkinter.StringVar",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "tkinter... |
25160213168 | ## objectives ##
# objective - build dashboard using 'OldFaithful.csv'
# display as a scatterplot
# D = data of recordings in month (August)
# X duration of current eruptions in minutes
# Y waiting time until the next eruption
import dash
import dash_html_components as html
import dash_core_components as dc... | eugeniosp3/udemy_plotly_course | simple_dash exercise.py | simple_dash exercise.py | py | 1,476 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "dash.Dash",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "dash_html_components.Div",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "dash_html_componen... |
8999728817 | from sklearn.base import BaseEstimator, TransformerMixin
import pandas as pd
from data_processing.helpers.check_if_nans_exist import check_if_nans_exist
from data_processing.helpers.columns_that_contain_lists import columns_that_contain_lists
class RemoveNan(BaseEstimator, TransformerMixin):
def __init__(self, k... | arctic-source/game_recommendation | data_processing/transformers/RemoveNan.py | RemoveNan.py | py | 1,550 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sklearn.base.BaseEstimator",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "sklearn.base.TransformerMixin",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_... |
1704389554 | from LoadData import *
import statsmodels.api as sm
import pandas as pd
import numpy as np
from diagnosticTests import *
data = loadAll() #just returns the database
data['GDP_lag1'] = data['GDP_perCap'].shift(1) #lag column for GDP variable
data['CO2_lag1'] = data['Annual_CO2_emissions_TperCap'].shift(1) #lag column ... | SalFin99/CO2_GPD | OLSmodels/LinearOLS_fixed.py | LinearOLS_fixed.py | py | 964 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "statsmodels.api.add_constant",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "statsmodels.api",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "statsmodels.api.OLS",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "stat... |
5169905792 | from PIL import Image
from django.shortcuts import render
import os
def papaya_find_ripe_raw():
path = 'webs/color/papaya/'
directory= os.listdir(path)
if len(directory) == 2:
img = Image.open('webs/color/papaya/raw_papaya.png')
black = 0
papaya_raw = 0
for pixel in... | LoneWolf1999-Th/Fruit_Detect | webs/controller/papaya_ripe_or_raw.py | papaya_ripe_or_raw.py | py | 1,228 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.listdir",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "PIL.Image.open",
"line_number": ... |
8337571690 | import time
import os
import hashlib
from absl import app, flags, logging
from absl.flags import FLAGS
import tensorflow as tf
import lxml.etree
import tqdm
flags.DEFINE_string('data_dir', './my_data/voc2020_raw/VOCdevkit/VOC2020/',
'path to raw PASCAL VOC dataset')
flags.DEFINE_enum('... | christos-vasileiou/yolov3tiny-edgetpu | tools/fire_smoke_tfrecord.py | fire_smoke_tfrecord.py | py | 5,359 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "absl.flags.DEFINE_string",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "absl.flags",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "absl.flags.DEFINE_enum",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "absl.flags... |
38782305735 | import logging
from datetime import datetime, timedelta
import random
import pytest
import pytz
from show_my_solutions.dbmanager import Submission
OJS = ['POJ', 'LeetCode', 'Codeforces', 'TopCoder', 'HackerRank', 'ACM']
MAX_ROW = 100
LOGGER = logging.getLogger(__name__)
def setup_module(module):
from show_my_s... | yehzhang/Show-My-Solutions | tests.py | tests.py | py | 3,816 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "show_my_solutions.dbmanager.start_database",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 21,
"usage_type": "call"
},
{
"api_n... |
19707782223 | from setuptools import setup, find_packages
import os
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as README:
DESCRIPTION = README.read()
with open('requirements.txt') as f:
required = f.read().splitlines()
setup(
name='OpenReader',
version='0.1',
packages = find_packages(),
... | craigsonoffergus/OpenReader | setup.py | setup.py | py | 580 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_n... |
34468081224 | import pyarrow.compute as pc
import pyarrow as pa
import numpy as np
from typing import Iterator, Tuple, List
from ..model.types import (
SubjectSymbol,
SourceSymbol,
ExchangeSymbol,
InstrumentSymbol,
MarketSymbol,
Timestamp,
FileId,
)
DAY_NANOSECONDS = 24 * 60 * 60 * 10 ** 9
PARTITION_COLU... | walling/trading | lib/datatool/write/partitioning.py | partitioning.py | py | 2,619 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "pyarrow.ChunkedArray",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "pyarrow.DictionaryType",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "pyarrow.chunked_array",
"line_number": 26,
"usage_type": "call"
},
{
"api_n... |
3215553627 | from django.db import models
from django.contrib.auth import get_user_model
from django.utils import timezone
from datetime import datetime
from django.utils.translation import gettext_lazy as _
from service.models import Skill
User = get_user_model()
class Expert(models.Model):
user = models.OneToOneField(User,... | amoo-sajad/arp-project | expert/models.py | models.py | py | 2,825 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.contrib.auth.get_user_model",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "django.db.models.Model",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 11,
"usage_type": "name"
},
{
"ap... |
6900603378 | import os
import jinja2
import yaml
def load_config(config_directory, env_file, config_env_overrides=None):
if config_env_overrides is None:
config_env_overrides = {}
with open(os.path.join(config_directory, env_file)) as env_fd:
config_env = yaml.load(env_fd)
for key, value in config_e... | vvgolubev/blabbermouth | blabbermouth/util/config.py | config.py | py | 952 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "yaml.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "jinja2.Environment",
"line_nu... |
25888909951 | from django import forms
from django.shortcuts import render, redirect
from .forms import DetailForm
from datetime import datetime
import string
import csv
# Create your views here.
def index(request):
print("HELLO")
if request.method == 'POST':
form = DetailForm(request.POST)
if form.is_valid... | rupenchitroda/hackathon | DocOnGo/views.py | views.py | py | 3,266 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "forms.DetailForm",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "forms.DetailForm",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "django.shor... |
32497373603 | # https://leetcode.com/problems/middle-of-the-linked-list/
from typing import Optional
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
def middleNode(self, head: Optional[ListNode]) -> Optional[ListNode]:
first, second = head, he... | augini/algorithms_ds | Leetcode/876.py | 876.py | py | 452 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "typing.Optional",
"line_number": 12,
"usage_type": "name"
}
] |
70601213475 |
from typing import Any
from django import http
from django.shortcuts import render, redirect
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from common.models import Insumo, Proveedor
from django.views import View
from django.views.decorators.csrf import csrf_... | leanmsan/proyecto-ITSE | NeumaticosSgo/insumos/views.py | views.py | py | 2,674 | python | es | code | 2 | github-code | 1 | [
{
"api_name": "django.views.View",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "django.utils.decorators.method_decorator",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "django.views.decorators.csrf.csrf_exempt",
"line_number": 17,
"usage_type": "a... |
72919968353 | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import (
IndexView,
AutorListCreateAPIView,
AutorRetrieveUpdateDestroyAPIView,
CategoriaListCreateAPIView,
CategoriaRetrieveUpdateDestroyAPIView,
EditorialListCreateAPIView,
EditorialRetrieveU... | aaronbarra040998/biblioteca-v | proyecto/api/urls.py | urls.py | py | 1,291 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "rest_framework.routers.DefaultRouter",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "views.LibroViewSet",
"line_number": 17,
"usage_type": "argument"
},
{
"api_name": "django.urls.path",
"line_number": 20,
"usage_type": "call"
},
{
"api_... |
5542013576 | from django.shortcuts import redirect, render
from core.models import Jornada
from django.views.generic import ListView, CreateView, UpdateView, DeleteView
from django.core.serializers import serialize
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
from dj... | AdolfoCunquero/Colegio | core/views/jornada/views.py | views.py | py | 3,662 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.views.generic.ListView",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "core.models.Jornada",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "core.forms.jornada.forms.JornadaForm",
"line_number": 14,
"usage_type": "name"
},
{... |
5593742103 | tags = set()
fo = open("a_example.txt","r")
photos = []
for i in fo:
photos.append(i)
photos = [photos[0]]+[photos[1]]+[photos[2]+photos[3]]+[photos[4]]
photos[2] = "H 3 selfie smile garden\n"
# print(photos)
for i in range(len(photos)):
x = len(photos[i])
photos[i] = photos[i][:x-1]
n = int(photos[0])
n =... | mayank-kumar-giri/Competitive-Coding | HashCode/test.py | test.py | py | 1,649 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "itertools.combinations",
"line_number": 55,
"usage_type": "call"
}
] |
21245458777 | from models import *
from dataset import *
import argparse
import os
import glob
import tqdm
from torchvision.utils import make_grid
from PIL import Image, ImageDraw
import skvideo.io
import ssl
import cv2
import json
import matplotlib.pyplot as plt
import numpy as np
import av
def extract_frames(video_path):
fra... | LeoYin/Course-Project-Action-Recognition | test_on_video.py | test_on_video.py | py | 6,161 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "av.open",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "ssl._create_default_https_context",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "ssl._create_unverified_context",
"line_number": 25,
"usage_type": "attribute"
},
{
... |
3649536709 | #!/bin/python
"""Stastics of GC information, GCskew / GCratio / Nratio"""
__date__ = "2023-4-11"
__author__ = "Junbo Yang"
__email__ = "yang_junbo_hi@126.com"
__license__ = "MIT"
"""
The MIT License (MIT)
Copyright (c) 2022 Junbo Yang <yang_junbo_hi@126.com> <1806389316@pku.edu.cn>
Permission is here... | joybio/custom_scripts | GC_information_for_circos/GC_infor_for_circos.py | GC_infor_for_circos.py | py | 5,210 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "optparse.OptionParser",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 66,
"usage_type": "attribute"
},
{
"api_name": "sys.exit",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "sys.exit",
"line_num... |
43110373172 | """
Contains functions for common support adjustments.
Created on Thu May 11 16:30:11 2023
@author: MLechner
# -*- coding: utf-8 -*-
"""
from copy import deepcopy
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection im... | MCFpy/mcf | mcf/mcf_common_support_functions.py | mcf_common_support_functions.py | py | 21,725 | python | en | code | 12 | github-code | 1 | [
{
"api_name": "mcf.mcf_data_functions.get_treat_info",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "mcf.mcf_data_functions",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "mcf.mcf_general.get_key_values_in_list",
"line_number": 30,
"usage_type": "c... |
36307774911 | from twilio.rest import Client
import os
def send(body='Some body', to=''):
# Your Account Sid and Auth Token from twilio.com/console
# DANGER! This is insecure. See http://twil.io/secure
account_sid = os.getenv("sid")
auth_token = os.getenv("token")
sender = os.getenv("from_")
recepient = os.g... | gmihov001/Queue-Mgmt-API-Flask | src/sms.py | sms.py | py | 514 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.getenv",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 10,
"us... |
15436207408 | from flask import Flask, jsonify, request
import cv2
import tensorflow as tf
import keras
import numpy as np
import requests
from labels.dog_label import dog_label
app = Flask(__name__)
MODEL_PATH = "./models/loaded_2.h5"
app.run(host='0.0.0.0', port=5000)
def load_model():
loaded_model = keras.models.load_mo... | devRangers/smg-ana-prototype | data/app.py | app.py | py | 1,309 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "keras.models.load_model",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "keras.models",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "numpy.asarray",... |
73789734115 | import numpy as np
import cv2
import dlib
import torch
import torch.nn as nn
import torchvision.transforms as transforms
from torchvision import models
from PIL import Image
import pygame
device = torch.device('cpu')
num_classes = 4
path = 'epoch-99.pt'
classes = {'closed': 0, 'normal': 1, 'side': 2, 'yawn': 3}
model... | Nithya-Satheesh/Drowsiness-And-Distraction-Detection-System | real-time.py | real-time.py | py | 3,070 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "torch.device",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torchvision.models.resnet18",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torchvision.models",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "torch.nn.... |
32271389388 | import os
import azure.cognitiveservices.speech as speechsdk
def recognize_from_microphone():
# This example requires environment variables named "SPEECH_KEY" and "SPEECH_REGION"
speech_key = 'bb8bd625ed4e4a4ba60392152e02eb7c'
speech_region = 'eastus'
speech_config = speechsdk.SpeechConfig(subscription... | AlexOlivaresP/Transcriptor-RPC | voz.py | voz.py | py | 1,468 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "azure.cognitiveservices.speech.SpeechConfig",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "azure.cognitiveservices.speech",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "azure.cognitiveservices.speech.audio.AudioConfig",
"line_number": 12... |
16565100780 | from os import path
from setuptools import setup, find_packages
from powerdataclass.VERSION import __VERSION__
package_name = 'powerdataclass'
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
na... | arishpyne/powerdataclass | setup.py | setup.py | py | 1,210 | python | en | code | 9 | github-code | 1 | [
{
"api_name": "os.path.abspath",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number"... |
71631120355 | from utils import mock_fairseq
mock_fairseq() # noqa: E402
from tseval.qats import get_qats_train_data, evaluate_scoring_method_on_qats
from tseval.feature_extraction import get_all_vectorizers
def test_get_qats_train_data():
sentences, labels = get_qats_train_data(aspect='simplicity')
assert sentences.shape... | facebookresearch/text-simplification-evaluation | tests/test_qats.py | test_qats.py | py | 566 | python | en | code | 46 | github-code | 1 | [
{
"api_name": "utils.mock_fairseq",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "tseval.qats.get_qats_train_data",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "tseval.feature_extraction.get_all_vectorizers",
"line_number": 14,
"usage_type": "call"
... |
18972801594 | import telegram
import telegram.ext
import time
import threading
# custom library
from handler import SuperHandler
import callback
import exrates
# token of the bot. For individual use, you should enter yous
TOKEN = open('token.txt', mode='r').read()
# add functionality to the bot
def create_updater(token) -> telegr... | AndrewChmutov/TelegramWallet | main.py | main.py | py | 1,115 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "telegram.ext.Updater",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "telegram.ext",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "handler.SuperHandler.get_handler",
"line_number": 19,
"usage_type": "call"
},
{
"api_name"... |
38684301063 | import cv2
import numpy as np
from PIL import Image, ImageOps, ImageTk, ImageFilter
def apply_median_filter(img, ksize):
# Apply the median filter
img = cv2.medianBlur(img, ksize)
# Convert the NumPy array to a PIL image
# pil_img = Image.fromarray(img)
# return pil_img
return img
def apply_... | nicole-kozhuharova/bachelorArbeit | venv/bachelorArbeit/algorithm/functions/medianFilterFunc.py | medianFilterFunc.py | py | 1,449 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "cv2.medianBlur",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "PIL.Image.fromarray",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "PIL.Image",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "PIL.ImageFilter.SHARPEN",... |
20741888168 | from typing import Annotated, List, Optional
from mypy_extensions import TypedDict
RaiderDictionary = TypedDict("RaiderDictionary", {"address": str, "ranking": int})
RaiderWithAgentDictionary = TypedDict(
"RaiderWithAgentDictionary", {"address": str, "ranking": int, "agent_address": str}
)
CurrencyDictionary = Ty... | planetarium/world-boss-service | world_boss/app/stubs.py | stubs.py | py | 1,112 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "mypy_extensions.TypedDict",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "mypy_extensions.TypedDict",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "mypy_extensions.TypedDict",
"line_number": 9,
"usage_type": "call"
},
{
"api_na... |
24328717943 | """Read NestedSamples from UltraNest results."""
import os
import json
from anesthetic.samples import NestedSamples
def read_ultranest(root, *args, **kwargs):
"""Read UltraNest files.
Parameters
----------
root : str
root name for reading files in UltraNest format, i.e. the files
``<r... | handley-lab/anesthetic | anesthetic/read/ultranest.py | ultranest.py | py | 1,314 | python | en | code | 51 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "json.load",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number":... |
38940687657 |
import stripe
from stripe.error import AuthenticationError, InvalidRequestError
from django.conf import settings
# from .models import StripeConfig, SillyStripeConfig
# color parameters: style;background (30 is none);foreground
color = {
"end": "\x1b[0m",
"info": "\x1b[0;30;36m",
"success": "\x1b[0;30;3... | byoso/django-silly-stripe | django_silly_stripe/conf.py | conf.py | py | 1,495 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.conf.settings.SILLY_STRIPE",
"line_number": 51,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings",
"line_number": 51,
"usage_type": "name"
},
{
"api_name": "django.conf.settings.SILLY_STRIPE",
"line_number": 52,
"usage_type": "attribu... |
23718020693 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 15 08:02:43 2018
@author: mfromano
"""
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 2 10:31:21 2018
@author: mfromano
"""
# run hua-an's motion correction
import motion_correction2
import scipy.io as sio
import numpy as... | HanLabBU/micro-control-final | matlab_src/bin/hua-an_code/test_motion_correct_results.py | test_motion_correct_results.py | py | 614 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "scipy.io.loadmat",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "scipy.io",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "numpy.arange",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "motion_correction2.motion_corr... |
41898385777 | import os
from astropy.io import fits
import numpy as np
from . import db_indicies as dbi
from . import load_fits
# Indicies of fits file arrays2018/180625/101501_180625.1129.fits
FLG_IND = 4
TEL_DIV_IND = 5
def write_back_tellurics(spectrum_path, model, pwv, order_wv_ranges, shards):
# 1: Open file
f = fits.o... | chrisleet/selenite | selenite/load_store/write_fits.py | write_fits.py | py | 3,256 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "astropy.io.fits.open",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "astropy.io.fits",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "numpy.zeros",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"lin... |
31944377025 | from PyQt5.QtCore import QCoreApplication
from PyQt5.QtGui import QColor
from qgis.PyQt.Qt import QVariant
from qgis.core import (QgsProcessing,
QgsFeatureSink,
QgsProcessingAlgorithm,
QgsProcessingParameterFeatureSource,
QgsPro... | dsgoficial/Ferramentas_Producao | modules/qgis/processingAlgs/spellCheckerAlg.py | spellCheckerAlg.py | py | 6,299 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "Ferramentas_Producao.modules.qgis.processingAlgs.processingAlg.ProcessingAlg",
"line_number": 47,
"usage_type": "name"
},
{
"api_name": "qgis.core.QgsProcessingParameterMultipleLayers",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "qgis.core.QgsProcessi... |
73078421474 | from sklearn.decomposition import KernelPCA
from matplotlib import pyplot as plt
import pandas as pd, numpy as np, os
import pywt
base_path = os.path.dirname(os.path.abspath(__file__))
data_path = os.path.join(base_path, "../data/12053002165")
output_path = os.path.join(base_path, "../data/solar")
if not os.... | apie0419/solar_power_prediction | hourahead/process_data.py | process_data.py | py | 3,653 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "os.path.dirname",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_nu... |
12194770935 | import nextcord
from nextcord.ext import commands, tasks
import openai
import os
import re
from langdetect import detect
from config import TRANSLATE_CHANNEL
# Initialize the OpenAI API
openai.api_key = os.environ['Key_OpenAI']
def is_english(text):
try:
return detect(text) == 'en'
except:
ret... | CryptoAutistic80/Nextcord-Cog-Bot | cogs/translator.py | translator.py | py | 4,573 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "openai.api_key",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "langdetect.detect",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "re.sub",
"l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.