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
S2.Surface_Normal/lib/helper.py
leoshine/Spherical_Regression
133
12797551
<filename>S2.Surface_Normal/lib/helper.py # coding: utf8 """ @Author : <NAME> """ import torch import torch.nn as nn from torch.autograd import Variable import numpy as np from easydict import EasyDict as edict from collections import OrderedDict as odict from itertools import product def eval_cls(Preds, GTs): ...
2.34375
2
nevergrad/functions/corefuncs.py
akhti/nevergrad
1
12797552
<reponame>akhti/nevergrad<filename>nevergrad/functions/corefuncs.py<gh_stars>1-10 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import time from typing import Dict, An...
3.09375
3
tests/data/src/requires_simple/setup.py
rsumnerz/pip
2
12797553
<filename>tests/data/src/requires_simple/setup.py from setuptools import find_packages, setup setup(name='requires_simple', version='0.1', install_requires=['simple==1.0'] )
1.148438
1
main.py
flkapes/best-buy-bot
0
12797554
import time from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions import TimeoutException from selenium.webdriver.common.by import By from sel...
2.828125
3
api/serializers.py
vault-the/babybuddy
0
12797555
<reponame>vault-the/babybuddy<filename>api/serializers.py # -*- coding: utf-8 -*- from __future__ import unicode_literals from rest_framework import serializers from django.contrib.auth.models import User from core.models import (Child, DiaperChange, Feeding, Note, Sleep, Timer, TummyTime) ...
2.109375
2
api/drinks/models/__init__.py
gthole/drink-stash
7
12797556
<filename>api/drinks/models/__init__.py from .activities import Activity from .books import Book, BookUser from .recipes import Quantity, Recipe from .lists import UserList, UserListRecipe from .users import UserIngredient, Profile from .comments import Comment from .ingredients import Ingredient from .uom import Uom f...
1.34375
1
utility.py
IamVicky90/insurance-prediction-pyspark
0
12797557
from asyncore import read import os import shutil import yaml import json from app_logger import logger from datetime import datetime import uuid def create_directory(path: str, is_recreate: bool = False)->None: """Utility to create the dirctory Args: path (str): Give the full path with directory name ...
2.734375
3
SMPyBandits/Policies/Experimentals/UCBjulia.py
balbok0/SMPyBandits
309
12797558
<reponame>balbok0/SMPyBandits # -*- coding: utf-8 -*- """ The UCB policy for bounded bandits, with UCB indexes computed with Julia. Reference: [Lai & Robbins, 1985]. .. warning:: Using a Julia function *from* Python will not speed up anything, as there is a lot of overhead in the "bridge" protocol used by pyjulia...
1.796875
2
tests/test_pmd.py
believeinlain/asynch-cv
1
12797559
"""Test of pmd_consumer functionality, with a selection of data.""" from os.path import join, expanduser from async_cv.play_file import play_file from async_cv.event_processing.pmd_consumer import pmd_consumer data_root = 'OneDrive\\Documents\\NIWC\\NeuroComp\\boat_tests\\' annot_root = 'OneDrive\\Documents\\NIWC\\N...
1.828125
2
examples/live_sowemail_example.py
SoWeMail/sowerest-python
0
12797560
<gh_stars>0 import os import sowerest host = "http://api.sowemail.com:9000" api_key = os.environ.get('SOWEMAIL_API_KEY') request_headers = { "Authorization": 'Bearer {}'.format(api_key) } version = 1 client = sowerest.Client(host=host, request_headers=request_headers, ...
2.5625
3
DCNN-CIFAR10.py
bansalshubh91/Deep-CNN---CIFAR10
0
12797561
<reponame>bansalshubh91/Deep-CNN---CIFAR10<gh_stars>0 # coding: utf-8 # In[ ]: # # coding: utf-8 # # In[1]: import numpy as np import h5py import time import copy from random import randint import torch import torchvision import torchvision.transforms as transforms import torch.nn as nn import torch.nn.functio...
2.859375
3
alipay/aop/api/domain/CollectReceiptOpenApiDTO.py
antopen/alipay-sdk-python-all
213
12797562
<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.MultiCurrencyMoneyOpenApi import MultiCurrencyMoneyOpenApi from alipay.aop.api.domain.MultiCurrencyMoneyOpenApi import MultiCurrencyMoneyOpenApi from alipay.aop.a...
1.617188
2
Web/EnterthePolygon/exif/front/migrations/0003_auto_20190318_2200.py
HackUCF/SunshineCTF-2019-Public
9
12797563
# Generated by Django 2.1.4 on 2019-03-18 22:00 from django.db import migrations, models import front.models class Migration(migrations.Migration): dependencies = [ ('front', '0002_images_filename'), ] operations = [ migrations.AlterField( model_name='images', na...
1.617188
2
util/summary_func.py
demetoir/ALLGANS
11
12797564
"""tensorflow summary util""" import tensorflow as tf def mean_summary(var): """mean scalar summary :type var: tensorflow.Variable :param var: variable to add summary """ with tf.name_scope(var.name.split(":")[0]): mean = tf.reduce_mean(var) tf.summary.scalar('mean', m...
3.078125
3
date-and-time/src/datetime-methods.py
giserh/book-python
1
12797565
from datetime import datetime armstrong = datetime(1969, 7, 21, 14, 56, 15) armstrong.date() # datetime.date(1969, 7, 21) armstrong.time() # datetime.time(14, 56, 15) armstrong.weekday() # 0 # in US week starts with Sunday
3.078125
3
phantasy/library/parser/polarity.py
phantasy-project/phantasy
0
12797566
# -*- coding: utf-8 -*- """Read polarity. """ import csv def readfile(filepath, fmt='csv'): with open(filepath, 'r') as f: data = csv.reader(f, delimiter=',', skipinitialspace=True) next(data) r = {i[0]: int(i[1]) for i in data if not i[0].startswith("#")} return r
3.609375
4
elrosproject/jedis/admin.py
prophet322/elrostest
0
12797567
from django.contrib import admin from .models import Planet, Jedi, Tests, Questions # Register your models here. admin.site.register(Planet) admin.site.register(Jedi) class TestsInline(admin.StackedInline): model = Questions extra = 0 @admin.register(Tests) class QuestionsAdmin(admin.ModelAdmin): inline...
1.8125
2
Super Ugly Number.py
quake0day/oj
0
12797568
class Solution(object): def nthSuperUglyNumber(self, n, primes): """ :type n: int :type primes: List[int] :rtype: int """ res = [1] hashmap = {val:0 for val in primes} m = [float('inf')] * len(primes) while len(res) < n: newm = [re...
3.359375
3
pandasCSVread.py
apalom/Clustering_NHTS_Driving_Patterns
1
12797569
# -*- coding: utf-8 -*- """ Created on Sun Feb 18 22:57:53 2018 @author: <NAME> """ # import libraries import pandas as pd import timeit # initialize values start_time = timeit.default_timer() <<<<<<< HEAD # Import NHTS2009 Data df0 = pd.read_csv(r'C:\Users\avi_b\Box\CS6140 Project\Data\CSV\DAYV2PUB...
2.75
3
api/bittrex.py
arafuse/CryptoWatcher
1
12797570
<reponame>arafuse/CryptoWatcher<gh_stars>1-10 # -*- coding: utf-8 -*- """ Bittrex API module. """ __author__ = '<NAME> <$(echo nqnz.enshfr#tznvy.pbz | tr a-z# n-za-m@)>' __version__ = "0.2.0" __all__ = ['Client'] import hmac import json import time import asyncio import hashlib import traceback from datetime import...
2.03125
2
bvlapi/api/team/matches_by_guid.py
alanverresen/bvl-api
1
12797571
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Contains function to call API for information about a team's games. from bvlapi.api.call import call_api from bvlapi.api.settings import API_BASE_URL from bvlapi.common.exceptions import InvalidGuid from bvlapi.guid.team import is_team_guid def get_matches_by_guid(gu...
3.015625
3
fastdb/__init__.py
kaankarakoc42/FastDB
0
12797572
from .fastdb import FastDB from .fastclient import FastClient
1.101563
1
transik/views.py
macie/transik
0
12797573
<gh_stars>0 from flask import flash, render_template, redirect, request, session, url_for from transik import app @app.route('/') def dashboard(): projects = [ {'id': 'first', 'name': 'first project'} ] return render_template('dashboard.html', session=session, projects=projects) @app.route('/logi...
2.21875
2
06-templates/templates_server.py
bzd111/aiohttp-all
0
12797574
import sqlite3 from pathlib import Path from typing import Any, AsyncIterator, Dict import aiohttp_jinja2 import aiosqlite import jinja2 from aiohttp import web router = web.RouteTableDef() async def fetch_post(db: aiosqlite.Connection, post_id: int) -> Dict[str, Any]: async with db.execute( "select ow...
2.5625
3
ACO.py
mentesniker/Maxcut-solver
0
12797575
<reponame>mentesniker/Maxcut-solver from random import random, uniform from scipy.optimize import minimize from math import e, sqrt,cos,pi ''' Class Point. A point is an object that has a position and a pheromone that leads to the point. ''' class Point(): ''' The constructor of the class. Params: ...
3.765625
4
mmvmm/tap_device.py
marcsello/mmvmm
0
12797576
<filename>mmvmm/tap_device.py #!/usr/bin/env python3 import subprocess from threading import RLock class TAPDevice(object): """ This class issues iproute2 commands to add and remove tap devices required for VM networking """ _allocated_device_ids = [] NAMING_SCHEME = "tap{id}" _global_networ...
2.765625
3
utils/mesh_utils.py
amirhertz/maps
2
12797577
from custom_types import * from constants import EPSILON import igl def scale_all(*values: T): max_val = max([val.max().item() for val in values]) min_val = min([val.min().item() for val in values]) scale = max_val - min_val values = [(val - min_val) / scale for val in values] if len(values) == 1:...
1.867188
2
core/filebrowser/urls.py
yesw2000/panda-bigmon-core
0
12797578
<gh_stars>0 """ filebrowser.urls """ from django.conf.urls import include, url from django.conf import settings from django.conf.urls.static import static from django.contrib import admin ### #FIXME admin.autodiscover() import views as filebrowser_views urlpatterns = [ url(r'^$', filebrowser_views.index, nam...
1.398438
1
disvae/models/losses.py
BartMelman/disentangling-vae
0
12797579
<filename>disvae/models/losses.py """ Module containing all vae losses. """ import abc import math import torch from torch.nn import functional as F from torch import optim from .discriminator import Discriminator from disvae.utils.math import log_density_normal, log_importance_weight_matrix # TO-DO: clean data_siz...
2.125
2
monitor/tests/test_views/test_twitter_user_views.py
arineto/twitter_monitor
1
12797580
from django.test import TestCase from django.urls import reverse from model_mommy import mommy from monitor.models import TwitterUser from monitor.tests.utils.http_client_mixin import HTTPClientMixin import mock class TestTwitterUserView(HTTPClientMixin, TestCase): def setUp(self): super(TestTwitterUserV...
2.3125
2
surf/surf4hourstool.py
izhujiang/igsnrr
0
12797581
<filename>surf/surf4hourstool.py # !/usr/bin/python # -*- coding: utf-8 -*- # COPYRIGHT 2016 igsnrr # # MORE INFO ... # email: import os import shutil import time from datetime import date from datetime import timedelta, datetime import pandas as pd from ..base.toolbase import ToolBase class Surf4HoursTool(ToolBase...
2.765625
3
docs/code/surrogates/pce/plot_pce_sphere.py
SURGroup/UncertaintyQuantification
0
12797582
""" Sinusoidal Function Sphere function (2 random inputs, scalar output) ====================================================================== In this example, PCE is used to generate a surrogate model for a given set of 2D data. .. math:: f(x) = x_1^2 + x_2^2 **Description:** Dimensions: 2 **Input Domain:** T...
3.453125
3
Greedy/2847.py
esdx245/algorithms
0
12797583
n = int(input()) lista= [] for i in range(n): lista.append(int(input())) tempmax = lista[-1] count = 0 for i in range(n-2,-1,-1): if lista[i] >= tempmax: temp = lista[i] -tempmax +1 count += temp lista[i] -= temp tempmax = lista[i] print(count)
3.046875
3
linear/sym1.py
shirai708/qiita
1
12797584
<gh_stars>1-10 import matplotlib.pyplot as plt vq = [] vp = [] h = 0.05 q = 1.0 p = 0.0 for i in range(1000): p = p - h * q q = q + h * p vp.append(p) vq.append(q) plt.plot(vq, vp) plt.savefig("sym1.png")
2.71875
3
python/tvm/topi/cuda/stft.py
shengxinhu/tvm
4,640
12797585
<gh_stars>1000+ # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"...
1.84375
2
src/Gon/stock_info_spyder.py
somewheve/Listed-company-news-crawl-and-text-analysis
1
12797586
<filename>src/Gon/stock_info_spyder.py """ https://waditu.com/document/2 """ import __init__ from spyder import Spyder from Kite import config import tushare as ts ts.set_token(config.TUSHARE_TOKEN) import akshare as ak class StockInfoSpyder(Spyder): def __init__(self): super(StockInfoSpyder, self)._...
2.515625
3
on/ottawa/ed/definition.py
ajah/represent-canada-data
0
12797587
from datetime import date import boundaries boundaries.register('Ottawa wards', domain='Ottawa, ON', last_updated=date(2010, 8, 27), name_func=boundaries.dashed_attr('WARD_EN'), id_func=boundaries.attr('WARD_NUM'), authority='City of Ottawa', source_url='http://ottawa.ca/online_services/openda...
2.015625
2
title_cleaner_test.py
susannahsoon/oldperth
302
12797588
from nose.tools import * import title_cleaner TRUTH = [ (True, 'Manhattan: 1st Ave. - 34th St. E.'), (True, 'Queens: Hoyt Avenue - 24th Street'), (False, "Queens: Flushing Meadow Park - New York World's Fair of 1939-40 - [Industrial exhibits.]"), (False, 'Fifth Avenue - 90th Street, southeast corner')...
2.515625
3
src/AoC_2015/d16_finding_Sue_with_list_comprehension/finding_sue.py
derailed-dash/Advent-of-Code
9
12797589
<reponame>derailed-dash/Advent-of-Code<filename>src/AoC_2015/d16_finding_Sue_with_list_comprehension/finding_sue.py """ Author: Darren Date: 26/02/2021 Solving https://adventofcode.com/2015/day/16 500 Sues. Each with different known attributes, and potentially other forgetten attributes. Examine list of k:v pairs de...
2.890625
3
Tutorial code/Week 8_Functions-UserDefined.py
Yixin1103/inf1340-programmingfordatascience-fa21
8
12797590
<gh_stars>1-10 #!/usr/bin/env python # coding: utf-8 # In[2]: def square_root( sq_rand: float ) -> float: ret_val = sq_rand diff = sq_rand - ret_val*ret_val while abs(diff) > 0.000001: diff = sq_rand - ret_val*ret_val ret_val = ret_val + (diff / 2.0) return ret_val # ...
4.09375
4
PocketAlgorithm_v1.py
appielife/Machine-Learning--Perceptron-Pocket-Linear-and-Logical-Regresstion-Algorithm
0
12797591
<reponame>appielife/Machine-Learning--Perceptron-Pocket-Linear-and-Logical-Regresstion-Algorithm<filename>PocketAlgorithm_v1.py ''' Author: <NAME> <<EMAIL>> <NAME> <<EMAIL>> ''' import numpy as np import matplotlib.pyplot as plt import copy class PocketAlgorithm: def __init__(self, datapoints, no_of_i...
3.109375
3
cogs/events.py
est73/cog-example
0
12797592
from discord.ext import commands class Events(commands.Cog): def __init__(self, bot): self.bot = bot @commands.Cog.listener() async def on_ready(self): print('Logged in as') print(self.bot.user.name) print(self.bot.user.id) print('------') def setup(bot): bo...
2.59375
3
itdagene/app/company/migrations/0017_auto_20160315_1953.py
itdagene-ntnu/itdagene
9
12797593
<reponame>itdagene-ntnu/itdagene from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("company", "0016_auto_20160315_1950")] operations = [ migrations.AlterField( model_name="company", name="...
1.3125
1
rfpy/scripts/rfpy_hk.py
wsja/RfPy
21
12797594
<reponame>wsja/RfPy<filename>rfpy/scripts/rfpy_hk.py #!/usr/bin/env python # Copyright 2019 <NAME> # # This file is part of RfPy. # # 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 re...
1.945313
2
Two_snake_version.py
Hacker-Davinci/Snake_Game_My_Hero_Academia_Version
1
12797595
<filename>Two_snake_version.py import pygame from pygame.locals import * import time import random SIZE = 40 BACKGROUND_COLOR = (110, 110, 5) WHITE_COLOR = (255, 255, 255) class Apple: def __init__(self, parent_screen): self.image = pygame.image.load("resources/The_apple_everyone_want.jpg").c...
3.359375
3
fiery_llama/matched_filters.py
bkimmig/fiery_llama
0
12797596
<gh_stars>0 import numpy as np import pandas as pd import re import latbin def lineify(df, n, column): return cubeify(df, [n], [column]) def squareify(df, nx, ny, xcol, ycol): return cubeify(df, [nx, ny], [xcol, ycol]) def cubeify(df, n, columns, target="weights"): """bins up a dataframe into a densel...
2.921875
3
experiments/system_model_v3/recommended_params.py
trangnv/geb-simulations-h20
7
12797597
import datetime import os from models.system_model_v3.model.params.init import params from models.system_model_v3.model.state_variables.init import state_variables from models.constants import RAY from experiments.system_model_v3.configure import configure_experiment from experiments.system_model_v3.run import run_ex...
1.703125
2
day5/part2.py
theonewolf/aoc2021
0
12797598
#!/usr/bin/env python3 GRID_SIZE = 1000 if __name__ == '__main__': data = open('input').read().splitlines() grid = [[0 for i in range(GRID_SIZE)] for j in range (GRID_SIZE)] for row in data: pointA, pointB = row.split(' -> ') pointA = [int(i) for i in pointA.split(',')] pointB = [...
3.625
4
main.py
shemerofir/skaffold-auto-docs
0
12797599
from get_config import get_config from get_ansible import get_ansible from get_helm import get_helm from get_skaffold import get_skaffold from get_docker import get_docker from get_minikube import get_minikube from get_regs import get_registries from edit_hosts import edit_hosts from c_registry import c_registry if _...
1.3125
1
tests/test_counter.py
benkrikler/fast-carpenter-github-test
12
12797600
import numpy as np import pytest from fast_carpenter.selection.filters import Counter @pytest.fixture def weight_names(): return [ "EventWeight", # "MuonWeight", "ElectronWeight", "JetWeight", ] @pytest.fixture def counter(weight_names): return Counter(weight_names) def test_init(weigh...
2.328125
2
server/apps/vartype/tests/__init__.py
iotile/iotile_cloud
0
12797601
<reponame>iotile/iotile_cloud from .test_api_token import * from .tests import *
1.070313
1
app/root.py
SRAlexander/PyAPI
1
12797602
# coding:utf-8 import sys from flask import Flask, jsonify from flask_cors import CORS from flask_migrate import Migrate from flask_restplus import Api from flasgger import Swagger from alchemy.common.base import db from marshmallow import Schema, fields, ValidationError, pre_load from controllers import tests_cont...
2.078125
2
vega/correlation_func.py
andreicuceu/lyafit
0
12797603
<gh_stars>0 import numpy as np from scipy.integrate import quad from scipy.interpolate import interp1d from . import utils class CorrelationFunction: """Correlation function computation and handling. # ! Slow operations should be kept in init as that is only called once # ! Compute is called many times ...
2.515625
3
example_racktests/2_seed.py
eyal-stratoscale/pyracktest
0
12797604
from strato.racktest.infra.suite import * from example_seeds import addition import time SIGNALLED_CALLABLE_CODE = """ import signal import time signalReceived = None def signalHandler(sigNum, _): global signalReceived signalReceived = sigNum signal.signal(signal.SIGUSR2, signalHandler) while not signalRece...
2.265625
2
Jira/jiraAPI.py
Yash-Jain289/Anton-Virtual-Assistant
2
12797605
# Reference : https://docs.atlassian.com/software/jira/docs/api/REST/8.5.3 # Reference : https://developer.atlassian.com/cloud/jira/platform/rest/v2/ # https://id.atlassian.com/manage/api-tokens - create the api token # https://developer.atlassian.com/cloud/jira/platform/basic-auth-for-rest-apis/ - doing it from conf...
2.890625
3
KiZip/core/KiZip.py
gregdavill/KiZip
18
12797606
import os import json import re import sys from datetime import datetime import logging import wx import zipfile import shutil import pcbnew from .config import Config from ..dialog import SettingsDialog from ..errors import ParsingException from .parser import Parser class Logger(object): def __init__(self...
2.03125
2
train_PFSeg.py
Dootmaan/PFSeg
7
12797607
import torch as pt import numpy as np from model.PFSeg import PFSeg3D from medpy.metric.binary import jc,hd95 from dataset.GuidedBraTSDataset3D import GuidedBraTSDataset3D # from loss.FALoss3D import FALoss3D import cv2 from loss.TaskFusionLoss import TaskFusionLoss from loss.DiceLoss import BinaryDiceLoss from config ...
1.75
2
pterasoftware/__init__.py
camUrban/PteraSoftware
68
12797608
<gh_stars>10-100 # ToDo: Update this module's documentation. """This package contains all the source code for the Ptera Software. This package contains the following subpackages: None This package contains the following directories: airfoils: This folder contains a collection of airfoils whose coordinates are...
2.109375
2
task_manager/tasks/filters.py
kunatastic/kunatastic-task-manager
0
12797609
<reponame>kunatastic/kunatastic-task-manager from django_filters.filters import ChoiceFilter, DateFilter from tasks.models import STATUS_CHOICES, Task, History from django_filters.rest_framework import FilterSet from django.db.models import Q STATUS_CHOICES_CUSTOM = ( ("COMPLETED","COMPLETED"), ("NOT_COMPLETED","N...
2.296875
2
django_ember_toolkit/management/commands/_base.py
ForSpareParts/django_ember_toolkit
0
12797610
from os.path import abspath, join import subprocess from django.apps import apps as django_apps from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.template.loader import render_to_string from termcolor import colored SEPARATOR = '----------------------------...
2.203125
2
django/website/wagtail_vue/apps/pages/models.py
hyshka/wagtail-vue-talk
26
12797611
<reponame>hyshka/wagtail-vue-talk # -*- coding: utf-8 -*- """Page models.""" from django.db import models from wagtail.admin.edit_handlers import FieldPanel, StreamFieldPanel from wagtail.images.edit_handlers import ImageChooserPanel from wagtail.core.models import Page from wagtail.api import APIField from wagtail.ima...
1.945313
2
exercise12/lib/ProtocolUtils.py
jdiegoh3/distributed_computing
0
12797612
<gh_stars>0 from xmlrpc import client from xmlrpc.server import SimpleXMLRPCServer from xmlrpc.server import SimpleXMLRPCRequestHandler import threading import socketserver class MessageHandler(object): body = None def __init__(self, message): self.body = message.decode("utf-8") def message_loads...
2.9375
3
src/documentation_builder/test/sourcehandler.py
jouvin/release
0
12797613
<reponame>jouvin/release """Test class for sourcehandler.""" import os import sys import shutil from tempfile import mkdtemp from unittest import TestCase, main, TestLoader sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../lib'))) # noqa from quattordocbuild import sourcehandler class Sour...
2.421875
2
azaka/commands/condition.py
mooncell07/Azaka
12
12797614
<filename>azaka/commands/condition.py<gh_stars>10-100 from __future__ import annotations import typing as t from .proxy import _ConditionProxy from ..objects import UlistLabels if t.TYPE_CHECKING: from ..interface import T __all__ = ( "VNCondition", "BaseCondition", "ReleaseCondition", "Produce...
2.5
2
src/encoder.py
Codingboy/edoc
0
12797615
<gh_stars>0 from random import randint import unittest from typing import Dict, Tuple, List class Encoder: def __init__(self, pw: str): password = bytearray() for c in pw: password.append(ord(c)) index = 0 while len(password) < 4096: password.append(ord(pw[index%len(pw)])) index += 1 self.spBox = S...
2.796875
3
web-component/python/admin_api/api/__init__.py
AbhiGupta03/SDK
0
12797616
<filename>web-component/python/admin_api/api/__init__.py<gh_stars>0 from __future__ import absolute_import # flake8: noqa # import apis into api package from admin_api.api.auto_generate_app_token_api import AutoGenerateAppTokenApi from admin_api.api.card_api import CardApi from admin_api.api.client_api import ClientA...
1.265625
1
problems/__init__.py
rampasek/attention-learn-to-route
0
12797617
<reponame>rampasek/attention-learn-to-route from problems.tsp.problem_tsp import TSP, TSPEdge from problems.vrp.problem_vrp import CVRP, SDVRP from problems.op.problem_op import OP from problems.pctsp.problem_pctsp import PCTSPDet, PCTSPStoch
1.21875
1
sebs/__init__.py
opal-mimuw/serverless-benchmarks
35
12797618
from .sebs import SeBS # noqa from .aws import * # noqa from .azure import * # noqa from .cache import Cache # noqa from .benchmark import Benchmark # noqa # from .experiments import * # noqa
0.976563
1
Array/10 Move all negative numbers to beginning and positive to end.py
ikaushikpal/DS-450-python
3
12797619
def rearrange(arr, n): j = 0 for i in range(0, n): if (arr[i] < 0): arr[i], arr[j] = arr[j], arr[i] j += 1 print(arr) if __name__ == "__main__": arr = [-1, 2, -3, 4, 5, 6, -7, 8, 9] n = len(arr) rearrange(arr, n)
3.59375
4
ml-agents/mlagents/envs/__init__.py
icaro56/ml-agents
134
12797620
from .environment import * from .brain import * from .exception import *
1.070313
1
src/parse_tree.py
yxtay/data-structures-algorithms
1
12797621
import operator OPERATORS = {"+": operator.add, "-": operator.sub, "*": operator.mul, "/": operator.truediv} LEFT_PAREN = "(" RIGHT_PAREN = ")" def build_parse_tree(expression): tree = {} stack = [tree] node = tree for token in expression: if token == LEFT_PAREN: node["left"] = {}...
3.5
4
MakeMytripChallenge/script/edalevel1.py
divayjindal95/DataScience
0
12797622
<reponame>divayjindal95/DataScience import numpy as np import pandas as pd import matplotlib.pylab as plt train_data = pd.read_csv("../data/train.csv") train_data_len=len(train_data) test_data=pd.read_csv("../data/test.csv") test_data_len=len(test_data) data=pd.concat(train_data,test_data) ## pd.read_csv("../data/tes...
3.09375
3
ntee/utils/abstract_db.py
studio-ousia/ntee
87
12797623
# -*- coding: utf-8 -*- import click import gzip import os import rdflib import re import urllib from collections import defaultdict from contextlib import closing from functools import partial from multiprocessing.pool import Pool from shelve import DbfilenameShelf from tokenizer import RegexpTokenizer class Abstr...
2.296875
2
mapfartapi/web.py
aaronr/mapfart
3
12797624
from flask import render_template def index(): return render_template('index.html') def documentation(): return render_template('documentation.html') def api_landing(): return render_template('api_landing.html')
1.929688
2
migrations/versions/07d04be1e961_add_a_bio_and_profile_pic_path_to_users_.py
WaruiAlfred/sixty-seconds-impression
0
12797625
<reponame>WaruiAlfred/sixty-seconds-impression """add a bio and profile pic path to users table Revision ID: 0<PASSWORD> Revises: <PASSWORD> Create Date: 2021-09-19 11:46:47.937931 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '<PASSWORD>' down_revision = '<P...
1.421875
1
setup.py
lopatinay/psycopg2_error_handler
0
12797626
<reponame>lopatinay/psycopg2_error_handler from setuptools import setup setup( name="psycopg2_error_handler", install_requires=[ "psycopg-binary >= 3.0", ], packages=["psycopg2_error"], version='0.0.4', description='Psycopg2 Error Handler', author='<NAME>', license='MIT', )
1.226563
1
subirarchivos/models.py
Ax-Angel/NuevoGeco
4
12797627
from django.conf import settings from django.db import models from .validators import validate_file_extension # Create your models here. class NormalProject(models.Model): name = models.CharField(max_length=100, null=False, unique=True) owner = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='owner_nor...
2.078125
2
model/synthesizer/ctabgan_synthesizer.py
Zepp3/CTAB-GAN
0
12797628
import numpy as np import pandas as pd import torch import torch.utils.data import torch.optim as optim from torch.optim import Adam from torch.nn import functional as F from torch.nn import (Dropout, LeakyReLU, Linear, Module, ReLU, Sequential, Conv2d, ConvTranspose2d, BatchNorm2d, Sigmoid, init, BCELoss, CrossEntropy...
2.265625
2
problem_solving/python/algorithms/bit_manipulation/sum_vs_xor.py
kcc3/hackerrank-solutions
0
12797629
def sum_xor(n): """Hackerrank Problem: https://www.hackerrank.com/challenges/sum-vs-xor/problem Given an integer n, find each x such that: 0 <= x <= n n + x = n ^ x Solve: We count the number of zeros that are in the binary representation of the integer, because for sum and xor to be ...
4.21875
4
backend/api/urls.py
ChansongJo/PsychoLingExperiment
0
12797630
<gh_stars>0 from django.urls import path, include from backend.api.views import bulkUploadFromFile urlpatterns = [ path('bulk_upload/', bulkUploadFromFile) ]
1.523438
2
jobs/r_programming/script.py
ivan-brko/GamayunConfigurationSample
0
12797631
import requests import json from bs4 import BeautifulSoup from gamayun.gamayun_utils import report_result_with_maps_only from gamayun.gamayun_utils import report_error from gamayun.gamayun_utils import run_gamayun_script_logic def parse_single_entry(entry): # test if this entry contains comment (if it doesn't it i...
2.859375
3
tests/funcionales/test_formularios.py
cacao-accounting/cacao-accounting-mockup
2
12797632
<reponame>cacao-accounting/cacao-accounting-mockup<gh_stars>1-10 # Copyright 2020 <NAME> # # 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.25
2
graphlets/utils.py
KirillShmilovich/graphlets
3
12797633
""" util.py Some utility functions """ import os import numpy as np from sklearn.neighbors import BallTree, radius_neighbors_graph import networkx as nx __all__ = ["ORCA_PATH", "pbc", "orbits", "weights", "compute_graph"] ORCA_PATH = os.path.abspath(os.path.abspath(__file__) + "../../../orca/orca.exe") def pbc(x0,...
2.734375
3
plugins/provider_video_ustvgo/lib/translations.py
cookieisland/cabernet
0
12797634
<reponame>cookieisland/cabernet # pylama:ignore=E203,E221 """ MIT License Copyright (C) 2021 ROCKY4546 https://github.com/rocky4546 This file is part of Cabernet Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal ...
1.492188
1
test/autocomplete.py
mrHola21/Eterm
12
12797635
<reponame>mrHola21/Eterm<gh_stars>10-100 import getpass import os_test import readline class MyCompleter: def __init__(self, options): self.options = sorted(options) def complete(self, text, state): if state == 0: if text: self.matches = [s for s in self.options ...
2.65625
3
logic.py
serkkz/PandaTools
1
12797636
from panda3d.core import Point3, TransformState, LQuaternion from panda3d.core import Camera, PerspectiveLens, OrthographicLens, CS_default, CS_zup_right, CS_yup_right, CS_zup_left, CS_yup_left, CS_invalid from panda3d.core import GeomVertexArrayFormat, Geom, GeomVertexFormat, GeomVertexData, GeomVertexWriter, Triangul...
1.9375
2
vulnerable_people_form/form_pages/postcode_eligibility.py
StephenGill/govuk-shielded-vulnerable-people-service
0
12797637
<filename>vulnerable_people_form/form_pages/postcode_eligibility.py<gh_stars>0 from flask import redirect, session from vulnerable_people_form.form_pages.shared.answers_enums import ApplyingOnOwnBehalfAnswers from .blueprint import form from .shared.render import render_template_with_title from .shared.routing import ...
2.59375
3
mmdet/models/roi_heads/bbox_heads/__init__.py
liuyanyi/mmdetection
0
12797638
from .bbox_head import BBoxHead from .convfc_bbox_head import (ConvFCBBoxHead, Shared2FCBBoxHead, Shared4Conv1FCBBoxHead) from .dii_head import DIIHead from .double_bbox_head import DoubleConvFCBBoxHead from .sabl_head import SABLHead from .scnet_bbox_head import SCNetBBoxHead from .rotat...
1.179688
1
hvodash/data.py
wtollett-usgs/dashboards
0
12797639
# -*- coding: utf-8 -*- import pandas as pd import plotly.graph_objs as go import requests from base64 import b64encode as be from dash_html_components import Th, Tr, Td, A from datetime import datetime, timedelta from flask import request from folium import Map from operator import itemgetter from os.path import join...
2.171875
2
clue2020-data-lab/predict_sequence_label.py
dedeguo/knowledge_graph_construction
0
12797640
#!/usr/bin/python # coding:utf8 """ @author: <NAME> @time: 2019-12-07 20:51 """ import os import re import json import tensorflow as tf import tokenization os.environ["CUDA_VISIBLE_DEVICES"] = "0" vocab_file = "./vocab.txt" tokenizer_ = tokenization.FullTokenizer(vocab_file=vocab_file) label2id = json.loads(open("./l...
2.515625
3
lib/cros_test_unittest.py
khromiumos/chromiumos-chromite
0
12797641
<filename>lib/cros_test_unittest.py # -*- coding: utf-8 -*- # Copyright 2019 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for CrOSTest.""" from __future__ import print_function import os import sys i...
2.046875
2
utils/utils.py
alphaccw/StereoNet
0
12797642
import os import torch def GERF_loss(GT, pred, args): mask = (GT < args.maxdisp) & (GT >= 0) # print(mask.size(), GT.size(), pred.size()) count = len(torch.nonzero(mask)) # print(count) if count == 0: count = 1 return torch.sum(torch.sqrt(torch.pow(GT[mask] - pred[mask], 2) + 4) /2 - 1)...
2.3125
2
data/DataManager.py
sash-a/CoDeepNEAT
28
12797643
import inspect import os def get_datasets_folder(): return os.path.join(get_data_folder(), "Datasets") def get_data_folder(): return os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
2.25
2
libv1/collate.py
hhaAndroid/miniloader
12
12797644
<reponame>hhaAndroid/miniloader<filename>libv1/collate.py # -*- coding: utf-8 -*- # ====================================================== # @Time : 20-12-26 下午4:42 # @Author : <NAME> # @Email : # @File : collate.py # @Comment: # ====================================================== import torch def defaul...
2.15625
2
AOC2018/day02.py
hbldh/AdventOfCode2016
0
12797645
from collections import Counter import difflib def _checksum(r): counter = Counter(r) return int(any([x == 2 for x in counter.values()])), int(any([x == 3 for x in counter.values()])) def _solve_1(rows): d = [_checksum(row) for row in rows] return sum([x[0] for x in d]) * sum([x[1] for x in d]) d...
3.25
3
sioinstagram/io/io_aiohttp.py
pohmelie/sioinstagram
3
12797646
import asyncio import functools import contextlib import aiohttp from ..protocol import Protocol from ..exceptions import InstagramError __all__ = ( "AioHTTPInstagramApi", ) class AioHTTPInstagramApi: def __init__(self, username, password, state=None, delay=5, proxy=None, loop=None, lock=None): i...
2.53125
3
common/utils.py
kosyfrances/crq_bot
5
12797647
import jinja2 def render(filename, context={}, error=None, path='templates'): if error: # Error should be a string if isinstance(error, str): context['error'] = error else: raise TypeError('Error message must be a string') return jinja2.Environment( load...
2.6875
3
src/compas_occ/geometry/curves/_curve.py
jf---/compas_occ
1
12797648
from compas.data import Data class Curve(Data): """Base class for all curves in this package."""
2.0625
2
p2db/p2db/ui.py
ne75/p2llvm-lib
0
12797649
<gh_stars>0 from prompt_toolkit import Application from prompt_toolkit.layout.containers import VSplit, HSplit, Window from prompt_toolkit.layout.layout import Layout from prompt_toolkit.layout import FormattedTextControl, WindowAlign from prompt_toolkit.key_binding import KeyBindings from prompt_toolkit.widgets import...
2.390625
2
archive/original_main.py
FDKevin0/Micro-Expression-with-Deep-Learning
249
12797650
<filename>archive/original_main.py import numpy as np import sys import math import operator import csv import glob,os import xlrd import cv2 import pandas as pd from sklearn.svm import SVC from collections import Counter from sklearn.metrics import confusion_matrix import scipy.io as sio from keras.models import Se...
2.0625
2