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
8660980424
import numpy as np from ctypes import * # c 类型库 import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from astropy.io import ascii from astropy.table import Table, vstack import os from scipy.stats import * import time z4figpre = '../z4/figs/' z4datapre = '../z4/data/' z5figpre = '../z5/figs/' z5data...
lovetomatoes/BHMF
PYmodule/__init__.py
__init__.py
py
8,267
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.use", "line_number": 4, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.get_cmap", "line_number": 61, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 61, "usage_type": "name" }, { "api_name": "numpy.min"...
2628647448
import os import cv2 import glob import numpy as np import matplotlib.pyplot as plt from tqdm import tqdm import random from ipdb import set_trace as bp size_h, size_w = 600, 600 from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data', one_hot=False, dtype='uint8') ob...
nguyenvantui/mnist-object-detection
mnist_gen.py
mnist_gen.py
py
8,145
python
en
code
1
github-code
36
[ { "api_name": "tensorflow.examples.tutorials.mnist.input_data.read_data_sets", "line_number": 12, "usage_type": "call" }, { "api_name": "tensorflow.examples.tutorials.mnist.input_data", "line_number": 12, "usage_type": "name" }, { "api_name": "os.path.exists", "line_number": ...
39076799665
from string import ascii_lowercase class Node: def __init__(self, val, parents = []): self.val = val self.parents = parents def __str__(self): return self.val from collections import deque from string import ascii_lowercase class Solution: def findLadders(self, beginWord: str, endWor...
YuxiLiuAsana/LeetCodeSolution
q0126.py
q0126.py
py
2,196
python
en
code
0
github-code
36
[ { "api_name": "collections.deque", "line_number": 15, "usage_type": "call" }, { "api_name": "string.ascii_lowercase", "line_number": 36, "usage_type": "name" } ]
74274579943
import pytest import ruleset import util import os def get_testdata(rulesets): """ In order to do test-level parametrization (is this a word?), we have to bundle the test data from rulesets into tuples so py.test can understand how to run tests across the whole suite of rulesets """ testdata = ...
fastly/ftw
ftw/pytest_plugin.py
pytest_plugin.py
py
3,940
python
en
code
263
github-code
36
[ { "api_name": "ruleset.tests", "line_number": 14, "usage_type": "attribute" }, { "api_name": "ruleset.Test", "line_number": 25, "usage_type": "attribute" }, { "api_name": "pytest.fixture", "line_number": 33, "usage_type": "attribute" }, { "api_name": "pytest.fixtu...
18701687808
import numpy as np from numpy import linalg as LA from keras.applications.vgg16 import VGG16 from keras.preprocessing import image from keras.applications.vgg16 import preprocess_input from PIL import Image from cv2 import imread,resize,cvtColor,COLOR_BGR2RGB,INTER_AREA,imshow ''' VGG16模型,权重由ImageNet训练而来 使用vgg16模型提取特...
935048000/ImageSearch
core/feature_extraction.py
feature_extraction.py
py
1,808
python
en
code
1
github-code
36
[ { "api_name": "keras.applications.vgg16.VGG16", "line_number": 25, "usage_type": "call" }, { "api_name": "cv2.imread", "line_number": 26, "usage_type": "call" }, { "api_name": "cv2.resize", "line_number": 27, "usage_type": "call" }, { "api_name": "cv2.INTER_AREA",...
43135278080
# Mnemonic: em.py # Abstract: Run em (Expectation Maximisation) # # Author: E. Scott Danies # Date: 06 March 2019 # # Acknowledgements: # This code is based in part on information gleaned from, or # code examples from the following URLs: # https://github.com/minmingzhao?...
ScottDaniels/gtcs7641
a3/em.py
em.py
py
4,623
python
en
code
0
github-code
36
[ { "api_name": "tools.printf", "line_number": 39, "usage_type": "call" }, { "api_name": "tools.str_flag", "line_number": 46, "usage_type": "name" }, { "api_name": "tools.bool_flag", "line_number": 47, "usage_type": "name" }, { "api_name": "tools.int_flag", "lin...
1054566885
# -*- coding = utf-8 -*- # @Time : 2021/5/5 18:25 # @Author : 水神与月神 # @File : 灰度转彩色.py # @Software : PyCharm import cv2 as cv import numpy as np import os import mypackage.dip_function as df # demo # path = r"C:\Users\dell\Desktop\8.png" # # image = cv.imread(path, cv.IMREAD_UNCHANGED) # # image1 = image[:, :, 0] # ...
mdwalu/previous
数字图像处理/灰度转彩色.py
灰度转彩色.py
py
2,065
python
en
code
1
github-code
36
[ { "api_name": "os.listdir", "line_number": 36, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 39, "usage_type": "call" }, { "api_name": "os.path", "line_number": 39, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number"...
3572388059
## # @file mathlib.py # @package mathlib # @brief Module with functions to convert and evaluate expression using expression tree import treeClass import logging # """Priorities of operators""" priority = { '!' : 3, '^' : 2, '*' : 1, '/' : 1, '%' : 1, '+' : 0, '-' : 0, } # """Associativit...
Hedgezi/jenna_calcutega
src/mathlib.py
mathlib.py
py
4,055
python
en
code
0
github-code
36
[ { "api_name": "treeClass.Stack", "line_number": 57, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 100, "usage_type": "call" }, { "api_name": "logging.debug", "line_number": 117, "usage_type": "call" }, { "api_name": "logging.debug", "li...
70167417064
from mongoengine import Q from django_pds.conf import settings from django_pds.core.managers import UserReadableDataManager, GenericReadManager, UserRoleMapsManager from django_pds.core.rest.response import error_response, success_response_with_total_records from django_pds.core.utils import get_fields, get_document, ...
knroy/django-pds
django_pds/core/pds/generic/read.py
read.py
py
6,463
python
en
code
3
github-code
36
[ { "api_name": "django_pds.conf.settings.SELECT_NOT_ALLOWED_ENTITIES", "line_number": 12, "usage_type": "attribute" }, { "api_name": "django_pds.conf.settings", "line_number": 12, "usage_type": "name" }, { "api_name": "django_pds.conf.settings.SECURITY_ATTRIBUTES", "line_numbe...
20145639624
""" Cobweb plot function """ import numpy as np import matplotlib.pyplot as plt __all__ = [ 'cobweb' ] def cobweb(func, initial_conditon, nsteps, limits, args=(), ax=None): """ Plot cobweb diagram for onedimensional iterated functions ``x[n+1] = func(x[n])``. Parameters ---------- func ...
antonior92/dynamic-system-plot
dynplt/cobweb.py
cobweb.py
py
1,586
python
en
code
1
github-code
36
[ { "api_name": "matplotlib.pyplot.subplots", "line_number": 37, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 37, "usage_type": "name" }, { "api_name": "numpy.linspace", "line_number": 40, "usage_type": "call" } ]
5765246532
import pyautogui import schedule import time import datetime import random pyautogui.FAILSAFE = False screenWidth, screenHeight = pyautogui.size() # Get the size of the primary monitor. currentMouseX, currentMouseY = pyautogui.position() # Get the XY position of the mouse. datetime.datetime.now() print(datetime.date...
jbernax/autoclicktimer
autoclick.py
autoclick.py
py
5,721
python
en
code
0
github-code
36
[ { "api_name": "pyautogui.FAILSAFE", "line_number": 6, "usage_type": "attribute" }, { "api_name": "pyautogui.size", "line_number": 8, "usage_type": "call" }, { "api_name": "pyautogui.position", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datet...
73313388265
# %% import csv import sys import numpy as np import pandas as pd import os from matplotlib import pyplot as plt # plt.rcParams['font.sans-serif'] = ['Times New Roman'] # 找到全局最优 10 20 41 # 不断找到最优 15 34 filename1 = "results/Cifar10-center/LeNet/record_sgd weight.csv" filename2 = "results/Cifar10-center/LeNet/recor...
zhengLabs/FedLSC
painting/painting_weight_change.py
painting_weight_change.py
py
1,279
python
en
code
1
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 20, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 21, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.clf", "line_number": 31, "usage_type": "call" }, { "api_name": "matplotlib.pypl...
35584359150
from zipfile import ZipFile import matplotlib.pyplot as plt import numpy as np import pandas as pd from sklearn import datasets, linear_model from sklearn.metrics import mean_squared_error, r2_score from sklearn.model_selection import train_test_split, cross_val_score from sklearn.preprocessing import StandardScaler i...
Kamkas/Bike-Sharing-Data-Analysis
lr.py
lr.py
py
2,416
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.linear_model.LinearRegression", "line_number": 62, "usage_type": "call" }, { "api_name": "sklearn.linear_model", "line_number": 62, "usage_type": "name" }, { "api_na...
11370165603
import numpy as np import torch import torch.nn as nn from ml.modules.backbones import Backbone from ml.modules.bottoms import Bottom from ml.modules.heads import Head from ml.modules.layers.bifpn import BiFpn from ml.modules.tops import Top class BaseModel(nn.Module): def __init__(self, config): super()...
gregiberri/DepthPrediction
ml/models/base_model.py
base_model.py
py
4,058
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 12, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 12, "usage_type": "name" }, { "api_name": "ml.modules.bottoms.Bottom", "line_number": 16, "usage_type": "call" }, { "api_name": "ml.modules.ba...
44575910113
from dbmanager import DatabaseManager from tgbot import Bot from market import Market from plot_provider import PlotProvider import threading import sys import logging import logging.handlers import queue from apscheduler.schedulers.background import BackgroundScheduler class MarketManager: def __init__(self, pa...
hype-ecosystem/predictions_bot
market_manager.py
market_manager.py
py
3,531
python
en
code
2
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 17, "usage_type": "call" }, { "api_name": "logging.ERROR", "line_number": 18, "usage_type": "attribute" }, { "api_name": "logging.handlers.SysLogHandler", "line_number": 19, "usage_type": "call" }, { "api_name": "l...
73895256743
import numpy as np import torch from torch.utils.data import Dataset import pickle as pkl def valence_map(elements: list, valences: list): """ ## Given a list of elements and their corresponding valences, create a dictionary mapping each element to its valence. ### Args: - elements: a list of ele...
Airscker/DeepMuon
DeepMuon/dataset/XASData.py
XASData.py
py
4,337
python
en
code
1
github-code
36
[ { "api_name": "torch.utils.data.Dataset", "line_number": 33, "usage_type": "name" }, { "api_name": "pickle.load", "line_number": 55, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 63, "usage_type": "call" }, { "api_name": "numpy.array", "l...
43069956711
import csv import io from Crypto.Signature import pkcs1_15 from Crypto.PublicKey import RSA from Crypto.Hash import SHA256, SHA gSigner = "signer@stem_app" def loadVoters(fname): try: voters = {s['studNr']: s for s in csv.DictReader( loadFile(fname), delimiter=';')} return voters ...
Tataturk/stem_app
audit.py
audit.py
py
2,468
python
en
code
0
github-code
36
[ { "api_name": "csv.DictReader", "line_number": 13, "usage_type": "call" }, { "api_name": "csv.DictReader", "line_number": 22, "usage_type": "call" }, { "api_name": "io.StringIO", "line_number": 30, "usage_type": "attribute" }, { "api_name": "Crypto.PublicKey.RSA.i...
71910544423
from collections import OrderedDict from Models.Utils.FRRN_utils import * class FRRNet(nn.Module): """ implementation table A of Full-Resolution Residual Networks """ def __init__(self, in_channels=3, out_channels=21, layer_blocks=(3, 4, 2, 2)): super(FRRNet, self).__init__() # 5×5 ...
akshatgarg99/FRR-Net
Models/FRRN.py
FRRN.py
py
2,658
python
en
code
0
github-code
36
[ { "api_name": "collections.OrderedDict", "line_number": 15, "usage_type": "call" } ]
37664896770
from page.E_confirm_order_page import ConfirmOrderPage class MyOrderPage(ConfirmOrderPage): """我的订单页面""" order_sn_loc = ('id', 'com.tpshop.malls:id/order_sn_tv') # 订单编号 to_be_received_loc = ('id','com.tpshop.malls:id/status_receive_tv') # 待收货 back_loc = ('id','com.tpshop.malls:id/title_back_img') # ...
15008477526/-
APP_aaaaaaaa/page/F_my_order.py
F_my_order.py
py
2,633
python
en
code
0
github-code
36
[ { "api_name": "page.E_confirm_order_page.ConfirmOrderPage", "line_number": 4, "usage_type": "name" }, { "api_name": "common.base_app.open_app", "line_number": 42, "usage_type": "call" }, { "api_name": "page.E_confirm_order_page.ConfirmOrderPage", "line_number": 43, "usage...
18482251122
import math import torch import torch.nn as nn import torch.nn.functional as F class BasicBlock(nn.Module): expansion = 1 def __init__(self, inplanes, planes, stride=1): super(BasicBlock, self).__init__() self.conv1 = nn.Conv2d(inplanes, inplanes, 1, stride, bias=False) self.bn1 = nn....
TWSFar/DSSD
model/decoder.py
decoder.py
py
3,824
python
en
code
8
github-code
36
[ { "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": 12, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
33078013582
# pylint: disable=W0102 # pylint: disable=W0212 # pylint: disable=W0221 # pylint: disable=W0231 # pylint: disable=W0640 # pylint: disable=C0103 """Module for representing UDS corpora.""" import os import json import requests from pkg_resources import resource_filename from os.path import basename, splitext from loggi...
decompositional-semantics-initiative/decomp
decomp/semantics/uds/corpus.py
corpus.py
py
26,248
python
en
code
56
github-code
36
[ { "api_name": "typing.Union", "line_number": 37, "usage_type": "name" }, { "api_name": "typing.TextIO", "line_number": 37, "usage_type": "name" }, { "api_name": "predpatt.PredPattCorpus", "line_number": 40, "usage_type": "name" }, { "api_name": "pkg_resources.reso...
30629658909
#!/usr/bin/env python # coding: utf-8 # In[1]: import json, urllib import plotly.graph_objects as go import pandas as pd import numpy as np # In[2]: asi_measures = pd.read_csv('final-data.csv') asi_measures.head() # In[4]: all_nodes = asi_measures.Category.values.tolist() + asi_measures.ASI.values.tolist() s...
nikolamedi/sankey-diagram
Sankey diagram with plotly.py
Sankey diagram with plotly.py
py
912
python
en
code
0
github-code
36
[ { "api_name": "pandas.read_csv", "line_number": 16, "usage_type": "call" }, { "api_name": "plotly.graph_objects.Figure", "line_number": 27, "usage_type": "call" }, { "api_name": "plotly.graph_objects", "line_number": 27, "usage_type": "name" }, { "api_name": "plot...
34091963292
from loader import dp, bot from aiogram.types import ContentType, Message from pathlib import Path # kelgan hujjatlar (rasm/video/audio...) downloads/categories papkasiga tushadi download_path = Path().joinpath("downloads","categories") download_path.mkdir(parents=True, exist_ok=True) @dp.message_handler() async def ...
BakhtiyarTayir/mukammal-bot
handlers/users/docs_handlers.py
docs_handlers.py
py
1,536
python
en
code
0
github-code
36
[ { "api_name": "pathlib.Path", "line_number": 6, "usage_type": "call" }, { "api_name": "aiogram.types.Message", "line_number": 10, "usage_type": "name" }, { "api_name": "loader.dp.message_handler", "line_number": 9, "usage_type": "call" }, { "api_name": "loader.dp"...
35896409907
from typing import NamedTuple, Optional, List, Dict, Any, Union from enum import Enum, auto import pysam def _build_filter(rec: pysam.VariantRecord) -> List[Union[str, int]]: return [f for f in rec.filter] def _build_info(rec: pysam.VariantRecord) -> Dict[str, Any]: info = dict() for key, value in rec....
EUCANCan/variant-extractor
src/variant_extractor/variants.py
variants.py
py
8,031
python
en
code
3
github-code
36
[ { "api_name": "pysam.VariantRecord", "line_number": 7, "usage_type": "attribute" }, { "api_name": "typing.List", "line_number": 7, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 7, "usage_type": "name" }, { "api_name": "pysam.VariantRecord", ...
25046698571
#!/usr/bin/python import json import re import os import sys # Get data.json from Twitter for # Followers: https://oauth-playground.glitch.me/?id=usersIdFollowers&params=%28%27user.fields%21%27description%27%29_ # Followings: https://oauth-playground.glitch.me/?id=usersIdFollowing&params=%28%27user.fields%21%27descr...
tjosten/twitter-mastodon-finder
finder.py
finder.py
py
983
python
en
code
0
github-code
36
[ { "api_name": "os.path.join", "line_number": 12, "usage_type": "call" }, { "api_name": "os.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "sys.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "json.load", "line_number"...
4197719073
"""Utilities for plotting the results of the experiments.""" import os import json import numpy as np import pandas as pd import matplotlib matplotlib.use("pdf") # Avoid trouble when generating pdf's on a distant server # matplotlib.use("TkAgg") # Be able to import matplotlib in ipython import matplotlib.pyplot as plt ...
RobinVogel/Weighted-Empirical-Risk-Minimization
plot_utils.py
plot_utils.py
py
10,788
python
en
code
1
github-code
36
[ { "api_name": "matplotlib.use", "line_number": 7, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line_number": 15, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 15, "usage_type": "name" }, { "api_name": "matplotlib.pyp...
9896960203
#!/usr/bin/env python3 #-*- coding: utf-8 -*- import os import sys import rospy import numpy as np import cv2 from sensor_msgs.msg import Image, CompressedImage from cv_bridge import CvBridge, CvBridgeError from darknet_ros_msgs.msg import BoundingBoxes, ObjectCount class Bridge(object): """압축된 이미지를 센서 메세지 형태로 ...
Taemin0707/minibot_control
pedestrian_tracking/src/visualizing.py
visualizing.py
py
2,884
python
en
code
0
github-code
36
[ { "api_name": "cv_bridge.CvBridge", "line_number": 20, "usage_type": "call" }, { "api_name": "darknet_ros_msgs.msg.BoundingBoxes", "line_number": 21, "usage_type": "call" }, { "api_name": "rospy.Publisher", "line_number": 25, "usage_type": "call" }, { "api_name": ...
39154979229
from typing import Callable def format_number(number: int) -> str: num = float(f"{number:.3g}") magnitude = 0 format_human: Callable[[float], str] = lambda x: f"{x:f}".rstrip("0").rstrip(".") while abs(num) >= 1000: magnitude += 1 num /= 1000.0 return f"{format_human(num)}{['', ...
SkyLissh/skylet-discord
app/utils/format_number.py
format_number.py
py
358
python
en
code
0
github-code
36
[ { "api_name": "typing.Callable", "line_number": 8, "usage_type": "name" } ]
12685785417
import itertools from itertools import izip, cycle import os import string import glob from moduleBaseClass import ModuleBaseClass class XorStuff: def __init__(self, filepath=None): """Constructor : set xored file (optional) """ self.file_type = None self.list_types = self.load_f...
tengwar/xorstuff
xorstuff.py
xorstuff.py
py
4,032
python
en
code
0
github-code
36
[ { "api_name": "glob.glob", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path.splitext", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "moduleBaseClass.ModuleBaseCla...
8036114944
from django.shortcuts import render, get_object_or_404 from django.http import HttpResponseRedirect from django.urls import reverse from django.views import generic #from django.template import loader # no longer needed b/c of render shortcut from .models import Question, Choice # Create your views here. class Index...
Alex-Bishka/Languages
Django/mysite/polls/views.py
views.py
py
3,562
python
en
code
0
github-code
36
[ { "api_name": "django.views.generic.ListView", "line_number": 10, "usage_type": "attribute" }, { "api_name": "django.views.generic", "line_number": 10, "usage_type": "name" }, { "api_name": "models.Question.objects.order_by", "line_number": 18, "usage_type": "call" }, ...
11473243619
import os import zipfile from abc import ABCMeta from pathlib import Path from typing import Optional, Union from urllib.request import urlretrieve class BaseDownloader(metaclass=ABCMeta): """Base downloader for all Movielens datasets.""" DOWNLOAD_URL: str DEFAULT_PATH: str def __init__(self, zip_pa...
smartnews/rsdiv
src/rsdiv/dataset/base.py
base.py
py
876
python
en
code
7
github-code
36
[ { "api_name": "abc.ABCMeta", "line_number": 9, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 15, "usage_type": "name" }, { "api_name": "typing.Union", "line_number": 15, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_numb...
16539248084
import markovify import sys import argparse import configparser import twitter model_depth_default = 2 model_depth = model_depth_default def main(): arg_parser = argparse.ArgumentParser(description="Generate text with Markov chains based on a source corpus.") subparser = arg_parser.add_subparsers(dest="subparser_na...
nanovad/poorlytrained
poorlytrained.py
poorlytrained.py
py
2,216
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 11, "usage_type": "call" }, { "api_name": "configparser.ConfigParser", "line_number": 25, "usage_type": "call" }, { "api_name": "sys.stderr.write", "line_number": 35, "usage_type": "call" }, { "api_name": "sy...
33066511083
""" enums.py Contains the different types of objects for the application. """ # Import modules and libraries from enum import Enum class UserType(Enum): """ Represents the different types of users in the application. """ admin = "admin" manager = "manager" inspector = "inspector" maintenan...
Xata/cis4050-spring2023-prototipo
backend/app/enums.py
enums.py
py
1,280
python
en
code
0
github-code
36
[ { "api_name": "enum.Enum", "line_number": 9, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 21, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 33, "usage_type": "name" }, { "api_name": "enum.Enum", "line_number": 44, "...
28555182089
# This is a sample Python script. # Press ⌃R to execute it or replace it with your code. # Press Double ⇧ to search everywhere for classes, files, tool windows, actions, and settings. import sys import asyncio import datetime import time import collections import json # function to execute aws cli 'iam' command async...
SeungwookE/InvalidAccessKeyDetector
main.py
main.py
py
3,645
python
en
code
0
github-code
36
[ { "api_name": "asyncio.create_subprocess_shell", "line_number": 16, "usage_type": "call" }, { "api_name": "asyncio.subprocess", "line_number": 18, "usage_type": "attribute" }, { "api_name": "asyncio.subprocess", "line_number": 19, "usage_type": "attribute" }, { "a...
10663941067
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Fri Oct 21 16:38:00 2016 @author: Neo Oct 25, 2016: updated by Niu. """ import numpy as np import matplotlib.pyplot as plt res_dir = '../results/' dat_fil = ['OVrot.dat', 'GRrot.dat'] #glide for the three special catalog w3 = np.loadtxt(res_dir + 'Speci...
Niu-Liu/thesis-materials
sou-selection/progs/RotationPlot.py
RotationPlot.py
py
5,084
python
en
code
0
github-code
36
[ { "api_name": "numpy.loadtxt", "line_number": 18, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.loadtxt", "line_n...
15193997907
from enum import Enum from dynsimf.models.helpers.ConfigValidator import ConfigValidator from dynsimf.models.components.conditions.Condition import Condition __author__ = "Mathijs Maijer" __email__ = "m.f.maijer@gmail.com" class UpdateType(Enum): ''' An Enum to specify the type of the update ''' STAT...
Tensaiz/DyNSimF
dynsimf/models/components/Update.py
Update.py
py
4,795
python
en
code
4
github-code
36
[ { "api_name": "enum.Enum", "line_number": 9, "usage_type": "name" }, { "api_name": "dynsimf.models.helpers.ConfigValidator.ConfigValidator.validate", "line_number": 58, "usage_type": "call" }, { "api_name": "dynsimf.models.helpers.ConfigValidator.ConfigValidator", "line_numbe...
73550814184
#-*- coding: utf-8 -*- ''' 1. 添加系:adddepartment 2. 添加班级:addclass 3. 删除系:deldepartment 4. 删除班级:delclass 5. 编辑系:editdepartment 6. 编辑班级:editclass ''' from django.shortcuts import render_to_response from django.template import RequestContext, Template, Context from classes.models import Class, Department from teachers.mo...
Luokun2016/QuickSort
classes/views.py
views.py
py
7,941
python
en
code
0
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 20, "usage_type": "call" }, { "api_name": "django.http.HttpResponseRedirect", "line_number": 23, "usage_type": "call" }, { "api_name": "classes.models.Department.objects.order_by", "line_number": 24, "usage_type": "call" ...
21662366530
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # @Time: 2020/4/5 21:14 # @Author: qyh import matplotlib.pyplot as plt import numpy.random as rdm import networkx as nx node_num = 100 probability = 0.01 er_graph = nx.erdos_renyi_graph(node_num, probability) susceptible = 'S' infected = 'I' recovered = 'R' ...
QCloudHao/COVID19
development.py
development.py
py
2,014
python
en
code
0
github-code
36
[ { "api_name": "networkx.erdos_renyi_graph", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.random.random", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 27, "usage_type": "name" }, { "api_name": "numpy.ran...
5741967370
import os import pandas as pd from sklearn.model_selection import KFold, train_test_split root_path = os.path.dirname(__file__) asset_path = os.path.join(root_path, '../assets') # load the full titanic example data data = pd.read_csv(os.path.join(root_path, '../data/train.csv')) # train / test split train_data, tes...
Esadruhn/owkin_elixir_hackathon
substra_materials/titanic_example/titanic/scripts/generate_data_samples.py
generate_data_samples.py
py
1,475
python
en
code
1
github-code
36
[ { "api_name": "os.path.dirname", "line_number": 6, "usage_type": "call" }, { "api_name": "os.path", "line_number": 6, "usage_type": "attribute" }, { "api_name": "os.path.join", "line_number": 7, "usage_type": "call" }, { "api_name": "os.path", "line_number": 7...
39642904721
""" CONTROLLER.PY The site controller controlls the production of the response for requests to the website. The controller creates and interacts with both, the SiteModel and the SiteViews. A call to the controller calls start_response and returns the contents of the response. Upgrade to multi-s...
berthoud/webfitsviewer
webfitsviewer/src/controller.py
controller.py
py
16,483
python
en
code
1
github-code
36
[ { "api_name": "configobj.ConfigObj", "line_number": 80, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 88, "usage_type": "call" }, { "api_name": "os.path", "line_number": 88, "usage_type": "attribute" }, { "api_name": "logging.config.basicCon...
6671044786
from sense_hat import SenseHat from PIL import Image from random import randint import time sense = SenseHat() amount_of_pics = 3 while True: pic_nr = str(randint(1, amount_of_pics)) img = Image.open('pic'+pic_nr+'.png') byteList = list(img.getdata()) pixels = [] for index, byte in enumerate(byte...
gdmgent-IoT-1920/labo-2-sensehat-hansvertriest
avatar_animated.py
avatar_animated.py
py
425
python
en
code
0
github-code
36
[ { "api_name": "sense_hat.SenseHat", "line_number": 6, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 11, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 12, "usage_type": "call" }, { "api_name": "PIL.Image", "line...
74518602024
#import os from typing import Union import torch import numpy as np from . import torch_knn gpu_available = torch_knn.check_for_gpu() if not gpu_available: print("The library was not successfully compiled using CUDA. Only the CPU version will be available.") _transl_torch_device = {"cpu": "CPU", "cuda": "GPU"} c...
thomgrand/torch_kdtree
torch_kdtree/nn_distance.py
nn_distance.py
py
7,259
python
en
code
5
github-code
36
[ { "api_name": "torch.Tensor", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.device", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.float32", "line_number": 23, "usage_type": "attribute" }, { "api_name": "torch.from_num...
9135106371
#!/usr/bin/env python3 import sqlite3 def nice_print(sql_table): """ used to show information in a slightly more readable fashion""" for row in sql_table: row_string = map(str,row) pretty_row = '\t\t'.join(list(row_string)) print(pretty_row) conn = sqlite3.connect('northwind.sqlite3'...
Tclack88/Lambda
DS-3-2-SQL-and-Databases/sc/northwind.py
northwind.py
py
2,024
python
en
code
0
github-code
36
[ { "api_name": "sqlite3.connect", "line_number": 13, "usage_type": "call" } ]
7413102812
"""Sorts duplicate photos/files and places all copies in their own folder.""" import click import halo from hashlib import sha256 from pathlib import Path from shutil import copyfile, move """ Return the SHA256 sum of the provided file name. :param file_name - Name of the file to check :return Hexdigst of SHA sum "...
poiriermike/sort_dup_photos
sort_dupes.py
sort_dupes.py
py
1,698
python
en
code
0
github-code
36
[ { "api_name": "hashlib.sha256", "line_number": 17, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_number": 24, "usage_type": "call" }, { "api_name": "click.echo", "line_number": 28, "usage_type": "call" }, { "api_name": "pathlib.Path", "line_numbe...
40066321475
import pandas as pd from decouple import config import numpy as np import os import nilearn.image as img from nilearn.glm.second_level import non_parametric_inference import nibabel import argparse def options() -> dict: ''' Function to accept accept command line flags. Needs -t for task name and -p for n...
WMDA/socio-emotion-cognition
task_fmri/modelling/nilearn_notebooks/second_level_group_differences_nilearn.py
second_level_group_differences_nilearn.py
py
5,119
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 28, "usage_type": "call" }, { "api_name": "decouple.config", "line_number": 50, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 54, "usage_type": "call" }, { "api_name": "os.path", "l...
21811338637
from elasticsearch import Elasticsearch from services.caption_processor import split_captions es = Elasticsearch() def index_captions(captions, video_id): for ctime, ctext in split_captions(captions): doc = { 'time': ctime, 'text': ctext, 'video': video_id } ...
veotani/youtube-caption-search
server/services/caption_indexator.py
caption_indexator.py
py
696
python
en
code
0
github-code
36
[ { "api_name": "elasticsearch.Elasticsearch", "line_number": 4, "usage_type": "call" }, { "api_name": "services.caption_processor.split_captions", "line_number": 8, "usage_type": "call" } ]
31061471225
from ..utils import Object class GetLanguagePackStrings(Object): """ Returns strings from a language pack in the current localization target by their keys. Can be called before authorization Attributes: ID (:obj:`str`): ``GetLanguagePackStrings`` Args: language_pack_id (:obj:`str`...
iTeam-co/pytglib
pytglib/api/functions/get_language_pack_strings.py
get_language_pack_strings.py
py
1,077
python
en
code
20
github-code
36
[ { "api_name": "utils.Object", "line_number": 6, "usage_type": "name" } ]
27912151130
import boto3 import pg8000 import datetime import json import time # Create an S3 client s3 = boto3.client('s3') # Create a CloudWatch client cloudwatch = boto3.client('cloudwatch') def ingest_database_to_s3(bucket_name): # Retrieve the database connection details from AWS Secrets Manager secretsmanager = bo...
vasilecondrea/lake-cabin-project
extract/src/extract.py
extract.py
py
4,151
python
en
code
1
github-code
36
[ { "api_name": "boto3.client", "line_number": 8, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 11, "usage_type": "call" }, { "api_name": "boto3.client", "line_number": 15, "usage_type": "call" }, { "api_name": "json.loads", "line_number":...
17122612080
# import the packages import matplotlib.pyplot as plt import networkx as nx # Define the data structures of vertices and edges vertices = range(1, 10) edges = [(7, 2), (2, 3), (7, 4), (4, 5), (7, 3), (7, 5), (1, 6), (1, 7), (2, 8), (2, 9)] # Let's first instantiate the graph G = nx.Graph() # let's draw the gr...
amrmabdelazeem/40-Algorithms-to-Know
Fraud Analytics.py
Fraud Analytics.py
py
1,258
python
en
code
0
github-code
36
[ { "api_name": "networkx.Graph", "line_number": 10, "usage_type": "call" }, { "api_name": "networkx.spring_layout", "line_number": 14, "usage_type": "call" }, { "api_name": "networkx.draw_networkx_nodes", "line_number": 17, "usage_type": "call" }, { "api_name": "ne...
2760395481
import os from datetime import datetime, timedelta from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request from google.oauth2.credentials import Credentials import googleapiclient.discovery import googleapiclient.errors import httplib2.error import youtube_dl import log...
vachau/youtube-restreamer
utils/apis.py
apis.py
py
12,777
python
en
code
6
github-code
36
[ { "api_name": "os.path.exists", "line_number": 47, "usage_type": "call" }, { "api_name": "os.path", "line_number": 47, "usage_type": "attribute" }, { "api_name": "google.oauth2.credentials.Credentials.from_authorized_user_file", "line_number": 49, "usage_type": "call" }...
3984159879
from django.http import HttpResponse from django.shortcuts import render from .models import * def home_view(request): names = ['Jitendra', 'Rimaljit', 'Mohit', 'Deepak'] address = ['Chandigarh', 'Ludhiana', 'Ludhiana', 'Ludhian'] info = zip(names, address) data = { 'info': info }...
jitendra5581/cms-training
studentapp/views.py
views.py
py
1,601
python
en
code
0
github-code
36
[ { "api_name": "django.shortcuts.render", "line_number": 15, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 22, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 61, "usage_type": "call" } ]
19112292097
import torch as T import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import numpy as np class DeepQNetwork(nn.Module): def __init__(self, lr, input_dims, fc1_dims, fc2_dims, n_actions): super(DeepQNetwork, self).__init__() self.input_dims = input_dims self.fc...
miczed/learny-mc-learnface
DQN/Examples/DQN_Lunar_MLwithPhil.py
DQN_Lunar_MLwithPhil.py
py
5,392
python
en
code
0
github-code
36
[ { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 8, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 16, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
15083780449
import ray import numpy as np import gym import tensorflow as tf import tensorflow.contrib.slim as slim import time import sys sys.path.insert(0, "/home/ubuntu/pong_py") from pongjsenv import PongJSEnv ray.init(num_workers=0) n_obs = 8 # dimensionality of observations n_h = 256 # number of h...
robertnishihara/ray-tutorial-docker
rl_exercises/pong_py_no_git/pong_py/parallel_train.py
parallel_train.py
py
4,946
python
en
code
8
github-code
36
[ { "api_name": "sys.path.insert", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "ray.init", "line_number": 11, "usage_type": "call" }, { "api_name": "tensorflow.contrib.slim.fully_co...
14489788093
# Lab 24 - Rain Data import datetime import matplotlib.pyplot as plt def open_file(): """opens the file and returns its contents as a list separated by each row""" with open('lab24_ankeny_rain.txt', 'r') as data: return data.read().split("\n") def get_dates(data): """accepts data and returns a list of just...
mjhcodes/pdxcodeguild
python/lab24.py
lab24.py
py
2,881
python
en
code
0
github-code
36
[ { "api_name": "matplotlib.pyplot.plot", "line_number": 68, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_number": 68, "usage_type": "name" }, { "api_name": "matplotlib.pyplot.ylabel", "line_number": 69, "usage_type": "call" }, { "api_name": "mat...
23777096489
import re import sys from random import randrange, randint, choices, shuffle from typing import List, Dict, Tuple import numpy as np import pandas as pd from pepfrag import ModSite, IonType, pepfrag from pyteomics.mass import calculate_mass from src.fragment_matching import write_matched_fragments from src.model.frag...
Eugleo/dibby
src/generate_data.py
generate_data.py
py
18,105
python
en
code
1
github-code
36
[ { "api_name": "typing.List", "line_number": 37, "usage_type": "name" }, { "api_name": "src.model.peptide.Peptide", "line_number": 37, "usage_type": "name" }, { "api_name": "typing.List", "line_number": 42, "usage_type": "name" }, { "api_name": "typing.Dict", "...
21195656811
import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='snmpdesk', version='0.0.91', description='Scripts for easy get snmp data', author='Svintsov Dmitry', author_email='spam@19216801.ru', url='http://github.c...
uralbash/snmpdesk
setup.py
setup.py
py
927
python
en
code
5
github-code
36
[ { "api_name": "os.path.join", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_n...
29432851011
from asyncore import read #JMP:xkalou03 __author__ = 'xkalou03' import sys import argparse import re import reader import table def checkParameters(): parser = argparse.ArgumentParser(description = 'Projekt do IPP.', add_help = False) parser.add_argument('--help', action = "count", default = 0, help = 'P...
Strihtrs/IPP_Projects
JMP/jmp.py
jmp.py
py
4,768
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 16, "usage_type": "call" }, { "api_name": "sys.stderr", "line_number": 27, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 32, "usage_type": "attribute" }, { "api_name": "sys.stderr", ...
16128248265
import functools from importlib import import_module from pyws.public import InvalidPath def route(path): def wrapper(func): @functools.wraps(func) def _wrapper(*args, **kwargs): return func(*args, **kwargs) _wrapper.__route__ = path return _wrapper return wrapp...
czasg/ScrapyLearning
czaSpider/dump/bootstrap_test/blogs_v1/pyws/route.py
route.py
py
1,042
python
en
code
1
github-code
36
[ { "api_name": "functools.wraps", "line_number": 10, "usage_type": "call" }, { "api_name": "importlib.import_module", "line_number": 27, "usage_type": "call" }, { "api_name": "importlib.import_module", "line_number": 29, "usage_type": "call" }, { "api_name": "pyws....
22450428766
""" Team 46 Haoyue Xie 1003068 @Melbourne Jiayu Li 713551 @Melbourne Ruqi Li 1008342 @Melbourne Yi Zhang 1032768 @Melbourne Zimeng Jia 978322 @Hebei, China """ import json path = "E:/Unimelb/2020semester1/COPM90024 Cluster and Cloud Computing/assignment2/code/" filename = path + 'SA4_2016_AUST.json' with open(file...
yzzhan4/COMP90024-AuzLife
Create City_GeoJSON file/coordinates for cities.py
coordinates for cities.py
py
19,866
python
en
code
0
github-code
36
[ { "api_name": "json.load", "line_number": 16, "usage_type": "call" }, { "api_name": "json.JSONEncoder", "line_number": 516, "usage_type": "call" } ]
27521291277
from pyspark.sql import SparkSession from pyspark.sql import functions as fs spark= SparkSession.builder.appName("word_count").getOrCreate() data= spark.read.text("book.txt") pro_data= data.select(fs.explode(fs.split(data.value,"\\W+")).alias("words")) pro_data.filter(pro_data.words !="") a=pro_data.select("words")...
AmanSolanki007/Pyspark_problems
word_count_dataframe.py
word_count_dataframe.py
py
353
python
en
code
0
github-code
36
[ { "api_name": "pyspark.sql.SparkSession.builder.appName", "line_number": 4, "usage_type": "call" }, { "api_name": "pyspark.sql.SparkSession.builder", "line_number": 4, "usage_type": "attribute" }, { "api_name": "pyspark.sql.SparkSession", "line_number": 4, "usage_type": "...
15783422482
# -*- coding: utf-8 -*- """ Created on Sat May 8 12:16:46 2021 @author: tamon """ import csv import numpy as np from scipy.interpolate import griddata from scipy.interpolate import interp1d import matplotlib.pyplot as plt radius = [] angles = [] points = [] result = [] with open('angrad.csv', new...
Maselko/individual-project
Angrad.py
Angrad.py
py
4,228
python
en
code
0
github-code
36
[ { "api_name": "csv.reader", "line_number": 20, "usage_type": "call" }, { "api_name": "numpy.float64", "line_number": 33, "usage_type": "call" }, { "api_name": "numpy.mgrid", "line_number": 35, "usage_type": "attribute" }, { "api_name": "scipy.interpolate.griddata"...
74120455144
import pygame from constantes import * from auxiliar import Auxiliar class Background: ''' Clase para representar un fondo en un juego utilizando Pygame. Attributes: x (int): La coordenada x de la esquina superior izquierda del fondo. y (int): La coordenada y de la esquina superior izquier...
valverdecristian/cristian_valverde_tp_pygame
background.py
background.py
py
1,080
python
es
code
0
github-code
36
[ { "api_name": "pygame.image.load", "line_number": 20, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 20, "usage_type": "attribute" }, { "api_name": "pygame.transform.scale", "line_number": 21, "usage_type": "call" }, { "api_name": "pygame.tra...
39055642818
#!/usr/bin/env python from __future__ import print_function import os, sys, json import numpy as np from ase.build import bulk, surface from ase.units import Rydberg, Bohr from ase.io import read from ase.visualize import view from ase.spacegroup import crystal from ase.calculators.espresso import Espresso infile...
marshallmcdonnell/sno2_ase_espresso
surfaces/surfaces_sno2.py
surfaces_sno2.py
py
2,092
python
en
code
0
github-code
36
[ { "api_name": "sys.argv", "line_number": 16, "usage_type": "attribute" }, { "api_name": "json.loads", "line_number": 19, "usage_type": "call" }, { "api_name": "os.getcwd", "line_number": 28, "usage_type": "call" }, { "api_name": "ase.spacegroup.crystal", "line...
34450828117
import pytest from PyQt6.QtTest import QTest from PyQt6.QtWidgets import QLineEdit from pytestqt import qtbot from main import OLXWork, OLXSettings from PyQt6 import QtCore def test_olxwork_button_stop_clicked(qtbot): parent = OLXSettings() widget = OLXWork(parent= parent) widget.show() qtbot.addWidg...
Kandel269/OLXroom
test_main.py
test_main.py
py
3,676
python
en
code
0
github-code
36
[ { "api_name": "main.OLXSettings", "line_number": 11, "usage_type": "call" }, { "api_name": "main.OLXWork", "line_number": 12, "usage_type": "call" }, { "api_name": "pytestqt.qtbot.addWidget", "line_number": 14, "usage_type": "call" }, { "api_name": "pytestqt.qtbot...
22353260658
import torch from .logger_utils import get_logger import matplotlib.pyplot as plt import numpy as np import itertools logger = get_logger() def prediction(*, test_data, model, device): """Predict on test data and generate confusion matrix. Args: test_data (torch.utils.data.Dataset): Test dataset. ...
abhijitramesh/hpc-demo
utils/prediction_utils.py
prediction_utils.py
py
1,910
python
en
code
0
github-code
36
[ { "api_name": "logger_utils.get_logger", "line_number": 7, "usage_type": "call" }, { "api_name": "torch.zeros", "line_number": 29, "usage_type": "call" }, { "api_name": "torch.no_grad", "line_number": 31, "usage_type": "call" }, { "api_name": "torch.tensor", "...
11130997604
import csv import os from flask import Blueprint, redirect, render_template, request import sqlalchemy from forms.addTeacherForm import AddTeacherForm from models import GroupOfTeacher, Teacher, TeacherInGroup, db from forms.editForm import EditTeacherForm ROWS_PER_PAGE = 5 teachers_blueprint = Blueprint("teachers_b...
IngNoN/School_App
controllers/teachers.py
teachers.py
py
4,762
python
en
code
0
github-code
36
[ { "api_name": "flask.Blueprint", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.request.args.get", "line_number": 17, "usage_type": "call" }, { "api_name": "flask.request.args", "line_number": 17, "usage_type": "attribute" }, { "api_name": "flask....
16154091028
from django.contrib import admin from .models import InstrumentItem # Register your models here. class InstrumentItemAdmin(admin.ModelAdmin): search_fields = ['definition'] list_filter = ['instrument'] list_display = ['definition','instrument','discrimination','difficulty','guessing','upper_asymptote'] ad...
langcog/web-cdi
webcdi/cdi_forms/cat_forms/admin.py
admin.py
py
375
python
en
code
7
github-code
36
[ { "api_name": "django.contrib.admin.ModelAdmin", "line_number": 6, "usage_type": "attribute" }, { "api_name": "django.contrib.admin", "line_number": 6, "usage_type": "name" }, { "api_name": "django.contrib.admin.site.register", "line_number": 10, "usage_type": "call" },...
15065246438
import asyncio import base64 import collections import json import struct import sys import aiohttp import pytest import six from pytest_httpserver import RequestHandler import consul import consul.aio Check = consul.Check @pytest.fixture def local_server(httpserver): from pytest_httpserver import RequestHandl...
poppyred/python-consul2
tests/test_aio.py
test_aio.py
py
10,482
python
en
code
125
github-code
36
[ { "api_name": "consul.Check", "line_number": 16, "usage_type": "attribute" }, { "api_name": "pytest_httpserver.RequestHandler", "line_number": 24, "usage_type": "argument" }, { "api_name": "json.dumps", "line_number": 25, "usage_type": "call" }, { "api_name": "col...
30055311792
from collections import defaultdict import os import pandas as pd path = '/home/djf/djf/POI/CDRF/data/Foursquare_NYC.txt' dic = defaultdict(int) f = open(path, 'r') lines = f.readlines() for line in lines: user, t, lat, lon, POI = line.strip().split('\t') dic[int(POI)] += 1 counts = [item[1] for item in...
Mediocre250/CTMR
long_tail.py
long_tail.py
py
462
python
en
code
0
github-code
36
[ { "api_name": "collections.defaultdict", "line_number": 8, "usage_type": "call" } ]
6410410688
import random import os import argparse from typing import DefaultDict # from paper "Learning Unknown from Correlations: # Graph Neural Network for Inter-novel-protein Interaction Prediction" standard_acids = [ ('A', 1), ('C', 6), ('D', 5), ('E', 7), ('F', 2), ('G', 1), ('H', 4), ('I', 2), ('K', 5), ...
LtECoD/PPITrans
data/dscript/builddataset.py
builddataset.py
py
5,962
python
en
code
4
github-code
36
[ { "api_name": "typing.DefaultDict", "line_number": 39, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 69, "usage_type": "call" }, { "api_name": "os.path.exists", "line_number": 79, "usage_type": "call" }, { "api_name": "os.path", ...
10423506179
# coding: utf-8 import xlrd def getProgramList(filepath): program_list = dict() program_list[u'网络剧'] = [] program_list[u'网络电影'] = [] program_list[u'网络综艺'] = [] data = xlrd.open_workbook(filepath) table = data.sheet_by_name(u'网络剧') nrows = table.nrows ncols = table.ncols for i in range(2, nrows): one_p...
LayneIns/CrawlerProject
crawl2/dataHelper/fetchProgram.py
fetchProgram.py
py
1,465
python
en
code
1
github-code
36
[ { "api_name": "xlrd.open_workbook", "line_number": 12, "usage_type": "call" }, { "api_name": "xlrd.open_workbook", "line_number": 45, "usage_type": "call" } ]
37213151621
#!/usr/bin/env python3 import argparse from pprint import pprint import json import hlib def check_temp(cl, device_id): device_name = None # first, try and find the device as a device url = f"/clip/v2/resource/device/{device_id}" resp = cl.get(url) if resp.status_code == 200: ...
parlaynu/hue-utilities
bin/check-temp.py
check-temp.py
py
2,946
python
en
code
0
github-code
36
[ { "api_name": "argparse.ArgumentParser", "line_number": 54, "usage_type": "call" }, { "api_name": "hlib.find_bridge", "line_number": 58, "usage_type": "call" }, { "api_name": "hlib.load_config", "line_number": 63, "usage_type": "call" }, { "api_name": "hlib.new_cl...
41366597699
import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import os def MyPlotSO(CompMethod,trials,MaxFuncEvals,method,problem): ##% Plot figcount=0 Convergence = np.zeros((int(CompMethod.shape[0]/trials), MaxFuncEvals)) count=-1 for i in range(0,int(Co...
KZervoudakis/Mayfly-Optimization-Algorithm-Python
plotting.py
plotting.py
py
5,858
python
en
code
4
github-code
36
[ { "api_name": "numpy.zeros", "line_number": 10, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "matplotlib.pyplot", "line_num...
15130917408
# %% from pprint import pprint from datasets import load_dataset test_file = "../data/ekonspacing/test_small.txt" val_file = "../data/ekonspacing/val_small.txt" train_file = "../data/ekonspacing/train_small.txt" # %% dataset = load_dataset( "ekonspacing.py", name="small", data_files={"train": str(train_f...
entelecheia/transformer-datasets
datasets/ekonspacing/ekonspacing_test.py
ekonspacing_test.py
py
500
python
en
code
0
github-code
36
[ { "api_name": "datasets.load_dataset", "line_number": 11, "usage_type": "call" }, { "api_name": "pprint.pprint", "line_number": 19, "usage_type": "call" }, { "api_name": "pprint.pprint", "line_number": 20, "usage_type": "call" } ]
17079442964
import logging from .html import extract_html_text from .pdf import extract_pdf_text logger = logging.getLogger(__name__) def extract_text(file_path: str) -> str: """Extract text from any kind of file as long as it's html or pdf""" try: if file_path.endswith('.html'): return extract_htm...
amy-langley/tracking-trans-hate-bills
lib/util/misc.py
misc.py
py
691
python
en
code
2
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 7, "usage_type": "call" }, { "api_name": "html.extract_html_text", "line_number": 14, "usage_type": "call" }, { "api_name": "pdf.extract_pdf_text", "line_number": 17, "usage_type": "call" } ]
71038521063
import numpy as np try: import mc except Exception: pass import cv2 import os from PIL import Image import torch from torch.utils.data import Dataset import torchvision.transforms as transforms import utils from . import reader class PartialCompDataset(Dataset): def __init__(self, config, phase): ...
XiaohangZhan/deocclusion
datasets/partial_comp_dataset.py
partial_comp_dataset.py
py
6,088
python
en
code
764
github-code
36
[ { "api_name": "torch.utils.data.Dataset", "line_number": 18, "usage_type": "name" }, { "api_name": "torchvision.transforms.Compose", "line_number": 31, "usage_type": "call" }, { "api_name": "torchvision.transforms", "line_number": 31, "usage_type": "name" }, { "ap...
23751441892
import os import argparse import matplotlib.pyplot as plt from matplotlib import cm import torch import numpy as np import statistics as st import csv import seaborn as sns from timeseries import EchoCard from quality_classification import predict_single as predict_acq from quality_classification import CardioNet fro...
HelmholtzAI-Consultants-Munich/Echo2Pheno
Module I/run4single.py
run4single.py
py
25,479
python
en
code
1
github-code
36
[ { "api_name": "matplotlib.colors.cnames", "line_number": 30, "usage_type": "attribute" }, { "api_name": "matplotlib.colors", "line_number": 30, "usage_type": "name" }, { "api_name": "colorsys.rgb_to_hls", "line_number": 33, "usage_type": "call" }, { "api_name": "m...
14940809637
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys try: import petsclinter as pl except ModuleNotFoundError as mnfe: try: petsc_dir = os.environ['PETSC_DIR'] except KeyError as ke: raise RuntimeError('Must set PETSC_DIR environment variable') from ke sys.path.insert(0, os.path.join(pets...
firedrakeproject/slepc
lib/slepc/bin/maint/slepcClangLinter.py
slepcClangLinter.py
py
3,156
python
en
code
2
github-code
36
[ { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sys.path.insert", "line_number": 12, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.join", "line...
41896395893
import cv2 import numpy as np import csv import math img = cv2.imread(".//new_dataset//250.jpg") img = cv2.GaussianBlur(img , (5 , 5) , 0) n = 64 div = 256//n #n is the number of bins, here n = 64 rgb = cv2.split(img) q = [] for ch in rgb: vf = np.vectorize(lambda x, div: int(x//div)*div) quanti...
kumar6rishabh/cbir-search-engine
ccv_searcher.py
ccv_searcher.py
py
1,968
python
en
code
0
github-code
36
[ { "api_name": "cv2.imread", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.GaussianBlur", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.split", "line_number": 11, "usage_type": "call" }, { "api_name": "numpy.vectorize", "line_numbe...
71534616424
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from icalendar import Calendar, Event from datetime import * from dateutil.parser import parse from pytz import UTC # timezone cal_file = '/Users/gyyoon/Desktop/pentaa.ics' MEETING_STR = '[회의]' TEATIME_STR = '[Tea-Time]' WORK_STR = '[업무]' NONWORK_STR = '[비업무]' LUNCH_ST...
Dry8r3aD/ics_parser
run.py
run.py
py
8,555
python
en
code
0
github-code
36
[ { "api_name": "icalendar.Calendar.from_ical", "line_number": 245, "usage_type": "call" }, { "api_name": "icalendar.Calendar", "line_number": 245, "usage_type": "name" } ]
22706853086
import code import gym import torch from tqdm import trange import numpy as np import components.prioritized_memory import components.memory from components.filesys_manager import ExperimentPath class BaseTrainer: def __init__(self, args): # init experiment hyper-parameters self.args = args ...
APM150/Continuous_Envs_Experiments
mujoco/trainers/base_trainer.py
base_trainer.py
py
10,727
python
en
code
0
github-code
36
[ { "api_name": "components.filesys_manager.ExperimentPath", "line_number": 21, "usage_type": "call" }, { "api_name": "gym.make", "line_number": 24, "usage_type": "call" }, { "api_name": "gym.make", "line_number": 25, "usage_type": "call" }, { "api_name": "component...
22926496902
import cv2 import math # Source: https://richardpricejones.medium.com/drawing-a-rectangle-with-a-angle-using-opencv-c9284eae3380 # Made slight adjustments to color def draw_angled_rec(x0, y0, width, height, angle, img, color): _angle = angle * math.pi / 180.0 b = math.cos(_angle) * 0.5 a = math.sin(_angl...
MatanPazi/opt_fabric_layout
minAreaRect_Test.py
minAreaRect_Test.py
py
2,974
python
en
code
1
github-code
36
[ { "api_name": "math.pi", "line_number": 9, "usage_type": "attribute" }, { "api_name": "math.cos", "line_number": 10, "usage_type": "call" }, { "api_name": "math.sin", "line_number": 11, "usage_type": "call" }, { "api_name": "cv2.line", "line_number": 20, "...
15733506905
__docformat__ = "reStructuredText" __author__ = "davidh" import logging import os import re import sys from collections import namedtuple from datetime import datetime, timedelta from glob import glob LOG = logging.getLogger(__name__) FILENAME_RE = r"HS_H08_(?P<date>\d{8})_(?P<time>\d{4})_(?P<band>B\d{2})_FLDK_(?P<r...
ssec/sift
uwsift/project/organize_data_topics.py
organize_data_topics.py
py
6,413
python
en
code
45
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 12, "usage_type": "call" }, { "api_name": "re.compile", "line_number": 15, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime...
29290663147
from django.db import models from wagtail.admin.edit_handlers import MultiFieldPanel, RichTextFieldPanel, StreamFieldPanel from wagtail.core.fields import RichTextField, StreamField from wagtail.snippets.models import register_snippet from ..modules import text_processing from .. import configurations from ..blogs.blo...
VahediRepositories/AllDota
dotahub/home/blogs/models.py
models.py
py
1,626
python
en
code
0
github-code
36
[ { "api_name": "django.db.models.Model", "line_number": 12, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 12, "usage_type": "name" }, { "api_name": "wagtail.core.fields.RichTextField", "line_number": 13, "usage_type": "call" }, { "ap...
7182836122
#!/usr/bin/env python # -*- coding: utf-8 -*- # # @Author: José Sánchez-Gallego (gallegoj@uw.edu) # @Date: 2023-01-19 # @Filename: test_callback.py # @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause) import unittest.mock import click from click.testing import CliRunner from unclick.core import...
albireox/unclick
tests/test_callback.py
test_callback.py
py
1,732
python
en
code
0
github-code
36
[ { "api_name": "click.command", "line_number": 17, "usage_type": "call" }, { "api_name": "click.argument", "line_number": 18, "usage_type": "call" }, { "api_name": "click.argument", "line_number": 19, "usage_type": "call" }, { "api_name": "click.option", "line_...
27549684390
""" Query builder examples. NOTES: # Infix notation (natural to humans) NOT ((FROM='11' OR TO="22" OR TEXT="33") AND CC="44" AND BCC="55") # Prefix notation (Polish notation, IMAP version) NOT (((OR OR FROM "11" TO "22" TEXT "33") CC "44" BCC "55")) # Python query builder NOT(AND(OR(from_='11', to='22', t...
ikvk/imap_tools
examples/search.py
search.py
py
2,613
python
en
code
608
github-code
36
[ { "api_name": "imap_tools.OR", "line_number": 26, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 26, "usage_type": "call" }, { "api_name": "imap_tools.NOT", "line_number": 30, "usage_type": "call" }, { "api_name": "imap_tools.OR", "line_...
15857685473
# -*- coding: utf-8 -*- import os import sys import webbrowser from invoke import task docs_dir = 'docs' build_dir = os.path.join(docs_dir, '_build') @task def readme(ctx, browse=False): ctx.run("rst2html.py README.rst > README.html") if browse: webbrowser.open_new_tab('README.html') def build_doc...
CenterForOpenScience/COSDev
tasks.py
tasks.py
py
1,383
python
en
code
6
github-code
36
[ { "api_name": "os.path.join", "line_number": 9, "usage_type": "call" }, { "api_name": "os.path", "line_number": 9, "usage_type": "attribute" }, { "api_name": "webbrowser.open_new_tab", "line_number": 16, "usage_type": "call" }, { "api_name": "invoke.task", "li...
74160129703
''' Algorithm: just count how many characters(frequency more than one regard it as one) ''' #!/bin/python3 import sys from collections import Counter def stringConstruction(s): # Complete this function return len(Counter(s).values()) if __name__ == "__main__": q = int(input().strip()) for a0 in range(...
CodingProgrammer/HackerRank_Python
(Strings)String_Construction(Counter_FK1).py
(Strings)String_Construction(Counter_FK1).py
py
413
python
en
code
0
github-code
36
[ { "api_name": "collections.Counter", "line_number": 10, "usage_type": "call" } ]
33531980673
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Written by Lucas Sinclair and Paul Rougieux JRC biomass Project. Unit D1 Bioeconomy. """ # Built-in modules # # Third party modules # # First party modules # import autopaths from autopaths import Path from autopaths.auto_paths import AutoPaths from aut...
xapple/cbmcfs3_runner
cbmcfs3_runner/scenarios/base_scen.py
base_scen.py
py
4,131
python
en
code
2
github-code
36
[ { "api_name": "autopaths.Path", "line_number": 50, "usage_type": "call" }, { "api_name": "autopaths.auto_paths.AutoPaths", "line_number": 52, "usage_type": "call" }, { "api_name": "tqdm.tqdm", "line_number": 58, "usage_type": "call" }, { "api_name": "cbmcfs3_runne...
22330605569
import asyncio import logging import os import re import warnings from asyncio import Future from functools import wraps from inspect import signature from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union from tqdm.auto import tqdm from rubrix._constants import ( DATASET_NAME_REGEX_PATTER...
Skumarh89/rubrix
src/rubrix/client/api.py
api.py
py
24,714
python
en
code
null
github-code
36
[ { "api_name": "logging.getLogger", "line_number": 66, "usage_type": "call" }, { "api_name": "rubrix.utils.setup_loop_in_thread", "line_number": 72, "usage_type": "call" }, { "api_name": "asyncio.run_coroutine_threadsafe", "line_number": 87, "usage_type": "call" }, { ...
947951498
#!/home/shailja/.virtualenv/my_env/bin/python3 import requests import bs4 import sys content = sys.argv[1] def display_actual_text(text,para_no): text = text[para_no] [s.extract() for s in text(['style', 'script', '[document]', 'head', 'title'])] visible_text = text.getText() print(visible_text) w...
SKT27182/web_scaping
wiki_search.py
wiki_search.py
py
1,728
python
en
code
0
github-code
36
[ { "api_name": "sys.argv", "line_number": 7, "usage_type": "attribute" }, { "api_name": "requests.get", "line_number": 18, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 19, "usage_type": "call" } ]
9866560419
from mlagents_envs.environment import UnityEnvironment from mlagents_envs.environment import ActionTuple from mlagents_envs.side_channel.engine_configuration_channel import EngineConfigurationChannel import numpy as np import mlagents.trainers from collections import namedtuple obs = namedtuple( 'obs', ...
chagmgang/baselines
baselines/env/simple_drone.py
simple_drone.py
py
3,699
python
en
code
1
github-code
36
[ { "api_name": "collections.namedtuple", "line_number": 10, "usage_type": "call" }, { "api_name": "mlagents_envs.side_channel.engine_configuration_channel.EngineConfigurationChannel", "line_number": 19, "usage_type": "call" }, { "api_name": "mlagents.trainers.trainers", "line_...
15006294998
import pandas as pd from bs4 import BeautifulSoup as bs #Criando objeto BS def get_file(file_name): content = [] with open(file_name, 'r') as file: content = file.readlines() content = ''.join(content) soup = bs(content,'xml') return soup #Buscando parents def get_parents(soup): ...
jonesamandajones/powercenter
create_excel.py
create_excel.py
py
3,991
python
en
code
0
github-code
36
[ { "api_name": "bs4.BeautifulSoup", "line_number": 10, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 41, "usage_type": "call" }, { "api_name": "pandas.read_excel", "line_number": 50, "usage_type": "call" }, { "api_name": "pandas.DataFrame...
71592171944
#!/bin/python3 import math import os import random import re import sys from collections import deque # Complete the bfs function below. def bfs(n, m, edges, s): #Create adjacency list empty on array neighbors = [[] for i in range(n) for j in range(1)] #Include neighbors of each vertex, with index minus 1...
Gabospa/computer_science
bfs.py
bfs.py
py
1,506
python
en
code
0
github-code
36
[ { "api_name": "collections.deque", "line_number": 29, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 46, "usage_type": "attribute" } ]
521538009
#imports import numpy as np import matplotlib.pyplot as plt import scipy.constants as const from scipy.special import iv as I0 from scipy.special import kv as K0 #Define Global Variables L_geo = 55.6e-9 Z0 = 50.0 F0_base = 0.95e9 #At lowest Temp squares= 27223 c_couple = 1.5e-14 TC = 1.5 Delta_0 = (3.5*const.Bo...
Ashleyyyt/Characterizing-KIDs
Simulate KID.py
Simulate KID.py
py
7,177
python
en
code
0
github-code
36
[ { "api_name": "scipy.constants.Boltzmann", "line_number": 15, "usage_type": "attribute" }, { "api_name": "scipy.constants", "line_number": 15, "usage_type": "name" }, { "api_name": "numpy.pi", "line_number": 18, "usage_type": "attribute" }, { "api_name": "scipy.co...
28886388336
# from urllib import request from django.shortcuts import render, redirect from .models import Post, Comment from .forms import CommentForm, PostUpdateForm # from django.http import HttpResponseRedirect from django.contrib.auth.decorators import login_required # LoginRequiredMixin is simply the class based version fo...
MSKose/django-blog-app
blog/views.py
views.py
py
6,019
python
en
code
1
github-code
36
[ { "api_name": "models.Post.objects.all", "line_number": 26, "usage_type": "call" }, { "api_name": "models.Post.objects", "line_number": 26, "usage_type": "attribute" }, { "api_name": "models.Post", "line_number": 26, "usage_type": "name" }, { "api_name": "django.s...
74090977062
import math from datetime import datetime import firebase_admin from firebase_admin import credentials from firebase_admin import db from firebase_admin import firestore import parseIntervalFiles as pif import parseActivityFiles as paf hervdir = "C:\\Users\\Ju\\GDrive\\Projects\\HeRV\\" ## Firestore co...
jucc/HeRV_analysis
pipeline/convert_csv_firestore.py
convert_csv_firestore.py
py
3,459
python
en
code
1
github-code
36
[ { "api_name": "datetime.datetime", "line_number": 22, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 23, "usage_type": "call" }, { "api_name": "firebase_admin.db.collection", "line_number": 27, "usage_type": "call" }, { "api_name": "fire...
1693307394
import numpy as np import math import cv2 center_points = {} objects_bbs_ids = [] id_count = 0 vechical_count = 0 count = 0 person_id = 0 camera = cv2.VideoCapture("video.mp4") object_detector = cv2.createBackgroundSubtractorMOG2(history = None, varThreshold = None) kernelOp = np.ones((3,3), np.uint8) kernelC1 = n...
Computer4062/Python-Projects
Road Tracker/counter.py
counter.py
py
2,880
python
en
code
0
github-code
36
[ { "api_name": "cv2.VideoCapture", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.createBackgroundSubtractorMOG2", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy....
19199461708
from torch.utils.data import Dataset import numpy as np from pathlib import Path import pandas as pd import torch from dpipe.io import load_numpy class BraTSDataset(Dataset): def __init__(self, meta: pd.DataFrame, source_folder: [str, Path], nonzero_mask=False, transform=None): if isinstance(source_folder...
kurmukovai/hse_projects
2020/Anvar/data_loader.py
data_loader.py
py
1,392
python
en
code
1
github-code
36
[ { "api_name": "torch.utils.data.Dataset", "line_number": 9, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 10, "usage_type": "attribute" }, { "api_name": "pathlib.Path", "line_number": 10, "usage_type": "name" }, { "api_name": "pathlib.Pa...
27194927025
import logging import numpy as np from sklearn.model_selection import train_test_split, StratifiedKFold from utils import logging as lg from heatmap_tutorial import utils as ht_utils lg.set_logging() def get_mnist(dataset, dir_path='./data/mnist'): if dataset == 'train': prefix = 'train' elif dat...
p16i/thesis-designing-recurrent-neural-networks-for-explainability
src/utils/data_provider.py
data_provider.py
py
17,506
python
en
code
14
github-code
36
[ { "api_name": "utils.logging.set_logging", "line_number": 10, "usage_type": "call" }, { "api_name": "utils.logging", "line_number": 10, "usage_type": "name" }, { "api_name": "logging.debug", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.fromfile"...