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 |
|---|---|---|---|---|---|---|
deepxde/maps/__init__.py | Orcuslc/deepxde | 8 | 40800 | <reponame>Orcuslc/deepxde<gh_stars>1-10
from __future__ import absolute_import
from .fnn import FNN
from .mfnn import MfNN
from .opnn import OpNN
from .resnet import ResNet
| 0.988281 | 1 |
app/hrcm/services/cli/output.py | bastienbot/hr-challenges-manager | 0 | 40801 | <gh_stars>0
"""
@desc Prints informations about the candidate : his/her profile and messages sent
@params candidate: instance of Candidate
"""
def show_candidate_informations(candidate):
print("## CANDIDATE PROFILE ##", end="\n\n")
print("Firstname: {}".format(candidate.firstname))
print("Lastname: {}".f... | 3.0625 | 3 |
thuum/__main__.py | nickcoutsos/thuum | 0 | 40802 | import argparse
import functools
import sys
from tornado import (
httpclient,
ioloop,
)
def add_package_to_path():
if not (__name__ == "__main__" and __package__ == ""):
return
import os
sys.path.append(os.path.abspath(os.path.join(
os.path.abspath(__file__),
"..",
... | 2.53125 | 3 |
Fletnix/apps/profiles/migrations/0009_whoiswatching_user_age.py | FuryAndRage/Fletnix | 0 | 40803 | # Generated by Django 3.1.2 on 2021-02-15 05:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0008_whoiswatching_person_avatar'),
]
operations = [
migrations.AddField(
model_name='whoiswatching',
na... | 1.710938 | 2 |
mautrix/client/state_store/sqlalchemy/mx_room_state.py | tulir/mautrix-appservice-python | 1 | 40804 | <filename>mautrix/client/state_store/sqlalchemy/mx_room_state.py
# Copyright (c) 2022 <NAME>
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import ann... | 2.09375 | 2 |
examples/api-samples/inc_samples/sample11.py | groupdocs-legacy-sdk/python | 0 | 40805 | <gh_stars>0
### This sample will show how programmatically create and post an annotation into document. How to delete the annotation
# Import of classes from libraries
from pyramid.renderers import render_to_response
from groupdocs.ApiClient import ApiClient
from groupdocs.AntApi import AntApi
from groupdocs.S... | 2.4375 | 2 |
Utils/MyIOutils.py | kostrzmar/SimpTextAlignPython | 0 | 40806 | from pathlib import Path
import os
import re
from decimal import Decimal
import csv
import numpy
from Utils import TextProcessingUtils
from Utils import DefinedConstants
def readEmbeddingsFromTxtFile(inFile):
w2v = {}
with open(inFile, "r") as f:
for l in f.readlines():
if not l.strip():
... | 2.625 | 3 |
sherpa_client/models/new_user.py | kairntech/sherpa-client | 0 | 40807 | from typing import Any, Dict, List, Type, TypeVar, Union, cast
import attr
from ..types import UNSET, Unset
T = TypeVar("T", bound="NewUser")
@attr.s(auto_attribs=True)
class NewUser:
""" """
password: str
permissions: List[str]
roles: List[str]
username: str
email: Union[Unset, str] = UNS... | 2.796875 | 3 |
agents/model_free_aup.py | alexander-turner/attainable-utility-preservation | 12 | 40808 | from ai_safety_gridworlds.environments.shared import safety_game
from collections import defaultdict
import experiments.environment_helper as environment_helper
import numpy as np
class ModelFreeAUPAgent:
name = "Model-free AUP"
pen_epsilon, AUP_epsilon = .2, .9 # chance of choosing greedy action in training... | 2.578125 | 3 |
model/aspp.py | Sp00nyMan/BackgroundMattingV2-TensorFlow | 75 | 40809 | import tensorflow as tf
from tensorflow.keras.models import Model, Sequential
from tensorflow.keras.layers import Conv2D, BatchNormalization, ReLU, GlobalAveragePooling2D, Dropout
class ASPP(Model):
def __init__(self, filters, dilation_rates=[3, 6, 9]):
super().__init__()
self.aspp1 = ASPPConv(fil... | 2.765625 | 3 |
app/main/User.py | simeonschuez/slurk | 0 | 40810 | from calendar import timegm
from flask_login import UserMixin, login_user
from datetime import datetime
import flask_socketio as sio
from .Permissions import Permissions
from .Token import Token
from .database import Database
from .Room import Room, ROOMS
from .Logger import Logger
from .. import config
from .Layout i... | 2.265625 | 2 |
tests/test_types.py | SupraSummus/petriish | 0 | 40811 | <filename>tests/test_types.py
from unittest import TestCase
from petriish.types import Resolver, TypeResolutionError, PolymorphicType, Record, Bytes
class TypesTestCase(TestCase):
def setUp(self):
self.resolver = Resolver()
def test_identity_bind(self):
x = PolymorphicType()
self.asse... | 2.703125 | 3 |
server/bench-wrk/hge_wrk_bench.py | gh-oss-contributor/graphql-engine-1 | 27,416 | 40812 | from sportsdb_setup import HGETestSetup, HGETestSetupArgs
from run_hge import HGE
import graphql
import multiprocessing
import json
import os
import docker
import ruamel.yaml as yaml
import cpuinfo
import subprocess
import threading
import time
import datetime
from colorama import Fore, Style
from plot import run_dash_... | 1.890625 | 2 |
cube_analysis/progressbar.py | e-koch/CubeAnalysis | 4 | 40813 |
import six
import time
import signal
import multiprocessing
from functools import partial
import numpy as np
from astropy.utils.console import (_get_stdout, isatty, isiterable,
human_file_size, _CAN_RESIZE_TERMINAL,
terminal_size, color_print, human... | 1.734375 | 2 |
core/migrations/0006_bidragfile.py | hultberg/innlevering | 0 | 40814 | <gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import core.models
class Migration(migrations.Migration):
dependencies = [
('core', '0005_auto_20150819_2009'),
]
operations = [
migrations.CreateModel(
name=... | 1.703125 | 2 |
pima-indians-diabetes.py | xavrb/kerasStuff | 0 | 40815 | import numpy
from keras.models import Sequential
from keras.layers import Dense
#loading pima indians dataset from the csv
# fix random seed for reproducibility
numpy.random.seed(7)
dataset = numpy.loadtxt(
"./data/pima-indians-diabetes.csv", delimiter=","
)
#split into input (X) and (Y) variables
X = dataset[:,... | 3.265625 | 3 |
warp/tests/test_import.py | NVIDIA/warp | 306 | 40816 | <filename>warp/tests/test_import.py
# Copyright (c) 2022 NVIDIA CORPORATION. All rights reserved.
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# dist... | 1.976563 | 2 |
rabbitai/migrations/versions/e37912a26567_security_converge_queries.py | psbsgic/rabbitai | 0 | 40817 | """security converge queries
Revision ID: e37912a26567
Revises: 42b4c9e01447
Create Date: 2020-12-16 12:15:28.291777
"""
# revision identifiers, used by Alembic.
revision = "e37912a26567"
down_revision = "42b4c9e01447"
from alembic import op
from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy.orm import Sess... | 2.03125 | 2 |
Encryption.PY/encrypt-md5.py | Phoebus-Ma/Python-Helper | 0 | 40818 | ###
# MD5 encryption example.
#
# License - MIT.
####
import os
import hashlib
# Main function.
def main():
# {
teststr = 'To be No.1'
hmd5 = hashlib.md5()
hmd5.update(teststr.encode(encoding = 'UTF-8'))
print('Source data:\t' + teststr)
print('Dest data:\t' + hmd5.hexdigest())
# }
# Program... | 2.921875 | 3 |
bohr/config/appconfig.py | giganticode/bohr-framework | 0 | 40819 | from dataclasses import dataclass
from typing import Optional
from bohr.config.pathconfig import PathConfig, load_config_dict_from_file
from bohr.fs import find_project_root
from bohr.util.paths import AbsolutePath
@dataclass(frozen=True)
class AppConfig:
verbose: bool
paths: PathConfig
@staticmethod
... | 2.46875 | 2 |
visigoth/charts/scatter/scatter.py | visigoths/visigoth | 0 | 40820 | <filename>visigoth/charts/scatter/scatter.py
# -*- coding: utf-8 -*-
# Visigoth: A lightweight Python3 library for rendering data visualizations in SVG
# Copyright (C) 2020-2021 Visigoth Developers
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software
# and associ... | 1.703125 | 2 |
createConfigYml.py | rajeevsathish/sunbird-devops | 0 | 40821 | import os
configVars = ['env','implementation_name','ssh_ansible_user','ansible_private_key_path','application_host','app_address_space','dns_name','proto','database_host','database_password','<PASSWORD>_admin_password','<PASSWORD>_password','trampoline_secret','backup_storage_key','badger_admin_password','<PASSWORD>g... | 2.078125 | 2 |
genetic_algorithm/mutation.py | mig029/SnakeAI | 181 | 40822 | <filename>genetic_algorithm/mutation.py
# 9.3.2
# 11.2.1
# 12.4.3
import numpy as np
from typing import List, Union, Optional
from .individual import Individual
def gaussian_mutation(chromosome: np.ndarray, prob_mutation: float,
mu: List[float] = None, sigma: List[float] = None,
... | 3.546875 | 4 |
api/admin.py | EstherWaweru/JuniorDeveloperTest | 1 | 40823 | <gh_stars>1-10
from django.contrib import admin
# Register your models here.
from django.contrib.auth.admin import UserAdmin
# Register your models here.
from api.models import CustomUser,Company
class UserModel(UserAdmin):
pass
admin.site.register(CustomUser,UserModel)
admin.site.register(Company)
| 1.695313 | 2 |
Webpage/arbeitsstunden/migrations/0015_auto_20210718_1006.py | ASV-Aachen/Website | 0 | 40824 | <gh_stars>0
# Generated by Django 3.2.5 on 2021-07-18 10:06
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('arbeitsstunden', '0014_auto_20210705_1948'),
]
operations = [
migrations.AlterF... | 1.578125 | 2 |
scripts/move_image_in_md.py | chqwer2/chqwer2.github.io | 0 | 40825 | <filename>scripts/move_image_in_md.py<gh_stars>0
import matplotlib.pyplot as plt
from glob import glob, iglob
import regex as re
import os
import numpy as np
path = 'C:\\Users\\calvchen\\PycharmProjects\\chqwer2.github.io\\_posts\\'
md_list = [os.path.join(dirpath, f)
for dirpath, dirnames, files in os.walk(path)... | 2.484375 | 2 |
core/phishingRunner.py | brucewayne00/SocialFish | 1 | 40826 | <gh_stars>1-10
######################################################
# #
# SOCIALFISH v2.0 #
# #
# by: UNDEADSEC #
# ... | 2.25 | 2 |
matplotlib/3.scatterplot.py | sudeep0901/python | 0 | 40827 | <filename>matplotlib/3.scatterplot.py<gh_stars>0
import matplotlib as mlp
import matplotlib.pyplot as plt
plt.style.use('seaborn-whitegrid')
import numpy as np
x = np.linspace(1, 10, 30)
y = np.sin(x)
plt.plot(x, y, 'D',color="red")
plt.show()
rng = np.random.RandomState(0)
for marker in ['o', '.', ',', 'x', '+', 'v... | 2.953125 | 3 |
src/backend/common/models/tests/team_test.py | guineawheek/ftc-data-take-2 | 266 | 40828 | import pytest
from backend.common.models.team import Team
from backend.common.models.tests.util import (
CITY_STATE_COUNTRY_PARAMETERS,
LOCATION_PARAMETERS,
)
@pytest.mark.parametrize("key", ["frc177", "frc1"])
def test_valid_key_names(key: str) -> None:
assert Team.validate_key_name(key) is True
@pyte... | 2.375 | 2 |
ReLERNN/imports.py | peterdfields/ReLERNN | 14 | 40829 | import glob
import pickle
import sys
import msprime as msp
import numpy as np
import os
import multiprocessing as mp
import shutil
import random
import copy
import argparse
import h5py
import allel
import time
from sklearn.neighbors import NearestNeighbors
from sklearn.utils import resample
import matplotlib as mpl
m... | 1.320313 | 1 |
tsadm/slave/urls.py | jctincan/tsadm-webapp | 0 | 40830 | <reponame>jctincan/tsadm-webapp
from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
url(r'^(\d+)/$', 'tsadm.slave.views.dashboard', name='dashboard'),
url(r'^admin/$', 'tsadm.slave.views.admin', name='admin'),
)
| 1.640625 | 2 |
custom_object.py | Jerbuck/content-playground | 0 | 40831 | import sys
username = None
password = <PASSWORD>
base_url = None
objects = []
class CustomObject(object):
"""Data class for custom object."""
def __init__(self):
self.username = None
self.password = <PASSWORD>
self.base_url = None
self.objects = []
def print(self):
... | 3.359375 | 3 |
web/streams/views/streamdetailview.py | CleyFaye/gtlive-info | 0 | 40832 | """Display stream details"""
from django.views.generic.detail import DetailView
from streams.models import Stream
class StreamDetailView(DetailView):
"""Display a stream info"""
model = Stream
| 2.078125 | 2 |
features/chat/markov.py | Gurulhu/Reborn | 0 | 40833 | import gurulhutils
import random
def init( keys ):
global db
status, database = gurulhutils.db_init( keys["Database"] )
db = database.get_collection("taylorswiftdb")
return status
def help():
return "Look what you made me do."
def recursion( word ):
c = db.find_one( { "_word" : word } )
po... | 2.734375 | 3 |
app/api.py | kkwteh/cal_hacks_flight_delays | 0 | 40834 | import os
from flask import Blueprint, request, jsonify
from math import exp
bp = Blueprint('app', __name__)
MODEL_COEFFICIENTS = {
'CarrierAA': -0.0019204985425103213,
'CarrierAS': -0.84841944514035605,
'CarrierB6': 0.12241821143901417,
'CarrierDL': -0.13261989508615579,
'CarrierEV': -0.010973177444743456,
'C... | 2.140625 | 2 |
zorro/__init__.py | tailhook/zorro | 15 | 40835 | from functools import wraps
from contextlib import contextmanager
from .core import Hub, gethub, Future, Condition, Lock, TimeoutError
__version__ = '0.2.a0'
__all__ = [
'Hub',
'gethub',
'sleep',
'Future',
'Condition',
'Lock',
]
def sleep(value):
gethub().do_sleep(value)
| 2.125 | 2 |
main.py | Grimmaldi/supergoaltracker | 0 | 40836 | from app import app
if __name__ == '__main__':
app = app.Session() | 1.28125 | 1 |
official/cv/c3d/src/evalcallback.py | mindspore-ai/models | 77 | 40837 | # Copyright 2022 Huawei Technologies Co., Ltd
#
# 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... | 1.757813 | 2 |
cmsplugin_blocks/models/slider.py | emencia/cmsplugin-blocks | 1 | 40838 | # -*- coding: utf-8 -*-
"""
======
Slider
======
A slideshow component which may be similar to Album but with difference that
a slide item can have HTML content.
Slide items are ordered from their ``order`` field value. Items with a zero
value for their order will be ordered in an almost arbitrary order (mostly
depen... | 2.453125 | 2 |
members_ownership/Rishav/data_prep_1.py | TeamEpicProjects/Customer-Prioritization-for-Marketing | 2 | 40839 | # This script merges and consolidates the beacons and sessions datasets into 1 dataset
from pandarallel import pandarallel
import pandas as pd
import datetime
import sys
import os
pandarallel.initialize(progress_bar=False, nb_workers=4)
base_path = os.path.dirname(os.path.realpath(__file__))
def df_in... | 2.84375 | 3 |
tpDcc/libs/python/web.py | tpDcc/tpDcc-libs-python | 1 | 40840 | <reponame>tpDcc/tpDcc-libs-python<filename>tpDcc/libs/python/web.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module that contains utility functions related with email
"""
from __future__ import print_function, division, absolute_import
import os
import webbrowser
try:
import urllib2 as urllib
except Im... | 2.71875 | 3 |
conference_notebooks/KDD_2019/notebooks/plasticc/rnn.py | jacobtomlinson/notebooks-extended | 1 | 40841 | <filename>conference_notebooks/KDD_2019/notebooks/plasticc/rnn.py
import pandas as pd
import numpy as np
import time
import tensorflow as tf
from tqdm import tqdm
class PlasticcRNN:
"""
An attentional bi-directional RNN used in the PLASTiCC Challenge
"""
def __init__(self,**params):
self.p... | 2.625 | 3 |
pymtl3/datatypes/bitstructs.py | kevinyuan/pymtl3 | 152 | 40842 | """
==========================================================================
bitstruct.py
==========================================================================
APIs to generate a bitstruct type. Using decorators and type annotations
to create bit struct is much inspired by python3 dataclass implementation.
Note ... | 3.46875 | 3 |
sec/share.py | srccircumflex/SefiTrash | 0 | 40843 | <filename>sec/share.py
# MIT License
#
# Copyright (c) 2022 <NAME> [srccircumflex]
#
# 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 the righ... | 2.046875 | 2 |
config.py | KadjelRamkisoen/vuddy | 34 | 40844 | import platform
"""
[Note for Windows]
- Use '\\' or '/' in path
Ex) gitStoragePath = "D:\\Source\\gitrepos"
- Install 'Git for Windows'
- Windows version of VUDDY use its own JRE
[Note for POSIX]
- Use '/' for path
Ex) gitStoragePath = "/home/ubuntu/gitrepos/"
- Java binary is only needed in POSIX
"""
gitStoragePat... | 2.453125 | 2 |
2009-01-03_datacenter-shared-host-migration/real.py | neoice/neoice-random | 0 | 40845 | #!/usr/bin/python
import os
import re
infile = open('domains', 'r')
outfile = open('output', 'a')
for line in infile:
line = line.strip('\n') # yank the newline off to make printing pretty and play nice with shell one-liners
x = os.system('host ' + line + ' | grep PREFIX.*')
if not x: # that system call returns 0... | 2.65625 | 3 |
design-patterns/structural/adapter.py | verthais/exercise-python | 0 | 40846 | class Korean:
"""Korean speaker"""
def __init__(self):
self.name = "Korean"
def speak_korean(self):
return "An-neyong?"
class British:
"""English speaker"""
def __init__(self):
self.name = "British"
#Note the different method name here!
def speak_english(self):
return "Hello!"
clas... | 4.28125 | 4 |
session-0/asym/std_asym.py | Ivan-Solovyev/data-analysis-tutorial | 1 | 40847 | from math import sqrt, pow
def std_asym_ostap(n1,n2):
return (VE(n1,n1).asym(VE(n2,n2))).error()
def std_asym_calc(n1,n2):
return 2.*n1*sqrt(1./n1+1./n2) /( n2*pow(n1/n2+1.,2))
print("n=100")
print(" ostap = " + str(std_asym_ostap(100,100)))
print(" calc. = " + str(std_asym_calc (100,100)))
| 3.46875 | 3 |
utils/surface.py | fsanges/glTools | 165 | 40848 | <filename>utils/surface.py<gh_stars>100-1000
import maya.cmds as mc
import maya.OpenMaya as OpenMaya
import glTools.utils.base
import glTools.utils.curve
import glTools.utils.component
import glTools.utils.mathUtils
import glTools.utils.matrix
import glTools.utils.shape
import glTools.utils.stringUtils
import math
d... | 2.453125 | 2 |
simulator/buzzer.py | ondiiik/meteoink | 2 | 40849 | <reponame>ondiiik/meteoink
from config import pins
from machine import Pin, PWM
from utime import sleep_ms
def play(*pattern):
if pins.BUZZER < 0:
return
for tone in pattern:
if isinstance(tone, int):
sleep_ms(tone)
else:
beeper = PWM(Pin(pins.BUZZER), f... | 2.75 | 3 |
formal_grammars/color.py | magnickolas/formal-grammars | 0 | 40850 | def green(text):
return f"\033[92m{text}\033[0m"
def yellow(text):
return f"\033[93m{text}\033[0m"
| 1.984375 | 2 |
p3/views/__init__.py | lordmauve/epcon | 0 | 40851 | <filename>p3/views/__init__.py
# -*- coding: UTF-8 -*-
from django import forms
from django import http
from django.conf import settings
from django.contrib import auth
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.... | 2.078125 | 2 |
xdwlib/struct.py | linxsorg/xdwlib | 0 | 40852 | #!/usr/bin/env python3
# vim: set fileencoding=utf-8 fileformat=unix expandtab :
"""struct.py -- Point and Rect
Copyright (C) 2010 <NAME> <<EMAIL>> All rights reserved.
This software is subject to the provisions of the Zope Public License,
Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
THI... | 3.03125 | 3 |
tests/graphql/objects/and_or_not_permissions/objects.py | karlosss/simple_api | 2 | 40853 | <reponame>karlosss/simple_api
from simple_api.adapters.graphql.graphql import GraphQLAdapter
from simple_api.adapters.utils import generate
from simple_api.object.actions import Action
from simple_api.object.datatypes import BooleanType
from simple_api.object.permissions import AllowNone, Not, AllowAll, Or, And
from t... | 1.945313 | 2 |
menpo3d/base.py | apapaion/menpo3d | 134 | 40854 | import os
from pathlib import Path
def menpo3d_src_dir_path():
r"""The path to the top of the menpo3d Python package.
Useful for locating where the data folder is stored.
Returns
-------
path : str
The full path to the top of the Menpo3d package
"""
return Path(os.path.abspath(__... | 3.0625 | 3 |
page_edits/migrations/0015_delete_howweworktext.py | webspace95/studyhelp | 0 | 40855 | # Generated by Django 3.0.4 on 2022-03-02 19:32
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('page_edits', '0014_delete_whatsappnumber'),
]
operations = [
migrations.DeleteModel(
name='HowWeWorkText',
),
]
| 1.382813 | 1 |
test/test_xdmf.py | ZhimingGuo/meshio | 0 | 40856 | <filename>test/test_xdmf.py<gh_stars>0
# -*- coding: utf-8 -*-
#
import pytest
import meshio
import helpers
import legacy_reader
import legacy_writer
vtk = pytest.importorskip("vtk")
lxml = pytest.importorskip("lxml")
test_set_full = [
helpers.tri_mesh,
helpers.triangle6_mesh,
helpers.quad_mesh,
hel... | 2.09375 | 2 |
climetlab/arguments/transformers.py | pmaciel/climetlab | 0 | 40857 | # (C) Copyright 2021 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernmenta... | 1.976563 | 2 |
2DShooting.py | ZippyCodeYT/Zippy_Codes | 64 | 40858 | from ursina import *
app = Ursina()
bg = Entity(model='quad', texture='assets\BG', scale=36, z=1)
window.fullscreen = True
player = Animation('assets\player', collider='box', y=5)
fly = Entity(model='cube', texture='assets\\fly1', collider='box',
scale=2, x=20, y=-10)
flies = []
def newFly():
new = dup... | 2.203125 | 2 |
Chess_project/v1_falha/__main__.py | xDanielz/python_exercicios_pessoais | 0 | 40859 | from python_exercicios_pessoais.Chess_project.func import *
onboard = on_the_board()
while True:
for c in [0, 1]:
see_board(onboard)
while True:
while True:
piece = str(input(f'{c} Peça: '))
if len(piece) == 2:
piece = piece[0].lower()... | 3.703125 | 4 |
account/views/user.py | NTUSA/fudez-app | 2 | 40860 | from django.shortcuts import get_object_or_404
from rest_framework import viewsets, permissions
from rest_framework.decorators import detail_route, list_route
from rest_framework.response import Response
from account.models import User
from account.serializers import UserSerializer, SimpleUserSerializer, FullUserSeria... | 1.953125 | 2 |
app/app_main.py | junhuanchen/MaixUI | 0 | 40861 | # This file is part of MaixUI
# Copyright (c) sipeed.com
#
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license.php
#
import time, gc
from core import agent
from ui_canvas import ui, print_mem_free
from ui_system_info import system_info
#from ui_catch import catch
#from ui_taskbar impo... | 1.90625 | 2 |
week3_assignment.py | snalahi/Python3-Specialization--Python-Basics | 0 | 40862 | <filename>week3_assignment.py
# rainfall_mi is a string that contains the average number of inches of rainfall in Michigan for every month (in inches)
# with every month separated by a comma. Write code to compute the number of months that have more than 3 inches of
# rainfall. Store the result in the variable num_rain... | 4.40625 | 4 |
language/orqa/ops/orqa_ops_test.py | Xtuden-com/language | 1,199 | 40863 | # coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | 2.25 | 2 |
vendor/tango_tree/config.py | marehr/veb-data-structures | 0 | 40864 | <filename>vendor/tango_tree/config.py
import os
import sys
# load binary_tree
path = os.path.abspath('..')
if path not in sys.path:
sys.path.append(path)
del path
| 1.796875 | 2 |
selfdrive/car/tesla/PCC_module.py | vandreykiv/openpilot | 0 | 40865 | from common.numpy_fast import clip, interp
from selfdrive.car.tesla.values import CruiseButtons
from selfdrive.config import Conversions as CV
import time
from common.params import Params
from cereal import car
ACCEL_MAX = 0.6 #0.6m/s2 * 36 = ~ 0 -> 50mph in 6 seconds
ACCEL_MIN = -3.5
_DT = 0.05 # 20Hz in our case,... | 2.421875 | 2 |
Main_3D.py | manand881/Ising_Model_3D | 2 | 40866 | # Ising Model in Python.
# 28-03-2019.
# Written by <NAME>.
# Python 3.7.
# NumPy has been installed and used in this project.
# Numba has been installed and used in this project.
# Tools used: Visual Studio Code, GitHub Desktop.
from Input_param_reader import Ising_input # Python Function in... | 2.59375 | 3 |
Firmware/adctest.py | sanielfishawy/ODrive | 1,068 | 40867 | <reponame>sanielfishawy/ODrive<gh_stars>1000+
import numpy as np
import matplotlib.pyplot as plt
adchist = [(0, 137477),
(1, 98524),
(2, 71744),
(3, 60967),
(4, 44372),
(5, 46348),
(6, 19944),
(7, 10092),
(8, 13713),
(9, 11182),
(10, 6903),
(11, 4072),
(12, 2642),
(13, 968),
(14, 296),
(15, 166),
(16, 17),
(17, 2),
(... | 2.015625 | 2 |
01-values-and-types.py | leogithubid/python3-programming | 0 | 40868 | <filename>01-values-and-types.py
print('hello world')
print(type(100))
print(type(3.14)) | 1.507813 | 2 |
rdr_service/model/questionnaire.py | all-of-us/raw-data-repository | 39 | 40869 | <reponame>all-of-us/raw-data-repository
from sqlalchemy import (
Boolean,
Column,
ForeignKey,
ForeignKeyConstraint,
Integer,
String,
UniqueConstraint,
)
from sqlalchemy import BLOB # pylint: disable=unused-import
from sqlalchemy.orm import relationship
from typing import List
from rdr_serv... | 2.40625 | 2 |
pybmrb/__init__.py | jonwedell/PyBMRB | 0 | 40870 | __all__ = ['csviz']
| 1.101563 | 1 |
src/preprocessing.py | ppisarski/DaaS-docker | 0 | 40871 | <gh_stars>0
import numpy as np
import pandas as pd
from src.features import *
def get_data():
train_data = pd.read_csv('../data/train.csv')
test_data = pd.read_csv('../data/test.csv')
return train_data, test_data
def main():
train_data, test_data = get_data()
train_data = impute_all_features(tr... | 2.65625 | 3 |
Python/Week2/regularExpression.py | CoSandu/PythonCourses | 0 | 40872 | import re
f = open(r'C:\Constantin\Corsi_Online\Python\regx.txt', 'r')
interi = []
tot = 0
for line in f:
x = re.findall('[0-9]+', line)
if x:
interi.append(x)
for val in interi:
for v in val:
tot = int(v) + tot
print tot
f.close()
| 3 | 3 |
concat/tests/strategies.py | jmanuel1/concat | 5 | 40873 | from concat.level1.typecheck.types import (
IndividualType,
SequenceVariable,
StackItemType,
)
from hypothesis.strategies import (
SearchStrategy,
booleans,
composite,
from_type,
iterables,
lists,
register_type_strategy,
sampled_from,
)
from typing import (
Iterable,
... | 2.3125 | 2 |
src/device/handler.py | OSLL/apagescan | 6 | 40874 | <reponame>OSLL/apagescan<filename>src/device/handler.py
import re
from itertools import chain
from src.utilities import exec_command, list_difference
class DeviceHandler:
"""Class to handle Android devices, connected to PC
:ivar __listeners: list of listeners - objects (implementing Listener interface), tha... | 2.828125 | 3 |
compass-api/G4SE/configurable_elastic_search_backend/backends.py | geometalab/G4SE-Compass | 0 | 40875 | <reponame>geometalab/G4SE-Compass<filename>compass-api/G4SE/configurable_elastic_search_backend/backends.py
from haystack.backends.elasticsearch_backend import ElasticsearchSearchBackend, ElasticsearchSearchEngine
class ConfigurableElasticBackend(ElasticsearchSearchBackend):
DEFAULT_ANALYZER = "snowball"
# r... | 2.0625 | 2 |
gda_sdm_functions.py | JannikHamperETH/conda | 0 | 40876 | <reponame>JannikHamperETH/conda
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 21 16:21:14 2019
@author: martinhe
"""
import numpy as np
import pandas as pd
from sklearn.neighbors.kd_tree import KDTree
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from shapely.geometry import Poin... | 3.078125 | 3 |
tensorflow/compiler/xla/service/gpu/tests/mnist.py | Stevanus-Christian/tensorflow | 1 | 40877 | <filename>tensorflow/compiler/xla/service/gpu/tests/mnist.py<gh_stars>1-10
# Copyright 2021 The TensorFlow Authors. 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
#
# ... | 2.078125 | 2 |
ShapeLearnerAPI/_server.py | DEKHTIARJonathan/ShapeLearnerAPI | 0 | 40878 | <filename>ShapeLearnerAPI/_server.py
################################# Loading config File ################################
import sys
sys.path.append('../Config/')
from loadConf import loadConf
################################# Import Libraries ################################
import os.path
import urllib2
import tim... | 2.53125 | 3 |
dlkit/json_/relationship/objects.py | UOC/dlkit | 2 | 40879 | <reponame>UOC/dlkit
"""JSON implementations of relationship objects."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods,too-few-public-methods
# Number of methods are defined in specification
# pylint: disable=protected-access
# Access to prote... | 2.40625 | 2 |
DFS_generator/Controls.py | AGH-Narzedzia-Informatyczne/Project_Labyrinth | 1 | 40880 | import pygame
import DFS_generator.mazeGenerator as mazeGenerator
def changePos(k1, k2, maze):
if (k1 == pygame.K_UP and k2 == pygame.K_RIGHT) or (k2 == pygame.K_UP and k1 == pygame.K_RIGHT):
print("NE")
if mazeGenerator.NE not in maze.player_cell.walls:
for c in maze.neighbours(maz... | 3.15625 | 3 |
blur.py | dragonfyre23/ENGR133PyTeamProject | 0 | 40881 | '''
===============================================================================
ENGR 133 Program Description
This function takes an image array, a size number and a blur value and returns an array that contains a blurred image
Assignment Information
Assignment: Python Group Project
Author: <NAME>, ... | 3.671875 | 4 |
Server/app/main/utils/token_utils.py | Niewidzialny84/PathFighters | 9 | 40882 | from .. import db
from app.main.model.token_blacklist_model import TokenBlackList
from .. import jwt
from app.main.schema.token_blacklist_schema import tokens_blacklist_schema
from datetime import datetime
@jwt.token_in_blocklist_loader
def check_if_token_revoked(jwt_header, jwt_payload):
""" Callback function to ... | 2.546875 | 3 |
djangae/test_runner.py | benvand/djangae | 0 | 40883 | from django.test.simple import DjangoTestSuiteRunner
class DjangaeTestSuiteRunner(DjangoTestSuiteRunner):
pass | 1.078125 | 1 |
simple_scheduler/jobs/curl_job.py | In2ItChicago/ndscheduler | 0 | 40884 | <filename>simple_scheduler/jobs/curl_job.py
"""A job to send a HTTP (GET or DELETE) periodically."""
import logging
import requests
from ndscheduler.corescheduler import job
logger = logging.getLogger(__name__)
class CurlJob(job.JobBase):
TIMEOUT = 30
@classmethod
def meta_info(cls):
return {
... | 2.859375 | 3 |
curves.py | scjurgen/function-curves | 0 | 40885 | import math
import re
import subprocess
# from math import *
import sys
with open('response.plot', "r") as f:
plotTemplate = f.read()
with open('response_multi.plot', "r") as f:
plotTemplateMulti = f.read()
indexhtml = '<head></head><body>'
def mathDict():
d = {
"pow": math.pow, "cos": math.cos,... | 2.5625 | 3 |
datahub_core/printable.py | grovesy/datahub | 67 | 40886 | <reponame>grovesy/datahub<filename>datahub_core/printable.py
from pprint import pformat
class Printable:
def __repr__(self):
return "<" + type(self).__name__ + "> " + pformat(vars(self), indent=4, width=1)
| 2.328125 | 2 |
jointly/synchronizer.py | hpi-dhc/jointly | 7 | 40887 | import os
from typing import Dict, Optional
import numpy as np
import pandas as pd
from scipy.signal import correlate
from . import ShakeExtractor, helpers
from .abstract_extractor import AbstractExtractor
from .helpers import normalize, get_equidistant_signals
from .log import logger
from .synchronization_errors imp... | 2.265625 | 2 |
Kivy/gui/crud.py | joao0710/primeiro-repo | 0 | 40888 | <filename>Kivy/gui/crud.py
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
class Principal(BoxLayout):
pass
class Crud(App):
def build(self):
return Principal()
Crud().run()
| 2.109375 | 2 |
za.py | zweed4u/residue | 0 | 40889 | #!/usr/bin/python
#sitekey: 6Lcm qwIT AAAA AD_8 PDdc M-9A hyft RNtF Xn1U 5e_8
import json, random, requests
def decrypt_1(cyphertext):
plaintext = ''
for letter in cyphertext:
letter = chr(ord(letter) - 1)
plaintext += letter
return plaintext
url = decrypt_1('iuuqt;00psefs/epnjopt/dpn0qpxfs0hjgudbse.cbmbodf')
... | 2.640625 | 3 |
cp-classes/1s2020/contests/contests/06-03/d.py | oleonardolima/problem-solving | 0 | 40890 | from collections import deque, defaultdict
num_snacks = int(input())
snacks = deque([int(num) for num in input().split(" ")])
other_sizes = defaultdict(bool)
while snacks:
sizes_to_print = []
if snacks:
current_size = snacks.popleft()
#print(current_size)
if current_size == num_snacks:
... | 3.65625 | 4 |
lib/carbon/cache.py | zillow/carbon | 0 | 40891 | """Copyright 2009 <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 applicable law or agreed to in writing, software
distribut... | 2.203125 | 2 |
danbooru_dump/danbooru_dump_bulkdata_download_missing.py | danya02/booru-mirror-unified | 0 | 40892 | <filename>danbooru_dump/danbooru_dump_bulkdata_download_missing.py
import subprocess
import os
import sys
sys.path.append('..')
from database import *
import time
import random
import danbooru_dump_transfer_queue_into_redis_from_find
os.chdir('/hugedata/booru/danbooru_temp')
def download_content(id):
print ... | 2.25 | 2 |
backend/api/models/user_model.py | ferdn4ndo/infotrem | 0 | 40893 | <reponame>ferdn4ndo/infotrem
from uuid import uuid4
from django.contrib.auth.base_user import BaseUserManager, AbstractBaseUser
from django.contrib.auth.models import PermissionsMixin
from django.db import models
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from .location_s... | 2.234375 | 2 |
mirror/github/search.py | liammc98/mirror | 9 | 40894 | <filename>mirror/github/search.py
import os
import csv
import json
import time
import string
import traceback
import urllib.parse
from pathlib import Path
from typing import Optional, Tuple
import click
import requests
from ..settings import *
from .utils import forward_languages_config, request_with_limit
DATETIM... | 2.828125 | 3 |
beautiful_soup/page_parser.py | akellermann97/college-dump | 0 | 40895 | <reponame>akellermann97/college-dump<filename>beautiful_soup/page_parser.py
# Author: <NAME>
# Date: September 18th, 2018
# This is a placeholder file.
# In theory everything that has to do with beautifulsoup should find its way
# here in this file. This is where the parsing of the individual webpage should happen.
fr... | 3.671875 | 4 |
egs/spgispeech/ASR/local/compute_fbank_spgispeech.py | zhu-han/icefall | 0 | 40896 | #!/usr/bin/env python3
# Copyright 2022 Johns Hopkins University (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 License.
# You may obtain a... | 1.78125 | 2 |
mapUtils.py | caranha/GDMC_experiments | 14 | 40897 | # ! /usr/bin/python3
"""### Provides tools for maps and heightmaps
This module contains functions to:
* Calculate a heightmap ideal for building
* Visualise numpy arrays
"""
__all__ = ['calcGoodHeightmap']
# __version__
import cv2
import matplotlib.pyplot as plt
import numpy as np
def calcGoodHeightmap(worldSlice):... | 3.203125 | 3 |
vb2py/converter.py | ceprio/xl_vb2py | 0 | 40898 | """Wrapper around project converter to convert a project"""
from vb2py import projectconverter
if __name__ == '__main__':
projectconverter.main() | 0.875 | 1 |
ComputingAllSpectralIntegrals.py | llimonta/Alaska2014 | 0 | 40899 | <reponame>llimonta/Alaska2014<gh_stars>0
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from matplotlib.lines import Line2D
from scipy import interpolate
from scipy.integrate import trapz
from scipy.optimize import curve_fit
import itertools
#dictionary for plotting
color_line = {'Iron':'k','N... | 2.34375 | 2 |