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
src/sentry/api/bases/incident.py
overquota/sentry
1
12788751
from __future__ import absolute_import from sentry.api.bases.organization import OrganizationPermission class IncidentPermission(OrganizationPermission): scope_map = { 'GET': ['org:read', 'org:write', 'org:admin'], 'POST': ['org:write', 'org:admin'], 'PUT': ['org:write', 'org:admin'], ...
1.71875
2
python/003.py
Evergreen200/projecteuler
0
12788752
<filename>python/003.py<gh_stars>0 def is_prime(n): for i in range(2, int(n / 2) + 1): if n % i == 0 and n != i: return False return True def solution(n): for i in range(1, n): if n % i == 0: p = n // i if is_prime(p): return p if __name...
3.78125
4
model_src/black_white/bw_network/backward_model_direction.py
imbyjuli/blackboard-tensorflow-nrp
0
12788753
<reponame>imbyjuli/blackboard-tensorflow-nrp<filename>model_src/black_white/bw_network/backward_model_direction.py<gh_stars>0 from __future__ import absolute_import from __future__ import division from __future__ import print_function # Imports import numpy as np import tensorflow as tf import cv2 import csv from back...
2.34375
2
tests/scrubber/sensitive_string_scrubber_test.py
cgruber/make-open-easy
5
12788754
#!/usr/bin/env python # Copyright 2009 Google Inc. All Rights Reserved. """Tests for finding sensitive strings.""" __author__ = '<EMAIL> (<NAME>)' from google.apputils import resources from google.apputils import basetest from moe import config_utils from moe.scrubber import sensitive_string_scrubber import test_ut...
2.75
3
hypertrophy_dataset.py
dozsam13/LHYP
0
12788755
from torch.utils.data import Dataset from torchvision import transforms import torch class HypertrophyDataset(Dataset): def __init__(self, images, targets, device): self.images = images self.targets = targets self.device = device self.augmenter = transforms.Compose([ tr...
2.71875
3
constants.py
Kaoline/ShinobiTool
0
12788756
# file --constants.py-- waiting_message = "Opération en cours... Ça peut être long, et ça bloque la fenêtre." default_search_file = "Shinobis.txt" default_receivers_file = "Destinataires.txt" default_moles_file = "Ennemis.txt" default_message_file = "Message.txt" default_config_file = "Config.txt"
1.148438
1
hawser/errors.py
5elenay/hawser
4
12788757
class UserNotMonitoredError(Exception): """Raises when user not monitored.""" pass class LanyardException(Exception): """Raises when lanyard gives success false but we don't have a support for the exception.""" pass
2.03125
2
oecp/main/category.py
openeuler-mirror/oecp
0
12788758
# -*- encoding=utf-8 -*- """ # ********************************************************************************** # Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. # [oecp] is licensed under the Mulan PSL v1. # You can use this software according to the terms and conditions of the Mulan PSL ...
1.929688
2
src/bleanser/modules/firefox.py
karlicoss/bleanser
13
12788759
#!/usr/bin/env python3 from pathlib import Path from sqlite3 import Connection from bleanser.core import logger from bleanser.core.utils import get_tables from bleanser.core.sqlite import SqliteNormaliser, Tool class Normaliser(SqliteNormaliser): DELETE_DOMINATED = True MULTIWAY = True def __init__(sel...
2.21875
2
Problems/Two Pointers/easy/ReverseOnlyLetters/reverse_only_letters.py
dolong2110/Algorithm-By-Problems-Python
1
12788760
def reverseOnlyLetters(s: str) -> str: s = list(s) l, r = 0, len(s) - 1 while l < r: if not s[l].isalpha(): l += 1 elif not s[r].isalpha(): r -= 1 else: s[l], s[r] = s[r], s[l] l += 1 r -= 1 return ''.join(s)
3.5625
4
HarTex/cmds/censor.py
HTG-YT/hartex-discord.py
4
12788761
<filename>HarTex/cmds/censor.py import discord from discord.ext import commands import re import yaml from better_profanity import profanity from core.classes import * def is_zalgo_nickname_enabled(guild_id): with open(f'configurations/{guild_id}_config.yaml', 'r') as zalgo_prevention_enabled: accesso...
2.296875
2
day2/passValidator.py
IvantheDugtrio/adventofcode2020
0
12788762
<filename>day2/passValidator.py<gh_stars>0 #!/usr/bin/env python3 import sys validCount = 0 lineCount = 0 with open(sys.argv[1],'r') as fp: for line in fp: lineCount+=1 criteria = line.split(": ")[0] password = line.split(": ")[1].strip() keyChar = criteria.split(" ")[1] key...
3.703125
4
tests/utest/oxygen/test_oxygen_listener.py
vrchmvgx/robotframework-oxygen
0
12788763
<filename>tests/utest/oxygen/test_oxygen_listener.py from unittest import TestCase from unittest.mock import Mock, patch from oxygen import listener class OxygenListenerBasicTests(TestCase): def setUp(self): self.listener = listener() def test_listener_api_version_is_not_changed_accidentally(self): ...
2.578125
3
src/sendresults.py
ldolberg/the_port_ors_hdx
0
12788764
<reponame>ldolberg/the_port_ors_hdx<gh_stars>0 import pandas as pd import json def return_jsonlist(district,lat,lon,tag,json_list): # -- open 'Nepal_F_Tagged.csv' new_df = pd.read_csv('../data/Nepal/Nepal_F_Tagged.csv') total, percentage = total_percent_from_district_tag(district, tag, df) # -- get di...
3.078125
3
examples/basic/mesh_threshold.py
Gjacquenot/vtkplotter
7
12788765
<filename>examples/basic/mesh_threshold.py """ Extracts the cells where scalar value satisfies a threshold criterion. """ from vtkplotter import * doc = Text(__doc__) man = load(datadir+"man.vtk") scals = man.coordinates()[:, 1] + 37 # pick y coords of vertices man.pointColors(scals, cmap="cool") man.addScalarBar(...
2.875
3
coviddata.py
Paul567/MBCovidVaxTracker
0
12788766
import requests import json class CovidData: __data = [{}] __province = '' __population = -1 def __init__(self, province): self.__province = province.upper() reports = json.loads( requests.get( 'https://api.covid19tracker.ca/reports/province/' + ...
3.015625
3
helpscout/endpoints/endpoint.py
Gogen120/helpscout
0
12788767
from typing import Dict import requests import helpscout.exceptions as exc class Endpoint: """Base endpoint class.""" def __init__(self, client, base_url: str): """ Params: client: helpscout client with credentials base_url: url for endpoint """ self....
2.703125
3
geocamUtil/Installer.py
geocam/geocamUtilWeb
4
12788768
#!/usr/bin/env python # __BEGIN_LICENSE__ #Copyright (c) 2015, United States Government, as represented by the #Administrator of the National Aeronautics and Space Administration. #All rights reserved. # __END_LICENSE__ import os import logging import stat from glob import glob import shutil import itertools from g...
2.015625
2
train_model.py
olaals/end-to-end-RGB-pose-estimation-baseline
2
12788769
#from models.baseline_net import BaseNet import torch from data_loaders import * from image_dataloaders import get_dataloaders from loss import compute_ADD_L1_loss, compute_disentangled_ADD_L1_loss, compute_scaled_disentl_ADD_L1_loss from rotation_representation import calculate_T_CO_pred #from models.efficient_net im...
1.929688
2
stats.py
Vidar-Petersson/Gymnasiearbete
0
12788770
import pandas as pd import matplotlib.pyplot as plt import matplotlib.dates as mdates import seaborn as sns import numpy as np from misc import set_size from scipy import stats from scipy.interpolate import interp1d from pandas.plotting import table import statsmodels.api as sm df_knolls_grund = pd.read_csv("data-set...
2.46875
2
emotions.py
Omrigan/essay-writer
33
12788771
mat = [ 'сука', "блять", "пиздец", "нахуй", "<NAME>", "епта"] import random import re # strong_emotions = re.sub('[^а-я]', ' ', open('strong_emotions').read().lower()).split() def process(txt, ch): words = txt.split(" ") nxt = words[0] + ' ' i = 1 while i < len(words) - 1: if words[i - 1...
3.15625
3
sdkAutomator/sdkAutomator.py
chebroluharika/SDK_Automation_Generator
0
12788772
import fnmatch import executePythonResources import writeEndPointsFile import executeResources import changeLogGenerator import sys import os import shutil from datetime import datetime import json import git # if git module is not found, use 'pip install gitpython' resource_dict = { 'FC Networks': 'fc_net...
1.945313
2
src/openpersonen/contrib/demo/converters/ouder.py
maykinmedia/open-personen
2
12788773
from django.conf import settings from openpersonen.features.country_code_and_omschrijving.models import ( CountryCodeAndOmschrijving, ) from openpersonen.features.gemeente_code_and_omschrijving.models import ( GemeenteCodeAndOmschrijving, ) from openpersonen.utils.helpers import is_valid_date_format def conv...
2.078125
2
app/forms.py
samkreter/TigerBuilds-Website
0
12788774
from flask.ext.wtf import Form from wtforms import BooleanField, TextField, PasswordField, validators from wtforms.validators import DataRequired from flask_wtf.file import FileField class LoginForm(Form): first_name = TextField('first_name', validators=[DataRequired()]) last_name = TextField('first_name', val...
2.765625
3
vhoops/modules/on_call/ui/routes.py
yigitbasalma/vhoops
4
12788775
#!/usr/bin/python # -*- coding: utf-8 -*- from flask import Blueprint, render_template from flask_login import login_required from vhoops.modules.teams.api.controllers import get_all_teams_func from vhoops.modules.on_call.forms.new_on_call import NewOnCallSchedule on_call_router = Blueprint("on_call_router", __name...
2.203125
2
codes/Arms.py
imadaouali/bootstrapping-multi-armed-bandits
0
12788776
<reponame>imadaouali/bootstrapping-multi-armed-bandits """different classes of arms, all of them have a sample() method which produce rewards""" import numpy as np from random import random from math import sqrt,log,exp class Bernoulli: def __init__(self,p): # create a Bernoulli arm with mean p ...
3.46875
3
categorical/plot_sweep.py
remilepriol/causal-adaptation-speed
15
12788777
import os import pickle from collections import defaultdict import matplotlib import matplotlib.pyplot as plt import numpy as np import scipy.stats def add_capitals(dico): return {**dico, **{key[0].capitalize() + key[1:]: item for key, item in dico.items()}} COLORS = { 'causal': 'blue', 'anti': 'red', ...
2.640625
3
tests/v1tests/test_offices_view.py
Davidodari/POLITICO-API
1
12788778
from tests.v1tests import BaseTestCase import json class OfficeEndpointsTestCase(BaseTestCase): def test_create_office(self): """Tests valid data POST Http method request on /offices endpoint""" # Post, uses office specification model response = self.client.post('api/v1/offices', data=jso...
2.875
3
validate_signature/serializers.py
Arquitectura-de-Software-UFPS-2022-I/-validate-signature-api-documentation-
0
12788779
from rest_framework import serializers class ValidateSerializer(serializers.Serializer): class_label = serializers.IntegerField() confidence = serializers.FloatField()
1.890625
2
my_phonolammps/_lammps.py
araghukas/my-phonolammps
1
12788780
<reponame>araghukas/my-phonolammps<filename>my_phonolammps/_lammps.py """Here the original lammps class is wrapped to allow specifying the `modpath`""" from lammps import * from lammps import lammps class MyLammps(lammps): """new version of the lammps class""" # path to the directory containing liblammps.so ...
2.4375
2
jabledl/downloader.py
Yooootsuba/jabledl
10
12788781
<reponame>Yooootsuba/jabledl import time import requests import threading class Downloader: def __init__(self, segments, request_headers, requests_callback): self.threads = [] self.threads_count = 0 self.threads_limit = 50 self.segments = segments ...
3.15625
3
02 - Curso Em Video/Aula 15/E - 069.py
GabrielTrentino/Python_Basico
0
12788782
maior18 = 0 homens = 0 mulheres = 0 while True: idade = int(input('Digite a idade: ')) sexo = str(input('Qual o sexo? [H/M] ')).strip().upper()[0] if idade > 18: maior18 += 1 if sexo == 'H': homens += 1 if sexo == 'M' and idade < 20: mulheres += 1 opcao = str(...
3.734375
4
src/inmanta/compiler/help/explainer.py
inmanta/inmanta-core
6
12788783
""" Copyright 2018 Inmanta 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 ...
1.953125
2
pyorderedfuzzy/ofmodels/ofautoreg.py
amarszalek/PyOrderedFuzzyTools
0
12788784
<reponame>amarszalek/PyOrderedFuzzyTools # -*- coding: utf-8 -*- import numpy as np from pyorderedfuzzy.ofnumbers.ofnumber import OFNumber from pyorderedfuzzy.ofmodels.ofseries import OFSeries from scipy.optimize import minimize from pyorderedfuzzy.ofmodels.oflinreg import ofns2array, array2ofns from pyorderedfuzzy.of...
2.28125
2
rts/game_MC/model_unit_cmd_lstm.py
BOBSTK/ELF
0
12788785
<reponame>BOBSTK/ELF # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import torch import torch.nn as nn from torch.autograd import Variable from copy import deepcopy f...
1.929688
2
egs/librispeech/ASR/pruned_stateless_emformer_rnnt2/test_emformer.py
zhu-han/icefall
0
12788786
<reponame>zhu-han/icefall<gh_stars>0 #!/usr/bin/env python3 # Copyright 2022 Xiaomi Corp. (authors: <NAME>) # # See ../../../../LICENSE for clarification regarding multiple authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Li...
1.796875
2
cifar_imagenet/Attack_PGD_ResNet20.py
minhtannguyen/RAdam
0
12788787
# -*- coding: utf-8 -*- """ CW, FGSM, and IFGSM Attack CNN """ import torch._utils try: torch._utils._rebuild_tensor_v2 except AttributeError: def _rebuild_tensor_v2(storage, storage_offset, size, stride, requires_grad, backward_hooks): tensor = torch._utils._rebuild_tensor(storage, storage_offset, size...
1.960938
2
racing_models/dronet_NASNetMobileAPI.py
gengliangyu2008/Intelligent-Navigation-Systems
0
12788788
<gh_stars>0 from tensorflow.keras import Model from tensorflow.python.keras.applications import NASNetMobile class Dronet(Model): def __init__(self, num_outputs, include_top=True): super(Dronet, self).__init__() self.include_top = include_top self.create_model(num_outputs) def call(se...
2.703125
3
any_all.py
VladimirsHisamutdinovs/Advanced_Python_Operations
0
12788789
<reponame>VladimirsHisamutdinovs/Advanced_Python_Operations<filename>any_all.py def valid_rgb(rgb): #check if rgb input tuple is within 0-255 for val in rgb: if not 0 <= val <= 255: return False return True # print(valid_rgb((255, 100, 255))) # print(valid_rgb((255, 100, 256)...
3.9375
4
records/fib_rec.py
Aniket-Wali/Measure-Of-Document-Similarities-MODS-
0
12788790
<reponame>Aniket-Wali/Measure-Of-Document-Similarities-MODS- @profile def nthfib(n): if n <= 0: return 0 elif n == 1: return 1 else: return nthfib(n-1) + nthfib(n-2) for i in range(1,11): print(nthfib(i))
3.296875
3
download_model.py
kylebarz/udacity-item-classifier
0
12788791
<gh_stars>0 from io import BytesIO from urllib.request import urlopen from zipfile import ZipFile download_url = 'https://productid.azurewebsites.net/static/model_download/checkpoint-19.zip' with urlopen(download_url) as zipresp: with ZipFile(BytesIO(zipresp.read())) as zfile: zfile.extractall('mo...
2.59375
3
projects/Project 2 - Disaster Response Pipeline/data/process_data.py
xscbsx/Udacity_Nanodegree_DS
0
12788792
<filename>projects/Project 2 - Disaster Response Pipeline/data/process_data.py import sys import numpy as np import pandas as pd import matplotlib.pyplot as plt from sqlalchemy import create_engine def load_data(messages_filepath, categories_filepath): ''' Load two datasets called categories and messages. ...
3.359375
3
dynamite.py
coolioasjulio/Rock-Paper-Scissors-Royale
0
12788793
<filename>dynamite.py # RPS Bot import trutheyfalseybot as tfb name = 'dynamite' class RPSBot(object): name = name def __init__(self): self.bot = tfb.RPSBot() def get_hint(self, op_hist, my_hist): if not len(op_hist): return "S" if op_hist[0] == ['S', 'S']: ...
2.828125
3
day16.py
danvk/advent2019
3
12788794
<gh_stars>1-10 #!/usr/bin/env python import fileinput import time import numpy as np BASE_PATTERN = [0, 1, 0, -1] def digits(x): return np.asarray([int(d) for d in str(x)]) def fft(inputs): N = len(inputs) # cumsum = [0] * N # cumsum[0] = inputs[0] # for i in range(1, N): # cumsum[i]...
2.6875
3
python/moveZeroToTheEnd.py
raulpy271/challengeMe
3
12788795
<reponame>raulpy271/challengeMe # Description: https://www.codewars.com/kata/52597aa56021e91c93000cb0 def isZero(value): typeOfValue = type(value).__name__ if typeOfValue == 'int' or typeOfValue == 'float': if value == 0 or value == 0.0: return True return False def count_zeros(list): ...
3.609375
4
sample_problems/problems_with_solution100.py
adi01trip01/adi_workspace
0
12788796
# Write a Python program to get the name of the host on which the routine is running. import socket host_name = socket.gethostname() print("Host name:", host_name)
3.046875
3
poetry/mixology/graph/add_vertex.py
batisteo/poetry
0
12788797
from .action import Action from .vertex import Vertex _NULL = object() class AddVertex(Action): def __init__(self, name, payload, root): super(AddVertex, self).__init__() self._name = name self._payload = payload self._root = root self._existing_payload = _NULL s...
2.640625
3
tests/collections/reconstruction/fastmri/conftest.py
jerke123/mridc
0
12788798
# encoding: utf-8 __author__ = "<NAME>" # Parts of the code have been taken from https://github.com/facebookresearch/fastMRI import numpy as np import pytest import torch from tests.collections.reconstruction.fastmri.create_temp_data import create_temp_data # these are really slow - skip by default SKIP_INTEGRATION...
2.3125
2
SimHash/SimHashBuckets.py
gister9000/Big-Data
0
12788799
<filename>SimHash/SimHashBuckets.py import sys from hashlib import md5 B = 8 # number of buckets hashlen = 128 # md5 128 bits Bsize = 16 # 128 / 8 = 16 bits lines = sys.stdin.read().splitlines() N = int( lines[0] ) Q = int( lines[ N+1 ] ) texts = lines[ 1 : N+1 ] queries = lines[ N+2 : N+2+Q ] simhashes = [ ] can...
2.890625
3
docs/mcpi/mcsim-klasy/mcsym.py
damiankarol7/python101
44
12788800
<filename>docs/mcpi/mcsim-klasy/mcsym.py #!/usr/bin/env python # -*- coding: utf-8 -*- class Symulacja(object): """ Klasa pomocnicza. Pozwala odseparować kod. """ mc = None # obiekt reprezentujący serwer MC block = None # obiekt reprezentujący dostępne bloki def __init__(self, mc, block): ...
2.59375
3
cogs/moderation.py
spicydragonroll/Mr.-Humpbottom
0
12788801
import discord from discord import Forbidden from discord.ext import commands from discord.http import Route from utils import checks MUTED_ROLE = "316134780976758786" class Moderation: def __init__(self, bot): self.bot = bot self.no_ban_logs = set() @commands.command(hidden=True, pass_cont...
2.390625
2
custom_components/tibber_custom/__init__.py
niklasosth/home_assistant_tibber_custom
0
12788802
"""Tibber custom""" import logging import homeassistant.helpers.config_validation as cv import voluptuous as vol from homeassistant.const import EVENT_HOMEASSISTANT_START from homeassistant.helpers import discovery DOMAIN = "tibber_custom" CONF_USE_DARK_MODE = "use_dark_mode" CONFIG_SCHEMA = vol.Schema({ DOMAI...
2.09375
2
lab-day/LabDayBackend/labday_api/apps.py
JanStoltman/LabDayBackend
1
12788803
from django.apps import AppConfig class LabdayApiConfig(AppConfig): name = 'labday_api'
1.078125
1
examples/tests/test_examples.py
avanwyk/cipy
1
12788804
<filename>examples/tests/test_examples.py # Copyright 2016 <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 # # Unless required by applica...
2.109375
2
msg/apps.py
trym-inc/django-msg
7
12788805
<filename>msg/apps.py from django.apps import AppConfig class MsgConfig(AppConfig): name = 'msg' def ready(self): # Make sure that handlers are registered when django is ready from .settings import msg_settings msg_settings.import_setting('handlers')
1.835938
2
sdk/python/pulumi_aws/ec2/subnet_cidr_reservation.py
chivandikwa/pulumi-aws
0
12788806
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** 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, Union, overload from .. import...
2.203125
2
complier-for-retards.py
bossjaylen145/trojan
1
12788807
import os def complier(): print("If ur using this ur so dumb on god just read the install instructions!\n" "PLEASE HAVE THE requirements.txt FILE IN THE SAME DIRECTORY!!!!") os.system("pip install -r requirements.txt") def cleanup(): cmds = ["RD __pycache__ /Q /S", ...
2.984375
3
examples/LSTM_classification.py
xhpxiaohaipeng/xhp_flow_frame
2
12788808
<filename>examples/LSTM_classification.py import os from xhp_flow.nn.node import Placeholder,Linear,Sigmoid,ReLu,Leakrelu,Elu,Tanh,LSTM from xhp_flow.optimize.optimize import toplogical_sort,run_steps,forward,save_model,load_model,Auto_update_lr,Visual_gradient,Grad_Clipping_Disappearance,SUW,\ SGD,\ Momentum,\ Adagra...
2.640625
3
astro_fixer.py
boada/scripts
0
12788809
import subprocess import os def hms2decimal(RAString, delimiter): """Converts a delimited string of Hours:Minutes:Seconds format into decimal degrees. @type RAString: string @param RAString: coordinate string in H:M:S format @type delimiter: string @param delimiter: delimiter character in RASt...
3.34375
3
BlogProject/urls.py
JinitSan/Blog-App
0
12788810
<reponame>JinitSan/Blog-App """BlogProject URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', view...
2.953125
3
basiccomfundamental/List2.py
KApilBD/python
0
12788811
<filename>basiccomfundamental/List2.py aList = [0,1,2,3,4,5] bList = aList aList[2] = 'hello' print(aList == bList) print(aList is bList) print(aList) print(bList) cList = [6,5,4,3,2] dList = [] for num in cList: dList.append(num) print(cList == dList) #validate the contain only print(cL...
3.828125
4
python/backup.py
R-Varun/Sentimeter
0
12788812
<reponame>R-Varun/Sentimeter<gh_stars>0 import sys import json import parse import contextsummary import SentimentAnalysis data = parse.parseInput(sys.argv[1]) #data = input.readBody() input = data[0] granularity = data[2] begin = int(granularity[0]) end = int(granularity[1]) stride = data[3] if begin is -1 or end ...
2.40625
2
multitest_transport/ui2/main.py
maksonlee/multitest_transport
0
12788813
# Copyright 2019 Google LLC # # 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.804688
2
flags-dest/train_with_globals.py
lambdaofgod/examples
9
12788814
learning_rate = 0.01 epochs = 10 print("Training for %i epochs with a learning rate of %f" % (epochs, learning_rate))
2.921875
3
app/migrations/0004_auto_20190110_1501.py
wusri66666/room_order
0
12788815
# -*- coding: utf-8 -*- # Generated by Django 1.11.7 on 2019-01-10 07:01 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('app', '0003_auto_20190110_1037'), ] operations = [ migrations.RenameModel( ...
1.609375
2
fridge/Constituent/Constituent.py
ryanstwrt/FRIDGE
0
12788816
<filename>fridge/Constituent/Constituent.py import fridge.Material.Material as materialReader import fridge.utilities.mcnpCreatorFunctions as mcnpCF class Constituent(object): """Base class for creating an assembly constituent.""" def __init__(self, unit_info, void_percent=1.0): """Initializes the da...
2.8125
3
vsts/vsts/feed/v4_1/models/package_dependency.py
kenkuo/azure-devops-python-api
0
12788817
<reponame>kenkuo/azure-devops-python-api # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # ---------------------------...
1.945313
2
cocrawler/fetcher.py
machawk1/cocrawler
0
12788818
''' async fetching of urls. Assumes robots checks have already been done. Supports server mocking; proxies are not yet implemented. Success returns response object and response bytes (which were already read in order to shake out all potential network-related exceptions.) Failure returns enough details for the call...
2.453125
2
spatialpandas/tools/__init__.py
isabella232/spatialpandas
0
12788819
<gh_stars>0 from .sjoin import sjoin
1.0625
1
brax/envs/doublehumanoid.py
carolinewang01/brax
0
12788820
# Copyright 2021 The Brax Authors. # # 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 t...
2.390625
2
app_iza.py
Sharmaxz/instabot.py
2
12788821
<reponame>Sharmaxz/instabot.py #!/usr/bin/env python # -*- coding: utf-8 -*- import os import dotenv from src.location.extract_location import get_locations_id BASE_DIR = os.path.dirname(os.path.abspath(__file__)) dotenv.load_dotenv(os.path.join(BASE_DIR, '.env')) from src import InstaBot location_ids = get_locatio...
2.34375
2
exercises/exercise4/image-downloader/downloader.py
jackxxu/2020F-AC295
0
12788822
<gh_stars>0 import sys import os import requests import time import shutil from selenium import webdriver def download_google_images(search_term_list = ["tomato", "bell pepper"], num_images_requested = 10): print("download_google_images...") start_time = time.time() # Setup download folder downloads =...
3.203125
3
atalaia/explore.py
vallantin/atalaia
0
12788823
# TODOS #-------------------------------------- # imports import matplotlib.pyplot as plt from atalaia.atalaia import Atalaia import numpy as np import networkx as nx class Explore: """Explore is used for text exploratory tasks. """ def __init__(self, language:str): """ Parameters ...
3.625
4
tests/test_io.py
gerritholl/sattools
0
12788824
"""Test I/O related functionality.""" import tempfile import os import pathlib def test_cache_dir(): """Test getting cache directory.""" from sattools.io import get_cache_dir with tempfile.TemporaryDirectory() as tmpdir: d = get_cache_dir(tmpdir, "tofu") assert str(d.parent) == tmpdir ...
2.40625
2
escalate/rest_api/tests/model_tests/organization/person.py
darkreactions/ESCALATE
11
12788825
<reponame>darkreactions/ESCALATE from ..model_tests_utils import ( status_codes, DELETE, PUT, POST, GET, ERROR, random_model_dict, check_status_code, compare_data ) from core.models import ( Organization, Person, Actor ) person_test_data = { 'person_test_0':{ ...
2.09375
2
grr/server/grr_response_server/check_lib/__init__.py
khanhgithead/grr
4,238
12788826
<reponame>khanhgithead/grr #!/usr/bin/env python """This is the check capabilities used to post-process host data.""" # pylint: disable=g-import-not-at-top,unused-import from grr_response_server.check_lib import checks from grr_response_server.check_lib import hints from grr_response_server.check_lib import triggers
0.964844
1
Sandbox/gatherSV_zinfo.py
echaussidon/LSS
8
12788827
''' gather redshift info across all observations for a given target type; for now from a single tile ''' #test #standard python import sys import os import shutil import unittest from datetime import datetime import json import numpy as np import fitsio import glob import argparse from astropy.table import Table,join...
2.453125
2
module03_research_data_in_python/greengraph/map.py
marquesafonso/rse-course
0
12788828
<gh_stars>0 import numpy as np from io import BytesIO import imageio as img import requests class Map: def __init__( self, lat, long, satellite=True, zoom=10, size=(400, 400), sensor=False ): base = "https://static-maps.yandex.ru/1.x/?" params = dict( z=zoom, ...
3.171875
3
utils.py
yiluzhu/gomoku
1
12788829
from constants import P2P_PIXELS, PIECE_RADIUS_PIXELS, BOARD_SIZE def index_to_pixel(x): """Given a point index, return the corresponding pixel. The Index can be either row or column""" return P2P_PIXELS + P2P_PIXELS * x def pixels_to_indices(pixel_x, pixel_y): """Given a point pixels, go throu...
3.609375
4
OpenCVVideoFunctions/video4.py
zopagaduanjr/Microprocessor_Project
0
12788830
import cv2 import numpy as np cap = cv2.VideoCapture('grace4.mp4') def make_360p(): cap.set(3, 480) cap.set(4, 360) def rescale_frame(frame): percent = 25; width = int(frame.shape[1] * percent/100) height = int(frame.shape[0] * percent/100) dim = (width, height) return cv2.resize(frame, d...
2.75
3
bin/iamonds/hexiamonds-4x9.py
tiwo/puzzler
0
12788831
#!/usr/bin/env python # $Id$ """74 solutions""" import puzzler from puzzler.puzzles.hexiamonds import Hexiamonds4x9 puzzler.run(Hexiamonds4x9)
0.996094
1
run_novalid.py
zerebom/santander
0
12788832
<filename>run_novalid.py<gh_stars>0 from scripts.data_augumation import augmation from sklearn.model_selection import KFold, StratifiedKFold from models.lgbm import train_and_predict_novalid from logs.logger import log_best from utils import load_datasets, load_target from sklearn.model_selection import train_test...
2.40625
2
source/constructor.py
janzmazek/Wave-propagation
1
12788833
""" This module constructs network of streets. """ import numpy as np import json # Adobe flat UI colour scheme DARK_BLUE = "#2C3E50" MEDIUM_BLUE = "#2980B9" LIGHT_BLUE = "#3498DB" RED = "#E74C3C" WHITE = "#ECF0F1" # Colour parameters STROKE_COLOUR = DARK_BLUE STREET_COLOUR = DARK_BLUE JUNCTION_COLOUR = MEDIUM_BLUE ...
3.6875
4
chunonline/apps/organization/foms.py
andanlove/chunonline
1
12788834
# _*_ coding: utf-8 _*_ import re __author__ = "andan" __data__ = "2018/9/22 12:44" from django import forms from operation.models import UserAsk class UserAskForm(forms.ModelForm): class Meta: model = UserAsk fields = ['name', 'moblie', 'course_name'] def clean_moblie(self): moblie...
2.53125
3
angr/engines/soot/expressions/phi.py
vwvw/angr
0
12788835
<reponame>vwvw/angr import logging from .base import SimSootExpr l = logging.getLogger('angr.engines.soot.expressions.phi') class SimSootExpr_Phi(SimSootExpr): def _execute(self): try: local = [self._translate_value(v) for v, idx in self.expr.values if idx == self.state.scratch.source.block...
2.03125
2
src/nextstep_plist/__init__.py
techdragon/python-nextstep-plist
1
12788836
<filename>src/nextstep_plist/__init__.py from nextstep_plist.decoder import PListDecoder __version__ = "0.1.0" __all__ = [ 'load', 'loads', 'PListDecoder', ] _default_decoder = PListDecoder() def load(fp): """Deserialize ``fp`` (a ``.read()``-supporting file-like object containing a NeXTSTEP proper...
2.25
2
src/models/main.py
bh1995/mnist_cookiecutter
0
12788837
<filename>src/models/main.py # -*- coding: utf-8 -*- """ Created on Fri Jun 4 13:01:26 2021 @author: bjorn main script to call and run all functions from for mnist_cookiecutter """ # from google.colab import files import sys import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as o...
2.65625
3
ref/files/student.py
skrymets/python-core-and-advanced
0
12788838
class Student: def __init__(self,id,name,testscore): self.id = id self.name = name self.testscore = testscore def display(self): print(self.id,self.name,self.testscore)
3.21875
3
run/sb3_NeedlePick_tester.py
rokas-bendikas/SurRoL
0
12788839
<gh_stars>0 import gym import surrol import numpy as np from matplotlib import pyplot as plt import time from stable_baselines3 import DDPG,PPO,TD3, HerReplayBuffer, VecHerReplayBuffer from stable_baselines3.common.noise import NormalActionNoise from stable_baselines3.common.vec_env import DummyVecEnv, VecNormalize, ...
1.976563
2
core/recc/core/mixin/context_permission.py
bogonets/answer
3
12788840
<filename>core/recc/core/mixin/context_permission.py # -*- coding: utf-8 -*- from typing import List, Optional, Any, Union from recc.core.mixin.context_base import ContextBase from recc.database.struct.permission import Permission from recc.packet.permission import RawPermission from recc.packet.cvt.permission import ...
1.960938
2
tl_env/envs/double_goal.py
mhtb32/tl-env
1
12788841
<reponame>mhtb32/tl-env<filename>tl_env/envs/double_goal.py from typing import Dict, Tuple from highway_env.envs.common.abstract import Observation from highway_env.envs.common.action import Action from highway_env.road.objects import Landmark from tl_env.envs.single_goal import SingleGoalIDMEnv class DoubleGoalEnv...
2.8125
3
ecdc_status/upcoming_events/admin.py
ess-dmsc/ecdc-status
0
12788842
<reponame>ess-dmsc/ecdc-status<filename>ecdc_status/upcoming_events/admin.py from django.contrib import admin from django.utils import timezone from .models import EventIcon, Event from django.utils.translation import gettext_lazy as _ class FilterOld(admin.SimpleListFilter): title = _('future events') # Par...
2.328125
2
run_participants.py
tbenne10/TopographicSurveyAnalysis
0
12788843
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #This script scores results from each student #Drawn images are downloaded from a .csv file, converted from string base64 encoding, #and scored against machine learning models saved to disk import csv import os #import file import cv2 import re import base64 import nump...
3.5
4
journalClub/polls/views.py
chabanr/journalClub
0
12788844
<filename>journalClub/polls/views.py from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse, HttpResponseRedirect from django.template import loader from django.http import Http404 from django.urls import reverse from .models import Question # Create your views here. # # def in...
2.609375
3
mandarin/parser.py
joegasewicz/amber
2
12788845
from typing import Tuple, Union, Dict, Optional, Any import re from mandarin.core import ELEMENTS class NodeHasNoValueError(Exception): pass class Parser: def __init__(self): pass @staticmethod def remove_white_space(value: str) -> str: cleaned_val = value.lstrip() # TODO ...
3.015625
3
tests/test_foo.py
AlexDev-py/vkquick
1
12788846
def test_run(): import vkquick assert True
1.085938
1
api/letter_templates/tests/tests_view.py
django-doctor/lite-api
3
12788847
<gh_stars>1-10 from api.letter_templates.helpers import format_user_text from rest_framework import status from rest_framework.reverse import reverse from api.cases.enums import AdviceType, CaseTypeReferenceEnum from api.cases.enums import CaseTypeSubTypeEnum, CaseTypeEnum from api.staticdata.decisions.models import D...
2.3125
2
8723 Patyki.py
jangThang/Baekjoon-problem
0
12788848
<reponame>jangThang/Baekjoon-problem # 입력 a, b, c = map(int, input().split()) # 판별 후 출력 if a == b == c: # 정삼각형 유무 print(2) # 직각 삼각형 유무 elif a**2 == b**2 + c**2 or b**2 == a**2 + c**2 or c**2 == a**2 + b**2: print(1) # 모두 불가능 else: print(0)
3.234375
3
core/train.py
kianakiaei/TSGL-EEGNet
0
12788849
<reponame>kianakiaei/TSGL-EEGNet # coding:utf-8 import os import gc import sys import math import copy import time import logging import itertools import numpy as np from numpy.core.numeric import cross import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.python.keras.api._v2.keras import backend as...
1.976563
2
anomaly_tuning/__init__.py
albertcthomas/anomaly_tuning
40
12788850
<filename>anomaly_tuning/__init__.py from .tuning import anomaly_tuning # noqa from . import estimators # noqa
1.132813
1