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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
33923845443 | import numpy as np
import matplotlib.pyplot as plt
def Runge(x0, v0):
# Startwaarden
x = x0
v = v0
t0 = 0
# Variabelen
m = 1
h = 0.01
phi_max = 5
xpot = 5
# 2-vector with dependent variable
y = np.zeros((2), float)
y[0] = x
y[1] = v
# lists... | deboahemaa/Week-1-numstatfys | exercise_2d.py | exercise_2d.py | py | 2,844 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.zeros",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 2... |
70413300799 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import matplotlib
matplotlib.use('TKAgg')
import tensorflow as tf
from tensorflow.contrib.learn.python.learn.datasets import base
from tensorflow.python.framework import dtypes
from tensorflow.python.framework i... | ih-lab/CNN_Smoothie | CNN_basic/Load_2class.py | Load_2class.py | py | 6,844 | python | en | code | 18 | github-code | 97 | [
{
"api_name": "matplotlib.use",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "tensorflow.python.framework.dtypes.float32",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.python.framework.dtypes",
"line_number": 30,
"usage_type": "name... |
13231663407 | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 11 14:04:58 2020
@author: david
"""
import networkx
import networkx as nx
import matplotlib.pyplot as plt
def add_node_to_graph(g, case, more_nodes_to_ignore):
'''
Graph.add_node(node_for_adding, **attr)
Add a single node node_for_adding and update node att... | leebond/sgwuhan-network | SGWuhanHelperFunctions.py | SGWuhanHelperFunctions.py | py | 4,178 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "networkx.classes",
"line_number": 63,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 97,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 97,
"usage_type": "name"
},
{
"api_name": "netw... |
655246284 | import cocos
import pyglet
from pyglet import image as Image
from pyglet.image import Animation as Anim
import Map
##########################################################################################
##
class Wyvern(cocos.layer.Layer):
gravity = -9.8
secondsPerFrame = 0.075
# Create a texture atlas fro... | erikbuck/FlappyWyvern | Wyvern.py | Wyvern.py | py | 4,506 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "cocos.layer",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pyglet.image.atlas.TextureBin",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "pyglet.image",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "pygle... |
17874727099 | import discord
import klutzbot.command_defs.message
class Command(klutzbot.command_defs.message.Message):
"""
Representation of one command and all its useful properties
"""
start = "!"
def __init__(self, message: discord.Message, client: discord.Client):
super().__init__(message, clien... | JustinCheung168/klutzbot | klutzbot/command_defs/command.py | command.py | py | 2,046 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "klutzbot.command_defs.message.command_defs",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "klutzbot.command_defs.message",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "discord.Message",
"line_number": 13,
"usage_type": "attribute... |
44546779192 | from sklearn.preprocessing import StandardScaler
import pandas as pd
def preprosess(data, caling_list=[], dummy_list=[]):
""" 이 함수는 표준화와 원-핫 인코딩을 위한 코드
data= 데이터프레임값
caling_list = 스케줄링 해줄 변수들
dummy_list = 원- 핫 인코딩 해줄 변수
"""
# 파생변수를 스케줄링 해줌(표준화)
caling_category = ['TEM_IN', 'HUM_... | ssanchas/Weather-Bigdata-Contest | Weather-Bigdata-Contest/code/module.py | module.py | py | 1,094 | python | ko | code | 0 | github-code | 97 | [
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "p... |
2809247603 | import tensorflow as tf
from sklearn.preprocessing import OneHotEncoder
from PIL import Image
import os
import numpy as np
from sklearn.model_selection import train_test_split
import matplotlib.pyplot as plt
DATA_DIR_YES = r"C:\Users\Aryan\FLASK\Brain Tumor Detection\brain_tumor_dataset\yes"
DATA_DIR_NO = r"C:\Users\A... | AryanYuva/Brain-Tumor-Detection | Brain Tumor Detection/Model/model.py | model.py | py | 3,111 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sklearn.preprocessing.OneHotEncoder",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.walk",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
71065486398 | import requests
def test_all_posts_request():
response = requests.get('http://127.0.0.1:5000/api/posts')
type(response.json())
post_fields = {
'poster_name',
'poster_avatar',
'pic',
'content',
'views_count',
'likes_count',
'pk'
}
assert type... | tigran-saatchyan/skyprogram | tests/test_api.py | test_api.py | py | 1,416 | python | ru | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 26,
"usage_type": "call"
}
] |
72620449280 | import teradatasql
import json
import pandas as pd
from datetime import datetime, timezone
from google.cloud import secretmanager
def teradata_connector (query_db_name, secret_resource_id, object_type):
client_secret = secretmanager.SecretManagerServiceClient()
response = client_secret.access_secret_version(r... | GoogleCloudPlatform/professional-services | examples/bigquery-ddl-validator/plugin/teradata/teradata.py | teradata.py | py | 1,155 | python | en | code | 2,602 | github-code | 97 | [
{
"api_name": "google.cloud.secretmanager.SecretManagerServiceClient",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "google.cloud.secretmanager",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "json.loads",
"line_number": 11,
"usage_type": "call"
},
... |
74996503039 | from abc import ABCMeta, abstractmethod
import json
from aio_pika import connect_robust, Message
from code.config import settings
from ._base import BaseService
class RabbitMQService(BaseService, metaclass=ABCMeta):
def __init__(self, queue_name: str):
self._queue_name = queue_name
@abstractmethod
... | quqanai/zimran-test | backend/subscriptions/code/services/_rabbitmq.py | _rabbitmq.py | py | 849 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "_base.BaseService",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "abc.ABCMeta",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "abc.abstractmethod",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "aio_pika.Message",
... |
37560214345 | import pandas as pd
from pathlib import Path
inputfile = Path(__file__).parent / 'input.csv'
data = pd.read_csv(inputfile)
state = {
'horizontal': 0,
'vertical': 0,
'aim': 0,
}
# iterate through data
for d in data['data']:
action, value = d.split(' ')
value = int(value)
print(f"{action}, {val... | nllong/advent_of_code_2021 | day2/run.py | run.py | py | 870 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pathlib.Path",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"line_number": 5,
"usage_type": "call"
}
] |
2860556739 | import os, json, sys
from flask import Flask, render_template, request, Response, g
app = Flask(__name__)
def get_cdn_url():
if 'cdn' not in g:
g.cdn_url = "/static/cdn/"
return g.cdn_url
@app.route("/")
def home():
return render_template("ui.html", data={"cdnbaseurl": get_cdn_url(),})
@app.r... | codingwithsomeguy/csgflix | player/main.py | main.py | py | 1,440 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.g",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "flask.g.cdn_url",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "flask.g",
"line_number": 9,... |
16369244467 | import forecast
from config import config
import inverter
cloud_average = forecast.calculate_todays_cloud_average()
print(f"Today's cloud average is: {cloud_average}")
best_threshold = max(filter(lambda t: cloud_average >= t, config["cloud_thresholds"]))
time_of_use= config["cloud_thresholds"][best_threshold]
prin... | kofoednielsen/solar-controller | app/daily.py | daily.py | py | 847 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "forecast.calculate_todays_cloud_average",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "config.config",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "config.config",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "inv... |
21955018632 | #!/usr/bin/env python
# encoding: utf-8
import tweepy
import json
#Twitter API credentials
consumer_key = "uTjRLynXDBv4qt0e5ilbfc4QE"
consumer_secret = "QIpL4HiapJ21C7dMLY9ozMAsEwb2IWIc933PvzW9BBva7GpklU"
access_key = "902812596289626112-GaRIFy1FfFPtDkxESzf7bjzPaH8dnO4"
access_secret = "ISZmScghDtvnvfYKGH3EDkJ6UKQZeF... | Medan-AbdelHamid/Hate-Speech | Python/stream (2).py | stream (2).py | py | 1,405 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "tweepy.StreamListener",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "json.loads",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "json.dump",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tweepy.OAuthHandler",... |
15585141669 | from typing import (Callable, Dict, Optional)
import requests
from pathlib import Path
import tempfile
import shutil
import traceback
import time
import logging
from gettext import gettext as _
from deaduction.pylib.utils import filesystem as fs
from tempfile import TemporaryFile
import os.path
# import git
from ... | dEAduction/dEAduction | src/deaduction/pylib/packager/package.py | package.py | py | 15,283 | python | en | code | 17 | github-code | 97 | [
{
"api_name": "logging.getLogger",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 35,
"usage_type": "name"
},
{
"api_name": "deaduction.pylib.utils.filesystem.path_helper",
"line_number": 36,
"usage_type": "call"
},
{
"api_... |
14321379718 | import asyncio
import re
import os
import logging
from pyppeteer import launch
from dotenv import load_dotenv
load_dotenv()
USERNAME = os.getenv("USER")
PIN = os.getenv("PIN")
if not USERNAME or not PIN:
raise ValueError("Environment variables USER and PIN must be set")
logging.basicConfig(level=logging.INFO)
... | jonphob/saolgc_bot | main.py | main.py | py | 2,965 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "dotenv.load_dotenv",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line... |
19887691842 | import matplotlib
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
# matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
import csv
import os
print(matplotlib.get_backend())
plt.interactive(True)
# http://ksrowell.com/blog-visualizing-data/2012/02/02/optimal-colors-for-graphs/
MY_B... | adam-dziedzic/bandlimited-cnns | cnns/graphs/gaussian-noise/uniform_noise.py | uniform_noise.py | py | 2,248 | python | en | code | 17 | github-code | 97 | [
{
"api_name": "matplotlib.rcParams",
"line_number": 2,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.rcParams",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "matplotlib.get_backend",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": ... |
25002253367 | # Data preparation for flask app
import logging
import numpy as np
from imblearn.over_sampling import RandomOverSampler
from src.spacyNER import TrainingDataSpacy
from src.extract_bert_features import get_pipe, embed
def test_train_split(df, frac=1.0, oversample: bool=True):
"""
Returns a balanced train and t... | wgilpin/auto-ontology | webapp/data_prep.py | data_prep.py | py | 2,577 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.array",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number":... |
26330236424 | """Unit tests for Event module."""
from datetime import datetime
from typing import Dict, Any
import pytest
from notify_server.models.event import Event
from notify_server.models.payload_type import UserData
@pytest.mark.parametrize(
argnames=["data"],
argvalues=[
# Empty
[{}],
# Unk... | Opentrons/opentrons | notify-server/tests/unit/models/test_event.py | test_event.py | py | 1,276 | python | en | code | 363 | github-code | 97 | [
{
"api_name": "typing.Dict",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "typing.Any",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
... |
18249315060 | from flask import Flask, flash, jsonify, redirect, render_template, request, session
from flask_session import Session
from tempfile import mkdtemp
from werkzeug.exceptions import default_exceptions, HTTPException, InternalServerError
from werkzeug.security import check_password_hash, generate_password_hash
import ema... | Atharv-Attri/Compsci-site | app.py | app.py | py | 1,710 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tempfile.mkdtemp",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "flask_session.Session",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "flask.render_templ... |
13972658828 |
from django.urls import path
from . import views
app_name ='blog'
urlpatterns = [
path('',views.all_blogs, name='all_blogs' ),
path('about',views.about, name='about'),
path('<int:blog_id>', views.detail, name='detail')
] | softnotch/personal_portfolio | pp/blog/urls.py | urls.py | py | 243 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 11,
"usage_type": "call"
}
] |
74388475198 | from matplotlib import pyplot as plt
import numpy as np
import csv
import os
import zTime as time
import config
def drawGraph(path, file_name, data_type):
data = []
with open(path, 'r') as f:
reader = csv.reader(f)
for txt in reader:
data.append(float(txt[0]))
x = np.arange(... | Junwon6/data_analyzer | zGraph.py | zGraph.py | py | 1,113 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "csv.reader",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"lin... |
25790697696 | """
A script to run a chatbot using BLOOM-style model.
This script demonstrates how to use the transformers library to
run a chatbot with Hugging Face or local model.
The script is organized into three main sections: configurations,
utility functions, and main execution.
"""
import argparse
import logging
import nltk... | mikkorautiainen/Barebone-Boogie-Chatbot | barebone_chatbot.py | barebone_chatbot.py | py | 9,825 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.basicConfig",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "torch.device"... |
25284743709 | # -- coding:utf-8 --
import requests
from paramspider.settings import MYUSER_AGENTS
import random
from scrapy.selector import Selector
import json
def crawl_ips():
ua = random.choice(MYUSER_AGENTS)
headers = {
"Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q... | zhouhanghust/Scrapy | paramspider/tools/crawl_xici_ip.py | crawl_xici_ip.py | py | 1,521 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "random.choice",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "paramspider.settings.MYUSER_AGENTS",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "requests.get",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "scr... |
42359123317 | import argparse
import sys
sys.path.append("./")
from tools_embryo_segmentation import glob_tasks
from tools_embryo_segmentation import main_window_procedures
class ToolEmbryoSegmentation:
"""
Segment images containing multiple zebrafish embryos and store
segment information as .json files.
Requires ... | mueller-lab/TwinNet | code/Scripts/segmentation/main.py | main.py | py | 2,575 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.path.append",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "tools_embryo_segmentation.glob_tasks.GlobTasks",
"line_number": 24,
"usage_type": "call"
},
{
"api_na... |
38391467430 |
from django import forms
from .models import CustomUser, Program
from django.contrib.auth.forms import UserCreationForm
class StudentForm(forms.ModelForm):
class Meta:
model = CustomUser
fields = ['image','first_name', 'last_name', 'username','indexNo', 'email', 'program', 'paid']
widgets... | free20064u/schoolmanagement | course/forms.py | forms.py | py | 896 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "models.CustomUser",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "django.forms.... |
11876664629 | import board
import busio
import logging
import threading
import os
import pickle
from adafruit_sgp30 import Adafruit_SGP30
class GasReader:
def __init__(self, blackboard):
self.__baseline_filename = "baseline.data"
self.stop_requested = False
self.stop_event = threading.Event()
... | rieder91/pi-co2 | gas.py | gas.py | py | 3,118 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "threading.Event",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "busio.I2C",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "board.SCL",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "board.SDA",
"line_number... |
10749444421 | import pytest
import json
import requests
list_of_presidents = ['Washington', 'Adams', 'Jefferson', 'Madison', 'Monroe', 'Jackson', 'Van Buren', 'Harrison', 'Tyler', 'Polk', 'Taylor', 'Fillmore', 'Pierce', 'Buchanan', 'Lincoln', 'Johnson', 'Grant', 'Hayes', 'Garfield', 'Arthur',
'Cleveland', 'McK... | arhughes11/duckduckgo_api_test | test-api.py | test-api.py | py | 1,342 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "requests.get",
"line_number": 11,
"usage_type": "call"
}
] |
6154709135 | from isegm.utils.exp_imports.default import *
MODEL_NAME = 'cdnet_res34_cclvs'
from isegm.data.datasets.ade20k import ADE20kDataset
from isegm.data.datasets.saliency import SaliencyDataset
from isegm.data.compose import ComposeDataset,ProportionalComposeDataset
import torch.nn as nn
from isegm.engine.cdnet_trainer impo... | alibaba/ClickSEG | models/cdnet/cdnet_res34_cclvs.py | cdnet_res34_cclvs.py | py | 3,585 | python | en | code | 32 | github-code | 97 | [
{
"api_name": "isegm.data.aligned_augmentation.AlignedAugmentator",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "torch.nn.optim",
"line_number": 81,
"usage_type": "attribute"
},
{
"api_name": "torch.nn",
"line_number": 81,
"usage_type": "name"
},
{
"a... |
29180996208 | from flask import Flask, jsonify
import pickle
from os.path import abspath, dirname, join
here = dirname(abspath(__file__))
app = Flask(__name__)
with open(join(here, 'data.pkl'), 'rb') as f:
id_report_mapping, word_report_ids_mapping = pickle.load(f)
@app.route('/food/<food_name>')
def get_food_info(food_name... | angelaho0504/food_alert | server/main.py | main.py | py | 1,091 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path.abspath",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.Flask",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_num... |
73135578560 | import random
from os.path import abspath, expanduser, join
from typing import List, Optional, Union
from zipfile import ZipInfo
import pytest
from azure.cli.core.azclierror import ResourceNotFoundError
from azext_edge.edge.commands_edge import support_bundle
from azext_edge.edge.common import AIO_MQ_OPERATOR
from az... | Azure/azure-iot-ops-cli-extension | azext_edge/tests/edge/support/test_support_unit.py | test_support_unit.py | py | 23,829 | python | en | code | 5 | github-code | 97 | [
{
"api_name": "generators.generate_generic_id",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "azext_edge.edge.commands_edge.support_bundle",
"line_number": 89,
"usage_type": "call"
},
{
"api_name": "azext_edge.edge.providers.edge_api.AKRI_API_V0",
"line_number": 9... |
3374494606 | from __future__ import print_function
import torch
import torchvision
import torchvision.transforms as transforms
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import time
transform = transforms.Compose([transforms.ToTensor(),
transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.... | bigning/PytorchTutorial | cifar10.py | cifar10.py | py | 2,405 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.ToTensor",
"line_number": 11,
"usage_type": "call"
},
{
... |
26318279374 | from __future__ import annotations
from enum import Enum
import asyncio
from typing import Optional, Dict
from opentrons.drivers import utils
from opentrons.drivers.command_builder import CommandBuilder
from opentrons.drivers.asyncio.communication import AsyncResponseSerialConnection
from opentrons.drivers.heater_sha... | Opentrons/opentrons | api/src/opentrons/drivers/heater_shaker/driver.py | driver.py | py | 6,564 | python | en | code | 363 | github-code | 97 | [
{
"api_name": "enum.Enum",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "opentrons.drivers.heater_shaker.abstract.AbstractHeaterShakerDriver",
"line_number": 37,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 40,
"usage_type": "name"
... |
30287974241 | from datetime import datetime, timedelta
from lib.actions import OrionBaseAction
class NodeUnmanage(OrionBaseAction):
def run(self, node, minutes):
"""
Unmanage an Orion node
"""
if minutes > self.config['unmanage_max']:
raise ValueError(
"minutes ({})... | StackStorm/st2contrib | packs/orion/actions/node_unmanage.py | node_unmanage.py | py | 1,118 | python | en | code | 154 | github-code | 97 | [
{
"api_name": "lib.actions.OrionBaseAction",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.utcnow",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": ... |
36795646490 | import oneflow as flow
import oneflow.typing as tp
from typing import Tuple
import numpy as np
import time
import os
from yolov3_tiny import Yolov3_tiny
from dataset import Dataset
from config import cfg
np.set_printoptions(threshold=np.inf)
train_label_sbbox_input_size = int(cfg.TRAIN.INPUT_SIZE[0]/cfg.YOLO.STRIDES[... | Oneflow-Inc/oneflow_vision_model | TCA/detector/train.py | train.py | py | 3,991 | python | en | code | 10 | github-code | 97 | [
{
"api_name": "numpy.set_printoptions",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "config.cfg.TRAIN",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "config.cf... |
39124487090 | from sqlalchemy import BigInteger, Column, ForeignKeyConstraint, PrimaryKeyConstraint
from sqlalchemy.orm import relationship
from app.db.base_class import FLBase
class NeedNote(FLBase):
__tablename__ = "NeedNotes"
__table_args__ = (
PrimaryKeyConstraint("NeedId", "NoteId", name="idx_20753_PK_NeedNo... | WeAreBeep/FrontlineUkraine | src/core/app/app/models/need_note.py | need_note.py | py | 925 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "app.db.base_class.FLBase",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "sqlalchemy.PrimaryKeyConstraint",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "sqlalchemy.ForeignKeyConstraint",
"line_number": 12,
"usage_type": "call"
},
... |
16129850609 | # encoding=utf8
import telebot
import config, db_funcs
def botLogic():
bot = telebot.TeleBot(config.API_TOKEN)
@bot.message_handler(content_types=['text'])
def subscribeTo(message):
message_sender = str(message.chat.id)
is_admin, message_text = db_funcs.isAdmin(message_sender), str(message.... | abzik90/excel_search_bot | app.py | app.py | py | 2,396 | python | ru | code | 0 | github-code | 97 | [
{
"api_name": "telebot.TeleBot",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "config.API_TOKEN",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "db_funcs.isAdmin",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "db_funcs.changeA... |
7411541741 | from pydantic import BaseModel
class RoulettePattern:
class HistoryItem(BaseModel):
number: int
dozen: int
dozens: list[list[int]] = [[0], [*range(1, 13)], [*range(13, 25)], [*range(25, 37)]]
observers: dict = {
'n_of_same_dozen': []
}
@classmethod
def get_dozen(cls, ... | Rafael-dePaula/Casino-Bot | telegram/pattern.py | pattern.py | py | 2,062 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pydantic.BaseModel",
"line_number": 5,
"usage_type": "name"
}
] |
12002489381 | import re
from enum import Enum
import pandas as pd
from datetime import datetime
import config
def is_interactive():
import __main__ as main
return not hasattr(main, '__file__')
if not is_interactive():
import pymysql as db_con
else:
import mysql.connector as db_con
cnx = None
cursor = None
... | benlaird/soccer-project | createDBTables.py | createDBTables.py | py | 7,286 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "mysql.connector.connect",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "mysql.connector",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "config.host",
"line_number": 31,
"usage_type": "attribute"
},
{
"api_name": "config.user"... |
41276422532 | #!/usr/bin/env python
"""Fix metrics by reparsing corrupt log files
"""
import ast
from pathlib import Path
import mlflow
from scanprops import evt_rate_duration_from_log
from selections import read_config_toml, select_runs
def read_corrupt_logs(file_path: str | Path) -> str:
"""Read corrupt log files and try ... | LHC-NLeSC/run-allen-run | fix-corrupt-metrics.py | fix-corrupt-metrics.py | py | 2,078 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pathlib.Path",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "pathlib.Path",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "pathlib.Path",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": "ast.literal_eval",
"line_n... |
16106404571 | from chembl_webresource_client.new_client import new_client
from utils import printerr
from tqdm import tqdm
import sys
if (len(sys.argv) < 2):
exit("You must provide the minimum inhibition percentage at 1 micromol as argument.")
min_inhibition_percentage = int(sys.argv[1])
assay = new_client.assay
# Filtramos l... | joseroma/systems-biology-final-project | python/gsk_filter.py | gsk_filter.py | py | 1,453 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "sys.argv",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "chembl_webresource_client.new_client.new_client.assay",
"line_number": 10,
"usage_type": "attribute"
},
{
... |
73731817919 | from flask import Flask, request
app = Flask(__name__)
app.config["DEBUG"] = True
@app.after_request
def enableCors(response):
response.headers.add('Access-Control-Allow-Origin', '*')
response.headers.add('Access-Control-Allow-Headers', 'Content-Type,Authorization')
response.headers.add('Access-Control-Allow-Metho... | BogdanDenis/ci-server-course-work | be/api/__init__.py | __init__.py | py | 673 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Flask",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "flask.request.environ.get",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "flask.request.environ",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "flask... |
31021241348 | #!/usr/bin/python3
"""Routes for player to play game"""
from poker.game.card import Card
from poker.game.deck import Deck
from poker.game.game_round import GameRound
from poker.game.hand import Hand
from poker.game.player import Player
from flask_login import current_user, login_required
from poker import db
... | jacobgbemi/Naija_Hold-em_Poker | poker/game/routes.py | routes.py | py | 2,721 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.Blueprint",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "poker.game.deck.Deck",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "poker.game.card.Card.create_standard_52_cards",
"line_number": 24,
"usage_type": "call"
},
{
... |
35638190568 | #! /usr/bin/env python3
import os
import sys
import time
import random
import subprocess
from itertools import permutations
from lemonbar_script import MainLoop
from bar_modules import BspwmWorkspaces, CoronaVirus, ServerStatus,\
PingTimeOut, PacmanUpdates, NetworkTraffic, DiskUsage, SARCPUUsage,\
CPUTemp, Ra... | yousufinternet/config-files | Scripts/LemonBar/start_lemonbar.py | start_lemonbar.py | py | 4,819 | python | en | code | 20 | github-code | 97 | [
{
"api_name": "os.getenv",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "subprocess.check_output",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "bar_modules.ficon",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "bar_modules.ficon... |
6213493788 | from django.urls import path
from . import views
urlpatterns = [
path('', views.home, name='home'),
path('signup/', views.signupuser, name='signupuser'),
path('register/', views.registeruser, name='registeruser'),
path('thankyou/', views.thankyou, name='thankyou'),
path('welcome/', views.welcome, n... | Saiyuva-05/User_authentication_ | a_user/urls.py | urls.py | py | 397 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
71789998078 |
print("Working...")
from tensorflow.keras.models import load_model
from tensorflow.keras.models import model_from_json
import cv2
import numpy as np
import argparse
import logging
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # FATAL
logging.getLogger('tensorflow').setLevel(logging.FATAL)
# construct the argu... | gauravsinha7/Covid-Xray-Analysis-Tool | usage.py | usage.py | py | 1,079 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "os.environ",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "logging.FATAL",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "argparse.Argumen... |
11727197469 | from collections import deque
class Node:
def __init__(self,data):
self.data=data
self.lchild=None
self.rchild=None
class Tree:
def __init__(self):
self.root=None
def create(self):
print("Enter the root data")
data=input()
rootnode=Node(data)
... | siddhivinayakdubey/DSA | Trees/Alloperations.py | Alloperations.py | py | 3,193 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "collections.deque",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 78,
"usage_type": "call"
}
] |
24702807977 | '''
# @ Author: Bao Loc Pham
# @ Create Time: 2023-06-09 16:09:22
# @ Modified by: Bao Loc Pham
# @ Modified time: 2023-06-10 10:11:30
# @ Description: This file is for testing churn library
'''
import os
import logging
import warnings
import churn_library as clb
# import pytest
warnings.filterwarnings("ignore")... | BaoLocPham/MLOps_Udacity_Project_1 | churn_script_logging_and_tests.py | churn_script_logging_and_tests.py | py | 7,879 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "logging.basicConfig",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "loggin... |
10322608631 | #!/usr/bin/env python
# PCR controller base functions
# Jaeduk Han (05/19/2016)
import time
import serial
import numpy as np
import matplotlib.pyplot as plt
import sys
import glob
from IPython import display
from ipywidgets import widgets
from collections import deque
flag_sim=0;
temp_sim=30;
led_sim=0;
fan_sim=0;
ser... | racarrasco/thermocycler | Python/PCR_cont.py | PCR_cont.py | py | 11,771 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "numpy.clip",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "sys.platform.startswith",
"line_number": 98,
"usage_type": "call"
},
{
"api_name": "sys.platform",
"line_number": 98,
"usage_type": "attribute"
},
{
"api_name": "sys.platform.sta... |
74920946879 | "#_*_ coding:utf-8 _*_"
import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.getcwd(), "/..")))
import argparse
import torchvision
import torch
import numpy as np
import torch.nn as nn
import torch.utils.data as Data
import pandas as pd
import json
from torch import nn, optim
from torch.autograd import ... | dajuguan/ml | ex1/liang/encoder_model_train.py | encoder_model_train.py | py | 3,303 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "sys.path.append",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
15233798162 | import torch
import torch.nn as nn
class EEGNet(nn.Module):
def __init__(self, nb_classes=2, alpha=1.0, p=0.25):
super(EEGNet, self).__init__()
# Set up the hyperparameters
self.nb_classes = nb_classes
self.firstconv = nn.Sequential(
nn.Conv2d(1, 16, (1, 51), (1... | DongDong-Zoez/AI-DeepMedical-Starter | eeg-classification/model.py | model.py | py | 1,816 | python | en | code | 0 | github-code | 97 | [
{
"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.Sequential",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_... |
9411376514 | from django.shortcuts import render, HttpResponse
from django.views.generic import ListView
import requests
def index(request):
print('x')
return render(request, 'core/index.html')
def species(request):
species = []
if request.method == 'POST':
species_url = 'https://ghibliapi.he... | micaelagimenez/ghiblimovs | core/views.py | views.py | py | 3,466 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "django.shortcuts.render",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "requests.... |
20609822261 | from . import Funkcija
from ..util import minterm_v_niz, provide_no_escape
from typing import List, Optional
from pylatex import Document, Section, Subsection, Math
from pylatex.utils import NoEscape
from itertools import zip_longest
from varname import varname
class SimFunkcija(Funkcija):
def __init__(self, n:int, s... | aljazmedic/pyodv | pyodv/function/sim_funkcija.py | sim_funkcija.py | py | 2,108 | python | sh | code | 4 | github-code | 97 | [
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "util.minterm_v_niz",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "itertools.zip_longest"... |
31731091996 | #!/usr/bin/python
import random
import collections
import math
import sys
from util import *
############################################################
# Problem 3: binary classification
############################################################
############################################################
# Prob... | dchen327/stanford-cs221-code | sentiment/submission.py | submission.py | py | 5,979 | python | en | code | 21 | github-code | 97 | [
{
"api_name": "collections.defaultdict",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "random.seed",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "random.random",
"line_number": 79,
"usage_type": "call"
},
{
"api_name": "random.sample",
... |
11114404711 | # Author: Bichen Wu (bichen@berkeley.edu) 08/25/2016
# Modified : Wang Yuan
"""Neural network model base class."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
from utils import util
import numpy as np
import tensorflow as tf
import... | ywangeq/PointSeg | src/nn_skeleton.py | nn_skeleton.py | py | 72,924 | python | en | code | 64 | github-code | 97 | [
{
"api_name": "tensorflow.float32",
"line_number": 33,
"usage_type": "attribute"
},
{
"api_name": "tensorflow.get_variable",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "tensorflow.get_variable",
"line_number": 37,
"usage_type": "call"
},
{
"api_name"... |
42113717305 | from . import views
from django.urls import path
urlpatterns = [
path('', views.index, name='index'),
path('counter', views.counter, name='counter'),
path('handleCounter', views.handleCounter, name='handleCounter'),
path('login', views.login, name='login'),
path('handleRegister', views.handleRegist... | elyas-nawabi/djangoprojects | projects/myblog/urls.py | urls.py | py | 1,000 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "django.urls.path",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "django.urls.path",
... |
74386836159 | ###############################################################################
### Bio SeqIO is to parse a FASTA file, SeqUtils is for nt_search, which scans
### a file for a desired string of nts, reverse_complement is used one time to
### search specifically for wc base pair potential in an Ori
### RNA is the Vien... | AdamTSmiley/Ori-Seek | OriSeek.py | OriSeek.py | py | 16,557 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "Bio.SeqIO.parse",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "Bio.SeqIO",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "Bio.SeqUtils.nt_search",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "Bio.SeqUtils",
"... |
8029849000 | # Lint as: python3
"""Flax implementation of ResNet V1.
"""
from flax import nn
from jax import lax
import jax.numpy as jnp
class SpaceToDepthConv(nn.base.Module):
"""Convolution on space-to-depth transformed input images."""
def apply(self,
inputs,
filters,
kernel_size,
... | mlcommons/training_results_v0.7 | Google/benchmarks/resnet/implementations/resnet-research-JAX-tpu-v3-8192/models.py | models.py | py | 8,303 | python | en | code | 58 | github-code | 97 | [
{
"api_name": "flax.nn.base",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "flax.nn",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "jax.numpy.float32",
"line_number": 26,
"usage_type": "attribute"
},
{
"api_name": "jax.numpy",
"lin... |
36711618921 | import argparse
import os
import torch
import torch.optim as optim
from torch.optim.lr_scheduler import ReduceLROnPlateau
from trainer import train_model
from model import createDeepLabv3
from utils import create_nested_dir, get_criterion_by_name, get_segmentation_model, get_data_loaders, get_log_path
from kidney_da... | Luanabcruz/Tese-Doutorado-DCCMAPI | kidney-tumor-segmentation-method/main.py | main.py | py | 3,603 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "kidney_dataset_utils.misc.split_kits19.load_dpa_dist",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "lua_enums.DataAug",
"line_number": 50,
"usage_type": "attribute"
},
{
"api_name": "utils.get_log_path",
"line_number": 54,
"usage_type": "call"
... |
25286909200 | #!/bin/env/python
import requests
from bs4 import BeautifulSoup
from csv import DictWriter
import re
import json
from shutil import which
from subprocess import call
def parse_last_update(page):
soup = BeautifulSoup(page.text, features="html.parser")
update_tag = soup.find(lambda tag:tag.name=="div" and tag... | AlecDidi/mv-covid19-graph | scraper.py | scraper.py | py | 2,620 | python | en | code | null | github-code | 97 | [
{
"api_name": "bs4.BeautifulSoup",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "re.MULTILINE",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "re.DOTALL",
"line_n... |
13695448996 | import apriltag
import cv2
import numpy as np
#gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# slide a window across the image
def reader(img):
tagList = []
global img2
for y in range(0, img.shape[0], 350):
for x in range(0, img.shape[1], 350):
result, img2 = detector.det... | wyu12/DCT-Computer-Vision | Arjun:Josh Sliding window.py | Arjun:Josh Sliding window.py | py | 781 | python | en | code | 4 | github-code | 97 | [
{
"api_name": "cv2.imwrite",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cv2.VideoCapture",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "apriltag.Detector",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line... |
30285964811 | from lib.icsp import ICSPBaseActions
class SetServerAttribute(ICSPBaseActions):
def run(self, mid, attribute_key, function,
attribute_value=None, connection_details=None):
self.set_connection(connection_details)
self.get_sessionid()
endpoint = "/rest/os-deployment-servers/%s" ... | StackStorm/st2contrib | packs/hpe_icsp/actions/icsp_server_attribute_set.py | icsp_server_attribute_set.py | py | 1,664 | python | en | code | 154 | github-code | 97 | [
{
"api_name": "lib.icsp.ICSPBaseActions",
"line_number": 4,
"usage_type": "name"
}
] |
74032283519 | from flask import jsonify, make_response
from app import app
from app.database import db
@app.errorhandler(404)
def error_404(error):
"""这个handler可以catch住所有abort(404)以及找不到对应router的处理请求"""
app.logger.exception(error)
db.session.remove()
response = dict(status=404, message="{}".format(error))
return ... | flyingsnow0102/hacking_defense_show | app/error_class.py | error_class.py | py | 1,130 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "app.app.logger.exception",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "app.app.logger",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "app.app",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "app.database.db.ses... |
36758863396 | """
This is a template algorithm on Quantopian for you to adapt and fill in.
"""
from quantopian.algorithm import attach_pipeline, pipeline_output
from quantopian.pipeline import Pipeline
from quantopian.pipeline.data.builtin import USEquityPricing
from quantopian.pipeline.factors import AverageDollarVolume, CustomFact... | shinseitaro/my-quantopian-archive | algorithms/vxx tvix daytime/backtests/Backtest 6-5916bfaf5ed5976620c924fb.py | Backtest 6-5916bfaf5ed5976620c924fb.py | py | 10,555 | python | en | code | 3 | github-code | 97 | [
{
"api_name": "quantopian.algorithm.attach_pipeline",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "quantopian.pipeline.factors.CustomFactor",
"line_number": 43,
"usage_type": "name"
},
{
"api_name": "quantopian.pipeline.data.builtin.USEquityPricing.close",
"line_... |
38187915170 | # cpp, java, python 중 하나
# 백이나 프론트 중 하나를 선택해야함
# junior와 senior 중 하나를 선택
# chicken과 pizza중 하나 선택
# 지원 조건을 선택하면 해당 조건에 맞는 지원자가 몇 명인지 쉽게 알 수 잇는 도구를 만들고 싶음
# java, backend, junior, pizza 선택 중 50점 이상 받은 지원자는?
# 모든 선택을 필수로 할 필요는 없다.
# 4가지 정보, 코딩테스트 점수 하나의 문자열로 구성한 값의 배열 info
# 개발팀이 궁금해하는 문의 조건이 문자열 형태로 담긴 배열query가 매개변수... | GotPrgmer/co-re-study | 29/김민준/순위 검색.py | 순위 검색.py | py | 4,646 | python | ko | code | null | github-code | 97 | [
{
"api_name": "itertools.combinations",
"line_number": 86,
"usage_type": "call"
}
] |
29678318024 | from torch import nn
import torch.nn.functional as F
class DQN(nn.Module):
def __init__(self, num_actions):
super(DQN, self).__init__()
self.num_actions = num_actions
self.convLayer1 = nn.Conv2d(
in_channels = 4,
out_channels = 32,
kernel_size = 8,
... | ntindallUSC/project_flappy | model.py | model.py | py | 1,289 | python | en | code | 0 | github-code | 97 | [
{
"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.Conv2d",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_numbe... |
38101283635 | from flask import Flask,render_template
import time
from multiprocessing import Process as pcs
from multiprocessing import Queue as queue
class WifiSender():
def __init__(self,maxsize=5):
self.T=T=time.time()
self.Q=Q=queue.Queue(maxsize=maxsize)
self.app=app=Flask(__name__)
... | Astesias/baidu_18_competition | test/wifi.py | wifi.py | py | 2,615 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "time.time",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Queue.Queue",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Queue",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "flask.Flask"... |
6988754483 | import asyncio
import datetime
import typing
from typing import Optional
from unicodedata import category
import disnake
from disnake.ext.commands import Cog, has_permissions, Param, cooldown, BucketType, has_any_role
from disnake.ext.commands.slash_core import slash_command
from lib.db import db
from lib.utils.helpers... | jaymart95/AccGen | lib/cogs/commands.py | commands.py | py | 8,892 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "disnake.ext.commands.Cog",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "disnake.ext.commands.Cog.listener",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "disnake.ext.commands.Cog",
"line_number": 17,
"usage_type": "name"
},
{
... |
3247739197 | from flask.ext.mongoengine import MongoEngine
from mongoengine import *
from mongoengine.base import BaseList, BaseDocument
engine_db = MongoEngine()
def is_empty(doc):
if doc is None:
return True
if isinstance(doc, BaseList):
return False if doc else True
if isinstance(doc, BaseDocument)... | dredivaris/pluggable_resume | wsgi/models.py | models.py | py | 5,648 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "flask.ext.mongoengine.MongoEngine",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "mongoengine.base.BaseList",
"line_number": 11,
"usage_type": "argument"
},
{
"api_name": "mongoengine.base.BaseDocument",
"line_number": 13,
"usage_type": "argument... |
29367289421 | from tkinter import *
from pytube import YouTube
base = Tk()
base.geometry("500x300")
base.resizable(0, 0)
base.title("YT Video Downloader")
Label(base, text = "Youtube Video Downloader", font = "arial 20 bold").pack()
link = StringVar()
Label(base, text = "Paste Link Here:", font = 'arial 15 bold').place(x= 160 , ... | SamarjeetBanik/mini-python-projects | YT_Video_Downloader.py | YT_Video_Downloader.py | py | 756 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pytube.YouTube",
"line_number": 17,
"usage_type": "call"
}
] |
38873125339 | #coding=utf-8
import torch
from torch.autograd import Variable
from torch.backends import cudnn
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
import numpy as np
import pprint
import os
import argparse
import pandas as pd
import warnings
warnings.filterwarnings("ignore")
# f... | FeixiangZhou/GM-SCENet | train.py | train.py | py | 16,698 | python | en | code | 6 | github-code | 97 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "torch.backends.cudnn.benchmark",
"line_number": 28,
"usage_type": "attribute"
},
{
"api_name": "torch.backends.cudnn",
"line_number": 28,
"usage_type": "name"
},
{
"... |
23950877662 | import pandas as pd
import numpy as np
from tqdm import tqdm
"""
生成positive 和negative采样
"""
saving_file = "../../tmp/finData/finSamples4Level.npy"
# 实体表csv文件路径
ENTITY_DATA_PATH = "../../tmp/finData/finEntity.csv"
# 关系表csv文件路径
RELATION_DATA_PATH = "../../tmp/finData/finRelation.csv"
# [CLS]符号
CLS_CHAR = "$"
# [SEP]符号... | alibaba/EasyNLP | examples/kangaroo_pretraining/pos_neg_samples.py | pos_neg_samples.py | py | 9,856 | python | en | code | 1,835 | github-code | 97 | [
{
"api_name": "numpy.random.seed",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 48,
"usage_type": "attribute"
},
{
"api_name": "pandas.isna",
"line_number": 84,
"usage_type": "call"
},
{
"api_name": "numpy.random.shuffle"... |
3064961732 | # -*- coding: utf-8 -*-
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
from odoo.addons.http_routing.models.ir_http import slug, slugify
import json
class EventTheater(models.Model):
_name = 'event.theater'
_description = 'Theater'
name = fields.Char(string='Name', re... | yveshoyos/chabarok | event_seating/models/theater.py | theater.py | py | 6,519 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "odoo.models.Model",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "odoo.models",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "odoo.fields.Char",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "odoo.fields",
"... |
31142409703 | #!/usr/bin/env python
"""Time humanizing functions. These are largely borrowed from Django's
``contrib.humanize``."""
import datetime as dt
from enum import Enum
from .i18n import gettext as _
from .i18n import ngettext
__all__ = ["naturaldelta", "naturaltime", "naturalday", "naturaldate"]
class Unit(Enum):
... | RunFeifei/Paprika | venv/lib/python3.7/site-packages/humanize/time.py | time.py | py | 6,888 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "enum.Enum",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 22,
"usage_type": "attribute"
},
{
"api_name": "datetime.datet... |
73310850239 | from typing import List
from flask import current_app
from raspcuterie.devices import InputDevice
from raspcuterie.devices import OutputDevice
class ControlRule:
registry: List["ControlRule"] = []
def __init__(self, device: OutputDevice, expression: str, action: str, name: str = None):
ControlRule.... | foarsitter/raspcuterie | raspcuterie/devices/control.py | control.py | py | 1,253 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "typing.List",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "raspcuterie.devices.OutputDevice",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "raspcuterie.devices.OutputDevice",
"line_number": 15,
"usage_type": "name"
},
{
"api... |
22785400153 | import pytest
import server
from server import app
@pytest.fixture
def client():
""" Fixture du client pour tests """
app.config['TESTING'] = True
with app.test_client() as client:
yield client
@pytest.fixture
def load_clubs(mocker):
""" Fixture données clubs pour tests """
return mocker... | Benoitrenou/Project_11-Improve_an_application_with_tests_and_Test_Driven_Design | Python_Testing/tests/conftest.py | conftest.py | py | 1,125 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "server.app.config",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "server.app",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "server.app.test_client",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "server.app",
... |
74076126080 | from logging import exception
import sys
import subprocess
import math
import importlib
pkgs = {'pandas': 'pd', 'tqdm': 'tqdm','numpy':'np','openpyxl':'openpyxl','xlwings':'xlwings'}
def check_packages():
for p in pkgs:
s = pkgs[p]
try:
print(f'check for {p}')
s = importlib... | amundsentech/kay_curate | cleaningtools.py | cleaningtools.py | py | 8,469 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "importlib.import_module",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "subprocess.call",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "sys.executable",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "importlib... |
41262657713 | # Missing Data Handling Module
def myPreprocessor(dataframe, handling_method, target_label_name):
df = dataframe
method = handling_method
label = target_label_name
#importing libraries
import numpy as np
import pandas as pd
from sklearn import preprocessing
for i in range(df.shap... | ZZYINGing/Two_Level_IoT_Network_Attack_Detection_System_Using_Deep_Learning | myDataPreprocessing.py | myDataPreprocessing.py | py | 2,082 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 42,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing",
"line_number": 42,
"usage_type": "name"
},
{
"api_name": "sklearn.preprocessing.MinMaxScaler",
"line_number": 59,
"usage_type": "call"
}... |
15551866416 | #from .faceID_lib import faceID_lib
import os
import time
import cv2
import sys
sys.path.append(os.getcwd())
import argparse
import faceID_lib
def make_parser():
parser = argparse.ArgumentParser()
parser.add_argument("--input", type=str, required=True, help="input image name")
parser.add_argument("-... | guantinglin/faceID_lib | examples/find_face_in_picture/find_faces_in_picture.py | find_faces_in_picture.py | py | 1,137 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "sys.path.append",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "os.getcwd",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "argparse.ArgumentParser",
"l... |
7135999668 | from __future__ import print_function
from task.model.DAN import base
from task.framework import baseline
import yaml
constPath = "./task/yaml/oracle.yaml"
if __name__ == '__main__':
data = open(constPath, 'r').read()
setConfigs = yaml.load(data, Loader=yaml.FullLoader)
modelRoot = setConfigs['modelRoot']... | Foracgn/newOSOCR | task/OCR/oracle/train.py | train.py | py | 1,335 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "yaml.load",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "yaml.FullLoader",
"line_number": 10,
"usage_type": "attribute"
},
{
"api_name": "task.model.DAN.base.OracleDanConfig",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "ta... |
5229486374 | # -*- coding:utf-8 -*-
"""
author:Bonnieliuliu
email:fangyuanliu@pku.edu.cn
2
5 7
1 3
1 5
2 3
2 5
3 4
4 5
3 5
4 3
1 2
2 3
3 4
file: Sep_09_j2.py
time: 2018/9/9 20:16
"""
import sys
import os
import re
from collections import defaultdict
def solve(vertex, edges):
vertex_mapping = defaultdict(list)
partition =... | Bonnieliuliu/LeetCodePlayGround | Companies/JD/Sep_09_j2.py | Sep_09_j2.py | py | 1,703 | python | en | code | 2 | github-code | 97 | [
{
"api_name": "collections.defaultdict",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "sys.stdin.readline",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "sys.stdin",
"line_number": 66,
"usage_type": "attribute"
},
{
"api_name": "sys.stdin.r... |
42083852898 | from pyri.device_manager_client import DeviceManagerClient
from RobotRaconteur.Client import *
import time
from RobotRaconteurCompanion.Util.ImageUtil import ImageUtil
from RobotRaconteurCompanion.Util.GeometryUtil import GeometryUtil
import cv2
import numpy as np
d = DeviceManagerClient('rr+tcp://localhost:59902?serv... | johnwason/pyri-scripts | test_aruco_detection.py | test_aruco_detection.py | py | 1,755 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pyri.device_manager_client.DeviceManagerClient",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "RobotRaconteurCompanion.Util.GeometryUtil.GeometryUtil",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 23,
"us... |
11250104533 | #!/usr/bin/env python3
import json
import os
import requests
import time
import uplc
import cbor2
ADDRESS = os.getenv('ADDRESS', 'addr_test1wqhlsl9dsny9d2hdc9uyx4ktj0ty0s8kxev4y9futq4qt4s5anczn')
NETWORK = os.getenv('NETWORK', 'iohk-preprod')
KUPO_URL = os.getenv('KUPO_URL', 'https://d.kupo-api.' + NETWORK + '.dandel... | blinklabs-io/cardano-dns | dns-kupo.py | dns-kupo.py | py | 1,432 | python | en | code | 7 | github-code | 97 | [
{
"api_name": "os.getenv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 16,
... |
36360616999 | # -*- coding: utf-8 -*-
"""
Django settings for gglobal project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
from __future__ import absolute_import, unicode_lit... | vladimirmyshkovski/gglobal | config/settings/base.py | base.py | py | 27,331 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "environ.Path",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path.dirname",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line... |
74499730237 | import socket as sock
import rsa, os, pickle
def menu():
print('''
+-----------------------------+
| Benny Ridwan Susanto |
| NIM 202410102015 |
| Tugas Akhir Kriptografi |
+-----------------------------+
| MENU PROGRAM |
|- TIME (Waktu sa... | benny-rs/progjar-rsa-benny | client-tcp.py | client-tcp.py | py | 3,402 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "os.name",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "os.system",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "os.name",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "os.system",
"line_number": 24... |
71535463038 | """set shop data
Revision ID: b0b0233542b2
Revises: deafb9cf44c2
Create Date: 2023-03-03 10:31:30.554779
"""
import uuid
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'b0b0233542b2'
down_revision = 'deafb9cf44c2'
branch_labels = None
depends_on = None
def upgra... | claytantor/xrpl-poc-python | migrations/versions/b0b0233542b2_set_shop_data.py | b0b0233542b2_set_shop_data.py | py | 1,061 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "alembic.op.get_bind",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "alembic.op",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "uuid.uuid4",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "alembic.op.get_bind",
"... |
21147203602 | import requests
import json
from bs4 import BeautifulSoup
class ParsedField():
def __init__(self, name, tagType, className):
self.tagType = tagType
self.className = className
self.name = name
# I don't think I necessarily need this object anymore, since I'm using setattr
# but i... | jschuringa/amzscraper | lib/parser.py | parser.py | py | 4,145 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "json.dumps",
"line_number": 38,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 72,
"usage_type": "call"
}
] |
17603943628 | import itertools
import math
from tqdm import tqdm
from typing import List
import numpy as np
from .heap_utils import create_max_heap
from .scs_utils import find_overlap_length, get_strings_with_id_dict, calc_pairwise_overlaps_parallel_heap, \
add_row_col_to_end, remove_rows_cols
def scs(strings: List[str]) -> st... | sergkuzn/prot-kmer-assembly | group3_package/src/scs.py | scs.py | py | 10,131 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "typing.List",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "tqdm.tqdm",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "itertools.permutations",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "math.factorial",
"li... |
25212888385 | from argparse import ArgumentParser
import socket
import ssl
import threading
import logging
import binascii
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def send_to_dns_server(msg, dns, dns_port):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(80)
... | elifengin/dns-over-tls-proxy | dns.py | dns.py | py | 3,369 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "logging.basicConfig",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "socket.socket",
... |
26512728748 | import os
import pickle
import argparse
import mlflow
import xgboost as xgb
from prefect import flow, task
from hyperopt import STATUS_OK, Trials, hp, tpe, fmin
from hyperopt.pyll import scope
from sklearn.metrics import (
roc_auc_score,
accuracy_score,
classification_report
)
from prefect.artifacts import... | Joseun/lightsonheights | training.py | training.py | py | 3,666 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "mlflow.set_tracking_uri",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "mlflow.set_experiment",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "mlflow.xgboost.autolog",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "... |
2874025571 | import os
import subprocess
from distutils.version import LooseVersion
from os.path import join
import setuptools.command.build_py
import setuptools.command.develop
from setuptools import Extension, find_packages, setup
version = "0.1.2"
# Adapted from https://github.com/pytorch/pytorch
cwd = os.path.dirname(os.path... | r9y9/nnmnkwii | setup.py | setup.py | py | 5,826 | python | en | code | 387 | github-code | 97 | [
{
"api_name": "os.path.dirname",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "os.path.abspath",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.getenv",
"line_nu... |
11653373193 | import numpy as np
import csv
import re
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.common.action_chains import ActionChains
capabilities = DesiredCapabilities.CHROME
capabilities['loggingPrefs'] = { 'browser':'ALL' }
with ... | Thomberger/VehicleEmissionPlot | FindGeneral.py | FindGeneral.py | py | 1,562 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "selenium.webdriver.common.desired_capabilities.DesiredCapabilities.CHROME",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "selenium.webdriver.common.desired_capabilities.DesiredCapabilities",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "c... |
13336226431 | import threading
import time
import requests
import json
from bs4 import BeautifulSoup
import DBUtil
from multiprocessing import Queue, Manager
import urllib3
from functools import partial
from concurrent.futures import ThreadPoolExecutor
import re
import cn2an
urllib3.disable_warnings(urllib3.exceptions.InsecureReque... | fengq1ngyang/sql-project | 1 - 需要定时执行的任务/spider_gcgh_建设规模切分.py | spider_gcgh_建设规模切分.py | py | 11,148 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "urllib3.disable_warnings",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "urllib3.exceptions",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "threading.Lock",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "DBUti... |
26876623841 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 23 14:02:01 2017
@author: emg
"""
import pandas as pd
import re
import numpy as np
df = pd.read_pickle('cmv_17_06_posts.pkl')
df['time'] = pd.to_datetime(df['created_utc'], unit='s')
df['delta'] = df['author_flair_text'].apply(lambda x: re.sub("[^0... | ellamguest/comment-authors | monthly_post_description.py | monthly_post_description.py | py | 5,290 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_pickle",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pandas.to_datetime",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.nan",
"line_nu... |
73310740478 | import pandas as pd
import numpy as np
import os
from .utils import find_files
from .utils import encode
from .utils import last_hour_interpolation
def weather_data_preprocessing(base_path):
# 导入天气数据
weather_original_path = base_path + 'data/weather_original/'
weather_file = weather_original_path + 'nanji... | jgshu/Thesis | data_preprocessing/feature_engineering.py | feature_engineering.py | py | 11,833 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "pandas.read_csv",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "utils.last_hour_interpolation",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "os.pat... |
930540841 | # Cours hippique
# Version très basique, sans mutex sur l'écran, sans arbitre, sans annoncer le gagant, ... ...
# Programmeur : Carisey Corentin
# Date de DEBUT 25 Mai 2023
# Dernière modif
#A Faire :
# -ADAPTER arbitre au nouvel affichage
#
# Quelques codes d'échappement (tous ne sont pas utilisés)
CLEARSCR="\x1B[... | abislimi/projet1PC | Course-hippique-eleves.py | Course-hippique-eleves.py | py | 6,688 | python | fr | code | 0 | github-code | 97 | [
{
"api_name": "time.sleep",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 93,
"usage_type": "call"
},
{
"api_name": "time.sleep",
"line_number": 141,
"usage_type": "call"
},
{
"api_name": "platform.system",
"line_num... |
44296590403 | #!/usr/local/bin/env python
import json
import os
import sys
import numpy as np
from ... import verify_signature
# Read input data from JSON
fn = "../../../versign-core/src/app/verify_request.json"
fo = open(fn, "r")
payload = json.loads(fo.read())
fo.close()
os.remove(fn)
# Get customer ID
user = payload['customer... | saifkhichi96/authentica-desktop | src/app_server/verify.py | verify.py | py | 620 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "json.loads",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "os.remove",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number": 2... |
26961084468 |
import numpy as np
from PIL import Image
import os
#from os import list
# Define width and height
w, h = 300, 300
cnt= 0;
# Read file using numpy "fromfile()"
for file in os.listdir('./testmode/'):
if (file == '.DS_Store'):
continue
with open('./testmode/'+file, 'rb') as f:
d = np.fromfile... | nhunguet/ExeFileToPNG | code2.py | code2.py | py | 495 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "os.listdir",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "numpy.fromfile",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "numpy.uint8",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "PIL.Image.fromarray",
... |
19957214887 | # main.py
from format import format_wabbit
from interpret import interpret_wabbit
from model import *
program1 = PrintStatement(Integer("42"))
program2 = Statements(
[
PrintStatement(BinOp(Op("+"), Integer("2"), Integer("3"))),
PrintStatement(BinOp(Op("+"), Unary(Op("-"), Integer("2")), Integer("3... | dwalicki/compiler | wabbit/main.py | main.py | py | 5,583 | python | en | code | 0 | github-code | 97 | [
{
"api_name": "format.format_wabbit",
"line_number": 136,
"usage_type": "call"
},
{
"api_name": "format.format_wabbit",
"line_number": 139,
"usage_type": "call"
},
{
"api_name": "format.format_wabbit",
"line_number": 142,
"usage_type": "call"
},
{
"api_name": "for... |
13413760296 | #!/usr/bin/env python3
# default_encoder.py
import json
import myobj
class MyEncoder(json.JSONEncoder):
def default(self, obj):
print('default(', repr(obj), ')')
# Converts objects to a dictionary of their representation
d = {
'__class__': obj.__class__.__name__,
... | cponeill/pymotw-practice-examples | Internet/json/default_encoder.py | default_encoder.py | py | 487 | python | en | code | 1 | github-code | 97 | [
{
"api_name": "json.JSONEncoder",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "myobj.MyObj",
"line_number": 21,
"usage_type": "call"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.