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
40303282711
import serial from flask import request from flask_api import FlaskAPI, status app = FlaskAPI(__name__) ready = "ready" port_name = "/dev/cu.usbmodem143201" def send_str_to_arduino(msg): with serial.Serial(port_name, 9600) as ser: print("Waiting for arduino...") ch = ser.read(len(ready)) ...
dvdme/LcdDisplayWeb
serial_sender.py
serial_sender.py
py
960
python
en
code
0
github-code
97
[ { "api_name": "flask_api.FlaskAPI", "line_number": 6, "usage_type": "call" }, { "api_name": "serial.Serial", "line_number": 12, "usage_type": "call" }, { "api_name": "flask.request.data.get", "line_number": 30, "usage_type": "call" }, { "api_name": "flask.request....
29657344095
from django.conf.urls import include, url from django.contrib import admin admin.autodiscover() from serve.views import bulkview,subprojectview,mapprojects,indexview,collectionview,collectioninsert,no_objection urlpatterns = [ url(r'^search/', indexview, name='index'), url(r'^admin/', include(admin.site.urls)...
ash2shukla/String-Match-API
stringmatchapi/stringmatchapi/urls.py
urls.py
py
597
python
en
code
2
github-code
97
[ { "api_name": "django.contrib.admin.autodiscover", "line_number": 4, "usage_type": "call" }, { "api_name": "django.contrib.admin", "line_number": 4, "usage_type": "name" }, { "api_name": "django.conf.urls.url", "line_number": 8, "usage_type": "call" }, { "api_name...
30519553609
from django.shortcuts import render from django.db.models import Avg, Count from django.contrib.auth.models import User from django.http import HttpResponse from .models import Rater, Rating, Movie # Create your views here. def all_movies(request): movies = Movie.objects.all() return render(request, ...
powder-river/django-movielens
movielens/review/views.py
views.py
py
1,449
python
en
code
0
github-code
97
[ { "api_name": "models.Movie.objects.all", "line_number": 9, "usage_type": "call" }, { "api_name": "models.Movie.objects", "line_number": 9, "usage_type": "attribute" }, { "api_name": "models.Movie", "line_number": 9, "usage_type": "name" }, { "api_name": "django.s...
7036504591
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from einops import rearrange, repeat from torch import einsum def compute_imitation_loss(input, target, weights): target = torch.where(torch.isnan(target), input, target) # ignore nan targets diff = input - target...
monster-ghost/MonoDistill
lib/losses/feature_distill_loss.py
feature_distill_loss.py
py
5,481
python
en
code
61
github-code
97
[ { "api_name": "torch.where", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.isnan", "line_number": 10, "usage_type": "call" }, { "api_name": "torch.any", "line_number": 35, "usage_type": "call" }, { "api_name": "torch.nn.functional.interpolate", ...
70334604158
"""DenseNet as encoder backbone. Reference: https://arxiv.org/pdf/1608.06993.pdf """ import torch from torch import nn import numpy as np import math from training import CONFIGS_DIR, load_config class DenseNet(nn.Module): @classmethod def from_config(cls, architecture_name, phase): """ Ar...
dnychennnn/m26_g1_semantics
training/models/densenet.py
densenet.py
py
8,219
python
en
code
3
github-code
97
[ { "api_name": "torch.nn.Module", "line_number": 14, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 14, "usage_type": "name" }, { "api_name": "training.load_config", "line_number": 22, "usage_type": "call" }, { "api_name": "training.load_conf...
11876191189
from game import Game import pygame from player import Player import sys from os import environ from utility import black from config import Config from datetime import datetime if __name__ == "__main__": num_games = 1 games = [] for i in range(num_games): games.append(Game()) active_game = 0 ...
RieCo432/PongAI
main.py
main.py
py
3,178
python
en
code
0
github-code
97
[ { "api_name": "game.Game", "line_number": 15, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 19, "usage_type": "name" }, { "api_name": "pygame.init", "line_number": 20, "usage_type": "call" }, { "api_name": "pygame.display.set_mode", "line_...
18931872934
import discord import asyncio import aiohttp import os import re import random import json def parseReplys(reply): regex = r"\$\{([\w\ ]+)\}" parsed = reply matches = re.finditer(regex, reply, re.MULTILINE) if not matches: return parsed for i in matches: com = i.group(1).split(...
SeolHa314/DiscordMireiBot
app.py
app.py
py
2,932
python
en
code
0
github-code
97
[ { "api_name": "re.finditer", "line_number": 12, "usage_type": "call" }, { "api_name": "re.MULTILINE", "line_number": 12, "usage_type": "attribute" }, { "api_name": "random.randint", "line_number": 20, "usage_type": "call" }, { "api_name": "aiohttp.ClientSession", ...
70801636159
import requests # Калсс содержит вызовы методов api сервиса, серилезовнные в методы класса class Doge: base_url = "https://dog.ceo/api" def all_breeds(self): response = requests.get(f"{self.base_url}/breeds/list/all").json() print(response) if response.ok: return response ...
Akuma925/OtusPythonQAJune2020HomeWork
HomeWorkMock/doge.py
doge.py
py
1,088
python
en
code
0
github-code
97
[ { "api_name": "requests.get", "line_number": 9, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 17, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 25, "usage_type": "call" }, { "api_name": "requests.get", "line_number...
74323754240
from qgis.PyQt.QtCore import QSettings, QTranslator, QCoreApplication, Qt from qgis.PyQt.QtGui import QIcon from qgis.PyQt.QtWidgets import QAction, QTreeWidgetItem # Initialize Qt resources from file resources.py from .resources import * # Import the code for the DockWidget from .plugin_compiler_dockwidget import Plu...
CyprienAn/PluginCompiler
plugin_compiler.py
plugin_compiler.py
py
22,186
python
en
code
0
github-code
97
[ { "api_name": "os.path.dirname", "line_number": 35, "usage_type": "call" }, { "api_name": "os.path", "line_number": 35, "usage_type": "attribute" }, { "api_name": "qgis.PyQt.QtCore.QSettings", "line_number": 38, "usage_type": "call" }, { "api_name": "os.path.join"...
40915225432
"""Python process Django Models.""" import json import os from pathlib import Path from typing import Any, Dict, List, MutableMapping, Optional, Type from .communicator import communicator from .fields import ( BooleanField, DateTimeField, Field, IntegerField, JsonField, ListField, Relation...
gregorjerse/resolwe
resolwe/process/models.py
models.py
py
19,131
python
en
code
null
github-code
97
[ { "api_name": "django.contrib.auth.get_user_model", "line_number": 25, "usage_type": "call" }, { "api_name": "communicator.communicator.get_user_model_label", "line_number": 27, "usage_type": "call" }, { "api_name": "communicator.communicator", "line_number": 27, "usage_t...
32189053733
import os import numpy as np import pickle import config import sys import run_experiments as run import compute as comp def get_results(para_setup): name_string = '%s-' * len(para_setup) # % para_setup name_string = name_string[:-1] folder_name = config.home_path + config.interim_result_path file_...
guenwi/J-PCMCIplus
metrics.py
metrics.py
py
7,149
python
en
code
1
github-code
97
[ { "api_name": "config.home_path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "config.interim_result_path", "line_number": 15, "usage_type": "attribute" }, { "api_name": "pickle.load", "line_number": 20, "usage_type": "call" }, { "api_name": "num...
73875280958
from testsuite.base_fs import BaseFilesystem from testfixtures import log_capture from testsuite import config from core.sessions import SessionURL from core import modules from core import messages import subprocess import datetime import logging import os class FileCheck(BaseFilesystem): def setUp(self): ...
zhl2008/ctf-framework
utils/weevely3/testsuite/test_file_check.py
test_file_check.py
py
4,479
python
en
code
21
github-code
97
[ { "api_name": "testsuite.base_fs.BaseFilesystem", "line_number": 12, "usage_type": "name" }, { "api_name": "core.sessions.SessionURL", "line_number": 15, "usage_type": "call" }, { "api_name": "core.modules.load_modules", "line_number": 16, "usage_type": "call" }, { ...
35110676182
import os, os.path, sys import h5py import numpy as np import pickle as pkl from configs_genre import gen_config as genre_config from configs_gender import gen_config as gender_config from configs_year import gen_config as year_config from models.ann import Classifier from models.cnn import CNNClassifier from feature...
Alroomi/Song-Classification
demo.py
demo.py
py
6,694
python
en
code
0
github-code
97
[ { "api_name": "configs_year.gen_config", "line_number": 16, "usage_type": "call" }, { "api_name": "configs_year.gen_config", "line_number": 17, "usage_type": "call" }, { "api_name": "configs_genre.gen_config", "line_number": 19, "usage_type": "call" }, { "api_name...
41185960483
import environs env = environs.Env() env.read_env("./.env") TOKEN = env.str('TOKEN') API_HASH = env.str('API_HASH') API_ID = env.int('API_ID') ADMIN_CHATID = env.int('ADMIN_CHATID') ADMIN_USERNAME = env.str('ADMIN_USERNAME') db_name = env.str('DB_NAME') modules_repo_branch = env.str('MODULES_REPO_BRANCH', 'master')
deadboizxc/example-userbot
utils/config.py
config.py
py
320
python
en
code
0
github-code
97
[ { "api_name": "environs.Env", "line_number": 3, "usage_type": "call" } ]
73069611519
from pyfiglet import Figlet import sys import random figlet = Figlet() if ( len(sys.argv) == 3 and (sys.argv[1] == "-f" or sys.argv[1] == "--font") and sys.argv[2] in figlet.getFonts() ): figlet.setFont(font=sys.argv[2]) elif len(sys.argv) == 1: figlet.setFont(font=random.choice(f...
jdcsjdcs/Python-CS50
python-cs50/figlet/figlet.py
figlet.py
py
433
python
en
code
1
github-code
97
[ { "api_name": "pyfiglet.Figlet", "line_number": 5, "usage_type": "call" }, { "api_name": "sys.argv", "line_number": 9, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number": 10, "usage_type": "attribute" }, { "api_name": "sys.argv", "line_number...
19218234146
import sys import signal import subprocess try: import argparse except: print('argparse required, run: pip install argparse'); sys.exit(1) #global variables------------------------------------------------------------------ current_version = '0.1' outgoing_open_ports = [] process = None #---...
glezo1/out_firewalking
server/out_firewalking_server.py
out_firewalking_server.py
py
3,926
python
en
code
0
github-code
97
[ { "api_name": "sys.exit", "line_number": 7, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 43, "usage_type": "call" }, { "api_name": "argparse.ArgumentParser", "line_number": 46, "usage_type": "call" }, { "api_name": "sys.exit", "line_number"...
33245400551
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.shortcuts import render from django.http import HttpResponse from django.http import JsonResponse from django.views.decorators.csrf import csrf_exempt from models import Users import json import os import example as e #########################...
Minor-Navigation/Django
app1/views.py
views.py
py
8,921
python
en
code
0
github-code
97
[ { "api_name": "example.rtree", "line_number": 63, "usage_type": "call" }, { "api_name": "django.shortcuts.render", "line_number": 116, "usage_type": "call" }, { "api_name": "django.views.decorators.csrf.csrf_exempt", "line_number": 59, "usage_type": "name" }, { "a...
36490309887
def separator(): chars = "#" for i in range(100): chars += "#" print(chars) late = False if late: print(1) else: print(0) separator() income = 15000 if income < 10000: tax_coefficient = 0.0 elif income < 30000: tax_coefficient = 0.2 elif income < 100000: tax_coefficent = 0.3...
slackfx/learningpython
learning_python/conditionals.py
conditionals.py
py
3,258
python
en
code
0
github-code
97
[ { "api_name": "datetime.date.today", "line_number": 142, "usage_type": "call" }, { "api_name": "datetime.date", "line_number": 142, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 143, "usage_type": "call" } ]
18616344004
import yaml, os, re from code_generator import CodeGenerator from config import config from constants import * class ConversionGenerator(): def __init__(self) -> None: self.project_path = config['conversionInfo']['projectPath'] self.crds = None self.get_crds() os.chdir(self.project_...
Kuromesi/APIUpdater
conversion_generator.py
conversion_generator.py
py
8,007
python
en
code
0
github-code
97
[ { "api_name": "config.config", "line_number": 8, "usage_type": "name" }, { "api_name": "os.chdir", "line_number": 11, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 14, "usage_type": "call" }, { "api_name": "os.path", "line_number": 14, ...
24653360320
from django.contrib import admin from django.urls import path, include from . import views urlpatterns = [ path('home', views.home, name = 'home'), path('signup', views.signup, name = 'signup'), path('signin', views.signin, name = 'signin'), path('signout', views.signout, name = 'signout'), path(...
pawaskarmahesh/Mini-Project-1B-2022-23
Group No.8_Mini-project/Mini-Project/authentication/urls.py
urls.py
py
595
python
en
code
4
github-code
97
[ { "api_name": "django.urls.path", "line_number": 8, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 9, "usage_type": "call" }, { "api_name": "django.urls.path", "line_number": 10, "usage_type": "call" }, { "api_name": "django.urls.path", ...
32511299546
import pandas as pd from datetime import datetime df = pd.read_csv('https://query.data.world/s/tt5efa64gl6ruwmxz4wdgmhfwroi4r', usecols=['longitude', 'latitude', 'region', 'admin1', 'location', 'event_type', 'fatalities', 'event_date']) print('Loading in dataset from data.wo...
TifMoe/visualizing_conflict
src/make_data.py
make_data.py
py
771
python
en
code
0
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 4, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 13, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 13, "usage_type": "name" } ]
12309676620
import json import configparser import os import requests from pathlib import Path import sqlite3 import pandas from math import ceil import datetime class SearchAnalyzer(): session = requests.Session() __BASE_API_URL = 'https://line.pr-cy.ru/api/v1.1.0' low_price = 0.25 high_price = 0.3 __tasks...
STEJKpro/pr-cy_SEARCH_domain_analyzer
analyzer_service.py
analyzer_service.py
py
21,617
python
en
code
0
github-code
97
[ { "api_name": "requests.Session", "line_number": 13, "usage_type": "call" }, { "api_name": "configparser.ConfigParser", "line_number": 24, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 25, "usage_type": "call" }, { "api_name": "os.path", ...
18841026287
"""Spotitude. Get a user's top 25 tracks and return a 5x5 grid visualization. """ from config import Config from data import get_top_tracks import spotipy from visualization import make_visualization import argparse import gui if __name__ == "__main__": # Parse the input parameters. parser = argparse.Argumen...
dtcrout/spotitude
spotitude.py
spotitude.py
py
1,369
python
en
code
18
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 15, "usage_type": "call" }, { "api_name": "config.Config", "line_number": 30, "usage_type": "call" }, { "api_name": "config.get_token", "line_number": 31, "usage_type": "call" }, { "api_name": "spotipy.Spotif...
21057451756
# -*- coding: utf-8 -*- from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth.views import LoginView from django.shortcuts import render, redirect from .models import Contact from .forms import ContactForm template = 'core/' class CustomAuthenticationForm(AuthenticationForm): """Defin...
gjohann7/chatbotapp
chatbotapp/core/views.py
views.py
py
2,223
python
en
code
0
github-code
97
[ { "api_name": "django.contrib.auth.forms.AuthenticationForm", "line_number": 11, "usage_type": "name" }, { "api_name": "django.contrib.auth.views.LoginView", "line_number": 27, "usage_type": "name" }, { "api_name": "forms.ContactForm", "line_number": 57, "usage_type": "ca...
25931118437
import pickle import PIL from PIL import Image import numpy as np import os # for letter in ['o','p','q','r','s','u']: for letter in ['a','b','c','e','g']: samples = len([f for f in os.listdir('./Letters/'+letter+'/') if f[-5:] == ".jpeg"]) databasename='./Letters/'+letter+'/'+letter+'_vector.p' database=[] for i...
methi1999/scribble
Preprocessing/4jpegtovector.py
4jpegtovector.py
py
627
python
en
code
0
github-code
97
[ { "api_name": "os.listdir", "line_number": 9, "usage_type": "call" }, { "api_name": "PIL.Image.open", "line_number": 14, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 14, "usage_type": "name" }, { "api_name": "numpy.array", "line_number": 1...
29747087875
from django.conf.urls import patterns, include, url from django.contrib import admin urlpatterns = patterns('', # Examples: url(r'^$', 'agilecar.views.index', name='index'), # url(r'^blog/', include('blog.urls')), url(r'^admin/', include(admin.site.urls)), url(r'^jobposting/', include('jobposting....
cainhicks/agilecar
agilecar/urls.py
urls.py
py
751
python
en
code
0
github-code
97
[ { "api_name": "django.conf.urls.patterns", "line_number": 4, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 6, "usage_type": "call" }, { "api_name": "django.conf.urls.url", "line_number": 9, "usage_type": "call" }, { "api_name": "djan...
8220968078
import config import hashlib import app class Edit: def __init__(self): pass ''' def GET(self, id_denuncia, **k): if app.session.loggedin is True: # validate if the user is logged # session_username = app.session.username session_privilege = app.session.privile...
GabiCuriel/SavingLifes
application/controllers/denuncia/edit.py
edit.py
py
2,951
python
es
code
0
github-code
97
[ { "api_name": "config.check_secure_val", "line_number": 43, "usage_type": "call" }, { "api_name": "config.model.get_denuncia", "line_number": 44, "usage_type": "call" }, { "api_name": "config.model", "line_number": 44, "usage_type": "attribute" }, { "api_name": "c...
3821177178
import copy import os from collections import OrderedDict from logging import getLogger from time import time import numpy as num import theano.tensor as tt from pymc3 import Deterministic, Uniform from pyrocko.gf import LocalEngine, RectangularSource from theano import config as tconfig from theano import shared from...
hvasbath/beat
beat/models/geodetic.py
geodetic.py
py
39,976
python
en
code
120
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 28, "usage_type": "call" }, { "api_name": "beat.models.base.Composite", "line_number": 41, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 70, "usage_type": "call" }, { "api_name": "os.path", ...
74825422400
from typing import Any, Union from prometheus_client import Counter, Histogram from metrics.event import Event class SampleEvent(Event): LABELS = ["error"] METRICS = { "result": Counter("sample_result", "sample result", LABELS), "latency": Histogram( "sample_latency", ...
jakyns/prometheus-client-python
metrics/event/sample_event.py
sample_event.py
py
691
python
en
code
0
github-code
97
[ { "api_name": "metrics.event.Event", "line_number": 8, "usage_type": "name" }, { "api_name": "prometheus_client.Counter", "line_number": 11, "usage_type": "call" }, { "api_name": "prometheus_client.Histogram", "line_number": 12, "usage_type": "call" }, { "api_name...
40908799028
#!/usr/bin/python import sys import argparse from netaddr import * def main(args): parser = argparse.ArgumentParser(description='Check if ip(s) in range(s) --- don\'t use -i and -I or -r and -R') igroup = parser.add_mutually_exclusive_group(required = True) igroup.add_argument('-i', '--ip', help='ip to...
AccentureTVM/Python-check-IPs-in-Ranges
ipCIDR.py
ipCIDR.py
py
3,068
python
en
code
0
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 28, "usage_type": "call" }, { "api_name": "sys.exit", "line_number": 35, "usage_type": "call" }, { "api_name": "sys.exit", "line_number"...
13033181793
"""tox-pyenv Plugin for the tox_get_python_executable using tox's plugin system: https://testrun.org/tox/latest/plugins.html#tox.hookspecs.tox_get_python_executable Modified to instead use `pyenv which` to locate the appropriate python executable. This takes the place of the standard behavior in tox. The built-i...
tox-dev/tox-pyenv
tox_pyenv.py
tox_pyenv.py
py
4,877
python
en
code
127
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 50, "usage_type": "call" }, { "api_name": "py.path.local.sysfind", "line_number": 80, "usage_type": "call" }, { "api_name": "py.path", "line_number": 80, "usage_type": "attribute" }, { "api_name": "subprocess.Popen...
71308864640
import tensorflow as tf from skimage import transform as tr from skimage import io import pandas as pd import numpy as np import re import netv2 as net #fetch data def datFetch(dat, path, batch_size, iteration = 0, offset = 0, aug_chance = 0.3, load_box = True): imgs = [] bboxes = [] categories = [] ...
l3th4l/TFObjectLocalization
trainops.py
trainops.py
py
2,825
python
en
code
1
github-code
97
[ { "api_name": "numpy.array", "line_number": 17, "usage_type": "call" }, { "api_name": "skimage.io.imread", "line_number": 21, "usage_type": "call" }, { "api_name": "skimage.io", "line_number": 21, "usage_type": "name" }, { "api_name": "numpy.random.uniform", "...
30642292932
from django.http import HttpResponse from django.core.serializers import serialize import json from django.shortcuts import render class HttpResponseMixin(object): def render_to_Http_response(self,json_data,status=200): return HttpResponse(json_data,content_type='application/json',status=status) class Seri...
sachinkumar7277/OTP_Based_Login_API
restAPI/mixins.py
mixins.py
py
915
python
en
code
0
github-code
97
[ { "api_name": "django.http.HttpResponse", "line_number": 7, "usage_type": "call" }, { "api_name": "django.core.serializers.serialize", "line_number": 11, "usage_type": "call" }, { "api_name": "json.loads", "line_number": 14, "usage_type": "call" }, { "api_name": "...
43869910670
import toml def parse_toml_to_venv_script(file_path: str, python_version="3.10.12", env_name="myenv") -> str: """ Convert a TOML configuration to a bash script that sets up a python environment using venv and performs actions based on the TOML. Parameters: - file_path: The path to the TOML file. ...
romlingroup/flatpack-ai
package/flatpack/flatpack/parsers.py
parsers.py
py
5,364
python
en
code
2
github-code
97
[ { "api_name": "toml.load", "line_number": 29, "usage_type": "call" } ]
73395788798
""" N layers optimistic neural network """ import torch class ThreeLayersNN(torch.nn.Module): def __init__(self, in_dim, out_dim, h_dim, activation='relu'): """ :param in_dim: (int) input dimension :param out_dim: (int) output dimension """ super(ThreeLayersNN, self).__in...
erwanlecarpentier/optimistic-regressor
models/three_layers_nn.py
three_layers_nn.py
py
956
python
en
code
0
github-code
97
[ { "api_name": "torch.nn", "line_number": 8, "usage_type": "attribute" }, { "api_name": "torch.nn.Linear", "line_number": 20, "usage_type": "call" }, { "api_name": "torch.nn", "line_number": 20, "usage_type": "attribute" }, { "api_name": "torch.nn.Linear", "lin...
30291296391
from pyVmomi import vim from vmwarelib import inventory from vmwarelib.actions import BaseAction class VMRemove(BaseAction): def run(self, vm_id, delete_permanently, vsphere=None): """ Remove virtual machine from vsphere Args: - vm_id: Moid of Virtual Machine to edit - v...
StackStorm/st2contrib
packs/vsphere/actions/vm_hw_remove.py
vm_hw_remove.py
py
1,052
python
en
code
154
github-code
97
[ { "api_name": "vmwarelib.actions.BaseAction", "line_number": 7, "usage_type": "name" }, { "api_name": "vmwarelib.inventory.get_virtualmachine", "line_number": 25, "usage_type": "call" }, { "api_name": "vmwarelib.inventory", "line_number": 25, "usage_type": "name" }, {...
73843164158
from datetime import datetime, timedelta from io import BytesIO from PIL import Image from ebedke.utils.date import on_workdays, days_lower from ebedke.utils.utils import ocr_image, pattern_slice from ebedke.utils import facebook from ebedke.utils.text import skip_empty_lines from ebedke.pluginmanager import EbedkePlug...
ijanos/ebedke
ebedke/plugins/kerova.py
kerova.py
py
1,437
python
en
code
34
github-code
97
[ { "api_name": "datetime.datetime.strptime", "line_number": 17, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 17, "usage_type": "name" }, { "api_name": "datetime.timedelta", "line_number": 17, "usage_type": "call" }, { "api_name": "ebedk...
19961529650
from discord.commands import slash_command, SlashCommandGroup, Option from discord.ext import commands as ext_commands from discord import Permissions import discord import commands import common from typing import TYPE_CHECKING if TYPE_CHECKING: from BadWolfBot import BadWolfBot EMPTY_CHAR = '\u200b' allowed = ...
BadWolf1023/MKW-Table-Bot
slash_cogs/AdminSlashCommands.py
AdminSlashCommands.py
py
4,499
python
en
code
11
github-code
97
[ { "api_name": "typing.TYPE_CHECKING", "line_number": 9, "usage_type": "name" }, { "api_name": "common.botAdmins", "line_number": 14, "usage_type": "attribute" }, { "api_name": "common.OWNERS", "line_number": 14, "usage_type": "attribute" }, { "api_name": "common.i...
17805849732
#!/usr/bin/python import tempfile, argparse import os, sys, random, hashlib from pathlib import * from encrypt import encrypt_line, save_key, encrypt_line_v2 from decrypt import decrypt_line, find_key, delete_key_file, decrypt_line_v2 from webpage import create_webpage def hash(text): result = hashlib.sha...
hg387/CustomRansomware
Walker.py
Walker.py
py
4,541
python
en
code
0
github-code
97
[ { "api_name": "hashlib.sha256", "line_number": 10, "usage_type": "call" }, { "api_name": "os.access", "line_number": 22, "usage_type": "call" }, { "api_name": "os.W_OK", "line_number": 22, "usage_type": "attribute" }, { "api_name": "os.R_OK", "line_number": 22...
27812956353
# This code have been programmed by Christian Blad, Sajuran and Søren Koch aka. Group VT4103A # The reinforcement learning framework is based on the original code from udemy course https://www.udemy.com/artificial-intelligence-az/ # From Aalborg University # Importing the libraries import numpy as np import torch impo...
qLience/AI-Pump-for-Underfloor-Heating-systems
models/eligibility_trace_torch/ai.py
ai.py
py
5,273
python
en
code
35
github-code
97
[ { "api_name": "torch.nn.Module", "line_number": 17, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 17, "usage_type": "name" }, { "api_name": "torch.nn.functional.softmax", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.nn.fu...
34658618948
# -*- coding: utf-8 -* import re import argparse def parse_args(): parser = argparse.ArgumentParser( description="Paddle Fluid word2 vector preprocess") parser.add_argument( '--data_path', type=str, required=True, help="The path of training dataset") parser.add_arg...
Micheal0001/models
fluid/PaddleRec/word2vec/preprocess.py
preprocess.py
py
4,984
python
en
code
null
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 8, "usage_type": "call" }, { "api_name": "re.sub", "line_number": 36, "usage_type": "call" } ]
72487496640
import os import urllib from osgeo import ogr import folium def get_bbox(geom): return '{0},{1},{2},{3}'.format(*geom.GetEnvelope()) def get_center(geom): centroid = geom.Centroid() return [centroid.GetY(),centroid.GetX()] def get_state_geom(state_name): # C:\Users\Fabio\Documents\Programmazione\Pych...
geosconsulting/geoprocessing
ch4/WFS_Read.py
WFS_Read.py
py
2,023
python
en
code
2
github-code
97
[ { "api_name": "osgeo.ogr.Open", "line_number": 15, "usage_type": "call" }, { "api_name": "osgeo.ogr", "line_number": 15, "usage_type": "name" }, { "api_name": "urllib.urlencode", "line_number": 37, "usage_type": "call" }, { "api_name": "urllib.parse.urlencode", ...
38233160889
import ROOT import numpy as np import time from utils import get_leadjets, \ get_cells, get_truth_parts, topo_cluster_in_jets, \ map_cells, nb_of_truth_parts, map_truth_parts, \ get_tracks from base import DatasetBase class DatasetRoot(DatasetBase): """ Generator of clusters from root tree """...
guillaumegenthial/clusters
src/core/dataset/root.py
root.py
py
3,302
python
en
code
1
github-code
97
[ { "api_name": "base.DatasetBase", "line_number": 11, "usage_type": "name" }, { "api_name": "base.DatasetBase.__init__", "line_number": 19, "usage_type": "call" }, { "api_name": "base.DatasetBase", "line_number": 19, "usage_type": "name" }, { "api_name": "ROOT.TFil...
13336239882
"""palyapp URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-ba...
cproctor/palyapp_server
palyapp/urls.py
urls.py
py
3,666
python
en
code
0
github-code
97
[ { "api_name": "rest_framework_extensions.routers.ExtendedDefaultRouter", "line_number": 24, "usage_type": "call" }, { "api_name": "rest_framework_extensions.routers", "line_number": 24, "usage_type": "name" }, { "api_name": "stories.views.PublicationViewSet", "line_number": 2...
11969324371
#dot import numpy as np import pygame import constants import time display_width = constants.display_width display_height = constants.display_height dot_width = constants.dot_width dot_height = constants.dot_height white = constants.white black = constants.black red = constants.red max_moves = constants.max_moves...
sachin-101/NEAT
very easy game/dot.py
dot.py
py
4,733
python
en
code
0
github-code
97
[ { "api_name": "constants.display_width", "line_number": 7, "usage_type": "attribute" }, { "api_name": "constants.display_height", "line_number": 8, "usage_type": "attribute" }, { "api_name": "constants.dot_width", "line_number": 10, "usage_type": "attribute" }, { ...
102792871
import sys import time import webbrowser import pyttsx3 import speech_recognition as sr import datetime import os import pyaudio import wikipedia from requests import get import pyjokes import pywikihow from pywikihow import search_wikihow import speedtest engine = pyttsx3.init('sapi5') voices = engine.getProperty...
Manu1234-design/jarvis
Jarvis.py
Jarvis.py
py
3,943
python
en
code
0
github-code
97
[ { "api_name": "pyttsx3.init", "line_number": 20, "usage_type": "call" }, { "api_name": "speech_recognition.Recognizer", "line_number": 32, "usage_type": "call" }, { "api_name": "speech_recognition.Microphone", "line_number": 33, "usage_type": "call" }, { "api_name...
20290008160
from datetime import datetime, timedelta from typing import List from fastapi import Depends, HTTPException, status, Path, APIRouter from sqlalchemy.orm import Session from src.database.db import get_db from src.database.model import Contact from src.schemas import ContactResponse, ContactModel router = APIRouter(pr...
MaksymBratsiun/Homework_web_11
src/routes/contacts.py
contacts.py
py
4,515
python
en
code
0
github-code
97
[ { "api_name": "fastapi.APIRouter", "line_number": 11, "usage_type": "call" }, { "api_name": "sqlalchemy.orm.Session", "line_number": 15, "usage_type": "name" }, { "api_name": "fastapi.Depends", "line_number": 15, "usage_type": "call" }, { "api_name": "src.database...
21050183412
import time from appium import webdriver from appium.webdriver.extensions.android.nativekey import AndroidKey from appium.webdriver.common.appiumby import By caps = { "platformName": "Android", # 声明是ios还是Android系统 "platformVersion": "11", # Android内核版本号 "deviceName": "Redmi_K30_Pro", # 连接的设备名称 "appPackage": "com.tencen...
531207502/code_save
python-pc/appium/appium-test.py
appium-test.py
py
1,871
python
en
code
0
github-code
97
[ { "api_name": "appium.webdriver.Remote", "line_number": 13, "usage_type": "call" }, { "api_name": "appium.webdriver", "line_number": 13, "usage_type": "name" }, { "api_name": "appium.webdriver.common.appiumby.By.ID", "line_number": 15, "usage_type": "attribute" }, { ...
8255346359
import os import datetime DEADTIME = 175 def getime (file, dir, t_result, start_time): d_time = [] for i in range(2,139): dirno = str(i) newdir = dir + dirno os.chdir(newdir) times = open(file, 'r') lines = times.readlines() for line in lines: if lin...
Saarikakumar/datetimeinfo
elapsed_time.py
elapsed_time.py
py
1,248
python
en
code
0
github-code
97
[ { "api_name": "os.chdir", "line_number": 11, "usage_type": "call" }, { "api_name": "datetime.datetime.strptime", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.datetime", "line_number": 21, "usage_type": "attribute" }, { "api_name": "os.chdir",...
29509770652
from functools import wraps from django.http import Http404, HttpResponseRedirect from django.conf import settings def require_staff(protected_view): @wraps(protected_view) def wrapper(request, *args, **kwargs): staff_token = settings.STAFF_TOKEN token_auth = staff_token is not None and staf...
gpodder/mygpo
mygpo/administration/auth.py
auth.py
py
703
python
en
code
257
github-code
97
[ { "api_name": "django.conf.settings.STAFF_TOKEN", "line_number": 11, "usage_type": "attribute" }, { "api_name": "django.conf.settings", "line_number": 11, "usage_type": "name" }, { "api_name": "django.http.HttpResponseRedirect", "line_number": 19, "usage_type": "call" }...
5778383599
import sys from collections import Counter class Solution: def minWindow(self, s: str, t: str) -> str: left = 0 right = 0 start = 0 valid = 0 min_len = sys.maxsize need = Counter(t) window = Counter() while right < len(s): c = s[right] ...
baoyf4244/interviews
leetcode/sliding_window/0076_minimum_window_substring.py
0076_minimum_window_substring.py
py
949
python
en
code
0
github-code
97
[ { "api_name": "sys.maxsize", "line_number": 11, "usage_type": "attribute" }, { "api_name": "collections.Counter", "line_number": 13, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 14, "usage_type": "call" }, { "api_name": "sys.maxsize"...
20489458291
import httplib, urllib, base64, json subscription_key = 'bd2a946f230b4f4faec329e9933ea477' uri_base = 'westcentralus.api.cognitive.microsoft.com' headers = { # Request headers. 'Content-Type': 'application/json', 'Ocp-Apim-Subscription-Key': subscription_key, } params = urllib.urlencode({ # Request par...
cindyzhao/RaspBot
vision.py
vision.py
py
948
python
en
code
0
github-code
97
[ { "api_name": "urllib.urlencode", "line_number": 10, "usage_type": "call" }, { "api_name": "httplib.HTTPSConnection", "line_number": 15, "usage_type": "call" }, { "api_name": "json.dumps", "line_number": 19, "usage_type": "call" }, { "api_name": "json.loads", ...
11629294919
# -*- coding: utf-8 -*- import torch.nn as nn from torch import Tensor #############################################1 #Create a class, extending the Module class of PyTorch class MyCNNSystem(nn.Module): def __init__(self, kernel_size_1=5, kernel_size_2=5, channel_1=20, channel_2=20, dropout=0.2): ...
contact-aleksei/1_year_Tampere_advanced_audio_processing
exercise_02/my_cnn_system_name.py
my_cnn_system_name.py
py
2,482
python
en
code
0
github-code
97
[ { "api_name": "torch.nn.Module", "line_number": 6, "usage_type": "attribute" }, { "api_name": "torch.nn", "line_number": 6, "usage_type": "name" }, { "api_name": "torch.nn.Conv2d", "line_number": 17, "usage_type": "call" }, { "api_name": "torch.nn", "line_numb...
20289142022
#!/usr/bin/env python import argparse import logging as log import os.path as osp import sys if __name__ == '__main__': parser = argparse.ArgumentParser(description='Updates an Axon database'\ 'without loading the GUI') parser.add_argument('database', help='Database to update') opts = parser.parse...
xgrg/alfa
axon/axon_database_update.py
axon_database_update.py
py
896
python
en
code
0
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 9, "usage_type": "call" }, { "api_name": "brainvisa.axon.initializeProcesses", "line_number": 16, "usage_type": "call" }, { "api_name": "brainvisa.axon", "line_number": 16, "usage_type": "name" }, { "api_name...
71046497279
from project_crawl.share.models import Product from project_crawl.share.utils import init_logging, print_line, get_settings, get_db_connect_string, is_env_production from sqlalchemy import create_engine, select from sqlalchemy.orm import Session import scrapy class ShopHpDetailSpider(scrapy.Spider): name = "shop...
tion846/project_crawl
project_crawl/spiders/shop_hp_detail.py
shop_hp_detail.py
py
2,526
python
en
code
0
github-code
97
[ { "api_name": "scrapy.Spider", "line_number": 9, "usage_type": "attribute" }, { "api_name": "project_crawl.share.utils.get_settings", "line_number": 32, "usage_type": "call" }, { "api_name": "project_crawl.share.utils.init_logging", "line_number": 36, "usage_type": "call"...
35977337694
import re import json from urllib.parse import unquote from bs4 import BeautifulSoup import sys import requests # -*- coding: UTF-8 -*- URL_List = [] ARTICLES = dict({}) ID = 0 def run(url): parse_urls(get_soup(url)) def parse_urls(soup): """ Searches for all links on Google News Search Page """ for a i...
reido2012/JapaneseArticleScraper
news.py
news.py
py
6,539
python
en
code
1
github-code
97
[ { "api_name": "sys.exit", "line_number": 24, "usage_type": "call" }, { "api_name": "urllib.parse.unquote", "line_number": 49, "usage_type": "call" }, { "api_name": "requests.get", "line_number": 60, "usage_type": "call" }, { "api_name": "requests.exceptions", ...
20105326211
from typing import Dict, List, Union, TypedDict import logging import pandas as pd import numpy as np import spacy root_logger = logging.getLogger() logger = root_logger.getChild(__name__) def tokenize_expand_abbreviations(sent: spacy.tokens.Span, abrv_map: Dict) -> List[str]: toks = [] for tok in sent: ...
h1-the-swan/bridger
dataprocess/src/bridger_dataprocess/core.py
core.py
py
3,467
python
en
code
0
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 8, "usage_type": "call" }, { "api_name": "spacy.tokens", "line_number": 12, "usage_type": "attribute" }, { "api_name": "typing.Dict", "line_number": 12, "usage_type": "name" }, { "api_name": "typing.List", "lin...
1790493532
import tweepy import os class TweeterApi: def __init__(self, username, dataDir, tweeterToken, side): self.consumerKey = tweeterToken["consumer_key"] self.consumerSecret = tweeterToken["consumer_secret"] self.accessToken = tweeterToken["access_token"] self.accessTokenSecret = tweet...
VictorMeyer77/tln_politics_debate
dataGen/tweeterApi.py
tweeterApi.py
py
1,634
python
en
code
0
github-code
97
[ { "api_name": "os.path.join", "line_number": 13, "usage_type": "call" }, { "api_name": "os.path", "line_number": 13, "usage_type": "attribute" }, { "api_name": "tweepy.OAuthHandler", "line_number": 17, "usage_type": "call" }, { "api_name": "tweepy.API", "line_...
42255665916
import numpy as np import skimage from collections import deque from keras import layers, models, optimizers from game import wrapped_flappy_bird as flappy DO_UP = 0 DO_NOTHING = 1 ACTIONS = [DO_NOTHING, DO_UP] MAX_REPLAY_SIZE = 50000 OBSERVERATION = 3200 BATCH_SIZE = 100 EPSILON = 1.0 GAMMA = 0.95 epsilon = 1.0 ...
ashutosh-dwivedi-e3502/deepq_flappy
model.py
model.py
py
3,113
python
en
code
0
github-code
97
[ { "api_name": "collections.deque", "line_number": 26, "usage_type": "call" }, { "api_name": "numpy.random.choice", "line_number": 34, "usage_type": "call" }, { "api_name": "numpy.random", "line_number": 34, "usage_type": "attribute" }, { "api_name": "skimage.color...
72822599040
###Manages BOT ### from os import EX_CANTCREAT import telegram from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, ConversationHandler import mysql.connector import os #Telegram BOT API configuration - valid token hidden TOKEN =os.environ.get('BOT_TOKEN') #MySQL Database credential, hosted on f...
jacopobr/car-2-smart
telegrambot/bot.py
bot.py
py
8,261
python
en
code
2
github-code
97
[ { "api_name": "os.environ.get", "line_number": 9, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 9, "usage_type": "attribute" }, { "api_name": "os.environ.get", "line_number": 13, "usage_type": "call" }, { "api_name": "os.environ", "line_nu...
21139230399
from __future__ import annotations import json import re from datetime import datetime from logging import LoggerAdapter from typing import Any, Dict import paho.mqtt.client as mqtt from oslo_log import log from sqlalchemy.orm import Session from dandelion import crud from dandelion.db import session from dandelion....
open-v2x/dandelion
dandelion/mqtt/service/rsu/rsu_spat.py
rsu_spat.py
py
2,973
python
en
code
36
github-code
97
[ { "api_name": "logging.LoggerAdapter", "line_number": 18, "usage_type": "name" }, { "api_name": "oslo_log.log.getLogger", "line_number": 18, "usage_type": "call" }, { "api_name": "oslo_log.log", "line_number": 18, "usage_type": "name" }, { "api_name": "dandelion.m...
71597415039
import base64 import lzma import multiprocessing import multiprocessing.queues import ssl import textwrap from difflib import unified_diff from functools import lru_cache from http.server import ( HTTPServer, SimpleHTTPRequestHandler, ) from json import dumps from unittest import SkipTest from unittest.mock imp...
datalad/datalad
datalad/tests/utils_pytest.py
utils_pytest.py
py
67,748
python
en
code
464
github-code
97
[ { "api_name": "datalad.support.external_versions.external_versions", "line_number": 51, "usage_type": "name" }, { "api_name": "datalad.support.external_versions.external_versions", "line_number": 58, "usage_type": "name" }, { "api_name": "pytest.mark", "line_number": 66, ...
25348171258
import matplotlib.font_manager as font_manager import pandas as pd FONT_PATH = "fonts/LinLibertine_R.ttf" def add_missing_months(df): # Erstelle einen leeren DataFrame mit allen Monaten des Jahres all_months = pd.DataFrame({'month': range(1, 13)}) # Führe einen Left Join durch, um die fehlenden Monat...
NilsHellwig/Topic_Modelling_Twitter_German_Federal_Election_2021
03 Train Models/plots.py
plots.py
py
6,188
python
en
code
0
github-code
97
[ { "api_name": "pandas.DataFrame", "line_number": 8, "usage_type": "call" }, { "api_name": "matplotlib.font_manager.fontManager.addfont", "line_number": 19, "usage_type": "call" }, { "api_name": "matplotlib.font_manager.fontManager", "line_number": 19, "usage_type": "attri...
74910985598
import numpy as np import pytest from tests.test_mixed_integrator_numeric import _run_simulation from tests.test_utils import _open_json import odetoolbox try: import pygsl.odeiv as odeiv PYGSL_AVAILABLE = True except ImportError: PYGSL_AVAILABLE = False @pytest.mark.skipif(not PYGSL_AVAILABLE, reason="...
nest/ode-toolbox
tests/test_expression_simplification.py
test_expression_simplification.py
py
2,215
python
en
code
14
github-code
97
[ { "api_name": "tests.test_utils._open_json", "line_number": 29, "usage_type": "call" }, { "api_name": "tests.test_mixed_integrator_numeric._run_simulation", "line_number": 34, "usage_type": "call" }, { "api_name": "pygsl.odeiv.step_rk4", "line_number": 34, "usage_type": "...
15505867367
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division import numpy as np import pygame from pygame.locals import * import sys ##################################################################### # Hier die Zustandsvariablen initialisieren: Position und Geschwindigkeit # des Spielers #########...
iblech/mathezirkel-kurs
mathecamp-2016/mein-erstes-videospiel/stub.py
stub.py
py
3,072
python
de
code
9
github-code
97
[ { "api_name": "numpy.array", "line_number": 15, "usage_type": "call" }, { "api_name": "numpy.array", "line_number": 16, "usage_type": "call" }, { "api_name": "pygame.draw.rect", "line_number": 43, "usage_type": "call" }, { "api_name": "pygame.draw", "line_numb...
16346298766
import json import logging import os import tempfile from enum import Enum from pathlib import Path from typing import Dict, Tuple, List, Optional, Set from PySide6 import QtCore from PySide6.QtCore import QSettings from coolero.models.lcd_mode import LcdMode from coolero.models.lighting_mode import LightingMode # no...
codifryed/coolero
coolero/settings.py
settings.py
py
14,620
python
en
code
18
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 24, "usage_type": "call" }, { "api_name": "os.environ.get", "line_number": 25, "usage_type": "call" }, { "api_name": "os.environ", "line_number": 25, "usage_type": "attribute" }, { "api_name": "os.environ.get", ...
28598460521
# -*- coding:utf-8 -*- # @Time : 2022/4/30 15:17 # @Author : quzhuo import os import numpy as np import torch import torch.utils.data as data from PIL import Image from Utils.utils_dataset import convert_from_color class MyDataset(data.Dataset): def __init__(self, dataset_path, dataset_name, num_c...
quzhuo19/SemanticSegmentation_v3
dataset.py
dataset.py
py
3,388
python
en
code
0
github-code
97
[ { "api_name": "torch.utils.data.Dataset", "line_number": 13, "usage_type": "attribute" }, { "api_name": "torch.utils.data", "line_number": 13, "usage_type": "name" }, { "api_name": "os.path.join", "line_number": 21, "usage_type": "call" }, { "api_name": "os.path",...
16919510866
import pygame from pygame.math import * from Fruit import Fruit, PhantomFruit from Wall import Wall import SnakeGame class Snake(pygame.sprite.Sprite): DIRECTION_UP = Vector2(-1, 0) DIRECTION_DOWN = Vector2(1, 0) DIRECTION_LEFT = Vector2(0, -1) DIRECTION_RIGHT = Vector2(0, 1) AXIS_VERTICAL = (DIRE...
brayden-meyer/snake
Snake.py
Snake.py
py
8,700
python
en
code
0
github-code
97
[ { "api_name": "pygame.sprite", "line_number": 8, "usage_type": "attribute" }, { "api_name": "pygame.image.load", "line_number": 19, "usage_type": "call" }, { "api_name": "pygame.image", "line_number": 19, "usage_type": "attribute" }, { "api_name": "pygame.image.lo...
29248022887
# import cv2 import numpy as np from matplotlib import pyplot as plt import time def show(name,img): cv2.imshow(name, img) cv2.waitKey(0) cv2.destroyAllWindows() MIN = 10 FLANN_INDEX_KDTREE = 0 starttime = time.time() dir_root = r"D:\02dataset\01work\01TuoPanLJ\tuopan\0tmp_test3/" img01_path = dir_root + "1...
LittleSheepy/MyMLStudy
ml06pyPackeg/pk02opencv/openCV练习/06特征拼接.py
06特征拼接.py
py
2,695
python
en
code
3
github-code
97
[ { "api_name": "cv2.imshow", "line_number": 7, "usage_type": "call" }, { "api_name": "cv2.waitKey", "line_number": 8, "usage_type": "call" }, { "api_name": "cv2.destroyAllWindows", "line_number": 9, "usage_type": "call" }, { "api_name": "time.time", "line_numbe...
24762832599
from PIL import Image im = Image.open("owl.jpeg") pixels = im.load() # список с пикселями x, y = im.size # ширина (x) и высота (y) изображения for i in range(x): for j in range(y): r, g, b = pixels[i, j] pixels[i, j] = g, b, r im.save("owl1.jpeg")
yapcix/python_lessons
libraries_2/model_example.py
model_example.py
py
313
python
ru
code
0
github-code
97
[ { "api_name": "PIL.Image.open", "line_number": 3, "usage_type": "call" }, { "api_name": "PIL.Image", "line_number": 3, "usage_type": "name" } ]
34442068611
from typing import Optional from django.db import transaction, connection from django.db.models import Subquery, QuerySet from peoplefinder.models import Team, TeamTree class TeamService: def add_team(self, team: Team, parent: Team) -> None: """Add a team into the hierarchy. Args: t...
uktrade/peoplefinder-v2
peoplefinder/services/team.py
team.py
py
4,066
python
en
code
0
github-code
97
[ { "api_name": "peoplefinder.models.Team", "line_number": 10, "usage_type": "name" }, { "api_name": "peoplefinder.models.TeamTree.objects.bulk_create", "line_number": 17, "usage_type": "call" }, { "api_name": "peoplefinder.models.TeamTree.objects", "line_number": 17, "usag...
3802172327
""" Webscrape """ import webscrape_def from selenium import webdriver from selenium.webdriver.chrome.service import Service from webdriver_manager.chrome import ChromeDriverManager # create a ChromeOptions object chrome_options = webdriver.ChromeOptions() # set the "detach" option to True chrome_options.add_experim...
caleb-stahl/Stormglass_Surf
webscrape_main.py
webscrape_main.py
py
1,017
python
en
code
0
github-code
97
[ { "api_name": "selenium.webdriver.ChromeOptions", "line_number": 12, "usage_type": "call" }, { "api_name": "selenium.webdriver", "line_number": 12, "usage_type": "name" }, { "api_name": "selenium.webdriver.Chrome", "line_number": 17, "usage_type": "call" }, { "api...
1082528578
# -*- coding: utf-8 -*- """ Created on Sat Feb 6 11:07:23 2021 @author: Windows10 """ import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns pd.set_option('display.max_columns', None) path_spy = 'C:/Users/Windows10/Desktop/from old dell/Python_files/Daily_range_clo...
jaredalbert/random_stuff
Daily_range_close_study/daily_range_close_study.py
daily_range_close_study.py
py
1,057
python
en
code
0
github-code
97
[ { "api_name": "pandas.set_option", "line_number": 12, "usage_type": "call" }, { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "pandas.qcut", "line_number": 22, "usage_type": "call" }, { "api_name": "numpy.arange", "lin...
26335527654
""" opentrons_shared_data.labware.dev_types: types for labware defs types in this file by and large require the use of typing_extensions. this module shouldn't be imported unless typing.TYPE_CHECKING is true. """ from typing import Dict, List, NewType, Union from typing_extensions import Literal, TypedDict LabwareUr...
Opentrons/opentrons
shared-data/python/opentrons_shared_data/labware/dev_types.py
dev_types.py
py
3,257
python
en
code
363
github-code
97
[ { "api_name": "typing.NewType", "line_number": 10, "usage_type": "call" }, { "api_name": "typing.Union", "line_number": 12, "usage_type": "name" }, { "api_name": "typing_extensions.Literal", "line_number": 13, "usage_type": "name" }, { "api_name": "typing_extensio...
15406549922
import torch import numpy as np from pathlib import Path from torch import nn as nn from typing import Union, Callable PathLike = Union[str, Path] def to_numpy(x: torch.Tensor) -> np.ndarray: if isinstance(x, float): return x return x.cpu().detach().numpy() def inference_step(x: Union[np.ndarray, t...
stanislaushimovolos/Variational-Dropout-Pytorch
var_drop/utils.py
utils.py
py
818
python
en
code
0
github-code
97
[ { "api_name": "typing.Union", "line_number": 7, "usage_type": "name" }, { "api_name": "pathlib.Path", "line_number": 7, "usage_type": "name" }, { "api_name": "torch.Tensor", "line_number": 10, "usage_type": "attribute" }, { "api_name": "numpy.ndarray", "line_n...
23938476762
import unittest from test.asyncio_tests import AsyncIOTestCase, asyncio_test from typing import TYPE_CHECKING, Any, Callable, Dict, List, Mapping, TypeVar, Union, cast from bson import CodecOptions from bson.raw_bson import RawBSONDocument from bson.son import SON from pymongo.operations import DeleteOne, InsertOne, R...
mongodb/motor
test/test_typing.py
test_typing.py
py
9,889
python
en
code
2,245
github-code
97
[ { "api_name": "typing_extensions.TypedDict", "line_number": 17, "usage_type": "name" }, { "api_name": "typing_extensions.TypedDict", "line_number": 21, "usage_type": "name" }, { "api_name": "bson.ObjectId", "line_number": 22, "usage_type": "name" }, { "api_name": ...
27358069237
from typing import List class Solution: def letterCombinations(self, digits: str) -> List[str]: res=[] l = len(digits) store={ "2":["a","b","c"], "3":["d","e","f"], "4":["g","h","i"], "5":["j","k","l"], "6":["m","n","o"], ...
mkssri/competitive_programming
leetcode_fulltimes/2023/januarary/17_letter_combi_ph_nos.py
17_letter_combi_ph_nos.py
py
702
python
en
code
0
github-code
97
[ { "api_name": "typing.List", "line_number": 4, "usage_type": "name" } ]
9478874027
import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation import matplotlib as mpl mpl.rcParams['text.usetex'] = True mpl.rcParams['animation.html'] = 'html5' th = np.linspace(0,2*np.pi,1000) fig, (ax1,ax2) = plt.subplots(1,2,figsize=(9,4)) ax2.plot(th,np.cos(th),color="b",label=r"...
elyurn/basic_animation
basic_animation.py
basic_animation.py
py
1,204
python
en
code
0
github-code
97
[ { "api_name": "matplotlib.rcParams", "line_number": 6, "usage_type": "attribute" }, { "api_name": "matplotlib.rcParams", "line_number": 7, "usage_type": "attribute" }, { "api_name": "numpy.linspace", "line_number": 9, "usage_type": "call" }, { "api_name": "numpy.p...
16362874547
""" The getting method of the category object of the API """ from fastapi import APIRouter, Body, Depends from pydantic import BaseModel from consys.errors import ErrorAccess, ErrorWrong from models.category import Category from services.auth import sign from lib.queue import get router = APIRouter() class Type(B...
kosyachniy/web
api/routes/categories/get.py
get.py
py
1,598
python
en
code
7
github-code
97
[ { "api_name": "fastapi.APIRouter", "line_number": 14, "usage_type": "call" }, { "api_name": "pydantic.BaseModel", "line_number": 17, "usage_type": "name" }, { "api_name": "fastapi.Body", "line_number": 24, "usage_type": "call" }, { "api_name": "fastapi.Depends", ...
23899522790
# import openpyxl # def server_find_from_excl(ws_name:str, col_i:int, find_val:str): # sourceWB = openpyxl.load_workbook('E:/MyCode/networkWeb/device_list.xlsx') # sourceWS = sourceWB[ws_name] # retrun_info = list() # for row in sourceWS.iter_rows(min_row=2, values_only=True): # if row[c...
YSRpointNN/cq_2023_networkWEB
bin_/test.py
test.py
py
997
python
en
code
0
github-code
97
[ { "api_name": "openpyxl.load_workbook", "line_number": 23, "usage_type": "call" } ]
34658390339
__author__ = 'dengjingwen' import nltk import re from nltk.tokenize.punkt import PunktSentenceTokenizer from nltk.stem.wordnet import WordNetLemmatizer from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.ensemble import RandomForestClassifier fin = open('sentens_samples.txt', 'r') texts = fin.rea...
FionaT/NLP-proj
previous_version/ML.py
ML.py
py
1,935
python
en
code
0
github-code
97
[ { "api_name": "sklearn.feature_extraction.text.TfidfVectorizer", "line_number": 12, "usage_type": "call" }, { "api_name": "sklearn.ensemble.RandomForestClassifier", "line_number": 17, "usage_type": "call" }, { "api_name": "nltk.tokenize.punkt.PunktSentenceTokenizer", "line_nu...
31059832083
# -*- coding: utf-8 -*- from __future__ import division import argparse, time, logging, random, math import numpy as np import mxnet as mx from mxnet import gluon, nd from mxnet import autograd as ag from mxnet.gluon import nn from mxnet.gluon.data.vision import transforms from gluoncv.model_zoo import get_model from g...
KiLJ4EdeN/DeepLearningFromScratch
Extras/transfer_resnet_cifar.py
transfer_resnet_cifar.py
py
4,212
python
en
code
4
github-code
97
[ { "api_name": "mxnet.cpu", "line_number": 16, "usage_type": "call" }, { "api_name": "gluoncv.model_zoo.get_model", "line_number": 19, "usage_type": "call" }, { "api_name": "mxnet.init.Xavier", "line_number": 20, "usage_type": "call" }, { "api_name": "mxnet.init", ...
7927478368
import os from models.inference_model import InferenceModel import config import utils.utils as utils import torch import torchvision import torchvision.transforms as transforms from tqdm import tqdm import argparse # inference configurations # network_name = 'female2male' num_of_images = 6 use_saved_config = False ...
AlonShoshan10/dynamic_net
dynamic_dcgan/inference.py
inference.py
py
2,311
python
en
code
48
github-code
97
[ { "api_name": "argparse.ArgumentParser", "line_number": 19, "usage_type": "call" }, { "api_name": "os.path.join", "line_number": 27, "usage_type": "call" }, { "api_name": "os.path", "line_number": 27, "usage_type": "attribute" }, { "api_name": "os.path.join", ...
24122973017
# ----------------------------------------------------------------------------- # Air Resources Laboratory # # ashtrajectory.py - run HYSPLIT model on web and create plots # # 01 JUN 2020 (AMC) - adapted from locusts-run.py # 28 FEB 2023 (AMC) - default is for 10 evenly spaced trajectories from vent to top height. # --...
noaa-oar-arl/utilhysplit
ashapp/enstrajectory.py
enstrajectory.py
py
4,114
python
en
code
9
github-code
97
[ { "api_name": "logging.getLogger", "line_number": 26, "usage_type": "call" }, { "api_name": "ashapp.ashtrajectory.TrajectoryAshRun", "line_number": 38, "usage_type": "name" }, { "api_name": "utilhysplit.metfiles.gefs_suffix_list", "line_number": 42, "usage_type": "call" ...
74359664958
from math import hypot from timeit import default_timer import googlemaps class Node: """ represents a node in a TSP tour """ def __init__(self, coords): self.num = coords[0] # start position in a route's order self.x = coords[1] # x coordinate/Lat self.y = coords[2] # y coordinate/Lng self.key = 'AIza...
chinruichew/EADSProject
2opt_algo.py
2opt_algo.py
py
4,495
python
en
code
0
github-code
97
[ { "api_name": "googlemaps.Client", "line_number": 14, "usage_type": "call" }, { "api_name": "math.hypot", "line_number": 28, "usage_type": "call" }, { "api_name": "timeit.default_timer", "line_number": 152, "usage_type": "call" }, { "api_name": "timeit.default_tim...
1755894709
#!/usr/bin/python # -*- coding: utf-8 -*- """ handler for an openssl ca """ from __future__ import print_function import os import json import base64 import uuid import re from OpenSSL import crypto # pylint: disable=E0401 from acme.helper import load_config, build_pem_file, uts_now, uts_to_date_utc, b64_url_recode, ce...
grindsa/acme2certifier
.github/openssl_ca_handler_v16.py
openssl_ca_handler_v16.py
py
26,760
python
en
code
125
github-code
97
[ { "api_name": "os.path.exists", "line_number": 49, "usage_type": "call" }, { "api_name": "os.path", "line_number": 49, "usage_type": "attribute" }, { "api_name": "OpenSSL.crypto.load_privatekey", "line_number": 52, "usage_type": "call" }, { "api_name": "OpenSSL.cr...
13611249302
from bs4 import BeautifulSoup import requests def get_first_news(): headers = { 'user - agent': 'Mozilla / 5.0(Windows NT 10.0;Win64;x64) AppleWebKit / 537.36(KHTML, likeGecko) Chrome / 102.0.5005.63Safari / 537.36' } url = 'https://charter97.org/' r = requests.get(url=url, headers=headers) ...
Yaraul1/Parsing-News-Bot
main.py
main.py
py
558
python
en
code
0
github-code
97
[ { "api_name": "requests.get", "line_number": 10, "usage_type": "call" }, { "api_name": "bs4.BeautifulSoup", "line_number": 12, "usage_type": "call" } ]
23143143288
import math import numpy as np from PIL import Image import torch from torchvision import transforms from ..utils.face_alignment import align_face class Align: def __init__(self, get_eyes_mouth): self.get_eyes_mouth = get_eyes_mouth def __call__(self, im: Image, points: np.ndarray): e0, e1,...
florisdf/continuous_landmarks
continuous_landmarks/dataset/transforms.py
transforms.py
py
4,189
python
en
code
0
github-code
97
[ { "api_name": "PIL.Image", "line_number": 15, "usage_type": "name" }, { "api_name": "numpy.ndarray", "line_number": 15, "usage_type": "attribute" }, { "api_name": "utils.face_alignment.align_face", "line_number": 17, "usage_type": "call" }, { "api_name": "numpy.ar...
8283370743
# 가장 먼 노드 # 11 points import collections def solution(n, edge): dic = collections.defaultdict(list) for s, e in edge: dic[s - 1].append(e - 1) dic[e - 1].append(s - 1) been = [False for i in range(n)] q = [0] cnt = 0 while len(q) > 0: newq = set() for node i...
dorahkim/programmers
Graph/furthest_node.py
furthest_node.py
py
605
python
en
code
0
github-code
97
[ { "api_name": "collections.defaultdict", "line_number": 6, "usage_type": "call" } ]
74393326077
try: import requests, json, time, os, sys from fake_useragent import UserAgent except ImportError:exit(f"{hijau}[{merah}x{hijau}] {cyan}Module belum diinstall, install dengan perintah 'pip install requests fake_useragent'") hijau = '\x1b[1;92m' cyan = '\x1b[1;96m' kuning = '\x1b[1;93m' ungu = '\x1b[1;95m' puti...
AbilSeno/spamsmsrupiahcepat
spam12.py
spam12.py
py
3,029
python
en
code
2
github-code
97
[ { "api_name": "fake_useragent.UserAgent", "line_number": 16, "usage_type": "call" }, { "api_name": "time.sleep", "line_number": 35, "usage_type": "call" }, { "api_name": "os.system", "line_number": 44, "usage_type": "call" }, { "api_name": "os.system", "line_n...
1624824502
""" """ from collections import defaultdict import torch from torch.utils.data import DataLoader from torch.utils.data.sampler import RandomSampler from ac.util import array_like_stack def mt_collate_fn(batch_list): """ Collate function for a multi-task dataset. Assumes all inputs are the same size. A...
geoffreyangus/analytic-continuation
ac/experiment/dataloaders.py
dataloaders.py
py
1,966
python
en
code
0
github-code
97
[ { "api_name": "collections.defaultdict", "line_number": 21, "usage_type": "call" }, { "api_name": "ac.util.array_like_stack", "line_number": 33, "usage_type": "call" }, { "api_name": "ac.util.array_like_stack", "line_number": 35, "usage_type": "call" }, { "api_nam...
1483290188
import urllib.request from bs4 import BeautifulSoup import ssl import json # Ignore SSL cerificate errors(for HTTPS sites) ctx = ssl.create_default_context() ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONE url = input('Enter -') # for HTTPS html = urllib.request.urlopen(url, context=ctx).read() # html = ur...
nightisyang/gitbook-grind75
scripts/scraping.py
scraping.py
py
792
python
en
code
0
github-code
97
[ { "api_name": "ssl.create_default_context", "line_number": 7, "usage_type": "call" }, { "api_name": "ssl.CERT_NONE", "line_number": 9, "usage_type": "attribute" }, { "api_name": "urllib.request.request.urlopen", "line_number": 13, "usage_type": "call" }, { "api_na...
5330724556
# Data Libraries import pandas as pd import numpy as np import datetime import time # Dash APP import dash from dash import html, dcc, dash_table as dt, Input, Output, State import dash_bootstrap_components as dbc from dash.exceptions import PreventUpdate from components.navbar import * from components.visualizations...
kaburelabs/marketing-app-prototype
app.py
app.py
py
9,083
python
en
code
2
github-code
97
[ { "api_name": "pandas.read_csv", "line_number": 19, "usage_type": "call" }, { "api_name": "dash_bootstrap_components.themes", "line_number": 24, "usage_type": "attribute" }, { "api_name": "dash.Dash", "line_number": 30, "usage_type": "call" }, { "api_name": "dash....
27079444500
#!/usr/bin/env python # -*- coding: utf-8 -*- from flask import Flask import os import logg import pandas as pd import numpy as np from pipeline import Model_Pipeline,CleaningTextData,FillingNaN,TfIdf from sklearn.ensemble import GradientBoostingRegressor import nltk import ssl import datetime try: _create_unveri...
pashaboyko/diplom
app/flask_app.py
flask_app.py
py
3,776
python
en
code
0
github-code
97
[ { "api_name": "ssl._create_unverified_context", "line_number": 16, "usage_type": "attribute" }, { "api_name": "ssl._create_default_https_context", "line_number": 20, "usage_type": "attribute" }, { "api_name": "nltk.download", "line_number": 21, "usage_type": "call" }, ...
43045468752
# explanations for member functions are provided in requirements.py # each file that uses a Zip Tree should import it from this file. from typing import TypeVar import random KeyType = TypeVar('KeyType') ValType = TypeVar('ValType') class Node: def __init__(self, key: KeyType, val: ValType, rank: int): ...
fingalcong/261p
zip_tree.py
zip_tree.py
py
4,286
python
en
code
0
github-code
97
[ { "api_name": "typing.TypeVar", "line_number": 7, "usage_type": "call" }, { "api_name": "typing.TypeVar", "line_number": 8, "usage_type": "call" }, { "api_name": "random.randint", "line_number": 29, "usage_type": "call" } ]
16163596661
from collections import defaultdict, Counter def read_input(file_path: str) -> list[tuple[list[str], list[str]]]: patterns_displayed_pairs = [] with open(file_path, 'r') as fp: for line in fp.readlines(): patterns, displayed = line.split('|') patterns = patterns.strip().split()...
NovelleP/AdventOfCode2021
day8/day8_2.py
day8_2.py
py
4,063
python
en
code
2
github-code
97
[ { "api_name": "collections.defaultdict", "line_number": 16, "usage_type": "call" }, { "api_name": "collections.Counter", "line_number": 25, "usage_type": "call" }, { "api_name": "collections.defaultdict", "line_number": 38, "usage_type": "call" }, { "api_name": "c...
18642437006
import datetime from django.shortcuts import render, redirect from .models import Request, Review from .forms import AddRequest, AddUserForm from django.contrib.auth.decorators import permission_required from .forms import RegistrForm from django.contrib.auth.decorators import login_required # Create your views here. ...
OlgaLavyshyk/trucking
trucking/cargo/views.py
views.py
py
4,437
python
en
code
0
github-code
97
[ { "api_name": "django.shortcuts.render", "line_number": 11, "usage_type": "call" }, { "api_name": "forms.AddRequest", "line_number": 18, "usage_type": "call" }, { "api_name": "models.Request", "line_number": 21, "usage_type": "call" }, { "api_name": "datetime.date...
74595392957
""" Data-Store Models and a couple things to basically automatically create an API from a Model """ from google.appengine.ext import ndb import datetime import json import logging def university_key(name): return ndb.Key("University", name) def course_id(dept, number): return dept+str(number) def course_key(key_i...
TheDoctor343/enigmatic-intelligence
models.py
models.py
py
5,841
python
en
code
0
github-code
97
[ { "api_name": "google.appengine.ext.ndb.Key", "line_number": 11, "usage_type": "call" }, { "api_name": "google.appengine.ext.ndb", "line_number": 11, "usage_type": "name" }, { "api_name": "google.appengine.ext.ndb.Key", "line_number": 17, "usage_type": "call" }, { ...
21097263790
import os import time import argparse import torch import numpy as np from PIL import Image from torch.autograd import Variable from torchvision import transforms from nets import basic, depth_predciton, basic_NL, DGNLNet from config import test_raincityscapes_path from misc import check_mkdir from skimage.metrics im...
ZixiaXia/SANL-Net
infer.py
infer.py
py
9,009
python
en
code
1
github-code
97
[ { "api_name": "os.environ", "line_number": 23, "usage_type": "attribute" }, { "api_name": "torch.manual_seed", "line_number": 25, "usage_type": "call" }, { "api_name": "torch.cuda.set_device", "line_number": 26, "usage_type": "call" }, { "api_name": "torch.cuda", ...
75145117439
import csv import json import logging import pickle from datetime import date import pymysql from flask import Flask, request, jsonify, \ send_from_directory from flask_cors import CORS from pymysql import cursors logging.basicConfig( format='%(asctime)s %(levelname)-8s %(message)s', level=logging.DEBUG, ...
sabithsn/conv-moderator-v2
annotation-site/annotation_website_tutorial/annotation_website/backend/app.py
app.py
py
10,086
python
en
code
0
github-code
97
[ { "api_name": "logging.basicConfig", "line_number": 13, "usage_type": "call" }, { "api_name": "logging.DEBUG", "line_number": 15, "usage_type": "attribute" }, { "api_name": "flask.Flask", "line_number": 20, "usage_type": "call" }, { "api_name": "flask_cors.CORS", ...