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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
13280379613 |
from django.shortcuts import render, get_object_or_404, redirect
from django.contrib.auth.decorators import login_required
from django.template.context_processors import request
from django import forms
from .models import Person, Rolle, Leilighet, Innlegg, Kategori, Kommentar
from .forms import InnleggForm, Kommentar... | tbrygge/bolig | bolig/views.py | views.py | py | 9,813 | python | no | code | 0 | github-code | 1 | [
{
"api_name": "models.Person.objects.filter",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "models.Person.objects",
"line_number": 21,
"usage_type": "attribute"
},
{
"api_name": "models.Person",
"line_number": 21,
"usage_type": "name"
},
{
"api_name": ... |
29554395240 | import os
from app import app
import urllib.request
from flask import Flask, flash, request, redirect, url_for, render_template
from werkzeug.utils import secure_filename
import cv2
import time
import subprocess
CONFIDENCE_THRESHOLD = 0.2
NMS_THRESHOLD = 0.4
COLORS = [(0, 255, 255), (255, 255, 0), (0, 255, ... | YassinALLANI/finalversion | main.py | main.py | py | 3,057 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.render_template",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "app.app.route",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "app.app",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "flask.request.files",
... |
29372624043 | import boto3
dynamodb_client = boto3.client('dynamodb', region_name='us-west-2', endpoint_url='http://localhost:8000')
location = 'Trinity'
sdate = '20140101'
edate = '20140201'
response = dynamodb_client.query(
TableName='Snotel',
KeyConditionExpression='LocationID = :LocationID and SnotelDate BETWEEN :sdat... | MathiasDarr/Snotel | apis/snotel-serverless-api/parse_response_data.py | parse_response_data.py | py | 1,111 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "boto3.client",
"line_number": 3,
"usage_type": "call"
}
] |
25433425619 | from itertools import combinations
import sys
input = sys.stdin.readline
d = [(0,1), (1,0), (-1,0), (0,-1)]
def out_of_range(ny:int, nx:int) -> bool:
return ny < 0 or nx < 0 or ny >= n or nx >= m
def check(s: tuple[int]):
res = 0
visited = [[False]*m for _ in range(n)]
for i in s:
... | reddevilmidzy/baekjoonsolve | 백준/Silver/18290. NM과 K (1)/NM과 K (1).py | NM과 K (1).py | py | 752 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "sys.stdin",
"line_number": 3,
"usage_type": "attribute"
},
{
"api_name": "itertools.combinations",
"line_number": 26,
"usage_type": "call"
}
] |
75059028192 | """
Linear layer with fused activation with PyTorch autodiff support.
"""
from typing import Optional, Tuple
import torch
from torch import Tensor
from torch import nn
from triton import cdiv
from .act_kernels import act_func_backward_kernel
from .linear_kernels import linear_forward_kernel
from .types import Conte... | BobMcDear/attorch | attorch/linear_layer.py | linear_layer.py | py | 7,362 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "torch.autograd",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "types.Context",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "torch.Tensor",
"li... |
72226144995 | #-----------------------------------------------------------------
# Working with psycopg2
#-----------------------------------------------------------------
import psycopg2
import sys
from prettytable import PrettyTable
def heading(str):
print('-'*60)
print("** %s:" % (str,))
print('-'*60, '\n')
SH... | cmay20/Instagram-Database-Model | simple_query_1.py | simple_query_1.py | py | 2,828 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "prettytable.PrettyTable",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "sys.argv",
"line_number": 68,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 69,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"l... |
34929668909 | import random
import time
t0 = 1
t1 = 100
d = 1
a = [str(x) for x in range(t0,t1 + 1, d)]# a 为列表
b = []
nn = [0]
def choice(event):
time.sleep(1)
rm = random.choice(a)
a.remove(rm)#无放回抽签
b.append(rm)
if ((len(b)-nn[0])%10 == 0):
b.append('\n')
nn[0] += 1
bstr = ', '.join(b)
#随机输出数字
ctn = wx.TextCtrl(win... | kelvin1020/GUI_draw_dices | draw.py | draw.py | py | 1,403 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "time.sleep",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "wx.App",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "wx.Frame",
"line_number": 42,
... |
292220258 | import logging
import threading
import timeit
import os
import psutil
import inspect
from pyramid.threadlocal import get_current_request
lock = threading.Lock()
"""Provides an ``includeme`` function that lets developers configure the
package to be part of their Pyramid application with::
config.include('pyr... | dz0ny/pyramid_straw | pyramid_straw/profiler/__init__.py | __init__.py | py | 4,194 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "threading.Lock",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "logging.getLogger",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "psutil.Process",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "os.getpid",
"line_... |
19569543042 | # ------------------------------------------------------------------------------
# Part of implementation is adopted from CenterNet,
# made publicly available under the MIT License at https://github.com/xingyizhou/CenterNet.git
# ------------------------------------------------------------------------------
import warn... | RapidAI/TableStructureRec | lineless_table_rec/lineless_table_process.py | lineless_table_process.py | py | 13,631 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "typing.Dict",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "numpy.ndarray",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "typing.Union",... |
18738470138 | # -*- coding: utf-8 -*-
import numpy as np
from sklearn.datasets import load_iris
import matplotlib.pyplot as plot
"""
Ejercicio 1
"""
matriz = load_iris()
a=matriz.data
b=matriz.target_names
x1=a[0:49,-2:]
x2=a[50:99,-2:]
x3=a[100:149,-2:]
plot.scatter(x1[:,0],x1[:,1],c=[[1,0,0]],label=b[0])
plot.scatter(x2[:,0]... | PaulaCT/AprendizajeAutomatico_UGR | practica0.py | practica0.py | py | 1,365 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.scatter",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 20,
"usage_type": "name"
},
{
"api_name":... |
23119614056 | import argparse
import logging
from elixir import feedstock
__version__ = '0.0.1'
def _config_logging(logging_level='INFO', logging_file=None):
allowed_levels = {
'DEBUG': logging.DEBUG,
'INFO': logging.INFO,
'WARNING': logging.WARNING,
'ERROR': logging.ERROR,
'CRITICAL'... | scieloorg/elixir | elixir/elixir.py | elixir.py | py | 2,335 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "logging.DEBUG",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "logging.INFO",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "logging.WARNING",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "logging.ERR... |
43351701314 | """
This file is part of nand2tetris, as taught in The Hebrew University, and
was written by Aviv Yaish. It is an extension to the specifications given
[here](https://www.nand2tetris.org) (Shimon Schocken and Noam Nisan, 2017),
as allowed by the Creative Common Attribution-NonCommercial-ShareAlike 3.0
Unported [License... | noamkari/nand2tetris-8 | CodeWriter.py | CodeWriter.py | py | 14,254 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "typing.TextIO",
"line_number": 15,
"usage_type": "attribute"
}
] |
39828382351 | import string
import nltk
from bs4 import BeautifulSoup
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
from nltk.corpus import stopwords
from sklearn.feature_extraction.text import TfidfVectorizer
import pandas as pd
nltk.download('wordnet')
nltk.download('omw-1.4')
nltk.download('stop... | nzayem/Key-Terms-Extraction | Key Terms Extraction/task/key_terms.py | key_terms.py | py | 2,241 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "nltk.download",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_n... |
9565341585 | #!/usr/bin/env python
# coding: utf-8
# @Author : Mr.K
# @Software: PyCharm Community Edition
# @Time : 2020/1/3 12:19
# @Description:
#统计list中出现的元素个数
#参考:https://www.zybang.com/question/2fa278ce7f89fb437759d57ab4b20594.html
# numbers=["cc","cc","ct","ct","ac"]
# res = {}
# for i in numbers:
# res[i] = res.get... | LeonardoMrK/Spider_4_TYC | ceshi.py | ceshi.py | py | 812 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "collections.defaultdict",
"line_number": 32,
"usage_type": "call"
}
] |
8088553187 |
import csv
import pandas as pd
import matplotlib.pyplot as plt
CSV_LOAD_PATH = "data_C3-C4.csv"
ROW_INDEX = {
'name': 0,
'time': 1,
'stim_intensity': 6,
'rep_rate': 8
}
def plot_signal(datapoints):
plt.plot(datapoints)
# plt.title('Max: ', max(datapoints), 'min: ', min(datapoints))
plt.show()
def ... | rachelyeslah/ProjectNM | da.py | da.py | py | 1,479 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 23,
"usage_type": "name"
},
{
"api_name": "matplotlib.pyplot.show",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "matpl... |
35990847108 | """
Perform teardown and integration logic after executing "constructive" Terraform
subcommands (e.g. `init`, `plan`, and `apply`).
"""
from typing import List
import json
from accounts.models import Group
from cbhooks.models import TerraformStateFile, TerraformPlanHook
from infrastructure.models import Environment,... | mbomb67/cloudbolt_samples | terraform/tf_post_provision.py | tf_post_provision.py | py | 13,710 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "utilities.logger.ThreadLogger",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "cbhooks.models.TerraformPlanHook",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "jobs.models.Job",
"line_number": 39,
"usage_type": "name"
},
{
"ap... |
12059289004 | """
Module containing all the method used in both the octtree and particle
mesh simulations and all the global variables
"""
import multiprocessing
import copy
import pickle
import numpy as np
import astropy.units as u
import png
import pandas as pd
import matplotlib.pyplot as plt
import grav_field
from octtree im... | Lancaster-Physics-Phys389-2020/phys389-2020-project-JimWarner | sim.py | sim.py | py | 13,170 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "multiprocessing.Queue",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "multiprocessing.Queue",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "grav_field.get_force",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "octt... |
41440458922 | '''
페이지 교체 알고리즘 OPT 방식
OPT : https://velog.io/@qweadzs/BOJ-1700-%EB%A9%80%ED%8B%B0%ED%83%AD-%EC%8A%A4%EC%BC%80%EC%A4%84%EB%A7%81Python
멀티탭을 모두 사용하고 있을 때, 어떤 코드를 뽑을 것인지 선택하는 문제
- 앞으로 다시 사용하지 않을 코드
위 조건을 만족하는 코드가 없다면
- 가장 나중에 다시 사용할 코드
먼저 사용할 것을 빼버리면, 다시 사용할 때 다시 꽂아야 함.
'''
from collections... | aszxvcb/TIL | BOJ/boj1700.py | boj1700.py | py | 1,747 | python | ko | code | 0 | github-code | 1 | [
{
"api_name": "collections.deque",
"line_number": 49,
"usage_type": "call"
}
] |
14029528473 | #Python version 3.6.0
import random as r
from collections import defaultdict
#import numpy as np
#from copy import deepcopy
class HelperFunctions():
def __init__(self):
pass
def kill_ship(self,strike_area):
self.overall_p_density = self.calculate_strategy()
while self.open_... | Brian1441/Battleship_Simulator | HelperClass.py | HelperClass.py | py | 8,830 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "random.choice",
"line_number": 115,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 191,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 214,
"usage_type": "call"
}
] |
32578781072 | import torch
from torch import nn
from torch import optim
import torch.nn.functional as F
from torchvision import datasets, transforms, models
from collections import OrderedDict
import time
data_dir = './images_category/images_category'
train_transforms = transforms.Compose([transforms.RandomRotation(30),
... | Anhtu07/wss_models | resnet101_pytorch.py | resnet101_pytorch.py | py | 3,860 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torchvision.transforms.Compose",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torchvision.transforms",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "torchvision.transforms.RandomRotation",
"line_number": 10,
"usage_type": "call"
}... |
31626736274 | import os
import json
CONFIG_FILE = "config.json"
ROLEPLAY_DIR = "roleplay/"
def print_config(config):
print(f"- Role: {config['role']}")
print(f"- Memorable: {config['memorable']}")
print(f"- Temperature: {config['temperature']}")
print(f"- Presence Penalty: {config['presence_penalty']}")
print(f... | GuoDCZ/termichat | ChatConfig.py | ChatConfig.py | py | 2,018 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "os.path.exists",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "os.listdir",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "json.load",
"line_number":... |
12047999152 | import os
import numpy as np
from dataclasses import dataclass
from typing import Dict, Union, NamedTuple
import torch
import torch.nn as nn
from torch.utils.data import TensorDataset, RandomSampler, SequentialSampler, DataLoader
from torch.utils.data.distributed import DistributedSampler
from pyutils.display import... | zphang/nlprunners | nlpr/shared/runner.py | runner.py | py | 9,333 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "nlpr.shared.pycore.ExtendedDataClassMixin",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "dataclasses.dataclass",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "torch.utils.data.TensorDataset",
"line_number": 46,
"usage_type": "name"
... |
43110386622 | """
Contains functions for building the forest.
Created on Thu May 11 16:30:11 2023
@author: MLechner
# -*- coding: utf-8 -*-
"""
from copy import deepcopy
from numba import njit
import numpy as np
import ray
# import pandas as pd
from mcf import mcf_forest_data_functions as mcf_data
from mcf import mcf_general as ... | MCFpy/mcf | mcf/mcf_forest_add_functions.py | mcf_forest_add_functions.py | py | 26,445 | python | en | code | 12 | github-code | 1 | [
{
"api_name": "numpy.concatenate",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "numpy.unique",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "numpy.min",
"line_number": 119,
"usage_type": "call"
},
{
"api_name": "numpy.max",
"line_numbe... |
9553900919 | """
Code is partially borrowed from repository https://github.com/sbarratt/inception-score-pytorch/blob/master/inception_score.py # noqa: E501
"""
import argparse
import logging
from pathlib import Path
from typing import Dict, Iterable, Optional, Tuple, Union
import numpy as np
import torch
import torch.utils.data
i... | svsamsonov/ex2mcmc_new | ex2mcmc/metrics/inception_score.py | inception_score.py | py | 7,378 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "ex2mcmc.utils.callbacks.Callback",
"line_number": 32,
"usage_type": "name"
},
{
"api_name": "typing.Union",
"line_number": 36,
"usage_type": "name"
},
{
"api_name": "torch.device",
"line_number": 36,
"usage_type": "attribute"
},
{
"api_name": "torch... |
6535462852 | import re
from collections import namedtuple
from typing import Any, Callable, Union
from .common import Position, Range
class LexError(Exception):
pass
Rule = namedtuple('Rule', ['regex', 'callback'])
Token = namedtuple('Token', ['type', 'value', 'range'])
class Lexer:
"""A generic lexer
Example:
... | joshuaskelly/wick | wick/parser/lexer.py | lexer.py | py | 4,942 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "collections.namedtuple",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "collections.namedtuple",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "typing.Callable",
"line_number": 39,
"usage_type": "name"
},
{
"api_name": "typing.... |
16450676247 | from django.urls import path
from user import views
app_name = 'user'
urlpatterns = [
path('', views.UserViewSet.as_view(), name='list'),
path('manage/create/', views.CreateUserView.as_view(), name='create'),
path('token/', views.CreateTokenView.as_view(), name='token'),
path('manage/<int... | PittRgz/zebrands_backend | app/user/urls.py | urls.py | py | 383 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.urls.path",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "user.views.UserViewSet.as_view",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "user.views.UserViewSet",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name... |
3963994843 | from datetime import datetime
import pandas as pd
import numpy as np
# import config
import yaml
# time_start = config.time_start
# time_end = config.time_end
with open("config.yaml", 'r') as stream:
try:
# print()
content = yaml.load(stream)
time_start = content['time_start']
tim... | heluye/performance-dashboard-by-Flask | transform.py | transform.py | py | 1,113 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "yaml.load",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "yaml.YAMLError",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
"... |
70702970915 | #Realsense.py
#Created by: Josh Chapman Date: 1/12/2023
#This code contains basic implementation for the Realsense camera
#Version 1.0
#Status: Complete
#Capabilities:
# Camera initialization
# Getting frames and storing as np arrays
# ouput of a user-readable image
# Align depth with color image
... | jdc13/Farm_Roomba | RealSense.py | RealSense.py | py | 11,468 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pyrealsense2.pipeline",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "pyrealsense2.pyrealsense2.pointcloud",
"line_number": 75,
"usage_type": "call"
},
{
"api_name": "pyrealsense2.pyrealsense2",
"line_number": 75,
"usage_type": "name"
},
{
... |
7786710979 |
import cv2
import glob
import re
import os
from datetime import datetime
img_array = []
numbers = re.compile(r"(\d+)")
path_to_image_directory = glob.glob('images/ESP32-CAM/*')
latest_image_directory = glob.glob(max(path_to_image_directory, key=os.path.getctime))[0]
def numericalSort(value):
parts = numbers.spli... | ranavner/real_time_dashboard | code/timelapse_generator.py | timelapse_generator.py | py | 779 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "re.compile",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 11,
"u... |
21793048707 | from django.contrib import admin
# Register your models here.
from blog.models import Profile, Post, Tag
@admin.register(Profile)
class ProfileAdmin(admin.ModelAdmin):
model = Profile
@admin.register(Tag)
class TagAdmin(admin.ModelAdmin):
model = Tag
@admin.register(Post)
class PostAdmin(admin.ModelAdmin)... | zhengfen/dvg-backend | blog/admin.py | admin.py | py | 1,527 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django.contrib.admin.ModelAdmin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.admin",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "blog.models.Profile",
"line_number": 8,
"usage_type": "name"
},
{
"api_na... |
72459539553 | #!/usr/bin/python
# encoding:utf-8
from __future__ import print_function
import json
import sxtwl
import damson
from damson.constraint import (Required, DataType, Between)
from flask import Flask, request
class Result(object):
@staticmethod
def fail(code, message):
return Result(False, code, messag... | stonenice/impulse | onion/onion-lunar.py | onion-lunar.py | py | 6,768 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "json.dumps",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "sxtwl.Lunar",
"line_number": 72,
"usage_type": "call"
},
{
"api_name": "damson.verify",
"line_number": 74,
"usage_type": "call"
},
{
"api_name": "damson.constraint.DataType",
... |
37296903973 | from __future__ import print_function
from __future__ import division
import logging
logging.basicConfig(format='%(asctime)s | %(levelname)s : %(message)s', level=logging.INFO)
logger = logging.getLogger(__name__)
logger.info("Loading packages ...")
import os
import sys
import torch
import numpy as np
f... | gzerveas/abject_detector | main.py | main.py | py | 10,229 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "argparse.Argumen... |
9565427568 | # https://docs.aws.amazon.com/sagemaker/latest/dg/lineage-tracking-entities.html
# https://github.com/aws/amazon-sagemaker-examples/blob/master/sagemaker-lineage/sagemaker-lineage.ipynb
import base64
from sagemaker.lineage.artifact import Artifact
from sagemaker.lineage.context import Context
from sagemaker.lineage.ac... | aws-samples/ml-lineage-helper | ml_lineage_helper/ml_lineage.py | ml_lineage.py | py | 26,811 | python | en | code | 13 | github-code | 1 | [
{
"api_name": "utils.SageMakerSession",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 38,
"usage_type": "name"
},
{
"api_name": "typing.Iterator",
"line_number": 50,
"usage_type": "name"
},
{
"api_name": "sagemaker.line... |
74452980834 | import utils.format_population as fpt
import utils.population as pup
import utils.graphs as graph
def run():
data = fpt.read_csv('./world_population.csv')
country = input('Ingresa un país => ')
result = pup.get_population_by_country(data, country)
if len(result) > 0:
keys, values = pup.get_popu... | alaydv/Graphics-with-matplotlib | main.py | main.py | py | 418 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "utils.format_population.read_csv",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "utils.format_population",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "utils.population.get_population_by_country",
"line_number": 8,
"usage_type": "call... |
74136094754 | """
Simple sample of an autoregressive model compared to a RNN, focus is on data processsing and making the forcast correctly on a synthetic dataset. Predicting the next value based on T past values.
Out of the box RNN has too much flexibility, over parameterized for this case. It does perform slightly better on a mor... | CodingDog67/ML-Projects | TimeSeries and Sequence Data/simple_timeseries_prediction.py | simple_timeseries_prediction.py | py | 4,143 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.sin",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.plot",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
... |
922395795 | import logging
from typing import AsyncGenerator
from geopy import Point, distance
from treasurehunt.game.event_backend import EventBackend
from treasurehunt.game.exceptions import (
MailGatewayException,
WinnerAlreadyExists,
)
from treasurehunt.game.mail_gateway import MailGateway
from treasurehunt.game.repo... | lucekdudek/treasurehunt | treasurehunt/game/treasurehunt.py | treasurehunt.py | py | 3,524 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "treasurehunt.game.repository.TreasureHuntRepository",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "treasurehunt.game.mail_gateway.MailGateway",
"line_number": 31,
"us... |
74436037474 | import random
from tkinter import *
from tkinter import messagebox
from PIL import ImageTk, Image
def MainConsole():
root.destroy()
main = Tk()
main.title("Console")
main.geometry("600x500")
main.iconbitmap("Images/favicon.ico")
mainframe = Frame(main, bg="Black")
mainframe.place(relheigh... | SamuelDotDoc/OS_Fundacao | ConsoleGUI.py | ConsoleGUI.py | py | 11,712 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "random.randint",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tkinter.messagebox.showinfo",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "tkinter.messagebox",
"line_number": 44,
"usage_type": "name"
},
{
"api_name": "tkinter... |
5822246836 | from pygbif import occurrences as occ
import json
from datetime import datetime
def latStat(left,right,top,bottom):
latCheck = str(bottom) + "," + str(top)
longCheck = str(left) + "," + str(right)
return [latCheck,longCheck]
#IF NOT HOG FOUND FIND CLOSEST ONE
def hogSearch(left,right,top,bottom):
l = left
r = ... | utkimchi/scrofa-scanner | gbif_occ.py | gbif_occ.py | py | 2,099 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pygbif.occurrences.search",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "pygbif.occurrences",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "pygbif.occurrences.search",
"line_number": 30,
"usage_type": "call"
},
{
"api_name":... |
915146248 | import argparse
import subprocess
import time
parser = argparse.ArgumentParser(description=None);
parser.add_argument("-p", "--parties", action="store", required=True, type=int, help="number of parties");
args = parser.parse_args();
num_parties = args.parties
port = 8888
print("Generating config.ini file...")
subpr... | asb9189/MPC | UDP_Peer_To_Peer/simulation.py | simulation.py | py | 825 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "subprocess.Popen",
... |
665699934 | import pandas as pd
from unidecode import unidecode
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
import re
import numpy as np
class ProductSearch:
def __init__(self, database_csv: str):
self.database = self.__load_bd(database_csv)
... | maryane-castro/deploystreamlit | outro/bd_utils/ProductSearch.py | ProductSearch.py | py | 5,291 | python | pt | code | 1 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "unidecode.unidecode",
"line_number": 42,
"usage_type": "argument"
},
{
"api_name": "sklearn.feature_extraction.text.TfidfVectorizer",
"line_number": 57,
"usage_type": "call"
},
... |
42029466704 | from django.shortcuts import render
from django.urls import reverse #we used reverse function to use name instead of a url in urls.py
from django.core.files.storage import FileSystemStorage
from employee.models import Event,Employee,Student,Comment
from django.http import HttpResponse,HttpResponseRedirect
from django.d... | AakashkolekaR/NGO-Fundraiser-App | tsechacks/employee/views.py | views.py | py | 4,187 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "employee.models.Employee.objects.get",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "employee.models.Employee.objects",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "employee.models.Employee",
"line_number": 13,
"usage_type": "n... |
19031136762 | import numpy as np
from sklearn.model_selection import KFold
from sklearn.utils import indexable, check_random_state
from sklearn.utils.validation import _num_samples
class ModifiedKFold(KFold):
def __init__(self,
n_splits: int,
gap: int = 1,
random_state: int ... | vcerqueira/blog | src/cv_extensions/modified_cv.py | modified_cv.py | py | 2,035 | python | en | code | 15 | github-code | 1 | [
{
"api_name": "sklearn.model_selection.KFold",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "sklearn.utils.indexable",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "sklearn.utils.validation._num_samples",
"line_number": 23,
"usage_type": "call"
},... |
30656593324 | import pprint
import time
import pandas as pd
import requests
from config import *
from concurrent.futures import ThreadPoolExecutor
import logging
# 灵活配置日志级别,日志格式,输出位置
logging.basicConfig(level=logging.DEBUG, # 日志类型为DEBUG或者比DEBUG级别更高的类型保存在日志文件中;
format='%(asctime)s %(filename)s[line:%(lineno)d]... | lvah/201903python | day28/LaGou/run.py | run.py | py | 3,518 | python | en | code | 5 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "logging.DEBUG",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "requests.Session",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "time.sleep",
... |
19031013022 | from plotnine import *
from sklearn.datasets import make_regression
from sklearn.model_selection import TimeSeriesSplit
from sklearn.model_selection import KFold
from src.cv_extensions.blocked_cv import BlockedKFold
from src.cv_extensions.hv_blocked_cv import hvBlockedKFold
from src.cv_extensions.modified_cv import Mo... | vcerqueira/blog | posts/8_cv_methods_visualized.py | 8_cv_methods_visualized.py | py | 2,077 | python | en | code | 15 | github-code | 1 | [
{
"api_name": "sklearn.datasets.make_regression",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "sklearn.model_selection.KFold",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "src.cv_extensions.sliding_tss.SlidingTimeSeriesSplit",
"line_number": 23,
... |
18323508054 | import logging
import math
from typing import List, Dict, Optional
import torch
from adet.layers import DFConv2d, NaiveGroupNorm
from adet.utils.comm import compute_locations
from detectron2.layers import ShapeSpec, NaiveSyncBatchNorm
from detectron2.modeling.proposal_generator.build import PROPOSAL_GENERATOR_REGISTRY... | facebookresearch/sylph-few-shot-detection | sylph/modeling/meta_fcos/fcos.py | fcos.py | py | 36,764 | python | en | code | 54 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "detectron2.utils.file_io.PathManager.exists",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "detectron2.utils.file_io.PathManager",
"line_number": 30,
"usage_type": "na... |
38934075635 | class Sieve:
def __init__(self, n: int, sieve_max=100_000_000):
self.sieve_max = sieve_max
self.values = self.sieve(n)
def sieve(self, n: int) -> [int]:
"""takes n and returns a list of all primes from 2 to n using
the sieve of Eratosthenes"""
if n > self.sieve_max:
... | Crossroadsman/python-notes | sieve.py | sieve.py | py | 2,306 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "functools.reduce",
"line_number": 76,
"usage_type": "call"
}
] |
10678466176 | '''
INFO 523 Final Project DBSCAN code
https://www.kaggle.com/code/rpsuraj/outlier-detection-techniques-simplified
'''
import pandas as pd
from sklearn.cluster import DBSCAN
import matplotlib.pyplot as plt
df = pd.read_csv("fetal_health.csv")
X = df[['abnormal_short_term_variability', 'baseline value']].values
db = D... | norabaccam/info523-finalproj | dbscan.py | dbscan.py | py | 762 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "sklearn.cluster.DBSCAN",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "matpl... |
40167117838 | import os
from google.cloud.devtools import cloudbuild_v1
client = cloudbuild_v1.services.cloud_build.CloudBuildClient()
def validate(event, context):
"""Triggered by a change to a Cloud Storage bucket.
Args:
event (dict): Event payload.
context (google.cloud.functions.Context): Metadata for t... | craigenator/pbmm-lz-terragrunt | terraform-guardrails/modules/guardrails/functions/gcf-guardrails-run-validation/main.py | main.py | py | 3,549 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "google.cloud.devtools.cloudbuild_v1.services.cloud_build.CloudBuildClient",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "google.cloud.devtools.cloudbuild_v1.services",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "google.cloud.devtools.c... |
16199642933 | import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.metrics import r2_score
# Función para estructurar los datos recibidos de txt a un dataframe
def structure_data(file):
data = {"E": [], "J": []}
with open(file) as f:
f... | Mauricio-Portilla-Bit/Non-Ohmic-Studies | SampleAnalysis.py | SampleAnalysis.py | py | 5,312 | python | es | code | 0 | github-code | 1 | [
{
"api_name": "pandas.DataFrame",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 45,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model.LinearR... |
7423041627 | import torch
import torch.nn as nn
from torchsummary import summary
from dataclasses import asdict
from typing import Optional
from .configs.dqn import DQNConfig
from .utils.layer_params import LinearParams, ConvParams
def conv(params: ConvParams, pool: bool = True) -> nn.Module:
layers = [
nn.Conv2d(**a... | ShkarupaDC/game_ai | src/pacman/rl/dqn/network.py | network.py | py | 1,808 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "utils.layer_params.ConvParams",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "torch.nn.Conv2d",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.nn",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "dataclasses.as... |
42489136503 | # ---
# Created by aitirga at 09/10/2019
# Description: This module contains the gradient descent class
# ---
import os
import time
import matplotlib.pyplot as plt
import numpy as np
from ann_solver.ann_core import ANN
from ann_solver.constants import *
class GradientDescent(ANN):
def initialize(self, alpha=1e-... | aitirga/ANN_solver | ann_solver/gradient_descent.py | gradient_descent.py | py | 8,992 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "ann_solver.ann_core.ANN",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "time.time",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "ann_solver.ann_core.ANN.normalize_x_stdmean",
"line_number": 83,
"usage_type": "call"
},
{
"api... |
18297087048 | """
Authors: Bulelani Nkosi, Caryn Pialat
Main api to run chatbot
"""
# Imports
import os
import logging
from flask import Flask
from slack import WebClient
from slackeventsapi import SlackEventAdapter
from controllers.templates import QuestionAnswering
# Initialize a Flask app to host the events adapter
app = Flask... | BNkosi/odin | src/hera.py | hera.py | py | 2,060 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "slackeventsapi.SlackEventAdapter",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.environ",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "slack.We... |
20185918794 | import csv
import requests
from bs4 import BeautifulSoup
import write_db as wdb
def check_in_file(file_csv,line_csv):
open(f'{file_csv}','a')
with open(f'{file_csv}',encoding='utf-16', newline="") as file:
reader = csv.reader(file)
for line in reader:
if line == line_csv:
... | Elena-from-UA/GeekHub_PYTHON_2021 | HT_12/parsing.py | parsing.py | py | 2,712 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "csv.reader",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "csv.writer",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "requests.get",
"line_number": 36,... |
72533120033 | #%%
import gspread
import pandas as pd
import re
gc = gspread.service_account()
# %%
worksheet = gc.open('Total partidas').sheet1
rows = worksheet.get_all_values()
data = pd.DataFrame.from_records(rows)
data.columns = data.iloc[0]
data.drop(0, inplace=True)
display(data.info())
display(data.describe())
#%%
| bjimenezTechnodomus/licitaciones | clasificacion.py | clasificacion.py | py | 313 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "gspread.service_account",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame.from_records",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.DataFrame",
"line_number": 13,
"usage_type": "attribute"
}
] |
9436071028 | # -----------------------------------------------------------
# Creating a candlestick chart of stock-market data using python.
#
# (C) 2020 Sandra VS Nair, Trivandrum
# email sandravsnair@gmail.com
# -----------------------------------------------------------
from pandas_datareader import data
from bokeh.models.annot... | sandra-vs-nair/stockmarket-visualization | stock_market_visualization.py | stock_market_visualization.py | py | 2,911 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "pandas_datareader.data.DataReader",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": ... |
19259385951 | import numpy as np
import matplotlib.pyplot as plt
import time
def integrate(f, a, b, N):
""" Uses pure python to integrate function using Riemann sum
Example usage:
integrate(f=lambda x: x**2 , a=0, b=1, N=6000000)
"""
y = np.zeros(1)
if isinstance(f(y), (int, float)): #Checking if th... | kristtuv/UiO | INF4331/Assignment4/integratormod/integrator.py | integrator.py | py | 2,240 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.zeros",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.zeros",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "numpy.linspace",
"line_num... |
16847803816 | from django import template
register = template.Library()
@register.filter(nome="remover_texto")
def remover(texto, r):
return texto.replace(r, "")
@register.filter(name="verificardddpr")
def verificardddpr(telefone):
ddd = telefone[0:4]
if ddd == "(44)":
return True
else:
return Fa... | RafaelBicario/P.Road-Django | paginas/templatetags/meus_filtros.py | meus_filtros.py | py | 695 | python | es | code | 1 | github-code | 1 | [
{
"api_name": "django.template.Library",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 3,
"usage_type": "name"
}
] |
23493376011 | import numpy as np
import pandas as pd
from sklearn.preprocessing import StandardScaler
from sklearn.feature_selection import VarianceThreshold
from sklearn.metrics import r2_score, mean_squared_error
from rdkit import Chem
from rdkit.Chem import AllChem
import dill
import pymc3 as pm
import arviz as az
## Helper Func... | cmwoodley/BART_LMWG_model | scripts/train.py | train.py | py | 9,209 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sklearn.feature_selection.VarianceThreshold",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "arviz.hdi",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "num... |
20519516626 | #!/usr/bin/env python
import os
import sys
from django.core.exceptions import ImproperlyConfigured
def run_gunicorn(is_production: bool):
from django_events.wsgi import application # noqa
from django_docker_helpers.management import run_gunicorn # noqa
gunicorn_module_name = 'gunicorn_prod' if is_prod... | atten/django_events | manage.py | manage.py | py | 2,025 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "django_docker_helpers.management.run_gunicorn",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "django_events.wsgi.application",
"line_number": 13,
"usage_type": "argument"
},
{
"api_name": "django_docker_helpers.files.collect_static",
"line_number": ... |
34690753869 | # -*- coding: utf-8 -*-
import asyncio
import gi
gi.require_version("GUPnP", "1.0")
from gi.repository import GUPnP
import urllib.request
import urllib.parse
from xml.etree.ElementTree import XML, XMLParser
from xmlutils import StripNamespace
from cameraremoteapi import CameraRemoteApi
# from utils import debug_trace... | franckinux/sony-camera-remote-control | cameraremotecontrol.py | cameraremotecontrol.py | py | 2,268 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "gi.require_version",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "gi.repository.GUPnP.Context.new",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "gi.repository.GUPnP.Context",
"line_number": 22,
"usage_type": "attribute"
},
{
... |
26771832343 | from keras.models import Sequential
from keras.models import model_from_json
from keras.layers import Dense
import numpy
import os
numpy.random.seed(7)
# DATASET
train_dataset = numpy.loadtxt("pima-indians-diabetes.train_data.txt", delimiter=",")
X = train_dataset[:,0:8]
Y = train_dataset[:,8]
eval_dataset = numpy.l... | ousainoujaiteh/diabetes-classification | network.py | network.py | py | 1,781 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.random.seed",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "numpy.loadtxt",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.loadtxt",
"... |
37411976792 | import json
products_suppliers = dict() # { product_name : supplier_id}
def filling_tables(connect,file):
""" Функция заполняет новыми данными таблицу suppliers из файла и добавляет suppliers_id в products"""
with connect.cursor() as cursor:
with open(f'{file}') as file:
suppliers = jso... | Vadelevich/change_db | filling_tables.py | filling_tables.py | py | 1,842 | python | ru | code | 0 | github-code | 1 | [
{
"api_name": "json.load",
"line_number": 9,
"usage_type": "call"
}
] |
71464396195 | import numpy as np
from math import sqrt
from utils.transform import list2str, str2list
def combine(parts):
if len(parts) == 1:
return parts[0]
columns = []
for i in range(0, int(sqrt(len(parts)))):
columns.append([])
key = len(columns) - 1
for j in range(i, len(parts), i... | cdubz/advent-of-code-2017 | 21/utils/refactor.py | refactor.py | py | 886 | python | en | code | 3 | github-code | 1 | [
{
"api_name": "math.sqrt",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "math.sqrt",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "numpy.column_stack",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "utils.transform.list2str",
... |
35799840968 | # -*- coding: utf-8 -*-
# @Author: Lishi
# @Date: 2017-11-09 18:41:13
# @Last Modified by: Lishi
# @Last Modified time: 2017-11-14 20:00:48
from __future__ import print_function
import torch as t
import numpy as np
from torch.autograd import Variable #
import os, sys
import shutil
import pdb
def testTensor():... | stonels0/pytorchLearning | chapter2-快速入门/chapter2.py | chapter2.py | py | 1,440 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "torch.Tensor",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "torch.rand",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "torch.rand",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "torch.Tensor",
"line_number": ... |
74574084512 | """Simulations module
simulation_1():
"Preliminary observations" - There are three possible cases.
simulation_2():
"Homogeneous case" - Calculates asymptotic eigenvalues and alignments of eigenvectors.
simulation_3():
"Homogeneous case" - Calculates asymptotic alignment of eigenvectors for growing n.
si... | leobianco/Masters | m2/random_matrix_theory_MVA/Code/simulations.py | simulations.py | py | 6,349 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.ones",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "numpy.random.uniform",
... |
18568061325 | '''
Created on May 15, 2012
@author: lwoydziak
'''
import unittest
from trackeritemstatus import TrackerItemStatus
from jiraticket import JiraTicket
from mockito.mockito import verify, when
from mockito.mocking import mock
from mockito import inorder
from mockito.verification import never
from mockito.matchers import ... | lwoydziak/pivotal-tracker-syncing | src/trackeritemstatus_test.py | trackeritemstatus_test.py | py | 2,516 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "unittest.TestCase",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "jiraticket.JiraTicket",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "mockito.mocking.mock",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "moc... |
12442256141 | import sys
from PIL import Image
import struct
if len(sys.argv)!=2:
print("Usage: python read_bin.py in_bin_file")
infile = open(sys.argv[1],'rb')
# infile = open('y.bin','rb')
w = int(struct.unpack("i",infile.read(4))[0])
h = int(struct.unpack("i",infile.read(4))[0])
print("The picture\'s size is:")
print(w,h)
# ... | QSCTech/zju-icicles | 计算机组成与系统结构/prj_1/src/read_bin.py | read_bin.py | py | 1,688 | python | en | code | 34,263 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "struct.unpack",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "struct.unpack",
"line_num... |
25252549926 | from flask import Flask, render_template, redirect, request, session, flash
from flask_app import app
from flask_app.models.video_model import Video
from werkzeug.utils import secure_filename
import os
UPLOAD_FOLDER = 'flask_app\\static\\files'
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
ALLOWED_EXTENSIONS = { 'png', ... | blake-jensen99/WeThrow | flask_app/controllers/video_controller.py | video_controller.py | py | 1,613 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask_app.app.config",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "flask_app.app",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "flask.request.files",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "flask.... |
72183241954 | #coding=utf-8
#########################################################################
# File Name: mlp_train.py
# Author: guhao
# mail: guhaohit@foxmail.com
# Created Time: 2015年11月14日 星期六 19时04分41秒
#########################################################################
#!/usr/bin/python
import numpy as np ... | guhaohit/kaggle-coupon | mlp_train.py | mlp_train.py | py | 3,211 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "dataset.Dataset.load_pkl",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "dataset.Dataset",
"line_number": 33,
"usage_type": "name"
},
{
"api_name": "data... |
26657456323 | """ESMValTool CMORizer for ERA5 data.
Tier
Tier 3: restricted datasets (i.e., dataset which requires a registration
to be retrieved or provided upon request to the respective contact or PI).
Source
https://cds.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-era5-pressure-levels
https://cds.climate.cope... | leontavares/ESMValTool | esmvaltool/cmorizers/obs/cmorize_obs_era5.py | cmorize_obs_era5.py | py | 6,003 | python | en | code | null | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 59,
"usage_type": "call"
},
{
"api_name": "copy.deepcopy",
"line_number": 65,
"usage_type": "call"
},
{
"api_name": "esmvalcore.cmor.table.CMOR_TABLES",
"line_number": 67,
"usage_type": "name"
},
{
"api_name": "war... |
3979992268 | import getFile
import modelResult
from flask import Flask, jsonify, render_template, request
from flask_cors import CORS
from werkzeug.utils import secure_filename
from getFile import MongoGridFS
app = Flask(__name__)
CORS(app)
@app.route('/')
def serverTest():
return "flask server"
#get name from node server a... | uknowsj/flask | code/app.py | app.py | py | 1,064 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "flask.Flask",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "flask_cors.CORS",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "flask.request.method",
"line_number": 20,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
... |
70275561634 | """
Scrape projections from Hashtag Basketball
"""
import datefinder
import lxml.html
import pandas
import requests
from datetime import datetime
def main():
projections_page = download_projections_page()
root = lxml.html.fromstring(projections_page) # parse HTML
projections = extract_projections(r... | cdchan/fantasy-basketball | scrape_hashtagbasketball.py | scrape_hashtagbasketball.py | py | 2,656 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "lxml.html.html.fromstring",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "lxml.html.html",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "lxml.html",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "requests.get"... |
20185055392 | """
this is a classifier
input is the normalized ECG vector
output is the class of the ECG
"""
import json
import os
import random
import sys
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.optim as optim
from datetime import datetime
from torch.utils.data import DataLoa... | mah533/Synthetic-ECG-Generation---GAN-Models-Comparison | main_classifier_ecg.py | main_classifier_ecg.py | py | 12,172 | python | en | code | 16 | github-code | 1 | [
{
"api_name": "os.environ",
"line_number": 37,
"usage_type": "attribute"
},
{
"api_name": "ekg_class.dicts",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "datetime.dateti... |
30346487437 | # A Program that gives the value of present-day human contamination (with error bars) (c_mle) from simulated-data, by implementing the model given in OUR recent WORK (https://doi.org/10.1093/bioinformatics/btz660)
# c_mle stands for the maximum likelihood estimate of contamination
# doc stands for the depth of covera... | JyotiDalal93/contamination_simulated_DNAdata | Python_scripts/Contamination_Error bars.py | Contamination_Error bars.py | py | 9,108 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.full",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "numpy.random.uniform",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 35,
"usage_type": "attribute"
},
{
"api_name": "numpy.random.unifor... |
14793079597 | import argparse
import os
import pprint
import random
import time
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy import special, stats
from tqdm import tqdm
from algorithms.decision import get_decision
from algorithms.forecast import ExponentialMovingAverage
from datasets.base impor... | IElearner/Data-driven-safety-stock-setup | plot.py | plot.py | py | 5,677 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "random.seed",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "numpy.random.seed",
"line_number": 56,
"usage_type": "call"
},
{
"api_name": "numpy.random",
... |
20076957826 | # -*- coding: utf-8 -*-
import scrapy
from pyquery import PyQuery as pq
from hebei.items import HebeiItem
import copy
class MuseumSpider(scrapy.Spider):
name = 'museum'
allowed_domains = ['www.hebeimuseum.org']
start_urls = ['http://www.hebeimuseum.org/channels/175.html']
base_url = "http://www.heb... | X1903/spider-2018 | hebei/hebei/spiders/museum.py | museum.py | py | 2,572 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "scrapy.Spider",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "pyquery.PyQuery",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "hebei.items.HebeiItem",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "scrapy.Reque... |
44468882523 |
import geojson
from dataviz import parse, MY_FILE
def create_map(data_file):
geo_map = {"type": "FeatureCollection"} # Type of GeoJSON
item_list = [] # List to collect each point to graph
for index, line in enumerate(data_file): # Iterate data using enumerate to get line and index
... | rimonberhe/Data-Visualization | map.py | map.py | py | 1,298 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "geojson.dumps",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "dataviz.parse",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "dataviz.MY_FILE",
"line_number": 35,
"usage_type": "argument"
}
] |
71112271714 | from AIPUBuilder.Optimizer.ops.eltwise import *
from AIPUBuilder.Optimizer.framework import *
from AIPUBuilder.Optimizer.utils import *
import torch
'''
IR float:
layer_id=3
layer_name=ScatterND_0
layer_type=ScatterND
layer_bottom=[Placeholder_0,Placeholder_1,Placeholder_2]
layer_bottom_shape=[[4,... | Arm-China/Compass_Optimizer | AIPUBuilder/Optimizer/ops/scatter_nd.py | scatter_nd.py | py | 6,757 | python | en | code | 18 | github-code | 1 | [
{
"api_name": "torch.long",
"line_number": 98,
"usage_type": "attribute"
},
{
"api_name": "torch.clone",
"line_number": 118,
"usage_type": "call"
},
{
"api_name": "torch.arange",
"line_number": 119,
"usage_type": "call"
},
{
"api_name": "torch.cartesian_prod",
... |
21929302411 | from playwright.sync_api import expect
def test_go_to_api_page_from_main_page(browser):
context = browser.new_context()
page = context.new_page()
page.goto("https://cloud.ru")
page.wait_for_selector("//li[normalize-space(.)='Сервисы']").click()
page.wait_for_selector("//div[@id='portal']//div[nor... | SvetlanaIM/HW_playwright | test_cloud.py | test_cloud.py | py | 703 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "playwright.sync_api.expect",
"line_number": 16,
"usage_type": "call"
}
] |
29553461810 | import pandas as pd
from sklearn.cross_validation import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn import linear_model
from sklearn.model_selection import KFold
from sklearn.metrics import mean_squared_error
from sklearn.preprocessing import PolynomialFeatures
import matplotlib.pypl... | anirudhajitani/ImplementAIHackathon | code.py | code.py | py | 3,462 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.StandardScaler",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sklearn.cross_validation.train_test_split",
"line_number": 24,
"usage_type": "call"
... |
13956333578 | #!/usr/bin/env python
# coding: utf-8
# In[7]:
import MySQLdb
import pandas as pd
import numpy as np
import xgboost as xgb
import datetime
import math
import matplotlib.pyplot as plt
conn = MySQLdb.connect(host="remotemysql.com", user="6txKRsiwk3", passwd="nPoqT54q3m", db="6txKRsiwk3")
cursor = conn.cursor()
sql ... | anandroid/ML-Cryptocurrency | Moving_Average.py | Moving_Average.py | py | 3,091 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "MySQLdb.connect",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql_query",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "numpy.reshape",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "sklearn.preproces... |
11912724357 | import twitter, json, csv
from urllib.parse import unquote
q = 'homepod'
count = 100
loop = 120
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
OAUTH_TOKEN = ''
OAUTH_TOKEN_SECRET = ''
# Set the key and secret of your twitter developer
auth = twitter.oauth.OAuth(OAUTH_TOKEN, OAUTH_TOKEN_SECRET,
CONSUMER_KEY, CONSU... | vic8-j/sandbox | twitter_search.py | twitter_search.py | py | 2,483 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "twitter.oauth.OAuth",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "twitter.oauth",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "twitter.Twitter",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "csv.writer",
... |
13822947237 | import os
import json
import matplotlib.pyplot as plt
import logging
parent_folder = "/home/nianzu/python_project/comparative-master/Classification/graph_network_for_comparative_sentence/run_graph_attention_model/result/comp_GAT/original_bert_model_using_original_text_uncased"
#single_folder = "/home/nianzu/python_pro... | NianzuMa/ED-GAT-model | result_analysis_lib.py | result_analysis_lib.py | py | 10,911 | python | en | code | 2 | github-code | 1 | [
{
"api_name": "logging.basicConfig",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "logging.INFO",
"line_number": 16,
"usage_type": "attribute"
},
{
"api_name": "logging.getLogger",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "os.walk",
... |
70410754274 | import pandas as pd
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
from Algorithms.KNN import KNN
from Algorithms.Naive_Bayes import Naive_Bayes
def main():
# open the dataset
Data_set = pd.read_csv("Data_Sets/bodyPerformance.csv", delimiter=",")
# number of rows... | 7oSkaaa/Data_Mining_Practical | main.py | main.py | py | 1,551 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "pandas.read_csv",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing.LabelEncoder",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "sklearn.preprocessing",
"line_number": 33,
"usage_type": "name"
},
{
"api_name... |
4213589271 | # -*- coding: utf-8 -*-
# Learn more: https://github.com/kennethreitz/setup.py
from setuptools import setup
with open('README.md') as f:
readme = f.read()
with open('LICENSE.md') as f:
license = f.read()
setup(
name='BERRYBEEF',
version='0.1',
description='Softbeef for Raspberry ..',
long_... | ferlete/BerryBeef | setup.py | setup.py | py | 680 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "setuptools.setup",
"line_number": 14,
"usage_type": "call"
}
] |
40325957035 | import database_util
import mailling_util
import cv2
import DetectChars
import CheckPlates
showSteps = False
SCALAR_BLACK = (0.0, 0.0, 0.0)
SCALAR_WHITE = (255.0, 255.0, 255.0)
SCALAR_YELLOW = (0.0, 255.0, 255.0)
SCALAR_GREEN = (0.0, 255.0, 0.0)
SCALAR_RED = (0.0, 0.0, 255.0)
def main():
DetectChars.loadKNNData... | karthikvg/final-year-project | main.py | main.py | py | 1,528 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "DetectChars.loadKNNDataAndTrainKNN",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "cv2.imread",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "CheckPlates.detectPlatesInScene",
"line_number": 22,
"usage_type": "call"
},
{
"api... |
30272689977 | # coding=utf-8
import logging
import traceback
import re
import types
from qfcommon.thriftclient.presms import PreSmsThriftServer
from qfcommon.server.client import ThriftClient
presmsClient_log = logging.getLogger("presmslog")
class PreSms():
_MOBILESS_RE = '^(1\d{10},)*(1\d{10},?)$'
def... | liusiquan/open_test | qfcommon/qfpay/presmsclient.py | presmsclient.py | py | 4,367 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "logging.getLogger",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "traceback.format_exc",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "types.ListType",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "types.Tupl... |
21695893971 | import pygame
import localisation
import warp
from battle import Battle
import config
import pokemon
import trainer
from draw_area import DrawArea
from player import Player
from game_map import GameMap
from direction import Directions as dir
from animation import ScreenAnimationManager
from pokemon import Pokemon
from ... | dirdr/PokESIEE | game.py | game.py | py | 12,983 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "ability.loadmoves.loadmoves",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "ability.loadmoves",
"line_number": 22,
"usage_type": "name"
},
{
"api_name": "pokemon.Pokemon.load_pokemons",
"line_number": 23,
"usage_type": "call"
},
{
"api_n... |
72198179235 | from operator import itemgetter
from sklearn.model_selection import train_test_split
from sklearn.feature_selection import RFE
import numpy as np
from scipy.stats.stats import pearsonr
from numpy import zeros
from myFunctions import cv2NN
from myFunctions import cv2NM
from sklearn.feature_selection import SelectKBest
f... | karmelowsky/AcuteInflammations | Main.py | Main.py | py | 4,440 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "numpy.array",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "scipy.stats.stats.pearsonr",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "numpy.array",
"line_number": 40,
"usage_type": "call"
},
{
"api_name": "operator.itemgette... |
6154548013 | import os
import random
import shutil
from django.views.decorators.csrf import csrf_exempt
from django.http import (
HttpResponse,
HttpResponseForbidden,
HttpResponseServerError
)
from django.conf import settings
from license_protected_downloads.models import APIKeyStore, APILog
from license_protected_dow... | NexellCorp/infrastructure_server_fileserver | license_protected_downloads/uploads.py | uploads.py | py | 3,966 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "os.path.join",
"line_number": 24,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "django.conf.settings.SERVED_PATHS",
"line_number": 24,
"usage_type": "attribute"
},
{
"api_name": "djan... |
8691021729 | from typing import List
from collections import defaultdict, deque
# Definition for a binary tree node.
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def verticalOrder(self, root: TreeNode) -> List... | songkuixi/LeetCode | Python/Binary Tree Vertical Order Traversal.py | Binary Tree Vertical Order Traversal.py | py | 694 | python | en | code | 1 | github-code | 1 | [
{
"api_name": "collections.defaultdict",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_number": 14,
"usage_type": "name"
}
] |
31966900393 | import logging
import subprocess as sp
import numpy as np
from t2v.config.root import RootConfig
class VideoInput:
def __init__(self, cfg: RootConfig, video_path: str):
"""
VideoInput reads frames from a given video file which can be used as init images for individual frame generation
""... | sbaier1/pyttv | t2v/input/video_input.py | video_input.py | py | 2,724 | python | en | code | 35 | github-code | 1 | [
{
"api_name": "t2v.config.root.RootConfig",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "subprocess.Popen",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "subprocess.PIPE",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "nump... |
3834552212 | import numpy as np
from utils.text_analyzer import TextStats
from utils.text_analyzer import compute_score
from utils.dictionary import Dictionary
from itertools import permutations as permutations
def crack_transposition(stats: TextStats, dictionary: Dictionary, verbose: bool=False):
"""
Method to crack tabl... | draliii/Cracker | crackers/transposition.py | transposition.py | py | 6,254 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "utils.text_analyzer.TextStats",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "utils.dictionary.Dictionary",
"line_number": 8,
"usage_type": "name"
},
{
"api_name": "utils.text_analyzer.compute_score",
"line_number": 36,
"usage_type": "call"
},
... |
20942099310 | """
Finone API Controller
Processes XML response from Mortech, parses, and stores into database.
Returns response object for user consumption as JSON.
"""
import requests
import xmltodict
from requests import ConnectionError, HTTPError, RequestException, Timeout
from finone import db, app
from finone.constants impor... | diveone/finone | finone/api.py | api.py | py | 6,749 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "finone.utils.underscoreize",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "finone.constants.PROPERTY_TYPE_MAP.get",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "finone.constants.PROPERTY_TYPE_MAP",
"line_number": 50,
"usage_type": "... |
23291776654 | import sys
import datetime
configFile = open(sys.argv[1], 'r')
symbolList = []
for line in configFile:
symbol = line.split(';', 1)
symbol[1] = symbol[1][:-1] #remove trailing \n
symbol[0] = symbol[0].replace('\\n', '\n'); #remove escaping \\n
symbol[1] = symbol[1].replace('\\n', '\n'); #remove escapin... | kozak127/textTools | textPreprocessor/textReplacer.py | textReplacer.py | py | 808 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "sys.argv",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "datetime.datetime.now",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "datetime.da... |
26426724167 | # 더 효율적인 로직으로 풀어보기
from collections import defaultdict,deque; import copy
n, q = map(int, input().split())
n2 = 2**n
g = [ list(map(int,input().split())) for _ in range(n2)]
qrr = list( map(int, input().split()) )
visit = [ [False]*n2 for _ in range( n2)]
# 2L × 2L --> 회전 90도
dir = [(-1,0),(1,0),(0,-1),(0,1)]
summ = 0... | dohui-son/Python-Algorithms | simulation_samsung/b20058_마법상어와파이어스톰.py | b20058_마법상어와파이어스톰.py | py | 2,729 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "copy.deepcopy",
"line_number": 60,
"usage_type": "call"
},
{
"api_name": "collections.deque",
"line_number": 74,
"usage_type": "call"
}
] |
23716035381 | from typing import Optional
from fastapi import APIRouter, Form
from Deployment.ConsumerServices.GeneralService import DownloadImageFromURLServiceTask, ParseImageFromBase64ServiceTask
from Deployment.ConsumerServices.RecaptchaService import Captcha1RecognizeServiceTask
from Deployment.server_config import IS_MOCK
fro... | novioleo/Savior | Deployment/DispatchInterfaces/RecaptchaInterface.py | RecaptchaInterface.py | py | 2,146 | python | en | code | 135 | github-code | 1 | [
{
"api_name": "fastapi.APIRouter",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "typing.Optional",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "typing.Optional",
"line_number": 19,
"usage_type": "name"
},
{
"api_name": "fastapi.Form",
... |
42911353516 | from contextlib import asynccontextmanager
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
def create_app() -> "FastAPI":
from prisma import Prisma
from app.api.v1 import api
from app.core import settings
@asynccontextmanager
async def lifespan(_app: FastAPI):
... | neuronic-ai/autogpt-ui | backend/src/app/__init__.py | __init__.py | py | 967 | python | en | code | 89 | github-code | 1 | [
{
"api_name": "fastapi.FastAPI",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "prisma.Prisma",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "prisma.connect",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "prisma.disconnect",
... |
36862329178 | import logging
import numpy
import matplotlib
# Force matplotlib to not use any Xwindows backend.
matplotlib.use('Agg')
from matplotlib import pyplot as plt
def plot_pixels(file_name, candidate_data_single_band,
reference_data_single_band, limits=None, fit_line=None):
logging.info('Display: Cre... | planetlabs/radiometric_normalization | radiometric_normalization/display.py | display.py | py | 2,162 | python | en | code | 33 | github-code | 1 | [
{
"api_name": "matplotlib.use",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "logging.info",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot... |
15707900175 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import pytest
#set up a browser
@pytest.fixture
def selenium(base_url):
... | zabojnikp/study | TestLadies/test_sample.py | test_sample.py | py | 1,184 | python | en | code | 0 | github-code | 1 | [
{
"api_name": "selenium.webdriver.Chrome",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "selenium.webdriver",
"line_number": 11,
"usage_type": "name"
},
{
"api_name": "selenium.get",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "selenium.ma... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.