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
70472881787
import os, sys import os.path as osp sys.path.append(osp.dirname(__file__)) from glob import glob from tqdm import tqdm import random import shutil import math random.seed(0) def split_directory_into_batches(src_dir="../../../../2_Deep_Learning/Dataset/facial_forgery/df_in_the_wild/images/test/0_real",\ ...
phuc180155/GraduationThesis
my_thesis/forensics/preprocess_data/split_dataset_into_batches.py
split_dataset_into_batches.py
py
1,938
python
en
code
2
github-code
6
[ { "api_name": "sys.path.append", "line_number": 3, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 3, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 3, "usage_type": "call" }, { "api_name": "os.path", "line_number...
11458258201
from selenium import webdriver import time driver = webdriver.Chrome() driver.get('https://www.baidu.com') # 最大化窗口,如果不最大化窗口,页面有些控件显示不全,做自动化的时候可能定位不到控件 driver.maximize_window() time.sleep(3) # driver = webdriver.Firefox() # # driver.get('https://www.baidu.com') # time.sleep(5) # 三、通过class_name定位元素,如果属性值有空格的说明是复合类,不要用...
Ailian482/WebSelenium
Auto_Test/3_class_name定位方式.py
3_class_name定位方式.py
py
794
python
zh
code
0
github-code
6
[ { "api_name": "selenium.webdriver.Chrome", "line_number": 3, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 3, "usage_type": "name" }, { "api_name": "time.sleep", "line_number": 8, "usage_type": "call" }, { "api_name": "time.sleep", ...
73890494269
import torch import argparse from torch.utils.data import DataLoader, Dataset from torch.utils.data import Dataset, random_split import numpy as np import matplotlib.pyplot as plt import torch import torch.nn.functional as F from torch.utils.data import DataLoader import torch.optim as optim from models import VQ_Cla...
TClife/xai_timeseries
classifier.py
classifier.py
py
11,123
python
en
code
0
github-code
6
[ { "api_name": "torch.set_num_threads", "line_number": 22, "usage_type": "call" }, { "api_name": "torch.manual_seed", "line_number": 23, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 24, "usage_type": "call" }, { "api_name": "torch.cuda.is_av...
17672214686
import os import sys from enum import Enum sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__)))) sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(os.path.abspath(os.path.dirname(__file__)))))) from Config.configs import Configs from DataService.database_service import DatabaseSer...
amahiner7/GPS-System-Server
WebServerService/WebServerService/singleton_object.py
singleton_object.py
py
2,176
python
en
code
0
github-code
6
[ { "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...
12495454949
# reference: # D. J. Higham "An Algorithmic Introduction to Numerical # Simulation of Stochastic Differential Equations" # SIAM Review 43 (2001) 525 import numpy as np import matplotlib.pyplot as plt np.random.seed(100) lm=2; mu=1; X0=1; T=1; N=256; dt=T/N; t=np.linspace(0,T,N+1) W = np.zeros(N+1) dW = np.rando...
tt-nakamura/SDE
fig3.py
fig3.py
py
869
python
en
code
0
github-code
6
[ { "api_name": "numpy.random.seed", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 9, "usage_type": "attribute" }, { "api_name": "numpy.linspace", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.zeros", "l...
17131422582
from django import forms from django.forms import ModelForm, fields from django.forms import widgets from django.forms.models import modelformset_factory from django.forms.widgets import TextInput from .models import TaskInfo, UserInfo from django.forms import formset_factory from datetime import date class DateInpu...
qube1t/lhoraire-web
scheduler/forms.py
forms.py
py
5,018
python
en
code
0
github-code
6
[ { "api_name": "django.forms.DateInput", "line_number": 12, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 12, "usage_type": "name" }, { "api_name": "datetime.date.today", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime...
42510609513
import argparse import sys, os, shutil from pathlib import Path _local_dir = Path(__file__).parent.resolve() default_config = _local_dir / "netproxy.toml" _parent = str(_local_dir.parent) if _parent not in sys.path: sys.path.insert(0, _parent) __package__ = _local_dir.name sys.path.insert(0, str(_local_dir / "ex...
jose-pr/pypki
src/netproxy/__main__.py
__main__.py
py
1,426
python
en
code
2
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sys.path.insert", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number"...
27308241232
import random import math from collections import namedtuple, deque from graphics import Board from itertools import count import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import matplotlib import matplotlib.pyplot as plt n_actions = 7 class DQN(nn.Module): def __ini...
aravuri/Connect-Four
net.py
net.py
py
1,711
python
en
code
0
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 16, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 16, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 19, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
72621174589
#!/usr/bin/env python # coding: utf-8 # In[ ]: # Dependencies import tweepy import time import json import random import requests as req import datetime import os consumer_key = os.environ.get("consumer_key") consumer_secret = os.environ.get("consumer_secret") access_token = os.environ.get("access_token") access_to...
jxavie/weatherbot
Weather_Tweets.py
Weather_Tweets.py
py
1,410
python
en
code
0
github-code
6
[ { "api_name": "os.environ.get", "line_number": 16, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 16, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 17, "usage_type": "call" }, { "api_name": "os.environ", "line_...
10506259242
"""解码cifar10的二进制格式文件 Routine for decoding the CIFAR-10 binary file format""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from six.moves import xrange import tensorflow as tf #Process images of this size IMAGE_SIZE = 24 #Global constants de...
RuanYB/tensorflow
cifar10/cifar10_input.py
cifar10_input.py
py
8,083
python
en
code
0
github-code
6
[ { "api_name": "tensorflow.FixedLengthRecordReader", "line_number": 54, "usage_type": "call" }, { "api_name": "tensorflow.decode_raw", "line_number": 58, "usage_type": "call" }, { "api_name": "tensorflow.uint8", "line_number": 58, "usage_type": "attribute" }, { "ap...
38515106833
from typing import Dict, Any, Tuple, Union from .pipeline import SentimentPipeline, MetricTracker from pytorch_lightning import Trainer, seed_everything from torch.utils.data import DataLoader import pandas as pd from .dataset import build_dataloaders import numpy as np import torch def train_model( cfg: Dict[str...
crypto-sentiment/crypto_sentiment_notebooks
notebooks/checklist_utils/train/bert/train.py
train.py
py
1,717
python
en
code
1
github-code
6
[ { "api_name": "typing.Dict", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.Any", "line_number": 12, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 13, "usage_type": "attribute" }, { "api_name": "pandas.DataFrame", "...
26135226383
##pygal 画廊 import pygal from random import randint class Die(): def __init__(self,side=6): self.side = 6 def roll(self): return randint(1,self.side) #执行2次??? #执行2次就2次吧,不知道哪里出了问题 die = Die() #投骰子,把结果存入列表 result=[] #投100次 for i in range(5): num = die.roll() result.append(num) print(re...
paiping/PythonProject
pygal.py
pygal.py
py
925
python
zh
code
0
github-code
6
[ { "api_name": "random.randint", "line_number": 8, "usage_type": "call" }, { "api_name": "pygal.Bar", "line_number": 29, "usage_type": "call" } ]
42664243483
# -*- coding: utf-8 -*- import cv2 import numpy as np img_or = cv2.imread('paisaje.jpg') # Rotación 180 img_rot = cv2.rotate(img_or, cv2.ROTATE_180) # Unificación y negativización img_rot_neg = 255 - cv2.cvtColor(img_rot, cv2.COLOR_BGR2GRAY) cv2.imshow('Imagen original', img_or) cv2.imshow('Imagen nega...
andresdulonz/algoritmo_3__negativo_de_la_imagen
algoritmo_3__negativo_de_la_imagen/ejercicio_5.py
ejercicio_5.py
py
368
python
es
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "cv2.rotate", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.ROTATE_180", "line_number": 8, "usage_type": "attribute" }, { "api_name": "cv2.cvtColor", "line_numbe...
41599086922
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('WODStory', '0004_auto_20161013_1528'), ] operations = [ migrations.AddField( model_name='workout', n...
yoonjong92/WODStory_Server
WODStory/migrations/0005_auto_20161013_1629.py
0005_auto_20161013_1629.py
py
614
python
en
code
0
github-code
6
[ { "api_name": "django.db.migrations.Migration", "line_number": 7, "usage_type": "attribute" }, { "api_name": "django.db.migrations", "line_number": 7, "usage_type": "name" }, { "api_name": "django.db.migrations.AddField", "line_number": 14, "usage_type": "call" }, { ...
10688469085
from datetime import datetime from schema import Chapter, Article, Speaker, Paragraph from hdoc import HDoc, TextFormat import re, sys def contains_question(s): p = re.compile('Q:', re.IGNORECASE) return True if p.match(s) else False def contains_speaker(s): res = False t = s.strip(' ') p_simple ...
mikezm/h2hparser
helpers.py
helpers.py
py
11,664
python
en
code
0
github-code
6
[ { "api_name": "re.compile", "line_number": 8, "usage_type": "call" }, { "api_name": "re.IGNORECASE", "line_number": 8, "usage_type": "attribute" }, { "api_name": "re.compile", "line_number": 14, "usage_type": "call" }, { "api_name": "re.compile", "line_number"...
17329468454
import os import requests from bitrix24 import * from init_logger import create_logger from src.dtos.wolya_dto import WolyaDTO from src.enums.bitrix_enum import BitrixEnum from envs import Envs from src.smtp.mailing import mailing event_counter = 0 logger = create_logger() class BitrixClient: deal_key = 'data[...
XValentavr/bitrix_gateway
src/my_bitrix/bitrix_client.py
bitrix_client.py
py
2,554
python
en
code
0
github-code
6
[ { "api_name": "init_logger.create_logger", "line_number": 13, "usage_type": "call" }, { "api_name": "envs.Envs.WOLYA_URL", "line_number": 20, "usage_type": "attribute" }, { "api_name": "envs.Envs", "line_number": 20, "usage_type": "name" }, { "api_name": "envs.Env...
73866140026
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat May 16 23:40:29 2020 @author: Dani Kiyasseh """ #%% import numpy as np from prepare_miscellaneous import obtain_information, obtain_saved_weights_name, make_saving_directory, modify_dataset_order_for_multi_task_learning, obtain_load_path_dir, determine...
danikiyasseh/RTLP
run_experiments.py
run_experiments.py
py
26,818
python
en
code
3
github-code
6
[ { "api_name": "prepare_miscellaneous.obtain_saved_weights_name", "line_number": 166, "usage_type": "call" }, { "api_name": "prepare_miscellaneous.obtain_information", "line_number": 169, "usage_type": "call" }, { "api_name": "prepare_miscellaneous.obtain_information", "line_n...
17000325430
#!/usr/bin/env python from pathlib import Path import json import yaml here = Path(__file__).parent wakatime = json.loads((here / 'wakatime.json').read_text()) technologies = yaml.load((here / 'technologies.yaml').read_text(), Loader=yaml.SafeLoader) per_language_totals = {} per_project_totals = {} # Maps Wakatime la...
ewen-lbh/portfolio
database/aggregate-language-times.py
aggregate-language-times.py
py
1,761
python
en
code
0
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 6, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 7, "usage_type": "call" }, { "api_name": "yaml.load", "line_number": 8, "usage_type": "call" }, { "api_name": "yaml.SafeLoader", "line_number": 8...
86366426616
import numpy as np import pandas as pd import matplotlib.pyplot as plt """ https://medium.com/@martinpella/logistic-regression-from-scratch-in-python-124c5636b8ac https://www.geeksforgeeks.org/understanding-logistic-regression/ """ def normalize(X): mins = np.min(X, axis=0) maxs = np.max(X, axis=0) rng = ...
MitaAcharya/MachineLeaning
AndrewNG/Week3/Week3_LO_Extra/LogisticRegression/LogisticRegressionFirstBinaryClassifier.py
LogisticRegressionFirstBinaryClassifier.py
py
3,218
python
en
code
0
github-code
6
[ { "api_name": "numpy.min", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.max", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.dot", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.exp", "line_number": 23, ...
37118636258
from enum import StrEnum class WeaponType(StrEnum): bow = 'bow' catalyst = 'catalyst' claymore = 'claymore' polearm = 'polearm' sword = 'sword' class Element(StrEnum): anemo = 'anemo' cryo = 'cryo' dendro = 'dendro' electro = 'electro' geo = 'geo' hydro = 'hydro' pyro...
EymireWorld/gi-data
app/schemas.py
schemas.py
py
330
python
en
code
1
github-code
6
[ { "api_name": "enum.StrEnum", "line_number": 4, "usage_type": "name" }, { "api_name": "enum.StrEnum", "line_number": 12, "usage_type": "name" } ]
35063589303
from django import forms from django.shortcuts import get_object_or_404 from django.forms import ValidationError from core.models import Dataset, User, Project from core.models.contract import Contract class DatasetForm(forms.ModelForm): class Meta: model = Dataset fields = ['local_custodians', 't...
vildead/daisy
core/forms/dataset.py
dataset.py
py
3,898
python
en
code
null
github-code
6
[ { "api_name": "django.forms.ModelForm", "line_number": 8, "usage_type": "attribute" }, { "api_name": "django.forms", "line_number": 8, "usage_type": "name" }, { "api_name": "core.models.Dataset", "line_number": 10, "usage_type": "name" }, { "api_name": "django.for...
10519055462
from django.shortcuts import render,redirect from django.contrib.auth.decorators import login_required from .forms import ( Patient_personal_infoForm, VisitForm, PatientForm, EmployeeForm, PrescriptionForm, DoctorForm, HospitalForm, Normal_valuesForm, ACR_ScoringForm, Basic_TestsForm, Advanced_TestsForm, BM...
NarayanaRao26/dbms_project
database/views.py
views.py
py
4,502
python
en
code
0
github-code
6
[ { "api_name": "django.shortcuts.render", "line_number": 23, "usage_type": "call" }, { "api_name": "forms.Patient_personal_infoForm", "line_number": 28, "usage_type": "call" }, { "api_name": "forms.ACR_ScoringForm", "line_number": 29, "usage_type": "call" }, { "api...
607182869
import os from django.conf import settings from django.http import HttpResponse from api.model.serializers import GroupSerializer from accounts.serializers import TeacherGETSerializer from api.service.db_service import groups_statistic, populate_database, teacher_statistic from api.service.save_service import save_file...
hachimanhikki/diploma-backend-for-server
flows/views.py
views.py
py
2,875
python
en
code
0
github-code
6
[ { "api_name": "api.service.save_service.save_file", "line_number": 20, "usage_type": "call" }, { "api_name": "django.conf.settings.FLOWS_FILE_NAME", "line_number": 20, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 20, "usage_type": "nam...
38903284482
import youtube_transcript_api from transformers import pipeline from youtube_transcript_api import YouTubeTranscriptApi from flask import Flask, abort import pickle from flask import request import nltk nltk.download('punkt') # from datetime # define a variable to hold you app app = Flask(__name__) model = pipeline("s...
mahi-ma/Youtube-transcripts-summarizer
app.py
app.py
py
2,709
python
en
code
2
github-code
6
[ { "api_name": "nltk.download", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 12, "usage_type": "call" }, { "api_name": "transformers.pipeline", "line_number": 13, "usage_type": "call" }, { "api_name": "youtube_transcript_api...
23116503004
import os import re import json import hashlib import requests from flask import g from flask import abort from flask import request from flask import jsonify from flask import Response from flask import Blueprint from werkzeug.datastructures import Headers from eplatform import app from eplatform import connect_db ...
EibrielInv/platform
eplatform/modules/main/__init__.py
__init__.py
py
27,998
python
en
code
0
github-code
6
[ { "api_name": "flask.Blueprint", "line_number": 21, "usage_type": "call" }, { "api_name": "flask.g", "line_number": 36, "usage_type": "argument" }, { "api_name": "flask.g.cloudant_client", "line_number": 37, "usage_type": "attribute" }, { "api_name": "flask.g", ...
29990701274
""" CSAPX Lab 3: Merchants of Venice Given a list of merchants at integer locations on a road, find the optimal location to place a new merchant, such that the sum of the distances the new merchant must travel to all other merchants is minimized. $ python3 merchants.py [slow|fast] input-file Author: Sean Strout @ RI...
an5558/csapx-20191-lab3-merchants-an5558-master
src/merchants.py
merchants.py
py
5,386
python
en
code
0
github-code
6
[ { "api_name": "collections.namedtuple", "line_number": 26, "usage_type": "call" }, { "api_name": "typing.List", "line_number": 28, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 44, "usage_type": "name" }, { "api_name": "typing.Tuple", "li...
39046868722
from marshmallow import Schema, fields, post_load from rest_client.ProteinPFAMRest import ProteinPFAMAPI import datetime class ProteinPFAMSchema(Schema): """ This class map the json into the object Domain ..note:: see marshmallow API """ id = fields.Int() date_creation = fields.Date() do...
diogo1790/inphinity
objects_API/ProteinPFAMJ.py
ProteinPFAMJ.py
py
3,624
python
en
code
0
github-code
6
[ { "api_name": "marshmallow.Schema", "line_number": 7, "usage_type": "name" }, { "api_name": "marshmallow.fields.Int", "line_number": 13, "usage_type": "call" }, { "api_name": "marshmallow.fields", "line_number": 13, "usage_type": "name" }, { "api_name": "marshmall...
72233155067
import os import torch import torchvision import torchvision.transforms as transforms import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import numpy as np import matplotlib.pyplot as plt BATCH_SIZE = 4 device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu') transform ...
hermanprawiro/pytorch-learn
tutorials/training_tut.py
training_tut.py
py
5,162
python
en
code
0
github-code
6
[ { "api_name": "torch.device", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.cuda.is_available", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torchvision.tran...
41495739815
from torch import nn import torch import torch.nn.functional as F from torchstat import stat class DoubleConv(nn.Module): def __init__(self, in_channels, out_channels, mid_channels=None, stride=1): if mid_channels is None: mid_channels = out_channels super(DoubleConv, self).__init__() ...
CSUIIS/MsFEFNet-and-MT-TSNLNet
segmentation/MsFEFNet/modelcode/MsFEFNet.py
MsFEFNet.py
py
12,767
python
en
code
0
github-code
6
[ { "api_name": "torch.nn.Module", "line_number": 7, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
36413199968
# --------------- # ParamCopy - Substance 3D Designer plugin # (c) 2019-2022 Eyosido Software SARL # --------------- import logging import sd from paramcopy.pccore.pcdata import PCData class PCLogger: internal_instance = None @classmethod # simplified singleton def instance(cls): if cls.inter...
eyosido/ParamCopy
src/paramcopy/pccore/pclog.py
pclog.py
py
1,482
python
en
code
9
github-code
6
[ { "api_name": "sd.getContext", "line_number": 27, "usage_type": "call" }, { "api_name": "logging.Logger", "line_number": 27, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 30, "usage_type": "call" }, { "api_name": "paramcopy.pccore....
70676892347
import numpy as np import cv2 as cv def opening(img, kernel): img = cv.morphologyEx(img, cv.MORPH_OPEN, kernel) return img def closing(img, kernel): img = cv.morphologyEx(img, cv.MORPH_CLOSE, kernel) return img # Zadanie na ocenę dostateczną def renew_pictures(): ...
obrazowaniebiomedyczne/laboratorium-2-wt-tn-17-05-filipmg
solution.py
solution.py
py
3,830
python
en
code
0
github-code
6
[ { "api_name": "cv2.morphologyEx", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.MORPH_OPEN", "line_number": 6, "usage_type": "attribute" }, { "api_name": "cv2.morphologyEx", "line_number": 12, "usage_type": "call" }, { "api_name": "cv2.MORPH_CLOSE",...
1912276722
import numpy as np import torch import sys import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import os import pandas as pd from torch.utils.data import DataLoader, Dataset, TensorDataset import time import matplotlib.pyplot as plt # global variables cuda = torch.cuda.is_available() devi...
lingjie-feng/Deep-Learning-Models
Frame_Level Classification_of_Speech/test.py
test.py
py
3,491
python
en
code
0
github-code
6
[ { "api_name": "torch.cuda.is_available", "line_number": 14, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.device", "line_number": 15, "usage_type": "call" }, { "api_name": "sys.version", ...
20216414002
from collections import namedtuple from model.flyweight import Flyweight from model.static.database import database from model.dynamic.inventory.item import Item class TypeRequirements(Flyweight): #IGNORE:R0903 def __init__(self, type_id): #prevents reinitializing if "_inited" in self.__d...
Iconik/eve-suite
src/model/static/ram/type_requirements.py
type_requirements.py
py
1,578
python
en
code
0
github-code
6
[ { "api_name": "model.flyweight.Flyweight", "line_number": 7, "usage_type": "name" }, { "api_name": "model.static.database.database.get_cursor", "line_number": 29, "usage_type": "call" }, { "api_name": "model.static.database.database", "line_number": 29, "usage_type": "nam...
7064277772
""" 09/12/17: The MyPicasa database """ from os import walk, path from json import dump, load from PIL import Image, ExifTags from datetime import datetime class PicasaData(): """ Interface to the data class """ def __init__(self, controller): self.controller = controller self.stamp = datetime...
berkobob/myPicasa
data.py
data.py
py
3,812
python
en
code
0
github-code
6
[ { "api_name": "datetime.datetime.now", "line_number": 14, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 14, "usage_type": "name" }, { "api_name": "json.load", "line_number": 18, "usage_type": "call" }, { "api_name": "os.walk", "line...
19504734267
from igraph import Graph from igraph import plot #grafo simples orientado que forma um circuito grafo1 = Graph(edges = [(0,1),(1,2),(2,3),(3,0)], directed = True) print(grafo1) grafo1.vs['label'] = range(grafo1.vcount()) #não funcionou plot(grafo1, bbox = (300,300)) #grafo orientado com laço grafo2 = Graph(edges = [(...
guibarreta1993Average/data_science_udemy
05_Grafos/aula31_introducao.py
aula31_introducao.py
py
729
python
pt
code
0
github-code
6
[ { "api_name": "igraph.Graph", "line_number": 5, "usage_type": "call" }, { "api_name": "igraph.plot", "line_number": 8, "usage_type": "call" }, { "api_name": "igraph.Graph", "line_number": 11, "usage_type": "call" }, { "api_name": "igraph.plot", "line_number": ...
18355999351
# -*- coding: utf-8 -*- import argparse import dgl.function as fn import dgl.nn.pytorch as dglnn import torch as th import torch.nn as nn import torch.optim from data import MovieLens def config(): parser = argparse.ArgumentParser(description='GCMC') parser.add_argument('--device', default=0, ty...
Minzc/dgi_snippet
train.py
train.py
py
9,304
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.device", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.nn.Module", "line_number": 25, "usage_type": "attribute" }, { "api_name": "torch.nn", ...
39673439664
import textwrap from pathlib import Path import yaml import craft_parts from craft_parts import Action, Step _LOCAL_DIR = Path(__file__).parent def test_source_snap(mocker, new_dir, fake_snap_command): _parts_yaml = textwrap.dedent( """\ parts: foo: plugin: nil ...
cmatsuoka/craft-parts-orig
tests/integration/lifecycle/test_stage_snaps.py
test_stage_snaps.py
py
1,211
python
en
code
0
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 9, "usage_type": "call" }, { "api_name": "textwrap.dedent", "line_number": 13, "usage_type": "call" }, { "api_name": "yaml.safe_load", "line_number": 22, "usage_type": "call" }, { "api_name": "craft_parts.LifecycleManag...
38452034362
import sys from collections import deque input = sys.stdin.readline m,n = map(int,input().split()) L = [] Check = [[-1]*m for _ in range(n)] for _ in range(n): L.append(list(map(int,input().split()))) dy = [0,-1,0,1] dx = [-1,0,1,0] areaID = 0 aSize = [] def grid_bfs(start,areaID): dq = deque([start]) C...
LightPotato99/baekjoon
bitmask/castleWall.py
castleWall.py
py
1,362
python
en
code
0
github-code
6
[ { "api_name": "sys.stdin", "line_number": 3, "usage_type": "attribute" }, { "api_name": "collections.deque", "line_number": 18, "usage_type": "call" } ]
72532853309
# pylint:disable=unused-variable # pylint:disable=unused-argument # pylint:disable=redefined-outer-name import json from collections.abc import AsyncIterator, Iterator from copy import deepcopy from pathlib import Path import pytest import sqlalchemy as sa from aioresponses import aioresponses from pytest_simcore.hel...
ITISFoundation/osparc-simcore
services/web/server/tests/unit/with_dbs/03/wallets/conftest.py
conftest.py
py
3,781
python
en
code
35
github-code
6
[ { "api_name": "pytest_simcore.helpers.typing_env.EnvVarsDict", "line_number": 22, "usage_type": "name" }, { "api_name": "pytest_simcore.helpers.typing_env.EnvVarsDict", "line_number": 23, "usage_type": "name" }, { "api_name": "pytest.MonkeyPatch", "line_number": 24, "usag...
34336834634
from tkinter import * import cv2 import numpy as np import tkinter as tk from tkinter import filedialog, Text from PIL import Image, ImageTk import pytesseract from pytesseract import Output pytesseract.pytesseract.tesseract_cmd='C:\Program Files\Tesseract-OCR\\Tesseract.exe' def openimg(): filename =...
rushabhporwal29/image_processing_nehal
mini_project1.py
mini_project1.py
py
5,929
python
en
code
0
github-code
6
[ { "api_name": "pytesseract.pytesseract", "line_number": 9, "usage_type": "attribute" }, { "api_name": "tkinter.filedialog.askopenfilename", "line_number": 13, "usage_type": "call" }, { "api_name": "tkinter.filedialog", "line_number": 13, "usage_type": "name" }, { ...
41758447902
import time import curses import random import asyncio from async_funcs import blink from async_funcs import fire from async_funcs import animate_spaceship from async_funcs import run_spaceship from async_funcs import fly_garbage from async_funcs import fill_orbit_with_garbage from async_funcs import count_year from ...
qDes/space_game
main.py
main.py
py
2,718
python
en
code
0
github-code
6
[ { "api_name": "random.randint", "line_number": 39, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 40, "usage_type": "call" }, { "api_name": "random.choice", "line_number": 41, "usage_type": "call" }, { "api_name": "global_vars.coroutines.ap...
3037579150
from collections import defaultdict from operator import itemgetter def solution(genres, plays): genre_play_dict = defaultdict(lambda: 0) for genre, play in zip(genres, plays): genre_play_dict[genre] += play genre_rank = [genre for genre, play in sorted(genre_play_dict.items(), key=itemgetter(1),...
sunyeongchoi/sydsyd_challenge
argorithm/best_album_practice.py
best_album_practice.py
py
1,140
python
en
code
1
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 6, "usage_type": "call" }, { "api_name": "operator.itemgetter", "line_number": 10, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 13, "usage_type": "call" }, { "api_name": "op...
16166175154
from django.shortcuts import render, get_object_or_404, redirect from helent.models import Post # from .models import Comment from .forms import CommentForm # Create your views here. def post_comment(request, post_pk): # 先获取被评论的文章,评论和文章要关联 # 函数get_object_or_404的作用是当获取的文章(Post)存在时获取,不存在时返回404页面 post = ge...
Geneln/django_blog
comments/views.py
views.py
py
1,330
python
en
code
0
github-code
6
[ { "api_name": "django.shortcuts.get_object_or_404", "line_number": 13, "usage_type": "call" }, { "api_name": "helent.models.Post", "line_number": 13, "usage_type": "argument" }, { "api_name": "forms.CommentForm", "line_number": 17, "usage_type": "call" }, { "api_n...
10254889386
import pygame, random, threading from EventFlags import EventFlags pygame.init() arduino = True GREEN = (20, 255, 140) GREY = (210, 210, 210) WHITE = (255, 255, 255) RED = (255, 0, 0) PURPLE = (255, 0, 255) BLACK = (0, 0, 0) secondPlay = False FALLSPEED = 8 OBJECTPROB = 10 SCREENWIDTH = 1200 SCREENHEIGHT = 800...
mitchadam/GubaRush
Game/Game.py
Game.py
py
25,047
python
en
code
3
github-code
6
[ { "api_name": "pygame.init", "line_number": 5, "usage_type": "call" }, { "api_name": "pygame.time.Clock", "line_number": 26, "usage_type": "call" }, { "api_name": "pygame.time", "line_number": 26, "usage_type": "attribute" }, { "api_name": "pygame.display.set_mode...
42896315102
# This specific script failed randomly with some XLA/CUDA errors at start-up for my computer. # If you want to run it, you may have to just try again a few times. I am not sure what is causing this. It may just be # a problem with my computer. Will try on another one soon. # I am typically getting one of these errors: ...
AdrienCorenflos/aux-ssm-samplers
aux_samplers/examples/lorenz/experiment.py
experiment.py
py
13,579
python
en
code
7
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 27, "usage_type": "call" }, { "api_name": "time.time", "line_number": 62, "usage_type": "call" }, { "api_name": "jax.config.update", "line_number": 65, "usage_type": "call" }, { "api_name": "jax.config", ...
12791944170
# -*- coding: utf-8 -*- """ Created on Sat Aug 22 15:51:48 2020 在服务器中创建一个空白表,并把历史数据CSV文件中的数据导入这个表中。 首先要在数据库中把这个表删除 表名是tblhistory 进而填写出5阶差分的值,看看规律 @author: Eddiezhang """ import psycopg2 import configparser # 查找0~255的地址 def ping(ip): import os # ret =os.system('ping -c 1 -w 1 %s'%ip) #每个ip ping 1次,等待时间为1s r...
eddiejunzhang/ssq-git-ana
rebuild_history_to_db.py
rebuild_history_to_db.py
py
7,767
python
en
code
0
github-code
6
[ { "api_name": "os.system", "line_number": 17, "usage_type": "call" }, { "api_name": "configparser.ConfigParser", "line_number": 26, "usage_type": "call" }, { "api_name": "psycopg2.connect", "line_number": 40, "usage_type": "call" }, { "api_name": "configparser.Con...
74128851069
from argparse import ArgumentParser from asyncio import get_event_loop from asyncio import create_task from asyncio import gather from inspect import iscoroutinefunction from sys import exit as sys_exit from aiofiles import open as async_open from os import remove from . import * parser = ArgumentParser(description="P...
D4rkwat3r/ProjZ
projz/__main__.py
__main__.py
py
9,696
python
en
code
5
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "inspect.iscoroutinefunction", "line_number": 54, "usage_type": "call" }, { "api_name": "asyncio.get_event_loop", "line_number": 53, "usage_type": "call" }, { "api_na...
13442875639
from collections import namedtuple #This object describes the event of an entity being created CreateEnt = namedtuple( 'CreateEnt', ['entId', 'className', 'position', 'velocity', 'kwargs'] ) #This object describes the event of removing an ent. RemoveEnt = namedtuple( 'RemoveEnt', ['entId'] ) #This object describes t...
Occuliner/ThisHackishMess
modules/stockclasses/networkupdateclasses.py
networkupdateclasses.py
py
960
python
en
code
2
github-code
6
[ { "api_name": "collections.namedtuple", "line_number": 4, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 7, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 10, "usage_type": "call" }, { "api_name": "co...
4992880932
import time import sys from django.contrib.staticfiles.testing import StaticLiveServerTestCase from selenium import webdriver from selenium.common.exceptions import WebDriverException MAX_WAIT = 5 def wait(fn): def modified_fn(*args, **kwargs): start_time = time.time() while True: try...
ZhelSE/exchange_point
ft/base.py
base.py
py
1,208
python
en
code
0
github-code
6
[ { "api_name": "time.time", "line_number": 12, "usage_type": "call" }, { "api_name": "selenium.common.exceptions.WebDriverException", "line_number": 16, "usage_type": "name" }, { "api_name": "time.time", "line_number": 17, "usage_type": "call" }, { "api_name": "tim...
25149091323
import json from celery import group from django.contrib.auth import get_user_model from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.messages.views import SuccessMessageMixin from django.urls import reverse from django.utils.translation import gettext_lazy as _ from django.views.generic imp...
ford19982541/django-celery-rabbitmq-demo
demoq/users/views.py
views.py
py
2,577
python
en
code
0
github-code
6
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 17, "usage_type": "call" }, { "api_name": "django.contrib.auth.mixins.LoginRequiredMixin", "line_number": 20, "usage_type": "name" }, { "api_name": "django.views.generic.DetailView", "line_number": 20, "us...
38153161951
from collections import OrderedDict import datetime import logging import os from scrapy.crawler import CrawlerProcess from scrapy.utils import display from scrapy.utils.project import get_project_settings # it's necessary to remove the lambda loggers first, otherwise the Scrapy log # settings aren't respected and we...
multiplechoice/spiders
handler.py
handler.py
py
2,280
python
en
code
2
github-code
6
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "collections.OrderedDict", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 20, "usage_type": "attribute" }, { "api_name": "boto...
35049079491
""" Activation functions """ import theano.tensor as T tanh = T.tanh sigmoid = T.nnet.sigmoid softplus = T.nnet.softplus # @staticmethod def relu(X): """Rectified linear units (relu)""" return T.maximum(0,X)
lpigou/Theano-3D-ConvNet
convnet3d/activations.py
activations.py
py
221
python
en
code
83
github-code
6
[ { "api_name": "theano.tensor.tanh", "line_number": 10, "usage_type": "attribute" }, { "api_name": "theano.tensor", "line_number": 10, "usage_type": "name" }, { "api_name": "theano.tensor.nnet", "line_number": 11, "usage_type": "attribute" }, { "api_name": "theano....
12653349946
# -*- coding: utf-8 -*- """ Created on Mon Jul 03 22:12:56 2017 @author: touristlee TO:Don't worry,be happy! """ import web import pandas as pd import numpy as np #读取数据 df = pd.read_csv('small_user.csv',encoding='utf-8') #随机生成一个省份列表 def get_province(x): youlist = [] for i in x: ma...
touristlee/webpy
mysite.py
mysite.py
py
2,138
python
en
code
2
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 14, "usage_type": "call" }, { "api_name": "web.template.render", "line_number": 30, "usage_type": "call" }, { "api_name": "web.template", "line_number": 30, "usage_type": "attribute" }, { "api_name": "web.header", ...
3279426250
import json KEY_TEMPERATURE = 'temperatura' KEY_DRY_COUGH = 'tos_seca' KEY_LOSS_OF_SMELL = 'perdida_del_olfato' KEY_LOSS_OF_TASTE = 'perdida_del_gusto' DEFAULT_BOOLEAN_QUESTION = 'n' class CovidSurvey: def __init__(self): self._answers = {} def run(self): self._answers[KEY_TEMPERATURE] = float(input('In...
aalvarezwindey/sensible-data-system
model/covid_survey/covid_survey.py
covid_survey.py
py
712
python
en
code
0
github-code
6
[ { "api_name": "json.dumps", "line_number": 19, "usage_type": "call" } ]
12790612626
#!/usr/bin/env python import copy import sys import os import time import pickle import statistics from shutil import copyfile from methods import (run_TRANE_simulations, run_APS_simulations, save_facies_grids_as_png, count_connected_grid_nodes, calculate_and_save_facies_prob_maps, ...
Skauvold/APSvsTPG
python_code/run_models.py
run_models.py
py
5,978
python
en
code
0
github-code
6
[ { "api_name": "methods.run_TRANE_simulations", "line_number": 29, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 33, "usage_type": "call" }, { "api_name": "os.path", "line_number": 33, "usage_type": "attribute" }, { "api_name": "os.mkdir", ...
15549492714
import torch import copy import random ##### Locally Self-Balancing Sampler class LSB(): ##### Function initializing elements used ##### to compute and sample from Q(X'|X)) # batch - number of chains # func - 'lsb1', 'lsb2' # lr - learning rate # start_x - dictionary with va...
emsansone/LSB
UAI/self_sampler.py
self_sampler.py
py
17,909
python
en
code
2
github-code
6
[ { "api_name": "torch.tensor", "line_number": 42, "usage_type": "call" }, { "api_name": "torch.nn.Softmax", "line_number": 43, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 43, "usage_type": "attribute" }, { "api_name": "torch.zeros", "line_n...
11380864276
import config_file_out import process import config import router_module import subprocess class DhcpServer(router_module.RouterModule): def __init__(self, ctx): self.config_file = config_file_out.ConfigFileOut(ctx, "dhcpd.conf") preamble = """ subnet 192.168.1.0 netmask 255.255.255.0 { option routers ...
mbahlabs/mbah-router
py/dhcp_server.py
dhcp_server.py
py
1,307
python
en
code
0
github-code
6
[ { "api_name": "router_module.RouterModule", "line_number": 7, "usage_type": "attribute" }, { "api_name": "config_file_out.ConfigFileOut", "line_number": 9, "usage_type": "call" }, { "api_name": "config.Config.get_config", "line_number": 27, "usage_type": "call" }, { ...
22879360785
import speech_recognition as sr import sys import torch from torch.utils.data import Dataset, DataLoader from transformers import AutoTokenizer, AutoModelForSequenceClassification from transformers import BertModel r = sr.Recognizer() def infer(text): out_dict = {} output_str = '' for col in ['position_...
HugoXK/ECE-445-Senior-Design
nlp/test_nlp.py
test_nlp.py
py
1,759
python
en
code
0
github-code
6
[ { "api_name": "speech_recognition.Recognizer", "line_number": 8, "usage_type": "call" }, { "api_name": "transformers.AutoTokenizer.from_pretrained", "line_number": 15, "usage_type": "call" }, { "api_name": "transformers.AutoTokenizer", "line_number": 15, "usage_type": "na...
29331718522
from django.views.generic import ListView from django.views.generic import DetailView from django.views.generic.edit import CreateView from django.views.generic.edit import UpdateView from django.views.generic.edit import DeleteView from course.models import Course from django.urls import reverse_lazy class CourseLis...
TheCodingShophouse/codingshophouse_py_2017
coursegroup/course/views/course.py
course.py
py
1,067
python
en
code
0
github-code
6
[ { "api_name": "django.views.generic.ListView", "line_number": 10, "usage_type": "name" }, { "api_name": "course.models.Course", "line_number": 11, "usage_type": "name" }, { "api_name": "django.views.generic.DetailView", "line_number": 13, "usage_type": "name" }, { ...
43372332235
import copy import os import sys import warnings from collections import Counter from functools import partial from itertools import combinations from operator import itemgetter import six import numpy as np import pandas as pd from scipy.signal import savgol_filter from scipy.special import comb from . import PEAK_F...
Chris7/pyquant
pyquant/utils.py
utils.py
py
40,997
python
en
code
14
github-code
6
[ { "api_name": "os.environ.get", "line_number": 21, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 21, "usage_type": "attribute" }, { "api_name": "pandas.Series", "line_number": 52, "usage_type": "call" }, { "api_name": "pandas.Series", "lin...
42939769427
import numpy as np import matplotlib.pyplot as pyplot uAndes = open("tiempo_uandes_exportado.csv") qNormal = open("330020_202208_AguaCaida.csv") qNormal.readline() uAndes.readline() andes = uAndes.readlines() qnormal = qNormal.readlines() print(len(andes)) print(len(qnormal)) andesPrec = [] qNormalPrec = [] time...
elbug-py/weathertrack
get_prec.py
get_prec.py
py
938
python
en
code
0
github-code
6
[ { "api_name": "numpy.subtract", "line_number": 35, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.scatter", "line_number": 41, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 41, "usage_type": "name" }, { "api_name": "matplotlib...
5454385441
""" Problem: 21. Merge Two Sorted Lists Difficulty: Easy URL: https://leetcode.com/problems/merge-two-sorted-lists Tags: Linked List, Recursion Date: 2022-05-10T14:00:29.877163+08:00 """ from typing import List, Optional import sys sys.path.append('..') from utils.list.list_node import ListNode c...
s0u0b/leetcode
solutions/a00021_merge_two_sorted_lists.py
a00021_merge_two_sorted_lists.py
py
1,639
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 16, "usage_type": "attribute" }, { "api_name": "typing.Optional", "line_number": 21, "usage_type": "name" }, { "api_name": "utils.list.list_node.Li...
15598873092
import torch import os.path import numpy as np import pickle import importlib import yolo.config.yolo_voc as cfg from yolo.yolov2 import build_yolo from utils.extras import Timer, get_output_dir from utils.utils_eval import write_voc_results_file, do_python_eval use_cv2 = importlib.util.find_spec('cv2') is not None i...
AceCoooool/detection-pytorch
yolo/eval.py
eval.py
py
5,113
python
en
code
24
github-code
6
[ { "api_name": "importlib.util.find_spec", "line_number": 12, "usage_type": "call" }, { "api_name": "importlib.util", "line_number": 12, "usage_type": "attribute" }, { "api_name": "dataset.voc0712_cv", "line_number": 24, "usage_type": "argument" }, { "api_name": "y...
4312014962
from collections import deque if __name__ == "__main__": n = int(input()) d = deque() for _ in range(n): inputs = input().split() action = inputs[0] if len(inputs) > 1: ele = inputs[1] if action == "append": d.append(ele) elif action == "ap...
thiagojuliao/Hacker-Rank
Python/Collections/CollectionsDeque().py
CollectionsDeque().py
py
473
python
en
code
1
github-code
6
[ { "api_name": "collections.deque", "line_number": 5, "usage_type": "call" } ]
36041027706
import bottleneck as bn import matplotlib.pyplot as plt import numpy as np dqn = np.load("./dqn/buf.npy")[:5000] double_dqn = np.load("./double_dqn/buf.npy")[:5000] duel_dqn = np.load("./dueling_dqn/buf.npy")[:5000] dqn = bn.move_mean(dqn, 100, 1) double_dqn = bn.move_mean(double_dqn, 100, 1) duel_dqn = bn.move_mean(...
ppaanngggg/rl_course
09/show.py
show.py
py
499
python
en
code
0
github-code
6
[ { "api_name": "numpy.load", "line_number": 5, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 6, "usage_type": "call" }, { "api_name": "numpy.load", "line_number": 7, "usage_type": "call" }, { "api_name": "bottleneck.move_mean", "line_number...
40786160807
import pandas as file from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import train_test_split forest_model = RandomForestClassifier(criterion='gini', n_estimators=60, min_samples_split=11, min_sam...
kiper00/DataMining
Hw1/Hw.py
Hw.py
py
2,273
python
en
code
0
github-code
6
[ { "api_name": "sklearn.ensemble.RandomForestClassifier", "line_number": 5, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 13, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 34, "usage_type": "call"...
28395377944
import struct import random import sys import pathlib import mmap import heapq path = pathlib.Path(sys.argv[1]) def partition(A, elem_start, elem_stop, elem_size, key_start, key_stop): pivot_index = random.randint(elem_start, elem_stop) pivot = A[pivot_index * elem_size + key_start : pivot_index * elem...
cwpearson/graph-datasets
tools/util/sort.py
sort.py
py
4,529
python
en
code
1
github-code
6
[ { "api_name": "pathlib.Path", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "random.randint", "line_number": 14, "usage_type": "call" }, { "api_name": "heapq.heappush", "line_nu...
8655592927
import argparse import os from pathlib import Path from validation import validation_binary, validation_multi import torch from torch import nn from torch.utils.data import DataLoader import torch.backends.cudnn as cudnn import torch.backends.cudnn from models import UNet11, LinkNet34, UNet, UNet16, AlbuNet from loss...
supervisely-ecosystem/unet
custom_net/train.py
train.py
py
7,610
python
en
code
2
github-code
6
[ { "api_name": "models.UNet", "line_number": 27, "usage_type": "name" }, { "api_name": "models.UNet11", "line_number": 31, "usage_type": "name" }, { "api_name": "torchvision.models.vgg.model_urls", "line_number": 33, "usage_type": "name" }, { "api_name": "models.UN...
12994697426
import sys sys.path.append("..") import segprops.segprops as segprops import cv2 import cv import componentsUtils as cmpUtls import seqscanseg import numpy as np import random def getRandomColor(srcI): r = srcI g = random.randint(0, 255) b = random.randint(0, 255) return (r, (g + 155) / 2, (b + 155) / 2) def c...
zjucsxxd/MTU_CV
segmentation/seqscanseg_test2.py
seqscanseg_test2.py
py
1,244
python
en
code
0
github-code
6
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "random.randint", "line_number": 15, "usage_type": "call" }, { "api_name": "random.randint", "line...
5290615509
from vosk import Model, KaldiRecognizer import speech_recognition import wave import json import os import webbrowser import subprocess import pyautogui import keyboard import time import pyttsx3 engine = pyttsx3.init() notasd=0 engine.say('добрый день') engine.runAndWait() def record_and_rec...
ebcah/Stupied-bot-helper
helper.py
helper.py
py
5,465
python
ru
code
0
github-code
6
[ { "api_name": "pyttsx3.init", "line_number": 12, "usage_type": "call" }, { "api_name": "speech_recognition.WaitTimeoutError", "line_number": 36, "usage_type": "attribute" }, { "api_name": "speech_recognition.UnknownValueError", "line_number": 47, "usage_type": "attribute"...
29687392897
import notification from q_learning import * from flask import Flask, request # Due to the limit temperature that DHT11 capture, temperature_threshold is limited to 50. # If using DHT22 or better sensor, this value may be changed. app = Flask(__name__) on_fire = False temperature_threshold = 50 humidity_threshold = 20...
BeaconAR/BEST
server/pie_flask.py
pie_flask.py
py
1,964
python
en
code
0
github-code
6
[ { "api_name": "flask.Flask", "line_number": 7, "usage_type": "call" }, { "api_name": "notification.send_notification", "line_number": 25, "usage_type": "call" }, { "api_name": "flask.request.get_json", "line_number": 35, "usage_type": "call" }, { "api_name": "flas...
12959022649
import numpy as np import pylab as plt import pdb import math import os from microlens.jlu import munge from microlens.jlu import model_fitter, model import shutil, os, sys import scipy import scipy.stats from scipy.stats import chi2 from astropy.table import Table from jlu.util import fileUtil from astropy.table impor...
jluastro/JLU-python-code
jlu/papers/prop_hst_cycle28mid.py
prop_hst_cycle28mid.py
py
30,997
python
en
code
9
github-code
6
[ { "api_name": "jlu.papers.lu_2019_lens.pspl_ast_multiphot", "line_number": 25, "usage_type": "attribute" }, { "api_name": "jlu.papers.lu_2019_lens", "line_number": 25, "usage_type": "name" }, { "api_name": "jlu.papers.lu_2019_lens.pspl_ast_multiphot", "line_number": 27, "...
42783692935
import numpy as np import matplotlib.pyplot as plt import file_test.readfile as rd import IMU_Process as imu import UWB.dis2pos as uwb import uwb_pdr_fusion as fusion D2R = np.pi / 180.0 init_yaw = 73 * D2R init_pos = np.array([3.08, 6.22]) # is_from_uwb这个数据是不是来着于UWB设备的IMU的 def test_pdr(is_from_uwb, file): da_s...
piapi/IMU
test_pdr_ins.py
test_pdr_ins.py
py
6,121
python
en
code
0
github-code
6
[ { "api_name": "numpy.pi", "line_number": 8, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 10, "usage_type": "call" }, { "api_name": "file_test.readfile.read_file", "line_number": 16, "usage_type": "call" }, { "api_name": "file_test.readf...
3815828434
#!/usr/bin/env python3 """ Scripts to train a keras model using tensorflow. Basic usage should feel familiar: python train_v2.py --model models/mypilot Usage: train.py [--tubs=tubs] (--model=<model>) [--type=(linear|inferred|tensorrt_linear|tflite_linear)] Options: -h --help Show this screen. """...
cl3m3nt/mycar4
train.py
train.py
py
6,746
python
en
code
0
github-code
6
[ { "api_name": "donkeycar.parts.tub_v2.Tub", "line_number": 41, "usage_type": "call" }, { "api_name": "donkeycar.utils.train_test_split", "line_number": 52, "usage_type": "call" }, { "api_name": "tensorflow.python.keras.utils.data_utils.Sequence", "line_number": 55, "usage...
5193030375
import base64 from datetime import datetime import hashlib import hmac import logging from urlparse import urlparse from Crypto import Random from Crypto.Cipher import AES from Crypto.Util import Counter __author__ = 'broken' __all__ = [ 'SecureCookieException', 'SecureCookieMaxLengthException', 'SecureC...
ef-ctx/SecureCookie
secure_cookie/cookie.py
cookie.py
py
4,760
python
en
code
0
github-code
6
[ { "api_name": "base64.urlsafe_b64decode", "line_number": 59, "usage_type": "call" }, { "api_name": "base64.urlsafe_b64encode", "line_number": 63, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 66, "usage_type": "call" }, { "api_name": "C...
6580379051
import os,sys,math,pickle import random as lrand import rpy2.robjects as robjects import argparse import numpy #import svmutil def init(): lrand.seed(1982) robjects.r('library(splines)') robjects.r('library(stats4)') robjects.r('library(survival)') robjects.r('library(mvtnorm)') robjects.r('lib...
SegataLab/lefse
lefse/lefse.py
lefse.py
py
10,669
python
en
code
62
github-code
6
[ { "api_name": "random.seed", "line_number": 9, "usage_type": "call" }, { "api_name": "rpy2.robjects.r", "line_number": 10, "usage_type": "call" }, { "api_name": "rpy2.robjects", "line_number": 10, "usage_type": "name" }, { "api_name": "rpy2.robjects.r", "line_...
74132547068
import speech_recognition as sr robot_ear = sr.Recognizer() # Set the energy threshold (adjust as needed) robot_ear.energy_threshold = 8000 STOPWORD = ["dừng lại", "dừng"] while True: with sr.Microphone() as mic: print("Robot: Tôi đang lắng nghe...") audio = robot_ear.listen(mic) ...
meohoangdeptrai1407/Thesis_Psychology
Speech/Listening/Normal Voice/Vietnamese/demo.py
demo.py
py
770
python
vi
code
0
github-code
6
[ { "api_name": "speech_recognition.Recognizer", "line_number": 3, "usage_type": "call" }, { "api_name": "speech_recognition.Microphone", "line_number": 9, "usage_type": "call" }, { "api_name": "speech_recognition.UnknownValueError", "line_number": 16, "usage_type": "attrib...
42812354931
import requests def main(): res = requests.get("https://data.fixer.io/api/latest") if res.status_code != 200: raise Exception("ERROR: API Request unsuccesful.") data = res.json() print(data) if __name__ == "__main__": main() ### DEPRECATED CODE BECAUSE FIXER.IO REQUIRES API KEY NOW, SEE...
jjjj17/CS50
APIs/currency0.py
currency0.py
py
336
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 4, "usage_type": "call" } ]
21831977004
from typing import Any, Dict from fastapi import APIRouter, Depends, Response, status from sqlalchemy.exc import OperationalError from sqlalchemy.ext.asyncio import AsyncSession from backend.api.auth import HasListAccess, UserAuth from backend.data_models.response import User from backend.db.db import get_session, pi...
phineas-fam/rental
backend/api/health/endpoints.py
endpoints.py
py
1,231
python
en
code
0
github-code
6
[ { "api_name": "fastapi.APIRouter", "line_number": 11, "usage_type": "call" }, { "api_name": "backend.api.auth.UserAuth", "line_number": 12, "usage_type": "call" }, { "api_name": "backend.api.auth.HasListAccess", "line_number": 12, "usage_type": "call" }, { "api_na...
35320906569
from selenium import webdriver from fake_headers import Headers import time url = 'https://dikidi.net/' # url = 'https://www.whatismybrowser.com/detect/what-is-my-user-agent/' headers = Headers(os="lin", headers=True).generate() print(headers) options = webdriver.FirefoxOptions() # options.add_argument(f"User-Agent...
Sergryap/loader_dikidi_catalog
firefoxdriver/main.py
main.py
py
602
python
en
code
0
github-code
6
[ { "api_name": "fake_headers.Headers", "line_number": 8, "usage_type": "call" }, { "api_name": "selenium.webdriver.FirefoxOptions", "line_number": 11, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 11, "usage_type": "name" }, { "api_name...
41993002337
import requests import json # task 3 def currency_rates(currency): response = requests.get('https://www.cbr-xml-daily.ru/daily_json.js') result = json.loads(response.text) registr = currency.isupper() currency_1 = 0 if registr == False: currency_1 = currency.upper() else: curre...
UraKuleshov/Python-Homework
currency_rates.py
currency_rates.py
py
594
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 7, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 8, "usage_type": "call" } ]
36092791308
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import import gevent from napixd.client.gevent import Client from napixd.client.client import coerce_authenticator class ClientPool(object): """ A class that handles multiples clients and forward request. *authenticator*...
napix/NapixServer
napixd/client/pool.py
pool.py
py
2,789
python
en
code
1
github-code
6
[ { "api_name": "napixd.client.client.coerce_authenticator", "line_number": 31, "usage_type": "call" }, { "api_name": "napixd.client.gevent.Client", "line_number": 46, "usage_type": "call" }, { "api_name": "gevent.spawn", "line_number": 49, "usage_type": "call" }, { ...
6380996294
import torch import argparse import datetime import os import json from torch.utils.data import DataLoader import torch.optim as optim import torch.nn as nn from torch.optim.lr_scheduler import ReduceLROnPlateau from dataset import VentilatorDatasetMLP, VentilatorDatasetLSTM from models.lstm import LSTM from models.t...
sherif-abdelkarim/ventilator_pressure_prediction
test.py
test.py
py
3,115
python
en
code
0
github-code
6
[ { "api_name": "argparse.ArgumentParser", "line_number": 18, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 31, "usage_type": "call" }, { "api_name": "os.path", "line_number": 31, "usage_type": "attribute" }, { "api_name": "os.path.join", ...
74147629628
# coding: utf-8 """ Telegram bot utils. @author: Sébastien Renard (sebastien.renard@digitalfox.org) @license: AGPL v3 or newer (http://www.gnu.org/licenses/agpl-3.0.html) """ from asgiref.sync import SyncToAsync from datetime import datetime, date from django.db import close_old_connections from django.db.models imp...
digitalfox/pydici
bot/utils.py
utils.py
py
2,305
python
en
code
122
github-code
6
[ { "api_name": "asgiref.sync.SyncToAsync", "line_number": 21, "usage_type": "name" }, { "api_name": "django.db.close_old_connections", "line_number": 24, "usage_type": "call" }, { "api_name": "django.db.close_old_connections", "line_number": 28, "usage_type": "call" }, ...
72589124347
# -*- coding: utf-8 -*- """ The :program:`celery` umbrella command. .. program:: celery .. _preload-options: Preload Options --------------- These options are supported by all commands, and usually parsed before command-specific arguments. .. cmdoption:: -A, --app app instance to use (e.g. ``module.attr_name...
DMills27/CMS-Django-Application
lib/python2.7/site-packages/celery-4.0.0rc3-py2.7.egg/celery/bin/celery.py
celery.py
py
37,761
python
en
code
0
github-code
6
[ { "api_name": "numbers.Integral", "line_number": 319, "usage_type": "attribute" }, { "api_name": "celery.platforms.EX_OK", "line_number": 321, "usage_type": "name" }, { "api_name": "celery.platforms.EX_FAILURE", "line_number": 321, "usage_type": "name" }, { "api_n...
73966289788
#!/usr/bin/env python # -*- coding:utf-8 -*- import requests import re import json if __name__ == "__main__": url = 'https://pic.qiushibaike.com/system/pictures/12433/124337776/medium/SKD4RPPD6AXG7D6Z.jpg' #content返回的是二进制的图片数据 #text:字符串 #content:二进制 #json():对象 img_data = requests.get(url=url)....
xjuun/Note
Python/爬虫/code/数据解析/0.图片爬取.py
0.图片爬取.py
py
481
python
en
code
0
github-code
6
[ { "api_name": "requests.get", "line_number": 14, "usage_type": "call" } ]
11102815050
from tqdm import tqdm import wrsus.tools as tools import wrsus.package_xml_iterator as pxi import wrsus.database as db import wrsus.datastructures as datastructures import wrsus.tables as tables import logging import datetime def get_catalog(): url = 'http://download.windowsupdate.com/microsoftupdate/v6/wsussca...
MartijnBraam/wrsus
wrsus/bootstrap.py
bootstrap.py
py
4,634
python
en
code
1
github-code
6
[ { "api_name": "logging.info", "line_number": 16, "usage_type": "call" }, { "api_name": "wrsus.tools.fetch", "line_number": 17, "usage_type": "call" }, { "api_name": "wrsus.tools", "line_number": 17, "usage_type": "name" }, { "api_name": "logging.info", "line_n...
17510481243
''' i/o arr = [3, 9, 12, 20, 2] ^ target = 11 ans = [2, 9] arr = [3, 9, 12, 20, 2] target = 2 ans = null constraints -order doesn't matter -actual values psuedocode- i, j: i < j => O(n^2) method 1: sort the array -> O(n lg n) - time. vs O(n) ? method 2: hash set ''' from typing import List de...
soji-omiwade/cs
dsa/before_rubrik/twosum_jp.py
twosum_jp.py
py
740
python
en
code
0
github-code
6
[ { "api_name": "typing.List", "line_number": 23, "usage_type": "name" } ]
30367930621
from numpy import linspace, sin from chaco.api import ArrayPlotData, HPlotContainer, Plot from enable.api import ComponentEditor from traits.api import HasTraits, Instance from traitsui.api import Item, View class ContainerExample(HasTraits): plot = Instance(HPlotContainer) traits_view = View( Item...
enthought/chaco
examples/user_guide/h_plot_container.py
h_plot_container.py
py
1,154
python
en
code
286
github-code
6
[ { "api_name": "traits.api.HasTraits", "line_number": 9, "usage_type": "name" }, { "api_name": "traits.api.Instance", "line_number": 11, "usage_type": "call" }, { "api_name": "chaco.api.HPlotContainer", "line_number": 11, "usage_type": "argument" }, { "api_name": "...
2600747319
import vnstock as vs API_KEY="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" model="text-davinci-003" #ham lay ma ngan hang def get_ticket(): cp=vs.listing_companies() check='ngân hàng thương mại cổ phần' ticket=[] for n in range(len(cp)): if check in cp.loc[n][2].lower(): tick...
vanvy102/code
Code-test/config.py
config.py
py
1,194
python
vi
code
0
github-code
6
[ { "api_name": "vnstock.listing_companies", "line_number": 6, "usage_type": "call" }, { "api_name": "vnstock.listing_companies", "line_number": 14, "usage_type": "call" }, { "api_name": "vnstock.listing_companies", "line_number": 22, "usage_type": "call" } ]
74152934907
import cv2 import numpy as np import imutils image = cv2.imread('images/XsSOP.jpg') image = imutils.resize(image, width=800) gray = cv2.cvtColor(image,cv2.COLOR_BGR2GRAY) ret,thresh = cv2.threshold(gray,0,255,cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU) kernel = np.ones((3,6), np.uint8) img_dilation = cv2.dilate(thresh...
tomj0311/ai-ml-imaging
pre-processing/sgmnt.py
sgmnt.py
py
889
python
en
code
0
github-code
6
[ { "api_name": "cv2.imread", "line_number": 5, "usage_type": "call" }, { "api_name": "imutils.resize", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_nu...
10664592532
import configparser import os import time from pyspark.sql import SparkSession from pyspark.sql.functions import year, month, dayofmonth, hour, weekofyear, \ to_timestamp, dayofweek, monotonically_increasing_id from pyspark.sql.types import StructType as R, StructField as Fld, \ DoubleType as Dbl, StringType as...
aandersland/udacity-data-engineering-nanodegree
data_lake_spark/etl.py
etl.py
py
7,480
python
en
code
1
github-code
6
[ { "api_name": "configparser.ConfigParser", "line_number": 10, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 14, "usage_type": "attribute" }, { "api_name": "os.environ", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pyspark.sql...
21929015947
# Requests Module import requests url = "https://api.github.com/events" # gr = requests.get(url) # # print(gr.text) # print(gr.status_code) # dr = requests.delete(url) # # print(dr.status_code) # # print(dr.text) # hr = requests.head(url) # # print(hr.headers) # # print(hr.text) # # print(hr.status_code) # # par ...
MahbinAhmed/Learning
Python/Python Learning/Revision/Requests Module.py
Requests Module.py
py
1,231
python
en
code
0
github-code
6
[ { "api_name": "requests.session", "line_number": 54, "usage_type": "call" } ]
5424572128
#https://www.edureka.co/blog/web-scraping-with-python/ from selenium import webdriver from bs4 import BeautifulSoup import pandas as pd import csv from selenium.webdriver.chrome.service import Service ser = Service("/usr/lib/chromium-browser/chromedriver") driver = webdriver.Chrome(service=ser) products=[] #List ...
Samsonasumu/web_scrapping
scrape.py
scrape.py
py
1,226
python
en
code
1
github-code
6
[ { "api_name": "selenium.webdriver.chrome.service.Service", "line_number": 9, "usage_type": "call" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 13, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 13, "usage_type": "name" }, { ...
19644775546
from vplaned import Controller from collections import Counter, defaultdict def main(): dp_interface_stats = defaultdict(Counter) dp_stats = defaultdict(dict) with Controller() as controller: for dp in controller.get_dataplanes(): with dp: for key, value in dp.json_comm...
danos/vyatta-service-export
scripts/vyatta_flow_monitoring_show_dataplane.py
vyatta_flow_monitoring_show_dataplane.py
py
1,708
python
en
code
0
github-code
6
[ { "api_name": "collections.defaultdict", "line_number": 5, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 5, "usage_type": "argument" }, { "api_name": "collections.defaultdict", "line_number": 6, "usage_type": "call" }, { "api_name": "...
29184874114
import pandas as pd import pyarrow as pa import pyarrow.parquet as pq import logging class Converter: def __init__(self, compression=None, log_level=logging.CRITICAL): self.compression = compression logging.basicConfig(format="", level=log_level) def convert_parquet_to_csv_file(self, in_file...
zbokostya/coherent-training
Task1/converter.py
converter.py
py
2,279
python
en
code
0
github-code
6
[ { "api_name": "logging.CRITICAL", "line_number": 8, "usage_type": "attribute" }, { "api_name": "logging.basicConfig", "line_number": 11, "usage_type": "call" }, { "api_name": "pandas.read_parquet", "line_number": 15, "usage_type": "call" }, { "api_name": "logging....
37786033395
import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.linear_model import LogisticRegression import joblib #function load_data which randomly generates data #from utils import load_data as pandas dataframe #load_data as pandas datafra...
ShanthaKumarR/Diabetic-Retinopathy
data_analysis.py
data_analysis.py
py
2,182
python
en
code
0
github-code
6
[ { "api_name": "pandas.read_csv", "line_number": 15, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "sklearn.model_selection.train_test_split", "line_number": 19, "usage_type": "call" }, { "api_name...
20060348387
# coding:utf-8 import selenium.webdriver #模拟浏览器 import re def gethtml(city,name): url ="https://search.51job.com/list/"+city+",000000,0000,00,9,99,"+name+",2,1.html?lang=c&stype=&postchannel=0000&workyear=99&cotype=99&degreefrom=99&jobterm=99&companysize=99&providesalary=99&lonlat=0%2C0&radius=-1&ord_field...
wanglishuai123/51job
51job调用浏览器.py
51job调用浏览器.py
py
1,653
python
en
code
0
github-code
6
[ { "api_name": "selenium.webdriver.webdriver.Chrome", "line_number": 8, "usage_type": "call" }, { "api_name": "selenium.webdriver.webdriver", "line_number": 8, "usage_type": "attribute" }, { "api_name": "selenium.webdriver", "line_number": 8, "usage_type": "name" }, { ...
7090639814
import openai from flask import Flask, request, jsonify openai.api_key = 'YOUR_OPENAI_API_KEY' def interview_coach(question): try: prompt = f"You are my programming expert, your job is to come with a precise answer to the '{question}' in the below format:\n1. Answer to the {question}\n2. Real Life Ex...
Jenifer-TheCoder/AI-Interview-Coach-using-Python-and-OpenAI-API
AI-Interview-Coach.py
AI-Interview-Coach.py
py
1,238
python
en
code
1
github-code
6
[ { "api_name": "openai.api_key", "line_number": 4, "usage_type": "attribute" }, { "api_name": "openai.ChatCompletion.create", "line_number": 8, "usage_type": "call" }, { "api_name": "openai.ChatCompletion", "line_number": 8, "usage_type": "attribute" }, { "api_name...
39757313863
import tkinter from tkinter import ttk from tkinter import * import matplotlib.pyplot as plt import json import http.client from datetime import datetime conn = http.client.HTTPSConnection("api.covid19api.com") headers = { 'content-type': "application/json", 'authorization': "apikey your_token" ...
OgiBalboa/covid19monitoring
main.py
main.py
py
4,424
python
tr
code
0
github-code
6
[ { "api_name": "http.client.client.HTTPSConnection", "line_number": 8, "usage_type": "call" }, { "api_name": "http.client.client", "line_number": 8, "usage_type": "attribute" }, { "api_name": "http.client", "line_number": 8, "usage_type": "name" }, { "api_name": "j...