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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11947190227 | from flask import Flask,render_template,request
from flask_mysqldb import MySQL
from random import randint
# import json
app = Flask(__name__)#interface between webserver and web application
app.config['MYSQL_HOST'] = 'localhost'
app.config['MYSQL_USER'] = 'aman1'
app.config['MYSQL_PASSWORD'] = '1234'
app... | amanjhaaa/mvc-ncd | app1.py | app1.py | py | 5,249 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask.Flask",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "flask_mysqldb.MySQL",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "flask.render_tem... |
20948890617 | from keras.models import Model, Input
from keras.layers import LSTM, Embedding, Dense, TimeDistributed, Dropout, Conv1D, MaxPool1D, \
Flatten, concatenate
from __layers__ import *
from __logger__ import LOGGER_NAME
import logging
from __paths__ import path_to_lm, path_to_language_models
import json
logger = loggin... | kolikaran1992/NaturalLanguageProcessing | LanguageModel/model.py | model.py | py | 8,736 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "__logger__.LOGGER_NAME",
"line_number": 10,
"usage_type": "argument"
},
{
"api_name": "__paths__.path_to_lm.joinpath",
"line_number": 12,
"usage_type": "call"
},
{
"api_na... |
8747037255 | import os, sys
import logging
import argparse
data_path = r"http://livecell-dataset.s3.eu-central-1.amazonaws.com/LIVECell_dataset_2021/images.zip"
def parse_opt():
parser = argparse.ArgumentParser()
parser.add_argument('--save_path', type=str, default="data/coco", help='path to save downloaded data')
re... | avgurov2000/LIVECell | load_data.py | load_data.py | py | 2,523 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.access",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.R_OK",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "os.W_OK",
"line_num... |
72864231262 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
import pprint
import random
import shutil
import sys
import warnings
import logging
import time
import threading
import torch
import torch.npu
import torch.backends.cudnn as cudnn
im... | Ascend/ModelZoo-PyTorch | PyTorch/contrib/cv/pose_estimation/HigherHRNet/tools/dist_train.py | dist_train.py | py | 16,146 | python | en | code | 31 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "argparse.REMAINDER",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "config.update_config",
"line_number": 95,
"usage_type": "call"
},
{
"api_name": "... |
34508911560 | import torch
import numpy as np
from sklearn.datasets import make_blobs
from torch.autograd import Variable
import matplotlib.pyplot as plt
class Feedforward(torch.nn.Module):
def __init__(self, input_size, hidden_size):
super(Feedforward, self).__init__()
self.input_size = input_size
... | wanaaaa/cnnBasic | regressionTorch/feedFoward.GPU.py | feedFoward.GPU.py | py | 2,736 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.nn",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Linear",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.ReLU",
"line_... |
35490385105 | import cv2
import numpy as np
from keras.models import model_from_json
from keras.preprocessing.image import img_to_array
import _thread
arquivo = open('modelo_01_expressoes.json', 'r')
estrutura_rede = arquivo.read()
arquivo.close()
modelo = model_from_json(estrutura_rede)
modelo.load_weights('model_weights.h5')
ca... | luishresende/Emotion-Identifier | main.py | main.py | py | 2,190 | python | pt | code | 0 | github-code | 7 | [
{
"api_name": "keras.models.model_from_json",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "cv2.CascadeClassifier",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "c... |
6484478261 | import requests
import time
from functools import lru_cache
# Dictionary to keep track of URL access count
url_access_count = {}
def update_access_count(url):
"""Helper function to update URL access count."""
url_access_count[url] = url_access_count.get(url, 0) + 1
def get_page(url):
"""Fetches the HTM... | ShogoMark/alx-backend-storage | 0x02-redis_basic/web.py | web.py | py | 766 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "functools.lru_cache",
"line_number": 19,
"usage_type": "call"
}
] |
4371679532 | import os
import json
import codecs
import collections
import argparse
import glob
import re
def sentence2words(s):
# Turn words to lowercase
s = s.lower()
# Turn '-' to space in sentence
s = re.sub("[-']", ' ', s)
# Split sentence to words
words = s.split(' ')
# Strip )(;"?!.,
words = [ re.sub('[)(;"... | jingxil/SeqMatchSeq | customize_embedding.py | customize_embedding.py | py | 2,690 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "re.sub",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "codecs.open",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 31,
... |
14854076912 | import csv
import xml.etree.ElementTree as ET
tree = ET.parse('sb_sortiment.xml')
root = tree.getroot()
print('year,name,name2,price,price_per_liter,size')
for i in root.findall("./artikel/[Ursprung='Champagne']"):
year = i.find('Argang').text or "NV"
name = i.find('Namn').text or ""
name2 = i.find('Namn2').tex... | pontuspalmenas/ctbolaget | build.py | build.py | py | 832 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "xml.etree.ElementTree.parse",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "xml.etree.ElementTree",
"line_number": 4,
"usage_type": "name"
}
] |
25099918327 | import streamlit as st
import pathlib
from PIL import Image
from io import BytesIO, StringIO
from fastbook import *
from fastai.vision.widgets import *
from fastai.vision.all import *
@st.experimental_memo
def get_categories(_model):
return _model.dls.vocab
def showcase():
st.header('Thomas More - Big Data... | DavidSilTroy/python-Big-Data-Image_classification | showcase.py | showcase.py | py | 1,311 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "streamlit.experimental_memo",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "streamlit.header",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "streamlit.subheader",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": ... |
39590743950 | #!/usr/bin/env python
try:
import apt
except ImportError:
pass
from powerline.lib.threaded import ThreadedSegment, with_docstring
class AptUpgradesSegment(ThreadedSegment):
interval = 300
def update(self, oldthing):
upgrades = 0
for pkg in apt.Cache():
if pkg.is_upgradabl... | thefinn93/miniature-octo-batman | miniatureOctoBatman/packages.py | packages.py | py | 769 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "powerline.lib.threaded.ThreadedSegment",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "apt.Cache",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "powerline.lib.threaded.with_docstring",
"line_number": 28,
"usage_type": "call"
}
] |
25032864697 | import json
import requests
from src.variables import authentication_url, account_url
def authentification(username="admin", password="admin"):
try:
payload = {
'j_username': username,
'j_password': password,
'remember-me': 'true',
'submit': 'Login'
... | reachcorp/colissithon | src/services/connection_service.py | connection_service.py | py | 1,906 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.Session",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "src.variables.account_url",
"line_number": 16,
"usage_type": "argument"
},
{
"api_name": "src.variables.authentication_url",
"line_number": 24,
"usage_type": "name"
},
{
"a... |
36006665951 | import numpy as np
import glob
from sklearn.decomposition import PCA
from PIL import Image
from numpy import *
import os
import matplotlib.pyplot as plt
def loadpngs():
trainData = []
trainLabels = []
for filename in glob.glob('/home/gpietro/PhD/examsUB/610-DL/Handwritten-and-data/Cursive/imagesMod/*.... | gpfarina/deep-learning-project | script.py | script.py | py | 1,503 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "glob.glob",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path.basename",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image.open",
"line_nu... |
35724097689 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Get, for each node, the performance observed for each PIR
# Note: this script assumes 3 PIRs and f=1
# argv[1]: experiment directory
import sys
import os
import re
import scipy
num_faults = 1
def load_results(directory):
print("#\tPIR_X\tlat +/- stdev (ms)\tthr ... | plaublin/RBFT | scripts/get_observed_performance_during_attack_2fp1instances.py | get_observed_performance_during_attack_2fp1instances.py | py | 4,943 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "os.listdir",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "scipy.array",
"line_number": 135,
"usage_type": "call"
},
{
"api_name": "scipy.array",
"line_number": 145,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 15... |
73690499744 | import argparse
import datetime
import glob
import os
import random
import sys
import time
from PIL import Image
from PIL.PngImagePlugin import PngInfo
try:
sys.path.append(glob.glob('../carla/dist/carla-*%d.%d-%s.egg' % (
sys.version_info.major,
sys.version_info.minor,
'win-amd64' if os.na... | Farama-Foundation/D4RL | d4rl/carla/data_collection_agent_lane.py | data_collection_agent_lane.py | py | 16,498 | python | en | code | 1,058 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "glob.glob",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sys.version_info",
"line_... |
72186813662 | from typing import Generator
import asyncio
import os
import helpers
import pytest
import hiyori
@pytest.fixture(autouse=True, scope="session")
def update_resolver() -> None:
desired_resolver = os.environ.get("HIYORI_RESOLVER")
if desired_resolver is None:
return
if desired_resolver == "SYSTEM... | futursolo/hiyori | tests/conftest.py | conftest.py | py | 2,087 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "os.environ.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "hiyori.resolvers",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "hiyori.resolvers... |
72899260063 | import json
from datetime import datetime
from logging import Logger, getLogger
from typing import List, Dict, Any, Set, Optional, Tuple
from kombu import Connection
from redis import Redis
from webdav3.exceptions import RemoteResourceNotFound
from celery.app.control import Inspect
from text_extraction_system.config i... | LexPredict/text-extraction-system | text_extraction_system/text_extraction_system/task_health/task_health.py | task_health.py | py | 5,842 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "text_extraction_system.constants.tasks_pending",
"line_number": 16,
"usage_type": "argument"
},
{
"api_name": "text_extraction_system.file_storage.get_webdav_client",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "celery.app.control.Inspect",
"line_n... |
27333143023 | import json
from urllib import urlencode
from twisted.internet.defer import inlineCallbacks
from twisted.web import http
from vumi.tests.helpers import VumiTestCase
from vumi.tests.utils import LogCatcher
from vumi.transports.airtel import AirtelUSSDTransport
from vumi.message import TransportUserMessage
from vumi.ut... | praekeltfoundation/vumi | vumi/transports/airtel/tests/test_airtel.py | test_airtel.py | py | 17,618 | python | en | code | 416 | github-code | 7 | [
{
"api_name": "vumi.tests.helpers.VumiTestCase",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "vumi.transports.tests.helpers.TransportHelper",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "vumi.transports.airtel.AirtelUSSDTransport",
"line_number": 23,... |
17736091805 | import torch
'''
For the kwargs below, we required the all the values in the dictionary are tensors.
Usually the basic keys in the kwargs are spot,volatility,expiry and risk-free rate. The keys should meet the requirements of the pricer.
'''
@torch.enable_grad
def delta(pricer,create_graph:bool=False,**kwargs)->torch... | jialuechen/quantorch | quantorch/risk/greeks.py | greeks.py | py | 1,809 | python | en | code | 8 | github-code | 7 | [
{
"api_name": "torch.autograd.grad",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.autograd",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.ones_like",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.enable_... |
32949096378 | from __future__ import (
absolute_import, division, print_function, unicode_literals,
)
from builtins import * # noqa: F401,F403; pylint: disable=redefined-builtin,unused-wildcard-import,useless-suppression,wildcard-import
from future.builtins.disabled import * # noqa: F401,F403; pylint: disable=redefined-builtin... | posita/dropbox-api-primer | tests/test_doctests.py | test_doctests.py | py | 4,607 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "re.escape",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "os.path.sep",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "os.path",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "logging.getLogger",
"line_numb... |
71137134305 | import sys
import numpy as np
import pandas as pd
import mpl_toolkits.mplot3d.art3d as art3d
import matplotlib.pyplot as plt
from cmath import nan
import copy,re,itertools
from .constant import cluster_name
from copy import deepcopy
import subprocess
import re
from math import isclose
def first_cycle_func(isite,nn_da... | Kazushige-Takenaka/DCA | Distance_based_on_Cluster_Analysis/read_info.py | read_info.py | py | 9,846 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "cmath.nan",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "copy.deepcopy",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "cmath.nan",
"line_number": 34,
"usage_type": "name"
},
{
"api_name": "pandas.DataFrame",
"line_number... |
37131540568 | # from Ball import Ball
# from Ball import BALL_RADIUS
import os, sys
import pygame
import pygame.gfxdraw
from pygame import font
import random
import math
from pygame.locals import *
from TextInput import TextInput
import pymunk
import pymunk.pygame_util
from Border import Border
from Pocket import Pocket
f = pygame... | nza3552/AIB | venv/Table.py | Table.py | py | 2,123 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pygame.font.Font",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pygame.font",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pygame.disp... |
70996447583 | """
run all: python -m pytest -sv --cov-report term-missing --cov=element_calcium_imaging --sw -p no:warnings tests/
run one: python -m pytest -sv --cov-report term-missing --cov=element_calcium_imaging --sw -p no:warnings --pdb tests/module_name.py -k function_name
"""
import os
import pathlib
import sys
from context... | datajoint/element-calcium-imaging | tests/__init__.py | __init__.py | py | 2,058 | python | en | code | 8 | github-code | 7 | [
{
"api_name": "datajoint.logger",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout",
"line_number": 38,
"usage_type": "attribute"
},
{
"api_name": "os.devnull",
... |
7505018527 | import json
# Return json data
def readJson(path):
try:
with open(path) as fh:
return json.load(fh)
except Exception as e:
print("Error", e)
# Return json data
def writeJson(path, jsonData, mode = 'w'):
try:
with open(path, mode) as outfile:
json.dump(jsonDa... | lozthiensu/getTro | handleFileJson.py | handleFileJson.py | py | 385 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "json.load",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 15,
"usage_type": "call"
}
] |
15219639793 | """Bag class definitions."""
import heapq
from abc import ABCMeta, abstractmethod
from collections import defaultdict
from collections.abc import Collection, Hashable, Set
from operator import itemgetter
from ._util import deprecated
__all__ = (
'Bag',
'BagView',
'CountsView',
'UniqueElementsView',
'bag',
'froz... | mlenzen/collections-extended | collections_extended/bags.py | bags.py | py | 14,133 | python | en | code | 43 | github-code | 7 | [
{
"api_name": "collections.abc.Collection",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "abc.ABCMeta",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "abc.abstrac... |
32764548831 | """Create a CSV file with info on all audio files in a directory."""
import argparse
import logging
import os
from pathlib import Path
from typing import Tuple
from pydub.utils import mediainfo_json
from tqdm import tqdm
from utils import files
parser = argparse.ArgumentParser(
description='Create a CSV file with... | TarteelAI/tarteel-ml | generate_audio_info.py | generate_audio_info.py | py | 2,148 | python | en | code | 160 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "logging.info",
... |
35408821464 | from django import forms
from netbox.forms import NetBoxModelForm, NetBoxModelFilterSetForm, NetBoxModelImportForm
from dcim.models import Device, DeviceType
from utilities.forms import BootstrapMixin
from utilities.forms.fields import (
DynamicModelMultipleChoiceField,
SlugField,
DynamicModelChoiceField,
... | renatoalmeidaoliveira/nbrisk | nb_risk/forms.py | forms.py | py | 4,997 | python | en | code | 42 | github-code | 7 | [
{
"api_name": "netbox.forms.NetBoxModelForm",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "netbox.forms.NetBoxModelFilterSetForm",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "netbox.forms.NetBoxModelForm",
"line_number": 41,
"usage_type": "name"... |
11018018557 | import datetime
import psycopg2
from flask_restful import Resource, reqparse
class TemperaturesCountries(Resource):
def __init__(self, **kwargs):
self.logger = kwargs['logger']
self.db = kwargs['db']
def get(self, id):
parser = reqparse.RequestParser()
parser.add_argument('fr... | alexRot622/WeatherStation | src/TemperaturesCountries.py | TemperaturesCountries.py | py | 2,140 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "flask_restful.Resource",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "flask_restful.reqparse.RequestParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask_restful.reqparse",
"line_number": 13,
"usage_type": "name"
},
{
... |
1803654901 | import pandas as pd
import sklearn.cluster as cluster
from sklearn.preprocessing import scale
import sklearn.decomposition as decomp
import matplotlib.pyplot as plt
import csv
# Data Cleaning and Organization
data = pd.read_csv("data_by_genres.csv")
genres = data[['genres']]
data = data.drop('genres', 1)
data = data.d... | rpathak38/LikeMySong | genreClassification/genre.py | genre.py | py | 1,142 | python | en | code | 6 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.scale",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sklearn.cluster.AgglomerativeClustering",
"line_number": 28,
"usage_type": "call"
},
{
... |
45335179854 | """
Terminal output giving user information on Pipe or TRR processing
"""
import socket
import subprocess
import sys
from getpass import getpass
from colorama import Fore, Style
from colorama import init as enable_text_color
from datetime import datetime
from pipe_cleaner.src.terminal_properties import intro_section... | monkeyman51/VSE_PipeCleaner_2 | pipe_cleaner/src/terminal.py | terminal.py | py | 13,007 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pipe_cleaner.src.log_database.access_database_document",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.today",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 41,
"usage_type": "name... |
72685329824 | from typing import List
class Solution:
def wiggleSort(self, nums: List[int]) -> None:
"""
Do not return anything, modify nums in-place instead.
Directly sort the nums and swap them
https://leetcode.com/problems/wiggle-sort-ii/discuss/77678/3-lines-Python-with-Explanation-Proof
... | daviddwlee84/LeetCode | Python3/Array/WiggleSortII/Naive324.py | Naive324.py | py | 1,073 | python | en | code | 15 | github-code | 7 | [
{
"api_name": "typing.List",
"line_number": 5,
"usage_type": "name"
}
] |
16355169547 | import json
import os
import requests
from django.http import HttpResponseRedirect
from django.shortcuts import render, redirect
from django.views.generic import TemplateView
from .connectors import fyle
CLIENT_ID = os.environ.get("CLIENT_ID")
CLIENT_SECRET = os.environ.get("CLIENT_SECRET")
BASE_URL = os.environ.get... | fylein/fyle-django-oauth | fyleOauthDjango/views.py | views.py | py | 2,266 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "os.environ.get",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "os.environ.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_... |
4525316139 | from kivy.core.text import Label
from kivy.graphics import Rectangle
from kivy.graphics import Color
BORDER_SIZE = 0.25
def build_label(text):
label = Label(font_size=12)
label.text = text
label.refresh()
return (
label,
(float(label._size[0]),
floa... | tyler-conrad/flyeye | model/node.py | node.py | py | 3,213 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "kivy.core.text.Label",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "kivy.graphics.Color",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "kivy.graphics.Color",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "kivy.grap... |
34965054859 | import os
from django.contrib.gis.utils import LayerMapping
from .models import LowerGroundFloor
from .floordata import geojson
for feat in geojson['features']:
geom = feat['properties']['geometry']
lg = LowerGroundFloor(geom=geom, floor=-1)
lg.save()
room_mapping = {
'floor' : 'Floor',
'geom' ... | imatw4r/smcebi | src/smcebi/floors/load.py | load.py | py | 873 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "floordata.geojson",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "models.LowerGroundFloor",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
32021718879 | import logging
from datetime import datetime
from datetime import timedelta
import pdb
from . import enumerations
from multiprocessing import Pool
from multiprocessing.dummy import Pool as ThreadPool
"""Module:
Class: station
Methods:
__init__
get_obs
add_record
get_region
... | NOAA-MDL/CAMPS | camps/core/data_conversion/metar_to_nc/station.py | station.py | py | 8,591 | python | en | code | 9 | github-code | 7 | [
{
"api_name": "datetime.datetime.utcfromtimestamp",
"line_number": 136,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 136,
"usage_type": "name"
},
{
"api_name": "datetime.datetime",
"line_number": 220,
"usage_type": "call"
}
] |
22071769191 | from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
class Coupon(models.Model):
"""
Model representing a coupon which can be applied to an order to give a discount.
"""
code: models.CharField = models.CharField(max_length=20, unique=True)
valid_fro... | ch4zzy/online-shop | apps/coupons/models.py | models.py | py | 730 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.db.models.Model",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_na... |
42996254447 | from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.assertEqual(1 + 1, 2)
#
# def test_save_course(self):
# p = Course(courseName='test',courseTime=2,startTime=datetime.... | shalocfolmos/JJEhr | JJEhr/lesson/tests.py | tests.py | py | 1,104 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "django.test.TestCase",
"line_number": 3,
"usage_type": "name"
}
] |
72685488864 | from collections import defaultdict
class Solution:
def longestDupSubstring(self, S: str) -> str:
"""
https://leetcode.com/problems/longest-duplicate-substring/discuss/695029/Python-Binary-search-O(n-log-n)-average-with-Rabin-Karp-explained
"""
begin, end = 0, len(S)
q = (1... | daviddwlee84/LeetCode | Python3/String/LongestDuplicateSubstring/BinarySearch_RabinKarp1044.py | BinarySearch_RabinKarp1044.py | py | 2,008 | python | en | code | 15 | github-code | 7 | [
{
"api_name": "collections.defaultdict",
"line_number": 40,
"usage_type": "call"
}
] |
12695341154 | from hoshino import Service
from hoshino.typing import CQEvent
import json, time, requests
sv = Service('clanrank', bundle='pcr公会战', help_='''
clanrank <公会名> [all] | 查看该公会最新或者全部的会战名次记录
'''.strip())
def second2time(second):
return time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(second))
def get... | GWYOG/HoshinoBotClanRankSearchPlugin | clanrank/clanrank.py | clanrank.py | py | 4,393 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "hoshino.Service",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "time.strftime",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "time.localtime",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_... |
15992778220 | import numpy as np
from data.components.item import ItemGenerator
from data.utils import compare
from data.constants import CHUNK_SIZE, TILE_SIZE, TERRAIN_BUILD_STEPS, TILE_NUMBER
from data.map.tile import *
STRUCTURES_SEED = {(TILE_NUMBER * 1 // 4, TILE_NUMBER * 1 // 4): 1, (TILE_NUMBER * 3 // 4, TILE_NUMBER * 3 // 4... | alexandremr01/the-verge-of-tomorrow | data/map/chunk_generator.py | chunk_generator.py | py | 20,127 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "data.constants.TILE_NUMBER",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "data.constants.TILE_NUMBER",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "numpy.random.seed",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": ... |
30134113503 | import numpy as np
import random
import os
import os.path
import pickle
from pathlib import Path
from datetime import datetime
# Configuration file
from conf import read_conf
# Features
from file_loader import collate_fn
from file_loader import Dataset
from file_loader import fit_normalizer
from file_loader import re... | kevinmchu/PhonemeClassificationPytorch | train_lm.py | train_lm.py | py | 9,655 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "torch.device",
... |
27461084720 | import time
import urllib
import urllib.request
import bs4
import requests
start_url = "https://en.wikipedia.org/wiki/Special:Random"
target_url = "https://en.wikipedia.org/wiki/Philosophy"
def text_typing(text, speed =0.07):
for i in range(len(text)):
print(text[i]+"", end='', flush=True)
ti... | mlema4/wiki_web_crawler | wiki_web_crawler.py | wiki_web_crawler.py | py | 5,010 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "time.sleep",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "urllib.parse.urljoin",
... |
34008985819 | import argparse
import code
import curses
import itertools
import logging
import logging.handlers
import os
import socket
import subprocess
import sys
import unittest
import unittest.signals
import qubes.tests
import qubes.api.admin
class CursesColor(dict):
colors = (
'black', 'red', 'green', 'yellow', 'b... | QubesOS/qubes-core-admin | qubes/tests/run.py | run.py | py | 13,373 | python | en | code | 112 | github-code | 7 | [
{
"api_name": "curses.setupterm",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "curses.error",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "curses.tigetstr",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "curses.tparm",
... |
73248319904 | import numpy as np
from collections import defaultdict
def solve(A, b, *args, **kwargs):
safe_kwargs = defaultdict(lambda: None)
for key, value in kwargs.items():
safe_kwargs[key] = value
methods = {
"lu" : lu,
"jacobi": jacobi,
"gauss seidel": gauss_seidel,
... | DavidNKraemer/numerical-python | linalg.py | linalg.py | py | 2,876 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.defaultdict",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "numpy.shape",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "numpy.eye",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_... |
4860874865 | from torch import nn
import torch
class Net(nn.Module):
#初始化网络
def __init__(self):
super(Net, self).__init__()
#输入层
self.fc1 = nn.Linear(784,100)
self.relu1 = nn.ReLU()
#中间层
self.fc2 = nn.Linear(100,64)
self.relu2 = nn.ReLU()
#输出层
... | lieweiAGI/liewei-agi-code-part1 | 15 全连接课上代码/20210226_mnisttest/net.py | net.py | py | 1,183 | python | en | code | 2 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "torch.nn.Linear",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numbe... |
24338083579 | import requests
import re
from pyquery import PyQuery as pq
import json
import os
from fetch_coin_data import get_market_cap_data, get_crypto_compare_coin_list
def get_description(url):
page = requests.get(url).text
page = [line for line in page.split("\n") if 'pageInfo.setCoinPageInfo({"Res' in line][0]
page = pag... | calebdre/crypto-summaries | descriptions.py | descriptions.py | py | 2,664 | python | en | code | null | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pyquery.PyQuery",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "fetch_coin_data.get_market_cap... |
20532720805 | from collections.abc import Collection
from typing import Any
import logging
import pytest
from nlmaps_tools.process import (
ProcessingRequest,
ProcessingResult,
ProcessingTool,
)
from nlmaps_tools.process.models import SingleProcessorResult
from nlmaps_tools.process.processors import BuiltinProcessor
... | Simon-Will/nlmaps-tools | tests/process/test_processing_tool.py | test_processing_tool.py | py | 5,038 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "nlmaps_tools.process.processors.BuiltinProcessor",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "collections.abc.Collection",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 21,
"usage_type": "name"
},
{... |
34373784934 | import numpy
from keras.models import Sequential
from keras.layers import Dense
# Fix the random seed for reproducibility
numpy.random.seed(7)
# Load the dataset
data = numpy.loadtxt("pima-indians-diabetes.csv", delimiter=",")
# Separate between training and testing data
X = data[:, 0:8]
y = data[:, 8]
# Create t... | npcastro/enterprise-ai | 4. keras/keras_first_network.py | keras_first_network.py | py | 1,129 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.random.seed",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "numpy.loadtxt",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "keras.models.Sequenti... |
14248092547 | import builtins
import socket
from typing import List, Union
from unittest import mock
from unittest.mock import DEFAULT, Mock, call, patch
from autoreduce_db.reduction_viewer.models import (Experiment, Instrument, ReductionArguments, ReductionScript, Status,
DataLoca... | autoreduction/scripts | autoreduce_scripts/manual_operations/tests/test_manual_remove.py | test_manual_remove.py | py | 25,540 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "autoreduce_db.reduction_viewer.models.Experiment.objects.get_or_create",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "autoreduce_db.reduction_viewer.models.Experiment.objects",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "autoreduce_d... |
26568238685 | from sqlalchemy import Column, Integer, String, create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
USUARIO = 'root'
SENHA = ''
HOST = 'localhost'
PORT = '3306'
BANCO = 'sistemalogin'
CONN = f'mysql+pymysql://{USUARIO}:{SENHA}@{HOST}:{PORT}/{BANCO}'
... | rhuancborges/sistema-login-basico | Model.py | Model.py | py | 633 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.ext.declarative.declarative_base",
"line_number": 16,
"usage_type": "call... |
71757535583 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: katherinemichalski
Reads data quality files and
"""
# Python3 program to find groups of unknown
# Points using K nearest neighbour algorithm.
# PCA <--> SVD
import math
import csv
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from... | converseg/drp_sp2020 | knn.py | knn.py | py | 2,853 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.train_test_split",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 41,
"usage_type": "call"
... |
27549722846 | #coding=utf-8
import numpy as np
import pandas as pd
from sklearn.model_selection import KFold,StratifiedKFold,ShuffleSplit,train_test_split
import xgboost
from sklearn.metrics import mean_squared_error,mean_absolute_error,explained_variance_score
from sklearn.model_selection import GridSearchCV
import time
from sklear... | yanHaowen/comp | tool/MyEnsemble.py | MyEnsemble.py | py | 2,125 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.array",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.KFold",
... |
74894238621 | #!/usr/bin/env python
# coding: utf-8
from imp import reload
from unidecode import unidecode
import codecs
import xlsxwriter
from xlwt import Workbook
import requests
from bs4 import BeautifulSoup, NavigableString
import re
##################################################################
# création
... | ctith/RDV-avec-monsieur-X | scripts/excel_emission.py | excel_emission.py | py | 2,398 | python | fr | code | 0 | github-code | 7 | [
{
"api_name": "xlwt.Workbook",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 51,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_n... |
32868573914 | import numpy as np
from sigm import *
from perceptron import *
from testinput import *
from singlelayer import *
from multilayer import *
from linear import *
from prettytable import PrettyTable
if __name__ == '__main__':
activation_function = Sigm()(1.0)
activation_function_der = Sigm().derivative(1.0)
a... | staho/PSI_GCP04_zima_2017-2018_Kamil_Stachowicz | PSI_3/mine_implementation/main2.py | main2.py | py | 1,096 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "multilayer.trainNetwork",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "prettytable.PrettyTable",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "multilayer.guess",
"line_number": 36,
"usage_type": "call"
}
] |
71765548063 | import numpy as np
import math
class MMQ(object):
def __init__(self, data_file):
#The constructor receives the file passed to him and remove his information
with open(data_file) as file:
data = file.readlines()
list = []
for row in data:
if not row.... | luanrodrigues98/Least-Squares | MMQclass.py | MMQclass.py | py | 5,763 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.sum",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.power",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "numpy.power",
"line_number": 57,
... |
13235573853 | import os, numpy, PIL
from PIL import Image
import numpy as np
from numpy import newaxis
from time import sleep
import warnings
import pandas as pd
import re
warnings.filterwarnings("ignore")
def calculateDistance(i1, i2):
return numpy.sum((i1-i2)**2)
PATH = '/home/maghareh/Desktop/ThirdSemester/ComputationalData... | msmsadegh/Computational_Data_Mining_Course | HW2.py | HW2.py | py | 2,694 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "PIL.Image.open",
"lin... |
7775457533 | import numpy
import pytest
import chainer
from chainer import cuda
from chainer.iterators import SerialIterator
from chainer_chemistry.datasets.numpy_tuple_dataset import NumpyTupleDataset
from chainer_chemistry.training.extensions.r2_score_evaluator import R2ScoreEvaluator # NOQA
@pytest.fixture
def inputs():
... | chainer/chainer-chemistry | tests/training_tests/extensions_tests/test_r2_score_evaluator.py | test_r2_score_evaluator.py | py | 5,274 | python | en | code | 587 | github-code | 7 | [
{
"api_name": "numpy.random.seed",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.uniform",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.random... |
28564361406 | from django import template
from storage.models import DbFile
register = template.Library()
@register.assignment_tag
def dbfile_by_slug(slug):
try:
f = DbFile.objects.get(name = slug)
return f
except DbFile.DoesNotExist:
return None
| stoprightthere/django-dbfile | storage/templatetags/dbfile_extras.py | dbfile_extras.py | py | 267 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.template.Library",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 4,
"usage_type": "name"
},
{
"api_name": "storage.models.DbFile.objects.get",
"line_number": 9,
"usage_type": "call"
},
{
"api_name":... |
74814371741 | # %%
# 빅카인즈 API를 함수로 정리해놓음.
import json
import requests
def req_search_news(query="삼성전자", published_at=("2018-10-12", "2020-10-12"),
provider=[], category=[], category_incident=[], byline="", provider_subject=[],
subject_info=[""], subject_info1=[""],subject_info2=[""],subject_... | Ever2after/news_bigdata_hackathon_20201014 | api_function.py | api_function.py | py | 4,286 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "requests.post",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "requests.post",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "json.dumps",
"line_number"... |
5439434687 | import torch
import warnings
import numpy as np
import torch.nn.functional as F
from torch.utils.data import DataLoader
from sklearn.metrics import roc_auc_score
import configuration
from models import Vae
from utils import utils
from dataset import prepare_dataset
categories = ['bottle', 'cable', 'capsul... | GV8738/ADecomposer | AD_all.py | AD_all.py | py | 3,350 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "torch.sgn",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.nn.functional.relu",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.nn",... |
41434408023 | import numpy as np
import keras
import keras.datasets
from keras.datasets import cifar10
from CleanNN import layer_sizes, initialize_parameters, backward_propagation, forward_propagation, compute_cost, update_parameters, nn_model, predict
(x_train, y_train),(x_test, y_test) = cifar10.load_data()
### The shape of inpu... | Sindrir/assignment3AI | simleNeuro.py | simleNeuro.py | py | 2,071 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "keras.datasets.cifar10.load_data",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "keras.datasets.cifar10",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "CleanNN.initialize_parameters",
"line_number": 21,
"usage_type": "call"
},
{
... |
11258367313 | import discord
import configparser
from Application.Bot.BotManager import BotManager
config = configparser.ConfigParser()
config.read('properties.ini')
bot = discord.Client()
manager: BotManager = BotManager(bot, config)
def run():
global config
bot.run(config['DISCORD']['botKey'])
@bot.event
async def on... | nkonstantakos/trakt-discord-bot | MovieBot.py | MovieBot.py | py | 686 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "discord.Client",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "Application.Bot.BotManager.BotManager",
"line_number": 9,
"usage_type": "name"
},
{
"api_n... |
21670345926 | from django.urls import path
# from . import views
from tenants import views
urlpatterns = [
path('hokage', views.defaultpage),
path('master-unit', views.add_unit, name="master-unit"),
path('delete-unit/<int:id>', views.delete_unit, name="delete-unit"),
path('edit-unit/<int:id>', views.delete_unit, na... | numbstudent/ten_ants | tenants/urls.py | urls.py | py | 568 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "tenants.views.defaultpage",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "tenants.views",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.url... |
71039909983 | from PIL import Image, ImageFilter
import numpy
from .skimage import compare_mse
import sys
## ======================= ##
##
class MetricEdgeFactor:
## ======================= ##
##
@staticmethod
def compute_metrics(image1, image2):
image1 = image1.convert("RGB")
imag... | golemfactory/clay | apps/blender/resources/images/entrypoints/scripts/verifier_tools/edges.py | edges.py | py | 1,463 | python | en | code | 2,915 | github-code | 7 | [
{
"api_name": "PIL.ImageFilter.FIND_EDGES",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "PIL.ImageFilter",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "PIL.ImageFilter.FIND_EDGES",
"line_number": 20,
"usage_type": "attribute"
},
{
"a... |
74736736541 | import numpy as np
import os
import sys
import librosa
import soundfile as sf
from tqdm import tqdm
class ErrorCovarianceMatrix:
def __init__(self,p,q):
self.p = p
self.q = q
# initialize matrices
self.mqq = np.zeros((q,q), dtype=np.float32)
self.mqp = np.zeros((q,p), ... | strij9111/MFCC_Kalman | main.py | main.py | py | 10,759 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "numpy.zeros",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "numpy.zeros",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.float32",
"line_... |
44629921033 | import torch
import torch.nn.functional as F
from torch import Tensor
from ._gan_losses import DiscriminatorLoss, GeneratorLoss
class BinaryCrossentropyDiscriminatorLoss(DiscriminatorLoss):
"""
Binary cross-entropy discriminator loss function.
This callable applies the standard non-saturating binary cro... | facebookresearch/NeuralCompression | neuralcompression/loss_fn/_binary_crossentropy_loss.py | _binary_crossentropy_loss.py | py | 2,114 | python | en | code | 412 | github-code | 7 | [
{
"api_name": "_gan_losses.DiscriminatorLoss",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "torch.ones_like",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torch.nn.fu... |
73910985182 | from typing import Optional
class Node:
def __init__(self, value: int, next: Optional["Node"] = None) -> None:
self.value = value
self.next = next
def reorder(head: Node) -> Node:
midpoint = get_midpoint(head)
end = reverse_linked_list(midpoint)
begin = head
while begin is not N... | cs-cordero/interview-prep | grokking-coding/fast_and_slow/problem_challenge_2.py | problem_challenge_2.py | py | 919 | python | en | code | 9 | github-code | 7 | [
{
"api_name": "typing.Optional",
"line_number": 5,
"usage_type": "name"
}
] |
25386607824 | from django.contrib.auth import authenticate, logout, login
from django.contrib.auth.models import Group, User
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render, redirect
from evaluaciones.models import Evaluacion
from cursos.models import Curso
from rubricas.models import R... | DCC-CC4401/2019-1-yet-another-quality-commit-T4 | usuarios/views.py | views.py | py | 7,306 | python | es | code | 0 | github-code | 7 | [
{
"api_name": "django.shortcuts.render",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.authenticate",
"line_number": 27,
"usage_type": "call"
},
{
"... |
9719967128 | import datetime
import signal
import time
from ssl import CERT_NONE
from ssl import CERT_REQUIRED
from threading import Thread
from typing import Any
from typing import Callable
from typing import cast
from typing import ContextManager
from typing import Dict
from typing import Union
from uuid import UUID
from fastram... | magenta-aps/os2mo-ldap-import-export | mo_ldap_import_export/ldap.py | ldap.py | py | 21,381 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "config.ServerConfig",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "ldap3.Tls",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "ssl.CERT_NONE",
"line_number": 54,
"usage_type": "name"
},
{
"api_name": "ssl.CERT_REQUIRED",
"... |
15940861221 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 13 02:48:49 2021
@author: xiaojingni
"""
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from mpl_toolkits.mplot3d import Axes3D
from sklearn.cluster import KMeans
from sklearn import datasets
from sklearn import preprocessin... | nixiaojing/realestate_ml | gate_pca.py | gate_pca.py | py | 6,338 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pandas.read_csv",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "sklearn.cluster.KMeans",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "numpy.asarray",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "sklearn.cluster.... |
6482667891 | import pymysql
import requests
import json
URL = 'https://www.dhlottery.co.kr/common.do?method=getLottoNumber'
lotto = {}
def put_data():
conn = pymysql.connect(host='localhost', user='root', password='password', db='lotto_db', charset='utf8')
curs = conn.cursor()
sql = """REPLACE INTO new_t... | sktkddn777/predict_lotto | lotto/put_mysql.py | put_mysql.py | py | 1,097 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "pymysql.connect",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 23,
"usage_type": "call"
}
] |
7401111897 | import logging
from typing import Optional
import numpy as np
import tqdm
from tqdm.contrib.logging import logging_redirect_tqdm
from bayestme import data
from bayestme.mcmc import model_bkg
logger = logging.getLogger(__name__)
def deconvolve(
reads,
edges,
n_gene=None,
n_components=None,
lam2=... | tansey-lab/bayestme | src/bayestme/mcmc/deconvolution.py | deconvolution.py | py | 3,931 | python | en | code | 13 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "numpy.random",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.defa... |
36738859747 |
import scipy.spatial.distance as sd
import matplotlib.pyplot as plt
import time, numpy as np
from matplotlib import colors
from matplotlib.ticker import PercentFormatter
class InterpointDistancePlot:
def __init__( self, nx: int, ny: int, nbins: int = 200, **kwargs ) :
self.nx = nx
self.ny = ny
... | nasa-nccs-cds/spectraclass | spectraclass/test/metrics/plots.py | plots.py | py | 2,070 | python | en | code | 4 | github-code | 7 | [
{
"api_name": "numpy.ndarray",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.rand",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyp... |
37193590739 | from scipy.io import wavfile
from scipy import signal
import numpy as np
def filter2(x):
y = [0]*len(x)
for n in range(2, len(x)):
y[n] = x[n] - x[n-1] - 0.2217*x[n-1] + 0.2217*x[n-2] + 0.2217*y[n-1]
return y
def filter3(x):
y = [0]*len(x)
for n in range(2, len(x)):
y[n] = 0.1293... | LeonJelsma/BirdSongFiltering | src/simple_filter.py | simple_filter.py | py | 608 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "scipy.io.wavfile.read",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "scipy.io.wavfile",
"line_number": 20,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "scipy.io.wavfile.w... |
70368783265 | import requests
from lxml import etree
import base64
import time
print("--------------------------------------------------")
print("+\t\t _____ ____ ____ \t\t+")
print("+\t\t|__ / / ___| / ___| \t\t+")
print("+\t\t / / \___ \ \___ \ \t\t+")
print("+\t\t / /_ ___) | ___) |\t\t+")
print("+\t\t/... | Zhao-sai-sai/Infiltration_script | 教育行业漏洞报告平台/教育行业漏洞报告平台.py | 教育行业漏洞报告平台.py | py | 1,998 | python | en | code | 17 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "lxml.etree.HTML",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "lxml.etree",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "time.sleep",
"line_number... |
33091190099 | from django.db import models
from django.contrib.auth.models import AbstractUser
class User(AbstractUser):
groups = models.ManyToManyField(
'auth.Group',
related_name='custom_user_groups', # change related name to 'custom_user_groups'
blank=True,
help_text='The gr... | vesnatrisic/WebGISApp | energy_resources/users/models.py | models.py | py | 700 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "django.contrib.auth.models.AbstractUser",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "django.db.models.ManyToManyField",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.db.models",
"line_number": 7,
"usage_type": "name"
},
{... |
27701237152 | from connect import *
import time
import datetime
from query_handler.logger import log
from query_handler.table_titles import TableTitles
db = get_db()
cursor = db.cursor()
def has_blocked(src, dst):
sql = """
select count(blocker_ID)
from `blocked`
where blocker_ID = %s and blocked_ID = %s
"""
... | mr-amirfazel/locochat | query_handler/blocks_utils.py | blocks_utils.py | py | 1,920 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "time.time",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.fromtimestamp",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "quer... |
30591639554 | import argparse
import json
import pathlib
import timm
import torch
import torchvision.transforms as transforms
import tqdm
from torch.utils.data import DataLoader, SubsetRandomSampler
from torch.utils.tensorboard import SummaryWriter
from torchvision.datasets import ImageFolder
from evaluation import compute_embeddi... | jankrepl/mildlyoverfitted | github_adventures/dino/train.py | train.py | py | 6,811 | python | en | code | 300 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentDefaultsHelpFormatter",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "pathlib.Path",
"line_number": 44,
"usage_type": "call"
},
{
"... |
4439168951 | # -*- coding: utf-8 -*-
import bpy
import mmd_tools.core.model as mmd_model
from mmd_tools import register_wrap
class _PanelBase(object):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = 'object'
@register_wrap
class MMDModelObjectPanel(_PanelBase, bpy.types.Panel):
bl_idname = '... | V-Sekai/vsekai-blender-game-tools | addons/blender_mmd_tools-main/mmd_tools/panels/prop_object.py | prop_object.py | py | 1,189 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "bpy.types",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "mmd_tools.core.model.FnModel.find_root",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "mmd_tools.core.model.FnModel",
"line_number": 21,
"usage_type": "attribute"
},
... |
28224810690 | from collections import deque
q = int(input())
rows = 0
que = deque([])
for _ in range(q):
tmp = list(map(int, input().split()))
if len(tmp) == 3:
que.append((tmp[1], tmp[2]))
else:
rows += 1
num = 0
ans = 0
while True:
x, c = que.popleft()
if... | blueletter123456789/atc | abc247/d/d.py | d.py | py | 667 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "collections.deque",
"line_number": 5,
"usage_type": "call"
}
] |
24319853360 | # coding=utf-8
from __future__ import unicode_literals
import json
from os import path
from sys import version_info
from pod_base import PodBase, ConfigException
from .exceptions import DashboardException
try:
import urllib.parse as urllib
except ImportError:
import urllib
class PodDashboard(PodBase):
... | FanapSoft/pod-dashboard-python-sdk | pod_dashboard/pod_dashboard.py | pod_dashboard.py | py | 26,425 | python | fa | code | 0 | github-code | 7 | [
{
"api_name": "pod_base.PodBase",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "os.path.abspath",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "os.path.dirname",
"line_... |
24574937926 | import os
import geopandas as gpd
import numpy as np
import cv2
import base64
from shapely.geometry import LineString, MultiLineString
from shapely.ops import unary_union
class Bounds:
def __init__(self, minx, miny, maxx, maxy):
self.minx = minx
self.miny = miny
self.maxx = maxx
se... | splinters/vin_gis_test | services/rete.py | rete.py | py | 11,383 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "geopandas.read_file",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "shapely.geometry.MultiLineString",
"line_number": 69,
"usage_type": "argument"
},
{
"api_name": "shapely.geometry.LineString",
"line_number": 71,
"usage_type": "argument"
},
... |
1355971646 | import os
import cgi
import logging
import itertools
import hashlib
from SendMail import *
from Member import *
from datetime import datetime
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext import webapp
from google.appengine.api impo... | jpoon/ubcbadm_web | registration_system/v1/registration.py | registration.py | py | 11,648 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "google.appengine.ext.webapp.RequestHandler",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "google.appengine.ext.webapp",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "cgi.escape",
"line_number": 39,
"usage_type": "call"
},
{... |
25589595314 | import requests
import time
import hmac
import hashlib
# Set up the API endpoints for Binance and Gate.io
binance_api_endpoint = 'https://api.binance.com/api/v3'
gateio_api_endpoint = 'https://api.gateio.ws/api/v4'
# Set up your API keys and other credentials for Binance and Gate.io
binance_api_key = 'YOUR_BINANCE_AP... | ShahrozAtiq/binance-new-listings-trader | main.py | main.py | py | 4,364 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "requests.get",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number":... |
70264650783 | import os
import yaml
def search_sequence_in_yaml(file_path, sequence):
with open(file_path, 'r') as f:
lines = f.readlines()
# Convert lines list to a single string
yaml_content = ''.join(lines)
# Load YAML content
try:
yaml_data = yaml.safe_load(yaml_content)... | MubashirUsman/scripts | python/checkYaml.py | checkYaml.py | py | 1,030 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "yaml.safe_load",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "yaml.YAMLError",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"lin... |
10752787339 | from PyPDF2 import PdfFileReader
import os
from gtts import gTTS
import streamlit as st
import streamlit.components.v1 as components
def pypdf2(py_pdf_file):
pdfReader = PdfFileReader(py_pdf_file)
numOfPages = pdfReader.getNumPages()
text = "PDF File name : " + str(pdfReader.getDocumentInfo().title) + ' \n'
text_... | naashonomics/steamlit_projects | productivity/doc_to_audio.py | doc_to_audio.py | py | 1,327 | python | en | code | 1 | github-code | 7 | [
{
"api_name": "PyPDF2.PdfFileReader",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "gtts.gTTS",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "streamlit.file_uploader",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "streamlit.audio... |
9675861886 | import click
from build_monitor_cli.main import main
@click.command()
@click.option('--org', required=True, help='organization alias in config file')
@click.option('--branch', default='master', help='filter branch, default: master')
def entry(org, branch):
main(org, branch)
if __name__ == '__main__':
entry()... | dawncold/build_monitor_cli | build_monitor_cli/cli.py | cli.py | py | 321 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "build_monitor_cli.main.main",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "click.command",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "click.option",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "click.option",
... |
3467382176 | import os
import json
import hashlib
import numpy as np
import copy
from .auto_shard import update_ast
def get_execution_parallism():
return 1
def to_search_space(ast_seq, input_dict, output_dict):
assert len(ast_seq) == 1, "Unimplemented multi ASTs."
ast_props = ast_seq[0]['props']
space = dict([('tile_%d'... | microsoft/antares | backends/c-ipu/config.py | config.py | py | 7,518 | python | en | code | 293 | github-code | 7 | [
{
"api_name": "copy.deepcopy",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "auto_shard.update_ast",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 131,
"usage_type": "attribute"
},
{
"api_name": "antares.common.l... |
920872215 | from typing import List
import tensorflow as tf
import tensorflow.keras as keras
from augmentation.utilities.metrics import reset_metrics, update_metrics
def evaluate_model(model: keras.Model,
generator,
metrics: List[keras.metrics.Metric],
aggregate=None,
... | HazyResearch/model-patching | augmentation/utilities/eval.py | eval.py | py | 1,406 | python | en | code | 42 | github-code | 7 | [
{
"api_name": "tensorflow.keras.Model",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.keras",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "tensorflow.kera... |
46054340594 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/5/16 15:36
# @Author : Shenhan Qian
# @Site :
# @File : lanenet.py
# @Software: PyCharm
import torch
import torch.nn as nn
from model import decoder_fcn
from model.resnet import resnet18, resnet34
from model.enet import ENet_encoder,... | ShenhanQian/Lane_Detection-An_Instance_Segmentation_Approach | model/lanenet.py | lanenet.py | py | 5,064 | python | en | code | 49 | github-code | 7 | [
{
"api_name": "torch.nn.Module",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "model.resnet.resnet18",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "model.decoder_fcn... |
43083926927 | import torch
import torch.nn as nn
import math
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
class LstmGen(nn.Module):
def __init__ (self):
super(LstmGen, self).__init__()
self.n_values = 60
self.au_encoder = nn.Sequential( #input (1,80,18)
... | peterwisu/lip-synthesis | src/models/attnlstm.py | attnlstm.py | py | 7,527 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "torch.device",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Module",
... |
71905849504 | # Requires sci-kit learn and matplotlib
import matplotlib.pyplot as pyplot
from sklearn import datasets
from sklearn import svm
digits = datasets.load_digits()
#Gamma breaks when greater than 0.01. Maintains high accuracy at 0.001
clf = svm.SVC(gamma=0.001, C=100)
x,y = digits.data[:-1], digits.target[:-1]
clf.fit... | josh-abrams/machine-learning-sandbox | num-prediction.py | num-prediction.py | py | 537 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sklearn.datasets.load_digits",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "sklearn.svm.SVC",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sklearn.s... |
1716165281 | import argparse
import os.path
import encodedcc
import requests
from urllib.parse import quote
import subprocess
import mimetypes
from PIL import Image
from base64 import b64encode
import magic # install me with 'pip install python-magic'
# https://github.com/ahupp/python-magic
# this is the site for python-magic in c... | T2DREAM/pyencoded-tools | examples/3777-gravely-protocol.py | 3777-gravely-protocol.py | py | 6,155 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "argparse.RawDescriptionHelpFormatter",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.path.path.expanduser",
"line_number": 37,
"usage_type": "call"
},
... |
4429092208 | import matplotlib.pyplot as plt
import numpy as np
def plot_data_points(dataset,w,cl1,cl2):
x_red_data = []
y_red_data = []
x_blue_data = []
y_blue_data = []
for ele in dataset:
if ele[1]==cl1:
x_red_data.append(ele[0][0])
y_red_data.append(ele[0][1])
else:
x_blue_data.append(-ele[0][0])
y_blue_d... | CaptainSharf/SMAI-Assigns | Assignment2/plot_data.py | plot_data.py | py | 856 | python | zh | code | 0 | github-code | 7 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 16,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matpl... |
16680998483 | import pytest
import os
import shutil
from subprocess import check_call
import sys
# Append current directory to system path in order to import testconfig
sys.path.append(".")
import testconfig as tcf
from utils import untar_ms
"""
Script can be invoked in two ways:
- as standalone from the build/steps/test/integra... | lofar-astron/DP3 | steps/test/integration/tColumnReader.py | tColumnReader.py | py | 1,153 | python | en | code | 14 | github-code | 7 | [
{
"api_name": "sys.path.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.chdir",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "utils.untar_ms",
"line_numbe... |
29705023625 | #!/usr/bin/python3
"""Write a Python script that takes in a string and sends a search
request to the Star Wars API
"""
import requests
import sys
if __name__ == "__main__":
movies_dict = {}
num_res = 0
param = sys.argv[1]
url = "https://swapi.co/api/people/" + "?search=" + param
while True:
... | SantiagoHerreG/holbertonschool-higher_level_programming | 0x11-python-network_1/102-starwars.py | 102-starwars.py | py | 1,376 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 31,
"usage_type": "call"
}
] |
9573585392 | from __future__ import print_function
import tweepy
import json
from pymongo import MongoClient
MONGO_HOST= 'mongodb://localhost/twitterdb'
WORDS = ['je suis connecté']
CONSUMER_KEY = "0sVMx0oLDkFPqMxGEZkQQwj6i"
CONSUMER_SECRET = "U0XOkFy1Q9Q3sEXNq33BPF0cScrTxxtbGREtFq9lxnJFKlKjaX"
ACCESS_TOKEN = "1052923426728... | Christ-vie/PythonTest | data.py | data.py | py | 1,465 | python | en | code | 0 | github-code | 7 | [
{
"api_name": "tweepy.StreamListener",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "tweepy.OAut... |
26526828977 | from rich.console import Console
from rich.table import Table
from datetime import datetime
class View:
def display_menu(self):
print("-----------------------------------")
print('''Que souhaitez vous faire ?\n\t
1 - Creation d'un tournoi \n\t
2 - Afficher les infos d'un tournoi \n... | NicolasPython2022/OC_Projet4 | views/main_view.py | main_view.py | py | 9,551 | python | fr | code | 0 | github-code | 7 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 68,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 68,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 79,
"usage_type": "call"
},
{
"api_name"... |
21028520088 | import sys
import time
import os
import yaml
import logging
from requests import HTTPError
from bio_ner_predictor.mimic3_note_reader import Mimic3DischargeNoteReader
from fortex.elastic import ElasticSearchPackIndexProcessor
from fortex.huggingface.bio_ner_predictor import BioBERTNERPredictor
from fortex.huggingface.t... | asyml/forte-wrappers | tests/wrappers/bio_ner_predictor_test.py | bio_ner_predictor_test.py | py | 4,326 | python | en | code | 5 | github-code | 7 | [
{
"api_name": "unittest.TestCase",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "forte.pipeline.Pipeline",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "forte.data.data_pack.DataPack",
"line_number": 31,
"usage_type": "name"
},
{
"api_... |
19703162468 | import hashlib
import json
import logging
import os
import time
import urllib.request
from django.conf import settings
from django.core.files.base import ContentFile
from django.core.files.storage import default_storage
from .base import Wechat
logger = logging.getLogger(__name__)
class Wxa(Wechat):
"""
微信... | ChanMo/django-wechat-base | wechat/wxa.py | wxa.py | py | 1,998 | python | en | code | 7 | github-code | 7 | [
{
"api_name": "logging.getLogger",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "base.Wechat",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "time.time",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
"line_numbe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.