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
41637205602
import base64 import logging import sys from string import digits, ascii_uppercase import traceback import time from ins import * from disasm import * import gpu class Tape: ''' Tape is just a looped array of instructions. ''' @classmethod def from_inss(cls, inss): '''Create tape from in...
qxxxb/emu
emu.py
emu.py
py
16,844
python
en
code
0
github-code
1
[ { "api_name": "ins.to_bytes", "line_number": 37, "usage_type": "call" }, { "api_name": "string.digits", "line_number": 147, "usage_type": "name" }, { "api_name": "string.ascii_uppercase", "line_number": 147, "usage_type": "name" }, { "api_name": "gpu.Gpu", "li...
18773450898
import os, math, sys from collections import Counter def get_vocabulary(item_class): class_vocabulary = [] for filename in os.listdir('train/' + item_class): file = open(os.path.join('train/' + item_class, filename), encoding='latin-1') class_vocabulary += [word for line in file for word in li...
myociss/probabilistic-classifiers
bayes.py
bayes.py
py
3,170
python
en
code
0
github-code
1
[ { "api_name": "os.listdir", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.listdir", "line_number": 15,...
26815440104
from keras.models import Sequential, load_model from keras.layers import Embedding, Conv1D, MaxPooling1D, LSTM, GRU, Dense from keras.layers.wrappers import Bidirectional y_idx2word=8 def run_classifier(x_train_seq,x_test_seq,y_train_one_hot,y_test_one_hot): model = Sequential() print("-----------------------...
NehalAB/Text_Classifier
multi_class_neural_network.py
multi_class_neural_network.py
py
1,777
python
en
code
0
github-code
1
[ { "api_name": "keras.models.Sequential", "line_number": 8, "usage_type": "call" }, { "api_name": "keras.layers.Embedding", "line_number": 11, "usage_type": "call" }, { "api_name": "keras.layers.wrappers.Bidirectional", "line_number": 16, "usage_type": "call" }, { ...
40762266793
def getadd(): import requests import json import getip ip = getip.get() send_url = f'http://api.ipstack.com/{ip}?access_key=7cf3582503675544e752924eb3142e79&format=1' r = requests.get(send_url) j = json.loads(r.text) lat = str(j['latitude']) lon = str(j['longitude']) print(la...
usthandwa/WeThinkCode_Work
Matcha/views/functions.py
functions.py
py
1,063
python
en
code
0
github-code
1
[ { "api_name": "getip.get", "line_number": 8, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 11, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 12, "usage_type": "call" }, { "api_name": "config.db.query", "line_number":...
33008352550
import keyboard import time import random from ctypes import windll, wintypes, byref from functools import reduce from cafe_coding_download import enable enable() f = open('cafe_coding_download.py', 'r', encoding='UTF-8') data = f.read() f.close() i = 0 s = '' while True: if keyboard.read_key(): s += d...
Yotty0404/Cafe_Coding
cafe_coding_keyboard.py
cafe_coding_keyboard.py
py
741
python
en
code
2
github-code
1
[ { "api_name": "cafe_coding_download.enable", "line_number": 9, "usage_type": "call" }, { "api_name": "keyboard.read_key", "line_number": 19, "usage_type": "call" } ]
2226540156
from dataclasses import dataclass, field # dataclass ja cria para nós o init, repr e eq @dataclass(init=True) class Pessoa: _nome: str _idade: float enderecos: list[str] = field(default_factory=list) def __post_init__(self): print("depois do init") @property def nome(self): ...
michaelmedina10/estudos-python
oop/dataclass.py
dataclass.py
py
411
python
pt
code
1
github-code
1
[ { "api_name": "dataclasses.field", "line_number": 10, "usage_type": "call" }, { "api_name": "dataclasses.dataclass", "line_number": 5, "usage_type": "call" } ]
31666142254
# author: sunshine # datetime:2021/8/5 下午3:17 import torch import torch.nn as nn from transformers import BertModel class SMPNet(nn.Module): def __init__(self, args, num_class): super(SMPNet, self).__init__() self.bert = BertModel.from_pretrained(args.bert_path) self.fc1 = nn.Sequential( ...
fushengwuyu/smp2020_ewect
src/model.py
model.py
py
1,411
python
en
code
1
github-code
1
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "transformers.BertModel.from_pretrained", "line_number": 11, "usage_type": "call" }, { "api_name": "tr...
19845668758
from django.shortcuts import render from .forms import UploadTransactionFileForm from .models import TransactionFIles, Transactions from .serializers import TransactionnsSerializer from .utils.mixins import TransactionMixin from rest_framework.generics import ListCreateAPIView from rest_framework.views import APIView, ...
reisquaza/CNAB
transactions/views.py
views.py
py
3,344
python
en
code
0
github-code
1
[ { "api_name": "forms.UploadTransactionFileForm", "line_number": 17, "usage_type": "call" }, { "api_name": "serializers.TransactionnsSerializer", "line_number": 44, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 50, "usage_type": "call" }...
17315387689
""" Code adapted from https://github.com/uvavision/Double-Hard-Debias/blob/master/eval.py """ import glob import os import numpy as np from sklearn.utils import Bunch from sklearn.cluster import AgglomerativeClustering, KMeans from six import iteritems def evaluate_categorization(word_vectors, X, y, method='kmeans', ...
YolandaMDavis/DoubleHardMulticlass
common/concept.py
concept.py
py
5,620
python
en
code
0
github-code
1
[ { "api_name": "numpy.mean", "line_number": 31, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 47, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 48, "usage_type": "call" }, { "api_name": "numpy.vstack", "line_number": ...
37404377541
#!/usr/bin/env python3 # coding: utf-8 import torch import torch.nn as nn import torch.nn.functional as F from torch import multiprocessing as mp import math import plotly from plotly.graph_objs import Scatter, Line import numpy as np from numpy.lib.stride_tricks import as_strided as ast from scipy.ndimage import ga...
chenaddsix/pytorch_a3c
utils.py
utils.py
py
7,553
python
en
code
1
github-code
1
[ { "api_name": "numpy.mean", "line_number": 21, "usage_type": "call" }, { "api_name": "math.log10", "line_number": 26, "usage_type": "call" }, { "api_name": "math.sqrt", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.mean", "line_number": 28, ...
36221665148
import numpy as np import os import datetime as dt import sqlalchemy from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session from sqlalchemy import create_engine, func from flask import Flask, jsonify engine = create_engine("sqlite:///Resources/hawaii.sqlite") # reflect an existing databa...
epayne323/sqlalchemy-challenge
app.py
app.py
py
6,008
python
en
code
0
github-code
1
[ { "api_name": "sqlalchemy.create_engine", "line_number": 12, "usage_type": "call" }, { "api_name": "sqlalchemy.ext.automap.automap_base", "line_number": 15, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 21, "usage_type": "call" }, { "api_name...
1063359949
from django.db import models class BaseModel(models.Model): created_at = models.DateTimeField( "Data de Criação", auto_now=False, auto_now_add=True ) modified_at = models.DateTimeField( "Data de Modificação", auto_now=True, auto_now_add=False ) class Meta: abstract = True ...
CleysonPH/cdm-unofficial-api
mangas/models.py
models.py
py
2,848
python
en
code
0
github-code
1
[ { "api_name": "django.db.models.Model", "line_number": 4, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 4, "usage_type": "name" }, { "api_name": "django.db.models.DateTimeField", "line_number": 5, "usage_type": "call" }, { "api_name...
19890027037
import torch import numpy as np import torch.nn as nn import math from PIL import Image import os from core.constants import palette, NUM_CLASSES, IGNORE_LABEL def denorm(x): out = (x + 1) / 2 return out.clamp(0, 1) def norm(x): out = (x - 0.5) * 2 return out.clamp(-1, 1) def reset_grads(model, requi...
shahaf1313/ProCST
core/functions.py
functions.py
py
9,425
python
en
code
25
github-code
1
[ { "api_name": "numpy.ceil", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 23, "usage_type": "call" }, { "api_name": "numpy.int", "line_number": 23, "usage_type": "attribute" }, { "api_name": "torch.nn.functional.interpolate...
25410789355
import optparse import xml.etree.ElementTree from util import build_utils MANIFEST_TEMPLATE = """<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="%(package)s" split="%(split)s"> <uses-sdk android:minSdkVersion="21" /> <application and...
hanpfei/chromium-net
build/android/gyp/generate_split_manifest.py
generate_split_manifest.py
py
2,284
python
en
code
289
github-code
1
[ { "api_name": "optparse.OptionParser", "line_number": 23, "usage_type": "call" }, { "api_name": "util.build_utils.AddDepfileOption", "line_number": 24, "usage_type": "call" }, { "api_name": "util.build_utils", "line_number": 24, "usage_type": "name" }, { "api_name...
12137137685
import datetime class Message: """Represents a message sent to a chat. Attributes ---------- chat: :class:`models.Chat` The chat the message belongs to type: :class:`str` The type of message sent id: :class:`str` The id of the message content: :class:`str` ...
A-Trash-Coder/dlive.py
dlive/models/message.py
message.py
py
1,232
python
en
code
4
github-code
1
[ { "api_name": "datetime.datetime.utcfromtimestamp", "line_number": 32, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 32, "usage_type": "attribute" } ]
71728283555
from fastapi import FastAPI, Cookie, Response from typing import Union from pydantic import BaseModel from typing_extensions import Annotated app = FastAPI() @app.get("/books") async def books( ads_id: Annotated[Union[str, None], Cookie()] ): return { "code": 200, "message": "访问成功", ...
Mengxin-yi/fastApiProject
mainCookie.py
mainCookie.py
py
355
python
en
code
0
github-code
1
[ { "api_name": "fastapi.FastAPI", "line_number": 6, "usage_type": "call" }, { "api_name": "typing_extensions.Annotated", "line_number": 11, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 11, "usage_type": "name" }, { "api_name": "fastapi.Cooki...
32180876446
import torch from .base_model import BaseModel from .BigGAN_networks import * from util.util import toggle_grad, loss_hinge_dis, loss_hinge_gen, ortho, default_ortho, toggle_grad, prepare_z_y, \ make_one_hot, to_device, multiple_replace, random_word import pandas as pd from .OCR_network import * from torch.nn impor...
amzn/convolutional-handwriting-gan
models/ScrabbleGAN_baseModel.py
ScrabbleGAN_baseModel.py
py
25,408
python
en
code
235
github-code
1
[ { "api_name": "base_model.BaseModel", "line_number": 18, "usage_type": "name" }, { "api_name": "base_model.BaseModel.__init__", "line_number": 28, "usage_type": "call" }, { "api_name": "base_model.BaseModel", "line_number": 28, "usage_type": "name" }, { "api_name"...
28413956290
import json, os, requests, subprocess # Your Discogs username and API key username = '' api_key = '' # The ID of the folder containing your collection folder_id = 0 # Base URL for Discogs API base_url = 'https://api.discogs.com' # Endpoint for retrieving collection releases endpoint = f'/users/{username}/collection...
notaSWE/wallofrecords
local_option/get_collection.py
get_collection.py
py
1,616
python
en
code
0
github-code
1
[ { "api_name": "requests.get", "line_number": 20, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 44, "usage_type": "call" }, { "api_name": "os.path", "line_number":...
23657966447
#!Python-2.7.11/bin/python import os,sys import argparse import numpy as np import copy sys.path.append('Python-2.7.11/lib/python2.7/site-packages') from ete2 import Tree,TreeStyle,TextFace,NodeStyle parser = argparse.ArgumentParser(description='Phylogenetic Tree analysis for Cancer Evolution.') parser.add_argument('-...
gda7090/cancer
phylogenetic_tree_phylip.py
phylogenetic_tree_phylip.py
py
13,457
python
en
code
1
github-code
1
[ { "api_name": "sys.path.append", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path.exists", ...
28663203794
import os from dotenv import load_dotenv import sqlalchemy from sqlalchemy import join from sqlalchemy.orm import sessionmaker, query from models import create_tables, Publisher, Book, Shop, Stock, Sale load_dotenv() user = os.environ.get('USER') password = os.environ.get('PASSWORD') db = os.environ.get('DB') DSN = f...
juicebiz/13-orm
main.py
main.py
py
2,648
python
en
code
0
github-code
1
[ { "api_name": "dotenv.load_dotenv", "line_number": 8, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 9, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.environ.get", "...
26184567771
# %% import torch import torch.nn as nn import torch.optim as optim import torchtext from torchtext.data import Field, BucketIterator, TabularDataset from torchtext.data.functional import sentencepiece_tokenizer, load_sp_model from pathlib import Path import dill import numpy as np import os import random import re...
mmcux/de-nds-translation
translate_input.py
translate_input.py
py
18,238
python
en
code
32
github-code
1
[ { "api_name": "pathlib.Path", "line_number": 22, "usage_type": "call" }, { "api_name": "torchtext.data.functional.load_sp_model", "line_number": 32, "usage_type": "call" }, { "api_name": "torchtext.data.functional.load_sp_model", "line_number": 33, "usage_type": "call" ...
27438269251
from __future__ import absolute_import from __future__ import division import re from functools import reduce import wx import wx.stc from six.moves import xrange from graphics.GraphicCommons import ERROR_HIGHLIGHT, SEARCH_RESULT_HIGHLIGHT, REFRESH_HIGHLIGHT_PERIOD from plcopen.structures import ST_BLOCK_START_KEYWOR...
thiagoralves/OpenPLC_Editor
editor/editors/TextViewer.py
TextViewer.py
py
45,065
python
en
code
307
github-code
1
[ { "api_name": "six.moves.xrange", "line_number": 21, "usage_type": "call" }, { "api_name": "six.moves.xrange", "line_number": 23, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 37, "usage_type": "call" }, { "api_name": "re.compile", "line_n...
33843097301
from transformers import ColorTransformer from ..blend.blend import * from ..palettes.core_palette import * from ..scheme.scheme import * from .image_utils import * from .string_utils import * # /** # * Generate custom color group from source and target color # * # * @param source Source color # * @param color C...
DimitrisMilonopoulos/mitsugen
src/material_color_utilities_python/utils/theme_utils.py
theme_utils.py
py
3,222
python
en
code
88
github-code
1
[ { "api_name": "transformers.ColorTransformer.argb_to_hex", "line_number": 84, "usage_type": "call" }, { "api_name": "transformers.ColorTransformer", "line_number": 84, "usage_type": "name" } ]
74416921314
from collections import defaultdict # Utility function to create dictionary def multi_dict(K, type): if K == 1: return defaultdict(type) else: return defaultdict(lambda: multi_dict(K-1, type)) with open('input-10.txt') as f: lines = [row.strip() for row in f] print(lines) X=1 cycles = [...
fshsweden/AdventOfCode2022
10a.py
10a.py
py
805
python
en
code
0
github-code
1
[ { "api_name": "collections.defaultdict", "line_number": 6, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 8, "usage_type": "call" } ]
13382414004
import unittest import subprocess import os import numpy as np from openfermion import ( QubitOperator, InteractionOperator, FermionOperator, IsingOperator, get_interaction_operator, hermitian_conjugated ) from zquantum.core.circuit import build_uniform_param_grid from zquantum.core.utils import create_object f...
wugaxp/qe-openfermion
src/python/qeopenfermion/_io_test.py
_io_test.py
py
4,933
python
en
code
1
github-code
1
[ { "api_name": "unittest.TestCase", "line_number": 21, "usage_type": "attribute" }, { "api_name": "openfermion.QubitOperator", "line_number": 25, "usage_type": "call" }, { "api_name": "openfermion.hermitian_conjugated", "line_number": 26, "usage_type": "call" }, { ...
3513686248
import streamlit as st from streamlit_player import st_player column1, column2, = st.columns(2) st.subheader("Send Email Receipts using automation") st_player("https://youtu.be/G3fTz6VnnTc") st.divider() st.subheader("Recording Videos using Flonnect") st_player("https://youtu.be/id_Oj7cG0Hs") st.divider() st.s...
madhuammulu8/FR-Analysis
pages/_👨🏽‍💻_Knowledge Transfer.py
_👨🏽‍💻_Knowledge Transfer.py
py
725
python
en
code
0
github-code
1
[ { "api_name": "streamlit.columns", "line_number": 5, "usage_type": "call" }, { "api_name": "streamlit.subheader", "line_number": 7, "usage_type": "call" }, { "api_name": "streamlit_player.st_player", "line_number": 8, "usage_type": "call" }, { "api_name": "streaml...
20454510000
### This is the LSTM training module ### from keras.preprocessing.text import Tokenizer from keras.preprocessing.sequence import pad_sequences from keras.models import Sequential from keras.layers import Dense, Flatten, LSTM, Conv1D, MaxPooling1D, Dropout, Activation from keras.layers.embeddings import Embedding...
Sang555/Multimodal-disaster-analysis
CODE/Text_training_module.py
Text_training_module.py
py
2,674
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "keras.preprocessing.text.Tokenizer", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.asarray", "line_number": 38, "usage_type": "call" }, { "api_name": "nump...
16241233028
from rest_framework.permissions import ( DjangoModelPermissions, BasePermission, IsAdminUser, SAFE_METHODS) class IsProfileOwnerOrReadOnly(BasePermission): def has_object_permission(self, request, view, obj): print(obj) if request.method in SAFE_METHODS: return True retur...
Axubyy/ATS
Backend/week_8/MiniBlog/blog/api/permissions.py
permissions.py
py
833
python
en
code
0
github-code
1
[ { "api_name": "rest_framework.permissions.BasePermission", "line_number": 5, "usage_type": "name" }, { "api_name": "rest_framework.permissions.SAFE_METHODS", "line_number": 9, "usage_type": "name" }, { "api_name": "rest_framework.permissions.BasePermission", "line_number": 15...
39818017608
#!/usr/bin/env python3 import json import requests import subprocess session = requests.Session() proc = subprocess.run(['git', 'for-each-ref', '--format=%(refname:lstrip=3)', 'refs/remotes/origin/??????????????????????????????????'], stdout=subprocess.PIPE, check=True, ) to_delete = [] for branch in proc.stdo...
HsiangHo/macOS
.github/clean.py
clean.py
py
882
python
en
code
0
github-code
1
[ { "api_name": "requests.Session", "line_number": 6, "usage_type": "call" }, { "api_name": "subprocess.run", "line_number": 7, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 8, "usage_type": "attribute" }, { "api_name": "json.loads", "l...
14477324527
from django import forms from .models import Image from urllib import request from django.core.files.base import ContentFile from django.utils.text import slugify class ImageCreateForm(forms.ModelForm): class Meta: model = Image fields = ('title','url','description') #我们的用户不会在表单中直接为图片添加 UR...
aangang/bookmarks
bookmarks/images/forms.py
forms.py
py
2,247
python
zh
code
0
github-code
1
[ { "api_name": "django.forms.ModelForm", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 8, "usage_type": "name" }, { "api_name": "models.Image", "line_number": 10, "usage_type": "name" }, { "api_name": "django.forms.Hidd...
21703164964
# Author: Abdulaminkhon Khaydarov # Date: 06/11/22 # Problem URL: https://leetcode.com/problems/running-sum-of-1d-array/ from typing import List class Solution: def runningSum(self, nums: List[int]) -> List[int]: for i in range(1, len(nums)): nums[i] = nums[i] + nums[i - 1] return nu...
webdastur/leetcode
array/easy/leetcode1480_1.py
leetcode1480_1.py
py
628
python
en
code
7
github-code
1
[ { "api_name": "typing.List", "line_number": 9, "usage_type": "name" } ]
24856926246
# -*-coding:utf-8 -*- import numpy as np from sklearn.ensemble import AdaBoostClassifier from sklearn.tree import DecisionTreeClassifier """ Author: Jack Cui Blog: http://blog.csdn.net/c406495762 Zhihu: https://www.zhihu.com/people/Jack--Cui/ Modify: 2017-10-11 """ def loadDataSet(fileName): numFeat = len(...
Jack-Cherish/Machine-Learning
AdaBoost/sklearn_adaboost.py
sklearn_adaboost.py
py
1,320
python
en
code
8,026
github-code
1
[ { "api_name": "sklearn.ensemble.AdaBoostClassifier", "line_number": 34, "usage_type": "call" }, { "api_name": "sklearn.tree.DecisionTreeClassifier", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.mat", "line_number": 37, "usage_type": "call" }, { ...
39099255085
import queue from threading import Thread import numpy as np from transformers import * from openie import StanfordOpenIE from utility.utility import * #from bert_serving.client import BertClient from rouge import Rouge from stanfordcorenlp import StanfordCoreNLP import pickle from data.raw_data_loader import...
RuifengYuan/FactExsum-coling2020
make_data.py
make_data.py
py
18,770
python
en
code
17
github-code
1
[ { "api_name": "threading.Lock", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 128, "usage_type": "call" }, { "api_name": "numpy.float16", "line_number": 128, "usage_type": "attribute" }, { "api_name": "numpy.zeros", "li...
36629116758
"""Возьмите любую из задач с прошлых семинаров (например сериализация данных), которые вы уже решали. Превратите функции в методы класса, а параметры в свойства. Задачи должны решаться через вызов методов экземпляра.""" import csv import json class SaveToCsv: def __init__(self, input_file_name, output_file_name):...
Pisarev82/Immersion_in_Python
sem_10/hw_10_2.py
hw_10_2.py
py
1,252
python
ru
code
0
github-code
1
[ { "api_name": "json.load", "line_number": 16, "usage_type": "call" }, { "api_name": "csv.writer", "line_number": 21, "usage_type": "call" } ]
6953564000
from django.http import HttpResponseRedirect, HttpResponse from django.core.mail import send_mail from django.shortcuts import render from contacto.forms import FormularioContactos from django.template import loader # Create your views here. def contactos(request): #form=FormularioContactos() if request.metho...
JokerBerlin/python
contacto/views.py
views.py
py
983
python
en
code
0
github-code
1
[ { "api_name": "contacto.forms.FormularioContactos", "line_number": 12, "usage_type": "call" }, { "api_name": "django.core.mail.send_mail", "line_number": 15, "usage_type": "call" }, { "api_name": "django.http.HttpResponseRedirect", "line_number": 20, "usage_type": "call" ...
43758862321
# -*- coding: utf-8 -*- # file: __init__.py # date: 2021-07-20 import os import _io import json import logging import time import datetime import pyspark import pyspark.sql from typing import Any, Union, Dict, List, Tuple from ... import pysparkit LOGGER: logging.Logger = pysparkit.get_logger(__name__, level=loggi...
innerNULL/pysparkit
pysparkit/io/__init__.py
__init__.py
py
5,878
python
en
code
0
github-code
1
[ { "api_name": "logging.Logger", "line_number": 19, "usage_type": "attribute" }, { "api_name": "logging.INFO", "line_number": 19, "usage_type": "attribute" }, { "api_name": "typing.Dict", "line_number": 24, "usage_type": "name" }, { "api_name": "_io.TextIOWrapper",...
36038909243
import collections def calcEquation(equations, values, queries): """ :type equations: List[List[str]] :type values: List[float] :type queries: List[List[str]] :rtype: List[float] """ record = collections.defaultdict(lambda: collections.defaultdict(int)) for (var1, var2), v in zip(equatio...
zhaoxy92/leetcode
399_evaluate_division.py
399_evaluate_division.py
py
1,024
python
en
code
0
github-code
1
[ { "api_name": "collections.defaultdict", "line_number": 9, "usage_type": "call" } ]
11468083578
from io import StringIO from django.core.management import call_command from django.core.management.base import CommandError from django.test import TestCase from geostore.models import Layer from geostore.tests.factories import LayerFactory from geostore.tests.utils import get_files_tests class ImportGeojsonTest(T...
Terralego/django-geostore
geostore/tests/test_commands/test_import_geojson.py
test_import_geojson.py
py
3,126
python
en
code
21
github-code
1
[ { "api_name": "django.test.TestCase", "line_number": 12, "usage_type": "name" }, { "api_name": "io.StringIO", "line_number": 14, "usage_type": "call" }, { "api_name": "django.core.management.call_command", "line_number": 15, "usage_type": "call" }, { "api_name": "...
36427243193
""" 318. Maximum Product of Word Lengths Medium 514 47 Favorite Share Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. You may assume that each word will contain only lower case letters. If no such two words exist, re...
fengyang95/OJ
LeetCode/python3/318_MaximumProductOfWordLengths.py
318_MaximumProductOfWordLengths.py
py
2,324
python
en
code
2
github-code
1
[ { "api_name": "collections.defaultdict", "line_number": 37, "usage_type": "call" } ]
26524777453
#Dependencies from relu import relu from convolutional_mlp import LeNetConvPoolLayer from logistic_sgd import LogisticRegression from mlp import HiddenLayer from dropout import dropout_neurons_from_layer from theano.tensor.signal import downsample from theano.tensor.nnet import conv import theano class RetinopathyNet(...
rocket-raccoon/DiabeticRetinopathyDetection
retinopathy_net.py
retinopathy_net.py
py
2,958
python
en
code
0
github-code
1
[ { "api_name": "dropout.dropout_neurons_from_layer", "line_number": 24, "usage_type": "call" }, { "api_name": "convolutional_mlp.LeNetConvPoolLayer", "line_number": 26, "usage_type": "call" }, { "api_name": "dropout.dropout_neurons_from_layer", "line_number": 33, "usage_ty...
11040136855
from common.FrontendTexts import FrontendTexts view_texts = FrontendTexts('materials') labels = view_texts.getComponent()['selector']['choices'] ACTION_CHOICES = ( (1, labels['edit']), (2, labels['weight']) ) UNIT_CHOICES = ( (1, "M"), (2, "M2"), (3, "M3"), (4, "EA") )
Conpancol/PyHeroku
CPFrontend/materials/choices.py
choices.py
py
297
python
en
code
0
github-code
1
[ { "api_name": "common.FrontendTexts.FrontendTexts", "line_number": 3, "usage_type": "call" } ]
24709845293
from typing import List DISTANCE_END = 5 def determine_place(n: int, distance_list: List[int]) -> int: """ Функция которая определяет, максимально высокое место участника. :param n: длинна входного списка с расстояниями бросков участников :type n: int :param distance_list: список с расстояниями ...
OkhotnikovFN/Yandex-Algorithms
trainings_1.0/hw_2/task_e/e.py
e.py
py
1,780
python
ru
code
1
github-code
1
[ { "api_name": "typing.List", "line_number": 6, "usage_type": "name" } ]
73582152353
import scrapy from ..items import TutorialItem class QuoteSpider(scrapy.Spider): name = 'quote' pageNumber = 2 # def start_requests(self): start_urls = [ 'http://quotes.toscrape.com/page/1/' # 'http://quotes.toscrape.com/page/1/', # 'http://quotes.toscrape.com/page/2/', ] ...
Ankitdeveloper15/python
Boring Stuff/Scrapy/tutorial/tutorial/spiders/quotes_spider.py
quotes_spider.py
py
1,393
python
en
code
0
github-code
1
[ { "api_name": "scrapy.Spider", "line_number": 5, "usage_type": "attribute" }, { "api_name": "items.TutorialItem", "line_number": 19, "usage_type": "call" } ]
30997752571
from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask import request from flask_migrate import Migrate app = Flask(__name__) app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False app.config['SQLALCHEMY_DATABASE_URI'] = "postgresql://postgres:password@localhost:5432/FlaskDB" db = SQLAlchemy(app) mig...
Agasiland/FlaskService
app.py
app.py
py
2,360
python
en
code
0
github-code
1
[ { "api_name": "flask.Flask", "line_number": 6, "usage_type": "call" }, { "api_name": "flask_sqlalchemy.SQLAlchemy", "line_number": 9, "usage_type": "call" }, { "api_name": "flask_migrate.Migrate", "line_number": 10, "usage_type": "call" }, { "api_name": "flask.req...
1370447652
import datetime from django.core import serializers from django.shortcuts import render from django.http import HttpResponse,JsonResponse from weather.models import * # Create your views here. def weather(request, location): location = location.split(',')[-1] index = request.GET.get('index') ...
BruceDGit/HexuWeather
Server/weather_server/weather/views.py
views.py
py
8,222
python
en
code
3
github-code
1
[ { "api_name": "datetime.datetime.now", "line_number": 24, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 24, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 31, "usage_type": "call" }, { "api_name": "da...
32466005602
import random from colorama import init, Fore, Back, Style from checker import check_wordle def text_edit(guess, result, alphabet): editted_text = [] def _letter_paint(letter, color): letter_painted = '' if color=='Green': letter_painted = Back.GREEN + letter.upper() elif color=='Yellow': ...
ivlmag/simple_wordle_clone
console_wordle.py
console_wordle.py
py
2,396
python
en
code
0
github-code
1
[ { "api_name": "colorama.Back.GREEN", "line_number": 12, "usage_type": "attribute" }, { "api_name": "colorama.Back", "line_number": 12, "usage_type": "name" }, { "api_name": "colorama.Back.YELLOW", "line_number": 14, "usage_type": "attribute" }, { "api_name": "colo...
10669863739
import gspread import copy service_account = gspread.service_account('data/~service-account.json') sheet = service_account.open("Mapout3.0") scenario_sheet = sheet.worksheet("SCENARIO") cover_sheet = sheet.worksheet("COVER") sheet_rows = scenario_sheet.get_all_values() times = snow_accu = sleet_accu = frzg_accu = tot...
weathermandgtl/display_grid
data/melt_slr.py
melt_slr.py
py
5,403
python
en
code
0
github-code
1
[ { "api_name": "gspread.service_account", "line_number": 4, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 71, "usage_type": "call" } ]
31588107873
import dataclasses import json import logging import re import sys import urllib.parse from dataclasses import dataclass from pathlib import Path from typing import Dict, Set, List, Union from para_tranz.utils.config import PROJECT_DIRECTORY, ORIGINAL_PATH, TRANSLATION_PATH, PARA_TRANZ_PATH, LOG_LEVEL, \ LOG_DEBUG...
TruthOriginem/Starsector-096-Localization
para_tranz/utils/util.py
util.py
py
8,353
python
en
code
21
github-code
1
[ { "api_name": "pathlib.Path", "line_number": 15, "usage_type": "name" }, { "api_name": "para_tranz.utils.config.PROJECT_DIRECTORY", "line_number": 17, "usage_type": "argument" }, { "api_name": "logging.Formatter", "line_number": 22, "usage_type": "attribute" }, { ...
21104357591
# -*- coding: utf-8 -*- # This program ensures that the last lines in a set of OBS markdown files are italicized. import re # regular expression module import io import os import string import sys import shutil # Globals source_dir = r'C:\DCS\Russian\ru_obs.STR\content' # Inserts underscores at beginning and e...
unfoldingWord-dev/tools
md/obs_italicize_last_line.py
obs_italicize_last_line.py
py
2,684
python
en
code
8
github-code
1
[ { "api_name": "io.open", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 46, "usage_type": "call" }, { "api_name": "os.path", "line_number": 46, "usage_type": "attribute" }, { "api_name": "os.rename", "line_number": 47...
6034178664
from typing import List, MutableMapping """ Summary: The trick is - the problem is the duplicate of the original except for if you steal from the first house, you can't steal from the last. So, 2 cases: stole from the first or not. Then, the problem is identical to the original one ___________________________________...
EvgeniiTitov/coding-practice
coding_practice/sample_problems/leet_code/medium/greedy-dynamic-backtracking/213_house_robber_2.py
213_house_robber_2.py
py
3,911
python
en
code
1
github-code
1
[ { "api_name": "typing.List", "line_number": 44, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 47, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 71, "usage_type": "name" }, { "api_name": "typing.MutableMapping", "line...
71006897315
import xarray as xr import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl import cartopy.crs as ccrs import cartopy.io.shapereader as shpreader from cartopy.feature import ShapelyFeature import cartopy.feature as cfeature from cartopy.mpl.ticker import LongitudeFormatter, Latit...
pkmn99/dryland_moisture
code/plot_china_dryland_source.py
plot_china_dryland_source.py
py
2,696
python
en
code
0
github-code
1
[ { "api_name": "cartopy.crs.PlateCarree", "line_number": 14, "usage_type": "call" }, { "api_name": "cartopy.crs", "line_number": 14, "usage_type": "name" }, { "api_name": "cartopy.mpl.ticker.LongitudeFormatter", "line_number": 15, "usage_type": "call" }, { "api_nam...
41060910588
import json import os import re import sys import gzip import math import hashlib import logging import portalocker from collections import defaultdict from typing import List, Optional, Sequence, Dict from argparse import Namespace from tabulate import tabulate import colorama # Where to store downloaded test sets....
mjpost/sacrebleu
sacrebleu/utils.py
utils.py
py
22,550
python
en
code
896
github-code
1
[ { "api_name": "os.path.expanduser", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path", "line_number": 24, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 25, "usage_type": "call" }, { "api_name": "os.environ", "line...
1986352570
from ctypes import alignment from tkinter import * from tkinter import messagebox as mb import json #Class for GUI components class Assessment(object): def __init__(self, database_filename, gui): #Snag data with open(database_filename) as f: data = json.load(f) se...
ChHarding/grit-scale-HCI584
grit-scale_CH.py
grit-scale_CH.py
py
7,484
python
en
code
null
github-code
1
[ { "api_name": "json.load", "line_number": 14, "usage_type": "call" }, { "api_name": "tkinter.messagebox.showinfo", "line_number": 102, "usage_type": "call" }, { "api_name": "tkinter.messagebox", "line_number": 102, "usage_type": "name" }, { "api_name": "tkinter.me...
32195531566
import sys import os.path from cStringIO import StringIO from mapnik import * from django.conf import settings import PIL.Image from ebgeo.maps import bins from ebgeo.maps.constants import TILE_SIZE def xml_path(maptype): path = os.path.join(sys.prefix, 'mapnik', '%s.xml' % maptype) return path def get_mapser...
brosner/everyblock_code
ebgeo/ebgeo/maps/mapserver.py
mapserver.py
py
7,489
python
en
code
130
github-code
1
[ { "api_name": "os.path.path.join", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "os.path", "line_number": 11, "usage_type": "name" }, { "api_name": "sys.prefix", "line_nu...
23051885140
import tensorflow as tf import numpy as np import os import argparse import math from model import GridCell from custom_ops import block_diagonal from data_io import Data_Generator from matplotlib import pyplot as plt from utils import draw_heatmap_2D, draw_path_to_target, draw_path_to_target_gif import itertools cla...
ruiqigao/GridCell
path_planning.py
path_planning.py
py
16,048
python
en
code
18
github-code
1
[ { "api_name": "tensorflow.placeholder", "line_number": 18, "usage_type": "call" }, { "api_name": "tensorflow.float32", "line_number": 18, "usage_type": "attribute" }, { "api_name": "tensorflow.placeholder", "line_number": 19, "usage_type": "call" }, { "api_name": ...
39633978744
import pygame # 1. pygame 선언 import random pygame.init() # 2. pygame 초기화 # 3. pygame에 사용되는 전역변수 선언 BLACK = (0, 0, 0) size = [600, 800] screen = pygame.display.set_mode(size) done = False clock = pygame.time.Clock() # 4. pygame 무한루프 def runGame(): global done while not done: clock.tick(10) s...
kyungkkk/week9
game2.py
game2.py
py
1,222
python
en
code
0
github-code
1
[ { "api_name": "pygame.init", "line_number": 4, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_number": 10, "usage_type": "call" }, { "api_name": "pygame.display", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pygame.time.Cl...
1633661385
from collections import deque from fuzzywuzzy import fuzz from datasets.fuman_base import load_fuman_rant dataset = load_fuman_rant('data/20151023/bad-rants-4189.csv') duplicates = set() deduped = list() n_elements = len(dataset.data) rant_indexes = deque([i for i in range(n_elements)]) while rant_indexes: i = r...
dumoulma/py-evalfilter
src/deduplicate_rants.py
deduplicate_rants.py
py
1,055
python
en
code
0
github-code
1
[ { "api_name": "datasets.fuman_base.load_fuman_rant", "line_number": 7, "usage_type": "call" }, { "api_name": "collections.deque", "line_number": 11, "usage_type": "call" }, { "api_name": "fuzzywuzzy.fuzz.ratio", "line_number": 17, "usage_type": "call" }, { "api_na...
14749681743
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Aug 8 22:57:54 2019 @author: weichi """ import datetime as dt from datetime import datetime import pytz import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn import linear_model, metrics, model_selection from sklearn.model...
WeichiChen1210/PM2.5-Prediction
pm2.5_prediction.py
pm2.5_prediction.py
py
3,991
python
en
code
0
github-code
1
[ { "api_name": "pytz.timezone", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 22, "usage_type": "attribute" }, { "api_name": "datet...
9338192510
import dash import dash_core_components as dcc import dash_html_components as html import json import pandas as pd import numpy as np import matplotlib.pyplot as plt import plotly.express as px import plotly.graph_objs as go from urllib.request import urlopen import plotly.io as pio from sklearn.linear_model import Lin...
johnli25/uscoronavirusinfo
us_states_per_capita.py
us_states_per_capita.py
py
3,428
python
en
code
0
github-code
1
[ { "api_name": "plotly.io.renderers", "line_number": 16, "usage_type": "attribute" }, { "api_name": "plotly.io", "line_number": 16, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 18, "usage_type": "call" }, { "api_name": "pandas.DataFrame",...
4038397722
# TASK - 1 # A To-Do List application is a useful project that helps users manage and organize their tasks efficiently. # This project aims to create a command-line or GUI-based application using Python, allowing users to create, update, # and track their to-do lists. from tkinter import * import tkinter.messagebox as...
KaustabRoy/CODSOFT
Task1-ToDoListManager/main.py
main.py
py
17,100
python
en
code
0
github-code
1
[ { "api_name": "termcolor.colored", "line_number": 18, "usage_type": "call" }, { "api_name": "termcolor.colored", "line_number": 21, "usage_type": "call" }, { "api_name": "os.rename", "line_number": 189, "usage_type": "call" }, { "api_name": "os.remove", "line_...
42703895429
# Import Required Libraries from tkinter import * from tkinter import messagebox from tkinter import filedialog import cv2 import numpy as np import os import sys import tensorflow as tf from matplotlib import pyplot as plt from PIL import Image,ImageTk num_classes = 3 pb_fname = '/home/ubuntu/content/models/resea...
13020363/Deep-Learning
Assignments/A3/GUI_v2.py
GUI_v2.py
py
8,872
python
en
code
0
github-code
1
[ { "api_name": "PIL.Image.open", "line_number": 34, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 34, "usage_type": "name" }, { "api_name": "PIL.ImageTk.PhotoImage", "line_number": 35, "usage_type": "call" }, { "api_name": "PIL.ImageTk", "li...
31416846331
import zipfile dest_dir = "Bonusfiles/Bonusfiles/files" def extract_archive(archive_path, dest_dir): with zipfile.ZipFile(archive_path, 'r') as archive: archive.extractall(dest_dir) if __name__ == "__main__": extract_archive("Bonusfiles/compressed.zip", dest_dir)
manzitlo/Zip_CreateAndExtract
zip_extractor.py
zip_extractor.py
py
285
python
en
code
0
github-code
1
[ { "api_name": "zipfile.ZipFile", "line_number": 7, "usage_type": "call" } ]
38928738675
from django import forms from ckeditor.widgets import CKEditorWidget from .models import UserProfile class UserProfileForm(forms.ModelForm): # It is valid to explicitly instantiate a form field that has a # corresponding model field, but such a field will not take any of the # defaults from the model ...
Crossroadsman/treehouse-techdegree-python-project7
accounts/forms.py
forms.py
py
1,336
python
en
code
0
github-code
1
[ { "api_name": "django.forms.ModelForm", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 7, "usage_type": "name" }, { "api_name": "django.forms.DateField", "line_number": 11, "usage_type": "call" }, { "api_name": "django....
14503858692
from django.forms import Form, IntegerField, TextInput, CharField, ModelForm, Textarea from .models import Feedback class Calculator(Form): width = IntegerField(min_value=1, widget=TextInput( attrs={ 'class': 'form-control', 'type': 'number', 'placeholder': 'Введите шир...
Skywalker-69/python_django_belhard
catalogue/forms.py
forms.py
py
2,291
python
en
code
0
github-code
1
[ { "api_name": "django.forms.Form", "line_number": 5, "usage_type": "name" }, { "api_name": "django.forms.IntegerField", "line_number": 6, "usage_type": "call" }, { "api_name": "django.forms.TextInput", "line_number": 6, "usage_type": "call" }, { "api_name": "djang...
10180003978
import os import requests import shutil ################# # PREPARE FILES # ################# source_dir = os.path.dirname(os.path.realpath(__file__)) md_file = os.path.join(source_dir, 'project.md') ################## # PARSE MARKDOWN # ################## with open(md_file, 'r') as f: md = f.read() ##############...
Acrop146/Test
project-description/render-site.py
render-site.py
py
1,393
python
en
code
0
github-code
1
[ { "api_name": "os.path.dirname", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 8, "usage_type": "call" }, { "api_name": "os.path.join", "line_n...
73591823713
#! /usr/bin/env python # Import ROS. import rospy # Import the API. from iq_gnc.py_gnc_functions import * # To print colours (optional). from iq_gnc.PrintColours import * # Import 3D Plotting Library import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D # Import Kalman Filter Library from pykalman imp...
khulqu15/smc_drone
ros_smc_kf/scripts/square.py
square.py
py
5,474
python
en
code
1
github-code
1
[ { "api_name": "numpy.eye", "line_number": 21, "usage_type": "call" }, { "api_name": "numpy.eye", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.zeros", "line_number": 30, "usage_type": "call" }, { "api_name": "pykalman.KalmanFilter", "line_num...
42296024184
import random from itertools import starmap, cycle class PacketState: def __init__(self, seq_no, status, is_final, data): self.seq_no = seq_no self.status = status self.data = data self.packet = PacketState.make_pkt(data, seq_no, is_final) @staticmethod def make_pkt(data, ...
TarekAlQaddy/reliable-data-transfer-server
Helpers.py
Helpers.py
py
2,829
python
en
code
0
github-code
1
[ { "api_name": "random.random", "line_number": 50, "usage_type": "call" }, { "api_name": "itertools.starmap", "line_number": 61, "usage_type": "call" }, { "api_name": "itertools.cycle", "line_number": 61, "usage_type": "call" } ]
23131275206
""" Databricks - Terminate Cluster User Inputs: - Authentication - Cluster ID - terminates a single cluster. """ import argparse import sys import shipyard_utils as shipyard try: import errors from helpers import DatabricksClient except BaseException: from . import errors def get_args(): parser = ar...
shipyardapp/databricks-blueprints
databricks_blueprints/terminate_cluster.py
terminate_cluster.py
py
3,593
python
en
code
0
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 20, "usage_type": "call" }, { "api_name": "shipyard_utils.logs.determine_base_artifact_folder", "line_number": 38, "usage_type": "call" }, { "api_name": "shipyard_utils.logs", "line_number": 38, "usage_type": "attrib...
12712332139
import os try: import busio import armachat_lora import aesio except ImportError: pass from collections import namedtuple import time import struct import binascii import minipb MeshtasticData = minipb.Wire([ ("portnum", "t"), ("payload", "a"), ("want_response", "b"), ("dest", "I"), ...
rosmo/armassi
armassi/lib/comms.py
comms.py
py
7,772
python
en
code
0
github-code
1
[ { "api_name": "minipb.Wire", "line_number": 16, "usage_type": "call" }, { "api_name": "minipb.Wire", "line_number": 27, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 60, "usage_type": "call" }, { "api_name": "busio.SPI", "line_...
31799853905
import cv2 import mercantile from shapely.geometry import Polygon, MultiPolygon, mapping from toolz import curry, pipe from toolz.curried import * import numpy as np from abfs.api.prediction.image import ImagePrediction BASE_URL = 'https://api.mapbox.com/v4/mapbox.satellite' class LatLongPrediction(): def __init...
rcdilorenzo/abfs
abfs/api/prediction/lat_long.py
lat_long.py
py
2,544
python
en
code
8
github-code
1
[ { "api_name": "mercantile.tile", "line_number": 17, "usage_type": "call" }, { "api_name": "abfs.api.prediction.image.ImagePrediction", "line_number": 25, "usage_type": "call" }, { "api_name": "abfs.api.prediction.image.ImagePrediction", "line_number": 29, "usage_type": "c...
12090767387
import requests from bs4 import BeautifulSoup as bs import json import os import time #This URL will be the URL that your login form points to with the "action" tag. POSTLOGINURL = 'https://www.hackerrank.com/auth/login' LOGINREST = "https://www.hackerrank.com/rest/auth/login" #This URL is the page you actually want t...
moamen-ahmed-93/hackerrank_sol
hackerrank_scrapper/hackerrank.py
hackerrank.py
py
3,629
python
en
code
6
github-code
1
[ { "api_name": "requests.Session", "line_number": 16, "usage_type": "call" }, { "api_name": "requests.utils.default_headers", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.utils", "line_number": 17, "usage_type": "attribute" }, { "api_name": "b...
38989140015
import random import torch import os import pandas as pd from pathlib import Path import torch.utils.data as data from torch.utils.data import dataloader class CamelData(data.Dataset): def __init__(self, dataset_cfg=None, state=None): # Set all input args as attributes self.__dict__.update(locals...
ptoyip/6211H_Final
code/baseline_model/datasets/camel_data.py
camel_data.py
py
3,369
python
en
code
0
github-code
1
[ { "api_name": "torch.utils.data.Dataset", "line_number": 11, "usage_type": "attribute" }, { "api_name": "torch.utils.data", "line_number": 11, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 22, "usage_type": "call" }, { "api_name": "pathli...
73938024675
''' Created on 25 abr. 2020 @author: jesus.fernandez ''' from common.SQLUtil import SQLUtil class EmpleoINEProcessor(object): ''' classdocs ''' def __init__(self, spark, sc, sql): ''' Constructor ''' self.spark = spark self.sc = s...
jfernandezrodriguez01234/TFM_jfernandezrodriguez01234
src/processors/social/EmpleoINEProcessor.py
EmpleoINEProcessor.py
py
1,261
python
es
code
0
github-code
1
[ { "api_name": "common.SQLUtil.SQLUtil.writeSparkDf", "line_number": 43, "usage_type": "call" }, { "api_name": "common.SQLUtil.SQLUtil", "line_number": 43, "usage_type": "name" } ]
25058904996
import pygame class Player (object): inititalJumpSpeed=30 jumpSpeed=30 jumping=False gravity=2 initialFallSpeed=0 fallSpeed=0 falling=True spriteName="./Run1.png" spriteNum=0 sprite=pygame.image.load("./Run1.png"); sprite=pygame.transform.scale(sprite,(50,...
SlothDemon42/htne_game
v0.1/HTNE_Game.py
HTNE_Game.py
py
8,075
python
en
code
1
github-code
1
[ { "api_name": "pygame.image.load", "line_number": 16, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pygame.transform.scale", "line_number": 17, "usage_type": "call" }, { "api_name": "pygame.tra...
34166720448
#!/usr/bin/python3 import yaml, sys import numpy as np import matplotlib.pyplot as plt import glob import os import math from matplotlib.colors import LogNorm from scipy.interpolate import griddata from io import StringIO filename = sys.argv[1] f = '%s.yaml' % (filename) # Read YAML file with open(f, 'r') as stre...
droundy/sad-monte-carlo
plotting/grand2d.py
grand2d.py
py
4,441
python
en
code
4
github-code
1
[ { "api_name": "sys.argv", "line_number": 15, "usage_type": "attribute" }, { "api_name": "yaml.load", "line_number": 21, "usage_type": "call" }, { "api_name": "glob.iglob", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number":...
89310945
# -*- coding: utf-8 -*- from collections import namedtuple GENERIC_DICT = 'GenericDict' def __convert(obj): if isinstance(obj, dict): for key, value in obj.iteritems(): obj[key] = __convert(value) return namedtuple(GENERIC_DICT, obj.keys())(**obj) elif isinstance(obj, list): ...
tech-sketch/fiware-ros-turtlesim
src/fiware_ros_turtlesim/params.py
params.py
py
777
python
en
code
1
github-code
1
[ { "api_name": "collections.namedtuple", "line_number": 11, "usage_type": "call" } ]
11212571235
import subprocess from num2words import num2words def say(number: int) -> str: """ Say the number in words :param number: int :return: sentence: str """ if 0 <= number < 1000000000000: sentence = num2words(number).split() for index, word in enumerate(sentence): ...
stimpie007/exercism
python/say/say.py
say.py
py
831
python
en
code
0
github-code
1
[ { "api_name": "num2words.num2words", "line_number": 17, "usage_type": "call" }, { "api_name": "subprocess.run", "line_number": 25, "usage_type": "call" } ]
5895415014
import pandas as pd import matplotlib.pyplot as plt import Utils as utils from operator import itemgetter # reading data #da = utils.combine_data() da = pd.read_csv('rawdata/heathrowRawData.csv') class knn: def __init__(self, *args, **kw): pd.set_option('display.max_rows', 2000) plt.rcParams['fi...
omarali0703/MachineLearning
kNN.py
kNN.py
py
2,412
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 8, "usage_type": "call" }, { "api_name": "pandas.set_option", "line_number": 13, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.rcParams", "line_number": 14, "usage_type": "attribute" }, { "api_name": "matp...
12753959980
import matplotlib.pyplot as plt import autograd.numpy as np import autograd.numpy.random as npr import autograd.scipy.stats.multivariate_normal as mvn import autograd.scipy.stats.norm as norm import sys sys.path.append('..') from bbvi import BaseBBVIModel """ This implements the example in http://www.cs.toronto.edu/...
jamesvuc/BBVI
Examples/BBVI_test2.py
BBVI_test2.py
py
2,606
python
en
code
8
github-code
1
[ { "api_name": "sys.path.append", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "bbvi.BaseBBVIModel", "line_number": 18, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.subp...
34214470629
import logging import modules.net as model_arch from torch.utils.data.dataloader import default_collate from tqdm import tqdm import torch import torch.nn as nn class Predictor(): def __init__(self, batch_size=64, max_epochs=100, valid=None, labelEncoder=None, device=None, metric=None, learning_rate=1...
hsinlichu/Customer-Service-Data-Analysis-with-Machine-Learning-Technique
src/mypredictor.py
mypredictor.py
py
6,299
python
en
code
1
github-code
1
[ { "api_name": "torch.device", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.cuda", "l...
74736955554
import os import sys import warnings from decouple import config BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) if BASE_DIR not in sys.path: sys.path.append(BASE_DIR) STORAGE_DIR = os.path.join(BASE_DIR, 'storage') RUN_DIR = os.path.join(STORAGE_DIR, 'run') MSD_DIR = os.path.join(STORAGE_...
bpptkg/bulletin
wo/settings.py
settings.py
py
3,089
python
en
code
1
github-code
1
[ { "api_name": "os.path.dirname", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.path", "line_number...
15533905597
# A very simple Bottle Hello World app for you to get started with... from bottle import route, run, template, default_app import json import get_stream @route("/") @route("/index") def index(): data = get_stream.get_stream_data() #print(data) return template(""" <b> An example weather ...
smahagos/WeatherData
mysite/bottle_app.py
bottle_app.py
py
1,680
python
en
code
0
github-code
1
[ { "api_name": "get_stream.get_stream_data", "line_number": 13, "usage_type": "call" }, { "api_name": "bottle.template", "line_number": 15, "usage_type": "call" }, { "api_name": "bottle.route", "line_number": 10, "usage_type": "call" }, { "api_name": "bottle.route"...
30689755641
#################################################################################### # Estimator Models # Contains different estimators # Each Estimator Contains: # -A set of required conditional distributions (nuisance parameters) that must be trained # -The set of parameters that are shared between nuisance param...
weberna/causalchains
causalchains/models/estimator_model.py
estimator_model.py
py
10,710
python
en
code
6
github-code
1
[ { "api_name": "torch.nn.Module", "line_number": 26, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 26, "usage_type": "name" }, { "api_name": "causalchains.utils.data_utils.PAD_TOK", "line_number": 40, "usage_type": "name" }, { "api_name": "c...
25008123076
from Net import Net import torch import torch.nn as nn import torch.optim as optim from typing import List from pathlib import Path import os class ModelTrainEval: def __init__(self): self.net = Net() self.criterion = nn.MSELoss() self.optimizer = optim.Adam(self.net.parameters(), lr=0.00...
paddywardle/Computational_Chemistry_Data_Engineering_Project
main/Models/ModelTrainEval.py
ModelTrainEval.py
py
2,392
python
en
code
1
github-code
1
[ { "api_name": "Net.Net", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.nn.MSELoss", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 14, "usage_type": "name" }, { "api_name": "torch.optim.Adam", "line_number...
4062540397
# Pandigital products # Problem 32 # We shall say that an n-digit number is pandigital if it makes use of all the digits 1 to n exactly once; for example, # the 5-digit number, 15234, is 1 through 5 pandigital. # The product 7254 is unusual, as the identity, 39 × 186 = 7254, containing multiplicand, multiplier, and ...
IgorKon/ProjectEuler
032.py
032.py
py
2,843
python
en
code
0
github-code
1
[ { "api_name": "re.findall", "line_number": 18, "usage_type": "call" }, { "api_name": "re.findall", "line_number": 31, "usage_type": "call" }, { "api_name": "datetime.datetime.now", "line_number": 41, "usage_type": "call" }, { "api_name": "datetime.datetime", "...
19105383629
import os import json import pandas as pd from aideme.explore import ExplorationManager, PartitionedDataset from aideme.active_learning import KernelVersionSpace from aideme.active_learning.dsm import FactorizedDualSpaceModel from aideme.initial_sampling import random_sampler import src.routes.points from src.route...
AIDEmeProject/AIDEme
api/tests/routes/test_points.py
test_points.py
py
4,014
python
en
code
0
github-code
1
[ { "api_name": "os.path.join", "line_number": 30, "usage_type": "call" }, { "api_name": "os.path", "line_number": 30, "usage_type": "attribute" }, { "api_name": "src.routes.endpoints.INITIAL_UNLABELED_POINTS", "line_number": 40, "usage_type": "argument" }, { "api_n...
21415819246
import statistics import random import pandas as pd import plotly_express as px import plotly.figure_factory as ff import plotly.graph_objects as go file1 = pd.read_csv('data.csv') data = df['reading_time'].tolist() dataset = [] def randomdata(): for i in range(0,100): index = random.randint(0,(len(data...
SaanviSinha/Project-110
program.py
program.py
py
1,003
python
en
code
0
github-code
1
[ { "api_name": "pandas.read_csv", "line_number": 9, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 15, "usage_type": "call" }, { "api_name": "statistics.mean", "line_number": 18, "usage_type": "call" }, { "api_name": "statistics.mean", "...
75224693472
from data import * from models import * import argparse import os import pickle parser = argparse.ArgumentParser(description='NLI training') parser.add_argument("--data_path", type=str, default='./data', help="path to data") # model parser.add_argument("--encoder_type", type=str, default='GRUEncoder', help="see lis...
tingchunyeh/Sentence-Sim
train.py
train.py
py
7,510
python
en
code
0
github-code
1
[ { "api_name": "argparse.ArgumentParser", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 73, "usage_type": "call" }, { "api_name": "os.path", "line_number": 73, "usage_type": "attribute" }, { "api_name": "torch.optim.Adam", ...
8272807423
# MAGIC CODEFORCES PYTHON FAST IO import atexit import io import sys _INPUT_LINES = sys.stdin.read().splitlines() input = iter(_INPUT_LINES).__next__ _OUTPUT_BUFFER = io.StringIO() sys.stdout = _OUTPUT_BUFFER @atexit.register def write(): sys.__stdout__.write(_OUTPUT_BUFFER.getvalue()) # END OF MAGIC CODEFORCES P...
elsantodel90/cses-problemset
food_division.py
food_division.py
py
644
python
en
code
0
github-code
1
[ { "api_name": "sys.stdin.read", "line_number": 6, "usage_type": "call" }, { "api_name": "sys.stdin", "line_number": 6, "usage_type": "attribute" }, { "api_name": "io.StringIO", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.stdout", "line_number"...
36343414639
# -*- coding: utf-8 -*- import pymysql from learn_pymysql.test_api.mysql_api import MysqlClient from learn_pymysql.test_api.redis import RedisClient from learn_project.my_project.test_api.test_public import Job class StuChooseCls(object): @staticmethod def create_course(token, course): """ 创建...
Liabaer/Test
learn_flask/course/course_selection_project/course_selection_api/stu_choose_service.py
stu_choose_service.py
py
5,442
python
en
code
0
github-code
1
[ { "api_name": "learn_project.my_project.test_api.test_public.Job.get_time", "line_number": 24, "usage_type": "call" }, { "api_name": "learn_project.my_project.test_api.test_public.Job", "line_number": 24, "usage_type": "name" }, { "api_name": "learn_pymysql.test_api.mysql_api.Mys...
20523314908
from telegram import Update, Bot, InlineKeyboardButton, InlineKeyboardMarkup from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackQueryHandler from tg_token import token bot = Bot(token) updater = Updater(token, use_context = True) dispatcher = updater.dispatcher def printt(update, conte...
letSmilesz/meet_python
seminar10/telegram_bot.py
telegram_bot.py
py
2,548
python
en
code
1
github-code
1
[ { "api_name": "telegram.Bot", "line_number": 5, "usage_type": "call" }, { "api_name": "tg_token.token", "line_number": 5, "usage_type": "argument" }, { "api_name": "telegram.ext.Updater", "line_number": 6, "usage_type": "call" }, { "api_name": "tg_token.token", ...
38728874269
import speech_recognition as sr import os from gtts import gTTS import datetime import pyttsx3 import playsound import warnings import pyaudio import random import datetime import time import calendar import wikipedia warnings.filterwarnings("ignore") engine = pyttsx3.init() voices = engine.getProperty('rate') engine...
cs-darshan/AIR
main.py
main.py
py
4,105
python
en
code
0
github-code
1
[ { "api_name": "warnings.filterwarnings", "line_number": 15, "usage_type": "call" }, { "api_name": "pyttsx3.init", "line_number": 17, "usage_type": "call" }, { "api_name": "speech_recognition.Recognizer", "line_number": 28, "usage_type": "call" }, { "api_name": "sp...
10924485509
from selenium import webdriver from selenium.webdriver.common.keys import Keys """ 在 main 方法中才会延迟输出 """ def auto_search(): """ 自动搜索 :return: """ driver = webdriver.Chrome() url = "http://www.dianping.com" # url = "https://www.baidu.com/" driver.get(url) # 获取页面元素 print(driv...
logonmy/spider-mz
utils/selenium_utils_delay.py
selenium_utils_delay.py
py
1,411
python
en
code
0
github-code
1
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 12, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 12, "usage_type": "name" }, { "api_name": "selenium.webdriver.common.keys.Keys.RETURN", "line_number": 29, "usage_type": "attribute" ...
14085867754
# -*- coding: utf-8 -*- """ Created on Tue Mar 17 15:15:36 2020 @author: Administrator """ import numpy as np import torch import torch.nn as nn import time #import skimage.measure as sm import skimage.metrics as sm import cv2 from osgeo import gdal import matplotlib.pyplot as plt ###img read t...
endu111/remote-sensing-images-fusion
STARFM_torch.py
STARFM_torch.py
py
11,637
python
en
code
38
github-code
1
[ { "api_name": "cv2.imread", "line_number": 22, "usage_type": "call" }, { "api_name": "osgeo.gdal.Open", "line_number": 24, "usage_type": "call" }, { "api_name": "osgeo.gdal", "line_number": 24, "usage_type": "name" }, { "api_name": "torch.log", "line_number": ...
5409861942
import torch import torch.nn as nn import statistics import torchvision.models as models import torch.nn.functional as F device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") class encoder(nn.Module): def __init__(self, embed_size, model, unfreeze=10): super(encoder, self).__init__() ...
bhavyanarang/Image-Captioning
scripts/models.py
models.py
py
14,504
python
en
code
0
github-code
1
[ { "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": "torch.nn.Module", ...
32301689640
#!/usr/bin/env python3 import os import argparse import copy import time import json import signal import types from datetime import datetime from contextlib import contextmanager import wandb import yaml def main(): args = parse_args() init_wandb(args) log_parser = LogParser(args.experiment_dir, wait_f...
b0hd4n/multitarget_mt
scripts/wandb_runner.py
wandb_runner.py
py
13,135
python
en
code
0
github-code
1
[ { "api_name": "wandb.log", "line_number": 22, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path.basename", "line_number": 73, "usage_type": "call" }, { "api_name": "os.path", "lin...
10785644029
# coding:utf-8 """ @file: .py @author: dannyXSC @ide: PyCharm @createTime: 2022年05月15日 19点47分 @Function: 把协作关系转化为csv文件 """ import pandas as pd from Reader.CoauthorReader import read_coauthor from utils import get_coauthor_csv_path, timer coauthor_path = get_coauthor_csv_path() collaboration_list = [] @timer("读取协作关...
dannyXSC/BusinessIntelligence
ETL/Service/TransformCoauthorToCSV.py
TransformCoauthorToCSV.py
py
956
python
en
code
0
github-code
1
[ { "api_name": "utils.get_coauthor_csv_path", "line_number": 14, "usage_type": "call" }, { "api_name": "Reader.CoauthorReader.read_coauthor", "line_number": 22, "usage_type": "call" }, { "api_name": "utils.timer", "line_number": 19, "usage_type": "call" }, { "api_n...
71039993315
import requests import pandas as pd def get_children_leis(targetLei): """ Gets a list of LEIs for all ultimate children of a given LEI. Parameters ---------- targetLei : str The LEI of the parent entity for which the ultimate children LEIs are to be retrieved. Returns ------- ...
Donquicote/utils
utils.py
utils.py
py
2,005
python
en
code
0
github-code
1
[ { "api_name": "requests.request", "line_number": 23, "usage_type": "call" }, { "api_name": "requests.request", "line_number": 34, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 47, "usage_type": "call" }, { "api_name": "pandas.concat", ...
19323733535
import random import uuid import copy import json import multihash from intergov.domain.jurisdiction import Jurisdiction from intergov.domain.wire_protocols import generic_discrete as gd from intergov.domain import uri as u from intergov.serializers import generic_discrete_message as ser def _random_multihash(): ...
bizcubed/intergov
tests/unit/domain/wire_protocols/test_generic_message.py
test_generic_message.py
py
6,256
python
en
code
0
github-code
1
[ { "api_name": "uuid.uuid4", "line_number": 14, "usage_type": "call" }, { "api_name": "multihash.to_b58_string", "line_number": 15, "usage_type": "call" }, { "api_name": "multihash.encode", "line_number": 15, "usage_type": "call" }, { "api_name": "random.choice", ...
14202406531
from typing import ClassVar, Dict, List, Type, Union, TYPE_CHECKING from typing_extensions import Annotated from inflection import underscore from pydantic import BaseModel, Field, ConfigDict, BeforeValidator, PlainSerializer from pydantic.functional_validators import AfterValidator from pydantic._internal._model_con...
teej/titan
titan/resources/base.py
base.py
py
15,887
python
en
code
91
github-code
1
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 22, "usage_type": "name" }, { "api_name": "typing_extensions.Annotated", "line_number": 37, "usage_type": "name" }, { "api_name": "pydantic.functional_validators.AfterValidator", "line_number": 37, "usage_type": "call" ...