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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
19281348594 | import datetime
from haystack import indexes
from threads.models import Thread
class ThreadIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
title = indexes.CharField(model_attr='title')
subtitle = indexes.CharField(model_attr='subtitle')
author ... | suchanlee/Sound-Tribe-LC | soundtribe/threads/search_indexes.py | search_indexes.py | py | 660 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "haystack.indexes.SearchIndex",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "haystack.indexes",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "haystack.indexes.Indexable",
"line_number": 6,
"usage_type": "attribute"
},
{
"a... |
26042537046 | from __future__ import annotations
import itertools
import logging
import os
from dataclasses import dataclass
from typing import Collection
from pex.variables import Variables
from pants.core.util_rules import asdf, search_paths
from pants.core.util_rules.asdf import AsdfPathString, AsdfToolPathsResult
from pants.c... | pantsbuild/pants | src/python/pants/core/subsystems/python_bootstrap.py | python_bootstrap.py | py | 10,626 | python | en | code | 2,896 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pants.option.subsystem.Subsystem",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "pants.util.strutil.help_text",
"line_number": 35,
"usage_type": "call"
},
{
"a... |
13990411758 | import requests, base64, os
api_key = os.environ['OW_API_KEY']
base_url = "http://api.openweathermap.org/data/2.5/weather?"
city_name = os.environ['OW_CITY_NAME']
if "OW_UNIT" in os.environ:
unit = os.environ['OW_UNIT']
else:
unit = "imperial"
complete_url = base_url + "appid=" + api_key + "&q=" + city_name ... | jdev082/PyWeatherTray | API.py | API.py | py | 1,237 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "os.environ",
"line_n... |
74470707387 | import functools
import logging
import unittest
__all__ = ["fails", "skip", "skip_if"]
from typing import Callable, Optional
from unittest import TestCase
fails = unittest.expectedFailure
skip = unittest.skip
skip_if = unittest.skipIf
skip_unless = unittest.skipUnless
def flaky(reason: Optional[str] = None, run_t... | pycommons/pycommons-tests | pycommons/tests/condition.py | condition.py | py | 796 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "unittest.expectedFailure",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "unittest.skip",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "unittest.skipIf",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": ... |
10110578959 | # -*- coding: utf-8 -*-
import re
import csv
import boto3
import requests
import datetime
from bs4 import BeautifulSoup
# from newspaper import Article
# from crawlers.article_scraper import ArticleScraper
def parse_eleconomista(crawl_date, bucket_name):
print("\nInitializing Eleconomista spider ...")
print("-... | adriamoya/bcpnews_lambda | crawl_lambda/crawlers/eleconomista.py | eleconomista.py | py | 2,164 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "datetime.datetime",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "requests.get",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "re.compile",
... |
26898333714 | import cProfile
import pstats
from sklearn.datasets import load_breast_cancer
from sklearn.naive_bayes import GaussianNB
from algoritmos import SelfTraining, CoTraining
from algoritmos.utilidades.datasplitter import data_split
TRAINING_FILE = '../utilidades/datasets/waveform5000.arff'
def profile_selft... | dma1004/TFG-SemiSupervisado | algoritmos/test/profiling/profiling.py | profiling.py | py | 2,040 | python | es | code | 5 | github-code | 6 | [
{
"api_name": "algoritmos.SelfTraining",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sklearn.naive_bayes.GaussianNB",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets.load_breast_cancer",
"line_number": 21,
"usage_type": "call"
},... |
29423918156 | import argparse
import shutil
import numpy
from pathlib import Path
from PIL import Image, ImageChops
from packageland import handler
Image.MAX_IMAGE_PIXELS = None
parser = argparse.ArgumentParser(description="ICADM, Image Channel and Directory Modifier")
parser.add_argument('--directory', '-d', metavar='-D', type... | emarron/kartoffels-terrible-image-tools | src/icadm.py | icadm.py | py | 11,541 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "PIL.Image.MAX_IMAGE_PIXELS",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "arg... |
11815990542 | import os
import sys
import re
import pyrr
import glfw
import time
import numpy as np
from OpenGL.GL import *
from OpenGL.GL.shaders import compileProgram, compileShader
from multiprocessing import Pool
class Preprocessor:
def __init__(self, file_path, root):
self.root = root
self.file_path = fil... | cchenyixuan/Banira | data_fitting/interpolation.py | interpolation.py | py | 8,155 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.path.basename",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_numbe... |
26227216423 | # -*- coding: utf-8 -*-
import sys
import re
import itertools
from typing import Iterator, List, Match, TextIO
__all__ = ('split', 'quote')
__version__ = '1.1.0'
def iter_arg(peek: Match[str], i: Iterator[Match[str]]) -> Iterator[str]:
quote_mode = False
for m in itertools.chain([peek], i):
space, ... | smoofra/mslex | mslex/__init__.py | __init__.py | py | 6,111 | python | en | code | 14 | github-code | 6 | [
{
"api_name": "typing.Match",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "typing.Iterator",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "itertools.chain",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "re.finditer",
"line_... |
73846703226 | from datetime import datetime
import pytest
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from receipt_tracker.repo.models import Seller, Buyer, Receipt
from receipt_tracker.repo.sql_repo import Base
from receipt_tracker.repo.sql_repo import SQLRepo
@pytest.fixture(scope='session')
de... | jamestrew/receipt-tracker | tests/conftest.py | conftest.py | py | 2,186 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.orm.sessionmaker",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "receipt_tracker.repo.sql_repo.Base.metadata.create_all",
"line_number": 16,
"usage_t... |
16594988163 | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import sys
import os
from datetime import datetime
# -- Path setup -------------------... | discsim/frank | docs/conf.py | conf.py | py | 4,252 | python | en | code | 15 | github-code | 6 | [
{
"api_name": "sys.path.insert",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_num... |
72323287869 | from flask import render_template,url_for,flash, redirect,request,Blueprint
from flask_login import current_user,login_required
from myproject import db
from myproject.models import BlogPost, Truss
from myproject.truss_posts.forms import BlogPostForm
truss_posts = Blueprint('truss_posts',__name__)
@truss_posts.route(... | yasser64b/Flask-Web-Development | Myproject/truss_posts/views.py | views.py | py | 6,327 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Blueprint",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "myproject.truss_posts.forms.BlogPostForm",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "myproject.models.BlogPost",
"line_number": 15,
"usage_type": "call"
},
{
... |
36653422344 | #!/usr/bin/python3
# Codeforces - Round 624
# Problem C - Perform the Combo
from collections import Counter
letters = "abcdefghijklmnopqrstuvwxyz"
def combo(m, s, p):
cnt = Counter(s)
ind = 0
p.sort()
l = len(p)
for i in range(l):
if p[i] == ind:
continue
presses = s[ind:p[i]]
for press in p... | thaReal/MasterChef | codeforces/round_624/combo.py | combo.py | py | 636 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "collections.Counter",
"line_number": 11,
"usage_type": "call"
}
] |
16435576073 | import random
import time
import urls, db
import json
from selenium import webdriver
try:
urls = urls.get_news_urls()
except Exception as ex:
print(ex)
def scroll_page(driver):
time.sleep(random.randint(2, 5))
try:
driver.execute_script("window.scrollBy(0,document.body.scrollHeight)")
ex... | yuwisasha/zm_test | sessions.py | sessions.py | py | 998 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "urls.get_news_urls",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_n... |
28465223792 | import matplotlib.pyplot as plt
from matplotlib.widgets import Button, TextBox
from matplotlib.gridspec import GridSpec
from matplotlib.animation import FuncAnimation
from collections import deque
from math import sqrt
import sys
import heapq
sys.path.append('Maps')
from map_1 import QuadraticMap
from map_2 import Line... | lilmarcin/path-planning | PathPlanning/SingleRun/astar.py | astar.py | py | 9,108 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.draw",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot"... |
37034108501 | #!/usr/bin/env python3
# python websocket client to test with
# emulator: server is at ws://127.0.0.1:9080/ws
# esp8266: server is at ws:///ws
# (uncomment the right line below)
#uri = "ws://127.0.0.1:9080/ws"
uri = "ws://arduinoWebsockets.local/ws"
import websocket
try:
import thread
except ImportError:
im... | Links2004/arduinoWebSockets | examples/esp8266_pico/WebSocketServerHooked/ws-testclient.py | ws-testclient.py | py | 1,010 | python | en | code | 1,762 | github-code | 6 | [
{
"api_name": "time.sleep",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "_thread.start_new_thread",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "websocket.enableTrace"... |
37702810113 | """
"""
from django.shortcuts import render_to_response
from django.http import Http404, HttpResponseRedirect
from django.template import RequestContext
from django.core.urlresolvers import reverse
from utils.alphapaginator import AlphaPaginator
from directory.models import Business, Category
from directory.forms impo... | sealgair/onaben-biz-dir | directory/views.py | views.py | py | 2,422 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "directory.models.Business.approved",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "directory.models.Business",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "directory.models.Category.objects",
"line_number": 16,
"usage_type": "a... |
6836031270 | from fastapi import FastAPI
import os
from psycopg_pool import ConnectionPool
conninfo = os.environ["DATABASE_URL"]
pool = ConnectionPool(conninfo=conninfo)
def connect_to_db():
conninfo = os.environ["DATABASE_URL"]
pool = ConnectionPool(conninfo=conninfo)
return pool
class ReviewQueries:
def creat... | tinatran079/netstix | games/queries/reviews.py | reviews.py | py | 2,344 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "os.environ",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "psycopg_pool.ConnectionPool",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "psycopg_poo... |
32916487732 | import re
import pandas as pd
import numpy as np
from mshap import Mshap
import pytest
shap1 = pd.DataFrame(
{
"age": np.random.uniform(-5, 5, 1000),
"income": np.random.uniform(-5, 5, 1000),
"married": np.random.uniform(-5, 5, 1000),
"sex": np.random.uniform(-5, 5, 1000),
}
)
... | Diadochokinetic/mshap | mshap/test_mshap.py | test_mshap.py | py | 6,902 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.DataFrame",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.random.uniform",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.uni... |
3235458247 | from __future__ import annotations
from typing import TYPE_CHECKING
from avilla.core.context import Context
from avilla.core.selector import Selector
from avilla.core.trait.context import ContextSourceRecorder
if TYPE_CHECKING:
from ..account import CAIAccount
_source_record = ContextSourceRecorder["ElizabethAcc... | RF-Tar-Railt/Avilla-CAI | avilla/cai/impl/context_source.py | context_source.py | py | 1,267 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "typing.TYPE_CHECKING",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "avilla.core.trait.context.ContextSourceRecorder",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "account.CAIAccount",
"line_number": 15,
"usage_type": "name"
},
{... |
27327464041 | import requests #библиотека для работы с http запросами
from bs4 import BeautifulSoup #для работы с html страницами
import csv #модуль для работы с CSV
URL = 'https://kazandigital.ru/catalogue_category-category_id-47.html' #url сайта
URL1 = 'https://www.skynet-kazan.com/root/map'
HEADERS = {'user-agent': 'Mozilla/5.0 ... | RuselSam/Scripts_to_Skynet | parse_to_site_test.py | parse_to_site_test.py | py | 4,623 | python | ru | code | 0 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"li... |
8783080167 | import sqlite3
from loguru import logger
class Database:
def __init__(self, db_file):
self.connection = sqlite3.connect(db_file, check_same_thread=False)
self.cursor = self.connection.cursor()
def create_table(self):
with self.connection:
res = self.cursor.execute(f'''CREA... | Arsenky/Work_motivation_bot | db.py | db.py | py | 1,401 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlite3.connect",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "loguru.logger.error",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
"line_number": 34,
"usage_type": "name"
}
] |
7161919324 | """
Write an efficient algorithm that searches for a value target in an m x n integer matrix matrix. This matrix has the following properties:
Integers in each row are sorted from left to right.
The first integer of each row is greater than the last integer of the previous row.
Example 1:
Input: matrix = [[1,3,5,7... | CompetitiveCodingLeetcode/LeetcodeEasy | Medium/SearchA2DMatrix/SearchA2DMatrix_Q74.py | SearchA2DMatrix_Q74.py | py | 1,522 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "unittest.TestCase",
"line_number": 54,
"usage_type": "attribute"
}
] |
70714396668 | # from numpy import *
# import random
# import math
import os
# import time
# import pandas as pd
# import math
import argparse
import csv
import numpy as np
def ReadMyCsv(SaveList, fileName):
csv_reader = csv.reader(open(fileName))
for row in csv_reader:
SaveList.append(row)
return
def S... | jiboyalab/multiPPIs | src/data_process.py | data_process.py | py | 3,105 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "csv.reader",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 90,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentDefaul... |
15431076232 | import gensim
import numpy as np
import os
import re
import string
from sklearn.decomposition import TruncatedSVD
from sklearn.feature_extraction.text import CountVectorizer
class LabeledSentencesFromDictDoc2Vec(object):
STOP_LIST = set('for a of the and to in view more product infromation \
a... | IvonaTau/style-search | training.py | training.py | py | 4,478 | python | en | code | 24 | github-code | 6 | [
{
"api_name": "gensim.models.doc2vec.LabeledSentence",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "gensim.models",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "o... |
10128932828 | from django.shortcuts import render
from django.db.models import F
from rest_framework import generics
import os
import time
import json
import threading
from .models import Faces
from .serializers import SongsSerializer
from facerecogntion.face_recognition_demo import main, Visualizer
from django.views.decorators.csr... | Shahin-Sefidgaran/similarity-to-celebrity-with-facial-landmarks | face/views.py | views.py | py | 5,524 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "facerecogntion.face_recognition_demo.Visualizer",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "threading.Thread",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "threading.Thread.__init__",
"line_number": 25,
"usage_type": "call"... |
650677547 | import os
import json
from shutil import copyfile
import z5py
import luigi
from cluster_tools import LiftedMulticutSegmentationWorkflow
SOLVERS = ('kernighan-lin', 'greedy-additive', 'fusion-moves', 'hierarchical')
def prepare_data(exp_path, tmp_folder, prefix):
# make log for costs in order to skip all the pro... | constantinpape/cluster_tools | publications/leveraging_domain_knowledge/5_lifted_solver/run_solvers.py | run_solvers.py | py | 3,189 | python | en | code | 32 | github-code | 6 | [
{
"api_name": "os.makedirs",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "shutil.copyfile",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number":... |
23054939663 | # -*- coding: utf-8 -*-
# cython: language_level=3
"""
Created on Mon Mar 30 15:21:35 2020
@author: Liam Cornu
"""
import requests
from urllib3.util.retry import Retry
import urllib3
from requests.adapters import HTTPAdapter
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
from reque... | liam-cornu/Shopify-Discount-Bot | FetchCoupons.py | FetchCoupons.py | py | 5,011 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "urllib3.disable_warnings",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "urllib3.exceptions",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "requests.packages.urllib3.disable_warnings",
"line_number": 17,
"usage_type": "call"
}... |
17446488724 | from __future__ import (absolute_import, division, print_function)
DOCUMENTATION = r'''
---
module: site_load
short_description: Loads site information as ansible facts into the respective host
description:
Loads Skupper site information as a hostvar named 'site'. It contains the site name,
site id and invento... | skupperproject/skupper-ansible | skupper/network/plugins/modules/site_load.py | site_load.py | py | 4,781 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "ansible.module_utils.basic.AnsibleModule",
"line_number": 55,
"usage_type": "name"
},
{
"api_name": "module_utils.types.Site",
"line_number": 64,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 76,
"usage_type": "call"
},
{
"api_n... |
43889503514 | import sys
import torch.nn as nn
import os
import time
import numpy as np
from tqdm import trange
from torch.utils.data import TensorDataset, RandomSampler, DataLoader, SequentialSampler
from models import NN
from torch.optim import AdamW
import torch
import pandas as pd
from transformers import AutoTokenizer
from skle... | limengqigithub/sentiment-analysis | NN/main.py | main.py | py | 6,132 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.argv",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number... |
13750985546 | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 19 17:29:31 2018
@author: yangy
"""
import numpy as np
import pandas as pd
from scipy.stats import norm
import statsmodels.api as sm
import matplotlib.pyplot as plt
from datetime import datetime
import requests
from io import BytesIO
# ARIMA Example 1: ArimaX
# Dataset... | Richard27Yang/Flu_Vaccination_Efficacy_Learning | SARIMAX.py | SARIMAX.py | py | 4,875 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.read_stata",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "io.BytesIO",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "statsmodels.api.tsa.statesp... |
14255895926 | from __future__ import division, print_function
from __future__ import absolute_import, unicode_literals
from _MOM.import_MOM import MOM, Q
from _TFL import TFL
from _TFL.pyk import pyk
from _MOM._DBW._SAW import SA
import _MOM.DB_Meta_Data
import itertools
class _SAW_DB_Met... | xiaochang91/tapyr | _MOM/_DBW/_SAW/Session.py | Session.py | py | 21,369 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "_MOM.import_MOM.MOM.DB_Meta_Data",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "_MOM.import_MOM.MOM",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "_MOM.import_MOM.MOM.DB_Meta_Data",
"line_number": 18,
"usage_type": "attribute"... |
35037186961 | import cv2
import numpy as np
class EmbrunDetection():
"""
Class qui permet de détecter si de l'embrun empêche les mesures.
"""
def detection(self, frame):
"""
Fonction qui renvoie l'écart type de l'histogramme des pixels,
plus l'écart type est bas, plus il y a de l'embrun.
... | Torystan/analyse-images | analyzers/embrunDetection.py | embrunDetection.py | py | 785 | python | fr | code | 0 | github-code | 6 | [
{
"api_name": "cv2.calcHist",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.std",
"line_number": 29,
"usage_type": "call"
}
] |
41383063779 | from typing import Optional, Tuple, List
import numpy as np
from hvac import Quantity
from hvac.charts import LineChart
from .pump_curve import PumpCurve
Q_ = Quantity
class SystemCurve:
def __init__(self):
self.name: str = ''
self._R_hyd: Quantity = Q_(float('nan'), 'Pa * s ** 2 / m ** 6')
... | TomLXXVI/HVAC | hvac/fluid_flow/utils/system_curve.py | system_curve.py | py | 6,154 | python | en | code | 8 | github-code | 6 | [
{
"api_name": "hvac.Quantity",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "hvac.Quantity",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "hvac.Quantity",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "hvac.Quantity",
"line_nu... |
24604732053 | #!/bin/env python
from argparse import ArgumentParser
import socket
## Protocol
# Common
ACK = b'\xff'
DENY = b'\xfe'
# Client -> Server
JOIN_QUEUE = b'\x01'
QUIT_QUEUE = b'\x02' # not implemented
RESUME_GAME = b'\x05'
ASK_AGAIN = b'\x06'
ANSWER_A = b'\x10'
ANSWER_B = b'\x11'
ANSWER_C = b'\x12'
PASS... | veigaribo/pass-or-repass | client/client.py | client.py | py | 11,257 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "socket.SHUT_RDWR",
"line_number": 268,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 414,
"usage_type": "call"
},
{
"api_name": "socket.getaddrinfo",
"line_number": 426,
"usage_type": "call"
},
{
"api_name": "s... |
29672517199 | import glob
import tqdm
import pandas as pd
from ocr import run_ocr_spin
from ast import literal_eval
def preprocess_text(text: str, stop_symbols=None):
text = text.lower()
if not stop_symbols:
stop_symbols = {'\n', ',', '-'}
return ''.join([i[0] for i in zip(text, text[1:] + '#') if i[0] != i[1] ... | komatded/cosmetics_product_parser | src/data_preprocess.py | data_preprocess.py | py | 1,576 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "glob.glob",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "tqdm.tqdm",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "ocr.run_ocr_spin",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_num... |
18049672800 | from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
import sys
import unittest
import hh_paths
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("hh_server")
parser.add_argument("hh_client")
parser.add_argument("hh_single... | WeilerWebServices/Facebook | hhvm/hphp/hack/test/integration/runner.py | runner.py | py | 941 | python | en | code | 3 | github-code | 6 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "hh_paths.hh_server",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "hh_paths.hh_client",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name"... |
26024328440 | import numpy as np
from fealpy.mesh import UniformMesh1d
import matplotlib.pyplot as plt
from fealpy.decorator import cartesian
from scipy.sparse.linalg import spsolve
from scipy.sparse import diags
import time
class SinPDEData: # 可以点击这里查看FEALPy仓库中的代码。
def domain(self):
"""
@brief 得到 PDE 模型的区域
... | suanhaitech/pythonstudy2023 | python-jovan/Numerical solution of differential equation/elliptic/test.py | test.py | py | 2,499 | python | zh | code | 2 | github-code | 6 | [
{
"api_name": "numpy.e",
"line_number": 25,
"usage_type": "attribute"
},
{
"api_name": "fealpy.decorator.cartesian",
"line_number": 17,
"usage_type": "name"
},
{
"api_name": "numpy.e",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "fealpy.decorator... |
34357709141 | # This just takes stdin an sends it as a UDP over the proper port.
import socket, sys, json, argparse
def mute():
sys.stderr = None
sys.stdout = None
if __name__ == '__main__':
HOST, PORT = "localhost", 9999
# read stdin, as opposed to the command-line options
#data = sys.stdin.read()
title =... | Tadashi-Hikari/Sapphire-Assistant-Framework-Python | assistant/udp-client.py | udp-client.py | py | 1,243 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sys.stderr",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "sys.stdout",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "argparse.ArgumentParser",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.argv",
... |
26806725699 | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 23 15:44:40 2019
@author: dell
"""
# Plotting using numpy, pandas and matplotlib
# Importing libraries
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
# Types of Plots:
# 1. BASIC PLOTTING
ts = pd.Series(np.random.random(1000),... | lavish71/Forsk_2019 | Project_1_Basic_Libraries/Libraries/Libraries_Matplot_Numpy_Pandas.py | Libraries_Matplot_Numpy_Pandas.py | py | 1,792 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.Series",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.random.random",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "pandas.date_range... |
9659355780 | import scrapy
class QuotesSpider(scrapy.Spider):
name = 'quotes'
start_urls = [
'http://quotes.toscrape.com/'
]
def parse(self, response):
with open('resultados.html', 'w', encoding='utf-8') as f:
f.write(response.text)
| rb-one/Curso-Scrapy | hello_world/tutorial/tutorial/spiders/quotes_spider.py | quotes_spider.py | py | 277 | python | en | code | 19 | github-code | 6 | [
{
"api_name": "scrapy.Spider",
"line_number": 3,
"usage_type": "attribute"
}
] |
34637304938 | import sys
import os
import pandas as pd
import numpy as np
import multiprocessing as mp
from sklearn.linear_model import LinearRegression
from datetime import datetime
eventtype=['accidentsAndIncidents','roadwork','precipitation','deviceStatus','obstruction','trafficConditions']
date_format="%Y-%m-%d"
num_partitions=... | mayborin/Intro-datascience | lab11_predicate.py | lab11_predicate.py | py | 2,739 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.DataFrame",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "datetim... |
21325888475 | from nltk.corpus import stopwords
import string
# 加载要清理的文件
def load_doc(filename):
# open the file as read only
file = open(filename, 'r')
# read all text
text = file.read()
# close the file
file.close()
return text
# 清理文本,转化成词列表
def clean_doc(doc):
# 按照空格分词
tokens = doc.split()
# 删除文本中的标点符号
table = str.ma... | yangwohenmai/NLP | 文本分类/实例_基于词袋模型分类/1.清理数据.py | 1.清理数据.py | py | 930 | python | en | code | 33 | github-code | 6 | [
{
"api_name": "string.punctuation",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "nltk.corpus.stopwords.words",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "nltk.corpus.stopwords",
"line_number": 24,
"usage_type": "name"
}
] |
4242634590 | import json.decoder
from datetime import datetime
from requests import Response
from models.user import User
class BaseCase:
def get_cookie(self, response: Response, cookie_name):
assert cookie_name in response.cookies, f"Cannot find cookie with name {cookie_name} in the last response"
return re... | terrajanis/LearnQA_PythonAPI | lib/base_case.py | base_case.py | py | 1,432 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "requests.Response",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "requests.Response",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "requests.Response",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "json.decoder.de... |
17247681580 | from aiogram.dispatcher import FSMContext
from aiogram.dispatcher.filters.state import State, StatesGroup
from aiogram import types
from create_bot import dp
from aiogram import Dispatcher
# from import cursor
import asyncio
from TempUserBD import notifications
from aiogram.contrib.fsm_storage.memory import MemorySto... | KaLiNkA-code/FFFFF | FSM/NotificFSM.py | NotificFSM.py | py | 2,934 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "aiogram.dispatcher.filters.state.StatesGroup",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "aiogram.dispatcher.filters.state.State",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "aiogram.dispatcher.filters.state.State",
"line_number": 1... |
73128849469 | from rest_framework import viewsets, generics, permissions
from knox.auth import TokenAuthentication
from setup.models import (
Institution,
)
from setup.serializers import (
InstitutionCreateUpdateSerializer,
InstitutionListDetailSerializer,
)
class InstitutionViewSet(viewsets.ModelViewSet):
authentic... | DUMBALINYOLO/gbc_oms | setup/apis/admin.py | admin.py | py | 610 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "rest_framework.viewsets.ModelViewSet",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "rest_framework.viewsets",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "knox.auth.TokenAuthentication",
"line_number": 13,
"usage_type": "name"... |
13384798652 | import socket
from base64 import b64encode
from ssl import wrap_socket
from configparser import ConfigParser
parser = ConfigParser(allow_no_value=True)
with open('config.cfg', encoding="utf-8") as file:
parser.read_file(file)
message = parser['Message']
boundary = message['Boundary']
account = parser['Account']
... | Maxoriy/Internet_protocols | smtp_client/script.py | script.py | py | 2,332 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "configparser.ConfigParser",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "base64.b64encode",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "base64.b64encode",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "socket.soc... |
7436896502 | """
setup.py for Vesper pip package.
Note that we specify Python 3.10 in the instructions below. As of
2023-04-03, Python 3.11 is available but it is not yet supported by
the `numba` package, which is used by `resampy`.
Creating an Up-to-Date `requirements.txt` File
----------------------------------------------
... | HaroldMills/Vesper | setup.py | setup.py | py | 7,324 | python | en | code | 47 | github-code | 6 | [
{
"api_name": "pathlib.Path",
"line_number": 139,
"usage_type": "call"
},
{
"api_name": "importlib.machinery.SourceFileLoader",
"line_number": 140,
"usage_type": "call"
},
{
"api_name": "setuptools.setup",
"line_number": 147,
"usage_type": "call"
},
{
"api_name": ... |
72900266429 | import hashlib
import magic
# pip install python-magic-bin
# pip install python-magic
def __sha1(f):
sha1obj = hashlib.sha1()
sha1obj.update(f.read())
return sha1obj.hexdigest()
def __md5(f):
md5obj = hashlib.md5()
md5obj.update(f.read())
return md5obj.hexdigest()
# 一定要是rb
def sha1(file):... | kingreatwill/openself | python/recall/app/core/filelib.py | filelib.py | py | 875 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "hashlib.sha1",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "hashlib.md5",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "magic.Magic",
"line_number": 40,
"usage_type": "call"
}
] |
17349538431 | from setuptools import setup, find_packages
# setup metainfo
libinfo_content = open("__init__.py", "r").readlines()
version_line = [l.strip() for l in libinfo_content if l.startswith("__version__")][0]
exec(version_line) # produce __version__
setup(
name="smartclust",
version=__version__,
description="Pr... | chschock/smartclust | setup.py | setup.py | py | 938 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "setuptools.setup",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "setuptools.find_packages",
"line_number": 18,
"usage_type": "call"
}
] |
41568547351 | from django.shortcuts import render, redirect
from django.contrib import messages
# adiciona mensagens no contexto da pagina
# aparece essas mensagens na pagina quando declarado
# na pagina {% bootstrap_messages %}
from core.forms import FeedbackForms
def feedback_view(request):
form = FeedbackForms(request.POST ... | jamalghatit/feedback | core/views.py | views.py | py | 882 | python | pt | code | 0 | github-code | 6 | [
{
"api_name": "core.forms.FeedbackForms",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages.success",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.contrib.messages",
"line_number": 15,
"usage_type": "name"
},
{
"... |
25844050132 | """Test init."""
import json
from flask import url_for
from flask_testing import TestCase
from manage import app
from app.service.users import UsersServices
from app.models import db
class BaseTest(TestCase):
"""Test dev releted test cases."""
def create_app(self):
"""Create app."""
app.con... | ekramulmostafa/ms-auth | app/test/__init__.py | __init__.py | py | 2,429 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask_testing.TestCase",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "manage.app.config.from_object",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "manage.app.config",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_n... |
40411540691 | """
Name: ndfc_discover.py
Description: Discover switches and test reachability
Public methods:
- discover() Initiate NDFC discovery of switches.
- is_reachable() Tests for switch reachability from NDFC perspective
- is_up Tests if a switch is up
The JSON payload constructed by the NdfcDiscover() class is shown below... | allenrobel/ndfc-python | lib/ndfc_python/ndfc_discover.py | ndfc_discover.py | py | 23,039 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "ndfc_python.validations.Validations",
"line_number": 130,
"usage_type": "call"
},
{
"api_name": "ndfc_python.log.log",
"line_number": 189,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 279,
"usage_type": "call"
},
{
"api_name": "sys... |
19168936137 | from imix.models.builder import VQA_MODELS
import torch
import copy
'''
from transformers.modeling_bert import (
BertConfig,
BertEmbeddings,
BertEncoder,
# BertLayerNorm,
BertPreTrainedModel,
)
'''
from .lxmert import LXMERTForPretraining
from imix.models.vqa_models.base_model import BaseModel
from ... | asdlei99/iMIX | imix/models/vqa_models/lxmert/lxmert_task.py | lxmert_task.py | py | 3,861 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "imix.models.vqa_models.base_model.BaseModel",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "torch.device",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 29,
"usage_type": "call"
},
{
"... |
8638306989 |
import os
import csv
from sqlalchemy import Table, Column, Integer, String, Float, MetaData
from sqlalchemy import create_engine
engine = create_engine('sqlite:///database.db', echo=True)
meta = MetaData()
print(os.getcwd())
with open('clean_stations.csv', newline= '') as csvfile:
clean_stations = []
clea... | m1122b/sqlclean | sqlclean.py | sqlclean.py | py | 2,066 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sqlalchemy.create_engine",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.MetaData",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.getcwd",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "csv.DictReader",... |
5648146033 |
import sys
from typing import List, TypedDict
import unittest
def can_construct(target_string: str, strings: List[str]) -> bool:
n = len(target_string) + 1
table = [i == 0 for i in range(n)]
for i in range(n):
if table[i]:
for string in strings:
j = i + len(string)
... | bradtreloar/freeCodeCamp_DP_problems | problems/tabulated/can_construct.py | can_construct.py | py | 1,385 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "typing.List",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "unittest.TestCase",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "sys.setrecursionlimit",
"line_number": 21,
"usage_type": "call"
}
] |
323756513 | # -*- coding: utf-8 -*-
"""
Created on Wed May 4 13:49:34 2022
@author: Duvallp
"""
import os
import pandas as pd
import numpy as np
from pandas import DataFrame
import xlwt
from xlwt import Workbook
import xlwings as xw
#Import AMRI data
#need to use xlwings to open password protected excel files
amri_sheet = "T:/... | pmd84/DSI_Scripts | DSI_File_Find.py | DSI_File_Find.py | py | 2,897 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "xlwings.Book",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.chdir",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_nu... |
21214864055 | # -*- coding: utf-8 -*-
from django import forms
from django.forms import widgets
from django.conf import settings
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from taggit.forms import TagField
from babybuddy.widgets import DateInput, DateTimeInput, TimeInput
from core impo... | babybuddy/babybuddy | core/forms.py | forms.py | py | 9,265 | python | en | code | 1,766 | github-code | 6 | [
{
"api_name": "core.models.Child.objects.filter",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "core.models.Child",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "core.models",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "c... |
8767292561 | import json
import os
import requests
from signal_protocol import curve, identity_key, state, storage, session, address, protocol
from signal_protocol import session_cipher
def write_identity_key_to_localfile(key, user='unknown'):
with open(f"{user}.txt", "wb") as binary_file:
# Write bytes to file
... | Tectone23/signal-protocol-client-cog | src/receive_message.py | receive_message.py | py | 4,207 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "signal_protocol.session.get",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "signal_protocol.session",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "json.load",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "os.gete... |
22411389507 | import requests, re, logging
from .utils import unescape
from xml.etree import ElementTree
logger = logging.getLogger(__name__)
class tsFetch():
class CouldNotRetrieveTranscript(Exception):
"""
Raised if a transcript could not be retrieved.
"""
ERROR_MESSAGE = (
'Could... | fizzywhizbang/yt_transcript | yt_transcript/fetch.py | fetch.py | py | 2,513 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "logging.getLogger",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "re.compile",
"line_number": 64,
"usage_type": "call"
},
{
"api_name": "re.IGNORECASE",
"line_nu... |
12026125268 | #-*- coding:utf-8 -*-
import sys
import requests
from bs4 import BeautifulSoup
def getMovieCodebyDate(sel, date, tg=0, page=1):
"""
*------------------------DESRIPTION-----------------------*
네이버 영화 코드를 얻기 위한 크롤러
NAVER 영화랭킹에서 코드를 추출하며 sel, date, tg, page의
query를 argument로 받아 결과를 리턴한다.
*-------... | jinmang2/t2snet | crawler.py | crawler.py | py | 9,059 | python | ko | code | 4 | github-code | 6 | [
{
"api_name": "requests.get",
"line_number": 92,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 94,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 108,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
... |
38432574829 |
import HDLC
import TCP
import DLMSPlayground
import DLMS
import xmltodict
import binascii
class Meter:
"""
"""
currentMessage = ''
inMessage = False
def __init__(self):
"""
"""
self.counter = 0
def SetTransport(self, transport):
"""
... | BlockWorksCo/Playground | GuruxXML2PDU/VirtualMeter/VirtualMeter.py | VirtualMeter.py | py | 5,407 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "binascii.hexlify",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "xmltodict.parse",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "binascii.hexlify",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "xmltodict.parse",
... |
42812610433 | import os
import torch
import torch.nn as nn
import torchvision
from torch.utils.data import DataLoader
# 定义AlexNet模型
class AlexNet(nn.Module):
def __init__(self, num_classes=10):
super(AlexNet, self).__init__()
# 定义卷积层和池化层
self.conv_layer1 = nn.Conv2d(3, 64, kernel_size=3, stride=2, pad... | HHU-ANN/convolution-neural-network-3q3z4 | _03_Convolution_Neural_Network/Convolution_Neural_Network.py | Convolution_Neural_Network.py | py | 3,118 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_nu... |
72088289469 | import random
import pygame as pg
pg.init()
BG_COLOR = pg.Color('gray12')
ENEMY_IMG = pg.Surface((50, 30))
ENEMY_IMG.fill(pg.Color('darkorange1'))
BULLET_IMG = pg.Surface((9, 15))
BULLET_IMG.fill(pg.Color('aquamarine2'))
class Enemy(pg.sprite.Sprite):
def __init__(self, pos, *sprite_groups):
... | KevinFroissart/Cannon-Runner | test.py | test.py | py | 3,048 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "pygame.Color",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.Surface",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "pygame.Color",
"line_number"... |
31315504703 | import numpy as np
import pandas as pd
import os
import tkinter as tk
from tkinter import filedialog
import bs4
import json
import sys
from scipy.signal import resample, decimate
sys.path.append('..')
sys.path.append('')
os.chdir("./pyAPisolation/")
print(os.getcwd())
from pyAPisolation.patch_ml import *
from pyAPisola... | smestern/pyAPisolation | pyAPisolation/web_viz/run_output_to_web.py | run_output_to_web.py | py | 4,131 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "sys.path.append",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "sys.path.append",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_nu... |
32483876553 | """Simple GUI
Provides a visual interface for the topside unit"""
from typing import List
import settings
from snr.async_endpoint import AsyncEndpoint
from snr.node import Node
from snr.utils import debug
from snr.task import SomeTasks, Task, TaskPriority
class SimpleGUI(AsyncEndpoint):
def __init__(self, paren... | CalPolyUROV/UROV2019 | raspi/ui/gui/gui_endpoint.py | gui_endpoint.py | py | 5,332 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "snr.async_endpoint.AsyncEndpoint",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "snr.node.Node",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "snr.task.Task",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "snr.task... |
23248135575 | #imports required modules for programe to run
import sys,pygame,os,time,math
import Angle
import PowerBarSensor
import GameOver
pygame.init()
#size of window
size = width,height = 600,400
#sets window size and insert backgorund image
screen = pygame.display.set_mode(size)
#loads up ball and targe image
tar... | Soupupup/pythonsensorgame | 10 Sensor Game.py | 10 Sensor Game.py | py | 3,792 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "pygame.image.l... |
16644685799 | # -*- coding: utf-8 -*-
# @Time:2021/3/2921:10
# @File:3.29.py
import numpy as np
import random
import networkx as nx
random.seed(23)
nn=5
C = np.zeros(shape=(5, 5))
for i in range(5):
for j in range(i, 5):
if i == j:
C[i, i] = 1
else:
r = random.random()
C[i, j... | QingqingSun-Bao/GitResp2 | nested/3.29.py | 3.29.py | py | 2,191 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "random.seed",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.sum",
"line_number": 2... |
69873508667 | #
# @lc app=leetcode.cn id=2006 lang=python3
#
# [2006] 差的绝对值为 K 的数对数目
#
# @lc code=start
'''
给你一个整数数组 nums 和一个整数 k
请你返回数对 (i, j) 的数目
满足 i < j 且 |nums[i] - nums[j]| == k
'''
# 哈希表
'''
cnt记录nums中的数字出现的频次
遍历cnt对应的key,如果key+k也在nums中,那么(key, key+k)是一个数对,数对的个数为key的频次*(key+k)的频次
将其加入到ans中
只需要考虑key+k
因为和key差的绝对值为k的数字有key-k... | Algo-Goer/LeetCodeSolutions | 2022/0215_2006.差的绝对值为-k-的数对数目Counter().py | 0215_2006.差的绝对值为-k-的数对数目Counter().py | py | 934 | python | zh | code | 0 | github-code | 6 | [
{
"api_name": "collections.Counter",
"line_number": 27,
"usage_type": "call"
}
] |
41053915268 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib import animation
hmm_f = open("hmm_data_n_data=0.txt", "r")
curve_data_f = open("curve_data.txt", "r")
curve_data0_f = open("curve_data0.txt", "r")
length = int(hmm_f.readline())
signal = np.empty(length)
sig_sd, obs_sd = list(map(float, hmm_f.readlin... | dwb26/mlbpf_convection_diffusion | anim.py | anim.py | py | 1,220 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "numpy.empty",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.empty",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"l... |
19411958809 | from django.views.generic import View
from picbackend.views.utils import JSONGETRspMixin
from picbackend.views.utils import JSONPUTRspMixin
from picmodels.models import HospitalWebTrafficData
from .tools import validate_put_rqst_params
#Need to abstract common variables in get and post class methods into class attri... | bbcawodu/careadvisors-backend | picbackend/views/v2/hospital_web_traffic_calculator_views/views.py | views.py | py | 3,285 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "picbackend.views.utils.JSONPUTRspMixin",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "picbackend.views.utils.JSONGETRspMixin",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "django.views.generic.View",
"line_number": 10,
"usage_type"... |
23644407427 | from HabiticaAPI import Client
from HabiticaAPI.Exceptions import *
import json
def terminal_create_todos():
print("go on!")
queue = []
# title
title = input()
while title:
# input
task = {'tasktype': 'todo', 'checklist': []}
items = []
line = input()
while l... | Erakla/habitica-python-tools | AddTasksPerPaste/AddTasksPerPaste.py | AddTasksPerPaste.py | py | 2,438 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.load",
"line_number": 63,
"usage_type": "call"
},
{
"api_name": "HabiticaAPI.Client",
"line_number": 66,
"usage_type": "call"
}
] |
73757203708 | #!/usr/bin/env python3
import cyvcf2
import numpy as np
import pandas as pd
import sys
########## Load sample info and get sample order #############
kgsamples = pd.read_csv("/projects/ps-gymreklab/helia/TR_1000G/1000G.ped", delim_whitespace=True)
h3afrsamples = pd.read_csv("/projects/ps-gymreklab/helia/H3Africa/name... | gymreklab/1000Genomes-TR-Analysis | cumulative-gain/get_cumulative_counts.py | get_cumulative_counts.py | py | 2,734 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"line_nu... |
74489731068 | import numpy as np
import pandas as pd
import seaborn as sns
from datetime import timedelta
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from statistics import mean, stdev
from matplotlib.lines import Line2D
from mpl_toolkits.mplot3d import Axes3D
from sklearn.metrics import confusion_matrix as c... | UlysseCoteAllard/LongTermEMG | LongTermClassificationMain/TrainingsAndEvaluations/utils_training_and_evaluation.py | utils_training_and_evaluation.py | py | 36,585 | python | en | code | 14 | github-code | 6 | [
{
"api_name": "numpy.array",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 57,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 73,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": ... |
75059763387 | #coding:utf-8
'''
Created on 2016年5月5日 下午4:11:48
@author: TianD
@E-mail: tiandao_dunjian@sina.cn
@Q Q: 298081132
@Description:
'''
import pymel.core as pm
import utils.name as name
def createObjectSet(setName, objLst = [], exclusiveness = False, partition = None, increment = False):
'''
create an objec... | TianD/TianD_KX_TOOL | utils/objSet.py | objSet.py | py | 2,582 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "pymel.core.objExists",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pymel.core",
"line_number": 29,
"usage_type": "name"
},
{
"api_name": "pymel.core.sets",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "pymel.core",
"lin... |
27741412001 | import re
import logging
import collections
import os
import tools
class Option :
"""Create an option object with a "name" and "values" similar to dict """
def __init__(self, name, values) :
self.name = name
self.values = values
def splitValues(s) :
""" split string of values at ',' but no... | piclas-framework/reggie2.0 | combinations.py | combinations.py | py | 16,468 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "re.split",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.path.exists",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 54,
"usage_type": "attribute"
},
{
"api_name": "tools.red",
"line_number": 5... |
3520659999 | from time import gmtime, sleep
import pytest
from src.filter_never_sent import FilterNeverSent
from src.page_filter import PageFilter
from src.page_reference import PageReference
from src.rss_configuration import RssConfiguration
feedparser_dict = [
{
'link': 'https://g1.globo.com/ce/ceara/noticia/2019/0... | maxpeixoto/rss_filterer | test/test_filter_never_sent.py | test_filter_never_sent.py | py | 2,310 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "src.page_reference.PageReference",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "src.rss_configuration.RssConfiguration",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "time.gmtime",
"line_number": 32,
"usage_type": "call"
},
{
... |
28232689435 | import numpy as np
import copy
from sklearn.ensemble import RandomForestClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn import tree
######################################################
##### Utility Funcs #####
####################################################... | ZimmermanGroup/ActiveTransfer | AL.py | AL.py | py | 19,967 | python | en | code | 10 | github-code | 6 | [
{
"api_name": "sklearn.ensemble.RandomForestClassifier",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.vstack",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "numpy.concatenate",
"line_number": 63,
"usage_type": "call"
},
{
"api_name":... |
16199512324 | import sqlalchemy as sa
metadata = sa.MetaData()
restrictions_tbl = sa.Table("restrictions", metadata,
sa.Column("id", sa.Integer, primary_key=True, autoincrement=True),
sa.Column("user", sa.BigInteger, nullable=False),
sa.Column("ty... | chenzw95/porygon | database.py | database.py | py | 1,447 | python | en | code | 4 | github-code | 6 | [
{
"api_name": "sqlalchemy.MetaData",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Table",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Column",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.Intege... |
43623137070 | # -*- coding: utf-8 -*-
import pytest
from pathlib import Path
from mcomix.sort.sort_alphanumeric import SortAlphanumeric
@pytest.mark.parametrize('unsorted_file_list,sorted_file_list', [
([], []), # test empty
([9, 8, 7, 6, 5, 4, 3, 2, 1, 0], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]), # 1..9
([10.5, 10, 11, 1]... | thermitegod/mcomix-lite | tests/mcomix/test_sort_alphanumeric.py | test_sort_alphanumeric.py | py | 1,264 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "mcomix.sort.sort_alphanumeric.SortAlphanumeric",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "pytest.mark.parametrize",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pytest.mark",
"line_number": 9,
"usage_type": "attribute"
},
{
... |
72120292989 | from fastapi import APIRouter, Depends
from sqlalchemy import select, insert, or_
from sqlalchemy.ext.asyncio import AsyncSession
from database import get_async_session
from store.models import Product, Category
from store.schemas import ProductSchema
router = APIRouter(
tags=['Product']
)
@router.post('/produc... | ananos548/fastapi_store | src/store/router_product.py | router_product.py | py | 1,711 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "store.schemas.ProductSchema",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.ext.asyncio.AsyncSession",
"line_number": 15,
"usage_type": "name"
},
{
"... |
32552283318 | import asyncio
import sys
from typing import Optional
from mitmproxy import log
class ErrorCheck:
"""Monitor startup for error log entries, and terminate immediately if there are some."""
def __init__(self, log_to_stderr: bool = False):
self.has_errored: Optional[str] = None
self.log_to_stde... | MornS0/mitmproxy | mitmproxy/addons/errorcheck.py | errorcheck.py | py | 842 | python | en | code | null | github-code | 6 | [
{
"api_name": "typing.Optional",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "mitmproxy.log.LogEntry",
"line_number": 15,
"usage_type": "attribute"
},
{
"api_name": "mitmproxy.log",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "asyncio.cre... |
37182031556 | # class Connection_Mockup:
# def __init__(self):
# self.conn = None
import random
# def connect(self):
# self.conn = CON.Connection(arangoURL='http://127.0.0.1:8529', username='root', password='root')
# def close(self):
# if self.conn:
# self.conn.close()
# ... | brankomilovanovic/Database-Handler | handlers/nosql/arangodb/Workspace/LoadGraphFromDB_Test.py | LoadGraphFromDB_Test.py | py | 11,454 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "PyQt5.QtWidgets.QMainWindow",
"line_number": 126,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QGraphicsView",
"line_number": 133,
"usage_type": "name"
},
{
"api_name": "PyQt5.QtWidgets.QGraphicsView.RubberBandDrag",
"line_number": 137,
"usage_typ... |
38975624071 | import pandas as pd
import numpy as np
from sklearn import preprocessing
class data_fetch():
"""
This is the method that operates the source data file and stores processed format
into desired genometric learning format.
**input**: `argv_list`(optional), argv_list is the list input that only take ... | Zaoyee/deep-geometric-pathway | GenomicData/utils/data_fetch.py | data_fetch.py | py | 7,027 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pandas.read_csv",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing",
"line_number": 49,
"usage_type": "name"
},
{
"api_name... |
40319378487 | from ansible.module_utils.basic import AnsibleModule
from ansible_collections.ansibleguy.opnsense.plugins.module_utils.base.api import \
Session
from ansible_collections.ansibleguy.opnsense.plugins.module_utils.base.cls import GeneralModule
class Blocklist(GeneralModule):
CMDS = {
'set': 'set',
... | ansibleguy/collection_opnsense | plugins/module_utils/main/bind_blocklist.py | bind_blocklist.py | py | 1,299 | python | en | code | 158 | github-code | 6 | [
{
"api_name": "ansible_collections.ansibleguy.opnsense.plugins.module_utils.base.cls.GeneralModule",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "ansible.module_utils.basic.AnsibleModule",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "ansible_collections.a... |
31962659570 | # -*- coding: utf8 -*-
import argparse
import math
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from drake import lcmt_viewer_load_robot
from pydrake.common.eigen_geometry import Quaternion
from pydrake.geometry import DispatchLoadMessage, SceneGraph
from pydrake.lcm import DrakeMockLcm
from ... | ZackKnopp/quadruped | pendulum/underactuated/planar_multibody_visualizer.py | planar_multibody_visualizer.py | py | 13,676 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pyplot_visualizer.PyPlotVisualizer",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "numpy.array",
"line_number": 78,
"usage_type": "call"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 87,
"usage_type": "attribute"
},
{
"api_name"... |
70809072188 | # ------------------------------------------------------------------#
# AMPBA - 2021 Winter :: Data Collection assignment - PART1 #
# Group Id : 3 #
# Authors: #
# Nishant Jalasutram - PG I... | deepkamal/DC_AMPBA_W2021 | 3_matchResults.py | 3_matchResults.py | py | 11,587 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "csv.QUOTE_ALL",
"line_number": 40,
"usage_type": "attribute"
},
{
"api_name": "csv.DictWriter",
"line_number": 62,
"usage_type": "call"
},
{
"api_name": "csv.DictWriter",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "csv.DictWriter",
... |
1404571613 | from flask_app.config.mysqlconnection import connectToMySQL
from flask_app import DATABASE, bcrypt
from flask import flash, session
from flask_app.models.model_products import Product
class Cart:
def __init__( self , data ):
self.id = data['id']
self.user_id = data['user_id']
self.created_... | tchevier/Flak-Official | flask_app/models/model_carts.py | model_carts.py | py | 4,118 | python | en | code | 1 | github-code | 6 | [
{
"api_name": "flask_app.config.mysqlconnection.connectToMySQL",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "flask_app.DATABASE",
"line_number": 20,
"usage_type": "argument"
},
{
"api_name": "flask_app.config.mysqlconnection.connectToMySQL",
"line_number": 26,
... |
21958923365 | from numpy import *
from numpy.linalg import solve
import matplotlib.pyplot as plt
f = lambda y: 5*y*(1 - y)
fp = lambda y: 5 - 2*5*y
logistic = lambda x: 1./(1+9*exp(-5.*x))
# Rosenbrock-Wanner Ordnung 2
def ROW2_step(yi, h):
yi = atleast_2d(yi)
n = yi.shape[0]
a = 1.0 / (2.0 + sqrt(2.0))
I = id... | lubo93/Numerical-Mathematics | rosenbrock_wanner_logistic.py | rosenbrock_wanner_logistic.py | py | 1,792 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "numpy.linalg.solve",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.solve",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.linalg.solve",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.linalg... |
72516825787 | import pygame, map_gen , boss
pygame.init()
# font = pygame.font.SysFont(None, 48)
def drawGame(font):
score = 0
coin_count = 0
screenX = 870
screenY = 900
dx = 43
dy = 45
playernew = pygame.image.load('player1.png')
player =pygame.transform.scale(playernew, (dx, dy))
... | UlyanaNee/Game | maze.py | maze.py | py | 5,486 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "pygame.init",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "pygame.image.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pygame.image",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pygame.transform.scale... |
8110658180 | import streamlit as st
import pandas as pd
from fredapi import Fred
import plotly.graph_objects as go
from plotly.subplots import make_subplots
import numpy as np
from datetime import datetime,timedelta
import requests
fred = Fred(api_key='f40c3edb57e906557fcac819c8ab6478')
st.set_page_config(page_title="growth")
fr... | alitalbi/streamLit | pages/growth.py | growth.py | py | 16,024 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "fredapi.Fred",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "streamlit.set_page_config",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "fredapi.Fred",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "streamlit.date_inp... |
28704587946 | from http.server import HTTPServer, SimpleHTTPRequestHandler
import tkinter as tk
from tkinter import filedialog, messagebox
import tkinter.ttk as ttk
import os
from threading import Thread
import socket
class Application(ttk.Frame):
def __init__(self, master=None):
super().__init__(master)
self.m... | MihailShishow/file_server_gui | main.py | main.py | py | 4,871 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "tkinter.ttk.Frame",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "tkinter.ttk",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "tkinter.StringVar",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tkinter.ttk.Butt... |
25064423529 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import argparse
import datetime
import os,sys
import ntpath
import json
import glob
import shutil
import datetime
sys.path.insert(0, os.path.sep.join([os.path.di... | asmariyaz23/Long-reads | minion_pipeline.py | minion_pipeline.py | py | 21,193 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "sys.path.insert",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.path.sep.join",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_nu... |
39169034959 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.cm as cm
import matplotlib as mpl
import re
import sys
# fix 96 MLT bin
BinMLT=0.25
#-----------------------------------------------------------------------------
#
#--------------------------------------------------------------... | FTAModel/FTA | fta_model_aual.py | fta_model_aual.py | py | 21,212 | python | en | code | 2 | github-code | 6 | [
{
"api_name": "re.match",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 51,
"usa... |
7190325723 | import json
class Question:
def __init__(self, question_type="", title="", subtitle=""):
self.question_type = question_type
self.title = title
self.subtitle = subtitle
def __repr__(self):
return f"{self.question_type}, {self.title}, {self.subtitle}"
if __name__ == '__main__'... | flyfire/learning-py | qt/test_import_1/test_kwargs.py | test_kwargs.py | py | 486 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "json.loads",
"line_number": 17,
"usage_type": "call"
}
] |
9553211024 | import cgi
import urllib
import webapp2
from google.appengine.ext import db
class Contact(db.Model):
# Basic info.
name = db.StringProperty()
birthday = db.StringProperty()
# Address info.
address = db.StringProperty()
# The original phone_number property has been replaced by
# an imp... | gdgmiagegi/gae-datastore-mer | main.py | main.py | py | 2,727 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "google.appengine.ext.db.Model",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "google.appengine.ext.db",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "google.appengine.ext.db.StringProperty",
"line_number": 12,
"usage_type": "call"... |
72054858428 | from flask import Flask,render_template,request
import smtplib
app=Flask(__name__)
subscribe=[]
@app.route("/",methods=['get'])
def home():
return render_template("index.html")
@app.route('/form',methods=['post'])
def submit():
first_name=request.form.get("first_name")
mobile_number=request.form.get("mob... | Thangadurai43/Thangadurai43 | app.py | app.py | py | 872 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "flask.Flask",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask.request.form.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "flask.request.... |
24164930565 | import numpy as np
from numpy import trapz
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
from matplotlib.ticker import MaxNLocator
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.colors import LinearSegmentedColormap
from path import Path
from scipy.interpolate import interp1d... | FrancisCrickInstitute/AmmariMonaca2023 | Figure3_analysis/GRIN_analysis_tools.py | GRIN_analysis_tools.py | py | 63,161 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "path.Path",
"line_number": 54,
"usage_type": "call"
},
{
"api_name": "path.parent",
"line_number": 55,
"usage_type": "attribute"
},
{
"api_name": "path.stem",
"l... |
70008245307 | """
class for testing functionality of many methods used in EODIE
automatically run by gitlab on push
can also be run with ```pytest test_all.py```
authors: Samantha Wittke
"""
import os
import shutil
from collections import OrderedDict
from affine import Affine
import glob
import sys
import numpy as np
from eodie... | annefou/eodie | src/eodie/test_all.py | test_all.py | py | 10,150 | python | en | code | 0 | github-code | 6 | [
{
"api_name": "yaml.safe_load",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "eodie.mask.Mask",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 43,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_nu... |
4908646269 | import argparse
import math
import multiprocessing as mp
from pathlib import Path
from typing import Any, Dict, Tuple
import gym
from gym.spaces import Box
import numpy as np
from sb3_contrib import RecurrentPPO
from stable_baselines3.common.callbacks import CheckpointCallback, EvalCallback
from stable_baselines3.comm... | kachayev/car-racing-attention-agent | exp2-topK-ppo.py | exp2-topK-ppo.py | py | 10,662 | python | en | code | 5 | github-code | 6 | [
{
"api_name": "torch.nn.Module",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "torch.nn.LSTM",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numb... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.