max_stars_repo_path stringlengths 4 286 | max_stars_repo_name stringlengths 5 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.03M | content_cleaned stringlengths 6 1.03M | language stringclasses 111
values | language_score float64 0.03 1 | comments stringlengths 0 556k | edu_score float64 0.32 5.03 | edu_int_score int64 0 5 |
|---|---|---|---|---|---|---|---|---|---|---|
src/main/NLP/STRING_MATCH/scopus_ha_module_match.py | alvinajacquelyn/COMP0016_2 | 0 | 9100 | import os, sys, re
import json
import pandas as pd
import pymongo
from main.LOADERS.publication_loader import PublicationLoader
from main.MONGODB_PUSHERS.mongodb_pusher import MongoDbPusher
from main.NLP.PREPROCESSING.preprocessor import Preprocessor
class ScopusStringMatch_HAmodule():
def __ini... | import os, sys, re
import json
import pandas as pd
import pymongo
from main.LOADERS.publication_loader import PublicationLoader
from main.MONGODB_PUSHERS.mongodb_pusher import MongoDbPusher
from main.NLP.PREPROCESSING.preprocessor import Preprocessor
class ScopusStringMatch_HAmodule():
def __ini... | en | 0.823004 | Visualises progress for a process given a current count and a total count Given a set of publications in a dictionary, performs pre-processing for all string type data fields.
Performs look-up on HA keyword occurences in a document.
Results are pushed to MongoDB (backed-up in JSON file - scopu... | 2.758062 | 3 |
tools/urls.py | Cyberdeep/archerysec | 0 | 9101 | <reponame>Cyberdeep/archerysec
# _
# /\ | |
# / \ _ __ ___| |__ ___ _ __ _ _
# / /\ \ | '__/ __| '_ \ / _ \ '__| | | |
# / ____ \| | | (__| | | | __/ | | |_| |
# /_/ \_\_| \___|_| |_|\___|_| \__, |
# __/ |
# ... | # _
# /\ | |
# / \ _ __ ___| |__ ___ _ __ _ _
# / /\ \ | '__/ __| '_ \ / _ \ '__| | | |
# / ____ \| | | (__| | | | __/ | | |_| |
# /_/ \_\_| \___|_| |_|\___|_| \__, |
# __/ |
# |___/
# Copyright (C) 20... | en | 0.516802 | # _ # /\ | | # / \ _ __ ___| |__ ___ _ __ _ _ # / /\ \ | '__/ __| '_ \ / _ \ '__| | | | # / ____ \| | | (__| | | | __/ | | |_| | # /_/ \_\_| \___|_| |_|\___|_| \__, | # __/ | # |___/ # Copyright (C) 20... | 1.743809 | 2 |
api/vm/base/utils.py | erigones/esdc-ce | 97 | 9102 | from core.celery.config import ERIGONES_TASK_USER
from que.tasks import execute, get_task_logger
from vms.models import SnapshotDefine, Snapshot, BackupDefine, Backup, IPAddress
logger = get_task_logger(__name__)
def is_vm_missing(vm, msg):
"""
Check failed command output and return True if VM is not on comp... | from core.celery.config import ERIGONES_TASK_USER
from que.tasks import execute, get_task_logger
from vms.models import SnapshotDefine, Snapshot, BackupDefine, Backup, IPAddress
logger = get_task_logger(__name__)
def is_vm_missing(vm, msg):
"""
Check failed command output and return True if VM is not on comp... | en | 0.913991 | Check failed command output and return True if VM is not on compute node. This helper function deletes snapshots for VM with changing disk IDs. Bug #chili-363 ++ Bug #chili-220 - removing snapshot and backup definitions for removed disks. Helper function used below. It sets the IP usage back to VM [1] only if other... | 2.134816 | 2 |
993_Cousins-in-Binary-Tree.py | Coalin/Daily-LeetCode-Exercise | 3 | 9103 | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def isCousins(self, root: TreeNode, x: int, y: int) -> bool:
x_depth = None
x_parent = None... | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def isCousins(self, root: TreeNode, x: int, y: int) -> bool:
x_depth = None
x_parent = None... | en | 0.53741 | # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right | 3.741704 | 4 |
docker-images/taigav2/taiga-back/tests/integration/test_tasks_tags.py | mattcongy/itshop | 1 | 9104 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 <NAME> <<EMAIL>>
# Copyright (C) 2014-2016 <NAME> <<EMAIL>>
# Copyright (C) 2014-2016 <NAME> <<EMAIL>>
# Copyright (C) 2014-2016 <NAME> <<EMAIL>>
# Copyright (C) 2014-2016 <NAME> <<EMAIL>>
# This program is free software: you can redistribute it and/or modify
# it under... | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 <NAME> <<EMAIL>>
# Copyright (C) 2014-2016 <NAME> <<EMAIL>>
# Copyright (C) 2014-2016 <NAME> <<EMAIL>>
# Copyright (C) 2014-2016 <NAME> <<EMAIL>>
# Copyright (C) 2014-2016 <NAME> <<EMAIL>>
# This program is free software: you can redistribute it and/or modify
# it under... | en | 0.77976 | # -*- coding: utf-8 -*- # Copyright (C) 2014-2016 <NAME> <<EMAIL>> # Copyright (C) 2014-2016 <NAME> <<EMAIL>> # Copyright (C) 2014-2016 <NAME> <<EMAIL>> # Copyright (C) 2014-2016 <NAME> <<EMAIL>> # Copyright (C) 2014-2016 <NAME> <<EMAIL>> # This program is free software: you can redistribute it and/or modify # it under... | 2.04193 | 2 |
pytorchocr/postprocess/cls_postprocess.py | satchelwu/PaddleOCR2Pytorch | 3 | 9105 | import torch
class ClsPostProcess(object):
""" Convert between text-label and text-index """
def __init__(self, label_list, **kwargs):
super(ClsPostProcess, self).__init__()
self.label_list = label_list
def __call__(self, preds, label=None, *args, **kwargs):
if isinstance(preds, ... | import torch
class ClsPostProcess(object):
""" Convert between text-label and text-index """
def __init__(self, label_list, **kwargs):
super(ClsPostProcess, self).__init__()
self.label_list = label_list
def __call__(self, preds, label=None, *args, **kwargs):
if isinstance(preds, ... | en | 0.769787 | Convert between text-label and text-index | 2.599187 | 3 |
inference_folder.py | aba-ai-learning/Single-Human-Parsing-LIP | 0 | 9106 | #!/usr/local/bin/python3
# -*- coding: utf-8 -*-
import os
import argparse
import logging
import numpy as np
from PIL import Image
import matplotlib
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
from torchvision import transforms
import cv2
import tqdm
from net.pspnet import PSPNet
models = {
... | #!/usr/local/bin/python3
# -*- coding: utf-8 -*-
import os
import argparse
import logging
import numpy as np
from PIL import Image
import matplotlib
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
from torchvision import transforms
import cv2
import tqdm
from net.pspnet import PSPNet
models = {
... | en | 0.413267 | #!/usr/local/bin/python3 # -*- coding: utf-8 -*- # transforms.Resize((192, 256), 3), # always index 0 # show image # colorbar legend # --------------- model --------------- # # ------------ load image ------------ # | 2.073383 | 2 |
src/random_policy.py | shuvoxcd01/Policy-Evaluation | 0 | 9107 | from src.gridworld_mdp import GridWorld
class EquiprobableRandomPolicy:
def __init__(self):
self.world_model = GridWorld()
def get_prob(self, selected_action, state):
assert state in self.world_model.states
assert selected_action in self.world_model.actions
num_all_possible_a... | from src.gridworld_mdp import GridWorld
class EquiprobableRandomPolicy:
def __init__(self):
self.world_model = GridWorld()
def get_prob(self, selected_action, state):
assert state in self.world_model.states
assert selected_action in self.world_model.actions
num_all_possible_a... | none | 1 | 2.727045 | 3 | |
sktime/classification/feature_based/_summary_classifier.py | Rubiel1/sktime | 1 | 9108 | <filename>sktime/classification/feature_based/_summary_classifier.py
# -*- coding: utf-8 -*-
"""Summary Classifier.
Pipeline classifier using the basic summary statistics and an estimator.
"""
__author__ = ["MatthewMiddlehurst"]
__all__ = ["SummaryClassifier"]
import numpy as np
from sklearn.ensemble import RandomFo... | <filename>sktime/classification/feature_based/_summary_classifier.py
# -*- coding: utf-8 -*-
"""Summary Classifier.
Pipeline classifier using the basic summary statistics and an estimator.
"""
__author__ = ["MatthewMiddlehurst"]
__all__ = ["SummaryClassifier"]
import numpy as np
from sklearn.ensemble import RandomFo... | en | 0.595299 | # -*- coding: utf-8 -*- Summary Classifier. Pipeline classifier using the basic summary statistics and an estimator. Summary statistic classifier. This classifier simply transforms the input data using the SummaryTransformer transformer and builds a provided estimator using the transformed data. Paramete... | 3.14307 | 3 |
coding/reverse_bits/starter.py | skumaravelan/tech-interview-questions | 14 | 9109 | class Solution:
# @param n, an integer
# @return an integer
def reverseBits(self, n):
| class Solution:
# @param n, an integer
# @return an integer
def reverseBits(self, n):
| en | 0.106937 | # @param n, an integer # @return an integer | 2.786227 | 3 |
Topics/Submitting data/POST Request With Several Keys/main.py | valenciarichards/hypernews-portal | 1 | 9110 | <reponame>valenciarichards/hypernews-portal
from django.shortcuts import redirect
from django.views import View
class TodoView(View):
all_todos = []
def post(self, request, *args, **kwargs):
todo = request.POST.get("todo")
important = request.POST.get("important")
if todo not in self.... | from django.shortcuts import redirect
from django.views import View
class TodoView(View):
all_todos = []
def post(self, request, *args, **kwargs):
todo = request.POST.get("todo")
important = request.POST.get("important")
if todo not in self.all_todos:
if important:
... | none | 1 | 2.190704 | 2 | |
pypeln/thread/api/to_iterable_thread_test.py | quarckster/pypeln | 1,281 | 9111 | <filename>pypeln/thread/api/to_iterable_thread_test.py
import typing as tp
from unittest import TestCase
import hypothesis as hp
from hypothesis import strategies as st
import pypeln as pl
import cytoolz as cz
MAX_EXAMPLES = 10
T = tp.TypeVar("T")
@hp.given(nums=st.lists(st.integers()))
@hp.settings(max_examples=MA... | <filename>pypeln/thread/api/to_iterable_thread_test.py
import typing as tp
from unittest import TestCase
import hypothesis as hp
from hypothesis import strategies as st
import pypeln as pl
import cytoolz as cz
MAX_EXAMPLES = 10
T = tp.TypeVar("T")
@hp.given(nums=st.lists(st.integers()))
@hp.settings(max_examples=MA... | none | 1 | 2.5772 | 3 | |
pybinsim/pose.py | fkleinTUI/pyBinSim | 0 | 9112 | import logging
from collections import namedtuple
logger = logging.getLogger("pybinsim.Pose")
class Orientation(namedtuple('Orientation', ['yaw', 'pitch', 'roll'])):
pass
class Position(namedtuple('Position', ['x', 'y', 'z'])):
pass
class Custom(namedtuple('CustomValues', ['a', 'b', 'c'])):
pass
cl... | import logging
from collections import namedtuple
logger = logging.getLogger("pybinsim.Pose")
class Orientation(namedtuple('Orientation', ['yaw', 'pitch', 'roll'])):
pass
class Position(namedtuple('Position', ['x', 'y', 'z'])):
pass
class Custom(namedtuple('CustomValues', ['a', 'b', 'c'])):
pass
cl... | en | 0.275541 | # 'old' format: orientation - position # 'new' format: orientation - position - custom | 2.798831 | 3 |
morphocut_server/extensions.py | madelinetharp/morphocut-server | 0 | 9113 | <filename>morphocut_server/extensions.py
from flask_sqlalchemy import SQLAlchemy
from flask_redis import FlaskRedis
from flask_migrate import Migrate
# from flask_rq2 import RQ
from rq import Queue
from morphocut_server.worker import redis_conn
database = SQLAlchemy()
redis_store = FlaskRedis()
migrate = Migrate()
r... | <filename>morphocut_server/extensions.py
from flask_sqlalchemy import SQLAlchemy
from flask_redis import FlaskRedis
from flask_migrate import Migrate
# from flask_rq2 import RQ
from rq import Queue
from morphocut_server.worker import redis_conn
database = SQLAlchemy()
redis_store = FlaskRedis()
migrate = Migrate()
r... | en | 0.480525 | # from flask_rq2 import RQ | 1.520519 | 2 |
acq4/drivers/ThorlabsMFC1/tmcm.py | aleonlein/acq4 | 1 | 9114 | from __future__ import print_function
"""
Low-level serial communication for Trinamic TMCM-140-42-SE controller
(used internally for the Thorlabs MFC1)
"""
import serial, struct, time, collections
try:
# this is nicer because it provides deadlock debugging information
from acq4.util.Mutex import RecursiveMut... | from __future__ import print_function
"""
Low-level serial communication for Trinamic TMCM-140-42-SE controller
(used internally for the Thorlabs MFC1)
"""
import serial, struct, time, collections
try:
# this is nicer because it provides deadlock debugging information
from acq4.util.Mutex import RecursiveMut... | en | 0.758466 | Low-level serial communication for Trinamic TMCM-140-42-SE controller (used internally for the Thorlabs MFC1) # this is nicer because it provides deadlock debugging information ## relative imports not allowed when running from command prompt, so ## we adjust sys.path when running the script for testing # decorator for ... | 2.148772 | 2 |
tests/generators/ios/test_core_data.py | brianleungwh/signals | 3 | 9115 | import unittest
from signals.generators.ios.core_data import get_current_version, get_core_data_from_folder
class CoreDataTestCase(unittest.TestCase):
def test_get_current_version(self):
version_name = get_current_version('./tests/files/doubledummy.xcdatamodeld')
self.assertEqual(version_name, 'du... | import unittest
from signals.generators.ios.core_data import get_current_version, get_core_data_from_folder
class CoreDataTestCase(unittest.TestCase):
def test_get_current_version(self):
version_name = get_current_version('./tests/files/doubledummy.xcdatamodeld')
self.assertEqual(version_name, 'du... | none | 1 | 2.394328 | 2 | |
mcmc/plot_graph.py | hudalao/mcmc | 0 | 9116 | <filename>mcmc/plot_graph.py
# commend the lines for plotting using
import matplotlib.pyplot as plt
import networkx as nx
def plot_graph(G, N, time_point, posi):
#setting up for graph plotting
#setting the positions for all nodes
pos = {}
for ii in range(N):
pos[ii] = posi[ii]
# plt.figure(... | <filename>mcmc/plot_graph.py
# commend the lines for plotting using
import matplotlib.pyplot as plt
import networkx as nx
def plot_graph(G, N, time_point, posi):
#setting up for graph plotting
#setting the positions for all nodes
pos = {}
for ii in range(N):
pos[ii] = posi[ii]
# plt.figure(... | en | 0.443927 | # commend the lines for plotting using #setting up for graph plotting #setting the positions for all nodes # plt.figure(time_point + 1) # nodes # nx.draw_networkx_nodes(G[time_point],pos,node_size=200) # edges # nx.draw_networkx_edges(G[time_point],pos,edgelist=elarge,width=3) # nx.draw_networkx_edges(G[tim... | 3.097418 | 3 |
Number Theory/Sieve_of_Eratosthenes.py | mishrakeshav/Competitive-Programming | 2 | 9117 | from sys import stdin
input = stdin.readline
N = int(input())
primes = [1]*(N+1)
primes[0] = 0
primes[1] = 0
for i in range(2,int(N**0.5)+1):
if primes[i]:
for j in range(i*i,N+1,i):
primes[j] = 0
for i in range(N+1):
if primes[i]:
print(i,end = " ")
| from sys import stdin
input = stdin.readline
N = int(input())
primes = [1]*(N+1)
primes[0] = 0
primes[1] = 0
for i in range(2,int(N**0.5)+1):
if primes[i]:
for j in range(i*i,N+1,i):
primes[j] = 0
for i in range(N+1):
if primes[i]:
print(i,end = " ")
| none | 1 | 3.400944 | 3 | |
powerline/lib/tree_watcher.py | kruton/powerline | 19 | 9118 | <filename>powerline/lib/tree_watcher.py
# vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, absolute_import, print_function)
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import sys
import os
import errno
from time import sleep
from powerline.l... | <filename>powerline/lib/tree_watcher.py
# vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, absolute_import, print_function)
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import sys
import os
import errno
from time import sleep
from powerline.l... | en | 0.929685 | # vim:fileencoding=utf-8:noet Add watches for this directory and all its descendant directories, recursively. # There may exist a link which leads to an endless # add_watches loop or to maximum recursion depth exceeded # The entry could have been deleted between listdir() and # add_watch(). # We silently ignore entri... | 2.192193 | 2 |
python/qisys/test/fake_interact.py | PrashantKumar-sudo/qibuild | 0 | 9119 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2019 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" Fake Interact """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2019 SoftBank Robotics. All rights reserved.
# Use of this source code is governed by a BSD-style license (see the COPYING file).
""" Fake Interact """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import... | en | 0.684124 | #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2012-2019 SoftBank Robotics. All rights reserved. # Use of this source code is governed by a BSD-style license (see the COPYING file). Fake Interact A class to tests code depending on qisys.interact FakeInteract Init Answers Getter Answers Setter Find Answer... | 2.750968 | 3 |
muselsl/cli.py | kowalej/muse-lsl | 2 | 9120 | #!/usr/bin/python
import sys
import argparse
class main:
def __init__(self):
parser = argparse.ArgumentParser(
description='Python package for streaming, recording, and visualizing EEG data from the Muse 2016 headset.',
usage='''muselsl <command> [<args>]
Available commands:
... | #!/usr/bin/python
import sys
import argparse
class main:
def __init__(self):
parser = argparse.ArgumentParser(
description='Python package for streaming, recording, and visualizing EEG data from the Muse 2016 headset.',
usage='''muselsl <command> [<args>]
Available commands:
... | en | 0.544914 | #!/usr/bin/python muselsl <command> [<args>] Available commands: list List available Muse devices. -b --backend BLE backend to use. can be auto, bluemuse, gatt or bgapi. -i --interface The interface to use, 'hci0' for gatt or a com port for bgapi. stream Star... | 2.718368 | 3 |
src/quocspyside2interface/gui/freegradients/GeneralSettingsNM.py | Quantum-OCS/QuOCS-pyside2interface | 1 | 9121 | # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Copyright 2021- QuOCS Team
#
# 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://ww... | # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Copyright 2021- QuOCS Team
#
# 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://ww... | en | 0.806359 | # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Copyright 2021- QuOCS Team # # 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://ww... | 1.461848 | 1 |
pulsar/datadog_checks/pulsar/check.py | divyamamgai/integrations-extras | 158 | 9122 | <filename>pulsar/datadog_checks/pulsar/check.py
from datadog_checks.base import ConfigurationError, OpenMetricsBaseCheck
EVENT_TYPE = SOURCE_TYPE_NAME = 'pulsar'
class PulsarCheck(OpenMetricsBaseCheck):
"""
PulsarCheck derives from AgentCheck that provides the required check method
"""
def __init__(... | <filename>pulsar/datadog_checks/pulsar/check.py
from datadog_checks.base import ConfigurationError, OpenMetricsBaseCheck
EVENT_TYPE = SOURCE_TYPE_NAME = 'pulsar'
class PulsarCheck(OpenMetricsBaseCheck):
"""
PulsarCheck derives from AgentCheck that provides the required check method
"""
def __init__(... | en | 0.794721 | PulsarCheck derives from AgentCheck that provides the required check method | 2.239444 | 2 |
Chapter11/publish_horoscope1_in_another_ipns.py | HowToBeCalculated/Hands-On-Blockchain-for-Python-Developers | 62 | 9123 | import ipfsapi
c = ipfsapi.connect()
peer_id = c.key_list()['Keys'][1]['Id']
c.name_publish('QmYjYGKXqo36GDt6f6qvp9qKAsrc72R9y88mQSLvogu8Ub', key='another_key')
result = c.cat('/ipns/' + peer_id)
print(result)
| import ipfsapi
c = ipfsapi.connect()
peer_id = c.key_list()['Keys'][1]['Id']
c.name_publish('QmYjYGKXqo36GDt6f6qvp9qKAsrc72R9y88mQSLvogu8Ub', key='another_key')
result = c.cat('/ipns/' + peer_id)
print(result)
| none | 1 | 2.083699 | 2 | |
magie/window.py | NiumXp/Magie | 1 | 9124 | <filename>magie/window.py<gh_stars>1-10
import pygame
class Window:
def __init__(self, title: str, dimension: tuple):
self.surface = None
self.initial_title = title
self.initial_dimension = dimension
@property
def title(self) -> str:
"""Returns the title of th... | <filename>magie/window.py<gh_stars>1-10
import pygame
class Window:
def __init__(self, title: str, dimension: tuple):
self.surface = None
self.initial_title = title
self.initial_dimension = dimension
@property
def title(self) -> str:
"""Returns the title of th... | en | 0.625734 | Returns the title of the window. Sets the window title. Alias for `Window.title = ...`. Alias for Window.get_width. Alias for Window.get_height. Alias for Window.get_size. Returns the widget of the window. Returns the height of the window. Returns the size of the size. Build the window. | 3.242368 | 3 |
tests/optimize/test_newton_raphson_hypo.py | dwillmer/fastats | 26 | 9125 | <gh_stars>10-100
from hypothesis import given, assume, settings
from hypothesis.strategies import floats
from numpy import cos
from pytest import approx
from fastats.optimise.newton_raphson import newton_raphson
def func(x):
return x**3 - x - 1
def less_or_equal(x, compared_to, rel=1e-6):
return ((x < com... | from hypothesis import given, assume, settings
from hypothesis.strategies import floats
from numpy import cos
from pytest import approx
from fastats.optimise.newton_raphson import newton_raphson
def func(x):
return x**3 - x - 1
def less_or_equal(x, compared_to, rel=1e-6):
return ((x < compared_to)
... | en | 0.951294 | Tests that the value output from the solver is less than or equal to the value of the objective. | 2.578547 | 3 |
faceRecognition.py | sequery/Face-Recognition-Project | 2 | 9126 | import cv2
import os
import numpy as np
# This module contains all common functions that are called in tester.py file
# Given an image below function returns rectangle for face detected alongwith gray scale image
def faceDetection(test_img):
gray_img = cv2.cvtColor(test_img, cv2.COLOR_BGR2GRAY) # convert color... | import cv2
import os
import numpy as np
# This module contains all common functions that are called in tester.py file
# Given an image below function returns rectangle for face detected alongwith gray scale image
def faceDetection(test_img):
gray_img = cv2.cvtColor(test_img, cv2.COLOR_BGR2GRAY) # convert color... | en | 0.844148 | # This module contains all common functions that are called in tester.py file # Given an image below function returns rectangle for face detected alongwith gray scale image # convert color image to grayscale # Load haar classifier # detectMultiScale returns rectangles # Given a directory below function returns part of ... | 2.918586 | 3 |
evaluation/datasets/build_dataset_images.py | hsiehkl/pdffigures2 | 296 | 9127 | <filename>evaluation/datasets/build_dataset_images.py
import argparse
from os import listdir, mkdir
from os.path import join, isdir
from subprocess import call
import sys
import datasets
from shutil import which
"""
Script to use pdftoppm to turn the pdfs into single images per page
"""
def get_images(pdf_dir, outp... | <filename>evaluation/datasets/build_dataset_images.py
import argparse
from os import listdir, mkdir
from os.path import join, isdir
from subprocess import call
import sys
import datasets
from shutil import which
"""
Script to use pdftoppm to turn the pdfs into single images per page
"""
def get_images(pdf_dir, outp... | en | 0.812211 | Script to use pdftoppm to turn the pdfs into single images per page | 3.040675 | 3 |
sympy/physics/__init__.py | utkarshdeorah/sympy | 1 | 9128 | <reponame>utkarshdeorah/sympy
"""
A module that helps solving problems in physics.
"""
from . import units
from .matrices import mgamma, msigma, minkowski_tensor, mdft
__all__ = [
'units',
'mgamma', 'msigma', 'minkowski_tensor', 'mdft',
]
| """
A module that helps solving problems in physics.
"""
from . import units
from .matrices import mgamma, msigma, minkowski_tensor, mdft
__all__ = [
'units',
'mgamma', 'msigma', 'minkowski_tensor', 'mdft',
] | en | 0.925716 | A module that helps solving problems in physics. | 2.023381 | 2 |
py.py | avr8082/Hadoop | 0 | 9129 | printf("Hello world")
| printf("Hello world")
| none | 1 | 1.240308 | 1 | |
build/python-env/lib/python2.7/site-packages/elasticsearch/client/xpack/ml.py | imiMoisesEducation/beatcookie-discbot | 1 | 9130 | from elasticsearch.client.utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH
class MlClient(NamespacedClient):
@query_params('from_', 'size')
def get_filters(self, filter_id=None, params=None):
"""
:arg filter_id: The ID of the filter to fetch
:arg from_: skips a num... | from elasticsearch.client.utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH
class MlClient(NamespacedClient):
@query_params('from_', 'size')
def get_filters(self, filter_id=None, params=None):
"""
:arg filter_id: The ID of the filter to fetch
:arg from_: skips a num... | en | 0.712137 | :arg filter_id: The ID of the filter to fetch :arg from_: skips a number of filters :arg size: specifies a max number of filters to get `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html>`_ :arg datafeed_id: The ID of the datafeeds to fetch `<http://www.elasti... | 2.366878 | 2 |
src/oci/service_catalog/service_catalog_client_composite_operations.py | LaudateCorpus1/oci-python-sdk | 0 | 9131 | <filename>src/oci/service_catalog/service_catalog_client_composite_operations.py
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apa... | <filename>src/oci/service_catalog/service_catalog_client_composite_operations.py
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apa... | en | 0.564346 | # coding: utf-8 # Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 2.307388 | 2 |
vision/_file_utils.py | BrianOfrim/boja | 7 | 9132 | <filename>vision/_file_utils.py
from typing import List
import os
import re
def create_output_dir(dir_name) -> bool:
if not os.path.isdir(dir_name) or not os.path.exists(dir_name):
print("Creating output directory: %s" % dir_name)
try:
os.makedirs(dir_name)
except OSError:
... | <filename>vision/_file_utils.py
from typing import List
import os
import re
def create_output_dir(dir_name) -> bool:
if not os.path.isdir(dir_name) or not os.path.exists(dir_name):
print("Creating output directory: %s" % dir_name)
try:
os.makedirs(dir_name)
except OSError:
... | none | 1 | 3.299281 | 3 | |
vaccine_allocation/epi_simulations.py | COVID-IWG/epimargin-studies | 0 | 9133 | import dask
import numpy as np
import pandas as pd
from epimargin.models import Age_SIRVD
from epimargin.utils import annually, normalize, percent, years
from studies.vaccine_allocation.commons import *
from tqdm import tqdm
import warnings
warnings.filterwarnings("error")
num_sims = 1000
simulation_range = 1... | import dask
import numpy as np
import pandas as pd
from epimargin.models import Age_SIRVD
from epimargin.utils import annually, normalize, percent, years
from studies.vaccine_allocation.commons import *
from tqdm import tqdm
import warnings
warnings.filterwarnings("error")
num_sims = 1000
simulation_range = 1... | en | 0.571926 | # distribute historical doses assuming mortality prioritization # try: # process(t) # except Exception as e: # failures.append((e, t)) | 2.161285 | 2 |
src/core/agent_state.py | nandofioretto/py_dcop | 4 | 9134 | '''Every agent has an agent state, which is its local view of the world'''
import numpy as np
import itertools
class AgentState:
def __init__(self, name, agt, seed=1234):
self.name = name
self.prng = np.random.RandomState(seed)
# contains the variable assignment (exploreD) for this agent a... | '''Every agent has an agent state, which is its local view of the world'''
import numpy as np
import itertools
class AgentState:
def __init__(self, name, agt, seed=1234):
self.name = name
self.prng = np.random.RandomState(seed)
# contains the variable assignment (exploreD) for this agent a... | en | 0.833537 | Every agent has an agent state, which is its local view of the world # contains the variable assignment (exploreD) for this agent and its neighbors ## Data structures to explore assignment local to an agent # the iterator to all possible assignment for this agent # All possible assignments for the variables of this age... | 3.237484 | 3 |
johnny_cache/__init__.py | Sonictherocketman/cache-proxy | 3 | 9135 | from .server import app # noqa
| from .server import app # noqa
| none | 1 | 1.095316 | 1 | |
python_packages_static/flopy/mf6/__init__.py | usgs/neversink_workflow | 351 | 9136 | <gh_stars>100-1000
# imports
from . import coordinates
from . import data
from .modflow import *
from . import utils
from .data import mfdatascalar, mfdatalist, mfdataarray
from .mfmodel import MFModel
from .mfbase import ExtFileAction
| # imports
from . import coordinates
from . import data
from .modflow import *
from . import utils
from .data import mfdatascalar, mfdatalist, mfdataarray
from .mfmodel import MFModel
from .mfbase import ExtFileAction | none | 1 | 1.042753 | 1 | |
tests/__init__.py | issuu/jmespath | 0 | 9137 | <gh_stars>0
import sys
# The unittest module got a significant overhaul
# in 2.7, so if we're in 2.6 we can use the backported
# version unittest2.
if sys.version_info[:2] == (2, 6):
import unittest2 as unittest
import simplejson as json
from ordereddict import OrderedDict
else:
import unittest
im... | import sys
# The unittest module got a significant overhaul
# in 2.7, so if we're in 2.6 we can use the backported
# version unittest2.
if sys.version_info[:2] == (2, 6):
import unittest2 as unittest
import simplejson as json
from ordereddict import OrderedDict
else:
import unittest
import json
... | en | 0.612497 | # The unittest module got a significant overhaul # in 2.7, so if we're in 2.6 we can use the backported # version unittest2. | 2.237035 | 2 |
src/routes/scoring.py | jtillman20/cfb-data-api | 0 | 9138 | <filename>src/routes/scoring.py
from typing import Union
from flask import request
from flask_restful import Resource
from exceptions import InvalidRequestError
from models import Scoring
from utils import flask_response, rank, sort
class ScoringRoute(Resource):
@flask_response
def get(self, side_of_ball: s... | <filename>src/routes/scoring.py
from typing import Union
from flask import request
from flask_restful import Resource
from exceptions import InvalidRequestError
from models import Scoring
from utils import flask_response, rank, sort
class ScoringRoute(Resource):
@flask_response
def get(self, side_of_ball: s... | en | 0.748482 | GET request to get scoring offense or defense for the given years. If team is provided only get scoring data for that team. Args: side_of_ball (str): Offense or defense Returns: Union[Scoring, list[Scoring]]: Scoring data for all teams or only scoring data f... | 3.122627 | 3 |
WebPortal/gbol_portal/vars.py | ZFMK/GermanBarcodeofLife | 0 | 9139 | import configparser
c = configparser.ConfigParser()
c.read("production.ini")
config = {}
config['host'] = c['dboption']['chost']
config['port'] = int(c['dboption']['cport'])
config['user'] = c['dboption']['cuser']
config['pw'] = c['dboption']['cpw']
config['db'] = c['dboption']['cdb']
config['homepath'] = c['option'][... | import configparser
c = configparser.ConfigParser()
c.read("production.ini")
config = {}
config['host'] = c['dboption']['chost']
config['port'] = int(c['dboption']['cport'])
config['user'] = c['dboption']['cuser']
config['pw'] = c['dboption']['cpw']
config['db'] = c['dboption']['cdb']
config['homepath'] = c['option'][... | de | 0.824417 | 100408, 100430, 100431, 100451, 100453, 3000243, 3100522, 3200125, 3200126, 4000014, 4402020, 4403366, 4403382, 4403383, 4404012, 4404135, 4404679, 4405947, 4406565, 4407062, 4408012, 5000093, 5000095, 5000203, 5009403, 5009532, 5100497, 5200013, 5210014, ... | 1.907279 | 2 |
challenges/Backend Challenge/pendulum_sort.py | HernandezDerekJ/Interview | 0 | 9140 | """
Coderpad solution
"""
def pend(arr):
## arr = [2,3,5,1,4]
## vrr = [0,0,0,0,0]
var = [0] * len(arr)
mid = (len(var) - 1) / 2
## sort_arr = [1,2,3,4,5]
## vrr = [0,0,1,0,0]
sort_arr = sorted(arr)
var[mid] = sort_arr[0]
# ^
# focus... | """
Coderpad solution
"""
def pend(arr):
## arr = [2,3,5,1,4]
## vrr = [0,0,0,0,0]
var = [0] * len(arr)
mid = (len(var) - 1) / 2
## sort_arr = [1,2,3,4,5]
## vrr = [0,0,1,0,0]
sort_arr = sorted(arr)
var[mid] = sort_arr[0]
# ^
# focus... | en | 0.778519 | Coderpad solution ## arr = [2,3,5,1,4] ## vrr = [0,0,0,0,0] ## sort_arr = [1,2,3,4,5] ## vrr = [0,0,1,0,0] # ^ # focus shouldn't be at beginning ofr array [1',2,3,4,5] # ^ # it should be mid [1,2,3,4,5] # ^ # var [0,... | 3.44496 | 3 |
swagger_server/controllers/threadFactory.py | garagonc/optimization-framework | 0 | 9141 | <gh_stars>0
import os
import configparser
import json
import time
from IO.inputConfigParser import InputConfigParser
from IO.redisDB import RedisDB
from optimization.ModelException import MissingKeysException
from optimization.controllerDiscrete import OptControllerDiscrete
from optimization.controllerMpc import OptC... | import os
import configparser
import json
import time
from IO.inputConfigParser import InputConfigParser
from IO.redisDB import RedisDB
from optimization.ModelException import MissingKeysException
from optimization.controllerDiscrete import OptControllerDiscrete
from optimization.controllerMpc import OptControllerMPC... | en | 0.527412 | #from optimization.controllerStochasticTestPebble import OptControllerStochastic #restart = True # print(os.path.sep) # print(os.environ.get("HOME")) #self.logger.debug("Error mqtt " + str(self.redisDB.get("Error mqtt" + self.id))) # Creating an object of the configuration file (standard values) # Loads the solver name... | 1.931506 | 2 |
ptrace/oop/math_tests.py | xann16/py-path-tracing | 0 | 9142 | <filename>ptrace/oop/math_tests.py<gh_stars>0
"""Unit tests for math-oriented common classes."""
import unittest
import math
import numpy as np
from .vector import Vec3, OrthonormalBasis
from .raycast_base import Ray
from .camera import Camera
class Vec3Tests(unittest.TestCase):
"""Test for Vec3 class."""
... | <filename>ptrace/oop/math_tests.py<gh_stars>0
"""Unit tests for math-oriented common classes."""
import unittest
import math
import numpy as np
from .vector import Vec3, OrthonormalBasis
from .raycast_base import Ray
from .camera import Camera
class Vec3Tests(unittest.TestCase):
"""Test for Vec3 class."""
... | en | 0.823816 | Unit tests for math-oriented common classes. Test for Vec3 class. Basic creation, access and manipulation of vector components. Testing methods and operators used for arithmentic and comparisons. Testing length calculations and normalisation. Testing reflection with respect to given normal vector. Tests for Orthonormal... | 2.447699 | 2 |
tests/integration/condition__browser__have_url_test.py | kianku/selene | 0 | 9143 | # MIT License
#
# Copyright (c) 2015-2020 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, ... | # MIT License
#
# Copyright (c) 2015-2020 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, ... | en | 0.731234 | # MIT License # # Copyright (c) 2015-2020 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, ... | 1.825924 | 2 |
cohesity_management_sdk/models/scheduling_policy.py | chandrashekar-cohesity/management-sdk-python | 1 | 9144 | <reponame>chandrashekar-cohesity/management-sdk-python
# -*- coding: utf-8 -*-
# Copyright 2019 Cohesity Inc.
import cohesity_management_sdk.models.continuous_schedule
import cohesity_management_sdk.models.daily_schedule
import cohesity_management_sdk.models.monthly_schedule
import cohesity_management_sdk.models.rpo_s... | # -*- coding: utf-8 -*-
# Copyright 2019 Cohesity Inc.
import cohesity_management_sdk.models.continuous_schedule
import cohesity_management_sdk.models.daily_schedule
import cohesity_management_sdk.models.monthly_schedule
import cohesity_management_sdk.models.rpo_schedule
class SchedulingPolicy(object):
"""Implem... | en | 0.781499 | # -*- coding: utf-8 -*- # Copyright 2019 Cohesity Inc. Implementation of the 'SchedulingPolicy' model. Specifies settings that define a backup schedule for a Protection Job. Attributes: continuous_schedule (ContinuousSchedule): Specifies the time interval between two Job Runs of a continuo... | 2.668455 | 3 |
networking_mlnx/eswitchd/cli/ebrctl.py | mail2nsrajesh/networking-mlnx | 0 | 9145 | #!/usr/bin/python
# Copyright 2013 Mellanox Technologies, 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... | #!/usr/bin/python
# Copyright 2013 Mellanox Technologies, 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... | en | 0.884169 | #!/usr/bin/python # Copyright 2013 Mellanox Technologies, 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... | 2.167085 | 2 |
survos/core/__init__.py | paskino/SuRVoS | 22 | 9146 |
from .launcher import Launcher
from .model import DataModel
from .layers import LayerManager
from .labels import LabelManager
from .singleton import Singleton
|
from .launcher import Launcher
from .model import DataModel
from .layers import LayerManager
from .labels import LabelManager
from .singleton import Singleton
| none | 1 | 1.140908 | 1 | |
src/FinanceLib/analysis.py | Chahat-M/FinanceLib | 3 | 9147 | from typing import List, Union
import numpy as np
import pandas_datareader as pdr
import pandas as pd
import matplotlib.pyplot as plt
def rsi(symbol :str ,name :str, date :str) -> None :
"""
Calculates and visualises the Relative Stock Index on a Stock of the company.
Parameters:
symbol(str) : Sy... | from typing import List, Union
import numpy as np
import pandas_datareader as pdr
import pandas as pd
import matplotlib.pyplot as plt
def rsi(symbol :str ,name :str, date :str) -> None :
"""
Calculates and visualises the Relative Stock Index on a Stock of the company.
Parameters:
symbol(str) : Sy... | en | 0.571534 | Calculates and visualises the Relative Stock Index on a Stock of the company. Parameters: symbol(str) : Symbol of the company from https://in.finance.yahoo.com/ name(str) : Name of the company date(str) : start date of historical data in the format (YYYY,M,D) Returns: Return ty... | 3.367381 | 3 |
datastore/core/test/test_basic.py | jbenet/datastore | 1 | 9148 | <gh_stars>1-10
import unittest
import logging
from ..basic import DictDatastore
from ..key import Key
from ..query import Query
class TestDatastore(unittest.TestCase):
def subtest_simple(self, stores, numelems=1000):
def checkLength(len):
try:
for sn in stores:
self.assertEqual(len(s... | import unittest
import logging
from ..basic import DictDatastore
from ..key import Key
from ..query import Query
class TestDatastore(unittest.TestCase):
def subtest_simple(self, stores, numelems=1000):
def checkLength(len):
try:
for sn in stores:
self.assertEqual(len(sn), numelems)
... | en | 0.869534 | # ensure removing non-existent keys is ok. # insert numelems elems # reassure they're all there. # make sure everything is there. #TODO: should order be preserved? # self.assertEqual(result, expected) # change numelems elems # remove numelems elems # make sure the cache is used # make sure the cache is not relief upon ... | 3.06548 | 3 |
rooms/models.py | Neisvestney/SentSyncServer | 0 | 9149 | from django.db import models
class Room(models.Model):
code = models.CharField('Code', max_length=128)
tab_url = models.CharField('Tab url', max_length=512, default='', blank=True)
def to_dict(self):
return {
'users': [u.to_dict() for u in self.users.all()],
'tabUrl': self... | from django.db import models
class Room(models.Model):
code = models.CharField('Code', max_length=128)
tab_url = models.CharField('Tab url', max_length=512, default='', blank=True)
def to_dict(self):
return {
'users': [u.to_dict() for u in self.users.all()],
'tabUrl': self... | none | 1 | 2.318539 | 2 | |
colbert/parameters.py | techthiyanes/ColBERT | 421 | 9150 | import torch
DEVICE = torch.device("cuda")
SAVED_CHECKPOINTS = [32*1000, 100*1000, 150*1000, 200*1000, 300*1000, 400*1000]
SAVED_CHECKPOINTS += [10*1000, 20*1000, 30*1000, 40*1000, 50*1000, 60*1000, 70*1000, 80*1000, 90*1000]
SAVED_CHECKPOINTS += [25*1000, 50*1000, 75*1000]
SAVED_CHECKPOINTS = set(SAVED_CHECKPOINTS)... | import torch
DEVICE = torch.device("cuda")
SAVED_CHECKPOINTS = [32*1000, 100*1000, 150*1000, 200*1000, 300*1000, 400*1000]
SAVED_CHECKPOINTS += [10*1000, 20*1000, 30*1000, 40*1000, 50*1000, 60*1000, 70*1000, 80*1000, 90*1000]
SAVED_CHECKPOINTS += [25*1000, 50*1000, 75*1000]
SAVED_CHECKPOINTS = set(SAVED_CHECKPOINTS)... | none | 1 | 2.070674 | 2 | |
jarvis/stats.py | aburgd/sheila | 0 | 9151 | <reponame>aburgd/sheila
#!/usr/bin/env python3
###############################################################################
# Module Imports
###############################################################################
import pyscp
import textwrap
from dominate import tags as dt
from . import core, lex, ext
... | #!/usr/bin/env python3
###############################################################################
# Module Imports
###############################################################################
import pyscp
import textwrap
from dominate import tags as dt
from . import core, lex, ext
########################... | de | 0.423372 | #!/usr/bin/env python3 ############################################################################### # Module Imports ############################################################################### ############################################################################### # Templates ############################... | 2.190594 | 2 |
entry.py | Allenyou1126/allenyou-acme.sh | 0 | 9152 | <filename>entry.py
#!/usr/bin/env python3
import json
from allenyoucert import Cert
def main():
certList = list()
a = json()
main()
| <filename>entry.py
#!/usr/bin/env python3
import json
from allenyoucert import Cert
def main():
certList = list()
a = json()
main()
| fr | 0.221828 | #!/usr/bin/env python3 | 1.853258 | 2 |
dynts/lib/fallback/simplefunc.py | quantmind/dynts | 57 | 9153 |
from .common import *
def tsminmax(v):
mv = NaN
xv = NaN
for v in x:
if x == x:
if mv == mv:
mv = min(mv,x)
else:
mv = x
if xv == xv:
xv = max(xv,x)
else:
xv = x
retu... |
from .common import *
def tsminmax(v):
mv = NaN
xv = NaN
for v in x:
if x == x:
if mv == mv:
mv = min(mv,x)
else:
mv = x
if xv == xv:
xv = max(xv,x)
else:
xv = x
retu... | none | 1 | 2.940469 | 3 | |
week9/finance/application.py | lcsm29/edx-harvard-cs50 | 0 | 9154 | import os
from cs50 import SQL
from flask import Flask, flash, redirect, render_template, request, session
from flask_session import Session
from tempfile import mkdtemp
from werkzeug.exceptions import default_exceptions, HTTPException, InternalServerError
from werkzeug.security import check_password_hash, generate_pa... | import os
from cs50 import SQL
from flask import Flask, flash, redirect, render_template, request, session
from flask_session import Session
from tempfile import mkdtemp
from werkzeug.exceptions import default_exceptions, HTTPException, InternalServerError
from werkzeug.security import check_password_hash, generate_pa... | en | 0.909698 | # Configure application # Ensure templates are auto-reloaded # Ensure responses aren't cached # Custom filter # Configure session to use filesystem (instead of signed cookies) # Configure CS50 Library to use SQLite database # Make sure API key is set Show portfolio of stocks Buy shares of stock Show history of transact... | 2.288179 | 2 |
users/forms.py | iurykrieger96/alura-django | 0 | 9155 | <filename>users/forms.py
from django import forms
from django.contrib.auth.models import User
from django.forms.utils import ErrorList
class UserForm(forms.Form):
name = forms.CharField(required=True)
email = forms.EmailField(required=True)
password = forms.CharField(required=True)
phone = forms.CharF... | <filename>users/forms.py
from django import forms
from django.contrib.auth.models import User
from django.forms.utils import ErrorList
class UserForm(forms.Form):
name = forms.CharField(required=True)
email = forms.EmailField(required=True)
password = forms.CharField(required=True)
phone = forms.CharF... | none | 1 | 2.46998 | 2 | |
python/manager.py | Kiku-Reise/vsmart | 0 | 9156 | from telethon.sync import TelegramClient
from telethon.errors.rpcerrorlist import PhoneNumberBannedError
import pickle, os
from colorama import init, Fore
from time import sleep
init()
n = Fore.RESET
lg = Fore.LIGHTGREEN_EX
r = Fore.RED
w = Fore.WHITE
cy = Fore.CYAN
ye = Fore.YELLOW
colors = [lg, r, w, cy, ye]
try:
... | from telethon.sync import TelegramClient
from telethon.errors.rpcerrorlist import PhoneNumberBannedError
import pickle, os
from colorama import init, Fore
from time import sleep
init()
n = Fore.RESET
lg = Fore.LIGHTGREEN_EX
r = Fore.RED
w = Fore.WHITE
cy = Fore.CYAN
ye = Fore.YELLOW
colors = [lg, r, w, cy, ye]
try:
... | en | 0.605556 | # fancy logo #print('=============SON OF GENISYS==============') #client.sign_in(phone, input('[+] Enter the code: ')) # thanks to github.com/th3unkn0n for the snippet below # https://raw.githubusercontent.com/Cryptonian007/Astra/main/version.txt #os.system('del scraper.py') | 2.192449 | 2 |
src/m2ee/client_errno.py | rus-kh/m2ee-tools | 23 | 9157 | <reponame>rus-kh/m2ee-tools<filename>src/m2ee/client_errno.py
#
# Copyright (C) 2009 Mendix. All rights reserved.
#
SUCCESS = 0
# Starting the Mendix Runtime can fail in both a temporary or permanent way.
# Some of the errors can be fixed with some help of the user.
#
# The default m2ee cli program will only handle a... | #
# Copyright (C) 2009 Mendix. All rights reserved.
#
SUCCESS = 0
# Starting the Mendix Runtime can fail in both a temporary or permanent way.
# Some of the errors can be fixed with some help of the user.
#
# The default m2ee cli program will only handle a few of these cases, by
# providing additional hints or intera... | en | 0.916233 | # # Copyright (C) 2009 Mendix. All rights reserved. # # Starting the Mendix Runtime can fail in both a temporary or permanent way. # Some of the errors can be fixed with some help of the user. # # The default m2ee cli program will only handle a few of these cases, by # providing additional hints or interactive choices ... | 1.463351 | 1 |
datasets/__init__.py | andrewliao11/detr | 0 | 9158 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import torch.utils.data
import torchvision
def get_coco_api_from_dataset(dataset_val):
for _ in range(10):
# if isinstance(dataset, torchvision.datasets.CocoDetection):
# break
if isinstance(dataset_val, torch.utils... | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import torch.utils.data
import torchvision
def get_coco_api_from_dataset(dataset_val):
for _ in range(10):
# if isinstance(dataset, torchvision.datasets.CocoDetection):
# break
if isinstance(dataset_val, torch.utils... | en | 0.502991 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved # if isinstance(dataset, torchvision.datasets.CocoDetection): # break # if isinstance(dataset, torchvision.datasets.CocoDetection): # break #elif dataset_args.name == 'viper': # from .viper import build as build_viper # return build_vi... | 2.253178 | 2 |
dkhomeleague/dkhomeleague.py | sansbacon/dkhomeleague | 0 | 9159 | # dkhomeleague.py
import json
import logging
import os
from string import ascii_uppercase
import pandas as pd
from requests_html import HTMLSession
import browser_cookie3
import pdsheet
class Scraper:
"""scrapes league results"""
def __init__(self, league_key=None, username=None):
"""Creates instan... | # dkhomeleague.py
import json
import logging
import os
from string import ascii_uppercase
import pandas as pd
from requests_html import HTMLSession
import browser_cookie3
import pdsheet
class Scraper:
"""scrapes league results"""
def __init__(self, league_key=None, username=None):
"""Creates instan... | en | 0.703664 | # dkhomeleague.py scrapes league results Creates instance Args: league_key (str): id for home league username (str): your username Returns: Scraper Gets contest leaderboard Gets contest lineup Args: draftgroup_id (int): the draftgroupId ... | 2.978388 | 3 |
Graphing/Example1.py | Wadden12/Semester1 | 0 | 9160 | <gh_stars>0
#!/usr/bin/python3
import numpy as np
import matplotlib.pyplot as plt
t = np.arange(0.0, 3.0, 0.01)
s = np.sin(2.5 * np.pi * t)
plt.plot(t, s)
plt.xlabel('time (s)')
plt.ylabel('voltage (mV)')
plt.title('Sine Wave')
plt.grid(True)
plt.show() | #!/usr/bin/python3
import numpy as np
import matplotlib.pyplot as plt
t = np.arange(0.0, 3.0, 0.01)
s = np.sin(2.5 * np.pi * t)
plt.plot(t, s)
plt.xlabel('time (s)')
plt.ylabel('voltage (mV)')
plt.title('Sine Wave')
plt.grid(True)
plt.show() | fr | 0.386793 | #!/usr/bin/python3 | 3.25503 | 3 |
Cursoemvideo/desafios/desafio008.py | gentildf/Python | 1 | 9161 | #Escreva um programa que leia um valor em metros e o exiba convertido em centimetros e milimetros.
n = float(input('\033[32mDigite o numero:\033[m'))
print('O número digitado é \033[33m{0:.0f}m\033[m.\n'
'Ele apresentado em centimetros fica \033[33m{0:.2f}cm\033[m.\n'
'Apresentado em milímetros fica \033[33... | #Escreva um programa que leia um valor em metros e o exiba convertido em centimetros e milimetros.
n = float(input('\033[32mDigite o numero:\033[m'))
print('O número digitado é \033[33m{0:.0f}m\033[m.\n'
'Ele apresentado em centimetros fica \033[33m{0:.2f}cm\033[m.\n'
'Apresentado em milímetros fica \033[33... | pt | 0.942059 | #Escreva um programa que leia um valor em metros e o exiba convertido em centimetros e milimetros. #print('O número em metros é {0}.\n # O número em convertido para centimetros é {1}.\n # O número convertido para milimetros é {2}' # .format(n, n/100, n/1000)) | 4.05996 | 4 |
publish_fanout.py | Dordoloy/BachelorDIM-Lectures-Algorithms-2019 | 0 | 9162 | # -*- coding: utf-8 -*-
"""
Created on Mon Oct 21 08:47:08 2019
@author: dordoloy
"""
import os
import pika
import config
import getpass
def publish_fanout():
amqp_url=config.amqp_url
# Parse CLODUAMQP_URL (fallback to localhost)
url = os.environ.get('CLOUDAMQP_URL',amqp_url)
params = pika... | # -*- coding: utf-8 -*-
"""
Created on Mon Oct 21 08:47:08 2019
@author: dordoloy
"""
import os
import pika
import config
import getpass
def publish_fanout():
amqp_url=config.amqp_url
# Parse CLODUAMQP_URL (fallback to localhost)
url = os.environ.get('CLOUDAMQP_URL',amqp_url)
params = pika... | en | 0.632426 | # -*- coding: utf-8 -*- Created on Mon Oct 21 08:47:08 2019 @author: dordoloy # Parse CLODUAMQP_URL (fallback to localhost) # Connect to CloudAMQP | 2.740541 | 3 |
orbit/utils.py | xjx0524/models | 0 | 9163 | <<<<<<< HEAD
# Lint as: python3
=======
>>>>>>> a811a3b7e640722318ad868c99feddf3f3063e36
# Copyright 2020 The Orbit 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 ... | <<<<<<< HEAD
# Lint as: python3
=======
>>>>>>> a811a3b7e640722318ad868c99feddf3f3063e36
# Copyright 2020 The Orbit 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 ... | en | 0.760127 | # Lint as: python3 # Copyright 2020 The Orbit 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 requi... | 2.400488 | 2 |
python/word-count/word_count.py | whitepeaony/exercism-python | 0 | 9164 | def count_words(sentence):
sentence = sentence.lower()
words = {}
shit = ',\n:!&@$%^&._'
for s in shit:
sentence = sentence.replace(s, ' ')
for w in sentence.split():
if w.endswith('\''):
w = w[:-1]
if w.startswith('\''):
w = w[1:]
words... | def count_words(sentence):
sentence = sentence.lower()
words = {}
shit = ',\n:!&@$%^&._'
for s in shit:
sentence = sentence.replace(s, ' ')
for w in sentence.split():
if w.endswith('\''):
w = w[:-1]
if w.startswith('\''):
w = w[1:]
words... | none | 1 | 3.627309 | 4 | |
examples/multiple_deserializers.py | klauer/apischema | 0 | 9165 | from dataclasses import dataclass
from apischema import deserialize, deserializer
from apischema.json_schema import deserialization_schema
@dataclass
class Expression:
value: int
@deserializer
def evaluate_expression(expr: str) -> Expression:
return Expression(int(eval(expr)))
# Could be shorten into des... | from dataclasses import dataclass
from apischema import deserialize, deserializer
from apischema.json_schema import deserialization_schema
@dataclass
class Expression:
value: int
@deserializer
def evaluate_expression(expr: str) -> Expression:
return Expression(int(eval(expr)))
# Could be shorten into des... | en | 0.834069 | # Could be shorten into deserializer(Expression), because class is callable too #", | 3.194712 | 3 |
ficheros/CSV/prueba csv (lm)/alumnos.py | txtbits/daw-python | 0 | 9166 | <filename>ficheros/CSV/prueba csv (lm)/alumnos.py<gh_stars>0
# -*- coding: utf-8 -*-
'''
Created on 02/12/2011
@author: chra
'''
import csv
from operator import itemgetter
# ----- Función media de la notas de los alumnos ----------
def media(alumno):
#devuelve la nota media a partir de un diccionario con datos ... | <filename>ficheros/CSV/prueba csv (lm)/alumnos.py<gh_stars>0
# -*- coding: utf-8 -*-
'''
Created on 02/12/2011
@author: chra
'''
import csv
from operator import itemgetter
# ----- Función media de la notas de los alumnos ----------
def media(alumno):
#devuelve la nota media a partir de un diccionario con datos ... | es | 0.62407 | # -*- coding: utf-8 -*- Created on 02/12/2011 @author: chra # ----- Función media de la notas de los alumnos ---------- #devuelve la nota media a partir de un diccionario con datos de un alumno # ---------------------------------------------------------- # si no se pone delimiter, coge la coma por defecto // devuelve ... | 3.481498 | 3 |
src/interpreter/functions/math/math.py | incrementals/b-star | 2 | 9167 | <reponame>incrementals/b-star
from src.interpreter.functions.math.add import add
from src.interpreter.functions.math.div import div
from src.interpreter.functions.math.mod import mod
from src.interpreter.functions.math.mul import mul
from src.interpreter.functions.math.pow import pow_func
from src.interpreter.functions... | from src.interpreter.functions.math.add import add
from src.interpreter.functions.math.div import div
from src.interpreter.functions.math.mod import mod
from src.interpreter.functions.math.mul import mul
from src.interpreter.functions.math.pow import pow_func
from src.interpreter.functions.math.sub import sub
def mat... | none | 1 | 3.360351 | 3 | |
setup.py | monkey2000/pygazetteer | 1 | 9168 | <gh_stars>1-10
from setuptools import setup
setup(name='pygazetteer',
version='0.1.0',
description='Location extractor by looking up gazetteer',
url='https://github.com/monkey2000/pygazetteer',
license='MIT',
packages=['pygazetteer'],
install_requires=[
'pyahocorasick'
... | from setuptools import setup
setup(name='pygazetteer',
version='0.1.0',
description='Location extractor by looking up gazetteer',
url='https://github.com/monkey2000/pygazetteer',
license='MIT',
packages=['pygazetteer'],
install_requires=[
'pyahocorasick'
],
zip... | none | 1 | 1.273243 | 1 | |
iqoptionapi/country_id.py | mustx1/MYIQ | 3 | 9169 | <gh_stars>1-10
ID = {"Worldwide":0,
"AF": 1,
"AL": 2,
"DZ": 3,
"AD": 5,
"AO": 6,
"AI": 7,
"AG": 9,
"AR": 10,
"AM": 11,
"AW": 12,
"AT": 14,
"AZ": 15,
"BS": 16,
"BH": 17,
"BD": 18,
"BB": 19,
"BY": 20,
"BZ": 22,
... | ID = {"Worldwide":0,
"AF": 1,
"AL": 2,
"DZ": 3,
"AD": 5,
"AO": 6,
"AI": 7,
"AG": 9,
"AR": 10,
"AM": 11,
"AW": 12,
"AT": 14,
"AZ": 15,
"BS": 16,
"BH": 17,
"BD": 18,
"BB": 19,
"BY": 20,
"BZ": 22,
"BJ": 23,
... | none | 1 | 1.26624 | 1 | |
pysd/py_backend/external.py | rogersamso/pysd_dev | 0 | 9170 | """
These classes are a collection of the needed tools to read external data.
The External type objects created by these classes are initialized before
the Stateful objects by functions.Model.initialize.
"""
import re
import os
import warnings
import pandas as pd # TODO move to openpyxl
import numpy as np
import xarr... | """
These classes are a collection of the needed tools to read external data.
The External type objects created by these classes are initialized before
the Stateful objects by functions.Model.initialize.
"""
import re
import os
import warnings
import pandas as pd # TODO move to openpyxl
import numpy as np
import xarr... | en | 0.685472 | These classes are a collection of the needed tools to read external data. The External type objects created by these classes are initialized before the Stateful objects by functions.Model.initialize. # TODO move to openpyxl Class to save the read Excel files and thus avoid double reading Read the Excel file or return t... | 3.314808 | 3 |
pirates/piratesgui/ChatBar.py | ksmit799/POTCO-PS | 8 | 9171 | # File: C (Python 2.4)
from direct.gui.DirectGui import *
from direct.interval.IntervalGlobal import *
from direct.fsm.FSM import FSM
from direct.showbase.PythonUtil import Functor
from pandac.PandaModules import *
from pirates.piratesbase import PiratesGlobals
from pirates.piratesbase import PLocalizer
from pirates.p... | # File: C (Python 2.4)
from direct.gui.DirectGui import *
from direct.interval.IntervalGlobal import *
from direct.fsm.FSM import FSM
from direct.showbase.PythonUtil import Functor
from pandac.PandaModules import *
from pirates.piratesbase import PiratesGlobals
from pirates.piratesbase import PLocalizer
from pirates.p... | en | 0.641047 | # File: C (Python 2.4) | 1.869808 | 2 |
mozmill-env/python/Lib/site-packages/mozlog/logger.py | lucashmorais/x-Bench | 0 | 9172 | <filename>mozmill-env/python/Lib/site-packages/mozlog/logger.py<gh_stars>0
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from logging import getLogger as getSysLogger... | <filename>mozmill-env/python/Lib/site-packages/mozlog/logger.py<gh_stars>0
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from logging import getLogger as getSysLogger... | en | 0.771504 | # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # Some of the build slave environments don't see the following when doing # 'from logging import *' # see https://bugzill... | 2.328867 | 2 |
CAAPR/CAAPR_AstroMagic/PTS/pts/core/misc/images.py | wdobbels/CAAPR | 7 | 9173 | #!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | #!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | en | 0.659521 | #!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ## ... | 1.921061 | 2 |
venv/Lib/site-packages/rivescript/inheritance.py | Hazemcodes/GimmyBot | 154 | 9174 | # RiveScript-Python
#
# This code is released under the MIT License.
# See the "LICENSE" file for more information.
#
# https://www.rivescript.com/
def get_topic_triggers(rs, topic, thats, depth=0, inheritance=0, inherited=False):
"""Recursively scan a topic and return a list of all triggers.
Arguments:
... | # RiveScript-Python
#
# This code is released under the MIT License.
# See the "LICENSE" file for more information.
#
# https://www.rivescript.com/
def get_topic_triggers(rs, topic, thats, depth=0, inheritance=0, inherited=False):
"""Recursively scan a topic and return a list of all triggers.
Arguments:
... | en | 0.90507 | # RiveScript-Python # # This code is released under the MIT License. # See the "LICENSE" file for more information. # # https://www.rivescript.com/ Recursively scan a topic and return a list of all triggers. Arguments: rs (RiveScript): A reference to the parent RiveScript instance. topic (str): The... | 2.75561 | 3 |
src/dataAccess/Connection.py | mattmillr/utaka | 1 | 9175 | <filename>src/dataAccess/Connection.py
#Copyright 2009 Humanitarian International Services Group
#
#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
... | <filename>src/dataAccess/Connection.py
#Copyright 2009 Humanitarian International Services Group
#
#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
... | en | 0.85452 | #Copyright 2009 Humanitarian International Services Group # #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.558036 | 3 |
setup.py | DKorytkin/pylint-pytest | 0 | 9176 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md')) as fin:
long_description = fin.read()
setup(
name='pylint-pytest',
version='1.0.3',
author='<NAME>',
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md')) as fin:
long_description = fin.read()
setup(
name='pylint-pytest',
version='1.0.3',
author='<NAME>',
... | en | 0.352855 | #!/usr/bin/env python # -*- coding: utf-8 -*- | 1.327682 | 1 |
Shells/Python/Client/TCPReverseShell.py | lismore/OffensiveCyberTools | 1 | 9177 | # Reverse TCP Shell in Python For Offensive Security/Penetration Testing Assignments
# Connect on LinkedIn https://www.linkedin.com/in/lismore or Twitter @patricklismore
#=========================================================================================================================================
# Python... | # Reverse TCP Shell in Python For Offensive Security/Penetration Testing Assignments
# Connect on LinkedIn https://www.linkedin.com/in/lismore or Twitter @patricklismore
#=========================================================================================================================================
# Python... | en | 0.555668 | # Reverse TCP Shell in Python For Offensive Security/Penetration Testing Assignments # Connect on LinkedIn https://www.linkedin.com/in/lismore or Twitter @patricklismore #========================================================================================================================================= # Python T... | 2.982497 | 3 |
src/_cffi_src/openssl/engine.py | balabit-deps/balabit-os-6-python-cryptography | 0 | 9178 | <filename>src/_cffi_src/openssl/engine.py<gh_stars>0
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
INCLUDES = """
#incl... | <filename>src/_cffi_src/openssl/engine.py<gh_stars>0
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
INCLUDES = """
#incl... | en | 0.281096 | # This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. #include <openssl/engine.h> static const long Cryptography_HAS_ENGINE_CRYPTODEV; typedef ... ENGINE; typedef ... RSA_METHOD; typedef ... DS... | 1.6716 | 2 |
tests/products/test_products.py | AlexandruScrob/fast_api_proj_2 | 0 | 9179 | <reponame>AlexandruScrob/fast_api_proj_2<gh_stars>0
import pytest
from httpx import AsyncClient
from conf_test_db import app
from tests.shared.info import category_info, product_info
@pytest.mark.asyncio
async def test_new_product():
async with AsyncClient(app=app, base_url="http://test") as ac:
category... | import pytest
from httpx import AsyncClient
from conf_test_db import app
from tests.shared.info import category_info, product_info
@pytest.mark.asyncio
async def test_new_product():
async with AsyncClient(app=app, base_url="http://test") as ac:
category_obj = await category_info()
payload = {
... | none | 1 | 2.418374 | 2 | |
3rdparty/pyviso2/src/viso2.py | utiasSTARS/matchable-image-transforms | 11 | 9180 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (2, 7, 0):
def swig_im... | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (2, 7, 0):
def swig_im... | en | 0.304918 | # This file was automatically generated by SWIG (http://www.swig.org). # Version 3.0.12 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. # Python < 2.2 doesn't have 'property'. Proxy of C++ swig::SwigPyIterator class. value(self) -> PyObject * incr(self,... | 1.889153 | 2 |
restcord/http.py | Yandawl/restcord.py | 4 | 9181 | # -*- coding: utf-8 -*-
import asyncio
import datetime
import json
import logging
import sys
from typing import Optional
import aiohttp
from aiohttp import ClientSession
from . import __version__
from .errors import (
BadGateway,
BadRequest,
Forbidden,
HTTPException,
InternalServerError,
NotFo... | # -*- coding: utf-8 -*-
import asyncio
import datetime
import json
import logging
import sys
from typing import Optional
import aiohttp
from aiohttp import ClientSession
from . import __version__
from .errors import (
BadGateway,
BadRequest,
Forbidden,
HTTPException,
InternalServerError,
NotFo... | en | 0.26964 | # -*- coding: utf-8 -*- :class:`ClientSession`: The aiohttp ClientSession. | 2.240156 | 2 |
notes/algo-ds-practice/problems/graph/mother_vertex.py | Anmol-Singh-Jaggi/interview-notes | 6 | 9182 | <reponame>Anmol-Singh-Jaggi/interview-notes
'''
What is a Mother Vertex?
A mother vertex in a graph G = (V,E) is a vertex v such that all other vertices in G can be reached by a path from v.
How to find mother vertex?
Case 1:- Undirected Connected Graph : In this case, all the vertices are mother vertices as we c... | '''
What is a Mother Vertex?
A mother vertex in a graph G = (V,E) is a vertex v such that all other vertices in G can be reached by a path from v.
How to find mother vertex?
Case 1:- Undirected Connected Graph : In this case, all the vertices are mother vertices as we can reach to all the other nodes in the graph... | en | 0.944828 | What is a Mother Vertex? A mother vertex in a graph G = (V,E) is a vertex v such that all other vertices in G can be reached by a path from v. How to find mother vertex? Case 1:- Undirected Connected Graph : In this case, all the vertices are mother vertices as we can reach to all the other nodes in the graph. ... | 3.758222 | 4 |
app/config.py | MoShitrit/kubernetes-controller-example | 0 | 9183 | <filename>app/config.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
class Config:
api_group = os.environ.get('API_GROUP', 'hello-k8s.s5t.dev')
auth_method = os.environ.get("AUTH_METHOD", "cluster")
examples_plural = os.environ.get('API_PLURAL', 'examples')
examples_version = os.environ.get... | <filename>app/config.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
class Config:
api_group = os.environ.get('API_GROUP', 'hello-k8s.s5t.dev')
auth_method = os.environ.get("AUTH_METHOD", "cluster")
examples_plural = os.environ.get('API_PLURAL', 'examples')
examples_version = os.environ.get... | en | 0.352855 | #!/usr/bin/env python # -*- coding: utf-8 -*- | 1.837862 | 2 |
mechanical_markdown/parsers.py | greenie-msft/mechanical-markdown | 0 | 9184 | <gh_stars>0
"""
Copyright (c) Microsoft Corporation.
Licensed under the MIT License.
"""
import re
import yaml
from html.parser import HTMLParser
from mistune import Renderer
from mechanical_markdown.step import Step
start_token = 'STEP'
end_token = 'END_STEP'
ignore_links_token = 'IGNORE_LINKS'
end_ignore_links_t... | """
Copyright (c) Microsoft Corporation.
Licensed under the MIT License.
"""
import re
import yaml
from html.parser import HTMLParser
from mistune import Renderer
from mechanical_markdown.step import Step
start_token = 'STEP'
end_token = 'END_STEP'
ignore_links_token = 'IGNORE_LINKS'
end_ignore_links_token = 'END_I... | en | 0.811928 | Copyright (c) Microsoft Corporation. Licensed under the MIT License. | 2.582035 | 3 |
cchecker.py | jakepolatty/compliance-checker | 0 | 9185 | <filename>cchecker.py<gh_stars>0
#!/usr/bin/env python
from __future__ import print_function
import argparse
import sys
from compliance_checker.runner import ComplianceChecker, CheckSuite
from compliance_checker.cf.util import download_cf_standard_name_table
from compliance_checker import __version__
def main():
... | <filename>cchecker.py<gh_stars>0
#!/usr/bin/env python
from __future__ import print_function
import argparse
import sys
from compliance_checker.runner import ComplianceChecker, CheckSuite
from compliance_checker.cf.util import download_cf_standard_name_table
from compliance_checker import __version__
def main():
... | en | 0.431284 | #!/usr/bin/env python # Load all available checker classes # Skip the "latest" output # Check the number of output files # Check the output formats # Run the compliance checker # 2 modes, concatenated output file or multiple output files | 2.523664 | 3 |
apps/articles/cms_apps.py | creimers/djangocms-delete-error | 0 | 9186 | from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import gettext as _
class CategoriesAppHook(CMSApp):
name = _("Categories")
def get_urls(self, page=None, language=None, **kwargs):
return ["apps.articles.urls"]
apphook_pool.register(CategoriesA... | from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import gettext as _
class CategoriesAppHook(CMSApp):
name = _("Categories")
def get_urls(self, page=None, language=None, **kwargs):
return ["apps.articles.urls"]
apphook_pool.register(CategoriesA... | none | 1 | 1.913484 | 2 | |
bouncer/blacklist/signals.py | sourcelair/bouncer-api | 0 | 9187 | <gh_stars>0
from django.db.models.signals import pre_save
from django.dispatch import receiver
from blacklist import models
from hashlib import sha256
@receiver(pre_save, sender=models.EmailEntry)
def email_entry_handler(sender, instance, **kwargs):
"""
Handler that assigns to lower_case_entry_value the entry... | from django.db.models.signals import pre_save
from django.dispatch import receiver
from blacklist import models
from hashlib import sha256
@receiver(pre_save, sender=models.EmailEntry)
def email_entry_handler(sender, instance, **kwargs):
"""
Handler that assigns to lower_case_entry_value the entry_value.lower... | en | 0.286259 | Handler that assigns to lower_case_entry_value the entry_value.lower() Handler that assigns to lower_case_entry_value the entry_value.lower() | 2.174977 | 2 |
app/boardgames/migrations/0001_initial.py | collaer/boardgames | 0 | 9188 | # Generated by Django 3.1 on 2020-08-22 17:48
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='BoardGame',
fields=[
('id', models.AutoField(... | # Generated by Django 3.1 on 2020-08-22 17:48
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='BoardGame',
fields=[
('id', models.AutoField(... | en | 0.842925 | # Generated by Django 3.1 on 2020-08-22 17:48 | 1.96069 | 2 |
matcher/utils.py | BlueRidgeLabs/slack-meetups | 12 | 9189 | import re
# regex for a user or channel mention at the beginning of a message
# example matches: " <@UJQ07L30Q> ", "<#C010P8N1ABB|interns>"
# interactive playground: https://regex101.com/r/2Z7eun/2
MENTION_PATTERN = r"(?:^\s?<@(.*?)>\s?)|(?:^\s?<#(.*?)\|.*?>\s?)"
def get_set_element(_set):
"""get the element fr... | import re
# regex for a user or channel mention at the beginning of a message
# example matches: " <@UJQ07L30Q> ", "<#C010P8N1ABB|interns>"
# interactive playground: https://regex101.com/r/2Z7eun/2
MENTION_PATTERN = r"(?:^\s?<@(.*?)>\s?)|(?:^\s?<#(.*?)\|.*?>\s?)"
def get_set_element(_set):
"""get the element fr... | en | 0.732703 | # regex for a user or channel mention at the beginning of a message # example matches: " <@UJQ07L30Q> ", "<#C010P8N1ABB|interns>" # interactive playground: https://regex101.com/r/2Z7eun/2 #(.*?)\|.*?>\s?)" get the element from the set to which the iterator points; returns an arbitrary item given a Match, return the... | 3.237308 | 3 |
scripts/quest/q3526s.py | pantskun/swordiemen | 0 | 9190 | # In Search for the Lost Memory [Explorer Thief] (3526)
# To be replaced with GMS's exact dialogue.
# Following dialogue has been edited from DeepL on JMS's dialogue transcript (no KMS footage anywhere):
# https://kaengouraiu2.blog.fc2.com/blog-entry-46.html
recoveredMemory = 7081
darkLord = 1052001
sm.setSpeakerID(... | # In Search for the Lost Memory [Explorer Thief] (3526)
# To be replaced with GMS's exact dialogue.
# Following dialogue has been edited from DeepL on JMS's dialogue transcript (no KMS footage anywhere):
# https://kaengouraiu2.blog.fc2.com/blog-entry-46.html
recoveredMemory = 7081
darkLord = 1052001
sm.setSpeakerID(... | en | 0.846217 | # In Search for the Lost Memory [Explorer Thief] (3526) # To be replaced with GMS's exact dialogue. # Following dialogue has been edited from DeepL on JMS's dialogue transcript (no KMS footage anywhere): # https://kaengouraiu2.blog.fc2.com/blog-entry-46.html #h #.") | 1.544862 | 2 |
student/urls.py | rummansadik/Admission-Automation | 0 | 9191 | from django.contrib.auth.views import LoginView
from django.urls import path
from student import views
urlpatterns = [
path('studentclick', views.studentclick_view, name='student-click'),
path('studentlogin', LoginView.as_view(
template_name='student/studentlogin.html'), name='studentlogin'),
path... | from django.contrib.auth.views import LoginView
from django.urls import path
from student import views
urlpatterns = [
path('studentclick', views.studentclick_view, name='student-click'),
path('studentlogin', LoginView.as_view(
template_name='student/studentlogin.html'), name='studentlogin'),
path... | none | 1 | 1.754788 | 2 | |
aiida_quantumespresso/parsers/neb.py | lin-cp/aiida-quantumespresso | 0 | 9192 | <gh_stars>0
# -*- coding: utf-8 -*-
from aiida.common import NotExistent
from aiida.orm import Dict
from aiida_quantumespresso.calculations.pw import PwCalculation
from aiida_quantumespresso.parsers import QEOutputParsingError
from aiida_quantumespresso.parsers.parse_raw import convert_qe_to_aiida_structure
from aiida... | # -*- coding: utf-8 -*-
from aiida.common import NotExistent
from aiida.orm import Dict
from aiida_quantumespresso.calculations.pw import PwCalculation
from aiida_quantumespresso.parsers import QEOutputParsingError
from aiida_quantumespresso.parsers.parse_raw import convert_qe_to_aiida_structure
from aiida_quantumespr... | en | 0.760504 | # -*- coding: utf-8 -*- `Parser` implementation for the `NebCalculation` calculation job class. Parse the retrieved files of a completed `NebCalculation` into output nodes. Two nodes that are expected are the default 'retrieved' `FolderData` node which will store the retrieved files permanently in the ... | 2.164714 | 2 |
foundation/djangocms_submenu/cms_plugins.py | Mindelirium/foundation | 0 | 9193 | <reponame>Mindelirium/foundation
from django.utils.translation import ugettext_lazy as _
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from cms.models.pluginmodel import CMSPlugin
class SubmenuPlugin(CMSPluginBase):
model = CMSPlugin
name = _("Submenu")
render_template... | from django.utils.translation import ugettext_lazy as _
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from cms.models.pluginmodel import CMSPlugin
class SubmenuPlugin(CMSPluginBase):
model = CMSPlugin
name = _("Submenu")
render_template = "cms/plugins/submenu.html"
pl... | none | 1 | 1.601943 | 2 | |
training/horovod/base/horovod_wrapper.py | thehardikv/ai-platform-samples | 418 | 9194 | <reponame>thehardikv/ai-platform-samples
import collections
import datetime
import json
import multiprocessing
import os
import subprocess
import sys
import time
_SSHD_BINARY_PATH = "/usr/sbin/sshd"
EnvironmentConfig = collections.namedtuple(
"EnvironmentConfig",
["hosts", "port", "is_chief", "pools", "job_id... | import collections
import datetime
import json
import multiprocessing
import os
import subprocess
import sys
import time
_SSHD_BINARY_PATH = "/usr/sbin/sshd"
EnvironmentConfig = collections.namedtuple(
"EnvironmentConfig",
["hosts", "port", "is_chief", "pools", "job_id"])
class DeadlineExceededError(Excepti... | en | 0.909135 | Indicates an action took too long. # This is imported here so that we don't load tensorflow in the parent # process. Once the sub-process exits, it releases its allocated GPU memory. Returns the number of GPUs on the machine. Parses environment config and returns a list of hosts as well as the role. Returns: An ... | 2.479089 | 2 |
smaregipy/pos/customer_groups.py | shabaraba/SmaregiPy | 0 | 9195 | import datetime
from pydantic import Field
from typing import (
ClassVar,
List,
Dict,
Optional,
)
from smaregipy.base_api import (
BaseServiceRecordApi,
BaseServiceCollectionApi,
)
from smaregipy.utils import NoData, DictUtil
class CustomerGroup(BaseServiceRecordApi):
RECORD_NAME = 'custo... | import datetime
from pydantic import Field
from typing import (
ClassVar,
List,
Dict,
Optional,
)
from smaregipy.base_api import (
BaseServiceRecordApi,
BaseServiceCollectionApi,
)
from smaregipy.utils import NoData, DictUtil
class CustomerGroup(BaseServiceRecordApi):
RECORD_NAME = 'custo... | ja | 0.999934 | 客層セクションの更新を行います。 put処理のため、saveメソッドをオーバーライド | 2.308725 | 2 |
StickyDJ-Bot/src/clients/client.py | JCab09/StickyDJ-Bot | 0 | 9196 | #!/usr/bin/env python3
"""
Base-Client Class
This is the parent-class of all client-classes and holds properties and functions they all depend on.
Author: <NAME>
"""
import src.util.debugger as Debugger
import src.util.configmaker as configmaker
class BaseClient(object):
"""Base-Client Class"""
def __init__(... | #!/usr/bin/env python3
"""
Base-Client Class
This is the parent-class of all client-classes and holds properties and functions they all depend on.
Author: <NAME>
"""
import src.util.debugger as Debugger
import src.util.configmaker as configmaker
class BaseClient(object):
"""Base-Client Class"""
def __init__(... | en | 0.819947 | #!/usr/bin/env python3 Base-Client Class This is the parent-class of all client-classes and holds properties and functions they all depend on. Author: <NAME> Base-Client Class Base Class for getting client configuration Base Class for loading client configuration into memory | 3.109398 | 3 |
cryptomon/ascii.py | S0L1DUS/cryptocoinmon | 0 | 9197 | # -*- coding: utf-8 -*-
import sys
from cryptomon.common import Colors
if sys.version_info >= (3, 0):
import io
else:
import StringIO as io
ascii_title = """
/$$$$$$ /$$ /$$ /$$
/$$__ $$ | $$ ... | # -*- coding: utf-8 -*-
import sys
from cryptomon.common import Colors
if sys.version_info >= (3, 0):
import io
else:
import StringIO as io
ascii_title = """
/$$$$$$ /$$ /$$ /$$
/$$__ $$ | $$ ... | en | 0.523504 | # -*- coding: utf-8 -*- /$$$$$$ /$$ /$$ /$$ /$$__ $$ | $$ | $$$ /$$$ | $$ \__/ /$$$$$$ /$$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ | $$$$ /$$$$ /$$$$$$ /$$$$$$$ | $$ /$$__... | 2.460153 | 2 |
car & pedestrian_tracker.py | Ishita-2001/Car-And-Pedestrian-prediction | 1 | 9198 | import cv2
video=cv2.VideoCapture(r'C:\Users\ISHITA\Desktop\ML project\UEM_PROJECT_COM\pedestrian.mp4')
#pre trained pedestrian and car classifier
car_tracker_file=(r'C:\Users\ISHITA\Desktop\ML project\UEM_PROJECT_COM\car.xml')
pedestrian_tracker_file=(r'C:\Users\ISHITA\Desktop\ML project\UEM_PROJECT_COM\pedestrian.x... | import cv2
video=cv2.VideoCapture(r'C:\Users\ISHITA\Desktop\ML project\UEM_PROJECT_COM\pedestrian.mp4')
#pre trained pedestrian and car classifier
car_tracker_file=(r'C:\Users\ISHITA\Desktop\ML project\UEM_PROJECT_COM\car.xml')
pedestrian_tracker_file=(r'C:\Users\ISHITA\Desktop\ML project\UEM_PROJECT_COM\pedestrian.x... | en | 0.760304 | #pre trained pedestrian and car classifier #create car n pedestrian classifier #run forever untill car stop #detect cars n pedestrian #draw rectangle around cars #draw rectangle around pedestrian #display #stopping condition # release the VideoCapture object | 3.229544 | 3 |
saleor/wing/api/serializers.py | glosoftgroup/tenants | 1 | 9199 | <filename>saleor/wing/api/serializers.py<gh_stars>1-10
# site settings rest api serializers
from rest_framework import serializers
from saleor.wing.models import Wing as Table
class TableListSerializer(serializers.ModelSerializer):
update_url = serializers.HyperlinkedIdentityField(view_name='wing:api-update')
... | <filename>saleor/wing/api/serializers.py<gh_stars>1-10
# site settings rest api serializers
from rest_framework import serializers
from saleor.wing.models import Wing as Table
class TableListSerializer(serializers.ModelSerializer):
update_url = serializers.HyperlinkedIdentityField(view_name='wing:api-update')
... | en | 0.407684 | # site settings rest api serializers | 2.36331 | 2 |