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 |
|---|---|---|---|---|---|---|
stp_core/common/logging/handlers.py | andkononykhin/plenum | 148 | 5700 | <reponame>andkononykhin/plenum<filename>stp_core/common/logging/handlers.py
import logging
class CallbackHandler(logging.Handler):
def __init__(self, typestr, default_tags, callback, override_tags):
"""
Initialize the handler.
"""
super().__init__()
self.callback = callback... | 2.125 | 2 |
blog/migrations/__init__.py | Amohammadi2/django-SPA-blog | 2 | 5701 | # you just need to add some informations here
| 1.132813 | 1 |
amocrm_asterisk_ng/crm/amocrm/kernel/calls/call_records/file_converters/core/__init__.py | iqtek/amocrn_asterisk_ng | 0 | 5702 | from .IFileConverter import IFileConverter
| 1.140625 | 1 |
tests/blueprint/test_decorators.py | cuenca-mx/agave | 3 | 5703 | <reponame>cuenca-mx/agave
from functools import wraps
from agave.blueprints.decorators import copy_attributes
def i_am_test(func):
@wraps(func)
def wrapper(*args, **kwargs):
return func(*args, **kwargs)
wrapper.i_am_test = True
return wrapper
class TestResource:
@i_am_test
def retr... | 2.40625 | 2 |
tools/python/utils/config_parser.py | hanhan9449/mace | 1 | 5704 | # Copyright 2019 The MACE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 1.664063 | 2 |
main_cross_testing_iseg.py | sami-ets/DeepNormalize | 1 | 5705 | # -*- coding: utf-8 -*-
# Copyright 2019 <NAME>. All Rights Reserved.
#
# Licensed under the MIT License;
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/MIT
#
# Unless required by applicable law or agreed to in writing... | 1.382813 | 1 |
docs/10.level3_demo_streaming/pc_server/server.py | FaBoPlatform/RobotCarAI | 10 | 5706 | <reponame>FaBoPlatform/RobotCarAI<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ClientからOpenCV画像データを受け取り、ライン検出して制御命令を送る
# Server: Jetson TX2
# Client: Jetson TX2/Raspberry Pi3 Docker
# 1. FFMPEG UDP StreamingをClientで実行する。AWS向け10FPS,Jetson TX2向け1FPS
# 2. Serverを起動する
# 3. Clientを起動する
# コード修正
# lib/camera.... | 1.945313 | 2 |
client.py | zackorndorff/revsync | 94 | 5707 | from collections import defaultdict
import json
import re
import redis
import threading
import time
import traceback
import uuid
import base64
import binascii
TTL = 2
hash_keys = ('cmd', 'user')
cmd_hash_keys = {
'comment': ('addr',),
'extra_comment': ('addr',),
'area_comment': ('addr',),
'rename': ('... | 2.171875 | 2 |
ontask/condition/urls.py | pinheiroo27/ontask_b | 33 | 5708 | # -*- coding: utf-8 -*-
"""URLs to manipulate columns."""
from django.urls import path
from ontask.condition import views
app_name = 'condition'
urlpatterns = [
#
# FILTERS
#
path(
'<int:pk>/create_filter/',
views.FilterCreateView.as_view(),
name='create_filter'),
path('<... | 2.09375 | 2 |
VideoClassification/SegmentLevelClassifier/model.py | googleinterns/via-content-understanding | 1 | 5709 | """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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distr... | 2.484375 | 2 |
ivy/functional/backends/jax/old/math.py | faruq2021/ivy | 0 | 5710 | <reponame>faruq2021/ivy<filename>ivy/functional/backends/jax/old/math.py<gh_stars>0
"""
Collection of Jax math functions, wrapped to fit Ivy syntax and signature.
"""
# global
import jax as _jax
import jax.numpy as _jnp
tan = _jnp.tan
acos = _jnp.arccos
atan = _jnp.arctan
atan2 = _jnp.arctan2
cosh = _jnp.cosh
atanh ... | 1.21875 | 1 |
neaten_db.py | Adoni/ZhihuCrawler | 0 | 5711 | <filename>neaten_db.py<gh_stars>0
from pymongo import MongoClient
from pyltp import Segmentor
def insert_questions_from_answered_question():
in_db = MongoClient().zhihu.user_answered_questions
out_db = MongoClient().zhihu_network.questions
existed_question_id = set(map(lambda q: q['_id'], out_db.find()))
... | 2.734375 | 3 |
test/tst_vlen.py | timgates42/netcdf4-python | 574 | 5712 | import sys
import unittest
import os
import tempfile
from netCDF4 import Dataset
import numpy as np
from numpy.testing import assert_array_equal
FILE_NAME = tempfile.NamedTemporaryFile(suffix='.nc', delete=False).name
VL_NAME = 'vlen_type'
VL_BASETYPE = np.int16
DIM1_NAME = 'lon'
DIM2_NAME = 'lat'
nlons = 5; nlats = 5... | 2.203125 | 2 |
sonnet/src/once.py | ScriptBox99/deepmind-sonnet | 10,287 | 5713 | # Copyright 2019 The Sonnet Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 2.828125 | 3 |
env.py | DGarciaMedina/PiArmDiego | 0 | 5714 | <reponame>DGarciaMedina/PiArmDiego
import piarm
import time
import numpy as np
import cv2
import random
class MyArm2D:
def __init__(self, move_robot = False):
self.move_robot = move_robot
if self.move_robot:
self.robot = piarm.PiArm()
self.open_connection()
se... | 2.890625 | 3 |
src/python/src/grpc/_adapter/_links_test.py | jonywtf/grpc | 1 | 5715 | <gh_stars>1-10
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of condi... | 1.4375 | 1 |
tests/_test_progress_board.py | stjordanis/Hyperactive | 382 | 5716 | <gh_stars>100-1000
import os, glob
import subprocess
from subprocess import DEVNULL, STDOUT
abspath = os.path.abspath(__file__)
dir_ = os.path.dirname(abspath)
files = glob.glob(dir_ + "/_progress_board_tests/_test_progress_board_*.py")
for file_path in files:
file_name = str(file_path.rsplit("/", maxsplit=1)[1... | 1.796875 | 2 |
pages/forest_pages.py | jhalljhall/beiwe-backend | 1 | 5717 | import csv
import datetime
from collections import defaultdict
from django.contrib import messages
from django.http.response import FileResponse
from django.shortcuts import redirect, render
from django.utils import timezone
from django.views.decorators.http import require_GET, require_http_methods, require_POST
from... | 2.109375 | 2 |
data_scout/transformations/math_custom.py | janthiemen/data_scout | 0 | 5718 | <filename>data_scout/transformations/math_custom.py
from __future__ import division
from .transformation import Transformation
from pyparsing import (Literal, CaselessLiteral, Word, Combine, Group, Optional,
ZeroOrMore, Forward, nums, alphas, oneOf)
import math
import re
import operator
__autho... | 2.546875 | 3 |
project/cloudmesh-storage/cloudmesh/vdir/api/manager.py | cybertraining-dsc/fa19-516-171 | 0 | 5719 | #
# this manager stores directly into the db wit Database update
from cloudmesh.mongo.DataBaseDecorator import DatabaseUpdate
from cloudmesh.mongo.CmDatabase import CmDatabase
from cloudmesh.common.console import Console
from cloudmesh.storage.Provider import Provider
import os
from datetime import datetime
class Vd... | 2.5 | 2 |
redash/query_runner/influx_db.py | cjpit/redash | 1 | 5720 | import json
import logging
from redash.query_runner import *
from redash.utils import JSONEncoder
logger = logging.getLogger(__name__)
try:
from influxdb import InfluxDBClusterClient
enabled = True
except ImportError:
enabled = False
def _transform_result(results):
result_columns = []
result_r... | 2.21875 | 2 |
ics/mergeGatingSets.py | victorfica/utils | 5 | 5721 | <filename>ics/mergeGatingSets.py
#!/usr/bin/env python
"""
Usage examples:
python /home/agartlan/gitrepo/utils/ics/mergeGatingSets.py --function functions --ncpus 4 --out functions_extract.csv
sbatch -n 1 -t 3-0 -c 4 -o functions_slurm.txt --wrap="python /home/agartlan/gitrepo/utils/ics/mergeGatingSets.py --function ... | 1.335938 | 1 |
meeting.py | zoni/ulauncher-meet | 4 | 5722 | from dataclasses import dataclass
@dataclass
class Meeting:
name: str
id: str
| 1.710938 | 2 |
setup.py | uuosio/uuosio.gscdk | 6 | 5723 | <filename>setup.py<gh_stars>1-10
import os
import shutil
import setuptools
# from skbuild import setup
from distutils.core import setup
from distutils.sysconfig import get_python_lib
import glob
# if os.path.exists('pysrc/tinygo'):
# shutil.rmtree('pysrc/tinygo')
# shutil.copytree('tinygo/build/release/tinygo', ... | 1.75 | 2 |
tests/data_creator_action.py | michalurbanski/bkgames | 0 | 5724 | from typing import Callable
class DataCreatorAction:
def __init__(self, func: Callable, priority_for_creation: int = 99, priority_for_removal: int = 99):
self.func = func
self.priority_for_creation = priority_for_creation
self.priority_for_removal = priority_for_removal
| 2.6875 | 3 |
Python/Numpy/Min and Max/min_and_max.py | brianchiang-tw/HackerRank | 2 | 5725 | import numpy as np
if __name__ == '__main__':
h, w = map( int, input().split() )
row_list = []
for i in range(h):
single_row = list( map(int, input().split() ) )
np_row = np.array( single_row )
row_list.append( np_row )
min_of_each_row = np.min( row_list, axis = 1)
... | 3.40625 | 3 |
allure/pytest_plugin.py | allure-framework/allure-pytest | 112 | 5726 | import uuid
import pickle
import pytest
import argparse
from collections import namedtuple
from six import text_type
from allure.common import AllureImpl, StepContext
from allure.constants import Status, AttachmentType, Severity, \
FAILED_STATUSES, Label, SKIPPED_STATUSES
from allure.utils import parent_module, p... | 2.1875 | 2 |
treenode/debug.py | domlysi/django-treenode | 0 | 5727 | <reponame>domlysi/django-treenode
# -*- coding: utf-8 -*-
from django.conf import settings
from django.db import connection
import logging
import timeit
logger = logging.getLogger(__name__)
class debug_performance(object):
def __init__(self, message_prefix=''):
super(debug_performance, self).__init__... | 2.09375 | 2 |
String_tool.py | vibhorvk/BlendString | 0 | 5728 | bl_info = {
"name": "STRING",
"blender": (2, 80, 0),
"category": "Object",
'Author' : '<NAME>'
}
import bpy
import bmesh
class STRING(bpy.types.Operator):
"""My Object Moving Script""" # Use this as a tooltip for menu items and buttons.
bl_idname = "object.stringtool_ot" ... | 2.640625 | 3 |
Code/DataHandlers/__init__.py | aricsanders/pyMez3 | 2 | 5729 | """
The DataHandlers subpackage is designed to manipulate data, by allowing different data types to be opened,
created, saved and updated. The subpackage is further divided into modules grouped by a common theme. Classes for data
that are already on disk normally follows the following pattern:
`instance=ClassName(file_... | 2.859375 | 3 |
djangomail/backends/dummy.py | somenzz/djangomail | 1 | 5730 | <reponame>somenzz/djangomail
"""
Dummy email backend that does nothing.
"""
from djangomail.backends.base import BaseEmailBackend
class EmailBackend(BaseEmailBackend):
def send_messages(self, email_messages):
return len(list(email_messages))
| 1.820313 | 2 |
awx/plugins/library/scan_services.py | Avinesh/awx | 17 | 5731 | <filename>awx/plugins/library/scan_services.py
#!/usr/bin/env python
import re
from ansible.module_utils.basic import * # noqa
DOCUMENTATION = '''
---
module: scan_services
short_description: Return service state information as fact data
description:
- Return service state information as fact data for various se... | 2.234375 | 2 |
app.py | duckm8795/runscope-circleci | 0 | 5732 | import requests
import sys
import time
import os
def main():
trigger_url = sys.argv[1]
trigger_resp = requests.get(trigger_url)
if trigger_resp.ok:
trigger_json = trigger_resp.json().get("data", {})
test_runs = trigger_json.get("runs", [])
print ("Started {} test runs.".format(l... | 2.71875 | 3 |
spyse/client.py | fabaff/spyse-python | 9 | 5733 | <reponame>fabaff/spyse-python
import requests
from typing import List, Optional
from .models import AS, Domain, IP, CVE, Account, Certificate, Email, DNSHistoricalRecord, WHOISHistoricalRecord
from .response import Response
from .search_query import SearchQuery
from limiter import get_limiter, limit
class DomainsSea... | 2.28125 | 2 |
talleres_inov_docente/figures/plot_helpers.py | jfcaballero/Tutorial-sobre-scikit-learn-abreviado | 576 | 5734 | from matplotlib.colors import ListedColormap
cm3 = ListedColormap(['#0000aa', '#ff2020', '#50ff50'])
cm2 = ListedColormap(['#0000aa', '#ff2020'])
| 2.328125 | 2 |
Applications/FlaskApp/errorpages.py | cemac-ccs/FlaskMWE | 0 | 5735 | <filename>Applications/FlaskApp/errorpages.py
from flask import render_template
# Error Pages ----------------------------------------------------------------
def page_not_found(e):
# note that we set the 404 status explicitly
return render_template('404.html.j2'), 404
def page_not_allowed(e):
# note tha... | 2.625 | 3 |
cppgym/ToyText/BlackJack.py | anhydrous99/cppgym | 0 | 5736 | from .._BlackJack import BlackJackCPP
import gym
import ctypes
import numpy as np
from gym import spaces
class BlackJack(gym.Env):
def __init__(self, natural=False):
self.env = BlackJackCPP(natural)
self.action_space = spaces.Discrete(2)
self.observation_space = spaces.Tuple((
... | 2.625 | 3 |
sdks/python/apache_beam/runners/direct/consumer_tracking_pipeline_visitor_test.py | ajothomas/beam | 5 | 5737 | <gh_stars>1-10
#
# 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.773438 | 2 |
gluon/main.py | scudette/rekall-agent-server | 21 | 5738 | <filename>gluon/main.py
#!/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by <NAME> <<EMAIL>>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
The gluon wsgi application
---------------------------
"""
from __future__ import print_function
if False: ... | 2.0625 | 2 |
agents/EWPublisherAgent.py | marc4gov/tokenspice2 | 1 | 5739 | <filename>agents/EWPublisherAgent.py
import logging
log = logging.getLogger('marketagents')
from enforce_typing import enforce_types # type: ignore[import]
import random
from agents.PublisherAgent import PublisherAgent
from agents.PoolAgent import PoolAgent
from util import constants
from util.constants import POOL_W... | 1.796875 | 2 |
lcls_orbit/__init__.py | slaclab/lcls-orbit | 0 | 5740 | import numpy as np
from . import _version
__version__ = _version.get_versions()['version']
HXR_COLORS = ("#000000", "#02004a", "#030069", "#04008f", "#0500b3", "#0700ff")
SXR_COLORS = ("#000000", "#330000", "#520000", "#850000", "#ad0000", "#ff0000")
HXR_AREAS = {
"GUN" : [2017.911, 2018.712],
"L0" : [2018.... | 2.125 | 2 |
tests/test_optimizers_v2/test_optimizers_v2.py | OverLordGoldDragon/dummy | 0 | 5741 | import os
import tempfile
import numpy as np
import tensorflow as tf
from time import time
from termcolor import cprint
from unittest import TestCase
from .. import K
from .. import Input, Dense, GRU, Bidirectional, Embedding
from .. import Model, load_model
from .. import l2
from .. import maxnorm
from .. import Ada... | 2.171875 | 2 |
koku/reporting/migrations/0099_ocp_performance.py | Vasyka/koku | 2 | 5742 | # Generated by Django 2.2.10 on 2020-02-18 12:51
import django.contrib.postgres.indexes
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [("reporting", "0098_auto_20200221_2034")]
operations = [
migrations.RunSQL(
"""
dro... | 1.835938 | 2 |
sympy/tensor/tests/test_functions.py | iamabhishek0/sympy | 8,323 | 5743 | <reponame>iamabhishek0/sympy<filename>sympy/tensor/tests/test_functions.py
from sympy.tensor.functions import TensorProduct
from sympy import MatrixSymbol, Matrix, Array
from sympy.abc import x, y, z
from sympy.abc import i, j, k, l
A = MatrixSymbol("A", 3, 3)
B = MatrixSymbol("B", 3, 3)
C = MatrixSymbol("C", 3, 3)
... | 2.609375 | 3 |
app/views.py | Kgermando/sem | 0 | 5744 | <reponame>Kgermando/sem
from django.shortcuts import render
# Create your views here.
class MultipleProxyMiddleware:
FORWARDED_FOR_FIELDS = [
'HTTP_X_FORWARDED_FOR',
'HTTP_X_FORWARDED_HOST',
'HTTP_X_FORWARDED_SERVER',
]
def __init__(self, get_response):
self.get_response = ... | 2.234375 | 2 |
webcrawler/crawler/spiders/baselensspider.py | HansZimmer5000/LensComparison | 0 | 5745 | <gh_stars>0
# This module is about my webcrawler with the use of scrapy.
# Its a generell web crawler, but the import and use of GhAdapter makes it usefull for geizhals.de sites.
from abc import ABC, abstractmethod
import scrapy
class BaseLensSpider(scrapy.Spider, ABC):
@property
@abstractmethod
def adapter(self)... | 2.84375 | 3 |
byol_train.py | fjbriones/deep-text-recognition-benchmark | 0 | 5746 | import os
import sys
import time
import random
import string
import argparse
import torch
import torch.backends.cudnn as cudnn
import torch.nn.init as init
import torch.optim as optim
import torch.utils.data
import numpy as np
from utils import CTCLabelConverter, CTCLabelConverterForBaiduWarpctc, AttnLabelConverter, ... | 2.28125 | 2 |
app/__init__.py | dulin/tornado-test | 0 | 5747 | <filename>app/__init__.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- mode: python -*-
import aiopg
import psycopg2
import tornado.locks
from tornado.options import define, options
from tornado.web import Application
from app.application import Application
define('port', default=8080, help="listening port")
... | 2.46875 | 2 |
pipescaler/core/stage.py | KarlTDebiec/PipeScaler | 1 | 5748 | <filename>pipescaler/core/stage.py
#!/usr/bin/env python
# pipescaler/core/stage.py
#
# Copyright (C) 2020-2021 <NAME>
# All rights reserved.
#
# This software may be modified and distributed under the terms of the
# BSD license.
from __future__ import annotations
from abc import ABC, abstractmethod
from imp... | 2.109375 | 2 |
leetcode/970_powerful_integers/970_powerful_integers.py | ryangillard/misc | 0 | 5749 | <gh_stars>0
class Solution(object):
def powerfulIntegers(self, x, y, bound):
"""
:type x: int
:type y: int
:type bound: int
:rtype: List[int]
"""
# Find max exponent
base = max(x, y) if x == 1 or y == 1 else min(x, y)
exponent = 1
if ba... | 3.109375 | 3 |
src/project/api/rankings/urls.py | jSkrod/djangae-react-browser-games-app | 0 | 5750 | <filename>src/project/api/rankings/urls.py
from django.conf.urls import url, include
from project.api.rankings.api import AddRanking, AddScore, GetScoresUser, GetScoresGame
urlpatterns = [
url(r'add_ranking$', AddRanking.as_view()),
url(r'add_score$', AddScore.as_view()),
url(r'get_scores_game$', GetScores... | 1.703125 | 2 |
qiskit_metal/qlibrary/lumped/cap_n_interdigital.py | wdczdj/qiskit-metal | 0 | 5751 | <filename>qiskit_metal/qlibrary/lumped/cap_n_interdigital.py
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source t... | 2.28125 | 2 |
ThirdParty/protobuf-registry/python/protobufs/services/feature/actions/get_flags_pb2.py | getcircle/luno-ios | 0 | 5752 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: protobufs/services/feature/actions/get_flags.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database... | 1.078125 | 1 |
Medium/102_2.py | Hellofafar/Leetcode | 6 | 5753 | <reponame>Hellofafar/Leetcode
# ------------------------------
# Binary Tree Level Order Traversal
#
# Description:
# Given a binary tree, return the level order traversal of its nodes' values. (ie, from
# left to right, level by level).
#
# For example:
# Given binary tree [3,9,20,null,null,15,7],
# 3
# / \
... | 3.984375 | 4 |
mturk/comparison_among_different_models/sample_from_models_for_comparison.py | qiaone/GIF | 322 | 5754 | import sys
sys.path.append('../../')
import constants as cnst
import os
os.environ['PYTHONHASHSEED'] = '2'
import tqdm
from model.stg2_generator import StyledGenerator
import numpy as np
from my_utils.visualize_flame_overlay import OverLayViz
from my_utils.flm_dynamic_fit_overlay import camera_ringnetpp
from my_utils.g... | 1.703125 | 2 |
setup.py | philippWassibauer/django-activity-stream | 4 | 5755 | <reponame>philippWassibauer/django-activity-stream
from distutils.core import setup
""" django-activity-stream instalation script """
setup(
name = 'activity_stream',
description = 'generic activity feed system for users',
author = '<NAME>',
author_email = '<EMAIL>',
url='http://github.com/philipp... | 1.242188 | 1 |
02/selenium.02.py | study-machine-learning/dongheon.shin | 2 | 5756 | <gh_stars>1-10
from selenium import webdriver
username = "henlix"
password = "<PASSWORD>"
browser = webdriver.PhantomJS()
browser.implicitly_wait(5)
url_login = "https://nid.naver.com/nidlogin.login"
browser.get(url_login)
el = browser.find_element_by_id("id")
el.clear()
el.send_keys(username)
el = browser.find_el... | 3.109375 | 3 |
visualization/matplotlib/barwitherror.py | Licas/datascienceexamples | 0 | 5757 | <filename>visualization/matplotlib/barwitherror.py<gh_stars>0
from matplotlib import pyplot as plt
drinks = ["cappuccino", "latte", "chai", "americano", "mocha", "espresso"]
ounces_of_milk = [6, 9, 4, 0, 9, 0]
error = [0.6, 0.9, 0.4, 0, 0.9, 0]
#Yerr -> element at i position represents +/- error[i] variance on bar[i]... | 3.421875 | 3 |
Packs/mnemonicMDR/Integrations/ArgusManagedDefence/ArgusManagedDefence.py | matan-xmcyber/content | 0 | 5758 | import demistomock as demisto
from CommonServerPython import *
""" IMPORTS """
import json
import urllib3
import dateparser
import traceback
from typing import Any, Dict, List, Union
import logging
from argus_api import session as argus_session
from argus_api.api.currentuser.v1.user import get_current_user
from ... | 1.84375 | 2 |
03.py | SnowWolf75/aoc-2020 | 0 | 5759 | #!/usr/bin/env python3
import sys, os
import unittest
from lib.common import *
filename = "inputs/2020_12_03_input.txt"
class day03:
def __init__(self):
pass
class day03part1(day03):
def solve(self, args):
pass
class day03part2(day03):
def solve(self, args):
pass
class exampl... | 3.09375 | 3 |
scripts/examples/tools/capturebat.py | fortinet/ips-bph-framework | 21 | 5760 | <gh_stars>10-100
# Tool Imports
from bph.tools.windows.capturebat import BphCaptureBat as CaptureBat
# Core Imports
from bph.core.server.template import BphTemplateServer as TemplateServer
from bph.core.sample import BphSample as Sample
from bph.core.sample import BphLabFile as LabFile
from bph.core.session imp... | 1.625 | 2 |
dymos/utils/test/test_hermite.py | kaushikponnapalli/dymos | 104 | 5761 | import unittest
import numpy as np
from numpy.testing import assert_almost_equal
from dymos.utils.hermite import hermite_matrices
class TestHermiteMatrices(unittest.TestCase):
def test_quadratic(self):
# Interpolate with values and rates provided at [-1, 1] in tau space
tau_given = [-1.0, 1.0]... | 2.859375 | 3 |
xl_auth/settings.py | libris/xl_auth | 7 | 5762 | # -*- coding: utf-8 -*-
"""Application configuration."""
from __future__ import absolute_import, division, print_function, unicode_literals
import os
from . import __author__, __name__, __version__
class Config(object):
"""Base configuration."""
SERVER_NAME = os.environ.get('SERVER_NAME', None)
PREFER... | 1.71875 | 2 |
tests/mrp/test_mrp_auth.py | evanreichard/pyatv | 0 | 5763 | <gh_stars>0
"""Functional authentication tests with fake MRP Apple TV."""
import inspect
from aiohttp.test_utils import AioHTTPTestCase, unittest_run_loop
import pyatv
from pyatv import exceptions
from pyatv.const import Protocol
from pyatv.conf import MrpService, AppleTV
from pyatv.mrp.server_auth import PIN_CODE, ... | 2.125 | 2 |
tests_app/tests/functional/key_constructor/bits/models.py | maryokhin/drf-extensions | 1 | 5764 | # -*- coding: utf-8 -*-
from django.db import models
class KeyConstructorUserProperty(models.Model):
name = models.CharField(max_length=100)
class Meta:
app_label = 'tests_app'
class KeyConstructorUserModel(models.Model):
property = models.ForeignKey(KeyConstructorUserProperty)
class Meta:... | 2 | 2 |
ngraph_onnx/onnx_importer/utils/numeric_limits.py | cliveseldon/ngraph-onnx | 0 | 5765 | # ******************************************************************************
# Copyright 2018 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.o... | 2.484375 | 2 |
curvpack/utils.py | AbhilashReddyM/curvpack | 8 | 5766 | <filename>curvpack/utils.py
import numpy as np
# The first two functions are modified from MNE surface project. LIcense follows
# This software is OSI Certified Open Source Software. OSI Certified is a certification mark of the Open Source Initiative.
#
# Copyright (c) 2011-2019, authors of MNE-Python. All rights... | 1.851563 | 2 |
tests/unit/core/streams/test_stream_zero.py | tethys-platform/tethys | 2 | 5767 | # Copyright 2020 Konstruktor, Inc. 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
#
# Unless required by applicable la... | 1.804688 | 2 |
amd64-linux/lib/ppc64_simple_components.py | qiyancos/Simics-3.0.31 | 1 | 5768 | ## Copyright 2005-2007 Virtutech AB
##
## The contents herein are Source Code which are a subset of Licensed
## Software pursuant to the terms of the Virtutech Simics Software
## License Agreement (the "Agreement"), and are being distributed under
## the Agreement. You should have received a copy of the Agreeme... | 2.171875 | 2 |
Front-end (Django)/course/migrations/0002_subject_number_of_questions.py | shadow0403bsr/AutomatedGradingSoftware | 0 | 5769 | # Generated by Django 3.0.1 on 2020-02-15 06:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('course', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='subject',
name='Number_Of_Questions',
... | 1.734375 | 2 |
cornflow/tests/unit/test_dags.py | pchtsp/corn | 5 | 5770 | """
Unit test for the DAG endpoints
"""
# Import from libraries
import json
# Import from internal modules
from cornflow.shared.const import EXEC_STATE_CORRECT, EXEC_STATE_MANUAL
from cornflow.tests.const import (
DAG_URL,
EXECUTION_URL_NORUN,
CASE_PATH,
INSTANCE_URL,
)
from cornflow.tests.unit.test_e... | 2.46875 | 2 |
nets/resnet.py | xwshi/faster-rcnn-keras | 0 | 5771 | #-------------------------------------------------------------#
# ResNet50的网络部分
#-------------------------------------------------------------#
import keras.backend as K
from keras import backend as K
from keras import initializers, layers, regularizers
from keras.engine import InputSpec, Layer
from keras.init... | 2.734375 | 3 |
app/api/deps.py | congdh/fastapi-realworld | 0 | 5772 | <gh_stars>0
from typing import Generator
from fastapi import Depends, HTTPException
from fastapi.security import APIKeyHeader
from sqlalchemy.orm import Session
from starlette import status
from app import crud, models
from app.core import security
from app.db.session import SessionLocal
JWT_TOKEN_PREFIX = "Token" ... | 2.234375 | 2 |
src/raiden_libs/contract_info.py | netcriptus/raiden-services | 13 | 5773 | <filename>src/raiden_libs/contract_info.py
import sys
from typing import Dict, List, Tuple
import structlog
from eth_utils import to_canonical_address
from raiden.utils.typing import Address, BlockNumber, ChainID, Optional
from raiden_contracts.contract_manager import (
ContractDevEnvironment,
ContractManager... | 2.328125 | 2 |
meta_dataset/models/functional_classifiers.py | letyrodridc/meta-dataset | 0 | 5774 | # coding=utf-8
# Copyright 2022 The Meta-Dataset 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.28125 | 2 |
app.py | Shrinidhi-C/Context-Based-Question-Answering | 16 | 5775 | <gh_stars>10-100
import os
import threading
import shutil
from datetime import timedelta, datetime
from flask import Flask, render_template, request, session, jsonify, url_for, redirect
from haystack.document_store.elasticsearch import *
from haystack.preprocessor.utils import convert_files_to_dicts
from haystack.prepr... | 2.15625 | 2 |
timevortex/utils/filestorage.py | timevortexproject/timevortex | 0 | 5776 | #!/usr/bin/python3
# -*- coding: utf8 -*-
# -*- Mode: Python; py-indent-offset: 4 -*-
"""File storage adapter for timevortex project"""
import os
from os import listdir, makedirs
from os.path import isfile, join, exists
from time import tzname
from datetime import datetime
import pytz
import dateutil.parser
from djan... | 2.390625 | 2 |
main_tg.py | olegush/quiz-bot | 0 | 5777 | <reponame>olegush/quiz-bot<filename>main_tg.py
import os
import logging
import logging.config
from functools import partial
from dotenv import load_dotenv
from telegram import Bot, ReplyKeyboardMarkup, ReplyKeyboardRemove
from telegram.ext import (Updater, CommandHandler, MessageHandler,
Regex... | 2.328125 | 2 |
tf_fourier_features/fourier_features_mlp.py | titu1994/tf_fourier_features | 37 | 5778 | import tensorflow as tf
from typing import Optional
from tf_fourier_features import fourier_features
class FourierFeatureMLP(tf.keras.Model):
def __init__(self, units: int, final_units: int, gaussian_projection: Optional[int],
activation: str = 'relu',
final_activation: str = "l... | 3.234375 | 3 |
eek/spider.py | fusionbox/eek | 5 | 5779 | <filename>eek/spider.py
import urlparse
import csv
import sys
import re
import collections
import time
import requests
from eek import robotparser # this project's version
from bs4 import BeautifulSoup
try:
import lxml
except ImportError:
HTML_PARSER = None
else:
HTML_PARSER = 'lxml'
encoding_re = re.c... | 2.734375 | 3 |
observations/r/zea_mays.py | hajime9652/observations | 199 | 5780 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def zea_mays(path):
"""Darwin's Heights of Cross- and ... | 3.109375 | 3 |
ois_api_client/v3_0/dto/Lines.py | peterkulik/ois_api_client | 7 | 5781 | <filename>ois_api_client/v3_0/dto/Lines.py
from typing import List
from dataclasses import dataclass
from .Line import Line
@dataclass
class Lines:
"""Product / service items
:param merged_item_indicator: Indicates whether the data exchange contains merged line data due to size reduction
:param line: Pro... | 1.875 | 2 |
parsing_documents.py | leylafenix/belief-network-irs | 0 | 5782 | <filename>parsing_documents.py<gh_stars>0
__author__ = '<NAME>'
import os
import pprint
def read_block(f):
s = ""
line = f.readline()
while line and not line.startswith("."):
s += line
line = f.readline()
return s, line
def read_doc(f):
doc = {"title": "", "autho... | 3.1875 | 3 |
groups/admin.py | caktus/rapidsms-groups | 1 | 5783 | <reponame>caktus/rapidsms-groups<gh_stars>1-10
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
from django.contrib import admin
from groups.models import Group
admin.site.register(Group)
| 1.179688 | 1 |
avod/datasets/kitti/kitti_aug_test.py | Ascend-Huawei/AVOD | 0 | 5784 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 1.414063 | 1 |
application/model/_base.py | keysona/blog | 0 | 5785 | <gh_stars>0
from flask_sqlalchemy import SQLAlchemy, Model
# class BaseModel(Model):
# def save(self):
# db.session.add(self)
# db.session.commit(self)
# def delete(self):
# db.session.
db = SQLAlchemy()
| 2.34375 | 2 |
kvmagent/kvmagent/plugins/prometheus.py | qianfei11/zstack-utility | 0 | 5786 | <filename>kvmagent/kvmagent/plugins/prometheus.py
import os.path
import threading
import typing
from prometheus_client import start_http_server
from prometheus_client.core import GaugeMetricFamily, REGISTRY
from kvmagent import kvmagent
from zstacklib.utils import http
from zstacklib.utils import jsonobject
from zsta... | 1.898438 | 2 |
recipes/libstudxml/all/conanfile.py | rockandsalt/conan-center-index | 562 | 5787 | from conans import ConanFile, AutoToolsBuildEnvironment, MSBuild, tools
from conans.errors import ConanInvalidConfiguration
import os
import shutil
required_conan_version = ">=1.33.0"
class LibStudXmlConan(ConanFile):
name = "libstudxml"
description = "A streaming XML pull parser and streaming XML serializer... | 1.921875 | 2 |
dataset/WebCariA.py | KeleiHe/DAAN | 9 | 5788 |
# Copyright 2020 <NAME> & <NAME> (<EMAIL>)
# 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 a... | 2.125 | 2 |
moonworm/crawler/state/json_state.py | zomglings/moonworm | 10 | 5789 | <reponame>zomglings/moonworm<gh_stars>1-10
import datetime
import json
import time
from typing import Optional
from web3.datastructures import AttributeDict
from .event_scanner_state import EventScannerState
class JSONifiedState(EventScannerState):
"""Store the state of scanned blocks and all events.
All s... | 2.515625 | 3 |
npbench/benchmarks/nbody/nbody_dace.py | frahlg/npbench | 27 | 5790 | <reponame>frahlg/npbench<filename>npbench/benchmarks/nbody/nbody_dace.py
# Adapted from https://github.com/pmocz/nbody-python/blob/master/nbody.py
# TODO: Add GPL-3.0 License
import numpy as np
import dace as dc
"""
Create Your Own N-body Simulation (With Python)
<NAME> (2020) Princeton Univeristy, @PMocz
Simulate orb... | 2.625 | 3 |
application/__init__.py | Healthy-Kokoro/Hiroshima | 0 | 5791 | <gh_stars>0
# Third-party imports
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
configurations = {
'development': 'configurations.DevelopmentConfiguration',
'testing': 'configurations.TestingConfiguration',
'staging': 'configurations.StagingConfiguration',
'production': 'configurations.Production... | 1.953125 | 2 |
lesson5/exceptions_except.py | drednout/letspython | 1 | 5792 | def take_beer(fridge, number=1):
if "beer" not in fridge:
raise Exception("No beer at all:(")
if number > fridge["beer"]:
raise Exception("Not enough beer:(")
fridge["beer"] -= number
if __name__ == "__main__":
fridge = {
"beer": 2,
"milk": 1,
"meat": 3,
}... | 3.984375 | 4 |
icfs/filesystem/exceptions.py | bhanupratapjain/icfs | 0 | 5793 | class ICFSError(IOError):
"""Error while making any filesystem API requests."""
| 1.578125 | 2 |
synapse/storage/data_stores/state/store.py | juhovan/synapse | 1 | 5794 | # -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 1.859375 | 2 |
core/migrations/0011_itemvariation_variation.py | manulangat1/djcommerce | 1 | 5795 | # Generated by Django 2.2.6 on 2020-02-09 12:24
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0010_auto_20200130_1135'),
]
operations = [
migrations.CreateModel(
name='Variation',
... | 1.710938 | 2 |
mnist/convolutional.py | Colins-Ford/mnist-webapp | 0 | 5796 | import os
from mnist import model
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
data = input_data.read_data_sets("data/dataset/", one_hot=True)
# model
with tf.variable_scope("convolutional"):
x = tf.placeholder(tf.float32, [None, 784])
keep_prob = tf.placeholder(tf.float... | 3.140625 | 3 |
parse_scripts/import_osm.py | nokout/au_address | 1 | 5797 | import requests
import codecs
query1 = """<union>
<query type="way">
<has-kv k="addr:housenumber"/>
<has-kv k="addr:street:name"/>
<has-kv k="addr:street:type"/>
<has-kv k="addr:state"/>
<bbox-query e="%s" n="%s" s="%s" w="%s"/>
</query>
<query type="way">
<has-kv k="addr:housenumber"/>
<ha... | 2.1875 | 2 |
tools/test_net_batch.py | abhirevan/pedestrian-detector | 0 | 5798 | #!/usr/bin/env python
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# --------------------------------------------------------
"""Test a Fast R-CNN network on an image database."""
... | 2.375 | 2 |
mygallary/urls.py | mangowilliam/my_gallary | 0 | 5799 | <gh_stars>0
from django.conf import settings
from django.conf.urls.static import static
from django.conf.urls import url
from . import views
urlpatterns = [
url('^$', views.gallary,name = 'gallary'),
url(r'^search/', views.search_image, name='search_image'),
url(r'^details/(\d+)',views.search_location,na... | 1.789063 | 2 |