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
17b.py
znuxor/adventofcode2017
0
30300
<filename>17b.py<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- from collections import deque puzzle_input = 377 # puzzle_input = 3 my_circular_buffer = deque() my_circular_buffer.append(0) for i in range(1, 50000000+1): new_pos = puzzle_input % len(my_circular_buffer) my_circular_buffer.rotate(-...
2.953125
3
aiobotocore/configprovider.py
vemel/aiobotocore
0
30301
from botocore.configprovider import os, SmartDefaultsConfigStoreFactory class AioSmartDefaultsConfigStoreFactory(SmartDefaultsConfigStoreFactory): async def merge_smart_defaults(self, config_store, mode, region_name): if mode == 'auto': mode = await self.resolve_auto_mode(region_name) ...
2.03125
2
modulemd/tests/ModulemdTests/module.py
val-verde/libmodulemd
28
30302
#!/usr/bin/python3 # This file is part of libmodulemd # Copyright (C) 2017-2018 <NAME> # # Fedora-License-Identifier: MIT # SPDX-2.0-License-Identifier: MIT # SPDX-3.0-License-Identifier: MIT # # This program is free software. # For more information on the license, see COPYING. # For more information on free software,...
2.03125
2
tests/stress/conftest.py
lolyu/sonic-mgmt
132
30303
import logging import pytest from tests.common.utilities import wait_until from utils import get_crm_resources, check_queue_status, sleep_to_wait CRM_POLLING_INTERVAL = 1 CRM_DEFAULT_POLL_INTERVAL = 300 MAX_WAIT_TIME = 120 logger = logging.getLogger(__name__) @pytest.fixture(scope='module') def get_function_conple...
2.15625
2
mamonsu/lib/zbx_template.py
dan-aksenov/mamonsu
0
30304
<gh_stars>0 # -*- coding: utf-8 -*- from mamonsu.lib.const import Template class ZbxTemplate(object): mainTemplate = u"""<?xml version="1.0" encoding="UTF-8"?> <zabbix_export> <version>2.0</version> <groups> <group> <name>Templates</name> </group> </groups> <templates> ...
1.40625
1
src/rhasspy_desktop_satellite/exceptions.py
mcorino/rhasspy-desktop-satellite
0
30305
"""This module contains exceptions defined for Rhasspy Desktop Satellite.""" class RDSatelliteServerError(Exception): """Base class for exceptions raised by Rhasspy Desktop Satellite code. By catching this exception type, you catch all exceptions that are defined by the Hermes Audio Server code.""" cla...
2.875
3
KMeans.py
trinity652/Skin-Cancer-Classification
16
30306
<gh_stars>10-100 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Oct 30 17:48:49 2017 @author: abhilasha Using SKLearns API for performing Kmeans clustering. Using sklearn.datasets.make_blobs for generating randomized gaussians for clustering. """ import numpy as np from matplotlib import pyplot ...
3.734375
4
test/unit/test_classical_explainer.py
tomdyer10/interpret-text
1
30307
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- # Tests for classical explainer from interpret_text.experimental.classical import ClassicalTextExplainer from sklearn.model_selection impor...
2.84375
3
create_python_app/main.py
xuchaoqian/create-python-app
0
30308
import argparse from create_python_app.path_utils import * from create_python_app.create_gitignore_file import create_gitignore_file from create_python_app.create_license_file import create_license_file from create_python_app.create_makefile_file import create_makefile_file from create_python_app.create_readme_file imp...
2.203125
2
Lexical Analyzer.py
amitnandi04/Compiler_Construction
0
30309
<filename>Lexical Analyzer.py # Lexical Analyzer import re # for performing regex expressions tokens = [] # for string tokens source_code = 'int result = 100;'.split() # turning source code into list of words # Loop through each source code word f...
4
4
user.py
genba2/pinybotbeta-enhanced
0
30310
import time class User: """ A class representing a users information. NOTE: Defaults are attributes that pinylib expects """ def __init__(self, **kwargs): # Default's. self.lf = kwargs.get('lf') self.account = kwargs.get('account', '') self.is_owner = kwargs.get('ow...
3.28125
3
my_python_module/exceptions.py
a358003542/wanze_python_project
1
30311
<filename>my_python_module/exceptions.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ python系统内的异常 +-- Exception +-- StopIteration +-- StopAsyncIteration +-- ArithmeticError | +-- FloatingPointError | +-- OverflowError | +-- ZeroDivisionError +-- AssertionError ...
2.546875
3
catbridge_tools/isbn_tools.py
victoriamorris/CatBridge
0
30312
<reponame>victoriamorris/CatBridge<filename>catbridge_tools/isbn_tools.py #!/usr/bin/env python # -*- coding: utf-8 -*- # ==================== # Set-up # ==================== # Import required modules import re __author__ = '<NAME>' __license__ = 'MIT License' __version__ = '1.0.0' __status__ = ...
2.625
3
tests/test_shows_tab.py
andrsd/podcastista
0
30313
<filename>tests/test_shows_tab.py import platform import pytest from unittest.mock import MagicMock from PyQt5 import QtWidgets if platform.system() == "Darwin": @pytest.fixture def widget(qtbot, main_window): from podcastista.ShowsTab import ShowsTab widget = ShowsTab(main_window) qtb...
2.234375
2
Solver.py
ANewDeviloper/Rubiks-Simulator
0
30314
# -*- coding: utf8 -*- import CubeModel methodIDs = {1 : "TLPU", 2 : "TLPD", 3 : "TVMPU", 4 : "TVMPD", 5 : "TRPU", 6 : "TRPD", 7 : "TFPR", 8 : "TFPL", 9 : "TOMPR", 10 : "TOMPL", 11 : "TBPR", 12 : "TBPL", 13 : "TUPR", 14 : "TUPL", 15 : "THMPR", 16 : "THMPL", 17...
2.921875
3
tests/python/contrib/test_ethosu/cascader/test_ethosu_conv2d_matcher.py
LEA0317/incubator-tvm
90
30315
<gh_stars>10-100 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License...
1.5
2
__init__.py
mendhak/aws-elb-logster
2
30316
# # Python init file #
1.03125
1
tests/testing_support/validators/validate_serverless_payload.py
newrelic/newrelic-python-agen
92
30317
# Copyright 2010 New Relic, Inc. # # 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 writ...
1.6875
2
kakao_message_utils/request_token.py
hahagarden/project_news_summarize
0
30318
<filename>kakao_message_utils/request_token.py import token_def # To get Authorization Code # https://kauth.kakao.com/oauth/authorize?client_id=cc335daa766cc74b3de1b1c372a6cce8&response_type=code&redirect_uri=https://localhost.com KAKAO_APP_KEY = "<KEY>" # REST_API app key AUTHORIZATION_CODE = "<KEY>" # once in a r...
2.59375
3
test/unit/messages/bloxroute/test_abstract_bloxroute_message.py
dolphinridercrypto/bxcommon
12
30319
<filename>test/unit/messages/bloxroute/test_abstract_bloxroute_message.py<gh_stars>10-100 from bxcommon.test_utils.abstract_test_case import AbstractTestCase from bxcommon import constants from bxcommon.messages.bloxroute.abstract_bloxroute_message import AbstractBloxrouteMessage from bxcommon.messages.bloxroute.bloxro...
2.078125
2
test/python/LIM2Metrics/py3/base/common/Bridge/Bridge.py
sagodiz/SonarQube-plug-in
20
30320
# Implementor class drawing_api: def draw_circle(self, x, y, radius): pass # ConcreteImplementor 1/2 class drawing_api1(drawing_api): def draw_circle(self, x, y, radius): print('API1.circle at %f:%f radius %f' % (x, y, radius)) # ConcreteImplementor 2/2 class drawing_api2(drawing_api): d...
3.5625
4
server/main.py
priyanshujha98/leilaportal
0
30321
<reponame>priyanshujha98/leilaportal #! /usr/bin/env python3.6 """ server.py Stripe Sample. Python 3.6 or newer required. """ import stripe import json import os import requests #flask from flask import Flask, render_template, jsonify, request, send_from_directory, session, Session from flask_session import Session...
2.0625
2
src/synthesize_predictions.py
bluetyson/concept-tagging-training
10
30322
import argparse import logging from pathlib import Path import dask import h5py import joblib import numpy as np import pandas as pd from dask.diagnostics import ProgressBar from tqdm import tqdm from dsconcept.get_metrics import ( get_cat_inds, get_synth_preds, load_category_models, load_concept_mode...
1.921875
2
LeetCode/python/211-240/216-cobination-sum-iii/solution.py
shootsoft/practice
0
30323
<reponame>shootsoft/practice class Solution: # @param {integer} k # @param {integer} n # @return {integer[][]} def combinationSum3(self, k, n): nums = range(1, 10) self.results = [] self.combination(nums, n, k, 0, []) return self.results def combination(self, nums, ...
3.109375
3
service/resources/appointment_offer.py
SFDigitalServices/otc_appointments
0
30324
"""Email module""" #pylint: disable=too-few-public-methods import json import os import falcon import requests from mako.template import Template import sendgrid from sendgrid.helpers.mail import Email, To, Content, Mail from .hooks import validate_access FROM_EMAIL = "<EMAIL>" SUBJECT = "Appointment Offering" SPREADS...
2.09375
2
matfactor/__init__.py
Joshua-Chin/matfactor
1
30325
<reponame>Joshua-Chin/matfactor from ._factorize import factorize
0.925781
1
C++/1059-All-Paths-from-Source-Lead-to-Destination/soln-1.py
wyaadarsh/LeetCode-Solutions
5
30326
class Solution { public: bool leadsToDestination(int n, vector<vector<int>>& edges, int source, int destination) { for(auto & edge : edges) { int u = edge[0], v = edge[1]; graph[u].push_back(v); } vector<bool> visited(n, false); return dfs(source, destination,...
2.21875
2
docs/source/renderers/chart_renderer_example.py
steveblamey/django-report-tools
33
30327
<gh_stars>10-100 from report_tools.renderers import ChartRenderer class MyChartRenderer(ChartRenderer): @classmethod def render_piechart(cls, chart_id, options, data, renderer_options): return "<div id='%s' class='placeholder'>Pie Chart</div>" % chart_id @classmethod def render_columnchart(cl...
2.5
2
app.py
lwalkk/truck-website
0
30328
from flask import Flask, request from flask import render_template from flask_mysqldb import MySQL import TimeCalc from datetime import datetime, timedelta app = Flask(__name__) app.config['MYSQL_USER'] = 'root' app.config['MYSQL_PASSWORD'] = 'password' app.config['MYSQL_HOST'] = 'localhost' app.config['MYSQL_DB'] = '...
2.421875
2
test/test_children_tree.py
kisliakovsky/structures
0
30329
<filename>test/test_children_tree.py from unittest import TestCase from src.tree import ChildrenTree class TestChildrenTree(TestCase): def test_height(self): tree = ChildrenTree(1, [[], [3, 4], [], [], [0, 2]]) self.assertEqual(3, tree.height())
3.03125
3
conanfile.py
bincrafters/conan-gtk
0
30330
from conans import ConanFile, Meson, tools from conans.errors import ConanInvalidConfiguration import os class LibnameConan(ConanFile): name = "gtk" description = "libraries used for creating graphical user interfaces for applications." topics = ("conan", "gtk", "widgets") url = "https://github.com/bi...
2.265625
2
Testcase11-Real-world-app-emulation/trace-gen/src/generateActionIATMapping.py
sangroad/ServerlessBench
0
30331
<gh_stars>0 # this file is for debug import os import yaml SECONDS_OF_A_DAY = 3600*24 MILLISECONDS_PER_SEC = 1000 config = yaml.load(open(os.path.join(os.path.dirname(__file__),'config.yaml')), yaml.FullLoader) SAMPLE_NUM = config['sample_number'] workloadDir = "../CSVs/%i" % SAMPLE_NUM def generateActionIATMapping(...
2.15625
2
electronics/ltspice/rc_lowpass/calc.py
qeedquan/misc_utilities
8
30332
<filename>electronics/ltspice/rc_lowpass/calc.py #!/usr/bin/env python # http://sim.okawa-denshi.jp/en/CRtool.php # A RC circuit can act as a low pass filter when fed different AC frequencies if we hook # them up in a serial way # We can calculate various values of the filters using the formulas below from math impor...
3.71875
4
apps/log_search/tasks/mapping.py
kiritoscs/bk-log
0
30333
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making BK-LOG 蓝鲸日志平台 available. Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. BK-LOG 蓝鲸日志平台 is licensed under the MIT License. License for BK-LOG 蓝鲸日志平台: ------------------------------------------------...
1.085938
1
eliza.py
lucasmelin/eliza
0
30334
<filename>eliza.py # https://sites.google.com/view/elizagen-org/the-original-eliza from dataclasses import dataclass from typing import List, Pattern import re import random from rich.console import Console from rich.panel import Panel from time import sleep class Eliza: def __init__(self): pass def ...
3.109375
3
aws_artifact_copy/services/ecr.py
schlarpc/aws-artifact-copy
0
30335
<filename>aws_artifact_copy/services/ecr.py import argparse import hashlib import json import os import sys import tarfile import trio from ..common.botocore import ( create_async_session, create_async_client, partial_client_methods, ) from ..common.serialization import json_dumps_canonical async def up...
1.992188
2
iniciante/1132.py
samucosta13/URI-Online-Judge
2
30336
<filename>iniciante/1132.py X = int(input()) Y = int(input()) soma = 0 if X > Y: troca = Y Y = X X = troca sam = X while sam <= Y: if sam%13 != 0: soma = soma + sam sam += 1 print(soma)
3.484375
3
InformationSecurity/phone-number.py
eduardormonteiro/PythonPersonalLibrary
0
30337
import phonenumbers from phonenumbers import geocoder phone = input('type phone number format(+551100000000): ') phone_number = phonenumbers.parse(phone) print(geocoder.description_for_number(phone_number, 'pt'))
3.28125
3
src/extract_old_site/modules/standard_text_chapter.py
aychen99/Excavating-Occaneechi-Town
1
30338
<gh_stars>1-10 from bs4 import BeautifulSoup from pathlib import Path import os def extract_page_content(html_string, folder_path_str): """Extract contents of a page from a report*b.html file. Parameters ---------- html_string : str The HTML content of the report*b.html page to be extracted, a...
3.265625
3
Pyrado/tests/environment_wrappers/test_action_delay.py
KhanhThiVo/SimuRLacra
0
30339
# Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and # Technical University of Darmstadt. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code mus...
1.4375
1
firmware/uvc_controller/mbed-os/features/storage/filesystem/littlefs/TESTS/util/stats.py
davewhiiite/uvc
1
30340
<filename>firmware/uvc_controller/mbed-os/features/storage/filesystem/littlefs/TESTS/util/stats.py #!/usr/bin/env python import re import sys import subprocess import os def main(*args): with open('main.cpp') as file: tests = file.read() cases = [] with open('template_all_names.txt') ...
2.1875
2
doltpy/cli/write/write.py
jzcruiser/doltpy
0
30341
import csv import datetime import io import logging import os import tempfile from typing import Any, Callable, List, Mapping, Optional, Set import pandas as pd # type: ignore from doltpy.cli import Dolt from doltpy.shared.helpers import columns_to_rows logger = logging.getLogger(__name__) CREATE, FORCE_CREATE, RE...
2.4375
2
codeformatter/formatter.py
ephenyxshop/sublimetext-codeformatter
676
30342
# @author <NAME> # @copyright Copyright (c) 2008-2015, <NAME> aka LONGMAN (<EMAIL>) # @link http://longman.me # @license The MIT License (MIT) import os import sys import re import sublime directory = os.path.dirname(os.path.realpath(__file__)) libs_path = os.path.join(director...
1.773438
2
splash/teams/teams_routes.py
dylanmcreynolds/splash-server
0
30343
from typing import List, Optional from attr import dataclass from fastapi import APIRouter, Security from fastapi.exceptions import HTTPException from fastapi import Header from pydantic import BaseModel from pydantic.tools import parse_obj_as from splash.api.auth import get_current_user from splash.service import Spl...
2.390625
2
iotbx/xds/xds_cbf.py
dperl-sol/cctbx_project
155
30344
#!/usr/bin/env libtbx.python # # iotbx.xds.xds_cbf.py # # <NAME>, Diamond Light Source, 2012/OCT/16 # # Class to read the CBF files used in XDS # from __future__ import absolute_import, division, print_function class reader: """A class to read the CBF files used in XDS""" def __init__(self): pass def re...
2.625
3
py_bipartite_matching/graphs_utils.py
FranciscoMoretti/PyBipartiteMatching
1
30345
# utils for graphs of the networkx library import copy import networkx as nx from networkx.algorithms.shortest_paths import shortest_path from typing import Any, Union, Optional, Iterator, Iterable, Tuple, Dict, List, cast LEFT = 0 RIGHT = 1 def top_nodes(graph: nx.Graph, data: bool = False) -> Union[I...
3.21875
3
tools/lttng.py
Taritsyn/ChakraCore
8,664
30346
#------------------------------------------------------------------------------------------------------- # Copyright (C) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. #-------------------------------------------------------------...
1.679688
2
PythonSelenium/src/server.py
talhaHavadar/MomTV
1
30347
""" Handles all requests that coming from phone """ import socketserver import bot from bot import TVBot class TCPSocketHandler(socketserver.StreamRequestHandler): """ Handles the tcp socket connection """ def handle(self): self.bot = TVBot() while True: self.data = ...
3.25
3
pydemic/fitting/Rt.py
PyDemic/pydemic
3
30348
import pandas as pd from . import K from .epidemic_curves import epidemic_curve from .utils import cases from .. import formulas from ..diseases import disease as get_disease from ..docs import docstring ARGS = """Args: model ({'SIR', 'SEIR', 'SEAIR', etc}): Epidemic model used to compute R(t) from K(...
3.046875
3
python/tests/spark/sql/codegen/test_sklearn_flavor.py
askintution/rikai
1
30349
<gh_stars>1-10 # Copyright (c) 2021 Rikai Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
2.265625
2
Leetcode/week_2/p0811_subdomain_visit_count.py
SamSamhuns/wallbreakers_projekts
1
30350
<reponame>SamSamhuns/wallbreakers_projekts<filename>Leetcode/week_2/p0811_subdomain_visit_count.py from typing import List from collections import defaultdict class Solution: def subdomainVisits(self, cpdomains: List[str]) -> List[str]: domain_visits = defaultdict(int) for cpdomain in cpdomains:...
3.265625
3
h2o-bindings/bin/pyunit_parser_test.py
vishalbelsare/h2o-3
6,098
30351
<reponame>vishalbelsare/h2o-3 #!/usr/bin/env python # -*- encoding: utf-8 -*- """Test case for pyparser.""" from __future__ import division, print_function import os import re import textwrap import tokenize from future.builtins import open import pyparser def _make_tuple(op): return lambda x: (op, x) NL = tok...
2.5625
3
tools/pot/openvino/tools/pot/algorithms/quantization/accuracy_aware_common/algorithm.py
chccc1994/openvino
2,406
30352
<reponame>chccc1994/openvino # Copyright (C) 2020-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import os import random from copy import deepcopy from sys import maxsize import numpy as np from .utils import create_metric_config, is_preset_performance, \ get_mixed_preset_config, evaluate_model, ge...
1.523438
2
Django-React/exemple/api/migrations/0002_rename_created_app_room_created_at.py
S-c-r-a-t-c-h-y/coding-projects
0
30353
<filename>Django-React/exemple/api/migrations/0002_rename_created_app_room_created_at.py # Generated by Django 3.2 on 2021-07-03 21:26 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('api', '0001_initial'), ] operations = [ migrations.RenameFiel...
1.859375
2
exceptions.py
italovalcy/mef_eline
1
30354
<filename>exceptions.py """MEF Eline Exceptions.""" class MEFELineException(Exception): """MEF Eline Base Exception.""" class EVCException(MEFELineException): """EVC Exception.""" class ValidationException(EVCException): """Exception for validation errors.""" class FlowModException(MEFELineException...
1.695313
2
stack.py
Shahadate-Rezvy/Samon_EXplainer
0
30355
<reponame>Shahadate-Rezvy/Samon_EXplainer import numpy as np from Orange.base import Learner, Model from Orange.modelling import Fitter from Orange.classification import LogisticRegressionLearner from Orange.classification.base_classification import LearnerClassification from Orange.data import Domain, ContinuousVaria...
2.6875
3
tests/test8u20/main.py
potats0/javaSerializationTools
124
30356
import yaml from javaSerializationTools import JavaString, JavaField, JavaObject, JavaEndBlock from javaSerializationTools import ObjectRead from javaSerializationTools import ObjectWrite if __name__ == '__main__': with open("../files/7u21.ser", "rb") as f: a = ObjectRead(f) obj = a.readContent()...
2.265625
2
getmysql_threadid.py
wang1352083/mysql_tool
0
30357
#!/usr/bin/env python import sys base31=pow(2,31) base32=pow(2,32) base=0xFFFFFFFF ''' mysql 中processlist和mysql.log中记录的 threadid不一致.因此做一个转换 from :processlist.threadid -> mysql.log.threadid ''' def long_to_short(pid): if pid <base31: return pid elif base31 <= pid < base32: return pid -base32 ...
3.015625
3
mediapipe_api/csharp_proto_src.bzl
laukaho/MediaPipeUnityPlugin
20
30358
<reponame>laukaho/MediaPipeUnityPlugin<filename>mediapipe_api/csharp_proto_src.bzl # Copyright (c) 2021 homuler # # Use of this source code is governed by an MIT-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/MIT. """Proto compiler Macro for generating C# source files co...
1.320313
1
bertopic/__init__.py
louisguitton/BERTopic
1
30359
from bertopic._bertopic import BERTopic __version__ = "0.9.1" __all__ = [ "BERTopic", ]
1.054688
1
dailyfresh/df_goods/views.py
myworldhere/dailyfresh
0
30360
<reponame>myworldhere/dailyfresh # coding=utf-8 from django.shortcuts import render, redirect from django.core.paginator import Paginator from models import * from haystack.views import SearchView # Create your views here. def index(request): category_list = Category.objects.all() array = [] for category...
2.453125
2
guillotina_amqp/tests/mocks.py
vjove/guillotina_amqp
4
30361
import asyncio import uuid class MockChannel: def __init__(self): self.published = [] self.acked = [] self.nacked = [] async def publish(self, *args, **kwargs): self.published.append({"args": args, "kwargs": kwargs}) async def basic_client_ack(self, *args, **kwargs): ...
2.3125
2
foodbot/urls.py
surajpaib/HungerHero
0
30362
from django.conf.urls import url from . import views urlpatterns = [ url(r'^bot/', views.webhook, name='bot'), url(r'^foodcenter/', views.food_center_webhook, name= 'food'), # url(r'^relay/', vi) ]
1.523438
2
pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/l2vpn/configure.py
CiscoTestAutomation/genielibs
94
30363
"""Common configure functions for bgp""" # Python import logging import re # Unicon from unicon.core.errors import SubCommandFailure log = logging.getLogger(__name__) def configure_l2vpn_storm_control( device, interface, service_instance_id, storm_control ): """ Configures storm control under service insta...
2.5625
3
MagiSlack/__main__.py
riemannulus/MagiSlack
0
30364
from os import environ from MagiSlack.io import MagiIO from MagiSlack.module import MagiModule def hello_world(*args, **kwargs): return f"HELLO WORLD! user {kwargs['name']}, {kwargs['display_name']}" if __name__ == '__main__': print('Magi Start!') print('='*30) print('MagiModule Initializing.') ...
2.25
2
my_plugins/YouCompleteMe/third_party/ycmd/ycmd/tests/server_utils_test.py
liutongliang/myVim
2
30365
<gh_stars>1-10 # Copyright (C) 2016-2018 ycmd contributors # # This file is part of ycmd. # # ycmd is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
1.726563
2
spraycharles/utils/notify.py
Tw1sm/passwordpredator
0
30366
<filename>spraycharles/utils/notify.py<gh_stars>0 import pymsteams from discord_webhook import DiscordWebhook from notifiers import get_notifier def slack(webhook, host): slack = get_notifier("slack") slack.notify(message=f"Credentials guessed for host: {host}", webhook_url=webhook) def teams(webhook, host)...
2.15625
2
manage.py
SinnerSchraderMobileMirrors/django-cms
2
30367
<reponame>SinnerSchraderMobileMirrors/django-cms #!/usr/bin/env python import sys from cms.test_utils.cli import configure from cms.test_utils.tmpdir import temp_dir import os def main(): with temp_dir() as STATIC_ROOT: with temp_dir() as MEDIA_ROOT: configure( 'sqlite://local...
1.617188
2
semantic-clustering/semantic_clustering/EmbeddingDataFrameWrapper.py
zzoia/sbert_wk_sentence_embedder
0
30368
<gh_stars>0 import numpy as np import pandas as pd from sklearn.metrics.pairwise import cosine_similarity class EmbeddingDataFrameWrapper: def __init__(self, path_to_csv, embedder=None, text_column="text", pooling="embedding", print_results=True): self.embed_df = pd.read_pickle(path_to_csv) self.e...
2.796875
3
sawyer/flat_goal_env.py
geyang/gym-sawyer
4
30369
<reponame>geyang/gym-sawyer import gym import numpy as np # wrapper classes are anti-patterns. def FlatGoalEnv(env, obs_keys, goal_keys): """ We require the keys to be passed in explicitly, to avoid mistakes. :param env: :param obs_keys: obs_keys=('state_observation',) :param goal_keys: goal_keys...
2.46875
2
sql/views_ajax.py
Galo1117/archer
0
30370
# -*- coding: UTF-8 -*- import re import simplejson as json import datetime import multiprocessing import urllib.parse import subprocess from django.contrib.auth import authenticate, login from django.db.models import Q from django.db import transaction from django.conf import settings from django.views.decorators....
1.8125
2
gather/handlers/__init__.py
openghg/gather
0
30371
<reponame>openghg/gather from ._scrape import scrape_handler from ._binary_data import data_handler from ._crds import crds_handler __all__ = ["scrape_handler", "data_handler"]
1.085938
1
bitswap/block_storage/__init__.py
VladislavSufyanov/py-bitswap
0
30372
<filename>bitswap/block_storage/__init__.py from .base_block_storage import BaseBlockStorage
1.140625
1
src/users/models.py
ofirr/OpenCommunity
0
30373
from django.conf import settings from django.contrib.auth.models import BaseUserManager, AbstractBaseUser, \ PermissionsMixin from django.core.mail import send_mail from django.db import models from django.template.loader import render_to_string from django.utils import timezone from django.utils.translation import...
2.125
2
src/hyperloop/Python/tests/test_magnetic_drag.py
jcchin/Hyperloop_v2
1
30374
<reponame>jcchin/Hyperloop_v2<filename>src/hyperloop/Python/tests/test_magnetic_drag.py """ Test for magnetic_drag.py. Uses test values and outputs given by the laminated sheet experiment in [1]. """ import pytest from hyperloop.Python.pod.magnetic_levitation.magnetic_drag import MagDrag import numpy as np from openmd...
2.25
2
back_end/dosage_dao.py
claire-sivan/pharmaceticual_web_based_app
0
30375
def get_dosages(connection): cursor = connection.cursor() query = ("SELECT * from dosage") cursor.execute(query) response = [] for (dosage_id, dosage_name) in cursor: response.append({ 'dosage_id': dosage_id, 'dosage_name': dosage_name }) retur...
3.03125
3
mmseg/models/losses/tversky_loss.py
yunchu/mmsegmentation
3
30376
<gh_stars>1-10 # Copyright (C) 2018-2021 kornia # SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # """Modified from https://kornia.readthedocs.io/en/v0.1.2/_modules/torchgeometry/losses/tversky.html""" import torch import torch.nn as nn import torch....
2.109375
2
replay.py
Plummy-Panda/MITM-V
0
30377
<gh_stars>0 import socket import config def main(): # get the login info, which is extracted from the packet f = open('data/msg.txt', 'r') msg = f.read() sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server_address = (config.HOST, config.PORT) print 'connecting to %s port %s' % ser...
2.9375
3
sim.py
julieisdead/jtwitter-simulator
1
30378
import jtweeter access_token = "TWITTER_APP_ACCESS_TOKEN" access_token_secret = "TWITTER_APP_ACCESS_TOKEN_SECRET" consumer_key = "TWITTER_APP_CONSUMER_KEY" consumer_secret = "TWITTER_APP_CONSUMER_SECRET" user_id = 000000000 #user id of twitter user to simulate. def main(): jtweeter.tweet(access_token, ac...
2.625
3
nobeldb/cli.py
ionrock/nobeldb
0
30379
<filename>nobeldb/cli.py<gh_stars>0 # -*- coding: utf-8 -*- import csv import pkg_resources import textwrap import click from tabulate import tabulate default_data = pkg_resources.resource_filename('nobeldb', 'data/nobel.csv') def reader(fh): rows = csv.DictReader(fh) for row in rows: yield {k: v.d...
3.03125
3
gnome/global_eigenvector/script.py
imlegend19/MDSN-DevRank
0
30380
import pickle import numpy as np def fetch_file(path): with open(path, 'rb') as fp: return pickle.load(fp) def fetch_adj_mat(column): if column == 0: return A1 elif column == 1: return A2 elif column == 2: return A3 # elif column == 3: # return A4 print(...
2.65625
3
brute.py
mirfansulaiman/python-bruteforce-script
1
30381
#!/usr/bin/env python # Name : Simple Bruteforce v.0.1 # Author: mirfansulaiman # Indonesian Backtrack Team | Kurawa In Disorder # http://indonesianbacktrack.or.id # http://mirfansulaiman.com/ # http://ctfs.me/ # # have a bug? report to <EMAIL> or PM at http://indonesianbacktrack.or.id/forum/user-10440.html # # Note :...
3.1875
3
flask_strapi/__init__.py
ToraNova/flask-strapi
1
30382
<reponame>ToraNova/flask-strapi import requests import sys, traceback from flask import session, abort from werkzeug.local import LocalProxy from functools import wraps strapi_session = LocalProxy(lambda: _get_strapi_session()) null_session = LocalProxy(lambda: _get_null_session()) def clear_strapi_session(): _po...
2.078125
2
code_generation.py
irinaid/MAlice
1
30383
<gh_stars>1-10 from sys import stdout from evaluate_expression import * from operations_and_expressions import * from write import * regs = ["r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"] relational_ops = [ ">", ">=", "<", "<=", "!=", "=="] allocationTable = {} globalTable = {} stack = [] BYTE_SIZE = 8 IF_NUMB...
2.890625
3
desafios/desafio059.py
carlosdaniel-cyber/my-python-exercises
0
30384
<reponame>carlosdaniel-cyber/my-python-exercises from time import sleep n1 = int(input('Primeiro valor: ')) n2 = int(input('Segundo valor: ')) op = 0 while op != 5: print(''' [ 1 ] somar [ 2 ] multiplicar [ 3 ] maior [ 4 ] novos números [ 5 ] sair do programa''') op = int(input('>>>>> Qual é ...
3.796875
4
curso em video/python/mundo 1/ex033.py
KenzoDezotti/cursoemvideo
0
30385
<filename>curso em video/python/mundo 1/ex033.py c = int(input('digite o primeiro numero: ')) b = int(input('digite o segundo numero: ')) a = int(input('digite o terceiro numero: ')) cores= {'vermelho': '\033[0;31m', 'azul' : '\033[1;34m', 'zero': '\033[m' } # qual o maior maior = a if b > c and b > a: ...
3.984375
4
pythonCore/ch03/E12.py
Furzoom/learnpython
0
30386
#!/usr/bin/env python # -*- coding: utf-8 -*- def read_text_file(): # get filename fname = raw_input('Enter filename: ') print # attempt to open file for reading try: fobj = open(fname, 'r') except IOError, e: print '*** file open error:', e else: # display content...
4.0625
4
configs/__init__.py
fswzb/autotrade
1
30387
<gh_stars>1-10 # coding=utf-8 common_mysql_config = { 'user': 'root', 'passwd': '', 'host': '127.0.0.1', 'db': 'autotrade', 'connect_timeout': 3600, 'charset': 'utf8' } yongjinbao_config = {"account": "帐号", "password": "<PASSWORD>"} guangfa_config = {"username": "加密的客户号", "password": "<PASSWO...
1.601563
2
pytictactoe.py
ruel/PyTicTacToe
1
30388
#!/usr/bin/python ''' PyTicTacToe - Tic Tac Toe in Python http://ruel.me Copyright (c) 2010, <NAME> - <EMAIL> All rights reserved. Redistribution and use in source and binary forms, with or without * Redistributions of source code must retain the above copyright notice, this list of conditions and the fol...
2.734375
3
plot/comparison.py
yketa/UBC---Spring-2018---code
1
30389
""" Module comparison superimposes most probable local density, maximum cooperativity, time of maximum cooperativity and ratio of transversal and longitudinal correlations at time of maximum cooperativity, as functions of the Péclet number, for different trajectories in the phase diagram (either varying persistence tim...
1.703125
2
sitewebapp/migrations/0014_auto_20210130_0425.py
deucaleon18/debsoc-nitdgp-website
2
30390
# Generated by Django 2.2.15 on 2021-01-29 22:55 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('sitewebapp', '0013_auto_20210130_0409'), ] operations = [ migrations.RemoveField( model_name='...
1.46875
1
tests/micropython/heapalloc_exc_compressed.py
andihoff98/micropython
2
30391
<filename>tests/micropython/heapalloc_exc_compressed.py import micropython # Tests both code paths for built-in exception raising. # mp_obj_new_exception_msg_varg (exception requires decompression at raise-time to format) # mp_obj_new_exception_msg (decompression can be deferred) # NameError uses mp_obj_new_exception...
2.390625
2
scripts/plot/klt_track_length.py
raphaelchang/omni_slam_eval
7
30392
<filename>scripts/plot/klt_track_length.py import h5py import numpy as np import matplotlib.pyplot as plt import seaborn as sns import pandas import os from parse import parse import argparse parser = argparse.ArgumentParser(description='Plot tracking evaluation results') parser.add_argument('results_path', help='trac...
2.171875
2
jtlib/test_client.py
bminard/jtlib
0
30393
<filename>jtlib/test_client.py # -*-coding:Utf-8 -* #-------------------------------------------------------------------------------- # jtlib: test_client.py # # jtlib module client test code. #-------------------------------------------------------------------------------- # BSD 2-Clause License # # Copyright (c) 20...
1.359375
1
corsair/ibm/qradar/__init__.py
forkd/corsair
7
30394
import urllib.request from urllib.parse import urlencode from json import loads from socket import timeout from ssl import _create_unverified_context from corsair import * class Api(object): def __init__(self, base_url, auth, tls_verify=True): self.base_url = base_url if base_url[-1] != '/' else base_ur...
2.328125
2
coop/guide/context_processors.py
jalibras/coop
1
30395
<reponame>jalibras/coop from guide.models import Area def nav(request): areas = Area.objects.all() return { 'areas':areas, }
1.890625
2
python/ccxt/async_support/bitmax.py
mariuszskon/ccxt
4
30396
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.async_support.ascendex import ascendex class bitmax(ascendex): def describe(self): return self.deep_extend(super(b...
1.6875
2
path_to_root.py
Wsoukkachang/Python
0
30397
from queue import Queue def convert_arr_to_binary_tree(arr): """ Takes arr representing level-order traversal of Binary Tree """ index = 0 length = len(arr) if length <= 0 or arr[0] == -1: return None root = BinaryTreeNode(arr[index]) index += 1 queue = Queue() qu...
4.25
4
users/forms.py
henryyang42/NTHUOJ_web
0
30398
<reponame>henryyang42/NTHUOJ_web<filename>users/forms.py """ The MIT License (MIT) Copyright (c) 2014 NTHUOJ team 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 wi...
1.710938
2
arena/objects/line.py
syreal17/ARENA-py
0
30399
from .arena_object import Object from ..attributes import Position class Line(Object): """ Class for Line in the ARENA. """ def __init__(self, start=Position(0,0,0), end=Position(10,10,10), **kwargs): super().__init__(object_type="line", start=start, end=end, **kwargs)
2.765625
3