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
multi_traductor.py
Jalagarto/translator
0
15200
<reponame>Jalagarto/translator #!/usr/bin/python3 import tkinter as tk from tkinter import messagebox as msg from tkinter.ttk import Notebook from tkinter import ttk import tkinter.font as font import requests class LanguageTab(tk.Frame): def __init__(self, master, lang_name, lang_code): super().__init_...
2.921875
3
root/settings/__init__.py
daniel-waruo/e-commerse-api
6
15201
""" This is a django-split-settings main file. For more information read this: https://github.com/sobolevn/django-split-settings Default environment is `development`. To change settings file: `DJANGO_ENV=production python manage.py runserver` """ import django_heroku from split_settings.tools import include base_set...
1.335938
1
Dataset/Leetcode/train/125/245.py
kkcookies99/UAST
0
15202
<reponame>kkcookies99/UAST class Solution: def XXX(self, s: str) -> bool: i=0 j = len(s)-1 #lower()把所有大写字母改成小写,其余不变 s = s.lower() while i<j: while not(97 <= ord(s[i]) <= 122 or 48 <= ord(s[i]) <= 57): if i == j: return True ...
2.84375
3
testapp/urls.py
danigosa/django-simple-seo
11
15203
from django.conf.urls import patterns, url, include from django.contrib import admin from django.conf import settings from django.contrib.staticfiles.urls import staticfiles_urlpatterns from .views import template_test urlpatterns = patterns( '', url(r'^test/', template_test, name='template_test'), url(r...
2.03125
2
continual_learning/scenarios/utils.py
jaryP/ContinualAI
0
15204
from typing import Sequence, Union import numpy as np from scipy.ndimage.interpolation import rotate as np_rotate from PIL.Image import Image from torch import Tensor, tensor from torchvision.transforms.functional import rotate class ImageRotation(object): def __init__(self, degree): self.degree = degree...
2.640625
3
d_graph.py
MohamedAl-Hussein/pyGraphs
0
15205
# Course: CS261 - Data Structures # Author: <NAME> # Assignment: 06 # Description: Directed graph implementation. from collections import deque import heapq class DirectedGraph: """ Class to implement directed weighted graph - duplicate edges not allowed - loops not allowed - only positive edge w...
3.9375
4
src/code_submission/2_pasanju/preprocessing/prepredict.py
NehzUx/AutoGraph-KDDCup2020
1
15206
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time: 2020/5/14 20:41 # @Author: Mecthew import time import numpy as np import pandas as pd import scipy from sklearn.svm import LinearSVC from sklearn.linear_model import logistic from sklearn.calibration import CalibratedClassifierCV from sklearn.metrics import ac...
2.5
2
disaster_data/sources/noaa_coast/spider.py
cognition-gis/cognition-disaster-data
0
15207
import os import scrapy from scrapy.crawler import CrawlerProcess import requests from disaster_data.sources.noaa_coast.utils import get_geoinfo, get_fgdcinfo class NoaaImageryCollections(scrapy.Spider): name = 'noaa-coast-imagery-collections' start_urls = [ 'https://coast.noaa.gov/htdata/raster2/...
2.640625
3
rlo/test/rlo/test_factory.py
tomjaguarpaw/knossos-ksc
31
15208
import pytest from rlo import factory @pytest.mark.parametrize("use_subtree_match_edges", [True, False]) @pytest.mark.parametrize("loss", ["pinball=0.6", "huber"]) def test_torch_model_from_config(use_subtree_match_edges, loss): # Check we can construct a Model config = { "num_embeddings": 3, ...
2.109375
2
src/setup_mac.py
dittert/pyprobe
0
15209
# coding=utf-8 # Copyright 2014 <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 i...
1.5
2
src/gui/view_menu/layer_list.py
jeremiahws/DLAE
2
15210
<gh_stars>1-10 # Copyright 2019 <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 i...
2.5625
3
preprocessing.py
Prakhar-Bhartiya/SentimentAnalysis
0
15211
<reponame>Prakhar-Bhartiya/SentimentAnalysis<gh_stars>0 """ DATA DESCRIPTION sentiment140 dataset. It contains 1,600,000 tweets extracted using the twitter api . The tweets have been annotated (0 = negative, 4 = positive) and they can be used to detect sentiment . It contains the following 6 fields: target: the pola...
2.78125
3
indico/modules/events/static/controllers.py
tobiashuste/indico
0
15212
# This file is part of Indico. # Copyright (C) 2002 - 2020 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals from flask import redirect, request, session from werkzeug.except...
1.882813
2
kruptos/csapp/api.py
ashwani762/Kruptos
0
15213
<reponame>ashwani762/Kruptos from csapp.models import Kruptos from rest_framework import viewsets, permissions from rest_framework.response import Response from rest_framework import status from .serializers import KruptosSerializer class KruptosViewSet(viewsets.ModelViewSet): permission_classes = [ ...
2.265625
2
test_autolens/simulators/imaging/instrument_util.py
agarwalutkarsh554/PyAutoLens
0
15214
from os import path import autolens as al import autolens.plot as aplt from test_autogalaxy.simulators.imaging import instrument_util test_path = path.join("{}".format(path.dirname(path.realpath(__file__))), "..", "..") def pixel_scale_from_instrument(instrument): """ Returns the pixel scale from...
2.578125
3
tests/test_gpcontrolset.py
waider/gopro-py-api
1
15215
from .conftest import GoProCameraTest from socket import timeout from urllib import error class GpControlSetTest(GoProCameraTest): def test_gp_control_set(self): # on success, this is an empty json blob self.responses['/gp/gpControl/setting/foo/bar'] = '{}' assert '{}' == self.goprocam.gp...
2.625
3
ca_bc_abbotsford/people.py
djac/scrapers-ca
0
15216
<filename>ca_bc_abbotsford/people.py<gh_stars>0 from utils import CanadianScraper, CanadianPerson as Person COUNCIL_PAGE = 'http://www.abbotsford.ca/city_hall/mayor_and_council/city_council.htm' CONTACT_PAGE = 'http://www.abbotsford.ca/contact_us.htm' class AbbotsfordPersonScraper(CanadianScraper): def scrape(se...
2.84375
3
tests/unit/cli/test_repo.py
tehlingchu/anchore-cli
110
15217
from anchorecli.cli import repo
1.054688
1
Python/Activies/Classroom10-1.py
FranciscoMends/Python_Codes
0
15218
''' nome = input('Insira seu nome: ') if nome == 'Mendes': print('Que nome lindo você tem!') else: print('Seu nome é tão normal!') print('Bom dia {}!'.format(nome)) ''' #DESAFIO_28 ''' from random import randint from time import sleep x = randint(0,5) y = int(input('Digite um número de 0 à 5: ')) print('Loading...
4.09375
4
temp logger complete.py
nevillethenev/Beer
0
15219
<reponame>nevillethenev/Beer<filename>temp logger complete.py #/usr/bin/python import serial import time import matplotlib.pyplot as plt import numpy as np import os """"""""""""""""""""""""""""""""""" """""""NEVS BEER SCRIPT"""""""""""" """"""""""""""""""""""""""""""""""" ###need to add exception handler...
2.875
3
src/domain/usecases/get_all_glaucomatous_images_paths.py
OzielFilho/ProjetoFinalPdi
0
15220
from abc import ABC, abstractmethod from domain.errors.failure import Failure from domain.errors.image_failure import ImageFailure from domain.repositories.image_repository_abstraction import ImageRepositoryAbstraction class GetAllGlaucomatousImagesPathsAbstraction(ABC): @abstractmethod def __init__(self, re...
2.71875
3
numsgraph.py
FNut/PyDev
2
15221
<gh_stars>1-10 import pygame import math pygame.init() pi = ('Pi = ' + str(math.pi)) e = ('E = ' + str(math.e)) f = ('F = 0,1,1,2,3,5,8,13...') p = ('P = 1,2,5,12,29...') l = ('L = 2,1,3,4,7,11,18,29...') pl = ('P-L = 2,6,14,34,82...') display = pygame.display.set_mode((800,600)) pygame.display.set_caption('N...
2.71875
3
scoap3/modules/tools/tasks.py
Lilykos/scoap3-next
1
15222
<gh_stars>1-10 import io import csv import logging from StringIO import StringIO from datetime import datetime from gzip import GzipFile import boto3 from celery import shared_task from flask import current_app from flask_mail import Attachment from invenio_mail.api import TemplatedMessage logger = logging.getLogger(...
2.3125
2
telegram_bot/handlers/commands/detailed_mode.py
ProgrammingLanguageLeader/MathematicianBot
0
15223
from system.db import db from telegram_bot.handlers.utils.decorators import remember_new_user, \ send_typing, write_logs from telegram_bot.handlers.utils.menu_entries import MenuEntry from telegram_bot.handlers.utils.reply_markup import create_main_reply_markup from telegram_bot.models import User @write_logs @se...
2.078125
2
my_spotless_app/migrations/0002_alter_service_picture_url.py
AntociM/Spotless
0
15224
<filename>my_spotless_app/migrations/0002_alter_service_picture_url.py # Generated by Django 3.2 on 2022-02-27 11:38 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('my_spotless_app', '0001_initial'), ] operations = [ migrations.AlterFie...
1.625
2
robot/TTS.py
mluyuchen/wukong-robot
8
15225
# -*- coding: utf-8-*- import os import base64 import tempfile import pypinyin from aip import AipSpeech from . import utils, config, constants from robot import logging from pathlib import Path from pypinyin import lazy_pinyin from pydub import AudioSegment from abc import ABCMeta, abstractmethod from .sdk import Tenc...
2.28125
2
app/utils.py
Chimmahh/StarJumper
0
15226
<reponame>Chimmahh/StarJumper from channels.db import database_sync_to_async from .exceptions import ClientError from .models import Game @database_sync_to_async def get_game_or_error(game_id, user): if not user.is_authenticated: raise ClientError("USER_HAS_TO_LOGIN") try: game = Game.objects.g...
2.5
2
tests/utils/test_file.py
gfi-centre-ouest/docker-devbox-ddb
4
15227
<filename>tests/utils/test_file.py import os import pytest from ddb.__main__ import load_registered_features from ddb.config import config from ddb.feature import features from ddb.feature.core import CoreFeature from ddb.utils import file from ddb.utils.file import FileWalker, FileUtils class TestHasSameContent: ...
2.15625
2
test/test_datasets.py
pyronear/pyro-dataset
0
15228
<filename>test/test_datasets.py # Copyright (C) 2021, Pyronear contributors. # This program is licensed under the GNU Affero General Public License version 3. # See LICENSE or go to <https://www.gnu.org/licenses/agpl-3.0.txt> for full license details. import unittest import tempfile from pathlib import Path import js...
2.28125
2
python/dgllife/model/pretrain/__init__.py
VIGNESHinZONE/dgl-lifesci
0
15229
# -*- coding: utf-8 -*- # # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 # # pylint: disable= no-member, arguments-differ, invalid-name # # Utilities for using pre-trained models. import torch from dgl.data.utils import _get_dgl_url, download from .molecule...
2.28125
2
src/pyrobot/vrep_locobot/camera.py
gujralsanyam22/pyrobot
2,150
15230
<reponame>gujralsanyam22/pyrobot # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import numpy as np import pyrobot.utils.util as prutil from pyrobot.core import Camera from pyrobot.utils.uti...
2.140625
2
main.py
lmkhkm/SerialMonitor
0
15231
<gh_stars>0 import serial ser = serial.Serial('COM7',115200, timeout=1) while True: print("R: ", ser.readline())
2.6875
3
examples/avro/py/generate_avro_users.py
kikkomep/pydoop
0
15232
<reponame>kikkomep/pydoop import sys import random import avro.schema from avro.datafile import DataFileWriter from avro.io import DatumWriter NAME_POOL = ['george', 'john', 'paul', 'ringo'] OFFICE_POOL = ['office-%d' % _ for _ in xrange(4)] COLOR_POOL = ['black', 'cyan', 'magenta', 'yellow'] def main(argv): tr...
2.546875
3
tests/utils_tests/testing_tests/assertions_tests/test_assert_is_bbox_dataset.py
souravsingh/chainercv
1
15233
import numpy as np import unittest from chainer.dataset import DatasetMixin from chainer import testing from chainercv.utils import assert_is_bbox_dataset from chainercv.utils import generate_random_bbox class BboxDataset(DatasetMixin): def __init__(self, options=(), empty_bbox=False): self.options = o...
2.578125
3
seahub/utils/http.py
Xandersoft/seahub
0
15234
<filename>seahub/utils/http.py # Copyright (c) 2012-2016 Seafile Ltd. from __future__ import unicode_literals import unicodedata import urlparse import json from functools import wraps from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseForbidden class _HTTPException(Exception): def __init_...
2.515625
3
biopipen/core/defaults.py
pwwang/bioprocs
4
15235
"""Provide default settgins""" from pathlib import Path BIOPIPEN_DIR = Path(__file__).parent.parent.resolve() REPORT_DIR = BIOPIPEN_DIR / "reports" SCRIPT_DIR = BIOPIPEN_DIR / "scripts"
1.21875
1
pextant/sextant.py
norheim/pextant
0
15236
<gh_stars>0 from flask_settings import GEOTIFF_FULL_PATH import sys import traceback sys.path.append('../') import numpy as np import json from datetime import timedelta from functools import update_wrapper from pextant.EnvironmentalModel import GDALMesh from pextant.explorers import Astronaut from pextant.analysis.l...
2
2
packages/gtmapi/service.py
gigabackup/gigantum-client
60
15237
#!/usr/bin/python3 import shutil import os import base64 from time import sleep import flask import requests.exceptions import blueprint from flask_cors import CORS from confhttpproxy import ProxyRouter, ProxyRouterException from flask import Flask, jsonify import rest_routes from lmsrvcore.utilities.migrate import...
1.96875
2
bitten/model.py
dokipen/bitten
1
15238
# -*- coding: utf-8 -*- # # Copyright (C) 2005-2007 <NAME> <<EMAIL>> # Copyright (C) 2007 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://bitten.edgewall.org/w...
2.21875
2
ml_model.py
CristopherNim/student_performance
0
15239
<reponame>CristopherNim/student_performance<filename>ml_model.py import numpy as np import pandas as pd from sklearn.linear_model import Ridge from sklearn.model_selection import cross_val_score, train_test_split from sklearn.model_selection import RepeatedKFold from sklearn.preprocessing import OneHotEncoder imp...
2.984375
3
src/ralph/models/edx/enrollment/fields/contexts.py
p-bizouard/ralph
5
15240
<gh_stars>1-10 """Enrollment event models context fields definitions""" from typing import Literal, Union from ...base import BaseContextField class EdxCourseEnrollmentUpgradeClickedContextField(BaseContextField): """Represents the `context` field of the `edx.course.enrollment.upgrade_clicked` server statem...
2.296875
2
tests/profiles/fontval_test.py
kennethormandy/fontbakery
0
15241
<gh_stars>0 import os import pytest from fontbakery.utils import TEST_FILE from fontbakery.checkrunner import ERROR def test_check_fontvalidator(): """ MS Font Validator checks """ from fontbakery.profiles.fontval import com_google_fonts_check_fontvalidator as check font = TEST_FILE("mada/Mada-Regular.ttf") ...
2.578125
3
app/views.py
sinantan/TechRSS
3
15242
<filename>app/views.py from run import app from functools import wraps from flask import render_template,flash,redirect,logging,session,url_for,request from .models.database import user_register, user_login, get_feed, get_user_info, update_feed, change_password #kullanıcı giriş decorator'u. bu yapı tüm decora...
2.546875
3
kubails/commands/service.py
DevinSit/kubails
2
15243
import click import logging import sys from typing import Tuple from kubails.commands import helpers from kubails.services.config_store import ConfigStore from kubails.services.service import Service from kubails.resources.templates import SERVICE_TEMPLATES from kubails.utils.command_helpers import log_command_args_fac...
2.203125
2
tests/sentry/integrations/cloudflare/test_webhook.py
jianyuan/sentry
1
15244
<reponame>jianyuan/sentry from __future__ import absolute_import from hashlib import sha256 import hmac import json import six from sentry import options from sentry.models import ApiToken, ProjectKey from sentry.testutils import TestCase UNSET = object() class BaseWebhookTest(TestCase): def setUp(self): ...
1.976563
2
teacher_files/ia_fopera/version sockets (unix only) d'H. Roussille/neurones.py
zomboyd/epi-ml
0
15245
from math import exp,sqrt from random import randrange class neurone: def __init__(self,a,b): self.a=a self.b=b def proceed(self,z): t = z[0]*self.a + z[1]*self.b return 1/(1+exp(-t)) n = 100 X_app = [(randrange(-500,501)/1000,randrange(-500,501)/1000) for i in range(n)] Y_app ...
2.984375
3
CarParkArcGisApi/CarParkArcGisApi/env/Lib/site-packages/arcgis/apps/storymap/storymap.py
moazzamwaheed2017/carparkapi
0
15246
import json import datetime import mimetypes from urllib.parse import urlparse from arcgis import env from arcgis.gis import GIS from arcgis.gis import Item from ._ref import reference class JournalStoryMap(object): """ Represents a Journal Story Map =============== ===================================...
2.484375
2
tests/test_core.py
emauton/aoc2015
0
15247
<filename>tests/test_core.py from aoc2015.core import dispatch def test_dispatch_fail(capsys): '''Dispatch fails properly when passed a bad day''' # capsys is a pytest fixture that allows asserts agains stdout/stderr # https://docs.pytest.org/en/stable/capture.html dispatch(['204']) captured = cap...
2.390625
2
bin/pannzer/operators/output_DE.py
nestorzaburannyi/annotate
1
15248
<filename>bin/pannzer/operators/output_DE.py from myoperator import BlockOperator import re class output_DE(BlockOperator): """ Select one line per DE-cluster with the best quality description. Creates cluster_data column 'desc','genename' Inputs: data columns 'clusid','desc','FF','sta...
2.75
3
Utility.py
psarkozy/HWTester
0
15249
<reponame>psarkozy/HWTester import os from StringIO import StringIO from zipfile import ZipFile import subprocess import shutil import fcntl import time import signal import imp import sys,traceback def dir_clean_error(function,path,excinfo): print 'WARNING: Ran into issues trying to remove directory:',path,str(fun...
2.203125
2
wagtailsharing/tests/test_urls.py
mikiec84/wagtail-sharing
1
15250
<reponame>mikiec84/wagtail-sharing from __future__ import absolute_import, unicode_literals try: from importlib import reload except ImportError: pass from django.conf.urls import url from django.test import TestCase from mock import patch try: import wagtail.core.urls as wagtail_core_urls except ImportE...
2.109375
2
py2neo/timing.py
VitalyRomanov/py2neo
0
15251
<filename>py2neo/timing.py #!/usr/bin/env python # -*- encoding: utf-8 -*- # Copyright 2011-2021, <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/license...
3.453125
3
LeapYearFinderClass.py
MichaelWiciak/LeapYearFinderClass
0
15252
<gh_stars>0 class LeapYearFinder(object): def __init__(self): pass def findLeapYear(self, startYear, endYear): leapYearRecord = [] for i in range(int(startYear),int(endYear)): year = i print(year,end = "\t") #If year is di...
3.578125
4
versions/versions.py
juanfec/juan_rueda_test
0
15253
<reponame>juanfec/juan_rueda_test # check to strings that represent version numbers and finds the greatest, # 'equals' if they are the same version or 'Invalid Format' # example: “1.2” is greater than “1.1”. # for reusability this function just returns the version number or the word equals # if a more elaborated answ...
4.03125
4
packages/pyright-internal/src/tests/samples/match7.py
Strum355/pyright
0
15254
# This sample tests type narrowing of subject expressions for # match statements. from typing import Literal def func1(subj: int | dict[str, str] | tuple[int] | str, cond: bool): match subj: case (3 | "hi"): t_v1: Literal["Literal[3, 'hi']"] = reveal_type(subj) return cas...
3.125
3
examples/finance/stocks_baselines.py
TianhaoFu/MultiBench
0
15255
import sys import os sys.path.append(os.getcwd()) import argparse import numpy as np import pmdarima import torch import torch.nn.functional as F from torch import nn from fusions.common_fusions import Stack from unimodals.common_models import LSTMWithLinear from datasets.stocks.get_data import get_dataloader parser...
2.109375
2
textmate/bundles/LaTeX.tmbundle/Support/lib/Python/tmprefs.py
leo-brewin/hybrid-latex
16
15256
<reponame>leo-brewin/hybrid-latex<gh_stars>10-100 # -- Imports ------------------------------------------------------------------ from __future__ import print_function from __future__ import unicode_literals from Foundation import CFPreferencesAppSynchronize, CFPreferencesCopyAppValue from os import getenv # -- Cla...
1.8125
2
parsetab.py
UVG-Teams/analizador-lexico-sintactico
0
15257
# parsetab.py # This file is automatically generated. Do not edit. # pylint: disable=W,C,R _tabversion = '3.10' _lr_method = 'LALR' _lr_signature = 'leftIMPLIESSIMPLIESleftANDORleftRPARENLPARENrightNEGATIONALPHABET AND IMPLIES LPAREN NEGATION OR PREDICATE RPAREN SIMPLIESexpr : expr AND exprexpr : ALPHABETexpr : expr...
1.8125
2
Q1_ab.py
dkilike/Image-Segmentation
2
15258
<gh_stars>1-10 '''Please write a program to read the scan and print out The maximum voxel intensity The mean voxel intensity The coordinates of the centre of the image volume, in the scanner coordinate system. ''' import pydicom import numpy as np import matplotlib.pyplot as plt import cv2 import glob import os import...
3.25
3
12/day_twelve.py
tmay-sarsaparilla/advent-of-code-2021
0
15259
<reponame>tmay-sarsaparilla/advent-of-code-2021 def find_paths(start, connections, visited=None, small_cave_visited_twice=False): if visited is None: visited = ["start"] possible_connections = [e for s, e in connections if s == start] + [s for s, e in connections if e == start] paths = [] if n...
3.71875
4
pythonic_binance/__init__.py
hANSIc99/pythonic-binance
1
15260
<reponame>hANSIc99/pythonic-binance """An unofficial Python wrapper for the Binance exchange API v3 .. moduleauthor:: <NAME> .. modified by <NAME> for Pythonic """
1.03125
1
tests/unit/test_question_answer.py
Lunga001/pmg-cms-2
2
15261
import os from tests import PMGTestCase from tests.fixtures import dbfixture, CommitteeQuestionData class TestQuestionAnswer(PMGTestCase): def setUp(self): super(TestQuestionAnswer, self).setUp() self.fx = dbfixture.data(CommitteeQuestionData,) self.fx.setup() def tearDown(self): ...
2.46875
2
Job-Interviews/Python/BinaryTrees/Problem2.py
JuanPabloMontoya271/ITC
1
15262
class Tree: def __init__(self, val,left = None, right = None): self.val = val self.left = left self.right = right root = Tree(4, left = Tree(3), right=Tree(5, left= Tree(4))) #InOrderTraversal def InOrderTraversal(root, res = []): if root is None: return res ...
3.828125
4
csv_analyzer/apps/dataset/api/dataset.py
saduqz/csv-analyzer-test
0
15263
from datetime import datetime # Rest framework from rest_framework import status from rest_framework.decorators import action from rest_framework.mixins import RetrieveModelMixin, ListModelMixin, UpdateModelMixin, CreateModelMixin from rest_framework.response import Response from rest_framework.viewsets import Generic...
2.140625
2
tfx_bsl/tfxio/tensor_to_arrow_test.py
brills/tfx-bsl
0
15264
<filename>tfx_bsl/tfxio/tensor_to_arrow_test.py # Copyright 2020 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 requ...
2.15625
2
th_watchdog/failure_email.py
hwjeremy/th-watchdog
0
15265
""" Thornleigh Farm - VPN Watchdog Failure Email Module author: <EMAIL> """ from th_watchdog.email import Email class FailureEmail(Email): """ An email notifying the administrator of a failed state """ SUBJECT = 'Starport VPN connection lost' BODY = 'Starport has lost connection to the VPN' d...
2.140625
2
nemo/nemo/backends/pytorch/common/data.py
petermartigny/NeMo
1
15266
<reponame>petermartigny/NeMo __all__ = ['TextDataLayer'] from functools import partial import torch from torch.utils.data import DataLoader, DistributedSampler from nemo.backends.pytorch.common.parts import TextDataset from nemo.backends.pytorch.nm import DataLayerNM from nemo.core import DeviceType from nemo.core.n...
2.75
3
bot.py
marsDurden/UnipdBot
4
15267
<gh_stars>1-10 import logging from datetime import time, timedelta from functools import wraps # Telegram bot libraries from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackQueryHandler from telegram import KeyboardButton, ReplyKeyboardMarkup, ParseMode, Bot, InlineKeyboardButton, InlineK...
2.140625
2
server/twitter.py
abijith-kp/Emolytics
0
15268
<reponame>abijith-kp/Emolytics<gh_stars>0 from server import db, auth, emolytics from server.models import Tweet from classifier import create_classifier from tweepy import Stream from tweepy.streaming import StreamListener from flask.ext.rq import job import json import random from multiprocessing import Process fr...
2.328125
2
misc_code/extractGridFeatures.py
Lab-Work/gpsresilience
21
15269
import csv import os import shutil from datetime import datetime from grid import * #from cluster import * from regions import * start_time = datetime.now() print("Allocating...") #grid2 #gridSystem = GridSystem(-74.04, -73.775, 5, 40.63, 40.835, 5) #gridname = "grid2" #grid3 #gridSystem = GridSystem(-74.02, -73.9...
2.609375
3
haiku/_src/stateful_test.py
madisonmay/dm-haiku
0
15270
# Lint as: python3 # Copyright 2019 DeepMind Technologies Limited. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
1.9375
2
pocketbook/commands/rename.py
ejfitzgerald/tools-pocketbook
1
15271
def run_rename(args): from pocketbook.address_book import AddressBook from pocketbook.key_store import KeyStore address_book = AddressBook() key_store = KeyStore() # make sure that the new name is not present either as a key, or as an address new_present = args.new in address_book.keys() or ar...
3.734375
4
src/orion/algo/robo/__init__.py
lebrice/orion.algo.robo
0
15272
# -*- coding: utf-8 -*- """ Wrapper for RoBO """ __descr__ = "TODO" __license__ = "BSD 3-Clause" __author__ = u"Epistímio" __author_short__ = u"Epistímio" __author_email__ = "<EMAIL>" __copyright__ = u"2021, Epistímio" __url__ = "https://github.com/Epistimio/orion.algo.robo" from ._version import get_versions __vers...
1.078125
1
minimum/minimum-function.py
gunater/Numerical-methods
0
15273
<gh_stars>0 """ Znaleść kąt á, przy którym zasięg skoku z wahadła będzie maksymalny. Należy posłużyć się metodą złotego podziału. <NAME> Index:216708 """ import matplotlib.pyplot as plt import numpy as np class Zloty_podzial: def __init__(self, h, line, a0): tau = (np.sqrt(5) - 1) / 2 a = 0.2 ...
3.125
3
app/products/product_info.py
Group-16-COSC-310/grocery-chat-bot
0
15274
from app.database import MOCK_PRODUCT_DATA import re from app.products.base_handler import BaseHandler class ProductInfoHandler(BaseHandler): """ A class used to represent a mini-bot to handle product queries. """ def __init__(self) -> None: super().__init__() def create_match_paterns(se...
2.46875
2
qcdb/iface_psi4/runner.py
vivacebelles/qcdb
1
15275
import sys import copy import pprint pp = pprint.PrettyPrinter(width=120) import inspect import numpy as np from .. import __version__ from .. import qcvars from ..driver.driver_helpers import print_variables from ..exceptions import * from ..molecule import Molecule from ..pdict import PreservingDict from .worker im...
1.9375
2
users/models.py
tanmayag8958/upes-fipi-jigyasa
8
15276
<reponame>tanmayag8958/upes-fipi-jigyasa from django.db import models from django.utils import timezone from django.contrib.auth.models import User from django.db.models.signals import post_save from django.dispatch import receiver class User_details(models.Model): user = models.OneToOneField(User, on_delete=model...
2.0625
2
script/study/sedov/sedov_main_function.py
will-iam/Variant
8
15277
<gh_stars>1-10 #Main Sedov Code Module #Ported to python from fortran code written by <NAME> and <NAME> #Original Paper and code found at http://cococubed.asu.edu/papers/la-ur-07-2849.pdf import numpy as np from globalvars import comvars as gv from sedov_1d import sed_1d from sedov_1d_time import sed_1d_...
2
2
packs/hue/actions/rgb.py
jonico/st2contrib
164
15278
from lib import action class RGBAction(action.BaseAction): def run(self, light_id, red, green, blue, transition_time): light = self.hue.lights.get(light_id) light.rgb(red, green, blue, transition_time)
2.328125
2
test/test_math_challenge.py
nikett/math_challenge_eval
0
15279
import unittest from typing import Dict, List from src.math_challenge import Challenge, DEFAULT_EMPTY_ANS from src.student_info import StudentInfo class TestChallenge(unittest.TestCase): def test_preprocess(self): self.assertEqual(Challenge.preprocess_ans("a. 37th floor, b. 42nd floor, c. 39th floor, d. ...
3.359375
3
MyBot.py
joebieb/halite
0
15280
import hlt import logging from collections import OrderedDict # GAME START game = hlt.Game("Spoof_v7") logging.info('Starting my %s bot!', game._name) TURN = 0 def navigate(ship, entity, multiplier = 1): navigate_command = ship.navigate( ship.closest_point_to(entity), game_map, speed=int(h...
2.390625
2
test/test_horizons.py
bluePhlavio/eph
1
15281
import pytest from eph.horizons import * @pytest.fixture(params=[ ('earth', '399'), ('\'earth\'', '399'), ('Earth', '399'), ('399', '399'), ('\'399\'', '399'), ('pluto', 'pluto'), ]) def codify_obj_data(request): return request.param def test_codify_obj(codify_obj_data): data, resul...
2.328125
2
demo.py
ademilly/sqs-service
0
15282
# -*- coding: utf-8 -*- import time import sqs_service """Usage: python demo.py Expected set environment variables: - AWS_ACCESS_KEY_ID - AWS_SECRET_ACCESS_KEY - AWS_DEFAULT_REGION - AWS_SESSION_TOKEN for IAM roles - AWS_SECURITY_TOKEN for IAM roles Send 'Hello World' to queue 'TEST', listen to the queue and print...
2.671875
3
web_console_v2/api/testing/workflow_template/psi_join_tree_model_no_label.py
chen1i/fedlearner
0
15283
<filename>web_console_v2/api/testing/workflow_template/psi_join_tree_model_no_label.py # Copyright 2020 The FedLearner 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 Licen...
1.632813
2
utils/sys_utils.py
machine2learn/galaina
3
15284
import os import shutil def delete_configs(config, dataset, username): if config != 'all': paths = [os.path.join('user_data', username, dataset, config)] else: paths = [os.path.join('user_data', username, dataset, d) for d in os.listdir(os.path.join('user_data', username, data...
2.921875
3
RasaMakeupRobot/script/dst/trade/utils.py
xiaobuguilaile/rasa-conversational-robot
2
15285
import os import bz2 import json import random import pickle from collections import defaultdict, Counter from tqdm import tqdm import torch from data.crosswoz.data_process.dst.trade_preprocess import ( EXPERIMENT_DOMAINS, Lang, get_seq, get_slot_information, ) class CNEmbedding: def __init__(s...
2.09375
2
pharmrep/reports/urls.py
boyombo/pharmrep
0
15286
from django.conf.urls import url from django.views.generic import TemplateView from reports import views urlpatterns = [ url(r'balance/$', views.balance, name='report_balance'), url(r'performance/$', views.performance, name='report_performance'), url(r'last_activity/$', views.last_activity, name='last_ac...
1.710938
2
pycam/pycam/Utils/progress.py
pschou/py-sdf
0
15287
from pycam.Utils.events import get_event_handler, get_mainloop class ProgressContext: def __init__(self, title): self._title = title self._progress = get_event_handler().get("progress") def __enter__(self): if self._progress: self._progress.update(text=self._title, percen...
2.65625
3
validate_submission.py
ChunghyunPark/semantic-kitti-api
1
15288
<filename>validate_submission.py #!/usr/bin/env python3 # This file is covered by the LICENSE file in the root of this project. import zipfile import argparse import os class ValidationException(Exception): pass if __name__ == "__main__": parser = argparse.ArgumentParser( description="Validate a submissi...
2.890625
3
sheldon_behaviors/ship_behavior/scripts/behavior_service.py
shinselrobots/sheldon
1
15289
#! /usr/bin/env python # License: Apache 2.0. See LICENSE file in root directory. # # For simple behaviors that can run syncronously, Python provides # a simple way to implement this. Add the work of your behavior # in the execute_cb callback # import rospy import actionlib import behavior_common.msg import time imp...
2.109375
2
src/core/utils/bert_utils.py
joe3d1998/GraphFlow
30
15290
from collections import defaultdict, namedtuple import torch # When using the sliding window trick for long sequences, # we take the representation of each token with maximal context. # Take average of the BERT embeddings of these BPE sub-tokens # as the embedding for the word. # Take *weighted* average of the word ...
2.359375
2
apps/lectures/serializers.py
csilouanos/student-management-system
0
15291
<filename>apps/lectures/serializers.py from rest_framework import serializers from .models import Lecture class LectureSerializer(serializers.ModelSerializer): class Meta: model = Lecture fields = ('id', 'title', 'lecturer_name', 'date', 'duration', 'slides_url', 'is_required')...
2.25
2
OpenDataCatalog/suggestions/urls.py
timwis/Open-Data-Catalog
3
15292
from django.conf.urls.defaults import patterns, include, url urlpatterns = patterns('', (r'^$', 'suggestions.views.list_all'), (r'^post/$', 'suggestions.views.add_suggestion'), (r'^vote/(?P<suggestion_id>.*)/$', 'suggestions.views.add_vote'), (r'^unvote/(?P<suggestion_id>.*)/$', 'suggestions.views.remove_v...
1.6875
2
fronteira_eficiente2.py
samuelbarrosm/Python-for-finances-
0
15293
<filename>fronteira_eficiente2.py<gh_stars>0 #Esse codigo é utilizado para calcular a fronteira eficiente de um portfolio #Esse codigo tem como objetivo avaliar a eficiencia das de um portfolio import numpy as np import pandas as pd import matplotlib.pyplot as plt from pandas_datareader import data as wb ...
2.859375
3
test/integration/test_build.py
DahlitzFlorian/wily
0
15294
<gh_stars>0 """ Tests for the wily build command. All of the following tests will use a click CLI runner to fully simulate the CLI. Many of the tests will depend on a "builddir" fixture which is a compiled wily cache. TODO : Test build + build with extra operator """ import pathlib import pytest from click.testing im...
2.5625
3
authz/test/test_obp_helper.py
shivdeep-singh/conversational-ai-chatbot
11
15295
<reponame>shivdeep-singh/conversational-ai-chatbot<gh_stars>10-100 import unittest from zmq_integration_lib import RPCClient, RPCServer import unittest.mock as mock class TestOBPHelper(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def logout(self, mock_zmq): ...
2.234375
2
cvtData.py
leduchust/ST-GCN_HAR
0
15296
<filename>cvtData.py import os import numpy as np import tqdm as tqdm def cvt_Data(): if not os.path.exists('./fphab_data/newData'): os.mkdir('./fphab_data/newData') #for i in range(1,7): # os.mkdir('./fphab_data/newData/Subject_'+str(i)) subject_list=os...
2.421875
2
src/zope/app/applicationcontrol/browser/runtimeinfo.py
zopefoundation/zope.app.applicationcontrol
0
15297
<gh_stars>0 ############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # 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 distri...
1.804688
2
helper/storageHelper.py
LHGames-2018/DCI5espaces
0
15298
import json import os.path class StorageHelper: __document = None __path = None @staticmethod def write(key, data): StorageHelper.__init() StorageHelper.__document[key] = json.dumps(data) StorageHelper.__store() @staticmethod def read(key): StorageHelper.__ini...
2.984375
3
ddot/cx_services_old-8-31-17/align.py
pupster90/ddot2
1
15299
import ndex.client as nc from ndex.networkn import NdexGraph import io import json from IPython.display import HTML from time import sleep import os, time, tempfile import sys import time import logging import grpc import networkx as nx import cx_pb2 import cx_pb2_grpc import numpy as np import inspect from concurre...
1.992188
2