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
users/views/logout.py
thulasi-ram/logistika
0
12776451
<reponame>thulasi-ram/logistika from django.contrib.auth import logout from django.http import HttpResponseRedirect from django.urls import reverse from django.views.generic import TemplateView class Logout(TemplateView): template_name = '' def get(self, request, *args, **kwargs): referrer = request....
2.078125
2
polyaxon_client/tracking/__init__.py
yu-iskw/polyaxon-client
0
12776452
# -*- coding: utf-8 -*- from polyaxon_client.tracking.experiment import Experiment from polyaxon_client.tracking.group import Group from polyaxon_client.tracking.job import Job from polyaxon_client.tracking.paths import *
1.085938
1
lib/python2.7/site-packages/setools/nodeconquery.py
TinkerEdgeR-Android/prebuilts_python_linux-x86_2.7.5
0
12776453
<reponame>TinkerEdgeR-Android/prebuilts_python_linux-x86_2.7.5 # Copyright 2014-2015, Tresys Technology, LLC # # This file is part of SETools. # # SETools is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation,...
1.882813
2
LeetCode/python-R1/0303-区域和检索 - 数组不可变D/V1.py
huuuuusy/Programming-Practice-Everyday
4
12776454
""" @Author: huuuuusy @GitHub: https://github.com/huuuuusy 系统: Ubuntu 18.04 IDE: VS Code 1.36 工具: python == 3.7.3 """ """ 思路: 直接将每个数字从0开始到自己的和存入target数组中 最后返回两个数字在target数组的差值即为结果 参考链接: https://leetcode-cn.com/problems/longest-increasing-subsequence/solution/dong-tai-gui-hua-er-fen-cha-zhao-tan-xin-suan-f...
3.875
4
FFTAnalysis/FFT.py
JamieAGraham/FID-Analysis-g-2
1
12776455
from __future__ import division import numpy as np import scipy as sci import sys # Python implementation of the FFT quadratic peak interpolation method. This code can be run with the following format: # <python FFT.py [filename.txt] [Zero Padding Multiple]> # The format of the text file is identical to that of the ZC...
2.859375
3
fb_mining/friends_analyzis.py
JustCheckingHow/StalkingYourGf
1
12776456
def find_deletions(friends_file_path, new_friends_list): deleted = "" f1 = open(friends_file_path, "r") data2 = new_friends_list for line in f1: if data2.find(line) == -1: print ("--" +line), deleted += line f1.close() return deleted def find_additions(friends_file_path, new_friends_list): added = "...
3.53125
4
raws/reffile.py
Charcoal-Apple/PyDwarf
49
12776457
<gh_stars>10-100 #!/usr/bin/env python # coding: utf-8 import os import shutil import basefile class reffile(basefile.basefile): def __init__(self, path=None, dir=None, root=None, **kwargs): self.dir = dir self.setpath(path, root, **kwargs) self.kind = 'ref' def copy(self): ...
2.8125
3
TransferOwnership.py
tylergusmyers/Pet_dApp
0
12776458
import streamlit as st from dataclasses import dataclass from typing import Any, List import datetime as datetime import pandas as pd import hashlib @dataclass class Title: sender: str receiver: str title: str @dataclass class Ownership: record: Title creator_id: int prev_hash: str = "0" ...
2.765625
3
endpoints/client_endpoint.py
iTecAI/XL3
0
12776459
from fastapi import APIRouter, status, Request, Response from util import * from classes import * from _runtime import server import logging, random, hashlib from pydantic import BaseModel from models import * logger = logging.getLogger("uvicorn.error") router = APIRouter() @router.post('/settings/set/{setting}/',res...
2.390625
2
qa/L0_stability_steps/check_results.py
MarkMoTrin/model_analyzer
115
12776460
<filename>qa/L0_stability_steps/check_results.py<gh_stars>100-1000 # Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. 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.296875
2
src/ai/conditions.py
Kupoman/thor
1
12776461
<reponame>Kupoman/thor<filename>src/ai/conditions.py # Copyright 2013 <NAME>, <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0...
2.296875
2
alertserver/trello_client.py
KoMinkyu/bitbucket_alerts_trello
1
12776462
<filename>alertserver/trello_client.py<gh_stars>1-10 from html import unescape from alertserver.config import Trello as config_trello import trolly client = trolly.client.Client(config_trello.api_key, config_trello.token) assert client is not None member = client.get_member() assert member is not None print('Connec...
2.390625
2
pypackage_scripts/__init__.py
marisalim/stonybrook_juypterworkflow
0
12776463
<reponame>marisalim/stonybrook_juypterworkflow x = 5.9 y = 6
0.945313
1
Data_Structure/selection_sort.py
RafaFurla/Python-Exercises
1
12776464
<filename>Data_Structure/selection_sort.py def sort(list_): """ This function is a selection sort algorithm. It will put a list in numerical order. :param list_: a list :return: a list ordered by numerial order. """ for minimum in range(0, len(list_)): for c in range(minimum + 1, len(li...
4.375
4
bltk/langtools/taggertools.py
saimoncse19/bltk
12
12776465
noun_suffix = ['াই', 'াটা', 'াটাই', 'াটাও', 'াটাকে', 'াটাকেও', 'াটি', 'ামি', 'িক', 'িকা', 'ের', 'েরই', 'েরও', 'েরা', 'েরাও', 'েরে', 'ও', 'আবলি', 'আলা', 'এরা', 'এরে', 'কারী', 'কুলের', 'কে', 'কেই', 'কেও', 'খানা', 'খানি', 'গণ', 'গণে', 'গন', 'গাছা', 'গাছি', 'গিরি', 'গুচ্ছ', 'গুলা', 'গুলি', 'গু...
1.585938
2
basic_structure.py
spaceghst007/astr-119-session-2
0
12776466
import library as alias #imports functions for #us to use def main(): #defines the main func #do some stuff #rest of the profram continues from here #if the main() function exists, fun it if __name__== "__main__": main() #you can do other stuff down here
2.34375
2
Fluid/io/fluid-cloudnative/module/alluxio_runtime_spec.py
Rui-Tang/fluid-client-python
1
12776467
<filename>Fluid/io/fluid-cloudnative/module/alluxio_runtime_spec.py # coding: utf-8 """ fluid client for fluid # noqa: E501 OpenAPI spec version: v0.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six from Fluid.io.fluid-cl...
1.554688
2
custom_components/bhyve/util.py
jdreamerz/bhyve-home-assistant
122
12776468
from homeassistant.util import dt def orbit_time_to_local_time(timestamp: str): if timestamp is not None: return dt.as_local(dt.parse_datetime(timestamp)) return None def anonymize(device): device["address"] = "REDACTED" device["full_location"] = "REDACTED" device["location"] = "REDACTED...
2.796875
3
Tracker/oauth_appengine.py
stvnrhodes/calsol
0
12776469
<filename>Tracker/oauth_appengine.py #!/usr/bin/env python # Copyright 2009 <NAME> # Copyright 2009 Google """ An appengine OAuthClient based on the oauth-python reference implementation. """ import oauth from google.appengine.api import urlfetch from google.appengine.ext import db class OAuthClient(oauth.OAuthCl...
2.9375
3
examples/push_dataset.py
Sage-Bionetworks/nlp-sandbox-client
3
12776470
""" Example code to push a dataset into the data node. A complete dataset includes "Dataset", "Fhir Store", "Annotation Store", "Annotation", "Patient", "Note" To run this code, here are the requirements: - Install the nlpsandbox-client (`pip install nlpsandbox-client`) - Start the Data Node locally - Follow instruct...
2.828125
3
alerter/test/channels_manager/channels/test_pagerduty.py
SimplyVC/panic
41
12776471
<filename>alerter/test/channels_manager/channels/test_pagerduty.py import logging import unittest from unittest import mock from src.alerter.alerts.system_alerts import ( OpenFileDescriptorsIncreasedAboveThresholdAlert) from src.channels_manager.apis.pagerduty_api import PagerDutyApi from src.channels_manager.chan...
2.171875
2
utool/util_sqlite.py
Erotemic/utool
8
12776472
<gh_stars>1-10 # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function from utool import util_inject import six import collections print, rrr, profile = util_inject.inject2(__name__) def get_tablenames(cur): """ Conveinience: """ cur.execute("SELECT name FROM sqlite_master WHE...
2.90625
3
mowl/projection/catont/model.py
bio-ontology-research-group/OntoML
0
12776473
from org.mowl.CatParser import CatParser import sys from mowl.graph.graph import GraphGenModel class CatOnt(GraphGenModel): def __init__(self, dataset, subclass = True, relations = False): super().__init__(dataset) self.parser = CatParser(dataset.ontology) def parseOWL(self): edge...
2.484375
2
cx_Freeze/initscripts/SharedLib.py
TechnicalPirate/cx_Freeze
358
12776474
""" Initialization script for cx_Freeze which behaves similarly to the one for console based applications but must handle the case where Python has already been initialized and another DLL of this kind has been loaded. As such it does not block the path unless sys.frozen is not already set. """ import sys if not hasa...
2.453125
2
src/evaluating_rewards/scripts/pipeline/train_experts.py
HumanCompatibleAI/evaluating_rewards
42
12776475
# Copyright 2020 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
1.96875
2
applications/AE2/controllers/default.py
Mexarm/web2pytests
0
12776476
# -*- coding: utf-8 -*- # this file is released under public domain and you can use without limitations ######################################################################### ## This is a sample controller ## - index is the default action of any application ## - user is required for authentication and authorization...
2.390625
2
solutions_2018/day8.py
EpicWink/advent-of-code-solutions
0
12776477
import logging as lg lg.basicConfig( level=lg.DEBUG, format="%(asctime)s [%(levelname)s] %(name)s: %(message)s", datefmt="%H:%M:%S") _logger = lg.getLogger(__name__) class Node: def __init__(self, children, metadata): self.children = children self.metadata = metadata def sum_meta...
2.75
3
uasyncio_iostream/uasyncio/lock.py
petrkr/micropython-samples
1
12776478
<filename>uasyncio_iostream/uasyncio/lock.py import uasyncio ################################################################################ # Lock (optional component) # Lock class for primitive mutex capability import uasyncio class Lock(uasyncio.Primitive): def __init__(self): super().__init__() ...
2.984375
3
_notes/exportMdFileToHtml.py
ramellus/phd-notes
0
12776479
<gh_stars>0 import os from shutil import copyfile, copyfileobj import shutil from pathlib import Path import pathlib import sys import re import html from urllib.parse import unquote import urllib.request from random import seed,random,randint if(len(sys.argv)!=2 and len(sys.argv)!=3 and len(sys.argv)!=4): prin...
2.5625
3
api/endpoints/curso.py
lads-ecp/ufma-api
1
12776480
<gh_stars>1-10 from flask_restplus import Resource, reqparse, Api from flask_jwt import jwt_required from flask.json import jsonify from restplus import api as api from flask import request from flask import make_response from database.models import Curso from database import db from database.operations import save_to ...
2.515625
3
thoraxe/transcript_info/__init__.py
PhyloSofS-Team/exonhomology
6
12776481
""" transcript_info: Module to read and manage transcript information. It performs the first exon clustering of the pipeline. """ from thoraxe.transcript_info import clusters from thoraxe.transcript_info import phases from thoraxe.transcript_info.transcript_info import * from thoraxe.transcript_info.exon_clustering ...
1.320313
1
third_party/libSBML-5.9.0-Source/src/bindings/python/test/sbml/TestL3Model.py
0u812/roadrunner
5
12776482
# # @file TestL3Model.py # @brief L3 Model unit tests # # @author <NAME> (Python conversion) # @author <NAME> # # ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ====== # # DO NOT EDIT THIS FILE. # # This file was generated automatically by converting the file located at # src/sbml/test/...
1.96875
2
zaqar/storage/mongodb/__init__.py
vkmc/zaqar-websocket
1
12776483
# 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 # distributed under the...
1.570313
2
backend/conf/__about__.py
alexhermida/pinecone
2
12776484
<gh_stars>1-10 __title__ = 'pinecone-backend' __summary__ = 'Domain.' __version__ = '0.0.1-dev' __license__ = 'All rights reserved.' __uri__ = 'http://vigotech.org/' __author__ = 'VigoTech' __email__ = '<EMAIL>'
0.902344
1
pythonProject/MUNDO 3/Desafio 92-Prof.py
lucasjlgc/Aulas-de-Python-
0
12776485
from datetime import datetime dados=dict() dados['Nome']= str(input('Nome: ')) nasc= int(input('Ano de nascimento: ')) dados['Idade']= datetime.now().year - nasc dados['ctps'] = int(input('Digite o ctps(0 se nao tem): ')) if dados['ctps']!=0: dados['contratação']=int(input('Ano de contratação: ')) dados['salari...
3.5625
4
kusanagi/sdk/lib/payload/transport.py
kusanagi/kusanagi-sdk-python
1
12776486
<filename>kusanagi/sdk/lib/payload/transport.py # Python 3 SDK for the KUSANAGI(tm) framework (http://kusanagi.io) # Copyright (c) 2016-2021 <NAME>.L. All rights reserved. # # Distributed under the MIT license. # # For the full copyright and license information, please view the LICENSE # file that was distributed with ...
2.09375
2
simple_playgrounds/agents/sensors/__init__.py
Asjidkalam/simple-playgrounds
0
12776487
from .robotic_sensors import * from .topdown_sensors import * from .semantic_sensors import *
1.046875
1
evennia/utils/tests/test_evmenu.py
victomteng1997/evennia_default_lib
0
12776488
<reponame>victomteng1997/evennia_default_lib<filename>evennia/utils/tests/test_evmenu.py """ Unit tests for the EvMenu system TODO: This need expansion. """ from django.test import TestCase from evennia.utils import evmenu from mock import Mock class TestEvMenu(TestCase): "Run the EvMenu testing." def set...
2.203125
2
searching/binary_search.py
TrungLuong1194/retrieval_systems
1
12776489
from utils import generate_random_sequence def search(seq, l, r, x): num_comparisons = 0 if r >= l: mid = l + (r - l) // 2 num_comparisons += 1 if seq[mid] == x: return mid, num_comparisons elif seq[mid] > x: res, num = search(seq, l, mid - 1, x) ...
3.84375
4
DailyCodingProblem/25_Facebook_regular_expression.py
RafayAK/CodingPrep
5
12776490
''' This problem was asked by Facebook. Implement regular expression matching with the following special characters: . (period) which matches any single character * (asterisk) which matches zero or more of the preceding element That is, implement a function that takes in a string and a valid regular expression and r...
4.4375
4
METABRIC_cBio/parse_metadata.py
btc36/WishBuilder
0
12776491
<reponame>btc36/WishBuilder<gh_stars>0 import sys, gzip clinical_sample_filePath = sys.argv[1] clinical_patient_filePath=sys.argv[2] cna_filePath=sys.argv[3] mutations_extended_filePath=sys.argv[4] outFilePath = sys.argv[5] #Function used to interpret data_CNA.txt values def geneAlterationTranslator(int): if int== '...
2.671875
3
StreamPy/examples_timed_window_wrapper.py
AnomalyInc/StreamPy
2
12776492
<reponame>AnomalyInc/StreamPy<filename>StreamPy/examples_timed_window_wrapper.py from Stream import Stream, _no_value, _multivalue, TimeAndValue from Operators import stream_func, stream_agent from examples_element_wrapper import print_stream import numpy as np import random #########################################...
1.976563
2
tests/onegov/election_day/views/test_views_manage.py
politbuero-kampagnen/onegov-cloud
0
12776493
<gh_stars>0 from datetime import date from lxml.html import document_fromstring from onegov.ballot import ProporzElection from onegov.election_day.collections import ArchivedResultCollection from onegov.election_day.layouts import ElectionLayout from tests.onegov.election_day.common import login from tests.onegov.ele...
2.171875
2
python_solutions/chapter_08_recursion_and_dynamic_programming/problem_08_08_permutations_with_dups.py
isayapin/cracking-the-coding-interview
560
12776494
def permutations_with_dups(string): hash_table = {} permutations = [] for character in string: if character in hash_table: hash_table[character] += 1 else: hash_table[character] = 1 helper('', hash_table, permutations) return permutations def helper(string, ...
3.515625
4
src/sudoku.py
nahuel-ianni/sudoku-solver
0
12776495
""" Sudoku solver script using a backtracking algorithm. """ def find_empty_location(grid): """ Looks for the coordinates of the next zero value on the grid, starting on the upper left corner, from left to right and top to bottom. Keyword Arguments: grid {number matrix} -- The matrix to look f...
4.375
4
space_invaders.py
keijolinnamaa/Space_Invaders
0
12776496
<reponame>keijolinnamaa/Space_Invaders import sys import os.path from datetime import datetime import pygame from settings import Settings from ship import Ship from bullet import Bullet from alien import Alien from time import sleep from game_stats import GameStats from button import Button from explosions ...
2.921875
3
debugger.py
AndyCyberSec/dextractor
3
12776497
import subprocess def debug(pid): cmd = ['adb', "forward", "tcp:1234", "jdwp:{}".format(pid)] stream = subprocess.Popen(cmd) stream.wait() jdb = ["jdb", "-attach", "localhost:1234"] stream = subprocess.Popen(jdb) stream.wait()
2.0625
2
datalad/interface/tests/test_download_url.py
yarikoptic/datalad
0
12776498
<reponame>yarikoptic/datalad # emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 noet: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the datalad package for the # copyright and...
2.046875
2
tests/test_ne.py
hyw208/beval
5
12776499
<gh_stars>1-10 import operator import unittest from unittest import TestCase from beval.criteria import Criteria, Const, NotEq, to_criteria, Ctx, In, universal from test_helper import acura_small class TestNe(TestCase): def test_ne_simple(self): with acura_small as acura: c = NotEq("make", ...
3.0625
3
Validation/ground_truth_internet2.py
dioptra-io/icmp-rate-limiting-classifier
0
12776500
from Files.utils import ipv4_regex, ipv6_regex import re if __name__ == "__main__": """ This script parse the Internet2 interfaces files and generates router files """ router_id_regex = re.compile('<th id=".*?">(.*)</th>') gt_interface_addresses = ( "resources/internet2/ground-truth/Int...
3.015625
3
setup.py
barnardn/rx_weather
0
12776501
<filename>setup.py import os from setuptools import setup import json exec(open("./rxw/_version.py").read()) def requirements_from_pipfile(pipfile=None): if pipfile is None: pipfile = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'Pipfile.lock') lock_data = ...
1.914063
2
pytorch-examples/00-warm-up/3 nn module/3 two_layer_net_custom_module.py
shubhajitml/neurCodes
1
12776502
<gh_stars>1-10 # Whenever we want to specify models that are more complex than a simple # sequence of existing Modules;we define your own Modules by # subclassing nn.Module and defining a forward which receives input Tensors # and produces output Tensors using other modules or other autograd operations # on Tensors ...
3.953125
4
macrotest/macrotest.py
ariegg/webiopi-examples
0
12776503
# Copyright 2016 <NAME> - t-h-i-n-x.net # # 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...
2.296875
2
python/1004.max-consecutive-ones-iii.py
Zhenye-Na/leetcode
10
12776504
<reponame>Zhenye-Na/leetcode # # @lc app=leetcode id=1004 lang=python3 # # [1004] Max Consecutive Ones III # # https://leetcode.com/problems/max-consecutive-ones-iii/description/ # # algorithms # Medium (61.32%) # Likes: 2593 # Dislikes: 40 # Total Accepted: 123.4K # Total Submissions: 202.1K # Testcase Example: ...
3.34375
3
fetcher.py
SDAChess/epita_r_place
0
12776505
<gh_stars>0 import requests def fetch_image(url): filename = url.split("/")[-1] r = requests.get(url, stream = True) if r.status_code == 200: print('Successfully downloaded image from' + str(url)) return r.raw else: print('Failed to download image...') return None
3.09375
3
fabric_digitalocean/decorators.py
CompileInc/fabric-digitalocean
0
12776506
import digitalocean import os from fabric.decorators import wraps, _wrap_as_new from retry.api import retry_call class TokenError(Exception): pass def _list_annotating_decorator(attribute, *values): """ From fabric.decorators._list_annotating_decorator https://github.com/fabric/fabric/blob/master/fa...
2.28125
2
bob/pipelines/transformers/linearize.py
bioidiap/bob.pipelines
1
12776507
import numpy as np from sklearn.preprocessing import FunctionTransformer from ..wrappers import wrap def linearize(X): X = np.asarray(X) return np.reshape(X, (X.shape[0], -1)) class Linearize(FunctionTransformer): """Extracts features by simply concatenating all elements of the data into one long ...
3.234375
3
{{cookiecutter.app_slug}}/databases/data_column/data.py
ELC/cookiecutter-python-fullstack
5
12776508
from pathlib import Path from contextlib import contextmanager from typing import Any, Iterator, List, Optional import duckdb from ..models.task import Task @contextmanager def database_connection() -> Iterator[duckdb.DuckDBPyConnection]: connection: duckdb.DuckDBPyConnection = duckdb.connect(f"{Path(__file__)....
2.875
3
setup.py
fran6w/pandas-method-chaining
5
12776509
from setuptools import setup requires = ["flake8 > 3.0.0", "attr"] flake8_entry_point = "flake8.extension" long_description = """ A flake8 style checker for pandas method chaining, forked from https://github.com/deppen8/pandas-vet] """ setup( name="pandas-method-chaining", version="0.1.0", author="<NAME...
1.234375
1
sample/django_sample/app/celery_tasks/urls.py
knroy/celery-rmq
0
12776510
<filename>sample/django_sample/app/celery_tasks/urls.py from django.urls import path from .views import CeleryTestView urlpatterns = [ path('', CeleryTestView.as_view(), name='Test') ]
1.648438
2
tests/test_shopitem.py
MrLeeh/shopy
0
12776511
""" test_shopitem.py Copyright 2015 by stefanlehmann """ import pytest from shopy.shop import Shop from shopy.shopitem import ShopItem def test_shopitem_repr(): shop = Shop.from_file('amazon.json') item = ShopItem() item.name = "testitem" item.articlenr = "123" item.price = 12.5 it...
2.6875
3
land_planning_and_allocation/config/land_planning_and_allocation.py
the-bantoo/Land-Planning-And-Allocation
0
12776512
<gh_stars>0 from __future__ import unicode_literals from frappe import _ def get_data(): config = [ { "label": _("Sales"), "items": [ { "type": "doctype", "name": "Customer", "description": _("Customer Database."), "onboard": 1, ...
1.773438
2
eris/setup.py
ahamilton/eris
0
12776513
<reponame>ahamilton/eris #!/usr/bin/env python3.9 import os try: from setuptools import setup except ImportError: from distutils.core import setup REPO_PATH = os.path.dirname(os.getcwd()) setup(name="eris", version="v2022.01.05", description=("Eris maintains an up-to-date set of reports for ever...
1.359375
1
tests/unit/test_scm.py
pavelito/opencoverage
0
12776514
import os from datetime import datetime, timedelta, timezone from unittest.mock import ( AsyncMock, MagicMock, Mock, patch, ) import pytest from opencoverage.clients import scm from tests import utils pytestmark = pytest.mark.asyncio @pytest.fixture(autouse=True) def _clear(): scm.github._token...
2.234375
2
code/statistics.py
Luca-Hackl/Discord-bot
0
12776515
import WebScraping import DiscordBot import mysql.connector import discord from time import time from dotenv import load_dotenv import os import requests import json from datetime import datetime import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt API_URL = "https://serv...
2.65625
3
lib/comm_struct.py
yiding-zhou/UFT
0
12776516
<filename>lib/comm_struct.py #! /usr/bin/ python # Copyright(c) 2021 Intel Corporation # # 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 # # U...
1.796875
2
PostDiffMixture/simulations_folder/simulation_analysis_scripts/scatter_plot_functions.py
SIGKDDanon/SIGKDD2021DeAnonV2
0
12776517
import matplotlib matplotlib.use('Agg') #matplotlib.use("gtk") #matplotlib.use('Qt5Agg') from rectify_vars_and_wald_functions import * import pickle import os import pandas as pd import matplotlib.pyplot as plt import sys sys.path.insert(1, '../../le_experiments/') # print(data) import numpy as np import os from sci...
2.203125
2
src/main.py
dynamitejustice/twitch-cli
0
12776518
<reponame>dynamitejustice/twitch-cli<filename>src/main.py #!/usr/bin/python3 import os import sys import requests import subprocess import json import click from termcolor import colored, COLORS from urllib.parse import urlencode import webbrowser import numpy as np from config import * os.system('color') TWITCH_CLIEN...
2.515625
3
tests/settings.py
bodgerbarnett/django-rest-email-manager
0
12776519
<gh_stars>0 SECRET_KEY = "fake-key" DATABASES = { "default": { "ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:", } } INSTALLED_APPS = [ "django.contrib.auth", "django.contrib.contenttypes", "rest_email_manager", ] TEMPLATES = [ { "BACKEND": "django.template.b...
1.421875
1
bin/commands/corpus.py
davidmcclure/open-syllabus-project
220
12776520
import os import click import csv import random import sys from osp.common import config from osp.common.utils import query_bar from osp.corpus.corpus import Corpus from osp.corpus.models import Document from osp.corpus.models import Document_Format from osp.corpus.models import Document_Text from osp.corpus.jobs im...
2.1875
2
integration_tests/python_tests/test_monitoring.py
redata-team/dbt_re_data
50
12776521
import os import copy import yaml from datetime import datetime, timedelta from .utils.run import dbt_seed, dbt_run, dbt_test, dbt_command RUN_TIME = datetime(2021, 5, 2, 0, 0, 0) DBT_VARS = { 're_data:time_window_start': (RUN_TIME - timedelta(days=1)).strftime("%Y-%m-%d %H:%M:%S"), 're_data:time_window_end':...
2.265625
2
pysph/tools/pysph_to_vtk.py
nauaneed/pysph
293
12776522
<reponame>nauaneed/pysph ''' convert pysph .npz output to vtk file format ''' from __future__ import print_function import os import re from enthought.tvtk.api import tvtk, write_data from numpy import array, c_, ravel, load, zeros_like def write_vtk(data, filename, scalars=None, vectors={'V':('u','v','w')}, tensors...
2.625
3
london_air_quality/__init__.py
robmarkcole/London-Air-Quality
1
12776523
<reponame>robmarkcole/London-Air-Quality<gh_stars>1-10 from datetime import timedelta import requests from typing import List, Dict AUTHORITIES = [ "<NAME>", "Barnet", "Bexley", "Brent", "Bromley", "Camden", "City of London", "Croydon", "Ealing", "Enfield", "Greenwich", ...
3.3125
3
other/dingding/dingtalk/api/rest/OapiEduFaceSearchRequest.py
hth945/pytest
0
12776524
''' Created by auto_sdk on 2020.01.09 ''' from dingtalk.api.base import RestApi class OapiEduFaceSearchRequest(RestApi): def __init__(self,url=None): RestApi.__init__(self,url) self.class_id = None self.height = None self.synchronous = None self.url = None self.userid = None self.width = None def getHt...
1.734375
2
evaluate_doe.py
mattshax/design_tools
1
12776525
<filename>evaluate_doe.py import sys,json import subprocess import sys sys.path.append("models") from model_simple import f_xy sys.path.append("utils") from radar import createRadar from sensitivity import createSensitivity f = open('inputs_doe.csv') inputs = f.readlines() f.close() input_labels=['x','y'] output_la...
2.34375
2
osirisdata/urls.py
KolibriSolutions/BepMarketplace
1
12776526
# Bep Marketplace ELE # Copyright (c) 2016-2021 Kolibri Solutions # License: See LICENSE file or https://github.com/KolibriSolutions/BepMarketplace/blob/master/LICENSE # from django.conf.urls import url from . import views app_name = 'osirisdata' urlpatterns = [ url('^list/$', views.listOsiris, name='list'), ...
1.171875
1
todoapi/migrations/0004_auto_20190129_2103.py
Faysa1/Gestion-Tickets-Taches
0
12776527
# Generated by Django 2.1.4 on 2019-01-29 15:33 from django.db import migrations, models import uuid class Migration(migrations.Migration): dependencies = [ ('todoapi', '0003_todolist_taskid'), ] operations = [ migrations.RemoveField( model_name='todolist', name=...
1.5625
2
argdispatch.py
nazavode/argdispatch
1
12776528
<gh_stars>1-10 # -*- coding: utf-8 -*- # # Copyright 2015 <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 appl...
2.359375
2
s/index_gen.py
andiac/compass
1
12776529
<reponame>andiac/compass import os f = os.popen("ls"); file_list = f.read().split("\n"); print ''' <!-- Here you can add your Google Analytics Tracking code. If you do so, do not forget to set the include_analytics attribute to true on the _config.yml file --> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObj...
2.375
2
neighbours/migrations/0004_auto_20190529_1722.py
lizKimita/Neighbourhoods
0
12776530
<gh_stars>0 # -*- coding: utf-8 -*- # Generated by Django 1.11 on 2019-05-29 14:22 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('neighbours', '00...
1.523438
2
sequencing_analysis/genes_fpkm_tracking.py
dmccloskey/sequencing_analysis
0
12776531
<gh_stars>0 from io_utilities.base_importData import base_importData from io_utilities.base_exportData import base_exportData class genes_fpkm_tracking(): '''Helper class to parse the output from cufflinks http://cole-trapnell-lab.github.io/cufflinks/cufflinks/index.html ''' def __init__(self,genesFpkm...
2.625
3
pyEBOT.py
Ndnes/pyEBOT
0
12776532
<filename>pyEBOT.py import discord # noqa import os import event import configuration import managedMessages import logging from logging import handlers from pydantic import ValidationError from utility import loadData, saveData, checkConfig, sendMessagePackets from constants import Constants from discord.ext import co...
2.34375
2
python/find_significant_sequences_example.py
google/expt-analysis
5
12776533
# # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
2.296875
2
app/project/users/forms.py
ritchie46/base-flask-mvc
1
12776534
<filename>app/project/users/forms.py from flask_wtf import Form from wtforms import StringField, PasswordField from wtforms.validators import DataRequired, Length, EqualTo, Email class RegisterForm(Form): email = StringField('Email', validators=[DataRequired(), Email(), Length(min=6, max=40)]) password = Pass...
2.90625
3
authors/apps/rating/serializers.py
andela/ah-codeofduty
0
12776535
<reponame>andela/ah-codeofduty """ Rating Serializers module """ from django.db.models import Sum, Avg from rest_framework import serializers from rest_framework.validators import UniqueTogetherValidator from .models import Rating from ..articles.serializers import ArticleSerializer from ..articles.models import A...
2.5
2
ai/action/eyedisplay/eyedisplay.py
elephantrobotics-joey/marsai
32
12776536
<gh_stars>10-100 import cv2 import copy import random from PIL import Image, ImageDraw, ImageFont import sys sys.path.append(".") import ai.actionplanner import ai.action.eyedisplay.OLED_Driver as OLED DEFAULT_SP = 0.01 # default speed / time seg ENJOY_SP = 0.06 PIC_COUNT = 10 OPEN = 0 CLOSE = 9 NEARLY_OPEN = 3 NE...
2.28125
2
sdmetrics/base.py
ZhuofanXie/SDMetrics
1
12776537
<filename>sdmetrics/base.py """BaseMetric class.""" class BaseMetric: """Base class for all the metrics in SDMetrics. Attributes: name (str): Name to use when reports about this metric are printed. goal (sdmetrics.goal.Goal): The goal of this metric. min_value ...
2.890625
3
catalog/bindings/gmd/abstract_rs_reference_system_type.py
NIVANorge/s-enda-playground
0
12776538
<reponame>NIVANorge/s-enda-playground from dataclasses import dataclass, field from typing import List, Optional from bindings.gmd.abstract_object_type import AbstractObjectType from bindings.gmd.ex_extent_property_type import ExExtentPropertyType from bindings.gmd.rs_identifier_property_type import RsIdentifierPropert...
1.953125
2
paper_rq/__init__.py
dldevinc/paper-rq
0
12776539
<reponame>dldevinc/paper-rq __version__ = "0.3.3" default_app_config = "paper_rq.apps.Config"
1.054688
1
python/python-algorithm-intervew/8-linked-list/19-reverse-linked-list2-1.py
bum12ark/algorithm
1
12776540
""" 인덱스 m에서 n까지를 역순으로 만들어라. 인덱스 m은 1부터 시작한다. - 입력 1->2->3->4->5->None, m = 2, n = 4 - 출력 1->4->3->2->5->None """ class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next def print_list(self): cur = self while cur: print(cur.val, end='->...
4.125
4
Libraries/Python/CommonEnvironment/v1.0/CommonEnvironment/UnitTests/Decorator_UnitTest.py
davidbrownell/Common_Environment
1
12776541
<reponame>davidbrownell/Common_Environment # Placeholder unit test import os import sys import unittest from CommonEnvironment.CallOnExit import CallOnExit # --------------------------------------------------------------------------- _script_fullpath = os.path.abspath(__file__) if "python" in sys.executable...
2.40625
2
lwlPackage/BaiduPic/dataPro.py
2892211452/myPackage
0
12776542
#分别传入网络连接和本地路径 def request_download(imgUrl, Path): import requests r = requests.get(imgUrl) with open(Path, 'wb') as f: f.write(r.content) if __name__ == "__main__": request_download('https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=2018604370,3101817315&fm=26&gp=0.jpg', 'images/1.j...
3.546875
4
playground/image_captions.py
BarracudaPff/code-golf-data-pythpn
0
12776543
photos = Photo.objects.all() captions = [] for idx, photo in enumerate(photos): if idx > 2: break thumbnail_path = photo.thumbnail.url with open("." + thumbnail_path, "rb") as image_file: encoded_string = base64.b64encode(image_file.read()) encoded_string = str(encoded_string)[2:-1] resp_captions = requests.po...
2.796875
3
ManufacturingNet/models/logistic_regression.py
lalitjg/ManufacturingNet
9
12776544
"""LogRegression trains a logistic regression model implemented by Scikit-Learn on the given dataset. Before training, the user is prompted for parameter input. After training, model metrics are displayed, and the user can make new predictions. View the documentation at https://manufacturingnet.readthedocs.io/. """ i...
3.796875
4
api/routers/email.py
temanisparsh/mailing-system
2
12776545
<gh_stars>1-10 from flask import Blueprint, make_response, request, jsonify, current_app from flask.views import MethodView from controllers import email controller = email.controller router = Blueprint('email', __name__) router.add_url_rule('/draft', view_func = controller['draft']) router.add_url_rule('/<email_id>...
2.1875
2
services/load-test/locustfile.py
DragonBanana/serverless-sock-shop
0
12776546
<gh_stars>0 import base64 from time import sleep from locust import HttpUser, TaskSet, task from random import randint, choice, getrandbits class WebTasks(TaskSet): @task def load(self): user = f"u{getrandbits(64)}" password = f"<PASSWORD>)}" session = bytes(f"{user}:{password}", "ut...
2.375
2
ektelo/algorithm/dawa/partition_engines/l1partition.py
dpcomp-org/ektelo
32
12776547
from __future__ import division from builtins import str import numpy import os import sys import logging from ektelo.algorithm.dawa.cutils import cutil from ektelo.algorithm.dawa.partition_engines import partition_engine from ektelo import util class l1partition_engine(partition_engine.partition_engine): """Use ...
2.328125
2
agent/BHAgent.py
Theoprasus/Abides
0
12776548
<filename>agent/BHAgent.py ''' from agent.examples.SubscriptionAgent import SubscriptionAgent import pandas as pd import random as rd from math import floor from copy import deepcopy class BHAgent(SubscriptionAgent): """ AN agent that simply wake at a random frequency and place a market order investing a percenta...
3.09375
3
python_Scripts/autoregression_final_models_MA.py
BanafshehKhaki/pHandDOprediction-models
1
12776549
<reponame>BanafshehKhaki/pHandDOprediction-models import pandas as pd import numpy as np import sys import matplotlib.pyplot as plt import seaborn as sns import time from statsmodels.tsa.ar_model import AR from statsmodels.tsa.arima_model import ARIMA from sklearn.metrics import mean_squared_error import re import date...
2.84375
3
4. Algorithms - Sorting/4 - QuickSort.py
PacktPublishing/Data-Structures-and-Algorithms-The-Complete-Masterclass
25
12776550
def quickSort(my_array): qshelper(my_array, 0, len(my_array) - 1) return my_array def qshelper(my_array, start, end): if start >= end: return pivot = start left = start + 1 right = end while right >= left: if my_array[left] > my_array[pivot] and my_array[right] < ...
3.796875
4