max_stars_repo_path stringlengths 3 269 | max_stars_repo_name stringlengths 4 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.05M | score float64 0.23 5.13 | int_score int64 0 5 |
|---|---|---|---|---|---|---|
course_api/migrations/0017_auto_20180404_2343.py | dragonbone81/bobcat-courses-backend | 3 | 12783151 | <gh_stars>1-10
# Generated by Django 2.0.3 on 2018-04-05 06:43
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('course_api', '0016_subjectcourse_course_description'),
]
operations = [
migrations.RenameField(
model_name='course',
... | 1.648438 | 2 |
index_documents.py | nilleb/adb-expertise-locator | 0 | 12783152 | <filename>index_documents.py
import logging
import os
import sys
import re
from backends.es import IndexingException, create_indexer
from common.constants import SETS_FILEPATH
from common.io import read_object, write_object
from configuration import LIMIT
from regex_authors import is_author_page
import nltk
from nltk... | 2.453125 | 2 |
src/tests/sources/test_data_loader.py | zaxmks/demo-data-compliance-service | 0 | 12783153 | import pytest
import pandas as pd
from src.clients.s3_client import S3Client
from src.sources.data_loader import DataLoader
def test_init():
dl = DataLoader("test_source", "test_client")
assert dl.data_source == "test_source"
assert dl.client == "test_client"
# def test_load_when_database_client():
# ... | 2.453125 | 2 |
data/pred.py | cedar33/roberta-crf | 6 | 12783154 | from fairseq.models.roberta import RobertaModel
label_fn = lambda label: roberta.task.label_dictionary.string(
[label + roberta.task.label_dictionary.nspecial]
)
roberta = RobertaModel.from_pretrained(
model_name_or_path='/path/to/checkpoints',
checkpoint_file='checkpoint_best.pt',
data_name_or_path='/... | 2.28125 | 2 |
tests/Eva_auth_test.py | Charlesworth/eva_python_sdk | 14 | 12783155 | from evasdk import EvaAutoRenewError, EvaError
import time
import pytest
# TODO: this rely on having an actual robot, should be rewritten to be mockable
@pytest.mark.robot_required
class TestAuth:
def test_create_new_session(self, eva):
token = eva.auth_create_session()
assert(len(token) == 36)
... | 2.21875 | 2 |
tools/debugging/matrix/load_with_generate_messages.py | luehrsFred/raiden | 0 | 12783156 | #!/usr/bin/env python
from gevent import monkey # isort:skip
monkey.patch_all() # isort:skip
import argparse
import os
import time
from dataclasses import dataclass
from typing import Iterator, List
from raiden.utils.nursery import Janitor, Nursery
CWD = os.path.dirname(os.path.abspath(__file__))
GENERATE_MESSAGE... | 2.046875 | 2 |
src/discussion/models.py | ResearchHub/ResearchHub-Backend-Open | 18 | 12783157 | from django.db.models import (
Count,
Q,
F
)
from django.contrib.contenttypes.fields import (
GenericForeignKey,
GenericRelation
)
from django.contrib.contenttypes.models import ContentType
from django.contrib.postgres.fields import JSONField
from django.core.cache import cache
from django.db import... | 1.820313 | 2 |
vyvyan/validate/__init__.py | downneck/vyvyan | 0 | 12783158 | <reponame>downneck/vyvyan
# Copyright 2015 WebEffects Network, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 1.921875 | 2 |
beneficiaries/beneficiaries/doctype/beneficiary_request/beneficiary_request.py | baidalala/beneficiaries | 0 | 12783159 | # -*- coding: utf-8 -*-
# Copyright (c) 2021, Baida and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import json
from frappe.model.naming import set_name_by_naming_series
from frappe import _, msgprint, throw
import frappe.defaults
from frappe.util... | 1.367188 | 1 |
tests/test_utils.py | OSeMOSYS/otoole | 8 | 12783160 | <reponame>OSeMOSYS/otoole<filename>tests/test_utils.py
import pytest
from unittest.mock import MagicMock
from otoole.utils import extract_config, read_packaged_file
class TestDataPackageSchema:
@pytest.mark.xfail
def test_read_datapackage_schema_into_config(self):
schema = read_packaged_file("datap... | 2.234375 | 2 |
x_rebirth_station_calculator/station_data/modules/warhead_forge.py | Phipsz/XRebirthStationCalculator | 1 | 12783161 | <filename>x_rebirth_station_calculator/station_data/modules/warhead_forge.py
from x_rebirth_station_calculator.station_data.station_base import Module
from x_rebirth_station_calculator.station_data.station_base import Production
from x_rebirth_station_calculator.station_data.station_base import Consumption
from x_rebir... | 1.765625 | 2 |
bot.py | SpencerDotGray/TronTracker | 0 | 12783162 |
from discord.ext import commands
import discord
from datetime import datetime, time, timedelta
import asyncio
import requests
import json
import os
client = discord.Client()
jontron_url = 'https://www.youtube.com/user/JonTronShow/videos'
try:
with open('./auth_tokens.json', 'r') as filein:
token = json.l... | 2.765625 | 3 |
programming-laboratory-I/ltjc/porta.py | MisaelAugusto/computer-science | 0 | 12783163 | # coding: utf-8
# Aluno: <NAME>
# Matrícula: 117110525
# Problema: Porta Eletrônica
registrados = []
while True:
entrada = raw_input().split()
if entrada[0] == "S":
break
else:
categoria = entrada[1]
if entrada[0] == "R":
registrados.append(categoria[0])
else:
n = 0
for r in registrados:
if r ... | 3.578125 | 4 |
pymrt/visualizer/casas/_gmphd_3d.py | TinghuiWang/pymrt | 1 | 12783164 | import sys
import numpy as np
from mayavi import mlab
from mayavi.scripts import mayavi2
from traits.api import HasTraits, Button, Instance
from traitsui.api import View, Item
from ._plot3d import plot3d_embeddings
def plot3d_gmphd(dataset, embeddings, grid, gm_s=None, gm_list=None,
observation=None,... | 2.421875 | 2 |
yatube/apps/posts/admin.py | azharkih/PetBlog | 1 | 12783165 | <filename>yatube/apps/posts/admin.py<gh_stars>1-10
from django.contrib import admin
from .models import Comment, Follow, Group, Post
class PostAdmin(admin.ModelAdmin):
""" Класс PostAdmin используется для конфигурации отображения модели Post
в админ-панели.
Атрибуты класса
--------
list_display ... | 2.40625 | 2 |
misc.py | soerenjalas/Laser | 0 | 12783166 | import numpy as np
def gauss2D(x, y, fwhmx, fwhmy, x0=0, y0=0, offset=0, order=1, int_FWHM=True):
"""
Define a (super-)Gaussian 2D beam. Identical to laser.misc.gauss2D.
Parameters
----------
x: float 2D np.array
Horizontal axis of the Gaussian
y: float 2D np.array
Vertical a... | 3.265625 | 3 |
point_2_screen.py | kenkyusha/eyeGazeToScreen | 8 | 12783167 | #!/usr/bin/env python
from typing import Optional
import datetime
import logging
import pathlib
import cv2
import numpy as np
import yacs.config
from gaze_estimation.gaze_estimator.common import (Face, FacePartsName,
Visualizer)
from gaze_estimation.utils import lo... | 2.03125 | 2 |
Vpp3_FlowVisualization/Package/__init__.py | kaijunhuang1994/VirtualPowerPrinciple-v1.0 | 0 | 12783168 | import sys
path = sys.path[0] + "/Package/parser"
sys.path.append(path)
path = sys.path[0] + "/Package/vector"
sys.path.append(path)
path = sys.path[0] + "/Package/solvercontrol"
sys.path.append(path) | 1.742188 | 2 |
swagger_client/apis/attachment_api.py | rcbops/qtest-swagger-client | 1 | 12783169 | <reponame>rcbops/qtest-swagger-client<filename>swagger_client/apis/attachment_api.py
# coding: utf-8
"""
qTest Manager API Version 8.6 - 9.1
qTest Manager API Version 8.6 - 9.1
OpenAPI spec version: 8.6 - 9.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
fro... | 1.515625 | 2 |
day13-1.py | kenleung5e28/advent-of-code-2021 | 0 | 12783170 | <gh_stars>0
m, n = 0, 0
points = []
folds = []
with open('input-day13.txt') as file:
while True:
line = file.readline().rstrip()
if len(line) == 0:
break
x, y = [int(s) for s in line.split(',')]
m, n = max(m, x), max(n, y)
points.append((x, y))
while True:
line = file.readline()
if... | 2.78125 | 3 |
metrics.py | wemyss/five-video-classification-methods | 0 | 12783171 | import functools
from keras import backend as K
import tensorflow as tf
def as_keras_metric(method):
@functools.wraps(method)
def wrapper(self, args, **kwargs):
""" Wrapper for turning tensorflow metrics into keras metrics """
value, update_op = method(self, args, **kwargs)
K.get_sessio... | 2.78125 | 3 |
servers/solusapi.py | SteelBall/StrutSkinn | 0 | 12783172 | <filename>servers/solusapi.py
from xmltodict import parse
import urllib
import urllib2
class SolusAPI(object):
api_key = ''
api_hash = ''
api_url = ''
document = None
success = False
error = None
GIGABYTES = 1073741824.0
MEGABYTES = 1048576.0
def __init__(self, url, api_key, ap... | 3 | 3 |
lib/opengl/postproc/Bypass.py | defgsus/thegame | 1 | 12783173 | <filename>lib/opengl/postproc/Bypass.py
from .base import PostProcNode
class Bypass(PostProcNode):
def __init__(self, name, alpha=None):
super().__init__(name)
self.alpha = alpha
def get_code(self):
return """
void mainImage(out vec4 fragColor, in vec2 fragCoord, in vec2 texC... | 2.453125 | 2 |
py12306/config.py | welking1/py12306 | 1 | 12783174 | <gh_stars>1-10
from os import path
# 12306 账号
USER_ACCOUNTS = []
# 查询任务
QUERY_JOBS = []
# 查询间隔
QUERY_INTERVAL = 1
# 用户心跳检测间隔
USER_HEARTBEAT_INTERVAL = 120
# 多线程查询
QUERY_JOB_THREAD_ENABLED = 0
# 打码平台账号
AUTO_CODE_ACCOUNT = {
'user': '',
'pwd': ''
}
# 输出日志到文件
OUT_PUT_LOG_TO_FILE_ENABLED = 0
OUT_PUT_LOG_TO_FI... | 1.960938 | 2 |
problems/test_0374.py | chrisxue815/leetcode_python | 1 | 12783175 | <filename>problems/test_0374.py
import unittest
# The guess API is already defined for you.
# @param num, your guess
# @return -1 if my number is lower, 1 if my number is higher, otherwise return 0
_my_num = 0
def guess(num):
if _my_num < num:
return -1
elif _my_num > num:
return 1
return... | 3.78125 | 4 |
deep_learning_with_tensorFlow/Chapter08/p204.py | pearpai/TensorFlow-action | 3 | 12783176 | <filename>deep_learning_with_tensorFlow/Chapter08/p204.py
# coding=utf-8
import numpy as np
X = [1, 2]
state = [0.0, 0.0]
# 分开定义不同输入部分的权重以方便操作
w_cell_state = np.asarray([[0.1, 0.2], [0.3, 0.4]])
w_cell_input = np.asarray([0.5, 0.6])
b_cell = np.asarray([0.1, -0.1])
# 定义用于输出的全连接层参数
w_output = np.asarray([[1.0], [2.0]]... | 3.03125 | 3 |
bin/list_routines_misc.py | shardulc/ec | 0 | 12783177 | <reponame>shardulc/ec<gh_stars>0
import matplotlib
matplotlib.use('Agg')
try:
import binutil # required to import from dreamcoder modules
except ModuleNotFoundError:
import bin.binutil # alt import if called as module
import glob
import json
import random
import itertools
import math
import numpy as np
impo... | 2.375 | 2 |
lib/RequestHandler.py | audrummer15/motif-crawler | 0 | 12783178 | <filename>lib/RequestHandler.py
import pycurl
from StringIO import StringIO
class RequestHandler(object):
USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36"
def __init__(self, cookieJar=None):
if cookieJar != None:
... | 2.671875 | 3 |
5 - unit testing/vehicle_info_test.py | mickeybeurskens/betterpython | 523 | 12783179 | import unittest
from vehicle_info_after import VehicleInfo
class TestVehicleInfoMethods(unittest.TestCase):
pass
# def test_compute_tax_non_electric(self):
# v = VehicleInfo("BMW", False, 10000)
# self.assertEqual(v.compute_tax(), 500)
# def test_compute_tax_electric(self):
# v =... | 3.40625 | 3 |
ianlmk/pyStuff/data_structs_1.py | ianlmk/cs161 | 0 | 12783180 | #!/usr/bin/ python3
'''
author: < <NAME>
description: < just a study on structures in python
input: < none for now
output: < various shit related to data types, structures and algorithms
return: < if you have to
'''
import sys
import os
pri... | 4.09375 | 4 |
src/better_corruptions/fast_corruptions/benchmark.py | anonymousicml2021/paper2888 | 85 | 12783181 | <filename>src/better_corruptions/fast_corruptions/benchmark.py
from robustness import datasets, model_utils, loaders
from robustness.model_utils import make_and_restore_model as make_model
from robustness.tools.vis_tools import show_image_row
from matplotlib import pyplot as plt
from .ext_files import make_cifar_c, mak... | 2.109375 | 2 |
deep-learning/pretrained_test.py | georgepachitariu/machine-learning-portfolio | 2 | 12783182 | <filename>deep-learning/pretrained_test.py
from data import Imagenet2012
import gpu
import tensorflow as tf
from tensorflow.python.keras.engine import data_adapter
from tensorflow.keras.layers import Conv2D, BatchNormalization, AveragePooling2D, GlobalAveragePooling2D, \
Flatten, Dropout, Dense, ReLU, Lambda, Softm... | 2.78125 | 3 |
head_pos.py | AuroreBussalb/app-head-pos | 0 | 12783183 | <reponame>AuroreBussalb/app-head-pos<filename>head_pos.py<gh_stars>0
#!/usr/local/bin/python3
import mne
import json
import os
from brainlife_apps_helper import helper
def head_pos(raw, param_compute_amplitudes_t_step_min,
param_compute_amplitudes_t_window,
param_compute_amplitudes_ext_or... | 2.15625 | 2 |
agents/lib/ping_agent.py | hseritt/alfmonitor | 0 | 12783184 | """ Ping agent - checks up/down status of nodes."""
import socket
from alfmonitor.lib.alflogger import logger
from agents.lib.abs_agent import AbstractConnectionAgent
socket.setdefaulttimeout(10)
class PingAgent(AbstractConnectionAgent):
agent_name = 'Ping'
def __init__(self):
self.log = logger(
... | 2.765625 | 3 |
models/__init__.py | mdca-aux-loss/MDCA-Calibration | 8 | 12783185 | <filename>models/__init__.py<gh_stars>1-10
from .resnet import resnet20, resnet32, resnet56, resnet110
from .mendley_networks import resnet50_mendley
from .resnet_pacs import resnet18_pacs
from .resnet_mnist import resnet20_mnist
from .resnet_imagenet import resnet34, resnet50
model_dict = {
# resnet models can be... | 1.734375 | 2 |
adocker/models/resources.py | leesdolphin/adocker | 0 | 12783186 | import typing as typ
_sentinal = object()
def attribute_value(attr_key, *, default=_sentinal, type=typ.Any, convert=lambda x: x):
docs = """The value of {0!r} from the attributes.""".format(attr_key)
if default == _sentinal:
def getter(self) -> type:
return convert(self.attrs[attr_key])
... | 2.6875 | 3 |
inkpy_jinja/__init__.py | ar4s/InkPy | 2 | 12783187 | # -*- coding: utf-8 -*-
from .api import pdf
__all__ = ['pdf']
| 1.101563 | 1 |
config.py | x-surgical-x/movie-recommendations | 7 | 12783188 | import json
import os
configName = os.path.dirname(os.path.realpath(__file__)) + '/config.json'
config = None
try:
with open(configName) as data:
try:
config = json.load(data)
config["build_exists"] = os.path.join(os.path.dirname(configName), "app", "frontend", "build")
... | 2.625 | 3 |
3_DnD_Generator.py | OzymandiasThe2/DnD_Project | 0 | 12783189 | from dice_gen import dice_details
from monster_gen import monster_details
from name_gen import name_details
from player_gen import final_ran_stats
from weapon_gen import generate_random_weapon
from NPC_gen_vince import generate_random_race
def main():
def clear(arr):
for x in arr:
x.reset()
... | 2.921875 | 3 |
saas/backend/api/management/urls.py | nannan00/bk-iam-saas | 7 | 12783190 | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-权限中心(BlueKing-IAM) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with th... | 1.765625 | 2 |
src/qraz/frontend/migrations/0001_initial.py | fladi/qraz | 0 | 12783191 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-28 13:20
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields
import django_fsm
import markupfield.fields
import qraz.frontend.mo... | 1.554688 | 2 |
src/CADRE/KS.py | JustinSGray/OpenMDAO-CADRE | 1 | 12783192 | import numpy as np
from openmdao.main.api import Component
from openmdao.lib.datatypes.api import Float, Array
class KSfunction(object):
"""Helper class that can be used inside other components to aggregate constraint
vectors with a KS function."""
def compute(self, g, rho=50):
"""Gets the va... | 2.765625 | 3 |
frontur_gui/model/FileSolverMenu.py | miguelbravo7/frontur_gui | 0 | 12783193 | from kivy.uix.textinput import TextInput
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import ObjectProperty
from kivy.uix.popup import Popup
from kivy.clock import Clock
from pandas import Timedelta
from frontur_gui.model.ComputeDialog import ComputeDialog
from frontur_gui.model.FileManagerLoad import ... | 2.03125 | 2 |
atom.py | greats3an/quicktimeatoms | 1 | 12783194 | <filename>atom.py
'''
# atom Module
Unpacks a video's QuickTime ATOM (`moov`) info via its ATOM header / footer
reference:https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html (fig.2-3)
'''
import struct
import io
class _ATOM:
whences = {
'ATOM_SIZE': ('I',... | 2.734375 | 3 |
asab/zookeeper/builder.py | TeskaLabs/asab | 23 | 12783195 | from urllib.parse import urlparse
import aiozk
import logging
L = logging.getLogger(__name__)
"""
This module builds ZooKeeper clients from Configs and urls
urls supported :
1. Absolute url.
Example: zookeeper://zookeeper:12181/etc/configs/file1
2. Relative ur1 with full path
Example: zookeeper:///etc/configs/file1... | 2.875 | 3 |
src/eval_pp.py | jerichooconnell/lcse_tools | 0 | 12783196 | <reponame>jerichooconnell/lcse_tools<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
C Pre-Processor #define evaluator.
Usage:
.. code:: bash
eval_pp.py input_file.F -o output_file.F -D israyprofile=0 isrestart=0
'''
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__date__ = '25 Apr 2015'
__license__ = ... | 2.703125 | 3 |
tests/test_make_cogs.py | washreve/hyp3-lib | 4 | 12783197 | import os
import shutil
import requests
from hyp3lib.make_cogs import cogify_dir, cogify_file
def _is_cog(filename):
with open(filename, 'rb') as f:
response = requests.post('http://cog-validate.radiant.earth/api/validate', files={'file': f})
return response.status_code == 200
def test_make_cog(geo... | 2.671875 | 3 |
pi/probemon.py | pirsquareff/wireless-wads | 0 | 12783198 | #!/usr/bin/python
import time
import datetime
import argparse
import netaddr
import sys
import logging
from scapy.all import *
from pprint import pprint
from logging.handlers import RotatingFileHandler
NAME = 'probemon'
DESCRIPTION = "a command line tool for logging 802.11 probe request frames"
DEBUG = False
def bu... | 2.5625 | 3 |
stylegan/get_dataset.py | britt0508/ExplainedKinshipCorrect | 0 | 12783199 | import csv
import pandas as pd
# from stylegan.metrics import linear_separability
from collections import defaultdict
from glob import glob
from random import choice, sample
def get_data():
train_file_path = "/content/drive/MyDrive/ExplainedKinshipData/data/train-pairs.csv"
train_folders_path = "/content/driv... | 2.640625 | 3 |
seqauto/tests/test_models.py | SACGF/variantgrid | 5 | 12783200 | <reponame>SACGF/variantgrid<filename>seqauto/tests/test_models.py
import logging
import os
from django.conf import settings
from django.test import TestCase
from genes.canonical_transcripts.canonical_transcript_manager import CanonicalTranscriptManager
from genes.canonical_transcripts.create_canonical_transcripts imp... | 1.882813 | 2 |
01/day-01.py | dfinninger/aoc-2017 | 0 | 12783201 | #!/usr/bin/env python3
import argparse
def _parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('input', help='program input')
return parser.parse_args()
def _solve_first(ipt):
chars = list(str(ipt))
accum = 0
for item in enumerate(chars):
if item[1] == chars[item... | 3.8125 | 4 |
tests/test_matrices.py | readthedocs-assistant/tabmat | 0 | 12783202 | <reponame>readthedocs-assistant/tabmat<filename>tests/test_matrices.py
import warnings
from typing import List, Optional, Union
import numpy as np
import pandas as pd
import pytest
from scipy import sparse as sps
import tabmat as tm
def base_array(order="F") -> np.ndarray:
return np.array([[0, 0], [0, -1.0], [0... | 2.234375 | 2 |
src/azure-cli/azure/cli/command_modules/lab/_params.py | YuanyuanNi/azure-cli | 3,287 | 12783203 | <filename>src/azure-cli/azure/cli/command_modules/lab/_params.py
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---... | 2.03125 | 2 |
softcolor/soft_color_operators.py | PBibiloni/softcolor | 0 | 12783204 | <gh_stars>0
import math
import numpy as np
def soft_color_erosion(multivariate_image, structuring_element, fuzzy_implication_function):
return _base_soft_color_operator(multivariate_image=multivariate_image,
structuring_element=structuring_element,
... | 2.28125 | 2 |
pong/pong_game.py | burnpiro/pong-deep-q-learning | 1 | 12783205 | <reponame>burnpiro/pong-deep-q-learning
from __future__ import annotations
from typing import Union, Tuple, List, Type
import random
from itertools import count
import gym
from gym.spaces import Discrete, Box
import numpy as np
import atari_py
from pong.gym_agents import *
from gym.envs.atari.atari_env import AtariEnv
... | 2.84375 | 3 |
bidwire/scrapers/knox_tn_agendas_scraper.py | RagtagOpen/bidwire | 5 | 12783206 | import logging
import scrapelib
from lxml import html
from urllib import parse
from sqlalchemy.exc import IntegrityError
from document import Document
from scrapers.base_scraper import BaseScraper
from utils import ensure_absolute_url
log = logging.getLogger(__name__)
class KnoxCoTNAgendaScraper(BaseScraper):
... | 2.875 | 3 |
lesson2.2_step8.py | Vesta080283/stepik-auto-tests-course | 0 | 12783207 | from selenium import webdriver
from selenium.webdriver.common.by import By
import time
import os
try:
link = "http://suninjuly.github.io/file_input.html"
browser = webdriver.Chrome()
browser.get(link)
# Ваш код, который заполняет обязательные поля
input1 = browser.find_element(
By.XPATH, "... | 2.890625 | 3 |
python/problem31.py | chjdev/euler | 0 | 12783208 | <reponame>chjdev/euler
# Coin sums
#
# Problem 31
#
# In England the currency is made up of pound, £, and pence, p, and there are eight coins in general circulation:
#
# 1p, 2p, 5p, 10p, 20p, 50p, £1 (100p) and £2 (200p).
# It is possible to make £2 in the following way:
#
# 1×£1 + 1×50p + 2×20p + 1×5p + 1×2p + 3×1p
# ... | 3.390625 | 3 |
tools/gui-editor/wrapper/item.py | jordsti/stigame | 8 | 12783209 | <filename>tools/gui-editor/wrapper/item.py
__author__ = 'JordSti'
import surface
import object_wrap
import style
class item(object_wrap.object_wrap):
def __init__(self, obj=None):
object_wrap.object_wrap.__init__(self, obj)
def set_dimension(self, width, height):
self.lib.Item_setDimension(se... | 2.328125 | 2 |
app/admin/views.py | lemocla/business-analysis-project | 10 | 12783210 | <gh_stars>1-10
from flask_admin import AdminIndexView, expose
from werkzeug.security import generate_password_hash
from app.admin.decorators import admin_access
from app.admin.forms import UserForm, OrganisationForm
from app.admin.flask_admin.views import CustomModelView
# Customized admin views
class DashboardView(... | 2.25 | 2 |
RCWDiscordBot.py | aditya369007/RCWprogressUpdate | 2 | 12783211 |
import discord
import os
import json
import time
import shutil
# creating a dict to keep track of member details
MemberDict ={
# name:
# unique id
# number of reports
};
timeStr = time.strftime("%H%M%S")
MemberDict['people'] = [];
token = open("token.txt","r").read();
#start the bot clien... | 2.90625 | 3 |
modules/src/dictionary.py | rampreeth/JARVIS-on-Messenger | 1,465 | 12783212 | <reponame>rampreeth/JARVIS-on-Messenger
import os
import requests
import requests_cache
import config
from templates.text import TextTemplate
WORDS_API_KEY = os.environ.get('WORDS_API_KEY', config.WORDS_API_KEY)
def process(input, entities):
output = {}
try:
word = entities['word'][0]['value']
... | 2.4375 | 2 |
CURSO PYTHON UDEMY/Curso Udemy/Mundo 4 (POO)/103. Atributos de Classe.py | nihilboy1455/CURSO-PYTHON-UDEMY | 0 | 12783213 | <reponame>nihilboy1455/CURSO-PYTHON-UDEMY
class A:
v = 123
a1 = A()
print(a1.v)
print(A.v)
'''
Eu posso mostrar uma variavel de classe tanto através de uma instância,
quanto da própria classe
'''
A.v = 5
print(A.v)
print(a1.v)
'''
Se eu alterar o valor da variavel de classe através da classe, nas próximas
vezes q... | 4.28125 | 4 |
openvisualizer/simengine/timeline.py | ftheoleyre/openvisualizer | 0 | 12783214 | <filename>openvisualizer/simengine/timeline.py
#!/usr/bin/python
# Copyright (c) 2010-2013, Regents of the University of California.
# All rights reserved.
#
# Released under the BSD 3-Clause license as published at the link below.
# https://openwsn.atlassian.net/wiki/display/OW/License
import logging
import threading... | 2.5 | 2 |
backend/Contraband/query/models.py | ShcherbaDev/WikiContrib | 0 | 12783215 | <reponame>ShcherbaDev/WikiContrib
from django.db import models
from contraband.settings import BASE_URL
from django.utils import timezone
from contraband.settings import DEBUG
class Query(models.Model):
"""
:Summary: Store details of Query.
"""
hash_code = models.CharField(unique=True, max_length=64)
... | 2.1875 | 2 |
clients/models.py | JaviManobanda/client_manager_CLI | 0 | 12783216 | import uuid
class ClientModel:
"""Client models
Args:
name ([type]): [description]
company ([type]): [description]
mail ([type]): [description]
position ([type]): [description]
uid ([type], optional): [description]. Defaults to None.
... | 3.0625 | 3 |
Maths/All Divisors of a number/Python/main.py | CoderMonProjects/DSA-GFG | 1 | 12783217 | #1
# num = x*y such that x < y
# there fore * x <=n
def printDivisors(n):
i = 1
res = []
while(i*i <=n):
if (n % i == 0):
if i:
res.append(i)
if int(n/i) != i:
if int(n/i):
res.append(int(n/i))
i += 1
return sorted(res)
print(printDivisors(21321522312))
| 3.671875 | 4 |
manipulator_learning/learning/data/img_depth_dataset.py | utiasSTARS/manipulator_learning | 2 | 12783218 | <reponame>utiasSTARS/manipulator_learning<gh_stars>1-10
import numpy as np
import os
from PIL import Image
from multiprocessing import Pool
from itertools import repeat
import shutil
class Dataset:
def __init__(self, data_dir, np_filename='data.npz', img_type='.png', imgs_per_folder=1000,
state_di... | 2.625 | 3 |
domain_to_prefix.py | ljm625/cisco_sdwan_policy_python | 11 | 12783219 | import argparse
from pprint import pprint
try:
import yaml
import sublist3r
import dns.resolver
except Exception as e:
print("Error loading libraries, please run following commands first:")
print("pip install pyyaml dnspython")
print("git clone https://github.com/aboul3la/Sublist3r")
print(... | 2.609375 | 3 |
archive/get_team_names.py | jletienne/yff | 0 | 12783220 | <reponame>jletienne/yff
def get_team_names(league_id='390.l.XXXXXX'):
teams = {}
num_teams = get_num_teams(league_id)
for i in range(1, num_teams+1):
url = 'https://fantasysports.yahooapis.com/fantasy/v2/team/{0}.t.{1}'.format('390.l.227235',str(i))
response = oauth.session.get(url, params={... | 3 | 3 |
src/tf_polygon/minimal_distance.py | dwferrer/tf-poly | 0 | 12783221 | import tensorflow as tf
from tf_polygon.primitives import get_edges, point_in_polygon, point_line_segment_distance
def minimal_distance(poly_a, poly_b):
x_a = tf.convert_to_tensor(poly_a)
x_b = tf.convert_to_tensor(poly_b)
e_a = get_edges(poly_a)
e_b = get_edges(poly_b)
a_in_b = point_in_polygo... | 2.828125 | 3 |
rtm.py | Ultronixon/rtmpy | 11 | 12783222 | # -*- coding: utf-8 -*-
"""
@author: <NAME>
"""
from __future__ import division
import finite_difference as fd
import numpy as np
def rtm1d(v,seis,dt,dz):
nt = len(seis)
nx = len(v)
a = fd.alpha(v,dt,dz)
ul, u, up = np.zeros((3,nx))
data = np.zeros((nt,nx))
g = np.zeros(u.shape)
g[0] = 1... | 2.25 | 2 |
vehiculo/migrations/0001_initial.py | gusanare1/site1 | 0 | 12783223 | <gh_stars>0
# Generated by Django 2.0.5 on 2018-05-18 17:33
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Carro',
fields... | 1.859375 | 2 |
code archieve/temperature_preprocessing_extract_phase_amplitude.py | yuanyuansjtu/Angstrom-method | 2 | 12783224 | from scipy.io import loadmat
import tables
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import os, os.path
import time
import scipy.signal
from scipy import signal
from lmfit import minimize, Parameters
import scipy.optimize as optimization
import operator
class temperature_preprocessing_extr... | 2.53125 | 3 |
python/ReportParse.py | jay4842/sim-engine | 0 | 12783225 | import argparse
import sys
import os
import glob
import simParse
import entityParse
parser = argparse.ArgumentParser(description='Process a report')
#parser.add_argument('--input_file', dest='input_file', default='/logs/EntityLog/', help='input file path')
#parser.add_argument('--report_type', dest='report_type', def... | 3.296875 | 3 |
Model/CNN-handsign/train.py | LihaoWang1991/hand-sign-classification-on-Azure | 0 | 12783226 | <filename>Model/CNN-handsign/train.py<gh_stars>0
import math
import numpy as np
import h5py
import scipy
from scipy import ndimage
import matplotlib
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.python.framework import ops
from cnn_utils import *
import argparse
import os
from azureml.core im... | 2.859375 | 3 |
search_engines_cli.py | csecht/Search-Engines-Scraper | 2 | 12783227 | #!/usr/bin/env python3
import argparse
try:
from search_engines.engines import search_engines_dict
from search_engines.multiple_search_engines import MultipleSearchEngines, AllSearchEngines
from search_engines import config
except ImportError as err:
MSG = '\nPlease install `search_engines` to resolve ... | 2.453125 | 2 |
pyutils/torch_train.py | JeremieMelo/pyutility | 4 | 12783228 | <filename>pyutils/torch_train.py
"""
Description:
Author: <NAME> (<EMAIL>)
Date: 2021-06-06 03:15:06
LastEditors: <NAME> (<EMAIL>)
LastEditTime: 2021-06-06 03:15:06
"""
import csv
import os
import random
import time
import traceback
from collections import OrderedDict
import numpy as np
import torch
from scipy import... | 2.125 | 2 |
sourcecode/21/21.8.1/threading_2.py | ydong08/PythonCode | 0 | 12783229 | #!/usr/bin/python
#encoding=utf-8
import threading
import time
class Counter: #计数器类
def __init__(self):
self.value = 0
def increment(self):
self.value = self.value + 1 #将value值加1
value = self.value #并返回这个value值
return value
counter = Counter()
class ThreadDemo(threading.Threa... | 3.9375 | 4 |
spiders/croatia.py | kristoff-it/customs-news-crawler | 1 | 12783230 | <reponame>kristoff-it/customs-news-crawler<gh_stars>1-10
# -*- coding: utf-8 -*-
import scrapy
class Item(scrapy.Item):
country = scrapy.Field()
title = scrapy.Field()
date = scrapy.Field()
body = scrapy.Field()
link = scrapy.Field()
class CroatiaSpider(scrapy.Spider):
name = "croatia"
al... | 2.671875 | 3 |
src/data/1017.py | NULLCT/LOMC | 0 | 12783231 | n, q = map(int, input().split())
g = [[] for i in range(n)]
for i in range(n - 1):
ai, bi = map(int, input().split())
ai -= 1
bi -= 1
g[ai].append(bi)
g[bi].append(ai)
# N: 頂点数
# G[v]: 頂点vの子頂点 (親頂点は含まない)
#
# - construct
# prv[u] = v: 頂点uの一つ上の祖先頂点v
# - lca
# kprv[k][u] = v: 頂点uの2^k個上の祖先頂点v
# depth[... | 2.203125 | 2 |
stanCode_Projects/weather_master/weather_master.py | wilson51678/sc-projects | 0 | 12783232 | <reponame>wilson51678/sc-projects<filename>stanCode_Projects/weather_master/weather_master.py
"""
File: weather_master.py
Name: <NAME>
-----------------------
This program should implement a console program
that asks weather data from user to compute the
average, highest, lowest, cold days among the inputs.
Output form... | 4 | 4 |
tests/optionparser_tests.py | Anavros/malt | 0 | 12783233 |
import pytest
from malt.parser.optionparser import parse, parse_all
from malt.exceptions import EmptyOptionString
def test_signature():
"""
Parsing takes an option string and creates a Signature. Basic operation test.
"""
option = "pow i:number i:power=2"
result = parse(option)
assert result.... | 2.859375 | 3 |
BusinessIndexData.py | pesikj/InformationParserOfNonprofitOrganization | 0 | 12783234 | import requests
import urllib.request, json, re
def load_organizational_data(identification_number):
address = 'https://or.justice.cz/ias/ui/rejstrik-$firma?ico={0}'.format(identification_number)
with urllib.request.urlopen(address) as url:
page = url.read().decode('utf-8')
detail_page_pattern ... | 2.78125 | 3 |
hexrd/utils/decorators.py | johnkit/hexrd | 0 | 12783235 | <reponame>johnkit/hexrd<filename>hexrd/utils/decorators.py
# encoding: utf-8
"""Decorators that don't go anywhere else.
This module contains decorators that don't really go with another module
in :mod:`hexrd.utils`. Before putting something here please see if it should
go into another topical module in :mod:`hexrd.uti... | 2.578125 | 3 |
main/views.py | zzaegun/RMS | 0 | 12783236 | <filename>main/views.py<gh_stars>0
from django.shortcuts import render
from .models import *
from django.http import HttpResponseRedirect, HttpResponse
from django.urls import reverse
from django.utils import timezone
from datetime import datetime
def get_latest_order_no():
#comparing phase
if T_ORDER_INFO.o... | 2.140625 | 2 |
AutomationKit_InfrastructureServices@SVU/SampleTomcatBuild.py | dipAch/Infrastructure-Automation-Kit | 0 | 12783237 | <reponame>dipAch/Infrastructure-Automation-Kit
#!/usr/bin/env python3
# Use-Case: Sample `TOMCAT` & `JDK / JRE` Downloader and Installation script.
# Author: <NAME>, <@tweeting_dipa>
"""
This is a sample `TOMCAT` Installation Use-Case script.
Do not use this file. Just take this as a reference on how to
us... | 1.828125 | 2 |
neurovault/apps/statmaps/migrations/0024_auto_20150219_2047.py | aphroditepv/NeuroVault | 68 | 12783238 | <filename>neurovault/apps/statmaps/migrations/0024_auto_20150219_2047.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('statmaps', '0023_auto_20150218_1943'),
]
operations = [
... | 1.710938 | 2 |
datasets/data_generator.py | RedaAlb/IntelligentTransportationInfrastructure_ITI | 1 | 12783239 | <reponame>RedaAlb/IntelligentTransportationInfrastructure_ITI<gh_stars>1-10
import os
import random
import shutil
from collections import Counter
import Automold as am
import cv2
import matplotlib.pyplot as plt
class DataGenerator:
""" Used to generate new samples using various methods.
"""
def __init__... | 2.625 | 3 |
mowl/corpus/base.py | bio-ontology-research-group/OntoML | 0 | 12783240 | <reponame>bio-ontology-research-group/OntoML<gh_stars>0
from org.semanticweb.owlapi.manchestersyntax.renderer import ManchesterOWLSyntaxOWLObjectRendererImpl
from org.semanticweb.owlapi.model import OWLLiteral
from org.semanticweb.owlapi.search import EntitySearcher
from jpype.types import *
from org.mowl import MOW... | 2.171875 | 2 |
AMBER/amber/utils/sampler.py | rtu715/NAS-Bench-360 | 10 | 12783241 | <reponame>rtu715/NAS-Bench-360
# Author: <NAME>
# Created on June 5, 2020
"""
This module provides the `BioIntervalSource` class and its children.
These are essentially wrappers for sets of sequence intervals and
associated labels.
"""
#import keras
import tensorflow as tf
import numpy
from .sequences import EncodedHDF... | 3 | 3 |
tests/test_io.py | A-Breeze/premierconverter | 0 | 12783242 | <reponame>A-Breeze/premierconverter<filename>tests/test_io.py
"""Unit tests on input/output file functions"""
# pylint: disable=assignment-from-none
#########
# Setup #
#########
# Import external modules
import pytest
# Import project modules
import premierconverter as PCon
##########################
# in_filepath ... | 2.46875 | 2 |
packages/syft/src/syft/proto/core/auth/signed_message_pb2.py | vishalbelsare/PySyft | 8,428 | 12783243 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: proto/core/auth/signed_message.proto
"""Generated protocol buffer code."""
# third party
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf... | 1.109375 | 1 |
tests/aqmesh/test_scraper_aq.py | openghg/gather | 0 | 12783244 | from pathlib import Path
def test_scrape(aqmesh_scraper_setup, tmpdir):
data = Path(aqmesh_scraper_setup["co2"]["data"])
metadata = Path(aqmesh_scraper_setup["co2"]["metadata"])
assert data.exists()
assert metadata.exists()
assert data.name == "20210515_20211024_CO2_AQMesh_Scaled_Dataset_PPM.csv... | 2.328125 | 2 |
pyDrivers/rgb.py | steelee/minnow_max_maker | 4 | 12783245 | <gh_stars>1-10
import mraa
import time
from led import led
class rgb(object):
def __init__(self, red_pin, green_pin, blue_pin, red_low=False, green_low=False, blue_low=False):
self._r = led(red_pin, red_low)
self._g = led(green_pin, green_low)
self._b = led(blue_pin, blue_low)
def off(... | 3.03125 | 3 |
test/test_char_lstm.py | epwalsh/pytorch-crf | 69 | 12783246 | """Tests for CharLSTM class."""
def test_forward(char_lstm, vocab_dataset):
"""Test `CharLSTM.forward()` method."""
dataset = vocab_dataset[1]
for src, tgt in dataset:
res = char_lstm(*src[:-2])
n_words, dim = res.size()
assert n_words == tgt.size()[0]
assert dim == char_ls... | 3.109375 | 3 |
Models/regressionTemplateTF/model.py | UTS-AnimalLogicAcademy/nuke-ML-server | 123 | 12783247 | # Copyright (c) 2020 Foundry.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 1.828125 | 2 |
utils/input_output/io.py | Tudor67/Object-Counting | 7 | 12783248 | import json
import numpy as np
import os
import skimage
def save_np_arrays(images, img_names, save_path):
for img, img_name in zip(images, img_names):
np.save(f'{save_path}/{img_name}', img)
def load_np_arrays(path, num=None):
images = []
img_names = sorted(os.listdir(path))
if nu... | 2.640625 | 3 |
ckanext/tnext/dbsuggest.py | WilJoey/ckanext-tnext | 0 | 12783249 | <gh_stars>0
# -*- coding: utf-8 -*-
import constants
import sqlalchemy as sa
import uuid
import logging
from sqlalchemy import func, ForeignKey
from sqlalchemy.orm import relationship, backref
Suggest = None
Comment = None
log = logging.getLogger(__name__)
def uuid4():
return str(uuid.uuid4())
def init_db(mod... | 2.328125 | 2 |
stage3b.py | TG-Techie/TG-Gui-LiveStream-Code-2021Jan31 | 1 | 12783250 | # The MIT License (MIT)
#
# Copyright (c) 2021 <NAME> (TG-Techie)
#
# See the file in the root directory of this project for the full licsense text
from tg_gui_std.all import *
import tg_gui_pyportal as setup
@setup.appwrapper
class Application(Layout):
some_data = State(0.5)
# now let's make the label sho... | 2.65625 | 3 |