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 |
|---|---|---|---|---|---|---|
scenario/trajectory_tracking/experiment/trajectory_tracking_trainer.py | NREL/K_Road | 1 | 12790551 | import os
import sys
import tempfile
from datetime import datetime
from pprint import pprint
import ray
from ray import tune
from ray.rllib.agents import Trainer
from ray.tune.logger import UnifiedLogger
from ray.tune.result import DEFAULT_RESULTS_DIR
# os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
from command_line_tools... | 1.828125 | 2 |
emodelrunner/protocols_func.py | AurelienJaquier/EModelRunner | 0 | 12790552 | """Protocol-related functions."""
# Copyright 2020-2021 Blue Brain Project / EPFL
# 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 r... | 1.929688 | 2 |
Lib/xmlrpc/__init__.py | sireliah/polish-python | 1 | 12790553 | # This directory jest a Python package.
| 0.820313 | 1 |
app.py | jonnelafin/B_ | 0 | 12790554 | import os
from flask import Flask, redirect
from flask import request
from flask import jsonify
import hashlib
app = Flask(__name__)
c = 0
clients = []
chat = []
#[from, to, status[0sent, 1accepted, 2rejected]]
requests = {}
requests_sent = {}
version = 5
additive = 0
def getUID(ip):
return hashlib.sha256(str(... | 2.828125 | 3 |
test/test_npu/test_network_ops/test_not_equal.py | Ascend/pytorch | 1 | 12790555 | # Copyright (c) 2020, Huawei Technologies.All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law... | 2.171875 | 2 |
utils/queries.py | sand-ci/AlarmsAndAlerts | 1 | 12790556 | from elasticsearch.helpers import scan
import utils.helpers as hp
valueField = {
'ps_packetloss': 'packet_loss',
'ps_owd': 'delay_mean',
'ps_retransmits': 'retransmits',
'ps_throughput': 'throughput'
}
def query4Avg(idx, dateFrom, dateTo):
val_fld = val... | 2.421875 | 2 |
tests/framework/test_sun.py | altair12/night_exoplanet_scheduler | 0 | 12790557 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import pytest
from mock import patch
from night_scheduler.framework.sun.sun import Sun
class TestSun(object):
FAKE_LATITUDE = "00"
FAKE_LONGITUDE = "11"
F... | 2.171875 | 2 |
xv_leak_tools/scriptlets/command_line_for_pid.py | UAEKondaya1/expressvpn_leak_testing | 219 | 12790558 | #!/usr/bin/env python3
import argparse
import sys
import psutil
from wrap_scriptlet import wrap_scriptlet
def run():
parser = argparse.ArgumentParser()
parser.add_argument('pid')
args = parser.parse_args(sys.argv[1:])
process = psutil.Process(int(args.pid))
return process.cmdline()
sys.exit(wra... | 2.359375 | 2 |
Bank.pyw | mukeshgurpude/Bank-Operations | 0 | 12790559 | <filename>Bank.pyw<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Tue May 19 15:51:38 2020
"""
from tkinter import Button, Label, Entry, messagebox, Tk, END, ttk, LabelFrame
import sqlite3
import datetime
import time
def process(process):
bar=Tk()
bar.title(f'Processing {process}')
bar.geometry('200x... | 3.125 | 3 |
server/main_build_DB.py | ZzhKlaus/2018-SURF-Trajectory-Estimation | 14 | 12790560 | '''
By Zhenghang(<NAME>
############################################################################################
It's a light server based on FLASK micro framework,
1.Requirements: Python 3, Flask and relevant packages
2. How does this work?
(1) Firstly, modify the host IP address of your own environment.
(2)... | 2.90625 | 3 |
packages/std/nodes/std___ExtractProperty0/widgets/std___ExtractProperty0___main_widget___METACODE.py | lidong1266/Ryven-Switch | 18 | 12790561 | from NIWENV import *
from PySide2.QtWidgets import QPlainTextEdit
from PySide2.QtCore import Qt
# from PySide2.QtGui import ...
class %CLASS%(QPlainTextEdit, MWB):
def __init__(self, params):
MWB.__init__(self, params)
QPlainTextEdit.__init__(self)
self.setStyleSheet(self.par... | 2.390625 | 2 |
main.py | marbiru/Model-Major-Generator | 0 | 12790562 | <gh_stars>0
print "\n Welcome to the Model Major Generator. This program gives you an image to help you memorise any number \n"
def create_mnemonic():
import pegs
mnemonic = ""
the_input = raw_input("Enter the number you'd like to memorise \n")
while len(the_input) > 1:
next_number = int(the_input[0:2])
... | 3.875 | 4 |
tests/composite_query_test.py | briandorsey/mimic | 1 | 12790563 | <filename>tests/composite_query_test.py
# Copyright 2012 Google Inc. All Rights Reserved.
#
# 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
#
... | 2.265625 | 2 |
addons/Sprytile-6b68d00/rx/linq/observable/dowhile.py | trisadmeslek/V-Sekai-Blender-tools | 733 | 12790564 | from rx.core import Observable
from rx.internal import extensionmethod
@extensionmethod(Observable)
def do_while(self, condition):
"""Repeats source as long as condition holds emulating a do while loop.
Keyword arguments:
condition -- {Function} The condition which determines if the source
will b... | 3.21875 | 3 |
sw/groundstation/wasp/__init__.py | nzjrs/wasp | 2 | 12790565 | <gh_stars>1-10
"""
libwasp is a library for interacting with UAVs running the wasp software system.
This library can be used to create groundstation and other monitoring software
for interacting with the UAV. The library is coupled with the onboard sofware
througn
* *messages.xml* - the defintion of messages sent ove... | 2.5 | 2 |
search_cycles.py | hazdzz/MGC_v2 | 2 | 12790566 | import os
import networkx as nx
import scipy.sparse as sp
def search_cycle(dir_adj):
dir_adj = nx.from_scipy_sparse_matrix(A=dir_adj, create_using=nx.DiGraph)
cycles = list(nx.algorithms.cycles.simple_cycles(dir_adj))
num_cycle = len(cycles)
q = []
for i in range(num_cycle):
q.append(len(cy... | 2.71875 | 3 |
demo/code/2021-11-10/f.py | uxlsl/uxlsl.github.io | 0 | 12790567 | #!/usr/bin/env python
# -*-coding:utf-8-*-
# File Name : f.py
# Description :
# Author :
# Creation Date : 2021-11-10
# Last Modified : 2021年11月10日 星期三 06时56分48秒
# Created By : lsl
def f(words):
def isPalindrome(s):
return s == s[::-1]
data = {word[::-1]:i for i,word in enumerate(wor... | 3.4375 | 3 |
sdk/python/pulumi_google_native/compute/alpha/get_network_edge_security_service.py | AaronFriel/pulumi-google-native | 44 | 12790568 | <reponame>AaronFriel/pulumi-google-native
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Unio... | 1.609375 | 2 |
basic_programs/7_circleArea.py | SU-Ki-MA/python-programs-gfg | 0 | 12790569 | <filename>basic_programs/7_circleArea.py
import math
def circleArea(r):
return math.pi*r*r
print(circleArea(55))
print(math.pi)
| 3.171875 | 3 |
tests/missing_data/test_missing_data_air_passengers_None_None.py | shaido987/pyaf | 377 | 12790570 | <filename>tests/missing_data/test_missing_data_air_passengers_None_None.py
import tests.missing_data.test_missing_data_air_passengers_generic as gen
gen.test_air_passengers_missing_data(None, None)
| 1.117188 | 1 |
test/test_status.py | System1Bio/asitiger | 2 | 12790571 | from asitiger.status import (
AxisEnabledStatus,
AxisStatus,
JoystickStatus,
LimitStatus,
MotorStatus,
RampingDirection,
RampingStatus,
Status,
status_from_decimal,
statuses_for_rdstat,
)
RDSTAT_RESPONSE = ":A 10N 138"
def test_status_from_decimal_types():
axis = status_f... | 2.34375 | 2 |
api/serializers.py | bartoszper/Django-REST-API-movierater | 0 | 12790572 | from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Film, ExtraInfo, Recenzja, Aktor
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ['id', 'username', 'email','password']
extra_kwargs = {'pa... | 2.0625 | 2 |
tests/image/svg_file_test.py | pywikibot-catfiles/file-metadata | 10 | 12790573 | <gh_stars>1-10
# -*- coding: utf-8 -*-
from __future__ import (division, absolute_import, unicode_literals,
print_function)
import os
from file_metadata.image.svg_file import SVGFile
from tests import fetch_file, unittest
class SVGFileTest(unittest.TestCase):
def test_svg_fetch_filenam... | 2.40625 | 2 |
xenso/indices.py | DangoMelon/xENSO | 1 | 12790574 | """
Module containing the definitions and methods to compute
a variety of indices used to study ENSO
"""
from typing import List, Optional, Tuple
import numpy as np
import xarray as xr
from eofs.xarray import Eof
from .core import compute_anomaly, compute_climatology, xconvolve
class ECindex:
"""
Computes ... | 2.71875 | 3 |
datauploader/apps.py | OpenHumans/oh-rescuetime-source | 11 | 12790575 | <filename>datauploader/apps.py<gh_stars>10-100
from django.apps import AppConfig
class DatauploaderConfig(AppConfig):
name = 'datauploader'
| 1.242188 | 1 |
pyvlova/op/__init__.py | ModelTC/pyvlova | 1 | 12790576 | <reponame>ModelTC/pyvlova
# Copyright 2020 <NAME>
# SPDX-License-Identifier: Apache-2.0
from .base import calc_mode, OpParameter, BaseOp, CombinedOp, SequenceOp, PolyOp, PolyTVMOp, ArgumentedOp
from .binary import BinaryChannelwise, BinaryElementwise, ElementwiseAdd, ChannelwiseAdd
from .conv import PlainConv2d, Conv2d... | 1.398438 | 1 |
bash_script_executer.py | Mohan-Zhang-u/TextSummarization | 0 | 12790577 | <reponame>Mohan-Zhang-u/TextSummarization<filename>bash_script_executer.py
import subprocess
import sys
def main(args):
runstring = "./run.sh " + args[0]
print(runstring)
subprocess.call(runstring, shell=True)
if __name__ == "__main__":
main(sys.argv[1:]) | 2.515625 | 3 |
src/umls_api_tool/auth.py | dcronkite/umls_api_tool | 0 | 12790578 | <gh_stars>0
import json
import urllib.parse
import requests
from lxml.html import fromstring
from loguru import logger
class Authenticator:
def __init__(self, apikey):
self.time_granting_ticket = self.get_time_granting_ticket(apikey)
self.base_url = 'https://uts-ws.nlm.nih.gov/rest'
@static... | 2.515625 | 3 |
goodbye_cruel_world.py | sgriffith3/2021_05_10_pyna | 0 | 12790579 | print("Goodbye Cruel World!!!!")
print("see ya later, aligator")
| 1.789063 | 2 |
auv_nav/parsers/parse_NOC_nmea.py | ocean-perception/oplab_pipeline | 5 | 12790580 | # -*- coding: utf-8 -*-
"""
Copyright (c) 2020, University of Southampton
All rights reserved.
Licensed under the BSD 3-Clause License.
See LICENSE.md file in the project root for full license information.
"""
import pynmea2
from auv_nav.sensors import Category, Usbl
from auv_nav.tools.time_conversions import date_ti... | 2.484375 | 2 |
src/lingcomp/data_utils/__init__.py | CharlottePouw/interpreting-complexity | 2 | 12790581 | <reponame>CharlottePouw/interpreting-complexity
from .et_processor import DundeeProcessor, GECOProcessor, ZuCoProcessor
| 0.914063 | 1 |
projects/hupun/test.py | kingking888/crawler-pyspider | 1 | 12790582 | import unittest
from hupun.page.hupun_goods.goods_information import GoodsInformation
from hupun.page.hupun_goods.goods_information_sku import GoodsInformationsku
from hupun.page.in_sale_store_table.export_file_download_req import ExportFileDownloadReq
from hupun.page.in_sale_store_table.export_task_query import Expor... | 2.3125 | 2 |
borre/__init__.py | younessidbakkasse/bore | 1 | 12790583 | """
Borre is a dead simple Farkle dice game implementation and game maker,
game rules are simple, you usually have five dices with six
sides, you roll the set of dices, and check if you score bonus
or regular standard points.
Made by a <NAME>, <NAME> for a School project
at Hetic.
"""
__version__ = "0.1.5"
from .ma... | 2.984375 | 3 |
resources/Wireshark/WiresharkDissectorFoo/tools/validate-clang-check.py | joshis1/C_Programming | 2 | 12790584 | <filename>resources/Wireshark/WiresharkDissectorFoo/tools/validate-clang-check.py
#!/bin/sh
# Copyright 2018, <NAME> (See AUTHORS file)
#
# Verifies last commit with clang-check (like scan-build) for Petri Dish
#
# Wireshark - Network traffic analyzer
# By <NAME> <<EMAIL>>
# Copyright 1998 <NAME>
#
# SPDX-License-Ident... | 1.523438 | 2 |
fit2gether_core/models/abstract.py | kapucko/fit2gether | 0 | 12790585 | <filename>fit2gether_core/models/abstract.py
import uuid
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ValidationError
class Fit2getherModel(models.Model):
class Meta:
abstract = True
uuid = models.UUIDField(default=uuid.uuid... | 2.3125 | 2 |
Company_Based_Questions/TCS/Codevita/mock1.py | Satyam-Bhalla/Competitive-Coding | 1 | 12790586 | n = int(input())
l = list(map(int,input().split(', ')))
for i in range(len(l)):
num = l[i]
a = 0
while num>0:
a += num%6
num = num//6
l[i] = a
count = 0
for i in range(n):
for j in range(i,n):
if l[i]>l[j]:
count += 1
print(count) | 3.09375 | 3 |
log_api/migrations/0009_auto_20200728_2127.py | mpupo/oh-my-log | 0 | 12790587 | # Generated by Django 3.0.8 on 2020-07-29 00:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('log_api', '0008_auto_20200728_2126'),
]
operations = [
migrations.AlterField(
model_name='execution',
name='archived... | 1.414063 | 1 |
pearl/plugins/eightball.py | dynosaur72/pearl | 11 | 12790588 | import asyncio, random
import nacre
class EightBallSession:
answers = [
"It is certain",
"It is decidedly so",
"Without a doubt",
"Yes definitely",
"You may rely on it",
"As I see it, yes",
"Most likely",
"Outlook good",
"Yes",
"Signs point to yes",
"Reply hazy try again",
"Ask again later",... | 2.609375 | 3 |
src/game/commands/general.py | gtaylor/dott | 3 | 12790589 | <filename>src/game/commands/general.py
"""
General commands that are available to everyone.
"""
import json
import settings
from src.daemons.server.commands.command import BaseCommand
from src.daemons.server.commands.exceptions import CommandError
from src.daemons.server.protocols.proxyamp import WhoConnectedCmd, Dis... | 2.59375 | 3 |
npro/npro/report/__init__.py | VasuGoel-zz/npro | 0 | 12790590 | # Copyright (c) 2013, GreyCube Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import cint
import shutil, os
from frappe.modules import scrub, get_module_path
def copy_report(
module="NPro... | 2.171875 | 2 |
mazikeen/GeneratorMakedirs.py | hanniballar/mazikeen | 0 | 12790591 | from mazikeen.MakedirsBlock import MakedirsBlock
from mazikeen.GeneratorException import GeneratorException
def generateMakedirs(data):
if not isinstance(data, str):
raise GeneratorException("'makedirs' block not recognized")
return MakedirsBlock(data) | 2.09375 | 2 |
face_detect.py | Biel-Hammer/IDphoto | 2 | 12790592 | <filename>face_detect.py
import cv2
import mediapipe as mp
mp_face_detection = mp.solutions.face_detection
mp_drawing = mp.solutions.drawing_utils
# For static images:
IMAGE_FILES = []
drawing_spec = mp_drawing.DrawingSpec(thickness=1, circle_radius=1)
def get_face_key_point(image):
with mp_face_detection.FaceD... | 2.96875 | 3 |
AD-HOC/NIVEL-8/1127/1127.py | Cluxnei/uri-online-judge-problems | 0 | 12790593 | def lp(copy, original):
copy_len = len(copy)
original_len = len(original)
if copy_len > original_len:
return original_len - 1
return copy_len - 1 if original_len == copy_len else copy_len
def not_flat_or_sharp(char):
return char != '#' and char != 'b'
def transpose_note(note, notes):
... | 3.4375 | 3 |
eoncloud_web/biz/firewall/migrations/0001_initial.py | eoncloud-dev/eoncloud_web | 10 | 12790594 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('idc', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operati... | 1.8125 | 2 |
challenge-49/test_solver.py | mauricioklein/algorithm-exercises | 3 | 12790595 | import unittest
from solver import buddy_strings
class TestSolver(unittest.TestCase):
def test_buddy_strings(self):
self.assertEqual(buddy_strings("ab" , "ba" ), True )
self.assertEqual(buddy_strings("ab" , "ab" ), False)
self.assertEqual(buddy_strings("aa" , "aa" ), T... | 3.03125 | 3 |
test/test_billing_prices_api.py | CiscoDevNet/python-msx-sdk | 0 | 12790596 | <reponame>CiscoDevNet/python-msx-sdk
"""
MSX SDK
MSX SDK client. # noqa: E501
The version of the OpenAPI document: 1.0.9
Generated by: https://openapi-generator.tech
"""
import unittest
import python_msx_sdk
from python_msx_sdk.api.billing_prices_api import BillingPricesApi # noqa: E501
class T... | 2.359375 | 2 |
model/train.py | dbetm/handwritten-flowchart-with-cnn | 24 | 12790597 | <filename>model/train.py
# -*- coding: utf-8 -*-
from __future__ import division
import random
import pprint
import sys
import time
import pickle
import logging
import traceback
from optparse import OptionParser
import numpy as np
import tensorflow as tf
from keras import backend as K
from keras.optimizers import Ada... | 2.4375 | 2 |
src/modules/json/pysud_config_json_parser.py | joaonlopes/pysud | 1 | 12790598 | import json
import pysud
class ConfigJsonParser():
"""
Summary
Attributes:
config_json_file: A valid json file path containing pysud game configurations.
"""
def __init__(self, config_json_file_path):
self.config_json_file = json.load(open(config_json_file_path, 'r', encoding='u... | 3.15625 | 3 |
client/summoner.py | sandbox-pokhara/auto-disenchanter-v2 | 0 | 12790599 | <filename>client/summoner.py
import requests
def get_level(connection):
try:
res = connection.get('/lol-summoner/v1/current-summoner')
res_json = res.json()
return res_json['summonerLevel']
except requests.exceptions.RequestException:
return -1
| 2.578125 | 3 |
editing.py | JuliaSmeredchuk/python_training | 0 | 12790600 |
class Editing:
def __init__(self, company, mobile, address2, notes):
self.company = company
self.mobile = mobile
self.address2 = address2
self.notes = notes
| 2.625 | 3 |
test/testExecutor.py | AutoDash/AutoDash | 3 | 12790601 | #!/usr/bin/env python3
import unittest
from src.executor.Printer import Printer
from src.data.VideoItem import VideoItem
class TestIExecutor(unittest.TestCase):
def test_compiles(self):
self.assertEqual(True, True)
def test_printer(self):
printer = Printer()
printer.run(VideoItem(met... | 2.375 | 2 |
complexcnn/modules.py | maxisoft/ComplexCNN | 0 | 12790602 | <filename>complexcnn/modules.py<gh_stars>0
# -*- coding: utf-8 -*-
import torch
import torch.nn as nn
import numpy as np
from abc import ABCMeta, abstractmethod
class BaseComplexConv(nn.Module, metaclass=ABCMeta):
_dtype_mapping = {torch.complex64: torch.float, torch.complex128: torch.double, torch.complex32: torc... | 2.25 | 2 |
application.py | Alastairsc/CITS4406-Assignment2 | 4 | 12790603 | """Main execution body for program. Contains GUI interface and exporting class that creates files instead
of generating HTML Reports
Author: <NAME>
Last Updated: 28/02/2017
"""
import argparse
import webbrowser
import textwrap
import xlrd
from tkinter import *
from tkinter import filedialog, ttk
from threading import... | 3.09375 | 3 |
index/tests.py | CodeMath/SmartCotract_Etherum_Example | 2 | 12790604 | from django.test import TestCase, override_settings
from social_django.compat import reverse
@override_settings(SOCIAL_AUTH_GITHUB_KEY = '1', SOCIAL_AUTH_GITHUB_SECRET='2')
class AuthTestcase(TestCase):
def setUp(self):
session = self.client.session
session["github_status"] = "1"
session.s... | 2.234375 | 2 |
main_node/stop_condition/stop_condition.py | dpukhkaiev/BRISE2 | 4 | 12790605 | import datetime
import json
import logging
import os
import threading
import time
from abc import ABC, abstractmethod
import pika
from tools.mongo_dao import MongoDB
class StopCondition(ABC):
def __init__(self, stop_condition_parameters: dict, experiment_description: dict, experiment_id: str):
self.even... | 2.4375 | 2 |
random_query_generator.py | Nispand1492/amazon_cloud_project | 0 | 12790606 | __author__ = 'Nispand'
import random
import time
def get_lang():
Lang = ["English","Spanish"]
id = random.randint(0,1)
print type(Lang[id])
return Lang[id]
def get_segment_id():
seg_id = random.randint(1,103214)
#print seg_id
return seg_id
def get_contract_id():
contract_id = random.r... | 2.71875 | 3 |
tomomibot/session.py | adzialocha/tomomibot | 28 | 12790607 | <gh_stars>10-100
import os
import random
import threading
import time
from keras.models import load_model
from sklearn.cluster import KMeans
import librosa
import numpy as np
import tensorflow as tf
from tomomibot.audio import (AudioIO, slice_audio, detect_onsets,
is_silent, mfcc_features... | 2.125 | 2 |
course-1:basic-building-blocks/subject-6:conditionals/lesson-5.0:Password puzzle.py | regnart-tech-club/python | 0 | 12790608 | # Write a program that takes in an input,
# prints 'You may enter.' if the input matches a password of one's own choosing, and
# prints 'Begone!' otherwise.
| 3 | 3 |
driver/tests/collision_avoidance.py | IDP-L211/controllers | 3 | 12790609 | # Test script for drive_to_pos
def main(robot):
# Setup
timestep = int(robot.getBasicTimeStep())
# Actions for our robot
action_queue = [
("move", [0, 0]),
"scan",
("move", [0.9, 0.9]),
("move", [0.9, -0.9]),
("move", [-0.9, 0.9]),
("move", [-0.9, -0.9])... | 2.671875 | 3 |
asch/server/server.py | DavidMChan/asch | 0 | 12790610 | <filename>asch/server/server.py
import random
import pymongo
from flask import Flask, render_template
from flask_restful import Api
from asch.config import Config
from asch.server.resources import *
from experiments import EXPERIMENT_TYPES # noqa: F401
# Flask app configuration
app = Flask(__name__)
app.config['SEC... | 2.484375 | 2 |
tests/unit_tests/test_time_integrator/test_time_integrator.py | cwentland0/perform | 6 | 12790611 | <reponame>cwentland0/perform
import unittest
from perform.time_integrator.time_integrator import TimeIntegrator
class TimeIntegratorTestCase(unittest.TestCase):
def setUp(self):
# set up param_dict
self.param_dict = {}
self.param_dict["dt"] = 1e-7
self.param_dict["time_scheme"] =... | 2.953125 | 3 |
vivit.py | rishikksh20/ViViT-pytorch | 204 | 12790612 | <filename>vivit.py
import torch
from torch import nn, einsum
import torch.nn.functional as F
from einops import rearrange, repeat
from einops.layers.torch import Rearrange
from module import Attention, PreNorm, FeedForward
import numpy as np
class Transformer(nn.Module):
def __init__(self, dim, depth, heads, dim_h... | 2.359375 | 2 |
web/app/djrq/templates/admin/requests.py | bmillham/djrq2 | 1 | 12790613 | <reponame>bmillham/djrq2
# encoding: cinje
: from ..template import page as _page
: from .. import table_class, table_style, caption_args
: from ..helpers.helpers import aa_link
: def requeststemplate page=_page, title=None, ctx=None, requestlist=[], view_status=None, requestinfo=None
: using page title, ctx, lan... | 2.125 | 2 |
visualize_architecture.py | yonycherkos/dl4cv_exercise | 0 | 12790614 | # import the necessary packages
from pyimagesearch.nn.conv.lenet import LeNet
from tensorflow.keras.utils import plot_model
model = LeNet.build(28, 28, 3, 3)
plot_model(model, show_shapes=True, to_file="lenet.png") | 2.140625 | 2 |
geco/mips/max_cut/generic.py | FreestyleBuild/GeCO | 8 | 12790615 | import itertools
import pyscipopt as scip
import geco.mips.utilities.naming as naming
def naive(graph):
model = scip.Model("Naive MaxCut")
node_variables = {}
for v in graph.nodes():
node_variables[v] = model.addVar(lb=0, ub=1, obj=0, name=str(v), vtype="B")
edge_variables = {}
all_non_... | 2.703125 | 3 |
problemtools/tex2html.py | jsannemo/problemtools | 0 | 12790616 | <reponame>jsannemo/problemtools
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import os.path
import string
import argparse
import logging
import subprocess
import plasTeX.TeX
import plasTeX.Logging
from .ProblemPlasTeX import ProblemRenderer
from .ProblemPlasTeX import ProblemsetMacros
from . import templ... | 2.15625 | 2 |
Player.py | sglyon/reversi.py | 0 | 12790617 | import time
import socket
import sys
from board import Board
INF = 1.0e100
CORNERS = [(0, 0), (0, 7), (7, 0), (7, 7)]
CENTERS = [(3, 3), (3, 4), (4, 3), (4, 4)]
DANGERS = [(0, 1), (0, 6), (1, 0), (1, 1), (1, 6), (1, 7), (6, 0), (6, 1),
(6, 6), (6, 7), (7, 1), (7, 6)]
G_EDGES = [(0, 2), (0, 3), (0, 4), (0, ... | 3.21875 | 3 |
1865.py | gabzin/beecrowd | 3 | 12790618 | for i in range(int(input())):
nome,numero=input().split()
print("Y") if nome=="Thor" else print("N")
| 3.734375 | 4 |
aqa/customers/migrations/0002_auto_20201025_1305.py | ksemilla/aqa | 0 | 12790619 | <gh_stars>0
# Generated by Django 3.0.9 on 2020-10-25 13:05
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('customers', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='c... | 1.953125 | 2 |
Monolith/UM.py | Nouranium/Monolith | 0 | 12790620 | <reponame>Nouranium/Monolith<filename>Monolith/UM.py
'''
Created on 15 Aug 2015
Universal Machines
@author: NoNotCar
'''
import Object
import Img
import Buyers
import Entity
class Incinerator(Object.OObject):
is3d=True
img=Img.imgret2("UM/Incinerator.png")
doc="Burns fuel to destroy items (such as fish poo)... | 2.515625 | 3 |
froide/publicbody/migrations/0012_auto_20180227_1926.py | manonthemat/froide | 0 | 12790621 | <reponame>manonthemat/froide
# -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-02-27 18:26
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('publicbody', '0011_auto_20180105_1648'),
]
operations ... | 1.539063 | 2 |
loops.py | neuralline/python-project | 0 | 12790622 | <gh_stars>0
companies = ["google", "apple", "microsoft"]
for element in companies:
print(element)
""" """
items = [0, 12, 30]
total = 0
for element in items:
total = total + element
print(element)
print("total =", total)
""" """
c = list(range(1, 5))
print(c)
| 3.71875 | 4 |
pylock/__init__.py | waveaccounting/pylock | 6 | 12790623 | <gh_stars>1-10
from importlib import import_module
import logging
from six.moves.urllib import parse
from .backends import LockTimeout # noqa
DEFAULT_TIMEOUT = 60
DEFAULT_EXPIRES = 10
KEY_PREFIX = 'pylock:'
DEFAULT_BACKEND = {
'class': 'pylock.backends.redis_lock.RedisLock',
'connection': 'redis://'
}
logg... | 2.4375 | 2 |
ogbg/mol/main.py | icmlsubmission-spec/spec-gnn | 0 | 12790624 | <reponame>icmlsubmission-spec/spec-gnn<filename>ogbg/mol/main.py
import os
import random
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
import torch.optim as optim
import numpy as np
from tqdm import tqdm
### importing OGB
from ogb.... | 2.1875 | 2 |
app/main.py | sto/flask-formvalidatorjs | 1 | 12790625 | # Aplicación de validación de formularios en Javascript
#
# Copyright 2018 <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation... | 1.835938 | 2 |
code/02_modeling/ui_utils/ui_annotation.py | Azure-Samples/MachineLearningSamples-AMLVisionPackage-ISICImageClassification | 1 | 12790626 | <reponame>Azure-Samples/MachineLearningSamples-AMLVisionPackage-ISICImageClassification<gh_stars>1-10
from ipywidgets import widgets, Layout, IntSlider
import io
from cvtk import ClassificationDataset, Label
#import sys
#import bqplot, IPython, random
#from IPython.display import display
#from bqplot import pyplot as ... | 2.25 | 2 |
refence/script1.py | caoghui/python | 0 | 12790627 | <reponame>caoghui/python<gh_stars>0
#A first python script
import sys
print(sys.platform)
print(2 ** 100)
x = 'Spam!'
print(x * 8)
input('Press Enter to exit')
| 2.890625 | 3 |
lib/writer.py | qwertytam/going-the-extra-mile | 0 | 12790628 | import inspect
# Indent level for writer
_INDENT_LEVEL = 2
_INDENT = ' ' * _INDENT_LEVEL
class _Writer(object):
'''Writer used to create source files with consistent formatting'''
def __init__(self, path):
'''
Args:
path (handle): File name and path to write to
'''
... | 4.3125 | 4 |
main.py | kmirzavaziri/ma-nqp | 0 | 12790629 | <reponame>kmirzavaziri/ma-nqp<filename>main.py
import math
import os
import random
import multiprocessing as mp
import numpy
import time
PRINT_SLICE_INFO = False
PRINT_ITERATION_NO = True
PRINT_ITERATION_BEST_ANSWER = True
PRINT_ITERATION_BEST_ANSWER_DETAILS = False
PRINT_ITERATION_ALL_ANSWERS = False
PRINT_TIME_INFO ... | 2.859375 | 3 |
models/ME_objectives.py | MrHuff/DIF-NLDL | 0 | 12790630 | import torch
from torch import nn
from gpytorch.kernels import LinearKernel,MaternKernel,RBFKernel,Kernel
from torch.nn.modules.loss import _Loss
class Log1PlusExp(torch.autograd.Function):
"""Implementation of x ↦ log(1 + exp(x))."""
@staticmethod
def forward(ctx, x):
exp = x.exp()
ctx.sav... | 2.640625 | 3 |
src/test.py | Felix-Huang11/rembg-greenscreen | 0 | 12790631 | from rembg.multiprocessing import parallel_greenscreen
if __name__ == "__main__":
parallel_greenscreen("/Users/zihao/Desktop/zero/video/group15B_Short.avi",
3,
1,
"u2net_human_seg",
frame_limit=300)
| 1.6875 | 2 |
Python/cube-can-sat-2016/soft/desktop/src/thermodynamic_parameters/src.py | Misha91908/Portfolio | 0 | 12790632 | <filename>Python/cube-can-sat-2016/soft/desktop/src/thermodynamic_parameters/src.py
import matplotlib.pyplot as plt
def reading_data():
func_dat = []
f = open("/home/misha91908/cube-can-sat-2016/soft/desktop/log/MEDIUM.TXT", 'r')
for line in f:
if(line != '\n'):
func_dat.append(line)
... | 2.953125 | 3 |
webspider/spiders/sheJiYuanSpider.py | JohnnieFucker/WebSpider | 0 | 12790633 | # -*- coding: utf-8 -*-
import scrapy
from webspider.items import SheJiYuanItem
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
class SheJiYuanSpider(scrapy.Spider):
name = 'SheJiYuanSpider'
allowed_domains = ['qieta.com']
start_urls = []
headers = {
'Accept': 'text / html, application /... | 2.703125 | 3 |
tests/wordplay_tests.py | deostroll/sengine | 0 | 12790634 | <reponame>deostroll/sengine
from unittest import TestCase
from context import *
import pdb
import pprint
def write(l):
w = open('debug.txt', 'a')
w.write(str(l) + '\n')
w.close()
def testWrap(tc, func):
def execute(inp, expected, hasReturn=True):
if hasReturn:
actual = func(inp)
... | 3.25 | 3 |
T2GEORES/model_conf.py | jejimenezm/T2GEORES | 0 | 12790635 | from datetime import datetime, timedelta
import numpy as np
input_data={'incon_state':'current',
'EOS':1,
'source_txt':'../input/',
'ref_date':datetime(1975,1,1,0,0,0),
'z_ref':600,
'db_path':'../input/model_month.db',
'LAYERS':{1:['A',100],
2:['B', 100],
3:['C', 125],
4:['D', 60],
... | 2.09375 | 2 |
helper.py | Wings30306/the-writers-club | 0 | 12790636 | import os
from flask import Flask, app, flash, session
from flask_pymongo import PyMongo
from datetime import date, datetime
app = Flask(__name__)
app.config["MONGO_DBNAME"] = os.getenv('MONGO_DBNAME')
app.config["MONGO_URI"] = os.getenv('MONGO_URI')
app.config["SECRET_KEY"] = os.getenv('SECRET_KEY')
mongo = PyMongo(... | 2.671875 | 3 |
tests/test_saga/test_executions/test_commit.py | Clariteia/minos_microservice_saga | 4 | 12790637 | import unittest
from unittest.mock import (
AsyncMock,
call,
)
from uuid import (
uuid4,
)
from minos.saga import (
ConditionalSagaStepExecution,
LocalSagaStep,
LocalSagaStepExecution,
RemoteSagaStepExecution,
Saga,
SagaContext,
SagaExecution,
TransactionCommitter,
)
from te... | 2.234375 | 2 |
examples/ForPatching/MediumOverCapacitiesLargeRunner.py | supermihi/scgen | 1 | 12790638 | <filename>examples/ForPatching/MediumOverCapacitiesLargeRunner.py
from examples.exampleRunner import runExample
runExample("ForPatching/MediumOverCapacitiesLarge.json", withExcel=False) | 1.328125 | 1 |
import.py | calzoneman/MarkovBot | 3 | 12790639 | <gh_stars>1-10
#!/usr/bin/python3
import argparse
import pymk
import sys
import time
def import_file(session, ns, f, batch_size=1000):
links = []
i = 0
start = time.perf_counter()
for link in pymk.tokenize(f, link_length=ns.link_length):
links.append(link)
i += 1
if len(links) ... | 2.71875 | 3 |
mee6_py_api/exceptions.py | hyperevo/mee6_python_api | 14 | 12790640 | #
# HTTP
#
class HTTPRequestError(Exception):
'''
Base error for any exceptions caused by communication with remote server
'''
pass
class BadRequestError(HTTPRequestError):
'''
Error 400
'''
pass
class UnauthorizedError(HTTPRequestError):
'''
Error 401
'''
pass
class T... | 2.21875 | 2 |
do_py/common/managed_list.py | timdavis3991/do-py | 0 | 12790641 | """
:date_created: 2020-06-28
"""
from do_py.common import R
from do_py.data_object.restriction import ManagedRestrictions
from do_py.exceptions import RestrictionError
class ManagedList(ManagedRestrictions):
"""
Use this when you need a restriction for a list of DataObject's.
"""
_restriction = R(lis... | 2.6875 | 3 |
tests/test_bfs.py | Akards/Parallel-Python | 1 | 12790642 | #!/usr/bin/env python3
import unittest
import networkx as nx
from Medusa.graphs import bfs
class TestBFS(unittest.TestCase):
def test_disconnected_graph(self):
G = nx.Graph()
node_list = ['A', 'B', 'C', 'D', 'E', 'F']
G.add_nodes_from(node_list)
self.assertEqual(list(G.nodes), node_... | 3.078125 | 3 |
lib/misc.py | lawrencesim/templatize-python | 0 | 12790643 | <filename>lib/misc.py
import collections, collections.abc
_types = {
"UNDEFINED": -1,
"NULL": 0,
"NONE": 0,
"VALUE": 1,
"STRING": 1,
"NUMBER": 1,
"ARRAY": 2,
"LIST": 2,
"OBJECT": 3,
"DICTIONARY": 3,
"FUNCTION": 4
}
_NT_ty... | 2.796875 | 3 |
pybg/tenor.py | bondgeek/pybg | 1 | 12790644 | '''
Tenor class
@author: <NAME>
@copyright: BG Research LLC, 2011
@modified: July 2012 to replace SWIG Quantlib bindings with pyQL Cython code.
'''
from datetime import date
from pybg.enums import TimeUnits
from pybg.quantlib.time.api import *
from pybg.ql import pydate_from_qldate, qldate_from_pydate
class Ten... | 2.359375 | 2 |
test_txamqpr/test_txamqp_client.py | aliowka/txamqpr | 0 | 12790645 | <gh_stars>0
# Copyright 2015 <NAME> <EMAIL>
#
# 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 i... | 1.953125 | 2 |
default_resolver.py | dlcs/river-annotations | 0 | 12790646 | <reponame>dlcs/river-annotations<filename>default_resolver.py
import hashlib
import settings
def get_anno_details(arguments):
details = {
'width': arguments.get('width'),
'height': arguments.get('height'),
'canvasURI': arguments.get('canvas'),
'imageURI': arguments.get('image'),
... | 2.09375 | 2 |
src/spn/tests/test_EM.py | nicoladimauro/SPFlow | 0 | 12790647 | import unittest
from spn.algorithms.EM import EM_optimization
from spn.algorithms.Inference import log_likelihood
from spn.algorithms.LearningWrappers import learn_parametric, learn_mspn
from spn.gpu.TensorFlow import spn_to_tf_graph, eval_tf, likelihood_loss, tf_graph_to_spn
from spn.structure.Base import Context
fro... | 2.390625 | 2 |
src/Vehicle_detection.py | AmudhanManisekaran/AI-Cop | 0 | 12790648 | <filename>src/Vehicle_detection.py
import tensorflow as tf
from utils import backbone
from api import object_counting_api
if tf.__version__ < '1.4.0':
raise ImportError('Please upgrade your tensorflow installation to v1.4.* or later!')
input_video = "./input_footage/trim.mp4"
# input_video="rtsp://admin:admin@555@1... | 2.03125 | 2 |
developing/misc/pyc_remove.py | Pyro4Bot-RoboLab/PYRobot | 0 | 12790649 | #!/usr/bin/env python3
import subprocess
try:
subprocess.call(["pyclean", ".."])
except:
print("error")
else:
print("*.pyc borrados")
| 1.695313 | 2 |
mobilealerts/gateway.py | PlusPlus-ua/python-mobilealerts | 0 | 12790650 | """MobileAlerts internet gataway."""
from typing import Any, Awaitable, Callable, Dict, List, Optional
import asyncio
import logging
import socket
import struct
import time
from ipaddress import IPv4Address
import aiohttp
from multidict import CIMultiDictProxy
from yarl import URL
from .sensor import Sensor
_LOGGE... | 2.28125 | 2 |