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
649139542
import numpy as np import scipy.linalg as la import dolfin as dl import sys, os dir_path = os.path.dirname(os.path.realpath(__file__)) sys.path.append( dir_path+"/../../") from hippylib import * from reducedHessianSVD import * from reducedGradient import * from preconditionedHessianSVD import * # import matplotlib.pypl...
null
SampleGeneration/generateSamplesUniform_v2.py
generateSamplesUniform_v2.py
py
10,027
python
en
code
null
code-starcoder2
66
[ { "api_name": "os.path.dirname", "line_number": 5, "usage_type": "call" }, { "api_name": "os.path", "line_number": 5, "usage_type": "attribute" }, { "api_name": "os.path.realpath", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.path.append", "lin...
253030912
import sys import matplotlib.pyplot as plt import csv def main(): f = [] for arg in sys.argv[1:]: f.append(arg) print(arg) x = [] y = [] x1 = [] y1 = [] with open(f[0], 'r') as csvfile: plots = csv.reader(csvfile, delimiter=' ') for row in plots: ...
null
py_plot.py
py_plot.py
py
693
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.argv", "line_number": 8, "usage_type": "attribute" }, { "api_name": "csv.reader", "line_number": 17, "usage_type": "call" }, { "api_name": "csv.reader", "line_number": 22, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot", "line...
425157214
from setuptools import setup with open('README.md') as f: long_description = f.read() setup( name='async-8ball', version='0.1', description='Asynchronous 8ball response generator.', long_description=long_description, url='https://github.com/Cryptex-github/async-8ball', author='cryptex', ...
null
setup.py
setup.py
py
396
python
en
code
null
code-starcoder2
66
[ { "api_name": "setuptools.setup", "line_number": 6, "usage_type": "call" } ]
465732051
import odl import numpy as np import matplotlib.pyplot as plt from LDDMM_gd import LDDMM_gd_solver #from skimage.measure import compare_ssim, compare_psnr def ssd(image_a, image_b): """Compute the sum of squared differences for two gray-valued images. The model is: .. math:: {1/2}...
null
odl-LDDMM/call_LDDMM.py
call_LDDMM.py
py
4,367
python
en
code
null
code-starcoder2
66
[ { "api_name": "numpy.linalg.norm", "line_number": 25, "usage_type": "call" }, { "api_name": "numpy.linalg", "line_number": 25, "usage_type": "attribute" }, { "api_name": "numpy.rot90", "line_number": 39, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.imr...
184899526
# encoding:utf-8 import os import copy import torch import torch.nn as nn from addict import Dict from ...utils import parse_setting from ...nn import BasicBlock, Decoder, APNB from ...nn import Fuse_Block, FCNHead from ..backbone import get_resnet18 # RFUNet: Res Fuse U-Net __all__ = ['RFUNet', 'get_rfunet'] class...
null
encoding/models/sseg/rfunet.py
rfunet.py
py
5,793
python
en
code
null
code-starcoder2
66
[ { "api_name": "torch.nn.Module", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 17, "usage_type": "name" }, { "api_name": "utils.parse_setting", "line_number": 23, "usage_type": "call" }, { "api_name": "backbone.get_resnet...
302564449
import json import pytz import ujson import datetime undefined = object() JSON_DATE_FORMAT = '%Y-%m-%d %H:%M:%S' def read(text): try: return ujson.decode(text) except Exception as e: raise DecodeError(e) def read_number_list(text): return [int(i) for i in read(text)] def write(obj, e...
null
libs/jsonist/__init__.py
__init__.py
py
1,808
python
en
code
null
code-starcoder2
66
[ { "api_name": "ujson.decode", "line_number": 13, "usage_type": "call" }, { "api_name": "ujson.encode", "line_number": 26, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 53, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", ...
529059611
import csv import os from datetime import date from typing import List from sqlalchemy import desc, asc from sqlalchemy.engine import Engine from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound from werkzeug.security import generate_password_hash from sqlalchemy.orm import scoped_session from flask imp...
null
csflix/adapters/database_repository.py
database_repository.py
py
8,920
python
en
code
null
code-starcoder2
66
[ { "api_name": "sqlalchemy.orm.scoped_session", "line_number": 24, "usage_type": "call" }, { "api_name": "flask._app_ctx_stack.__ident_func__", "line_number": 24, "usage_type": "attribute" }, { "api_name": "flask._app_ctx_stack", "line_number": 24, "usage_type": "name" }...
148747158
# -*- coding: utf-8 -*- from django.core.mail import send_mail from django.conf import settings # from django.contrib import messages from django.http.response import HttpResponseRedirect from django.shortcuts import render, get_object_or_404 from payments.models import GameProducts, PaymentData from payments.pay_form...
null
payments/views.py
views.py
py
3,461
python
en
code
null
code-starcoder2
66
[ { "api_name": "landing.models.Informer.objects.all", "line_number": 15, "usage_type": "call" }, { "api_name": "landing.models.Informer.objects", "line_number": 15, "usage_type": "attribute" }, { "api_name": "landing.models.Informer", "line_number": 15, "usage_type": "name...
308192976
#!/cust/soe/opt/python/2.7.3/bin//python from PIL import Image import json import logging import requests import operator from io import StringIO, BytesIO import sys sys.path.append('/Users/bburn1/development/scripts/trunk') import envutil class EnvironmentTester(): def __init__(self, ecn): self.ecn = ecn ec...
null
envcheck.py
envcheck.py
py
13,231
python
en
code
null
code-starcoder2
66
[ { "api_name": "sys.path.append", "line_number": 10, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 10, "usage_type": "attribute" }, { "api_name": "envutil.envkey", "line_number": 67, "usage_type": "call" }, { "api_name": "json.loads", "line_n...
476826049
""" Challenge utility functions """ import datetime import json import logging import sys import urllib import synapseclient from synapseclient.annotations import to_submission_status_annotations from synapseclient.annotations import is_submission_status_annotations try: from synapseclient.core.exceptions import S...
null
challengeutils/utils.py
utils.py
py
22,479
python
en
code
null
code-starcoder2
66
[ { "api_name": "logging.basicConfig", "line_number": 23, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 23, "usage_type": "attribute" }, { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "synapseclient...
183461381
# -*- coding: utf-8 -*- # FLO-2D Preprocessor tools for QGIS # Copyright © 2021 Lutra Consulting for FLO-2D # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, o...
null
flo2d/flo2d_tools/schematic_tools.py
schematic_tools.py
py
100,923
python
en
code
null
code-starcoder2
66
[ { "api_name": "operator.itemgetter", "line_number": 64, "usage_type": "call" }, { "api_name": "grid_tools.spatial_index", "line_number": 129, "usage_type": "call" }, { "api_name": "qgis.core.QgsFeatureRequest", "line_number": 159, "usage_type": "call" }, { "api_na...
444164544
import threading import urllib from threading import Thread from tornado.ioloop import IOLoop import asyncio try: import dronekit from dronekit import LocationGlobalRelative, VehicleMode except Exception as e: print(e) from control_pane.models import History from control_pane.models import Drone as DroneMo...
null
control_pane/lib/DroneModules/DroneDirectConnection.copy.py
DroneDirectConnection.copy.py
py
28,674
python
en
code
null
code-starcoder2
66
[ { "api_name": "inspect.stack", "line_number": 27, "usage_type": "call" }, { "api_name": "logging.getLogger", "line_number": 28, "usage_type": "call" }, { "api_name": "logging.INFO", "line_number": 31, "usage_type": "attribute" }, { "api_name": "control_pane.models...
14825031467
from django.urls import include, path from rest_framework import routers from github_projects import views router = routers.DefaultRouter() router.register('projects', views.ProjectEntryViewSet) router.register('webhooks', views.WebhookConfigViewSet) app_name = 'github_projects' urlpatterns = [ path('', include(r...
takenbyforce/django_example_site
github_projects/urls.py
urls.py
py
336
python
en
code
0
github-code
21
[ { "api_name": "rest_framework.routers.DefaultRouter", "line_number": 5, "usage_type": "call" }, { "api_name": "rest_framework.routers", "line_number": 5, "usage_type": "name" }, { "api_name": "github_projects.views.ProjectEntryViewSet", "line_number": 6, "usage_type": "at...
45988665504
from django.shortcuts import render, redirect, reverse, get_object_or_404 from django.contrib import messages from django.contrib.auth.decorators import login_required from django.db.models import Q from .models import Project from .forms import ProjectForm def portfolio(request): """ A view to show the portfolio...
Robert-Clark-1990/MS4_RCD
portfolio/views.py
views.py
py
3,648
python
en
code
0
github-code
21
[ { "api_name": "models.Project.objects.all", "line_number": 12, "usage_type": "call" }, { "api_name": "models.Project.objects", "line_number": 12, "usage_type": "attribute" }, { "api_name": "models.Project", "line_number": 12, "usage_type": "name" }, { "api_name": ...
74985176693
from matplotlib import pyplot import statistics import csv protocol = "coap" ms = "1000" filename = f"data/performance_analysis_{protocol}_{ms}ms.csv" file = open(filename) reader = csv.reader(file) times = [] hashtable = {} if protocol == "http": for line in reader: try: if line[0] == "200": times.append...
fabbrus97/iot_air_quality_monitoring
performance_eval/protocols/analyze_perf.py
analyze_perf.py
py
1,029
python
en
code
0
github-code
21
[ { "api_name": "csv.reader", "line_number": 10, "usage_type": "call" }, { "api_name": "statistics.mean", "line_number": 42, "usage_type": "call" }, { "api_name": "statistics.median", "line_number": 43, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.plot",...
4853067054
import numpy as np from keras.models import load_model import cv2 import os from utils import file_generator from utils import read_section properties = read_section("part4.ini", "part4") model_dir = properties["model.save.dir"] model_file = properties["model.save.name"] faces_out_dir = properties["real.faces.out.dir"...
tomer-DL/face_or_not
part4/deep_sort.py
deep_sort.py
py
941
python
en
code
0
github-code
21
[ { "api_name": "utils.read_section", "line_number": 8, "usage_type": "call" }, { "api_name": "keras.models.load_model", "line_number": 15, "usage_type": "call" }, { "api_name": "utils.file_generator", "line_number": 22, "usage_type": "call" }, { "api_name": "cv2.im...
42071713291
import os from flask import Flask, url_for, render_template, redirect, session from authlib.integrations.flask_client import OAuth import sys sys.path.append(f"{os.getcwd()}/user_login") # should be appended from user_db import db, User, init_db_table, add_user, query_user_with_username, delete_user_with_username,...
komms/flask_gmail_login
user_login/app.py
app.py
py
1,701
python
en
code
0
github-code
21
[ { "api_name": "sys.path.append", "line_number": 8, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 8, "usage_type": "attribute" }, { "api_name": "os.getcwd", "line_number": 8, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number":...
7440728782
# -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import print_function import logging import os from django.template.loaders import app_directories from django.conf import settings from django.utils._os import safe_join log = logging.getLogger(__name__) class AgileSiteAppDirectorie...
pivotal-energy-solutions/django-agilesites
django_agilesites/loaders.py
loaders.py
py
2,092
python
en
code
1
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 14, "usage_type": "call" }, { "api_name": "django.template.loaders.app_directories.Loader", "line_number": 17, "usage_type": "attribute" }, { "api_name": "django.template.loaders.app_directories", "line_number": 17, "usage...
37856598956
from ..data import CurrenciesData from ..models import Currency, CurrencyCode, Currencies async def fetch_currencies(self) -> Currencies: """Retrieves a list of currencies being traded on the dEX.""" if self.currencies != None: return self.currencies if self.params.network == None: raise...
AktaryTech/xrpl-dex-sdk-python
xrpl_dex_sdk/methods/fetch_currencies.py
fetch_currencies.py
py
1,295
python
en
code
1
github-code
21
[ { "api_name": "models.Currencies", "line_number": 14, "usage_type": "name" }, { "api_name": "data.CurrenciesData", "line_number": 16, "usage_type": "name" }, { "api_name": "models.CurrencyCode.from_string", "line_number": 25, "usage_type": "call" }, { "api_name": ...
9085483383
#!/usr/bin/env python3 from uuid import uuid4 from .particles import Electron, Proton, Neutron from .registery import RegisterSubClasses class Element(object, metaclass= RegisterSubClasses): def __init__(self, *args, **kwargs): self.id= uuid4() # id(self) self.electrons= [Electron()] * int(self.a...
richardjmarini/ChemWork
chemistry/elements.py
elements.py
py
771
python
en
code
0
github-code
21
[ { "api_name": "registery.RegisterSubClasses", "line_number": 8, "usage_type": "name" }, { "api_name": "uuid.uuid4", "line_number": 12, "usage_type": "call" }, { "api_name": "particles.Electron", "line_number": 13, "usage_type": "call" }, { "api_name": "particles.P...
8842420531
import numpy as np import cv2 as cv # testes + testes1 img = cv.imread("/home/roza/PycharmProjects/PoC1/imgs/bar15.jpeg") # 4 a 15 descobre a regiao do barcode gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY) gradX = cv.Sobel(gray, ddepth=cv.CV_32F, dx=1, dy=0, ksize=-1) gradY = cv.Sobel(gray, ddepth=cv.CV_32F, dx=0, dy=1, k...
Vicrrs/barcode_and_qrcode_reader
testes/script.py
script.py
py
1,474
python
en
code
1
github-code
21
[ { "api_name": "cv2.imread", "line_number": 4, "usage_type": "call" }, { "api_name": "cv2.cvtColor", "line_number": 6, "usage_type": "call" }, { "api_name": "cv2.COLOR_BGR2GRAY", "line_number": 6, "usage_type": "attribute" }, { "api_name": "cv2.Sobel", "line_nu...
5679521136
from ...configuration_utils import PretrainedConfig from ...utils import logging logger = logging.get_logger(__name__) GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP = { "EleutherAI/gpt-neo-1.3B": "https://huggingface.co/EleutherAI/gpt-neo-1.3B/resolve/main/config.json", # See all GPTNeo models at https://huggingface...
dropreg/R-Drop
huggingface_transformer_src/src/transformers/models/gpt_neo/configuration_gpt_neo.py
configuration_gpt_neo.py
py
7,814
python
en
code
834
github-code
21
[ { "api_name": "utils.logging.get_logger", "line_number": 5, "usage_type": "call" }, { "api_name": "utils.logging", "line_number": 5, "usage_type": "name" }, { "api_name": "configuration_utils.PretrainedConfig", "line_number": 13, "usage_type": "name" } ]
5652742270
import json from os.path import dirname, join import pytest from alembic import command from alembic.config import Config from flask.testing import FlaskClient from roadhog import roadhog class HTTPClient(FlaskClient): def open(self, *args, **kwargs): response = super(HTTPClient, self).open(*args, **kwa...
Kozea/roadhog
roadhog/tests/conftest.py
conftest.py
py
4,508
python
en
code
0
github-code
21
[ { "api_name": "flask.testing.FlaskClient", "line_number": 12, "usage_type": "name" }, { "api_name": "json.loads", "line_number": 16, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 22, "usage_type": "attribute" }, { "api_name": "roadhog.road...
22185239996
# import libraries import os from tkinter import * from tkinter import filedialog from pygame import mixer import numpy as np import argparse import cv2 from playsound import playsound import time # import keyboard from keras.models import Sequential from keras.layers import Dense, Dropout, Flatten from keras.layers i...
sonuyadav5504/EBMP
emotion.py
emotion.py
py
4,870
python
en
code
0
github-code
21
[ { "api_name": "os.environ", "line_number": 20, "usage_type": "attribute" }, { "api_name": "pygame.mixer.init", "line_number": 29, "usage_type": "call" }, { "api_name": "pygame.mixer", "line_number": 29, "usage_type": "name" }, { "api_name": "cv2.ocl.setUseOpenCL",...
35049339258
from urlparse import urlparse from django.contrib.auth.models import User from django.db.models import Q from rideplanner.models import ( Ride, UserProfile, RideMembership, RideInvitation, RiderGroup, RiderGroupInvitation, RiderGroupMembership, RiderGroupRideMembership, RiderLice...
gthmb/rideplanner_api
rideplanner/views.py
views.py
py
5,074
python
en
code
1
github-code
21
[ { "api_name": "rest_framework.mixins.CreateModelMixin", "line_number": 48, "usage_type": "attribute" }, { "api_name": "rest_framework.mixins", "line_number": 48, "usage_type": "name" }, { "api_name": "rest_framework.mixins.RetrieveModelMixin", "line_number": 48, "usage_ty...
25942215226
import logging import os from collections import namedtuple import numpy as np from vecto.utils.data import get_uncompressed_size from vecto.utils.metadata import WithMetaData from .iterators import (DirIterator, FileIterator, FileLineIterator, LoopedLineIterator, SequenceIterator, ...
vecto-ai/vecto
vecto/corpus/corpus.py
corpus.py
py
9,696
python
en
code
62
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "collections.namedtuple", "line_number": 19, "usage_type": "call" }, { "api_name": "vecto.utils.metadata.WithMetaData", "line_number": 22, "usage_type": "name" }, { "api_na...
69907307252
# -*- coding: utf-8 -*- """ Created on Tue May 26 09:52:05 2020 词向量 复现论文Distributed Representations of Words and Phrases and their Compositionalty中训练词向量的方法 实现Skip-gram模型,并且适用论文中noice contrastive sampling的目标函数 正例和反例 对一个中心词,每出现一个正确的周围词,都要出现K个错误的周围词,使得正确的周围词与中心词的距离越小越好,错误的周围词与中心词的距离越大越好。 1、准备数据,设定参数; 2、创建单词表,这里选取常见的MAX_V...
ThetaQing/ProjectOfPytorch
Num2/word-embendding-live.py
word-embendding-live.py
py
7,336
python
en
code
1
github-code
21
[ { "api_name": "torch.cuda.is_available", "line_number": 42, "usage_type": "call" }, { "api_name": "torch.cuda", "line_number": 42, "usage_type": "attribute" }, { "api_name": "random.seed", "line_number": 44, "usage_type": "call" }, { "api_name": "numpy.random.seed...
27722131643
import requests import json USERNAME = 'svenskiy' class GitHubUserAPI(): """Класс для работы с API GitHub""" URL = "https://api.github.com" def __init__(self, username, **kwargs): self.username = username self.last_response = '' def _get_request(self, req): buffer = request...
svenskiy/de_education
web_scraping/0_homework.py
0_homework.py
py
897
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 18, "usage_type": "call" }, { "api_name": "json.dump", "line_number": 31, "usage_type": "call" } ]
6563172598
#! /usr/bin/env python3 # Art Nasamran <cnasamran@health.ucsd.edu> # Extracts P25 insert sizes from qualimapReports # Calculates % >=Q30 from q30.txt # Calculates % alignment from subsampled_mapping_stats.tsv # Takes 4 arguments: # 1. qualimapReports_paths.txt # 2. q30_reads_paths.txt # 3. subsampled_mapping_stats_pat...
ucsd-ccbb/C-VIEW
src/custom_gen_stats_multiqc.py
custom_gen_stats_multiqc.py
py
8,330
python
en
code
9
github-code
21
[ { "api_name": "os.path.basename", "line_number": 85, "usage_type": "call" }, { "api_name": "os.path", "line_number": 85, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 85, "usage_type": "call" }, { "api_name": "re.compile", "line_...
73772111732
import sys sys.path.append('../') import torch.nn as nn import torch.nn.functional as F from utils import euclidean_dist class ClassifierNet(nn.Module): def __init__(self, hid_dim, z_dim): super(ClassifierNet, self).__init__() self.embedding_layer_dict = nn.Module...
Jorewang/CAMM
model/classifier.py
classifier.py
py
1,751
python
en
code
2
github-code
21
[ { "api_name": "sys.path.append", "line_number": 2, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 2, "usage_type": "attribute" }, { "api_name": "torch.nn.Module", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_...
37350728490
#!/usr/bin/env python3 import sys from os import path, listdir import yaml if (sys.version_info.minor < 8,): from typing_extensions import Final from typing import Tuple else: from typing import Final, Tuple import click def __generate_asciidoc(items: dict, config: dict) -> str: "Generate acsciidoc f...
jdangelo-rh/pruebacer
scripts/generate-healthcheck.py
generate-healthcheck.py
py
17,451
python
en
code
0
github-code
21
[ { "api_name": "sys.version_info", "line_number": 6, "usage_type": "attribute" }, { "api_name": "typing.Final", "line_number": 17, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 429, "usage_type": "call" }, { "api_name": "os.path", "line_n...
12997475145
from collections import Counter x = [] y = [] for i in range(3): thing = input().split(" ") x.append(thing[0]) y.append(thing[1]) cnt1 = Counter(x) cnt2 = Counter(y) xFound = 0 yFound = 0 for pos, value in cnt1.items(): if value == 1: xFound = pos for pos, value in cnt2.items(): if value == 1: y...
JLMadsen/Kattis
cetvrta.py
cetvrta.py
py
354
python
en
code
0
github-code
21
[ { "api_name": "collections.Counter", "line_number": 11, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 12, "usage_type": "call" } ]
71855158773
#Using the google API to get a geoJSON. We are using Dr. Chuck's subset of the API which has unlimited attempts import urllib.request, urllib.parse, urllib.error import json import ssl #Ignore ssl errors ctx = ssl.create_default_context() ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONE SERVICE_URL = "http...
EvilDoof/Python-programming
APIs/googleapi.py
googleapi.py
py
965
python
en
code
0
github-code
21
[ { "api_name": "ssl.create_default_context", "line_number": 8, "usage_type": "call" }, { "api_name": "ssl.CERT_NONE", "line_number": 10, "usage_type": "attribute" }, { "api_name": "urllib.request.parse.urlencode", "line_number": 22, "usage_type": "call" }, { "api_n...
43577438181
# -*- coding: utf-8 -*- import pandas as pd import plotly.graph_objects as go from sklearn.preprocessing import OrdinalEncoder from sklearn.cluster import KMeans from psycopg2 import (connect) from get_data_ep5 import update_req_ep5 def db_connecting_df(): update_req_ep5() conn = connect("host='local...
Mousasan97/RODI_Final
JAM/make_graphs.py
make_graphs.py
py
8,303
python
en
code
0
github-code
21
[ { "api_name": "get_data_ep5.update_req_ep5", "line_number": 11, "usage_type": "call" }, { "api_name": "psycopg2.connect", "line_number": 13, "usage_type": "call" }, { "api_name": "pandas.DataFrame", "line_number": 25, "usage_type": "call" }, { "api_name": "sklearn...
10203116510
import ast import re from os.path import join from setuptools import find_packages, setup CLASSIFIERS = [ 'Intended Audience :: Developers', 'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', ...
Ge0/okita-poc
setup.py
setup.py
py
1,753
python
en
code
19
github-code
21
[ { "api_name": "re.compile", "line_number": 34, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 35, "usage_type": "call" }, { "api_name": "ast.literal_eval", "line_number": 43, "usage_type": "call" }, { "api_name": "setuptools.setup", "line...
39021538511
from django.contrib import admin from django.urls import path from home import views urlpatterns = [ path('', views.index, name='Home'), path('about', views.about, name='About'), path('cc', views.cc, name='Cadets Corner'), path('alumni', views.alumni, name='Alumni'), path('downloads', views.downloa...
shyiam/NCC-SGSITS
home/urls.py
urls.py
py
398
python
en
code
0
github-code
21
[ { "api_name": "django.urls.path", "line_number": 6, "usage_type": "call" }, { "api_name": "home.views.index", "line_number": 6, "usage_type": "attribute" }, { "api_name": "home.views", "line_number": 6, "usage_type": "name" }, { "api_name": "django.urls.path", ...
74535547894
import matplotlib.pyplot as plt import matplotlib.gridspec as gs import seaborn as sns import numpy as np import plot_settings import re import utils from os import path from scipy.stats import entropy, gaussian_kde, iqr from elephant.conversion import BinnedSpikeTrain from elephant.statistics import isi, cv from el...
BrainsOnBoard/frontiers_genn_paper
scripts/plot_microcircuit_accuracy.py
plot_microcircuit_accuracy.py
py
16,879
python
en
code
3
github-code
21
[ { "api_name": "re.match", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 43, "usage_type": "call" }, { "api_name": "os.path", "line_number": 43, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 44...
1407451432
import os import time import speech_recognition as sr import pyttsx3 import datetime # voice Engine Settings engine = pyttsx3.init() voices = engine.getProperty('voices') engine.setProperty('voice', voices[4].id) engine.setProperty('rate' , 200) def speak(audio): engine.say(audio) engine.run...
anurajcreator/Python_Desktop_Assistant
AI.py
AI.py
py
1,609
python
en
code
1
github-code
21
[ { "api_name": "pyttsx3.init", "line_number": 10, "usage_type": "call" }, { "api_name": "speech_recognition.Recognizer", "line_number": 21, "usage_type": "call" }, { "api_name": "speech_recognition.Microphone", "line_number": 22, "usage_type": "call" }, { "api_name...
16686904211
"""Wrapper around Baidu Wenxin Baizhong knowledge search.""" from __future__ import annotations import json from dataclasses import asdict, dataclass from typing import List, Optional, Tuple import numpy as np import requests from langchain.docstore.document import Document from langchain.schema import BaseRetriever ...
ninehills/langchain-wenxin
src/langchain_wenxin/retrievers.py
retrievers.py
py
4,606
python
en
code
63
github-code
21
[ { "api_name": "typing.Optional", "line_number": 21, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 23, "usage_type": "name" }, { "api_name": "typing.Optional", "line_number": 25, "usage_type": "name" }, { "api_name": "typing.Optional", ...
33383532460
import json import logging import time import alexa_response_builder from iot_client import awsIoTClient logger = logging.getLogger() logger.setLevel(logging.DEBUG) awsclient = None telemetry_data = None ############################## # Configurations ############################## config = { 'host': '<REST API...
erviveksoni/alexa-controlled-drone
lambda_function/lambda_function.py
lambda_function.py
py
6,858
python
en
code
10
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 9, "usage_type": "attribute" }, { "api_name": "iot_client.awsIoTClient", "line_number": 41, "usage_type": "call" }, { "api_name": "time.sleep...
31963451871
import socket, sys, ssl, time from threading import Thread from wsgiref.handlers import format_date_time from datetime import datetime blockedList = set() BUFFSIZE = 1024 socketList = [] s = None cache = {} #the actual cache dates = {} #associated dates for url cacheTiming = {} #for...
BurkeO/Advanced-Telecommunications
Assignment_1/proxy.py
proxy.py
py
12,665
python
en
code
0
github-code
21
[ { "api_name": "sys.exit", "line_number": 27, "usage_type": "call" }, { "api_name": "time.time", "line_number": 50, "usage_type": "call" }, { "api_name": "socket.socket", "line_number": 54, "usage_type": "call" }, { "api_name": "time.time", "line_number": 81, ...
74638983092
import tkinter from tkinter import * from docx import Document from docx.opc.coreprops import CoreProperties from docx.enum.style import WD_STYLE_TYPE from docx.shared import Inches, Cm, Pt from tkinter import messagebox top = tkinter.Tk() top['bg']="white" top.title("Resignation Letter Generator") # ...
enishpandey/TKinter_Enish
doc_file.py
doc_file.py
py
8,542
python
en
code
0
github-code
21
[ { "api_name": "tkinter.Tk", "line_number": 10, "usage_type": "call" }, { "api_name": "docx.Document", "line_number": 72, "usage_type": "call" }, { "api_name": "docx.shared.Cm", "line_number": 76, "usage_type": "call" }, { "api_name": "docx.shared.Cm", "line_nu...
29554597307
# -*- coding: utf-8 -*- """ Created on 十一月 07 15:52 2017 @author: aeloyq ### Notice: The image data argumentation methods were copied from Keras If this reference is illegal, please announce me by email aeloyq@outlook.com I will deal with it in short time. """ import copy import numpy as np from nnbui...
aeloyq/NNBuilder
nnbuilder/data.py
data.py
py
18,476
python
en
code
6
github-code
21
[ { "api_name": "PIL.Image", "line_number": 24, "usage_type": "name" }, { "api_name": "PIL.Image", "line_number": 26, "usage_type": "name" }, { "api_name": "PIL.Image.NEAREST", "line_number": 28, "usage_type": "attribute" }, { "api_name": "PIL.Image", "line_numb...
4154062481
#!/usr/bin/env python import pandas as pd import numpy as np from sklearn.preprocessing import StandardScaler from sklearn.decomposition import PCA from sklearn.decomposition import FastICA import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from sklearn.preprocessing import StandardScaler from skl...
neelaksh007/CS7641_Assignment3
Step2.py
Step2.py
py
20,256
python
en
code
0
github-code
21
[ { "api_name": "numpy.random.seed", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 26, "usage_type": "attribute" }, { "api_name": "pandas.read_csv", "line_number": 36, "usage_type": "call" }, { "api_name": "numpy.int32", ...
73537329011
from xlutils.copy import copy import xlrd import xlwt tem_excel = xlrd.open_workbook('/Users/createyoung/Downloads/CourseCode/S1/1-2/PracticeNeed/日统计.xls', formatting_info=True) tem_sheet = tem_excel.sheet_by_index(0) new_excel = copy(tem_excel) new_sheet = new_excel.get_sheet(0) style...
createyoung/Homework
day5.py
day5.py
py
959
python
en
code
0
github-code
21
[ { "api_name": "xlrd.open_workbook", "line_number": 5, "usage_type": "call" }, { "api_name": "xlutils.copy.copy", "line_number": 9, "usage_type": "call" }, { "api_name": "xlwt.XFStyle", "line_number": 12, "usage_type": "call" }, { "api_name": "xlwt.Font", "line...
36381890021
import requests from bs4 import BeautifulSoup url = "https://www.groupon.com" page = requests.get(url) soup = BeautifulSoup(page.content, "html.parser") # print(soup) offers = [] info_card = soup.find_all('div', class_='cui-content') # print(info_card) for div_tag in info_card: # print(div_tag) offer_title...
Python-Coding-Challenges-and-Projects/web-scraper
main.py
main.py
py
2,705
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 5, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 7, "usage_type": "call" } ]
22309343238
import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np import utils.rotation as urotation def plot_frames(data:np.ndarray, lim:float, sign:str, folder:str, dx_plot_dict:dict, sx_plot_dict:dict, plot_axis:bool=True,): """ Plot motion frames of the input data. Input data c...
notlosca/auslan-classification
utils/visualization.py
visualization.py
py
4,842
python
en
code
1
github-code
21
[ { "api_name": "numpy.ndarray", "line_number": 6, "usage_type": "attribute" }, { "api_name": "numpy.array", "line_number": 24, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 28, "usage_type": "call" }, { "api_name": "matplotlib.pyplot.figure", ...
26029317422
from typing import Tuple import numpy as np import torch from torch.utils.data import Dataset class SiamDataLoader(Dataset): """ This is dataset class for Siamese Network. Since the Feature Extractor requires the data to be present in pairs, with single value depicting whether the input values are sa...
pilambdagammarho/Anomaly-Detection-Benchmarking
dataset/modeldataloaders.py
modeldataloaders.py
py
4,883
python
en
code
0
github-code
21
[ { "api_name": "torch.utils.data.Dataset", "line_number": 8, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 27, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 28, "usage_type": "call" }, { "api_name": "numpy.where", "li...
6973325143
#!/usr/bin/env python3 import subprocess as sb import os import math from matplotlib import pyplot as plt import matplotlib def submit_job(mpi_tasks): out = sb.run(['sbatch', '-n', '%s' %mpi_tasks, 'jobscripts/strong_scaling.slurm'],stdout=sb.PIPE,stderr=sb.PIPE) text=str() for word in out.args: ...
mshaikh786/PComp101
utils/strong_scaling.py
strong_scaling.py
py
3,158
python
en
code
0
github-code
21
[ { "api_name": "subprocess.run", "line_number": 11, "usage_type": "call" }, { "api_name": "subprocess.PIPE", "line_number": 11, "usage_type": "attribute" }, { "api_name": "subprocess.run", "line_number": 41, "usage_type": "call" }, { "api_name": "os.getenv", "l...
19761751749
# https://leetcode.com/problems/decode-ways/ # 91. Decode Ways # Recursion + Memoization from functools import lru_cache class Solution: def numDecodings(self, s: str) -> int: N = len(s) @lru_cache def helper(i): if i == N: return 1 ...
Priyansh121096/leetcode
91.py
91.py
py
1,123
python
en
code
0
github-code
21
[ { "api_name": "functools.lru_cache", "line_number": 11, "usage_type": "name" } ]
403236773
from __future__ import annotations from collections import deque from time import time from typing import Deque, TYPE_CHECKING from PySide2.QtCore import QLocale, Qt, Slot, Signal from PySide2.QtGui import QFont from PySide2.QtWidgets import QWidget, QProgressBar, QLCDNumber, QLabel, QDoubleSpinBox, QAbstractSpinBox,...
sing-group/livia-ui
livia_ui/gui/views/builders/DefaultTopToolBarBuilder.py
DefaultTopToolBarBuilder.py
py
14,676
python
en
code
1
github-code
21
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 31, "usage_type": "name" }, { "api_name": "livia_ui.gui.views.builders.TopToolBarBuilder.TopToolBarBuilder", "line_number": 38, "usage_type": "name" }, { "api_name": "PySide2.QtCore.Signal", "line_number": 39, "usage_ty...
39659399382
""" Created on Tuesday March 31 2020 @author: Jeffrey J. Walker iv_snapshot.py This script uses the yahoo_option_chain_json to plot the volatility surface and produce an implied probability distribution. This script produces several plots as a diagnostic See Malz 2014 for another way to get risk-neu...
jjwalkerwvu/finance
codes/options/iv_snapshot.py
iv_snapshot.py
py
17,882
python
en
code
1
github-code
21
[ { "api_name": "sys.path.insert", "line_number": 51, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 51, "usage_type": "attribute" }, { "api_name": "sys.path.insert", "line_number": 55, "usage_type": "call" }, { "api_name": "sys.path", "line_nu...
10506371140
import argparse import ConfigParser import string from datetime import datetime, timedelta from spreadsheet import Spreadsheet from message import TemplateMessage from config import set_config_file from moc_utils import get_absolute_path from dateutil import parser as dateparser def parse_user_row(cells): """Pars...
CCI-MOC/moc-openstack-tools
check-approved-requests.py
check-approved-requests.py
py
11,390
python
en
code
0
github-code
21
[ { "api_name": "config.items", "line_number": 106, "usage_type": "call" }, { "api_name": "config.items", "line_number": 107, "usage_type": "call" }, { "api_name": "message.TemplateMessage", "line_number": 111, "usage_type": "call" }, { "api_name": "moc_utils.get_ab...
8172734270
from scrapy import Spider, Request #from scrapy.selector import Selector from scrapy_bar.items import ScrapyBarItem class Scrapy_bar(Spider): name = 'bar_spider' allowed_urls = ['https://www.yelp.com/'] start_urls = ['https://www.yelp.com/search?find_desc=bars&find_loc=Manhattan,+NY&start=' + str(n) for n in rang...
salambda1987/Web-Scraping-Project
scrapy_bar/scrapy_bar/spiders/bar_spider.py
bar_spider.py
py
3,457
python
en
code
0
github-code
21
[ { "api_name": "scrapy.Spider", "line_number": 7, "usage_type": "name" }, { "api_name": "scrapy.Request", "line_number": 18, "usage_type": "call" }, { "api_name": "scrapy_bar.items.ScrapyBarItem", "line_number": 53, "usage_type": "call" } ]
1863411732
#!/usr/bin/env python """Translate the Last.fm data files to JSON. This script takes the various Last.fm data files and write them out as JSON. It removes the Last.fm artist URLs. Attributes: ARTISTS (dict): A dictionary that stores information about the artists. The variables are as follows: ...
Lab41/hermes
src/utils/lastfm_etl/lastfm.py
lastfm.py
py
8,114
python
en
code
125
github-code
21
[ { "api_name": "csv.reader", "line_number": 95, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 125, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_number": 150, "usage_type": "call" }, { "api_name": "copy.deepcopy", "line_nu...
19603967190
"""minor tweaks Revision ID: c3f0a594293f Revises: 2fb2a9f4c582 Create Date: 2023-10-24 13:49:53.458303 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'c3f0a594293f' down_revision = '2fb2a9f4c582' branch_labels = None depends_on = None def upgrade(): # #...
rawcsav/SpotifyFlask
migrations/versions/c3f0a594293f_minor_tweaks.py
c3f0a594293f_minor_tweaks.py
py
821
python
en
code
0
github-code
21
[ { "api_name": "alembic.op.batch_alter_table", "line_number": 21, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 21, "usage_type": "name" }, { "api_name": "alembic.op.batch_alter_table", "line_number": 29, "usage_type": "call" }, { "api_name": "...
25027195406
from chess import PIECE_TYPES, Board, popcount from chess.engine import Score def sign(score: Score) -> int: if score.is_mate(): s = score.mate() else: s = score.score() if s > 0: return 1 elif s < 0: return -1 return 0 def material_total(board: Board) -> float: ...
linrock/chess-puzzle-maker
puzzlemaker/utils.py
utils.py
py
1,201
python
en
code
51
github-code
21
[ { "api_name": "chess.engine.Score", "line_number": 5, "usage_type": "name" }, { "api_name": "chess.Board", "line_number": 16, "usage_type": "name" }, { "api_name": "chess.PIECE_TYPES", "line_number": 20, "usage_type": "argument" }, { "api_name": "chess.Board", ...
23828854297
from collections import namedtuple PhraseContainer = namedtuple('PhraseContainer', ('value')) class Node: def __init__(self): self.childs = dict() self.top_phrases = [] def __repr__(self): return f'{self.childs}; {self.top_phrases}' class Trie: TOP_PHRASES_PER_PR...
lopespm/autocomplete
shared/trie.py
trie.py
py
1,396
python
en
code
52
github-code
21
[ { "api_name": "collections.namedtuple", "line_number": 2, "usage_type": "call" } ]
10067688462
import PIL.Image as Image import PIL.ImageDraw as ImageDraw import PIL.ImageFont as ImageFont import cv2 import numpy as np #преобразование в символов в текст def crop_by_contours(image, contours): symbols = {} for contour in contours: area = cv2.minAreaRect(contour) points = np.int0(cv2.boxPo...
AS005110/diploma1
recognition.py
recognition.py
py
1,256
python
en
code
0
github-code
21
[ { "api_name": "cv2.minAreaRect", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.int0", "line_number": 13, "usage_type": "call" }, { "api_name": "cv2.boxPoints", "line_number": 13, "usage_type": "call" }, { "api_name": "PIL.Image.new", "line_nu...
15811403530
import jsonify import requests import time from selenium.webdriver import Chrome from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from keras.model...
manjiri13/Youtube-comments-emotion-detection
app.py
app.py
py
3,568
python
en
code
0
github-code
21
[ { "api_name": "tensorflow.compat.v1.disable_v2_behavior", "line_number": 22, "usage_type": "call" }, { "api_name": "tensorflow.compat.v1", "line_number": 22, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 26, "usage_type": "call" }, ...
1213593987
import requests import os import re AIPS_SOLR_HOST = "aips-solr" AIPS_NOTEBOOK_HOST="aips-notebook" AIPS_ZK_HOST="aips-zk" #AIPS_SOLR_HOST = "localhost" #AIPS_NOTEBOOK_HOST="localhost" #AIPS_ZK_HOST="localhost" AIPS_SOLR_PORT = os.getenv('AIPS_SOLR_PORT') or '8983' AIPS_NOTEBOOK_PORT= os.getenv('AIPS_NOTEBOOK_PORT') o...
treygrainger/ai-powered-search
docker/data-science/notebooks/aips.py
aips.py
py
16,170
python
en
code
90
github-code
21
[ { "api_name": "os.getenv", "line_number": 11, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 12, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 13, "usage_type": "call" }, { "api_name": "os.getenv", "line_number": 14, ...
21636418214
import pytest from aio_aws.aio_aws_batch_db import AioAWSBatchDB from aio_aws.aio_aws_batch_db import AioAWSBatchTinyDB from aio_aws.aws_batch_db import AWSBatchDB pytest_plugins = [ "tests.fixtures.aio_aws_fixtures", "tests.fixtures.geojson_fixtures", ] @pytest.fixture def test_jobs_db(tmp_path) -> AWSBatc...
dazza-codes/aio-aws
tests/conftest.py
conftest.py
py
1,055
python
en
code
3
github-code
21
[ { "api_name": "aio_aws.aws_batch_db.AWSBatchDB", "line_number": 17, "usage_type": "call" }, { "api_name": "pytest.fixture", "line_number": 13, "usage_type": "attribute" }, { "api_name": "aio_aws.aws_batch_db.AWSBatchDB", "line_number": 14, "usage_type": "name" }, { ...
10415155848
import pathlib import pytest from cryp_to_go import path_handler def test_init(): inst = path_handler.SubPath('foo/bar') assert str(inst.relative_path) == 'foo/bar' inst = path_handler.SubPath(pathlib.Path('foo/bar')) assert str(inst.relative_path) == 'foo/bar' with pytest.raises(ValueError, match...
matthiashuschle/cryp-to-go
tests/test_path_handler.py
test_path_handler.py
py
1,874
python
en
code
0
github-code
21
[ { "api_name": "cryp_to_go.path_handler.SubPath", "line_number": 7, "usage_type": "call" }, { "api_name": "cryp_to_go.path_handler", "line_number": 7, "usage_type": "name" }, { "api_name": "cryp_to_go.path_handler.SubPath", "line_number": 9, "usage_type": "call" }, { ...
28001816417
from __future__ import absolute_import, print_function from flask_login import user_logged_out from flask_oauthlib.client import OAuth as FlaskOAuth from flask_oauthlib.client import OAuthRemoteApp from . import config from .handlers import authorized_default_handler, disconnect_handler, \ make_handler, make_toke...
N03/invenio
.virtualenvs/invenio/lib/python2.7/site-packages/invenio_oauthclient/ext.py
ext.py
py
4,840
python
en
code
0
github-code
21
[ { "api_name": "flask_login.user_logged_out.connect", "line_number": 24, "usage_type": "call" }, { "api_name": "handlers.oauth_logout_handler", "line_number": 24, "usage_type": "argument" }, { "api_name": "flask_login.user_logged_out", "line_number": 24, "usage_type": "nam...
17266063900
import boto3 Client = boto3.resourse('ec2') instances =client.describe_instances() used_ami = [] for reservation in instances['Reservations']: for instance in reservation['Instances']: used_ami.append(instance['ImageID']) print(used_ami) # Remove duplicate ami def remove_duplicate(amis): unique_ami = ...
rana-repo/Python_boto3
2_deregister_unused_ami.py
2_deregister_unused_ami.py
py
1,072
python
en
code
0
github-code
21
[ { "api_name": "boto3.resourse", "line_number": 2, "usage_type": "call" } ]
1935245488
import pathlib from setuptools import setup, find_packages from geo_to_hca import version HERE = pathlib.Path(__file__).parent README = (HERE / "README.md").read_text() install_requires = [line.rstrip() for line in (HERE / "requirements.in").read_text().splitlines()] setup( name="geo-to-hca", version=versio...
ebi-ait/geo_to_hca
setup.py
setup.py
py
1,134
python
en
code
0
github-code
21
[ { "api_name": "pathlib.Path", "line_number": 6, "usage_type": "call" }, { "api_name": "setuptools.setup", "line_number": 11, "usage_type": "call" }, { "api_name": "geo_to_hca.version", "line_number": 13, "usage_type": "name" }, { "api_name": "setuptools.find_packa...
31301975664
from typing import Optional import torch from torch import nn import torch.nn.functional as F from options import AttentionType class BahdanauAttention(nn.Module): def __init__(self, dim): super(BahdanauAttention, self).__init__() self.query_layer = nn.Linear(dim, dim, bias=False) self.t...
almodhfer/Arabic_Diacritization
modules/attention.py
attention.py
py
6,274
python
en
code
29
github-code
21
[ { "api_name": "torch.nn.Module", "line_number": 10, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 10, "usage_type": "name" }, { "api_name": "torch.nn.Linear", "line_number": 13, "usage_type": "call" }, { "api_name": "torch.nn", "line_nu...
39109404763
import argparse import random import numpy as np #import pdb import gym from gym import logger import sys from reflex_agent.reflex_agent import ReflexAgent from neat_agent.neat_agent import NEATAgent from random_agent.random_agent import RandomAgent class Agent(object): """The world's simplest agent!""" def ...
ianrandman/berzerk
gym-play.py
gym-play.py
py
1,901
python
en
code
1
github-code
21
[ { "api_name": "argparse.ArgumentParser", "line_number": 27, "usage_type": "call" }, { "api_name": "gym.logger.set_level", "line_number": 33, "usage_type": "call" }, { "api_name": "gym.logger", "line_number": 33, "usage_type": "name" }, { "api_name": "gym.logger.IN...
10599372514
# -*- coding: utf-8 -*- """ Created on Thu May 21 12:24:08 2020 @author: smrak@bu.edu """ from gpstec import gpstec from datetime import datetime from cartomap import geogmap as gm import numpy as np import cartopy.crs as ccrs from scipy.ndimage import laplace latlim = [-10, 70] lonlim = [-150, -30] projection = 'st...
aldebaran1/pyTID
imaging/tec_gradient.py
tec_gradient.py
py
1,689
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime", "line_number": 31, "usage_type": "call" }, { "api_name": "gpstec.gpstec.merge_time", "line_number": 32, "usage_type": "call" }, { "api_name": "gpstec.gpstec", "line_number": 32, "usage_type": "name" }, { "api_name": "numpy.nanmea...
70194120054
""" image_resizer.py is a utility script, that helps to make the rendering of textures faster. Changes the 2k resolution texture to a smaller one, for the sake of faster loading of the main menu with planets' cards. """ import sys from PIL import Image import os files = os.listdir(sys.path[0]+'/planet_textures') path...
hellagod/StarrySky
image_resizer.py
image_resizer.py
py
848
python
en
code
0
github-code
21
[ { "api_name": "os.listdir", "line_number": 11, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 11, "usage_type": "attribute" }, { "api_name": "sys.path", "line_number": 12, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_num...
34018297315
import collections import gensim import gensim.downloader as api import json from nltk.corpus import stopwords import numpy as np import torch import utils from gensim.corpora import Dictionary from gensim import similarities from gensim.models import TfidfModel from rank_bm25 import BM25Okapi #from sentence_transform...
nnkennard/iclr-discourse-dataset
baselines/old/models.py
models.py
py
8,513
python
en
code
4
github-code
21
[ { "api_name": "nltk.corpus.stopwords.words", "line_number": 19, "usage_type": "call" }, { "api_name": "nltk.corpus.stopwords", "line_number": 19, "usage_type": "name" }, { "api_name": "collections.defaultdict", "line_number": 40, "usage_type": "call" }, { "api_nam...
26743391199
from django.shortcuts import render import re import requests from bs4 import BeautifulSoup from .forms import bookinfo, topicsn from django.contrib import messages class BookScrape: def __init__(self): self.url_main="https://books.toscrape.com/" self.topics=self.get_topic(self.url_main) ...
Tofunmi-creator/samples
Web Scraper (Online Books)/webscrape_django/bookscrape/views.py
views.py
py
4,557
python
en
code
0
github-code
21
[ { "api_name": "requests.get", "line_number": 14, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 15, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 83, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "...
38847008536
from mdp import MDPEnv, is_valid from tqdm.contrib.concurrent import process_map from tqdm import tqdm, trange import pickle import gzip from functools import cache import numpy as np from constants import HAZARD_P, SLIP_P, GROUP_SIZE, DIR from pathlib import Path def max_model(map_size): return int(map_size*2....
saumikn/gymnasium-test
_1_make_data.py
_1_make_data.py
py
3,601
python
en
code
0
github-code
21
[ { "api_name": "numpy.random.default_rng", "line_number": 19, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 19, "usage_type": "attribute" }, { "api_name": "mdp.MDPEnv", "line_number": 24, "usage_type": "call" }, { "api_name": "constants.HAZAR...
34586425310
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Dec 31 14:37:48 2016 @author: Falaize """ from __future__ import absolute_import, division, print_function from .tools import matrix_type, indent, linesplit from pyphs.config import CONFIG_CPP import numpy def append_ops(method, files, objlabel): ...
pyphs/pyphs
pyphs/numerics/cpp/operations.py
operations.py
py
5,926
python
en
code
39
github-code
21
[ { "api_name": "tools.linesplit", "line_number": 51, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 64, "usage_type": "call" }, { "api_name": "numpy.newaxis", "line_number": 64, "usage_type": "attribute" }, { "api_name": "numpy.prod", "line...
8597116567
"""add exports table Revision ID: 2b0c06cca84d Revises: 994326e472b3 """ import sqlalchemy as sa from alembic import op from sqlalchemy.dialects.postgresql import UUID # revision identifiers, used by Alembic. revision = '2b0c06cca84d' down_revision = '994326e472b3' def upgrade(): op.create_table( 'cal...
wazo-platform/wazo-call-logd
wazo_call_logd/database/alembic/versions/2b0c06cca84d_add_exports_table.py
2b0c06cca84d_add_exports_table.py
py
1,462
python
en
code
0
github-code
21
[ { "api_name": "alembic.op.create_table", "line_number": 18, "usage_type": "call" }, { "api_name": "alembic.op", "line_number": 18, "usage_type": "name" }, { "api_name": "sqlalchemy.Column", "line_number": 20, "usage_type": "call" }, { "api_name": "sqlalchemy.diale...
18033779228
from speechbrain.pretrained import EncoderClassifier import torchaudio import pandas as pd import os classifier = EncoderClassifier.from_hparams(source="/home/armine/Codes/star_rail_ai/speaker_classification/results/speaker_id/1987/save/CKPT+2023-05-08+22-45-26+00", hparams_...
ar-mine/star_rail_ai
speaker_classification/evaluate.py
evaluate.py
py
982
python
en
code
0
github-code
21
[ { "api_name": "speechbrain.pretrained.EncoderClassifier.from_hparams", "line_number": 6, "usage_type": "call" }, { "api_name": "speechbrain.pretrained.EncoderClassifier", "line_number": 6, "usage_type": "name" }, { "api_name": "pandas.read_csv", "line_number": 11, "usage_...
28209217929
from flask import Flask, jsonify, render_template,send_file,redirect,session,request from utils.create_app import create_webapp from utils.push_dockimage import push_docker_image from utils.create_dockerImage import build_docker_image from utils.update_app import update_webapp_image from utils.login import azure_l...
pedo4/TestAzPip
manageList/app.py
app.py
py
5,341
python
en
code
0
github-code
21
[ { "api_name": "flask.Flask", "line_number": 13, "usage_type": "call" }, { "api_name": "flask.Flask", "line_number": 14, "usage_type": "call" }, { "api_name": "utils.login.azure_login", "line_number": 16, "usage_type": "call" }, { "api_name": "flask.session", "...
39623194678
import os import io import json import time # Python 3 compatibility (no longer includes `unicode`): try: unicode except NameError: unicode = str class Cache(object): def __init__(self, path, seconds, retriever, *retriever_args): parent = os.path.dirname(path) if not os.path.exists(parent...
bradrf/kubey
kubey/cache.py
cache.py
py
1,456
python
en
code
2
github-code
21
[ { "api_name": "os.path.dirname", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "os.path.exists", "line_number": 16, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
69808148852
#!/usr/bin/python3 '''fetches status of https://intranet.hbtn.io/status''' import requests import sys if __name__ == "__main__": try: rep = sys.argv[1] except: rep = "" data = {'q': rep} r = requests.post('http://0.0.0.0:5000/search_user', data=data) try: data = r.json()...
gjdame/holbertonschool-higher_level_programming
0x11-python-network_1/8-json_api.py
8-json_api.py
py
558
python
en
code
3
github-code
21
[ { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "requests.post", "line_number": 15, "usage_type": "call" } ]
28859842851
import hashlib import io import os from PIL import Image from PIL.Image import Resampling from tqdm import tqdm os.chdir('../') map_names = {} def normalize_to_rgb(image_content, name, folder_path): try: image_file = io.BytesIO(image_content) image = Image.open(image_file) normalize_ima...
SergioRt1/An-analysis-of-diagram-images-on-Git-repositories
scrapping/normalizer.py
normalizer.py
py
1,743
python
en
code
0
github-code
21
[ { "api_name": "os.chdir", "line_number": 9, "usage_type": "call" }, { "api_name": "io.BytesIO", "line_number": 16, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 17, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 17, ...
70433189493
# Bibliothèques utilisés pour l'explotation du projet et la visualisation des résultats import pandas as pd import argparse import numpy as np from plotly.subplots import make_subplots # graphique interactive import plotly.graph_objects as go # graphique interactive # Import de la fonction de tranformation des données ...
YansKhoja/DGCNN
train.py
train.py
py
8,808
python
en
code
0
github-code
21
[ { "api_name": "model.train", "line_number": 21, "usage_type": "call" }, { "api_name": "model.eval", "line_number": 34, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 45, "usage_type": "call" }, { "api_name": "argparse.RawDescriptio...
27476550782
from transformers import RobertaForSequenceClassification, RobertaTokenizer from transformers import RobertaConfig, RobertaForSequenceClassification import torch model_path = './model96.bin' # Load the model with the specified configuration model = RobertaForSequenceClassification.from_pretrained('microsoft/codebert-...
anhkiet1227/NT505_Thesis
ML/verify.py
verify.py
py
1,233
python
en
code
0
github-code
21
[ { "api_name": "transformers.RobertaForSequenceClassification.from_pretrained", "line_number": 8, "usage_type": "call" }, { "api_name": "transformers.RobertaForSequenceClassification", "line_number": 8, "usage_type": "name" }, { "api_name": "transformers.RobertaTokenizer.from_pret...
36723382740
import fasttext import fasttext.util import gensim import gensim.downloader import argparse import pandas as pd import numpy as np from glob import glob from sklearn import linear_model import embedding_utils as utils import re import itertools def calculate_memorability_conventional(regr, sent_csv, args): """Rea...
anonymous-radio/sentence_memorability
embeddings/conventional_embeddings.py
conventional_embeddings.py
py
5,312
python
en
code
0
github-code
21
[ { "api_name": "pandas.read_csv", "line_number": 28, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 29, "usage_type": "call" }, { "api_name": "embedding_utils.get_embeddings_ft", "line_number": 53, "usage_type": "call" }, { "api_name": "embedding_ut...
43863355511
import copy import logging import os from typing import Dict, List, Optional, Tuple import matplotlib import matplotlib.pyplot as plt import numpy as np import scipy as sc import nanotune as nt from nanotune.data.plotting import (colors_dict, default_plot_params, plot_params_type) ...
microsoft/nanotune
nanotune/fit/coulomboscillationfit.py
coulomboscillationfit.py
py
8,435
python
en
code
9
github-code
21
[ { "api_name": "logging.getLogger", "line_number": 16, "usage_type": "call" }, { "api_name": "typing.Tuple", "line_number": 17, "usage_type": "name" }, { "api_name": "matplotlib.axes", "line_number": 17, "usage_type": "attribute" }, { "api_name": "matplotlib.colorb...
19351852320
import math import cv2 as cv import numpy as np from colorama import Style, Fore from scipy.stats import mode import Common.color as Color from Common.url import CITIES UP = "Moving up" DOWN = "Moving down" LEFT = "Moving to the left" RIGHT = "Moving to the right" STATIONARY = "Stationary" def log(info, msg): ...
lollopagno/VehicleSpeedEstimation
MotionTracking/Utility.py
Utility.py
py
13,216
python
en
code
0
github-code
21
[ { "api_name": "colorama.Fore.YELLOW", "line_number": 32, "usage_type": "attribute" }, { "api_name": "colorama.Fore", "line_number": 32, "usage_type": "name" }, { "api_name": "colorama.Fore.RED", "line_number": 34, "usage_type": "attribute" }, { "api_name": "colora...
26578862902
import os import telegram from doodstream import DoodstreamClient # Masukkan token API bot yang didapat dari Bot Father ke dalam variabel TOKEN TOKEN = "5635344869:AAF3jPheTnvDKAF2Qils437SYjEy9UsyLQw" # Masukkan kredensial API Doodstream ke dalam variabel DOODSTREAM_API_KEY dan DOODSTREAM_API_SECRET DOODSTREAM_API_KE...
hariri911/tesbot
telebot.py
telebot.py
py
1,515
python
id
code
0
github-code
21
[ { "api_name": "doodstream.DoodstreamClient", "line_number": 13, "usage_type": "call" }, { "api_name": "telegram.ext.Updater", "line_number": 16, "usage_type": "call" }, { "api_name": "telegram.ext", "line_number": 16, "usage_type": "attribute" }, { "api_name": "te...
72920014452
"""This module contains base classes and implementations for Deep Q policies, i.e. policies that choose from a list of Q values. Any policy implementation must have BasePolicy as superclass. Content: Base classes: - BasePolicy: base class for any policy that selects an action from Q values - Epsilo...
fedetask/des-rl
deepq/policies.py
policies.py
py
5,927
python
en
code
0
github-code
21
[ { "api_name": "sys.path.append", "line_number": 28, "usage_type": "call" }, { "api_name": "sys.path", "line_number": 28, "usage_type": "attribute" }, { "api_name": "os.path.dirname", "line_number": 28, "usage_type": "call" }, { "api_name": "os.path", "line_num...
72734082292
# @Author : Peizhao Li # @Contact : peizhaoli05@gmail.com import os import pandas as pd import numpy as np import random from numpy import linalg as la from typing import Dict import torch def save2csv(data: Dict, path: str) -> None: data = pd.DataFrame(data, index=[0]) if not os.path.isfile(path): ...
brandeis-machine-learning/influence-fairness
utils.py
utils.py
py
2,568
python
en
code
8
github-code
21
[ { "api_name": "typing.Dict", "line_number": 13, "usage_type": "name" }, { "api_name": "pandas.DataFrame", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path.isfile", "line_number": 15, "usage_type": "call" }, { "api_name": "os.path", "line_numbe...
22584207435
# By GuJi in WT&T, BUPT # from utilities.N_order_Carrier_Sync import N_order_Carrier_Sync from utilities.peroid_estimate import period_estimate import cupy as cp import numpy as np # import matplotlib.pyplot as plt from utilities.main_lobe_BW_estimate import main_lobe_BW_estimate from scipy.signal import find_peaks de...
Boom-Steven/electr_competition
algorithm_code/code_from_guji/utilities/freq_mod_Recognition.py
freq_mod_Recognition.py
py
4,113
python
en
code
0
github-code
21
[ { "api_name": "cupy.concatenate", "line_number": 16, "usage_type": "call" }, { "api_name": "cupy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "cupy.conj", "line_number": 17, "usage_type": "call" }, { "api_name": "cupy.abs", "line_number": 1...
37844975558
import datetime import email import imaplib import os from time import sleep from zipfile import ZipFile import psycopg2 import shutil import random db_name = "db_fts" db_user = "db_admin" db_pswd = "admin_1357S" def reform_date(in_date): tmp = in_date.strftime('%d.%m.%Y %H:%M') return datetime.datetime.strp...
atabayev/ftss
daemons/deadline_checker.py
deadline_checker.py
py
2,236
python
en
code
0
github-code
21
[ { "api_name": "datetime.datetime.strptime", "line_number": 18, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 18, "usage_type": "attribute" }, { "api_name": "os.path.abspath", "line_number": 22, "usage_type": "call" }, { "api_name": "os....
42966272791
#!/usr/bin/env python import json from bs4 import BeautifulSoup # Source of W3Cs list of entities, stored locally. CHAR_HTML = 'dat/chars.html' CHAR_JSON = 'dat/chars.json' CHAR_LESS = 'dat/chars.less' def gen_dict(): """ Generate dict from original w3c file. """ def parse_tr(tr): data = {} data['titl...
djtriptych/chars
chars.py
chars.py
py
1,986
python
en
code
0
github-code
21
[ { "api_name": "bs4.BeautifulSoup", "line_number": 30, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 83, "usage_type": "call" } ]
38426268505
from django.core.management.base import BaseCommand import csv import os from map.models import Phones, HeadReports, DeathReports, AltDiseases class Command(BaseCommand): args = '<None>' help = "Reads in fake generated data to the database" #loop over all files in ./testdata and read them in to repo...
daseinkapital/didactic-enigma
Scripts/predictive/map/management/commands/save_test_data_to_reports.py
save_test_data_to_reports.py
py
2,203
python
en
code
0
github-code
21
[ { "api_name": "django.core.management.base.BaseCommand", "line_number": 8, "usage_type": "name" }, { "api_name": "map.models.HeadReports.objects.all", "line_number": 14, "usage_type": "call" }, { "api_name": "map.models.HeadReports.objects", "line_number": 14, "usage_type...
3992864323
from django.core.validators import RegexValidator from django.db import models class Tag(models.Model): """Тэги для рецептов. Связано с моделью Recipe через М2М. Attributes: name(str): Название тэга. color(str): Цвет тэга в HEX-кодировке. slug(str): ...
Alex1995markson/foodgram-project-react
backend/apps/tags/models.py
models.py
py
1,493
python
ru
code
0
github-code
21
[ { "api_name": "django.db.models.Model", "line_number": 5, "usage_type": "attribute" }, { "api_name": "django.db.models", "line_number": 5, "usage_type": "name" }, { "api_name": "django.db.models.CharField", "line_number": 20, "usage_type": "call" }, { "api_name": ...
5001842885
# -*- coding:UTF-8 -*- from sklearn.linear_model import LogisticRegression import numpy as np import random import matplotlib.pyplot as plt from sklearn.linear_model import LogisticRegression def sigmoid(inX): return 1.0 / (1 + np.exp(-inX)) def stocGradAscent1(dataMatrix, classLabels, numIter=150): m,n = np....
zhangting9756/machineLearning
logistic/src/logisticadmit.py
logisticadmit.py
py
10,162
python
en
code
0
github-code
21
[ { "api_name": "numpy.exp", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.shape", "line_number": 12, "usage_type": "call" }, { "api_name": "numpy.ones", "line_number": 13, "usage_type": "call" }, { "api_name": "random.uniform", "line_number": 1...
31123165805
import datetime import time import jinja2 from nose.tools import ok_, eq_ from django.test import TestCase from airmozilla.main.models import Event from airmozilla.manage.helpers import ( almost_equal, event_status_to_css_label, format_message, ) class TestAlmostEqual(TestCase): def test_almost_eq...
alex-jerez/airmozilla
airmozilla/manage/tests/test_helpers.py
test_helpers.py
py
2,267
python
en
code
null
github-code
21
[ { "api_name": "django.test.TestCase", "line_number": 17, "usage_type": "name" }, { "api_name": "datetime.datetime.now", "line_number": 20, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 20, "usage_type": "attribute" }, { "api_name": "tim...
32752348347
import pandas as pd import itertools import json import utils def _get_relation_example(src_ent: int, trg_ent: int, df_all: pd.DataFrame, is_bert : bool = False): text = '' ent_set = set() for i, row in df_all.iterrows(): cur_token = row['Token'].lower() if row['Entity'] != '_' and row['Ent...
pavalucas/Bete
src/relation_extraction/load_data.py
load_data.py
py
5,907
python
en
code
1
github-code
21
[ { "api_name": "pandas.DataFrame", "line_number": 6, "usage_type": "attribute" }, { "api_name": "utils.BETE_RELATIONS", "line_number": 57, "usage_type": "attribute" }, { "api_name": "itertools.product", "line_number": 70, "usage_type": "call" }, { "api_name": "util...
69989836854
import sys import datetime import os def write_file(step, set_size, observation_list, action_list, score_list, unique_id): print("Step: " + str(step), file=sys.stderr) now = datetime.datetime.now() time_str = str(now)[0:10] + "_" + str(now)[11:23].replace(":", "-").replace(".", "-") if not os.path.e...
hadjurh/Bridge-RL-Agent
utils/memory.py
memory.py
py
950
python
en
code
2
github-code
21
[ { "api_name": "sys.stderr", "line_number": 7, "usage_type": "attribute" }, { "api_name": "datetime.datetime.now", "line_number": 9, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.path.exi...
30838994207
# Libraries import gi from lcd_display import lcd gi.require_version("Gtk", "3.0") from gi.repository import Gtk, Gdk # Variables screen = lcd() # Code class MyWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="Puzzle 2") self.set_border_width(8) self.set_default_siz...
adriiancorral/PBE
puzzle2.py
puzzle2.py
py
1,778
python
en
code
0
github-code
21
[ { "api_name": "gi.require_version", "line_number": 5, "usage_type": "call" }, { "api_name": "lcd_display.lcd", "line_number": 9, "usage_type": "call" }, { "api_name": "gi.repository.Gtk.Window", "line_number": 12, "usage_type": "attribute" }, { "api_name": "gi.rep...
17606335452
# 別解 from typing import Optional class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next def toList(self) -> list: if (self == None): return [] return self.stackList([]) def stackList(self, list: list = []) -> list: list.a...
Yasshi-cookie/leet-code
problems/merge-two-sorted-lists/main2.py
main2.py
py
1,247
python
en
code
0
github-code
21
[ { "api_name": "typing.Optional", "line_number": 24, "usage_type": "name" } ]
24151506348
#!/usr/bin/env python3 import subprocess from urllib import request from git import Repo, Git APP_ROUTE = 'http://10.0.0.1:8002/admin' # must be hardcoded cuz script is to be run as root for wg handling USER_PATH = '/home/odnes' SSH_IDENTITY = '%s/.ssh/id_ed25519' % USER_PATH GIT_SSH_CMD = 'ssh -i %s' % SSH_IDENTITY ...
Odnes/dotfiles
bin/tti_push.py
tti_push.py
py
1,888
python
en
code
0
github-code
21
[ { "api_name": "git.Repo", "line_number": 12, "usage_type": "call" }, { "api_name": "subprocess.check_output", "line_number": 38, "usage_type": "call" }, { "api_name": "subprocess.run", "line_number": 49, "usage_type": "call" }, { "api_name": "urllib.request.urlope...