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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2278543419 | import json
import os
import glob
def read_json(path):
data = []
with open(path) as file:
for line in file:
json_line = json.loads(line)
data.append(json_line)
# print(len(data))
return data
def read_prompt(path):
data_prompt = []
with open(path) as file:
... | qminh369/GenerateDataChatGPT | FakeData/read_data.py | read_data.py | py | 1,395 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "json.loads",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "json.loads",
"line_number": 36,
... |
4668982331 | from typing import List
from functools import lru_cache
class Solution:
def eventualSafeNodes(self, graph: List[List[int]]) -> List[int]:
n = len(graph)
used = [False for _ in range(n)]
visited = [False for _ in range(n)]
safe = [False for _ in range(n)]
ans = list()
... | yucongxing/leetcode | 0802_Find_Eventual_Safe_States.py | 0802_Find_Eventual_Safe_States.py | py | 1,299 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "typing.List",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "functools.lru_cache",
"line_number": 12,
"usage_type": "call"
}
] |
10505730784 | import pandas as pd
from sklearn import datasets
import matplotlib.pyplot as plt
ds=datasets.load_iris ()
#ds=pd.read_csv(r"C:\Users\HP\Desktop\INTERNSHIP 5 MARCH\ml project\plant iris clustering using principal component analysis 18 project\Iris.csv")
print(ds)
x=ds.data
print(ds)
y=ds.target
name=ds.ta... | NirajIngole35/plant-iris-clustering-using-principal-component-analysis-18-project | pca.py | pca.py | py | 736 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sklearn.datasets.load_iris",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sklearn.datasets",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "sklearn.decomposition.PCA",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "m... |
26943153254 | import csv
from pathlib import Path
from datetime import datetime
from pprint import pprint
def convert_to_time(text: str) -> datetime:
fmt = "%H:%M"
return datetime.combine(today, datetime.strptime(text, fmt).time())
def process(intervals: list) -> list:
"""intervals must be sorted by the end time.
... | movalex/myscripts | school/find_overlapping_intervals/find_overlapping_intervals.py | find_overlapping_intervals.py | py | 1,747 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datetime.datetime.combine",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "d... |
29198295999 | import requests
from bs4 import BeautifulSoup
import re
import pandas as pd
url = 'https://www.classcentral.com/collection/ivy-league-moocs?subject=data-science'
text = requests.get(url).text
soup = BeautifulSoup(text, 'html.parser')
def main(args=None):
found = findContent()
# print(type(found))
... | frostcow0/python-projects | web/webscraping/courses.py | courses.py | py | 1,394 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "bs4.BeautifulSoup",
"line_number": 8,
"usage_type": "call"
}
] |
74597285158 | #!/usr/bin/python3.7
# -*- coding: utf-8 -*-
# @Time : 2019/7/28 16:26
# @Author : Administrator
# @Software: PyCharm
# @License: BSD 3-Clause
"""
this is a description
"""
from __future__ import division
from abc import ABC
from itertools import permutations
import numpy as np
from sklearn.utils import check_ar... | ghayth82/featurebox | featurebox/featurizers/polyfeature.py | polyfeature.py | py | 2,440 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "featurebox.featurizers.base.BaseFeaturizer",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "abc.ABC",
"line_number": 25,
"usage_type": "name"
},
{
"api_name": "itertools.permutations",
"line_number": 39,
"usage_type": "call"
},
{
"api_nam... |
7785866404 | """This file reads a 4-D netcdf file and interpolates density at a given location & time.
--> Dependencies: the following packages need to be installed: Numpy, Scipy, netCDF4
--> Inputs:
CurrentEpMin (float scalar): Current Epoch in Minutes
current_height_km (float scalar): Current Satellite altitude in... | aeroztark/WAMxSTK | ReadWAMIPEdata.py | ReadWAMIPEdata.py | py | 3,746 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "netCDF4.Dataset",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "numpy.arange",
"line_number": 53,
"usage_type": "call"
},
{
"api_name": "numpy.where",
"line_number": 55,
"usage_type": "call"
},
{
"api_name": "scipy.interpolate.RegularGri... |
71426705640 | # This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/... | aorursy/new-nb-3 | fumiyokato_japanese.py | fumiyokato_japanese.py | py | 2,912 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.walk",
"line_number": 25,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 29,
"usage_type": "attribute"
},
{
"api_name": "pandas.read_csv",
"line_number"... |
31660993616 | from collections import defaultdict
import math
housekeeping_genes = ['EMC7', 'C1orf43', 'CHMP2A', 'GPI', 'PSMB2', 'PSMB4', 'RAB7A', 'REEP5', 'SNRPD3', 'VCP', 'VPS29']
file = 'allGeneLength.txt'
geneDict = {}
with open(file, 'r') as f:
for line in f:
line = line.strip('\n').split('\t')
gene = line... | micro-irfan/MScRepo | python/fetchFoldChange.py | fetchFoldChange.py | py | 2,434 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "collections.defaultdict",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "math.log10",
"line_number": 50,
"usage_type": "call"
}
] |
26258225454 | import PySimpleGUI as sg
import pandas as pd
import os
import firebase_handler
import time
# Add some color to the window
sg.theme('DarkTeal9')
FIRE_BASE_FILE = '/csv_file1' # path inside firebase for the online xlsx (excel) file
FIRE_BASE_FILE_TMP_LOCAL = './csv_file1_tmp.xlsx' # path for local copy for data from f... | shacharKZ/pyGUI_iot | data_entry.py | data_entry.py | py | 3,108 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "PySimpleGUI.theme",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.read_excel",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "firebase_handler.set_up_fire_base",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "... |
44813762230 | """Day 2"""
from typing import List, Tuple
from aoc.shared import read_file_lines
values = read_file_lines("year_2021/input_03.txt")
WIDTH = len(values[0])
def count_bits(values: str, index: int) -> Tuple[int, int]:
count_0 = 0
count_1 = 0
for value in values:
if value[index] == "0":
... | dalemyers/Advent-of-Code | aoc/year_2021/day_03.py | day_03.py | py | 1,842 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "aoc.shared.read_file_lines",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "typing.Tuple",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 41,
"usage_type": "name"
}
] |
16048545725 | from django import template
from ..models import GameGroup, Games
register = template.Library()
@register.filter(name="range")
def _range(value: int):
return range(value)
@register.filter(name="filter_users")
def filter_users(queryset, value: int):
length = queryset.count()
if value > length:
... | Dhruvacube/event-tickets-site | main/templatetags/extra.py | extra.py | py | 2,131 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.template.Library",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "django.template",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "models.Games.objects.filter",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "mod... |
5498691219 | import platform
from invoke import task
@task
def clean(c):
if platform.system() == "Windows":
c.run(
"for %f in (dist build autojoiner.egg-info) do if exist %f rmdir /s /q %f",
hide=True,
)
else:
c.run("rm -rf dist build autojoiner.egg-info")
return
@task... | rishi255/autojoiner | tasks.py | tasks.py | py | 1,014 | python | en | code | 4 | github-code | 18 | [
{
"api_name": "platform.system",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "invoke.task",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "platform.system",
"line_number": 20,
"usage_type": "call"
},
{
"api_name": "invoke.task",
"line_num... |
12186095780 | from flask import Flask, render_template, request
import sqlite3
app = Flask(__name__)
@app.route('/')
def index():
conn = sqlite3.connect('mydatabase.db')
cursor = conn.cursor()
cursor.execute('SELECT * FROM customers')
customers = cursor.fetchall()
cursor.execute('SELECT * FROM orders')
orde... | StocktonManges/Customer-CRM | main.py | main.py | py | 2,324 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "sqlite3.connect",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "flask.request.form",
... |
26195790720 | from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.operators.python_operator import PythonOperator, BranchPythonOperator
from datetime import datetime, timedelta
import pandas as pd
import random
import os
# DATA_FOLDER = os.getcwd()
DATA_FOLDER = '/home/phllp/dev/bootcamp_da... | phllp/bootcamp_data_eng | modulo_04/docker-airflow/dags/treino_03.py | treino_03.py | py | 2,708 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.getcwd",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "datetime.timedelta",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "pandas.read_csv",
... |
72817480361 | import nltk
from model.savoy import Savoy
nltk.download('stopwords')
nltk.download('punkt')
nltk.download('rslp')
from nltk.util import ngrams
from nltk.tokenize import RegexpTokenizer
from string import punctuation
from unicodedata import normalize
def _remove_acentos(txt):
return normalize('NFKD', txt).encode... | ulysses-camara/ulysses-amendment-comparer | look-for-amendments/model/preprocessamento.py | preprocessamento.py | py | 952 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "nltk.download",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "nltk.download",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "unicodedata.normalize",
"l... |
12497175544 | ## This file creates an ejido class and tries to find a nash belief equilibrium (not a technical term)
#%%
## imports
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from itertools import product
#%%
class Ejido:
def __init__(self,
c = 2,
N = 3,
... | jhconning/ejido | INEGI/Simulations/Ejido_conjecture.py | Ejido_conjecture.py | py | 7,395 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.random.seed",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "numpy.random",
"line_number": 39,
"usage_type": "attribute"
},
{
"api_name": "numpy.sort",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "numpy.random.lognormal... |
17058637959 | # -*- encoding = utf-8 -*-
import cv2
import qrcode
import tkinter as tk
import tkinter.ttk as ttk
from tkinter.constants import *
from tkinter.scrolledtext import ScrolledText
from tkinter.messagebox import showinfo, showerror
from tkinter.filedialog import askopenfilename, asksaveasfilename
from PIL import Image, Ima... | Parriss/tkinter-qrcode-gui | text2qrcode_cn.py | text2qrcode_cn.py | py | 4,017 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "tkinter.Tk",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tkinter.Menu",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "tkinter.Menu",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "tkinter.LabelFrame",
"line_n... |
42326875892 | # -*- coding: utf-8 -*-
import re
import sys
import logic
import planning
import search
from utils import (remove_all, unique, first, argmax, probability, isnumber,
issequence, Expr, expr, subexpressions, extend)
class Student:
def __init__(self):
self.state = []
self.cStreak = ... | alans2021/CS-1571 | Assignment2/a2.py | a2.py | py | 16,777 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "utils.expr",
"line_number": 69,
"usage_type": "call"
},
{
"api_name": "utils.expr",
"line_number": 70,
"usage_type": "call"
},
{
"api_name": "utils.expr",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "utils.expr",
"line_number": 72,
... |
21249289603 | from datetime import datetime
current_year = int(datetime.now().year)
current_month = int(datetime.now().month)
year_or_age = input("Do you know the year or age?: ")
if (year_or_age == "year" or year_or_age == "Year"):
birth_year = int(input("What year were you born?: "))
age = current_year - birth_year
... | ElainaJourney/Age-Guesser | main.py | main.py | py | 596 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datetime.datetime.now",
"line_number": 3,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 3,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.now",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "datetime.d... |
38847414695 | from http.server import BaseHTTPRequestHandler, HTTPServer
from entries import get_all_entries, get_single_entry, delete_entry
import json
class HandleRequests(BaseHTTPRequestHandler):
def parse_url(self, path):
path_params = path.split("/")
resource = path_params[1]
if "?" in resource:
... | samanthajmaas/daily-journal-server | request_handler.py | request_handler.py | py | 2,711 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "http.server.BaseHTTPRequestHandler",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "entries.get_single_entry",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "entries.get_all_entries",
"line_number": 49,
"usage_type": "call"
},
{
... |
25249077505 | from fractions import Fraction
one = list(map(int, input().split()))
two = list(map(int, input().split()))
s1 = 0
s2 = 0
yint1 = 0
yint2 = 0
try:
x1, y1, x2, y2 = one
s1 = Fraction(y2 - y1, x2 - x1)
yint1 = y2 - s1 * x2
except ZeroDivisionError:
s1 = 'undefined'
yint1 = one[0]
try:
x1, y1, x... | vishnupsatish/dmoj-practice | dmopc19c6p1.py | dmopc19c6p1.py | py | 943 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "fractions.Fraction",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "fractions.Fraction",
"line_number": 21,
"usage_type": "call"
},
{
"api_name": "fractions.Fraction",
"line_number": 39,
"usage_type": "call"
}
] |
39039386614 | from django.shortcuts import render, redirect
from .models import Note
# Create your views here.
def index(request):
context = {
'notes': Note.objects.all(),
# 'new_post_form' : PostForm()
}
return render(request, 'notes/index.html', context)
def addNote(request):
if request.method == "... | chosenman/Python | Django/FULLSTACK/ax_django_notes/apps/notes/views.py | views.py | py | 574 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "models.Note.objects.all",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "models.Note.objects",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "models.Note",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "django.shor... |
33591278599 | ## BOILERPLATE ##
import sys
from PySide import QtGui, QtCore
if QtCore.QCoreApplication.instance() is None:
app = QtGui.QApplication(sys.argv)
import qt4reactor
qt4reactor.install()
## BOILERPLATE ##
from goto import MIN, MAX, PRECISION, SLIDER, POI, GotoWidget
from config.steppermotor import POL, SM_C... | creilly/sitzlabexpcontrol | steppermotor/polarizergui.py | polarizergui.py | py | 3,816 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "PySide.QtCore.QCoreApplication.instance",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "PySide.QtCore.QCoreApplication",
"line_number": 4,
"usage_type": "attribute"
},
{
"api_name": "PySide.QtCore",
"line_number": 4,
"usage_type": "name"
},
{... |
8316552298 | import numpy as np
import pytest
from scipy.fft import dct, idct
from pytracer.test.utils import trace
def main():
N = 100
t = np.linspace(0, 20, N, endpoint=False)
x = np.exp(-t/3)*np.cos(2*t)
y = dct(x, norm='ortho')
window = np.zeros(N)
window[:20] = 1
yr = idct(y*window, norm='ortho')... | yohanchatelain/pytracer | pytracer/test/scipy/fft/test_discrete_cosine_transform.py | test_discrete_cosine_transform.py | py | 819 | python | en | code | 5 | github-code | 18 | [
{
"api_name": "numpy.linspace",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "numpy.exp",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "numpy.cos",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "scipy.fft.dct",
"line_number":... |
14638654778 | """
Written by Zain Kamal (zain.eris.kamal@rutgers.edu).
https://github.com/Humboldt-Penguin/redplanet
For more information, call `help(GRS)` or directly view docstring in `GRS/__init__.py`.
"""
########################################################################################################################... | Humboldt-Penguin/redplanet | src/redplanet/GRS/GRS.py | GRS.py | py | 22,886 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "redplanet.utils.getPath",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "redplanet.utils",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "pooch.os_cache",
"line_number": 31,
"usage_type": "call"
},
{
"api_name": "numpy.arange",... |
16056518890 | import pandas as pd
import numpy as np
import matplotlib.pyplot
from sklearn import linear_model as lm
from sklearn.preprocessing import LabelEncoder
from sklearn.preprocessing import OneHotEncoder
from sklearn.compose import ColumnTransformer
df = pd.read_csv("homeprices.csv")
dumies = pd.get_dummies(d... | whis-19/Machine-Learning- | one_hot_encoding.py | one_hot_encoding.py | py | 1,722 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pandas.read_csv",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pandas.get_dummies",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pandas.concat",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "sklearn.linear_model... |
9103285930 | # -*- coding: utf-8 -*-
__author__ = 'Bruce Frank Wong'
from typing import Dict, List
from datetime import datetime
import math
from . import QWDirection, QWOffset, QWOrderStatus
class QWPosition(object):
order_id: str
fill_datetime: datetime
price: float
lots: int
direction: QWDirection
cla... | BruceFrankWong/QuantWorkshop-TQ | src/QuantWorkshopTq/define/position.py | position.py | py | 3,156 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datetime.datetime",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "typing.List",
"line_number": 24,
"usage_type": "name"
},
{
"api_name": "math.floor",
"line_number": 46,
"usage_type": "call"
},
{
"api_name": "typing.List",
"line_numb... |
5076482365 | import numpy as np
import torch
import torchvision.transforms as transforms
from torch.utils.data import Dataset, DataLoader
import os
from PIL import Image
import torchvision.transforms.functional as TF
class VideoDataset(Dataset):
'''Video Dataset'''
def __init__(self, path='./', data_type='world', n... | vdutell/taec_torch | utils/dataset.py | dataset.py | py | 2,521 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "torch.utils.data.Dataset",
"line_number": 12,
"usage_type": "name"
},
{
"api_name": "os.path.join",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 34,
"usage_type": "attribute"
},
{
"api_name": "os.path.join",
... |
22341117562 | import pygame
#local Imports
from .snake import Prey
from .snake import Snake
class Screen:
"""Manage the pygame screen with its properties"""
def __init__(self, width, height, number_spaces, frame_rate):
self.width = width
self.height = height
self.number_spaces = number_spaces
sel... | AndresRubianoM/snakeGameDeepLearning | snakeGame/screen.py | screen.py | py | 2,411 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "pygame.init",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 27,
"usage_type": "attribute"
},
{
"api_name": "pygame.displa... |
22873005792 | '''This code evaluates the matrix elements for two-particle
Coulomb interactions. Given any Dirac cutoff (specifies )
'''
from header import *
from sympy.physics.wigner import wigner_3j
MM = [-l_max + i for i in range(int(2*l_max + 1))] # All the allowed m's
# Making a Dictionary for all the allowed states
Stat... | cosmorockz/FatDiracED | CoulombMatElComputer.py | CoulombMatElComputer.py | py | 5,544 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sympy.physics.wigner.wigner_3j",
"line_number": 105,
"usage_type": "call"
},
{
"api_name": "sympy.physics.wigner.wigner_3j",
"line_number": 106,
"usage_type": "call"
},
{
"api_name": "sympy.physics.wigner.wigner_3j",
"line_number": 107,
"usage_type": "call"... |
16522340904 | from flask import flash
from vote.models.categorie import Categorie
from vote.models.candidat import Candidat
from vote.models.utilisateur import Utilisateur
from vote.models.vote import Vote
from vote import db
"""
a = {'nom':'Rimbaud', 'prénom' : 'Arthur', 'classe': 'T°2'}
b = {'nom':'Dufaud', 'prénom' : 'Bertrand',... | gbaalat/vote | src/vote/votes/business.py | business.py | py | 1,607 | python | fr | code | 0 | github-code | 18 | [
{
"api_name": "vote.models.categorie.Categorie.query.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "vote.models.categorie.Categorie.query",
"line_number": 18,
"usage_type": "attribute"
},
{
"api_name": "vote.models.categorie.Categorie",
"line_number": 18,
... |
41179338106 | from django.shortcuts import render, redirect
from django.http import JsonResponse
import json
import datetime
from django.views.generic import TemplateView
from django.contrib import messages
from django.contrib.auth.models import User
from django.contrib.auth.models import Group
from django.contrib.auth import authe... | Mazbah-AHM/E-DocPh | store/views.py | views.py | py | 7,421 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "django.contrib.auth.models.Group.objects.get",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.Group.objects",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.auth.models.Group",
"line_number": ... |
442064192 | #!/usr/bin/env python
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from builtins import str
from builtins import range
import os, datetime, sys
import nipype.interfaces.io as nio # Data i/o
import nipype.interfaces.fsl as fsl # fs... | smerdis/streams | glm_code/glm_fixedeffects_level12.py | glm_fixedeffects_level12.py | py | 5,460 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "nipype.interfaces.fsl.FSLCommand.set_default_output_type",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "nipype.interfaces.fsl.FSLCommand",
"line_number": 19,
"usage_type": "attribute"
},
{
"api_name": "nipype.interfaces.fsl",
"line_number": 19,
... |
15458617890 | import datetime as dt
import time
from .env_actions import env_actions
from grid2op.Episode import EpisodeData
import numpy as np
import pandas as pd
from tqdm import tqdm
from . import EpisodeTrace, maintenances, consumption_profiles
#TODO: configure the reward key you want to visualize in agent overview.
# Either ... | Artelys-RTE/grid2viz | grid2viz/src/kpi/EpisodeAnalytics.py | EpisodeAnalytics.py | py | 24,135 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "time.time",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "env_actions.env_actions",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "env_actions.env_actions",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "time.time",... |
70435258600 | import serial
print("Sensor Demo")
usbport = '/dev/ttyAMA0'
ser = serial.Serial(usbport, 38400)
ser.write(bytes("L1\r",'UTF-8'))
ser.write(bytes("C\r",'UTF-8'))
line=""
while True:
data = ser.read().decode('UTF-8')
if(data == "\r"):
print("Received:", line)
line=""
else:
line = line + data
| freefood89/Fishtank | pi/sensorTest.py | sensorTest.py | py | 308 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "serial.Serial",
"line_number": 6,
"usage_type": "call"
}
] |
23819371993 | from sklearn import metrics
import sys, os
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
import torch
from torch.utils.data import DataLoader
import pickle
from rdkit import Chem
from rdkit import rdBase
from tqdm import tqdm
import numpy as np
# from Dataset.get_datase... | ggkong/tfCompared | Script/charnn_Script/optlogp.py | optlogp.py | py | 8,036 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.path.append",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "sys.path",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "os.path.dirname",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number... |
36655441461 | import numpy as np
import torch
from model import Classification2DModel, Classification1DModel
from utils import confusion_matrix
def calculate_test_accuracy(dim, gen_test, num_classes):
device = torch.device("cpu")
Acc = []
conf_matrix = torch.zeros(num_classes, num_classes)
if dim == '1D':
w... | MRJMoriarty/FashionMNIST | test.py | test.py | py | 1,390 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "torch.device",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch.zeros",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "torch.load",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "model.Classification1DModel",
... |
29056758878 | import sqlite3
import pandas as pd
import tkinter as tk
from tkinter import ttk
# Connect to the database
conn = sqlite3.connect('mydatabase.db')
# Query the database and convert the results to a DataFrame
query = 'SELECT * FROM mytable'
df = pd.read_sql(query, conn)
# Create the GUI window and table
root = tk.Tk()
... | liangleicn/gptrepos | gpt.py | gpt.py | py | 1,444 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sqlite3.connect",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pandas.read_sql",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "tkinter.Tk",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "tkinter.ttk.Treeview",
... |
26061898567 | import gzip
from re import findall
from requests import get
from os import getcwd, chdir, remove
from os.path import join
from collections import Counter
from numpy import mean
from settings.links import REPEAT_MASK_BASE_URL
from settings.directories import REPEAT_MASK_FOLDER
from settings.regularExpressions import GET... | justin-greenblatt/GenomeBlastWalk | bin/repeatMaskData.py | repeatMaskData.py | py | 2,305 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "settings.links.REPEAT_MASK_BASE_URL",
"line_number": 15,
"usage_type": "name"
},
{
"api_name": "requests.get",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "settings.... |
8639551283 | # -*- coding: utf-8 -*-
from copy import deepcopy
from lib.graph import Graph
from lib.helper import Helper
class CoverabilityGraph(Graph):
# states_list contains tuples: (id_state, parent_id_state, [net states], {state_id: transition_id}, transition_id)
def _create_coverability_graph(self):
queue = [... | massirim/petri_nets | back_end/lib/coverability_graph.py | coverability_graph.py | py | 3,787 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "lib.graph.Graph",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "lib.helper.Helper.get_competitive_transitions_priority_queue",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "lib.helper.Helper",
"line_number": 22,
"usage_type": "name"
... |
604860218 | from geopy.geocoders import Nominatim
import folium
import webbrowser
region = ["Dakar",
"Thies",
"Diourbel",
"Kaolack",
"Fatick",
"Kaffrine",
"Louga",
"Matam",
"Tambacounda",
"Kédougou",
"Kolda",
"Z... | mouhamedsylla/python_exercise | coordonnees.py | coordonnees.py | py | 2,131 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "geopy.geocoders.Nominatim",
"line_number": 36,
"usage_type": "call"
},
{
"api_name": "folium.Map",
"line_number": 44,
"usage_type": "call"
},
{
"api_name": "folium.Marker",
"line_number": 47,
"usage_type": "call"
},
{
"api_name": "geopy.geocoders.No... |
43281271755 | """
Модуль для приведения выходных данных к читаемому виду.
"""
import os
from utils.manipulate_data import load_data, save_data # pylint: disable=import-error
def fix_download_bug():
"""
Функция правит мета данные при некорректном скачивании данных с БД.
"""
meta_data = load_data('out... | ssharkov03/group-videos-by-similarity | utils/bug_fixes.py | bug_fixes.py | py | 1,364 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "utils.manipulate_data.load_data",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "os.listdir",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "os.path.split",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "os.path",
... |
36510611865 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="ssfm",
version="0.0.1",
author="Lykos94",
scripts=['ssfm',],
author_email="lukaszmoskwa94@gmail.com",
description="Curses based File Manager application",
long_description=long_des... | Lykos94/ssfm | setup.py | setup.py | py | 928 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "setuptools.setup",
"line_number": 6,
"usage_type": "call"
}
] |
10267485650 | import cv2
import numpy as np
src_img = np.load('./data/data_3df0.npy')
src_lab = np.load('./data/label_3df0.npy')
print(src_img.shape)
ind = 100
# cv2.imshow('Imgae '+str(ind)+' CPA: '+str(src_lab[ind]), src_img[ind])
# cv2.waitKey(0)
cv2.imwrite('./img/Imgae '+str(ind)+' CPA: '+str(src_lab[ind]) + '.jpg', src_img[i... | SpeagleYao/CPA | img_show.py | img_show.py | py | 324 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "numpy.load",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.load",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "cv2.imwrite",
"line_number": 11,
"usage_type": "call"
}
] |
42556203767 | import pygame
import random
class Snake:
def __init__(self, window_width, window_height, space):
self.reset(window_width, window_height, space)
def reset(self, window_width, window_height, space):
self.sprite_width = 50
self.sprite_height = 50
self.color = (26, 188, 156)
self.sprites = [pygame.Surface((s... | justincariaga/Phasing-Snake | game_objects.py | game_objects.py | py | 1,767 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "pygame.Surface",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "pygame.Surface",
"line_number": 50,
"usage_type": "call"
},
{
"api_name": "random.choice",
"line_number": 57,
"usage_type": "call"
}
] |
3234843710 | """Module containing the ModelWrapper lightning module and its config."""
from typing import Dict, Tuple
from attrs import define
import torch
from torch import optim
import pytorch_lightning as pl
from jigsaw.composite import Composite as JigsawComposite
from jigsaw.piece import LossFunction as JigsawLossFunction
f... | asparagus/dota-draft | draft/model/model.py | model.py | py | 4,942 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "draft.model.embedding.EmbeddingConfig",
"line_number": 26,
"usage_type": "name"
},
{
"api_name": "draft.model.team_modules.TeamConvolutionConfig",
"line_number": 27,
"usage_type": "name"
},
{
"api_name": "draft.model.match_prediction.MatchPredictionConfig",
"li... |
7396725721 | #レコーディングダイエットアプリ
import json, os, textwrap, re
import tkinter as tk
import matplotlib.pyplot as plt#
import matplotlib.ticker as ticker#
from matplotlib.dates import date2num#
from matplotlib.dates import DateFormatter#
from tkinter import messagebox as mbox
from time import strftime
from datetime import d... | EtsukoNakano/RecordingDietApp | RecordingDietApp.py | RecordingDietApp.py | py | 34,962 | python | ja | code | 0 | github-code | 18 | [
{
"api_name": "tkinter.Frame",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "tkinter.Frame",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "tkinter.Label",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "tkinter.Button",
"... |
24047206930 | import cv2
import sys
import json
import util
import pytesseract
bw_threshold = 160
image_density_threshold = 0.001
def main():
if len(sys.argv) < 2:
raise Exception("Inputs:\n\tparameter 1: Test image to use for processing.")
input_image = sys.argv[1]
print("Image: %s" % input_image)
image = ... | kineticsquid/Sudoku_Images | extract_matrix_from_image_with_tesseract.py | extract_matrix_from_image_with_tesseract.py | py | 1,425 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.argv",
"line_number": 11,
"usage_type": "attribute"
},
{
"api_name": "sys.argv",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "cv2.imread",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "cv2.cvtColor",
"line_numbe... |
73027257320 | from marketing_automation.active_campaign.entities.active_campaign_contact_automation import ActiveCampaignContactAutomation
from marketing_automation.active_campaign.entities.active_campaign_contact_note import ActiveCampaignContactNote
from marketing_automation.active_campaign.entities.active_campaign_deal import Act... | dipendrabaidawa/unified_api | unified/modules/main/categories/marketing_automation/active_campaign/actions.py | actions.py | py | 12,742 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "unified.core.actions.Actions",
"line_number": 14,
"usage_type": "name"
},
{
"api_name": "marketing_automation.active_campaign.util.rest",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "marketing_automation.active_campaign.util",
"line_number": 23,
... |
28606452885 | # python3
r"""Learners of generalized method of moments with deep networks.
References:
- DeepGMMLearner:
Andrew Bennett, Nathan Kallus, and Tobias Schnabel. Deep generalized method of
moments forinstrumental variable analysis. InAdvances in Neural Information
Processing Systems, pages3559–3569, 2019.
- Adver... | liyuan9988/IVOPEwithACME | src/ope/deep_gmm/learner.py | learner.py | py | 25,153 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "datetime.timedelta",
"line_number": 37,
"usage_type": "call"
},
{
"api_name": "src.ope.deep_gmm.oadam.oadam.OAdam",
"line_number": 41,
"usage_type": "attribute"
},
{
"api_name": "src.ope.deep_gmm.oadam.oadam",
"line_number": 41,
"usage_type": "name"
},
... |
30987754035 | from django.utils.deprecation import MiddlewareMixin
from django.shortcuts import render
import re
class SessionFilter(MiddlewareMixin):
def process_request(self,request):
if (request.session.get('user_id') or request.session.get('customer_id')):
return None
else:
#... | yechen1988/jianbing | jbadmin/filter/SessionFilter.py | SessionFilter.py | py | 807 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.utils.deprecation.MiddlewareMixin",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "re.search",
"line_number": 15,
"usage_type": "call"
},
{
"api_name": "django.shortcuts.render",
"line_number": 21,
"usage_type": "call"
}
] |
15505857155 | import pytest
from CBLClient.FileLogging import FileLogging
from keywords.utils import log_info
log_level_dict = {
"debug": 0,
"verbose": 1,
"info": 2,
"warning": 3,
"error": 4,
}
@pytest.mark.listener
@pytest.mark.database
@pytest.mark.parametrize("log_level, plain_text, max_size, max_rotate_co... | couchbaselabs/mobile-testkit | testsuites/CBLTester/CBL_Functional_tests/TestSetup_FunctionalTests/test_cbl_logging.py | test_cbl_logging.py | py | 2,690 | python | en | code | 14 | github-code | 18 | [
{
"api_name": "keywords.utils.log_info",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "CBLClient.FileLogging.FileLogging",
"line_number": 35,
"usage_type": "call"
},
{
"api_name": "keywords.utils.log_info",
"line_number": 39,
"usage_type": "call"
},
{
... |
25165743898 | import dis
import random
import pygame
from pygame import event
pygame.init()
pygame.display.set_caption('Snake game first trail')
display_width = 400
display_height = 400
snake_block = 10
food_block = snake_block
display_game = pygame.display.set_mode((display_width, display_height))
white = (255, 255, 255)
blue =... | metodi1/snake-game | snake.py | snake.py | py | 3,676 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pygame.init",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "pygame.display.set_caption",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "pygame.displa... |
5528910769 | import os
import pandas as pd
import numpy as np
import requests
import pickle
import nltk
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.metrics.pairwise import cosine_similarity
from collections import Counter
def cleanhtml(raw_html):
cleantext = re.sub(CLEANR, '', raw_html)
... | USharma002/game-recommendor | api/data/datatools.py | datatools.py | py | 7,265 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pickle.load",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pickle.dump",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "pickle.HIGHEST_PROTOCOL",
"l... |
11943853304 | from base64 import encode
import os.path
from flask import Blueprint, jsonify, render_template, url_for, send_file
from flask_login import login_required, current_user
from ..controller.ordemDeServicoController import (
abertura_OrdemDeServico,
registra_orcamento,
aceita_ordemDeServico,
avaliar_ordemSer... | ogabrielfelipe/SGOM-Repository | app/bluePrints/ordemDeServico.py | ordemDeServico.py | py | 4,183 | python | pt | code | 6 | github-code | 18 | [
{
"api_name": "flask.Blueprint",
"line_number": 23,
"usage_type": "call"
},
{
"api_name": "controller.ordemDeServicoController.abertura_OrdemDeServico",
"line_number": 29,
"usage_type": "call"
},
{
"api_name": "flask_login.current_user.id",
"line_number": 29,
"usage_type"... |
37595480622 | import csv
import pandas as pd
from commit import Commit,Change
from collections import OrderedDict
from datetime import date
def read_file(changes_file):
# use strip to strip out spaces and trim the line.
data = [line.strip() for line in open(changes_file, 'r')]
return data
def get_commits... | fuller22/programming_big_data_10352792 | data_analyzer.py | data_analyzer.py | py | 7,188 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "commit.Commit",
"line_number": 26,
"usage_type": "call"
},
{
"api_name": "datetime.date",
"line_number": 30,
"usage_type": "name"
},
{
"api_name": "datetime.date",
"line_number": 31,
"usage_type": "name"
},
{
"api_name": "datetime.date.split",
"... |
27428534237 | import numpy as np
import networkx as nx
import torch
import matplotlib.pyplot as plt
import random
from placement_rl.baseline import random_placement, heft, random_op_eft_dev, get_placement_constraints
from os import listdir
from os.path import isfile, join
from env.utils import generate_graph, generate_network
from ... | uidmice/placement-rl | plots/plot_utils.py | plot_utils.py | py | 12,339 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.walk",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "os.path.join",
"line_number": 30,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 30,
"usage_type": "attribute"
},
{
"api_name": "pickle.load",
"line_number": 33... |
37597974422 | from typing import List
class Solution:
def maxProduct(self, nums: List[int]) -> int:
n = len(nums)
dp_max = nums[0]
dp_min = nums[0]
max_v = nums[0]
min_v = nums[0]
for i in range(1, n):
a, b, c = dp_min*nums[i], dp_max*nums[i], nums[i]
dp... | DoubleChuang/leetcode | blind75/Array/Maximum_Product_Subarray/main_dp_enhance.py | main_dp_enhance.py | py | 564 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "typing.List",
"line_number": 4,
"usage_type": "name"
}
] |
13844359732 | import cv2
import numpy as np
import glob
for img in glob.glob("*.png"):
np.set_printoptions(threshold=np.inf)
cv2.namedWindow("Tracking")
image = cv2.imread(img)
im_gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
(thresh, im_bw) = cv2.threshold(im_gray, 128, 255, cv2.THRESH_BINARY | cv2.THRES... | sanidhyaagrawal/handwriting-synthesis | main/croper2.py | croper2.py | py | 1,181 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "glob.glob",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "numpy.set_printoptions",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "numpy.inf",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "cv2.namedWindow",
"l... |
71845369640 | import pygame
import sys
class grid_game:
def __init__(self, screen):
self.screen = screen
self.lines = [((200, 0), (200, 600)), ((400, 0), (400, 600)), ((0, 200), (600, 200)), ((0, 400), (600, 400)), ]
def show(self):
for lines in self.lines:
pygame.draw.line(self.screen,... | Fenbjorn/Information_computer_soft | MyApp/morpion.py | morpion.py | py | 1,215 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pygame.draw.line",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.draw",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "pygame.disp... |
70910488359 | #!/usr/bin/python3
import socket
import threading
import pygame
import widgets
class MasterWindow:
def __init__(self):
pygame.init()
self.surface = pygame.Surface((1, 1))
self.display_clock = pygame.time.Clock()
self.recv_clock = pygame.time.Clock()
self.framerate = 30
... | danya02/tabletop-rpg-terminal | master.py | master.py | py | 4,063 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pygame.init",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "pygame.Surface",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "pygame.time.Clock",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "pygame.time",
"line_... |
11327560762 | #!/usr/bin/env python3
#!/usr/bin/env python3
from sklearn.svm import LinearSVC, SVC
from sklearn.model_selection import train_test_split
from sklearn.metrics import f1_score, accuracy_score, confusion_matrix
import numpy as np
import pandas as pd
from sys import exit
import random
from collections import defaultdic... | biederfrau/ktsne | scripts/eval_classify.py | eval_classify.py | py | 2,523 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "warnings.filterwarnings",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "warnings.filterwarnings",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "sklearn.exceptions.UndefinedMetricWarning",
"line_number": 19,
"usage_type": "name"
},
... |
20547721288 | from enum import Enum
from .utils import val
import re
class Control:
def GetFullName(self,enumval):
return self.__class__._FullNameData.get(enumval.name,None)
@property
def ctrlcode(self):
return f'{self.__class__._CtrlIdPrefix}{val(self)}'
def CreateControls(enumtypename,filelist,
... | bbuhlig/fsuipc-contrib | fsuipcini/controls.py | controls.py | py | 2,256 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "utils.val",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "re.match",
"line_number": 39,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 49,
"usage_type": "call"
},
{
"api_name": "enum.Enum",
"line_number": 51,
"... |
19315429770 | import collections
import logging
import os
import os.path
import sys
def check_file(filename):
if ( filename is None
or not os.path.isfile(filename)
or not os.access(filename, os.R_OK) ):
logging.fatal("Input file not specified or invalid. Given: '%s'.", filename)
sys.exit("Input... | yp/allele-prediction | hapallelepred_utils.py | hapallelepred_utils.py | py | 604 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.isfile",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "os.access",
"line_number": 10,
"usage_type": "call"
},
{
"api_name": "os.R_OK",
"line_number": 10,
... |
2479580575 | import torch
from hanzi_font_deconstructor.model.unet.train_net import train_net
from hanzi_font_deconstructor.model.unet.UNet import UNet
if __name__ == "__main__":
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
print(f"Using device {device}")
net = UNet(
n_channels=1,
... | chanind/hanzi-font-deconstructor | hanzi_font_deconstructor/scripts/train_model.py | train_model.py | py | 599 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "torch.device",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 6,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "hanzi_font_deconstr... |
33069827310 | from django.db import models
from django.core.validators import MaxValueValidator, MinValueValidator
from users.models import CustomUser
import datetime
#Model for organizations
class OrgProfile(models.Model):
title = models.CharField(max_length=200, blank=False)
logo = models.ImageField(upload_to='org_logo')
... | ghasemi-amirIE/CONESU_WebApp | organization/models.py | models.py | py | 2,016 | python | en | code | 3 | github-code | 18 | [
{
"api_name": "django.db.models.Model",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "django.db.models",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.db.models.CharField",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "... |
35372230665 | """
Programa que analiza un documento de Word (.docx) que contenga un texto jurídico y lo estructura en una tabla .csv con los datos ordenados en las columnas "Contexto", "Ley", "Artículos" y "Fracciones". El programa utiliza expresiones regulares –escritas de acuerdo a estructuras lingüísticas– para obtener los datos... | absalnC/gilkathon | getArticulos.py | getArticulos.py | py | 4,967 | python | es | code | 0 | github-code | 18 | [
{
"api_name": "re.compile",
"line_number": 32,
"usage_type": "call"
},
{
"api_name": "re.UNICODE",
"line_number": 32,
"usage_type": "attribute"
},
{
"api_name": "docx.Document",
"line_number": 34,
"usage_type": "call"
},
{
"api_name": "re.sub",
"line_number": ... |
11223465921 | import requests
def check():
response = requests.get('https://kyfw.12306.cn/otn/leftTicket/queryZ?leftTicketDTO.train_date=2019-01-17&leftTicketDTO.from_station=BJP&leftTicketDTO.to_station=XFN&purpose_codes=ADULT')
response.encoding = 'utf-8'
result = response.json()
return result['da... | qzylalala/WebSpider | 12306.py | 12306.py | py | 490 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 5,
"usage_type": "call"
}
] |
73415819559 | from dashboard.models import Email
from django.http.response import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login, logout
from helpers import curr... | boyuan12/CustomEmail | dashboard/views.py | views.py | py | 2,165 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "django.contrib.auth.models.User.objects.create_user",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "django.contrib.auth.models.User.objects",
"line_number": 14,
"usage_type": "attribute"
},
{
"api_name": "django.contrib.auth.models.User",
"line_numb... |
10308392384 | import boto3
import json
def lambda_handler(event,context):
cfclient = client = boto3.client('cloudformation')
response = client.describe_stack_set_operation(
StackSetName='Baseline-PROD',
OperationId=event['baseline']['OperationId']
)
return(response['StackSetOperation']['Status']) | uprix/virago | src/Lambda/provision/getStackInstanceState_baseline.py | getStackInstanceState_baseline.py | py | 313 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "boto3.client",
"line_number": 4,
"usage_type": "call"
}
] |
22634335633 | from django import forms
from django.utils.translation import gettext_lazy as _
from congregations.models import Congregation, Group, Publisher, TAGS, CongregationRole, ROLES
class FormCongregation(forms.ModelForm):
class Meta:
model = Congregation
fields = ('name', 'number', 'circuit', 'city', 's... | muriloventuroso/sgc | congregations/forms.py | forms.py | py | 3,305 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "congregations.models.Congregation",
"line_number": 8,
"usage_type": "name"
},
{
"api_name"... |
126357722 | import re
import math
import argparse
import os.path
import yaml
import matplotlib.pyplot as plt
from tqdm.auto import tqdm
import pandas as pd
import numpy as np
import cv2
import joblib
# FLYHOSTEL_VIDEOS=os.environ["FLYHOSTEL_VIDEOS"]
FLYHOSTEL_VIDEOS="/Users/FlySleepLab Dropbox/Data/flyhostel_data/videos/"
from im... | shaliulab/idtrackerai | idtrackerai/video_presentation/video_presentation.py | video_presentation.py | py | 8,160 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "cv2.FONT_HERSHEY_SIMPLEX",
"line_number": 23,
"usage_type": "attribute"
},
{
"api_name": "pandas.isna",
"line_number": 48,
"usage_type": "call"
},
{
"api_name": "cv2.rectangle",
"line_number": 58,
"usage_type": "call"
},
{
"api_name": "cv2.copyMakeB... |
33367389810 | import os
import sys
import argparse
import subprocess
from loguru import logger
# Run createStationMeta.py to create station data from the original station data tables (i.e. dbo_gages_all, ndbc_stations, and noaa_stations).
# Ingesting the original station data was a step described in the README.md file.
def runCreat... | RENCI/apsviz-timeseriesdb-stations | run/runIngest.py | runIngest.py | py | 4,323 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "loguru.logger.info",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "loguru.logger",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "subprocess.call",
"line_number": 19,
"usage_type": "call"
},
{
"api_name": "loguru.logger.info",... |
29131535504 | import fileinput
import re
from collections import defaultdict
from functools import cache
import itertools
lines = [line.strip() for line in fileinput.input()]
rate = defaultdict(int)
graph = defaultdict(list)
time = 30
released = 0
D = defaultdict(lambda: 1000)
for l in lines:
source, r, dests = re.findall(r' ([... | sssss465/aoc | 2022/day16.py | day16.py | py | 2,047 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "fileinput.input",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "collections.defaultdict",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "collecti... |
1355550624 | # Usage: python parser.py --file result.txt
import argparse
import re
parser = argparse.ArgumentParser(description='Pass params to parse result numbers.')
parser.add_argument('--file', '-f', type=str, help=' ')
args = parser.parse_args()
with open(args.file, 'r') as f:
iter_cost, batch_inference_time, batch_post... | escalab/PAMLB | VMF/tools/parser.py | parser.py | py | 1,423 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_number": 22,
"usage_type": "call"
},
{
"api_name": "re.findall",
"line_n... |
16529248650 | from django import forms
from .models import Comment
class CommentsForm(forms.ModelForm):
class Meta:
model = Comment #base the form of the comment model
fields = ['text'] #don't have to show all fields from topic model
labels = {'text':''}
w... | jcolvert99/Pizzeria | pizzas/forms.py | forms.py | py | 382 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "django.forms.ModelForm",
"line_number": 5,
"usage_type": "attribute"
},
{
"api_name": "django.forms",
"line_number": 5,
"usage_type": "name"
},
{
"api_name": "models.Comment",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "django.forms.Tex... |
14040640954 | #!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
import argparse
"""
This script creates a bar graph of the number of "papers using libmesh" by year.
* We do not simply count citations, the authors must have actually
used libmesh in part of their work.
* Conversely, not everyone who uses lib... | libMesh/libmesh | doc/statistics/libmesh_citations.py | libmesh_citations.py | py | 2,981 | python | en | code | 589 | github-code | 18 | [
{
"api_name": "argparse.ArgumentParser",
"line_number": 52,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot.figure",
"line_number": 66,
"usage_type": "call"
},
{
"api_name": "matplotlib.pyplot",
"line_number": 66,
"usage_type": "name"
},
{
"api_name": "nu... |
72400179561 | import discord
from discord.ext import commands
import random
import json
import random
import aiohttp
import nekos
import asyncio
import uwuify
import sqlite3 as s
import requests
class Calculator(commands.Cog):
def __init__(self, client):
self.client = client
self.session = aiohttp.ClientSession(... | TeamSHEILD/Starry | cogs/Calculator.py | Calculator.py | py | 1,287 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "discord.ext.commands.Cog",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "discord.ext.commands",
"line_number": 13,
"usage_type": "name"
},
{
"api_name": "aiohttp.ClientSession",
"line_number": 16,
"usage_type": "call"
},
{
"api_name... |
8757895314 | from flask import Flask, render_template, jsonify, request
app = Flask(__name__)
from pymongo import MongoClient # pymongo를 임포트 하기(패키지 인스톨 먼저 해야겠죠?)
client = MongoClient('localhost', 27017) # mongoDB는 27017 포트로 돌아갑니다.
db = client.dbsparta # 'dbsparta'라는 이름의 db를 만듭니다.
## HTML을 주는 부분
@ap... | sdhead/sparta_sdhead | projects/homework_4/app.py | app.py | py | 1,337 | python | ko | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 2,
"usage_type": "call"
},
{
"api_name": "pymongo.MongoClient",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "flask.render_template",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "flask.request.for... |
34212420949 | import io
import sys
_INPUT = """\
869121
"""
sys.stdin = io.StringIO(_INPUT)
N = int(input())
mod = 10**9+7
A_all = pow(10, N, mod)
A_0 = pow(9, N, mod)
A_9 = pow(9, N, mod)
A_0_9 = pow(8, N, mod)
ans = A_all-(A_0+A_9-A_0_9)
ans %= mod
print(ans)
| kkchart9/atcoder | ABC/178_c.py | 178_c.py | py | 255 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "sys.stdin",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "io.StringIO",
"line_number": 7,
"usage_type": "call"
}
] |
20558634795 | '''
RunPod | Transformer | Handler
'''
import argparse
import torch
import runpod
from runpod.serverless.utils.rp_validator import validate
from transformers import (GPTNeoForCausalLM, GPT2Tokenizer, GPTNeoXForCausalLM,
GPTNeoXTokenizerFast, GPTJForCausalLM, AutoTokenizer, AutoModelForCausalL... | runpod/serverless-workers | workers/huggingface-transformers/runpod_infer.py | runpod_infer.py | py | 3,920 | python | en | code | 47 | github-code | 18 | [
{
"api_name": "torch.cuda.is_available",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "torch.device",
"line_number": 14,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_av... |
74602120681 | import pygame
import my_enums
from tigr import AbstractDrawer
import sys
class DrawerPy(AbstractDrawer):
def __init__(self, set_width=1000, set_height=1000):
self.window = pygame.display.set_mode((set_width, set_height))
self.src_x = 500
self.src_y = 500
self.des_x = 0
... | urube/FrameWork_Assignment3_Ara_2019-2 | drawer_py_game.py | drawer_py_game.py | py | 2,330 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "tigr.AbstractDrawer",
"line_number": 7,
"usage_type": "name"
},
{
"api_name": "pygame.display.set_mode",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "pygame.display",
"line_number": 9,
"usage_type": "attribute"
},
{
"api_name": "my_enums... |
9912712312 | """ Activation operators or other unary nonlinear operators"""
import torch
from torch import Tensor
from collections import OrderedDict
from .base import *
from .clampmult import multiply_by_A_signs
torch._C._jit_set_profiling_executor(False)
torch._C._jit_set_profiling_mode(False)
class BoundActivation(Bound):
... | Verified-Intelligence/auto_LiRPA | auto_LiRPA/operators/activation_base.py | activation_base.py | py | 12,735 | python | en | code | 235 | github-code | 18 | [
{
"api_name": "torch._C._jit_set_profiling_executor",
"line_number": 8,
"usage_type": "call"
},
{
"api_name": "torch._C",
"line_number": 8,
"usage_type": "attribute"
},
{
"api_name": "torch._C._jit_set_profiling_mode",
"line_number": 9,
"usage_type": "call"
},
{
"... |
20983934379 | import os
import shutil
import sys
import numpy as np
import math
from scipy import stats, mgrid, reshape, random
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import pyUQTk.utils as ut
from pylab import *
rc('legend',loc='upper left', fontsize=12)
rc('lines', linewidth=1, color='r')
rc('axe... | sukhbinder/uqtoolkit_on_rashpberrypi | pyUQTk/plotting/surrogate.py | surrogate.py | py | 6,334 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pyUQTk.utils.set_colors",
"line_number": 121,
"usage_type": "call"
},
{
"api_name": "pyUQTk.utils",
"line_number": 121,
"usage_type": "name"
},
{
"api_name": "numpy.empty",
"line_number": 122,
"usage_type": "call"
},
{
"api_name": "numpy.append",
... |
21357978883 | import base
import collections
import parse_cve_tags
import parse_shortlog
import parse_signed_off_by
import pyparsing
import subprocess
from data import PatchTestInput
def headlog():
output = subprocess.check_output(
"cd %s; git log --pretty='%%h#%%aN#%%cD:#%%s' -1" % PatchTestInput.repodir,
unive... | jhnc-oss/poky | meta/lib/patchtest/tests/test_mbox.py | test_mbox.py | py | 9,609 | python | en | code | 2 | github-code | 18 | [
{
"api_name": "subprocess.check_output",
"line_number": 11,
"usage_type": "call"
},
{
"api_name": "data.PatchTestInput.repodir",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "data.PatchTestInput",
"line_number": 12,
"usage_type": "name"
},
{
"api_... |
11902179820 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Yiming Yang
# Date: 08/07/2022
# Email: y.yang2@napier.ac.uk
# Description: Define the Probabilistic UNet Model.
# Referenced from Simon A. A. Kohl et al. (2018): A Probabilistic U-Net for Segmentation of Ambiguous Images
# Implementation... | yyimingucl/Auto_Cell_Counting_with_PUNet | Model/Probabilistic_UNet.py | Probabilistic_UNet.py | py | 12,497 | python | en | code | 5 | github-code | 18 | [
{
"api_name": "torch.device",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.cuda.is_available",
"line_number": 17,
"usage_type": "call"
},
{
"api_name": "torch.cuda",
"line_number": 17,
"usage_type": "attribute"
},
{
"api_name": "torch.nn.Module"... |
20623514804 | """Models for Blogly."""
from flask_sqlalchemy import SQLAlchemy
from datetime import datetime
db = SQLAlchemy()
def connect_db(app):
db.app = app
db.init_app(app)
class User(db.Model):
__tablename__ = "users"
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
first_name = db.Co... | brent-franklin/SpringBoard_Projects | flask-blogly/models.py | models.py | py | 4,889 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask_sqlalchemy.SQLAlchemy",
"line_number": 5,
"usage_type": "call"
},
{
"api_name": "datetime.datetime.now",
"line_number": 71,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 71,
"usage_type": "name"
}
] |
72337592041 | import requests
import re
# function to check if URL is malicious
def is_malicious(url):
try:
response = requests.get(url, timeout=7)
page_content = response.text
except:
return False
# check for presence of viruses in the page content
if re.search(r'malwar... | krishna0306/malware_checker_phishing_cookies-detector | malware_checker.py | malware_checker.py | py | 1,221 | python | en | code | 1 | github-code | 18 | [
{
"api_name": "requests.get",
"line_number": 7,
"usage_type": "call"
},
{
"api_name": "re.search",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "re.IGNORECASE",
"line_number": 13,
"usage_type": "attribute"
},
{
"api_name": "re.search",
"line_number... |
6546884780 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Note that all formatting functions require a config that has gone through normalizer.normalize()
Only regression tests are used for these, because it's string output.
Just don't forget to replace data files if input file changes.
"""
# pylama: ignore=D102
# pylint: di... | Prooffreader/pytabby | tests/test_formatting.py | test_formatting.py | py | 3,389 | python | en | code | 23 | github-code | 18 | [
{
"api_name": "copy.deepcopy",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "pytabby.formatting._format_headers",
"line_number": 28,
"usage_type": "call"
},
{
"api_name": "pytabby.formatting",
"line_number": 28,
"usage_type": "name"
},
{
"api_name": "p... |
39843876942 | #! /usr/bin/env python
import time
import rospy
import json
from geometry_msgs.msg import Twist
initial_time = -1
def callback(msg):
# read previous data
print('here')
with open('velocity_x.json', 'r') as openfile:
jsonObject = json.load(openfile)
openfile.close()
print(time.time())... | mfouad992/Multi_Robot_Mohamed | src/mir/mir_gazebo/launch/Date_recorder/velocity_x.py | velocity_x.py | py | 1,015 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "json.load",
"line_number": 16,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 27,
"usage_type": "call"
},
{
"api_name": "time.time",
"line_number": 29,
... |
27749929983 | # jikwon 테이블을 대상으로 사번과 이름을 입력(로그인)해 해당 자료가 있다면
# 해당 직원이 근무하는 부서 직원을 직급별 오름차순으로 모두 출력, 직급이 같다면 이름별 오름차순 출력
# 출력 형태 : 사번, 이름, 부서명, 직급, 성별
# 다음으로 해당 직원이 관리하는 고객 자료 출력
# 출력 형태 : 고객번호, 고객명, 고객전화, 나이
import MySQLdb
import pickle
with open('mydb.dat', 'rb') as obj:
config = pickle.load(obj)
def start():
try:
... | whatit0/Python | pack3/test43_ex.py | test43_ex.py | py | 2,246 | python | ko | code | 0 | github-code | 18 | [
{
"api_name": "pickle.load",
"line_number": 9,
"usage_type": "call"
},
{
"api_name": "MySQLdb.connect",
"line_number": 14,
"usage_type": "call"
}
] |
34188609150 | from datetime import datetime
class Trade:
def __init__(self, date, time, type, qty, strike, expiry, kind, exchange, tradeId, product, side=None):
self.date = date
self.time = time
self.type = type
self.qty = qty
self.strike = strike
self.expiry = expiry
self... | MadhavanKR/leetcode | runFront/Trade.py | Trade.py | py | 1,501 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "datetime.datetime.strptime",
"line_number": 18,
"usage_type": "call"
},
{
"api_name": "datetime.datetime",
"line_number": 18,
"usage_type": "name"
},
{
"api_name": "datetime.datetime.strptime",
"line_number": 19,
"usage_type": "call"
},
{
"api_name"... |
29977812362 |
# Import necessary libraries
import json
from flask import Flask, render_template, request, url_for, send_from_directory, jsonify
from werkzeug.utils import secure_filename
from flask_cors import CORS, cross_origin
import service as serve
app = Flask(__name__) # Create an instance of Flask
cors = CORS(app) # Enable C... | Thiviruperera/FYP-Safe-Vision | Backend/app.py | app.py | py | 2,147 | python | en | code | 1 | github-code | 18 | [
{
"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": 22,
"usage_type": "attribute"
},
{
"api_name": "flask.request",
... |
43464345252 | import pygame
import random
group = []
class Particles(pygame.sprite.Sprite):
"Creates particles starting from pos with a color"
def __init__(self, pos, y_dir, color, sparse=0, turn="off"):
super(Particles, self).__init__()
self.particles_list = []
self.pos = pos
self.color ... | formazione/skatejack | locals/particles.py | particles.py | py | 2,493 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "pygame.sprite",
"line_number": 7,
"usage_type": "attribute"
},
{
"api_name": "random.randrange",
"line_number": 33,
"usage_type": "call"
},
{
"api_name": "random.randint",
"line_number": 41,
"usage_type": "call"
},
{
"api_name": "random.randint",
... |
11789285904 | """ Make input station file for HypoDD
"""
import os
import config
# i/o paths
cfg = config.Config()
fout = open('input/station.dat','w')
done_list = []
f=open(cfg.fsta); lines=f.readlines(); f.close()
for line in lines:
codes = line.split(',')
net, sta = codes[0].split('.')
if sta in done_list: continue
... | YijianZhou/PAL | hypodd/mk_sta.py | mk_sta.py | py | 462 | python | en | code | 70 | github-code | 18 | [
{
"api_name": "config.Config",
"line_number": 7,
"usage_type": "call"
}
] |
33231049772 | from google.appengine.ext import db#
import logging#
import myutils#
import cacheMgr
class StockPrice(db.Model):
stock_id = db.StringProperty(required=True)
price = db.StringProperty(required=True)
detail = db.StringProperty(required=True)
date = db.DateProperty(auto_now_add=True)
def getPriceList(sto... | yyb196/stock-book | stockPrice.py | stockPrice.py | py | 875 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "google.appengine.ext.db.Model",
"line_number": 6,
"usage_type": "attribute"
},
{
"api_name": "google.appengine.ext.db",
"line_number": 6,
"usage_type": "name"
},
{
"api_name": "google.appengine.ext.db.StringProperty",
"line_number": 7,
"usage_type": "call"
... |
17062944728 | from elasticsearch import Elasticsearch
def analyze(sentence):
results = Elasticsearch().indices.analyze(
index = "data",
body={
"analyzer": "my_analyzer",
"text": sentence
}
)
print([key["token"] for key in results["tokens"]])
while(True):
analyze(input... | homveloper/Elasticsearch-Tutorial | analyze.py | analyze.py | py | 329 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "elasticsearch.Elasticsearch",
"line_number": 4,
"usage_type": "call"
}
] |
31397666989 | ### resize image to 1920x1080 pixels ###
import cv2, math, os, glob, shutil
folder_fish = ['pod', 'ku_lare', 'see_kun', 'too',
'khang_pan', 'hang_lueang', 'sai_dang', 'sai_dum']
for name_image in folder_fish:
# create folder resized for add image resize here
name_dir = f"resize... | DonXI/sorting_fish_project | resize_image.py | resize_image.py | py | 1,563 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "os.path.isdir",
"line_number": 12,
"usage_type": "call"
},
{
"api_name": "os.path",
"line_number": 12,
"usage_type": "attribute"
},
{
"api_name": "os.makedirs",
"line_number": 13,
"usage_type": "call"
},
{
"api_name": "glob.glob",
"line_number":... |
27035242791 | from flask import Flask, request, render_template, redirect, session
import random
import datetime
app = Flask(__name__)
app.secret_key = "SuchWowMuchNinja"
@app.route('/')
def root():
if 'gold' not in session:
session['gold'] = 0
if 'strs' not in session:
session['strs'] = []
return render... | KristoD/NinjaGold-Python2-Flask | server.py | server.py | py | 1,404 | python | en | code | 0 | github-code | 18 | [
{
"api_name": "flask.Flask",
"line_number": 4,
"usage_type": "call"
},
{
"api_name": "flask.session",
"line_number": 9,
"usage_type": "name"
},
{
"api_name": "flask.session",
"line_number": 10,
"usage_type": "name"
},
{
"api_name": "flask.session",
"line_numbe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.