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 |
|---|---|---|---|---|---|---|---|---|---|---|
chapter7/7_7_1.py | kungbob/Machine_Learning_In_Action | 0 | 6623851 | <reponame>kungbob/Machine_Learning_In_Action
import adaboost
datArr, labelArr = adaboost.loadDataSet('horseColicTraining2.txt')
classifierArray, aggClassEst = adaboost.adaBoostTrainDS(datArr, labelArr, 10)
adaboost.plotROC(aggClassEst.T, labelArr)
| import adaboost
datArr, labelArr = adaboost.loadDataSet('horseColicTraining2.txt')
classifierArray, aggClassEst = adaboost.adaBoostTrainDS(datArr, labelArr, 10)
adaboost.plotROC(aggClassEst.T, labelArr) | none | 1 | 2.121266 | 2 | |
test_cpap_extraction.py | cdvandyke/CPAP-extraction | 1 | 6623852 | <gh_stars>1-10
'''
This module contains unittests for the cpap_extraction module
'''
import unittest # For testing
import os # For file I/O
import io # For reading strings as files
from mock import Mock # For mocking input and output files
from mock import patch # For patching out... | '''
This module contains unittests for the cpap_extraction module
'''
import unittest # For testing
import os # For file I/O
import io # For reading strings as files
from mock import Mock # For mocking input and output files
from mock import patch # For patching out file I/O
impor... | en | 0.807065 | This module contains unittests for the cpap_extraction module # For testing # For file I/O # For reading strings as files # For mocking input and output files # For patching out file I/O # The module to be tested Tests the open_file method, which reads in a binary file, and returns it as a file object. Methods... | 3.100686 | 3 |
src/TeamsNotifier.py | BouyguesTelecom/docker-notifier | 0 | 6623853 | <filename>src/TeamsNotifier.py<gh_stars>0
import os
import sys
import pymsteams
class TeamsNotifier:
def notification_type(self):
return "Teams"
def send(self, title, message):
if os.environ.get("WEBHOOK_URL") is None:
print("WEBHOOK_URL environment variable is not set")
... | <filename>src/TeamsNotifier.py<gh_stars>0
import os
import sys
import pymsteams
class TeamsNotifier:
def notification_type(self):
return "Teams"
def send(self, title, message):
if os.environ.get("WEBHOOK_URL") is None:
print("WEBHOOK_URL environment variable is not set")
... | none | 1 | 2.538694 | 3 | |
ezbeq/apis/__init__.py | bmiller/ezbeq | 6 | 6623854 | <filename>ezbeq/apis/__init__.py
import logging
logger = logging.getLogger('ezbeq.apis')
| <filename>ezbeq/apis/__init__.py
import logging
logger = logging.getLogger('ezbeq.apis')
| none | 1 | 1.230872 | 1 | |
src/zodbbrowser/__main__.py | mgedmin/zodbbrowser | 15 | 6623855 |
if __name__ == '__main__':
# support python -m zodbbrowser on Python 2.7
from zodbbrowser.standalone import main
main()
|
if __name__ == '__main__':
# support python -m zodbbrowser on Python 2.7
from zodbbrowser.standalone import main
main()
| en | 0.427643 | # support python -m zodbbrowser on Python 2.7 | 1.12848 | 1 |
O(n) on array/rotate_max.py | boristown/leetcode | 1 | 6623856 | def rotate_max_F(L):
'''
计算将序列L向右旋转k(0<=k<n-1)后,函数F的最大值
F(k) = 0 * Lk[0] + 1 * Lk[1] + ... + (n - 1) * Lk[n - 1]
时间复杂度:O(n)
'''
#分析:
#F(0) = 0 * L[0] + 1 * L[1] + ... + (n - 1) * L[n - 1]
#F(1) = 0 * L[n - 1] + 1 * L[0] + ... + (n - 1) + L[n - 2]
#F(2) = 0 * L[n - 2] + 1 * L[n - 1]... | def rotate_max_F(L):
'''
计算将序列L向右旋转k(0<=k<n-1)后,函数F的最大值
F(k) = 0 * Lk[0] + 1 * Lk[1] + ... + (n - 1) * Lk[n - 1]
时间复杂度:O(n)
'''
#分析:
#F(0) = 0 * L[0] + 1 * L[1] + ... + (n - 1) * L[n - 1]
#F(1) = 0 * L[n - 1] + 1 * L[0] + ... + (n - 1) + L[n - 2]
#F(2) = 0 * L[n - 2] + 1 * L[n - 1]... | zh | 0.15262 | 计算将序列L向右旋转k(0<=k<n-1)后,函数F的最大值 F(k) = 0 * Lk[0] + 1 * Lk[1] + ... + (n - 1) * Lk[n - 1] 时间复杂度:O(n) #分析: #F(0) = 0 * L[0] + 1 * L[1] + ... + (n - 1) * L[n - 1] #F(1) = 0 * L[n - 1] + 1 * L[0] + ... + (n - 1) + L[n - 2] #F(2) = 0 * L[n - 2] + 1 * L[n - 1] + ... + (n - 1) + L[n - 3] #做差: #F(1) - F(0) = L[0] + L[... | 3.033004 | 3 |
torchrs/datasets/__init__.py | isaaccorley/torchrs | 146 | 6623857 | <filename>torchrs/datasets/__init__.py<gh_stars>100-1000
from . import utils
from .probav import PROBAV
from .etci2021 import ETCI2021
from .rsvqa import RSVQALR, RSVQAHR, RSVQAxBEN
from .eurosat import EuroSATRGB, EuroSATMS
from .resisc45 import RESISC45
from .rsicd import RSICD
from .oscd import OSCD
from .s2looking ... | <filename>torchrs/datasets/__init__.py<gh_stars>100-1000
from . import utils
from .probav import PROBAV
from .etci2021 import ETCI2021
from .rsvqa import RSVQALR, RSVQAHR, RSVQAxBEN
from .eurosat import EuroSATRGB, EuroSATMS
from .resisc45 import RESISC45
from .rsicd import RSICD
from .oscd import OSCD
from .s2looking ... | none | 1 | 1.243535 | 1 | |
src/scippnexus/nxobject.py | scipp/scippnexus | 0 | 6623858 | # SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2022 Scipp contributors (https://github.com/scipp)
# @author <NAME>
from __future__ import annotations
import re
import warnings
import datetime
import dateutil.parser
from enum import Enum, auto
import functools
from typing import List, Union, Any, Dict, Tuple, P... | # SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2022 Scipp contributors (https://github.com/scipp)
# @author <NAME>
from __future__ import annotations
import re
import warnings
import datetime
import dateutil.parser
from enum import Enum, auto
import functools
from typing import List, Union, Any, Dict, Tuple, P... | en | 0.846349 | # SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2022 Scipp contributors (https://github.com/scipp) # @author <NAME> # TODO move into scipp A multi-dimensional array with a unit and dimension labels. Could be, e.g., a scipp.Variable or a dimple dataclass wrapping a numpy array. Multi-dimensional array of va... | 2.320209 | 2 |
setup.py | erkolson/mergeyaml | 0 | 6623859 | from setuptools import setup
from meta import __version__
setup(
name='mergeyaml',
version=__version__,
author="<NAME>",
py_modules=['mergeyaml'],
license="MIT",
install_requires=[
"click==6.7",
"PyYAML==3.12",
"oyaml>=0.4",
],
entry_points='''
[console_s... | from setuptools import setup
from meta import __version__
setup(
name='mergeyaml',
version=__version__,
author="<NAME>",
py_modules=['mergeyaml'],
license="MIT",
install_requires=[
"click==6.7",
"PyYAML==3.12",
"oyaml>=0.4",
],
entry_points='''
[console_s... | en | 0.521803 | [console_scripts] mergeyaml=mergeyaml:cli | 1.139949 | 1 |
example/zmq_echo.py | tejeez/suo | 2 | 6623860 | <reponame>tejeez/suo<gh_stars>1-10
#!/usr/bin/env python3
# Example to parse frame metadata and transmit the same data back
# with an incremented timestamp.
import zmq, threading, struct
ctx = zmq.Context()
rx = ctx.socket(zmq.SUB)
rx.connect("tcp://localhost:43300")
rx.setsockopt(zmq.SUBSCRIBE, b"")
tx = ctx.socket... | #!/usr/bin/env python3
# Example to parse frame metadata and transmit the same data back
# with an incremented timestamp.
import zmq, threading, struct
ctx = zmq.Context()
rx = ctx.socket(zmq.SUB)
rx.connect("tcp://localhost:43300")
rx.setsockopt(zmq.SUBSCRIBE, b"")
tx = ctx.socket(zmq.PUB)
tx.connect("tcp://localho... | en | 0.351737 | #!/usr/bin/env python3 # Example to parse frame metadata and transmit the same data back # with an incremented timestamp. #print(rx_timestamp, rx_data) #print(tx_timestamp, tx_data) | 2.396214 | 2 |
examples/example_multiplex_dynamics.py | SkBlaz/supertest | 79 | 6623861 | # visualize multiplex network dynamics
from py3plex.visualization.multilayer import draw_multilayer_default
from py3plex.core import multinet
from collections import defaultdict
import matplotlib.pyplot as plt
import seaborn as sns
# first parse the layer n1 n2 w edgelist
multilayer_network = multinet.multi_layer_net... | # visualize multiplex network dynamics
from py3plex.visualization.multilayer import draw_multilayer_default
from py3plex.core import multinet
from collections import defaultdict
import matplotlib.pyplot as plt
import seaborn as sns
# first parse the layer n1 n2 w edgelist
multilayer_network = multinet.multi_layer_net... | en | 0.553372 | # visualize multiplex network dynamics # first parse the layer n1 n2 w edgelist # map layer ids to names # Finally, load termporal edge information # read correctly? # internally split to layers # remove all internal networks' edges. # empty graphs are stored as self.empty_layers # do the time series splits # chunk row... | 2.747354 | 3 |
distpy/workers/plotgenerator.py | billmcchesney1/distpy | 23 | 6623862 | # (C) 2020, Schlumberger. Refer to LICENSE
import numpy
import matplotlib.pyplot as plt
import datetime
import scipy.signal
import os
import distpy.io_help.io_helpers as io_helpers
import distpy.io_help.directory_services as directory_services
import distpy.calc.extra_numpy as extra_numpy
import distpy.calc.extra_pypl... | # (C) 2020, Schlumberger. Refer to LICENSE
import numpy
import matplotlib.pyplot as plt
import datetime
import scipy.signal
import os
import distpy.io_help.io_helpers as io_helpers
import distpy.io_help.directory_services as directory_services
import distpy.calc.extra_numpy as extra_numpy
import distpy.calc.extra_pypl... | en | 0.740487 | # (C) 2020, Schlumberger. Refer to LICENSE read_zones : read a CSV file containing measured_depth zone information for plot annotation #conversion = 1.0 #if (lines[1][0]=="ft"): # conversion = FT_TO_M plotgenerator : generates a command_list which is then executed to generate the plots... | 2.381347 | 2 |
0 install.py | MateP/ocijeni | 0 | 6623863 | #!/usr/bin/env python3
import sys, subprocess, traceback
import tkinter as tk
from tkinter import messagebox
try:
subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-U', 'pip'])
for package in ['img2pdf', 'openpyxl']:
subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-U', pac... | #!/usr/bin/env python3
import sys, subprocess, traceback
import tkinter as tk
from tkinter import messagebox
try:
subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-U', 'pip'])
for package in ['img2pdf', 'openpyxl']:
subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-U', pac... | sr | 0.208439 | #!/usr/bin/env python3 # Treba imati instaliran Python3 s opcijom ADD TO PATH! | 2.271868 | 2 |
test/test_wire.py | SamP20/mongo-sio | 0 | 6623864 | import pytest
import mongo_sio
from mongo_sio import parse_header, parse_op_msg, parse_op_reply, OP_COMPRESSED, OP_MSG, COMPRESSOR_ZLIB, COMPRESSOR_NOOP, COMPRESSOR_SNAPPY
import zlib
import struct
import bson
samples = [
bytes([8, 0, 0, 0, 1, 2, 3, 4]),
bytes([9, 0, 0, 0, 5, 6, 7, 8, 9]),
bytes([12, 0, 0... | import pytest
import mongo_sio
from mongo_sio import parse_header, parse_op_msg, parse_op_reply, OP_COMPRESSED, OP_MSG, COMPRESSOR_ZLIB, COMPRESSOR_NOOP, COMPRESSOR_SNAPPY
import zlib
import struct
import bson
samples = [
bytes([8, 0, 0, 0, 1, 2, 3, 4]),
bytes([9, 0, 0, 0, 5, 6, 7, 8, 9]),
bytes([12, 0, 0... | en | 0.617448 | # pylint: disable=import-error #1", "myvar": 42} #MoreToCome bit | 2.01296 | 2 |
tests/test_endpoints_canonical.py | soccermetrics/soccermetrics-client-py | 43 | 6623865 | import unittest
import mock
from soccermetrics.rest import SoccermetricsRestClient
@mock.patch('soccermetrics.rest.resources.base.EasyDict')
@mock.patch('soccermetrics.rest.resources.base.Response')
@mock.patch('soccermetrics.rest.resources.base.requests')
class ClientCanonicalEndpointTest(unittest.TestCase):
"""... | import unittest
import mock
from soccermetrics.rest import SoccermetricsRestClient
@mock.patch('soccermetrics.rest.resources.base.EasyDict')
@mock.patch('soccermetrics.rest.resources.base.Response')
@mock.patch('soccermetrics.rest.resources.base.requests')
class ClientCanonicalEndpointTest(unittest.TestCase):
"""... | en | 0.67387 | Test canonical endpoints of API resources in client. Verify URI of Validation resources with integer UIDs passed to GET. Verify URI of Validation resources with UUIDs passed to GET. Verify personnel resource endpoints with ID passed to GET. Verify club match resource endpoints with ID passed to GET. Verify national tea... | 2.739438 | 3 |
fuzzer/progress_reporter.py | ysoftdevs/wapifuzz | 3 | 6623866 | <filename>fuzzer/progress_reporter.py<gh_stars>1-10
import os
import threading
import sys
import datetime
from configuration_manager import ConfigurationManager
DID_FUZZING_STARTED_CHECKS_TIME_INTERVAL_IN_SECONDS = 5
def report_progress(session, junit_logger):
if did_fuzzing_already_started(session) > ... | <filename>fuzzer/progress_reporter.py<gh_stars>1-10
import os
import threading
import sys
import datetime
from configuration_manager import ConfigurationManager
DID_FUZZING_STARTED_CHECKS_TIME_INTERVAL_IN_SECONDS = 5
def report_progress(session, junit_logger):
if did_fuzzing_already_started(session) > ... | none | 1 | 2.280039 | 2 | |
compute_speeds.py | megvii-research/AnchorDETR | 160 | 6623867 | <reponame>megvii-research/AnchorDETR
# ------------------------------------------------------------------------
# Copyright (c) 2021 megvii-model. All Rights Reserved.
# ------------------------------------------------------------------------
# taken from https://gist.github.com/fmassa/c0fbb9fe7bf53b533b5cc241f5c8234c... | # ------------------------------------------------------------------------
# Copyright (c) 2021 megvii-model. All Rights Reserved.
# ------------------------------------------------------------------------
# taken from https://gist.github.com/fmassa/c0fbb9fe7bf53b533b5cc241f5c8234c with a few modifications
# taken fr... | en | 0.622175 | # ------------------------------------------------------------------------ # Copyright (c) 2021 megvii-model. All Rights Reserved. # ------------------------------------------------------------------------ # taken from https://gist.github.com/fmassa/c0fbb9fe7bf53b533b5cc241f5c8234c with a few modifications # taken from... | 2.282368 | 2 |
toolbox_elmer.py | roughhawkbit/robs-python-scripts | 0 | 6623868 | #/usr/bin/python
from __future__ import division
from __future__ import with_statement
import math
import matplotlib
from matplotlib import pyplot
from mpl_toolkits.axes_grid1 import make_axes_locatable
import numpy
from numpy import mean as amean
import os
import re
from scipy.spatial import Delaunay
from scipy.spatia... | #/usr/bin/python
from __future__ import division
from __future__ import with_statement
import math
import matplotlib
from matplotlib import pyplot
from mpl_toolkits.axes_grid1 import make_axes_locatable
import numpy
from numpy import mean as amean
import os
import re
from scipy.spatial import Delaunay
from scipy.spatia... | en | 0.486112 | #/usr/bin/python # Set up the space from the protocol file. # This isn't quite correct! Without wrapping, Elmer skips some nodes %s\n1 ### Make mesh.header # The 2 denotes dimensions, 202's are boundaries, 404's are elements. ### Make mesh.nodes # Shouldn't this take account of detail_level? # Consider changing this li... | 2.023053 | 2 |
oleander/views/contacts.py | honzajavorek/oleander | 0 | 6623869 | # -*- coding: utf-8 -*-
from flask import render_template, redirect, url_for, request, flash, session
from flask.ext.login import login_required, current_user
from oleander import app, db, facebook, google
from oleander.forms import EmailContactForm
from oleander.models import Contact, FacebookContact, GoogleContact,... | # -*- coding: utf-8 -*-
from flask import render_template, redirect, url_for, request, flash, session
from flask.ext.login import login_required, current_user
from oleander import app, db, facebook, google
from oleander.forms import EmailContactForm
from oleander.models import Contact, FacebookContact, GoogleContact,... | en | 0.776937 | # -*- coding: utf-8 -*- Contacts management page. Removes contact by ID. | 2.631317 | 3 |
examples/01-json-get.py | NxtGames/p3d-rest | 1 | 6623870 | """
Author: <NAME>
Written: 07/30/2019
The MIT License (MIT)
Copyright (c) 2019 Nxt Games
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 ri... | """
Author: <NAME>
Written: 07/30/2019
The MIT License (MIT)
Copyright (c) 2019 Nxt Games
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 ri... | en | 0.763082 | Author: <NAME> Written: 07/30/2019 The MIT License (MIT) Copyright (c) 2019 Nxt Games 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... | 1.929084 | 2 |
qbert/extraction_api.py | StrangeTcy/Q-BERT | 57 | 6623871 | <gh_stars>10-100
import requests
import json
import random
import time
def call_askbert(sentence, threshold=0.2, attribute=True):
url = "http://localhost:5000/"
response = requests.request("POST", url, data={"state": sentence, "threshold": threshold, "attribute": attribute})
response = json.JSOND... | import requests
import json
import random
import time
def call_askbert(sentence, threshold=0.2, attribute=True):
url = "http://localhost:5000/"
response = requests.request("POST", url, data={"state": sentence, "threshold": threshold, "attribute": attribute})
response = json.JSONDecoder().decode(r... | none | 1 | 2.807881 | 3 | |
Codeforces/A_Postcards_and_photos.py | anubhab-code/Competitive-Programming | 0 | 6623872 | s=input()
c=0
t=0
old=""
for i in s:
if i==old:
c+=1
if c>=5 or i!=old:
t+=1
c=0
old=i
print(t) | s=input()
c=0
t=0
old=""
for i in s:
if i==old:
c+=1
if c>=5 or i!=old:
t+=1
c=0
old=i
print(t) | none | 1 | 3.494359 | 3 | |
fs_util.py | akhandpuresoftware/rawfile-localpv | 38 | 6623873 | <filename>fs_util.py
import json
import os
import subprocess
def path_stats(path):
fs_stat = os.statvfs(path)
return {
"fs_size": fs_stat.f_frsize * fs_stat.f_blocks,
"fs_avail": fs_stat.f_frsize * fs_stat.f_bavail,
"fs_files": fs_stat.f_files,
"fs_files_avail": fs_stat.f_favai... | <filename>fs_util.py
import json
import os
import subprocess
def path_stats(path):
fs_stat = os.statvfs(path)
return {
"fs_size": fs_stat.f_frsize * fs_stat.f_blocks,
"fs_avail": fs_stat.f_frsize * fs_stat.f_bavail,
"fs_files": fs_stat.f_files,
"fs_files_avail": fs_stat.f_favai... | none | 1 | 2.168661 | 2 | |
menu.py | sarfarazstark/To-Do-Bot | 4 | 6623874 | <reponame>sarfarazstark/To-Do-Bot
"""Module for sending menus to user"""
from keyboards import get_menu_keyboard, get_tasks_keyboard
from messages import get_signboard, get_message
from languages import get_user_language
# Function for sending main menu
def send_main_menu(update):
# Get user language
languag... | """Module for sending menus to user"""
from keyboards import get_menu_keyboard, get_tasks_keyboard
from messages import get_signboard, get_message
from languages import get_user_language
# Function for sending main menu
def send_main_menu(update):
# Get user language
language = get_user_language(update=updat... | en | 0.686723 | Module for sending menus to user # Function for sending main menu # Get user language # Send menu # Function for sending editor menu # Get user language # Send menu # Function for sending settings menu # Get user language # Send menu # Function for sending edit task menu # Get user language # Send menu # Function for s... | 2.785647 | 3 |
ripple_api/models.py | 42cc/ripple_api | 7 | 6623875 | # -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
from model_utils import ModelTracker
from signals import transaction_status_changed, transaction_failure_send
class Transaction(models.Model):
RECEIVED = 0
PROCESSED = 1
MUST_BE_RETURN = 2
RE... | # -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
from model_utils import ModelTracker
from signals import transaction_status_changed, transaction_failure_send
class Transaction(models.Model):
RECEIVED = 0
PROCESSED = 1
MUST_BE_RETURN = 2
RE... | en | 0.769321 | # -*- coding: utf-8 -*- | 1.988554 | 2 |
bst_min_value.py | alexhla/programming-problems-in-python | 0 | 6623876 | <reponame>alexhla/programming-problems-in-python<gh_stars>0
class Node:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def bstmin(self, A):
while A.left != None: # iterative solution will suffice
A = A.left # as no need to keep track of anything
return... | class Node:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def bstmin(self, A):
while A.left != None: # iterative solution will suffice
A = A.left # as no need to keep track of anything
return A.val # just traverse to left most node
obj = So... | en | 0.969297 | # iterative solution will suffice # as no need to keep track of anything # just traverse to left most node | 3.807601 | 4 |
aoc-statistics.py | pavelrusakovich/statistics_showcase | 0 | 6623877 | #!/bin/python3
import random
from typing import List, Dict
from statistics import mean, median
from operator import itemgetter
from sys import maxsize
"""
Suppose, a = [a[0], a[1], ... a[n-1]] , a[i] is a real number
F(x) = sum( |a[i] - x| for i in (0..n-1) )
G(x) = sum( (a[i] - x)(a[i] - x - 1)/2 for i in (0..n-... | #!/bin/python3
import random
from typing import List, Dict
from statistics import mean, median
from operator import itemgetter
from sys import maxsize
"""
Suppose, a = [a[0], a[1], ... a[n-1]] , a[i] is a real number
F(x) = sum( |a[i] - x| for i in (0..n-1) )
G(x) = sum( (a[i] - x)(a[i] - x - 1)/2 for i in (0..n-... | en | 0.864837 | #!/bin/python3 Suppose, a = [a[0], a[1], ... a[n-1]] , a[i] is a real number F(x) = sum( |a[i] - x| for i in (0..n-1) ) G(x) = sum( (a[i] - x)(a[i] - x - 1)/2 for i in (0..n-1) ) Part 1 - Minimize F(x) for real number x Notice ,that |x| = x * sgn(x), where sgn(x) = 1 if x > 0, sgn(x) = 0 if x = 0, sgn(x) = -1 i... | 3.357241 | 3 |
Section 4/Video1_3_draw.py | PacktPublishing/-Learn-Python-Programming-with-Games | 3 | 6623878 | <reponame>PacktPublishing/-Learn-Python-Programming-with-Games<gh_stars>1-10
'''
Created on Sep 2, 2018
@author: <NAME>
Space background image was downloaded from:
--------------------------------------
https://opengameart.org
No attribution required for this png file.
'''
import pygame
from pygame.locals impor... | '''
Created on Sep 2, 2018
@author: <NAME>
Space background image was downloaded from:
--------------------------------------
https://opengameart.org
No attribution required for this png file.
'''
import pygame
from pygame.locals import *
from os import path
pygame.init()
pygame.display.set_caption('... | en | 0.568182 | Created on Sep 2, 2018 @author: <NAME> Space background image was downloaded from: -------------------------------------- https://opengameart.org No attribution required for this png file. # <== adjust size to your liking # create clock instance # frames per second # define color # line corner coordinates # tuple of... | 2.930305 | 3 |
tests/helpers.py | J-Obog/littlekv | 4 | 6623879 | from typing import Tuple
import subprocess
import time
import os
import signal
import sys
def launch_client_proc(cmd: str, conn_delay: int = 0.25) -> Tuple[int, int, str]:
time.sleep(conn_delay)
client_proc = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE)
exit_code = client_proc.wait()
output = ... | from typing import Tuple
import subprocess
import time
import os
import signal
import sys
def launch_client_proc(cmd: str, conn_delay: int = 0.25) -> Tuple[int, int, str]:
time.sleep(conn_delay)
client_proc = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE)
exit_code = client_proc.wait()
output = ... | none | 1 | 2.493567 | 2 | |
setup.py | hasangchun/sports_news_collector | 5 | 6623880 | from setuptools import setup, find_packages
with open('README.md', encoding='utf-8') as f:
long_description = f.read()
setup(
name='sports_news_collector',
version='0.1',
description='Provide services by collecting various sports news',
long_description=long_description,
long_description_cont... | from setuptools import setup, find_packages
with open('README.md', encoding='utf-8') as f:
long_description = f.read()
setup(
name='sports_news_collector',
version='0.1',
description='Provide services by collecting various sports news',
long_description=long_description,
long_description_cont... | none | 1 | 1.26374 | 1 | |
mod/units/play.py | HeraldStudio/wechat | 1 | 6623881 | <reponame>HeraldStudio/wechat
# -*- coding: utf-8 -*-
# @Date : 2014-07-05 22:43:49
# @Author : <EMAIL> <EMAIL>
from tornado.httpclient import HTTPRequest, HTTPClient, HTTPError
from config import SERVICE, TIME_OUT, DEFAULT_UUID
from get_api_return import error_map
import urllib
def update(db, user):
... | # -*- coding: utf-8 -*-
# @Date : 2014-07-05 22:43:49
# @Author : <EMAIL> <EMAIL>
from tornado.httpclient import HTTPRequest, HTTPClient, HTTPError
from config import SERVICE, TIME_OUT, DEFAULT_UUID
from get_api_return import error_map
import urllib
def update(db, user):
if user.state == 0:
... | fr | 0.288726 | # -*- coding: utf-8 -*- # @Date : 2014-07-05 22:43:49 # @Author : <EMAIL> <EMAIL> | 2.245063 | 2 |
xos/synchronizers/new_base/ansible_main.py | iecedge/xos | 0 | 6623882 | <gh_stars>0
# Copyright 2017-present Open Networking Foundation
#
# 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 applicabl... | # Copyright 2017-present Open Networking Foundation
#
# 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 agr... | en | 0.833103 | # Copyright 2017-present Open Networking Foundation # # 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 agr... | 1.833689 | 2 |
src/openbiolink/obl2021/obl2021.py | nomisto/OpenBioLink | 97 | 6623883 | <filename>src/openbiolink/obl2021/obl2021.py
import os
import pickle
import urllib
import zipfile
from os import path
from typing import cast, Iterable, Tuple
import numpy as np
import pandas as pd
import torch
from openbiolink.utils import split_list_in_batches_iter
from tqdm import tqdm
from openbiolink.graph_creat... | <filename>src/openbiolink/obl2021/obl2021.py
import os
import pickle
import urllib
import zipfile
from os import path
from typing import cast, Iterable, Tuple
import numpy as np
import pandas as pd
import torch
from openbiolink.utils import split_list_in_batches_iter
from tqdm import tqdm
from openbiolink.graph_creat... | en | 0.831411 | Args: root: Pathlike string to directory in which dataset files should be stored # check if exists Number of entities in the dataset Number of relations in the dataset Set of training triples. Shape `(num_train, 3)` Set of test triples. Shape `(num_test, 3)` Set of validation triples. Shape `(num_val, 3)` Set o... | 2.300762 | 2 |
rol_server/scripts/rol_client.py | LCAS/RFID | 0 | 6623884 | #!/usr/bin/env python
import rospy
from std_msgs.msg import String
#from rol_server.srv import findObject, findObjectRequest, findObjectResponse
from hmi_bridge.srv import findObject, findObjectRequest, findObjectResponse
# Node class.
class rol_client():
def __init__(self):
rospy.loginfo('Waiting for ... | #!/usr/bin/env python
import rospy
from std_msgs.msg import String
#from rol_server.srv import findObject, findObjectRequest, findObjectResponse
from hmi_bridge.srv import findObject, findObjectRequest, findObjectResponse
# Node class.
class rol_client():
def __init__(self):
rospy.loginfo('Waiting for ... | en | 0.642802 | #!/usr/bin/env python #from rol_server.srv import findObject, findObjectRequest, findObjectResponse # Node class. # Main function. # Initialize the node and name it. # Go to class functions that do all the heavy lifting. Do error checking. | 2.159183 | 2 |
68jogoParImpar.py | wcalazans81/Mundo_02_Python | 0 | 6623885 | from random import randint
tot = 0
while True:
computador = randint(0, 10)
print('\033[33m=-\033[m'*19)
print('VAMOS JOGAR PAR OU IMPAR!!!')
print('\033[33m=-\033[m'*19)
jogador = int(input('Escolha um número para comaçar: '))
s = computador + jogador
print('\033[34m=-\033[m'*19)
escolha... | from random import randint
tot = 0
while True:
computador = randint(0, 10)
print('\033[33m=-\033[m'*19)
print('VAMOS JOGAR PAR OU IMPAR!!!')
print('\033[33m=-\033[m'*19)
jogador = int(input('Escolha um número para comaçar: '))
s = computador + jogador
print('\033[34m=-\033[m'*19)
escolha... | none | 1 | 3.425138 | 3 | |
example/urls.py | komorebitech/django-ses | 0 | 6623886 | try:
from django.conf.urls import *
except ImportError: # django < 1.4
from django.conf.urls.defaults import *
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/doc/', include('django.contrib.... | try:
from django.conf.urls import *
except ImportError: # django < 1.4
from django.conf.urls.defaults import *
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/doc/', include('django.contrib.... | it | 0.193785 | # django < 1.4 | 1.70112 | 2 |
casper/kernel/spexpr/explicit.h.py | marcovc/casper | 1 | 6623887 | <filename>casper/kernel/spexpr/explicit.h.py
import util
print "/* THIS FILE WAS AUTOGENERATED FROM explicit_ref.h.py */"
print "#include <casper/kernel/spexpr/expr_wrapper.h>"
print "namespace Casper {"
util.printRel(True)
print "namespace Detail {"
util.printRef(True)
util.printGoal(True)
util.printExprWrapper(T... | <filename>casper/kernel/spexpr/explicit.h.py
import util
print "/* THIS FILE WAS AUTOGENERATED FROM explicit_ref.h.py */"
print "#include <casper/kernel/spexpr/expr_wrapper.h>"
print "namespace Casper {"
util.printRel(True)
print "namespace Detail {"
util.printRef(True)
util.printGoal(True)
util.printExprWrapper(T... | none | 1 | 1.623408 | 2 | |
classes/mapping.py | ProjetIsn2019/Ethynd | 14 | 6623888 | # -*- coding: utf-8 -*-
"""Les maps
Objet "Tuile" qui correspond a une tuile.
Objet "Map" qui correspond a une carte de tuiles.
Auteur: <NAME> pour correspondre au modèle de carte imaginé par Anthony
"""
from constantes import constantes_tuiles as ct
from constantes import constantes_partie as cp
from constantes import... | # -*- coding: utf-8 -*-
"""Les maps
Objet "Tuile" qui correspond a une tuile.
Objet "Map" qui correspond a une carte de tuiles.
Auteur: <NAME> pour correspondre au modèle de carte imaginé par Anthony
"""
from constantes import constantes_tuiles as ct
from constantes import constantes_partie as cp
from constantes import... | fr | 0.970525 | # -*- coding: utf-8 -*- Les maps Objet "Tuile" qui correspond a une tuile. Objet "Map" qui correspond a une carte de tuiles. Auteur: <NAME> pour correspondre au modèle de carte imaginé par Anthony Créer une map Pour créer des maps directement et facilement (Un outil) Permets de: - Charger une map (Avec 4 co... | 2.921702 | 3 |
scripts/check_and_create_log_file.py | ZhuoZhuoCrayon/AcousticKeyBoard-Web | 5 | 6623889 | # -*- coding: utf-8 -*-
import os
from typing import List
def check_and_create_log_file(log_file_paths: List[str]):
for log_file_path in log_file_paths:
if os.path.exists(log_file_path):
return
log_file_root = log_file_path.rsplit("/", 1)[0]
if not os.path.exists(log_file_root)... | # -*- coding: utf-8 -*-
import os
from typing import List
def check_and_create_log_file(log_file_paths: List[str]):
for log_file_path in log_file_paths:
if os.path.exists(log_file_path):
return
log_file_root = log_file_path.rsplit("/", 1)[0]
if not os.path.exists(log_file_root)... | en | 0.769321 | # -*- coding: utf-8 -*- | 2.886258 | 3 |
test/test_day_02.py | jacobogomez/adventofcode2021 | 0 | 6623890 | import pytest
from adventofcode2021 import day_02
from .utils import load_file
@pytest.fixture
def input_file():
return load_file("input/day_02.txt")
def test_day02_part_one(input_file):
part_one_answer = day_02.dive(input_file)
assert part_one_answer == 2117664
def test_day02_part_two(input_file):
... | import pytest
from adventofcode2021 import day_02
from .utils import load_file
@pytest.fixture
def input_file():
return load_file("input/day_02.txt")
def test_day02_part_one(input_file):
part_one_answer = day_02.dive(input_file)
assert part_one_answer == 2117664
def test_day02_part_two(input_file):
... | none | 1 | 2.26639 | 2 | |
esmvalcore/_config/_logging.py | markelg/ESMValCore | 26 | 6623891 | """Configure logging."""
import logging
import logging.config
import os
import time
from pathlib import Path
from typing import Union
import yaml
def _purge_file_handlers(cfg: dict) -> None:
"""Remove handlers with filename set.
This is used to remove file handlers which require an output
directory to ... | """Configure logging."""
import logging
import logging.config
import os
import time
from pathlib import Path
from typing import Union
import yaml
def _purge_file_handlers(cfg: dict) -> None:
"""Remove handlers with filename set.
This is used to remove file handlers which require an output
directory to ... | en | 0.459719 | Configure logging. Remove handlers with filename set. This is used to remove file handlers which require an output directory to be set. Initialize log files for the file handlers. Update the log level for the stream handlers. Configure logging. Parameters ---------- cfg_file : str, optional ... | 2.719489 | 3 |
src/main.py | EmmanuellaAlbuquerque/traveling-robin-problem | 0 | 6623892 | <filename>src/main.py<gh_stars>0
from pathlib import Path
from robin_file_reader import RobinFileReader
from trp import TRP
from vnd import VND
from copy import deepcopy
import time
# file_path = Path("../instances/n5.txt").absolute()
# file_path = Path("../instances/n6.txt").absolute()
# file_path = Path("../instance... | <filename>src/main.py<gh_stars>0
from pathlib import Path
from robin_file_reader import RobinFileReader
from trp import TRP
from vnd import VND
from copy import deepcopy
import time
# file_path = Path("../instances/n5.txt").absolute()
# file_path = Path("../instances/n6.txt").absolute()
# file_path = Path("../instance... | en | 0.492856 | # file_path = Path("../instances/n5.txt").absolute() # file_path = Path("../instances/n6.txt").absolute() # file_path = Path("../instances/n10p4.txt").absolute() # file_path = Path("../instances/n15p5.txt").absolute() # file_path = Path("../instances/n29p7A.txt").absolute() # file_path = Path("../instances/n29p8B.txt")... | 2.759387 | 3 |
setup.py | Zeex/samp-server-cli | 13 | 6623893 | <reponame>Zeex/samp-server-cli
from distutils.core import setup
setup(
name='samp-server-cli',
version='1.0',
author='Zeex',
author_email='<EMAIL>',
url='https://github.com/Zeex/samp-server-cli',
description='Advanced CLI for GTA: San Andreas Multiplayer (SA-MP) server',
license='BSD',
py_modules = ['s... | from distutils.core import setup
setup(
name='samp-server-cli',
version='1.0',
author='Zeex',
author_email='<EMAIL>',
url='https://github.com/Zeex/samp-server-cli',
description='Advanced CLI for GTA: San Andreas Multiplayer (SA-MP) server',
license='BSD',
py_modules = ['samp_server_cli'],
entry_point... | none | 1 | 1.128543 | 1 | |
PythonProjects/Tracking/EyeTracking.py | vygasuresh/img | 263 | 6623894 | __author__ = 'Charlie'
import numpy as np
import cv2
import sys, inspect, os
import argparse
cmd_subfolder = os.path.realpath(
os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0], "..","..", "Image_Lib")))
if cmd_subfolder not in sys.path:
sys.path.insert(0, cmd_subfolder)
i... | __author__ = 'Charlie'
import numpy as np
import cv2
import sys, inspect, os
import argparse
cmd_subfolder = os.path.realpath(
os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0], "..","..", "Image_Lib")))
if cmd_subfolder not in sys.path:
sys.path.insert(0, cmd_subfolder)
i... | none | 1 | 2.387135 | 2 | |
mollie/ideal/utils.py | nederhoed/django-mollie-ideal | 9 | 6623895 | <reponame>nederhoed/django-mollie-ideal
#-*- coding: utf-8 -*-
from decimal import Decimal
from mollie.ideal.helpers import _get_mollie_xml, get_mollie_bank_choices
from mollie.ideal.settings import MOLLIE_BTW, MOLLIE_TRANSACTION_FEE
def query_mollie(request_dict, mode):
valid_modes = ('check', 'fetch')
if ... | #-*- coding: utf-8 -*-
from decimal import Decimal
from mollie.ideal.helpers import _get_mollie_xml, get_mollie_bank_choices
from mollie.ideal.settings import MOLLIE_BTW, MOLLIE_TRANSACTION_FEE
def query_mollie(request_dict, mode):
valid_modes = ('check', 'fetch')
if mode not in valid_modes:
raise V... | en | 0.67096 | #-*- coding: utf-8 -*- # sic! | 2.06502 | 2 |
DICOMOFFIS/urls.py | pfagomez/DICOMOFFIS | 0 | 6623896 | from django.urls import path, include
from django.shortcuts import redirect
from DICOMOFFIS import views
urlpatterns =[
path("",views.home, name =("home")),
path('home/' , lambda req: redirect('/')),
path('allgemeines/', views.allgemeines, name= ('allgemeines')),
path('allgemeines/dicom-einfuehrung', v... | from django.urls import path, include
from django.shortcuts import redirect
from DICOMOFFIS import views
urlpatterns =[
path("",views.home, name =("home")),
path('home/' , lambda req: redirect('/')),
path('allgemeines/', views.allgemeines, name= ('allgemeines')),
path('allgemeines/dicom-einfuehrung', v... | none | 1 | 1.805697 | 2 | |
src/ciptools/configuration.py | uwcip/python-ciptools | 0 | 6623897 | import errno
import inspect
import logging
import os
import sys
from pathlib import Path
from types import ModuleType
from typing import Any, Tuple, Union
import ciptools.resources
logger = logging.getLogger(__name__)
# this configuration loader was taken from the Flask configuration loader
# the original can be fo... | import errno
import inspect
import logging
import os
import sys
from pathlib import Path
from types import ModuleType
from typing import Any, Tuple, Union
import ciptools.resources
logger = logging.getLogger(__name__)
# this configuration loader was taken from the Flask configuration loader
# the original can be fo... | en | 0.833538 | # this configuration loader was taken from the Flask configuration loader # the original can be found here: https://github.com/pallets/flask/blob/main/src/flask/config.py # noqa S102 # noqa S102 # load from a package called "{calling_package}.configurations" | 2.253013 | 2 |
ticket/mistune_custom_renderer.py | Xena89/bp-master | 3 | 6623898 | ''''
Copyright (c) 2014 - 2015, <NAME>
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 conditions and the following... | ''''
Copyright (c) 2014 - 2015, <NAME>
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 conditions and the following... | en | 0.709518 | ' Copyright (c) 2014 - 2015, <NAME> 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 conditions and the following di... | 1.893334 | 2 |
tests/test_templates.py | mwort/modelmanager | 1 | 6623899 | """Test module for the Templates plugin."""
import unittest
import os
import cProfile, pstats
import test_project
test_project.TEST_SETTINGS += """
from modelmanager.plugins import templates
from modelmanager.plugins.templates import TemplatesDict as _TemplatesDict
from modelmanager import utils
@utils.propertyplugi... | """Test module for the Templates plugin."""
import unittest
import os
import cProfile, pstats
import test_project
test_project.TEST_SETTINGS += """
from modelmanager.plugins import templates
from modelmanager.plugins.templates import TemplatesDict as _TemplatesDict
from modelmanager import utils
@utils.propertyplugi... | en | 0.453656 | Test module for the Templates plugin. from modelmanager.plugins import templates from modelmanager.plugins.templates import TemplatesDict as _TemplatesDict from modelmanager import utils @utils.propertyplugin class params(_TemplatesDict): template_patterns = ['param.txt'] # return value only # return dict # value ... | 2.699697 | 3 |
mobify/test/test_histmag.py | macbre/mobify | 5 | 6623900 | <gh_stars>1-10
# -*- coding: utf-8 -*-
from __future__ import print_function
from . import MobifyTestCase
from mobify.sources.histmag import HistmagPage, HistmagSource
class Histmag(MobifyTestCase):
@staticmethod
def test_is_my_url():
assert not HistmagSource.is_my_url('http://example.com')
... | # -*- coding: utf-8 -*-
from __future__ import print_function
from . import MobifyTestCase
from mobify.sources.histmag import HistmagPage, HistmagSource
class Histmag(MobifyTestCase):
@staticmethod
def test_is_my_url():
assert not HistmagSource.is_my_url('http://example.com')
assert HistmagS... | en | 0.514287 | # -*- coding: utf-8 -*- # @see https://histmag.org/Maurycy-Beniowski-bunt-na-Kamczatce-13947 # failed assert will print the raw HTML # @see https://histmag.org/Winston-Churchill-lew-Albionu-14521 # failed assert will print the raw HTML | 2.245521 | 2 |
Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/service_status/urls.py | osoco/better-ways-of-thinking-about-software | 3 | 6623901 | """
Django URLs for service status app
"""
from django.conf.urls import url
from openedx.core.djangoapps.service_status.views import celery_ping, celery_status, index
urlpatterns = [
url(r'^$', index, name='status.service.index'),
url(r'^celery/$', celery_status, name='status.service.celery.status'),
url... | """
Django URLs for service status app
"""
from django.conf.urls import url
from openedx.core.djangoapps.service_status.views import celery_ping, celery_status, index
urlpatterns = [
url(r'^$', index, name='status.service.index'),
url(r'^celery/$', celery_status, name='status.service.celery.status'),
url... | en | 0.628141 | Django URLs for service status app | 1.802629 | 2 |
glomtf/pairwisedist.py | Rishit-dagli/GLOM-TensorFlow | 31 | 6623902 | import tensorflow as tf
def pairwise_dist(A, B):
"""Write an algorithm that computes batched the p-norm distance between each pair of two collections of row vectors.
We use the euclidean distance metric.
For a matrix A [m, d] and a matrix B [n, d] we expect a matrix of
pairwise distances here D [m, n... | import tensorflow as tf
def pairwise_dist(A, B):
"""Write an algorithm that computes batched the p-norm distance between each pair of two collections of row vectors.
We use the euclidean distance metric.
For a matrix A [m, d] and a matrix B [n, d] we expect a matrix of
pairwise distances here D [m, n... | en | 0.769396 | Write an algorithm that computes batched the p-norm distance between each pair of two collections of row vectors. We use the euclidean distance metric. For a matrix A [m, d] and a matrix B [n, d] we expect a matrix of pairwise distances here D [m, n] # Arguments: A: A tf.Tensor object. The fir... | 3.562602 | 4 |
tests/test_search.py | dhinakg/BitSTAR | 6 | 6623903 | <filename>tests/test_search.py
# Copyright 2017 Starbot Discord Project
#
# 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>tests/test_search.py
# Copyright 2017 Starbot Discord Project
#
# 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.827401 | # Copyright 2017 Starbot Discord Project # # 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.917053 | 3 |
exploration/scripts/nbconverted/latent_offset_bool.py | greenelab/Pseudomonas_latent_spaces | 0 | 6623904 |
# coding: utf-8
# In[1]:
#-------------------------------------------------------------------------------------------------------------------------------
# By <NAME> (July 2018)
#
# Take the average of the encoded gene expression for the two experimental conditions
# Take the difference of the averages -- this wil... |
# coding: utf-8
# In[1]:
#-------------------------------------------------------------------------------------------------------------------------------
# By <NAME> (July 2018)
#
# Take the average of the encoded gene expression for the two experimental conditions
# Take the difference of the averages -- this wil... | en | 0.449494 | # coding: utf-8 # In[1]: #------------------------------------------------------------------------------------------------------------------------------- # By <NAME> (July 2018) # # Take the average of the encoded gene expression for the two experimental conditions # Take the difference of the averages -- this will be ... | 2.312145 | 2 |
public-engines/kaggle-titanic-engine/marvin_titanic_engine/data_handler/acquisitor_and_cleaner.py | tallandroid/incubator-marvin | 101 | 6623905 | #!/usr/bin/env python
# coding=utf-8
"""AcquisitorAndCleaner engine action.
Use this module to add the project main code.
"""
import pandas as pd
from .._compatibility import six
from .._logging import get_logger
from marvin_python_toolbox.common.data import MarvinData
import pandas as pd
from marvin_python_toolbo... | #!/usr/bin/env python
# coding=utf-8
"""AcquisitorAndCleaner engine action.
Use this module to add the project main code.
"""
import pandas as pd
from .._compatibility import six
from .._logging import get_logger
from marvin_python_toolbox.common.data import MarvinData
import pandas as pd
from marvin_python_toolbo... | en | 0.416394 | #!/usr/bin/env python # coding=utf-8 AcquisitorAndCleaner engine action. Use this module to add the project main code. | 2.490592 | 2 |
ads/graphs_processing/clrs/bellman_ford.py | Aminul-Momin/Algorithms_and_Data_Structures | 0 | 6623906 | <filename>ads/graphs_processing/clrs/bellman_ford.py
from ads.errors.exceptions import NegativeWeightCycleException
from .graphs import Digraph, DGVertex
class BellmanFord(object):
"""
The class represents a data type for detecting the negative-weight cycle for
single-source shortest paths problem in edge... | <filename>ads/graphs_processing/clrs/bellman_ford.py
from ads.errors.exceptions import NegativeWeightCycleException
from .graphs import Digraph, DGVertex
class BellmanFord(object):
"""
The class represents a data type for detecting the negative-weight cycle for
single-source shortest paths problem in edge... | en | 0.77365 | The class represents a data type for detecting the negative-weight cycle for single-source shortest paths problem in edge-weighted digraphs. It returns True if no negative-weight cycle if detected or False if a negative cycle reachable from the source vertex. NOTE: The edge weights can be positive, ne... | 2.937049 | 3 |
coman/_version.py | wietsedv/poco | 1 | 6623907 | from pkg_resources import get_distribution
__version__ = get_distribution("coman").version
| from pkg_resources import get_distribution
__version__ = get_distribution("coman").version
| none | 1 | 1.263042 | 1 | |
companies/tests.py | buketkonuk/pythondotorg | 911 | 6623908 | <filename>companies/tests.py
from django.test import TestCase
from . import admin # coverage FTW
from .templatetags.companies import render_email
class CompaniesTagsTests(TestCase):
def test_render_email(self):
self.assertEqual(render_email(''), None)
self.assertEqual(render_email('<EMAIL>'),... | <filename>companies/tests.py
from django.test import TestCase
from . import admin # coverage FTW
from .templatetags.companies import render_email
class CompaniesTagsTests(TestCase):
def test_render_email(self):
self.assertEqual(render_email(''), None)
self.assertEqual(render_email('<EMAIL>'),... | en | 0.985351 | # coverage FTW | 2.148752 | 2 |
applications/least_norm.py | rbiessel/CovSAR | 1 | 6623909 | import numpy as np
from matplotlib import pyplot as plt
def least_norm(A, closures, pinv=False):
'''
Solve: Ax = b
Find the minimum norm vector 'x' of phases that can explain 'b' phase closures
'''
if pinv:
return np.linalg.pinv(A) @ closures
return A.T @ np.linalg.inv(A @ A.T)... | import numpy as np
from matplotlib import pyplot as plt
def least_norm(A, closures, pinv=False):
'''
Solve: Ax = b
Find the minimum norm vector 'x' of phases that can explain 'b' phase closures
'''
if pinv:
return np.linalg.pinv(A) @ closures
return A.T @ np.linalg.inv(A @ A.T)... | en | 0.876257 | Solve: Ax = b Find the minimum norm vector 'x' of phases that can explain 'b' phase closures Use matrix mult to generate vector of phase closures such that the angle xi = phi_12 + phi_23 - phi_13 # Vector of phases with zero phase closure errors # Vector of phases with non-zero closure errors # Phases ... | 3.206147 | 3 |
wumpus/models/embed.py | jay3332/wumpus.py | 4 | 6623910 | from dataclasses import dataclass
from typing import List, Optional
from .objects import Timestamp
from ..typings import JSON
from ..typings.payloads import (
EmbedPayload,
EmbedAuthorPayload,
EmbedFooterPayload,
EmbedFieldPayload
)
@dataclass
class EmbedField:
"""Represents a field of an :class... | from dataclasses import dataclass
from typing import List, Optional
from .objects import Timestamp
from ..typings import JSON
from ..typings.payloads import (
EmbedPayload,
EmbedAuthorPayload,
EmbedFooterPayload,
EmbedFieldPayload
)
@dataclass
class EmbedField:
"""Represents a field of an :class... | en | 0.540759 | Represents a field of an :class:`Embed`. Attributes ---------- name: str The name of the field. value: str The value of the field. inline: bool Whether or not this field should be displayed inline. Represents the author of an :class:`Embed`. Attributes ---------... | 3.001357 | 3 |
CaptchaBreaker_cmd/load.py | alstjgg/captcha_image_preprocess | 2 | 6623911 | import requests
import cv2
import numpy as np
# Download captcha images from link and save
def get_image_link(link):
"""Download image from given url.
:param link: given url where image is located
:return: image downloaded from url
"""
req = requests.get(link)
try:
req.raise_for_statu... | import requests
import cv2
import numpy as np
# Download captcha images from link and save
def get_image_link(link):
"""Download image from given url.
:param link: given url where image is located
:return: image downloaded from url
"""
req = requests.get(link)
try:
req.raise_for_statu... | en | 0.896329 | # Download captcha images from link and save Download image from given url. :param link: given url where image is located :return: image downloaded from url # Get image from external file(path) Load image from local directory. :param path: given path where image is stored :return: image loaded from di... | 3.219502 | 3 |
visualize_graph_model_performance.py | dimitermilev/ML_predict_hospitalization_risk_ED_pts | 0 | 6623912 | from sklearn.metrics import confusion_matrix, precision_score, recall_score, precision_recall_curve,f1_score, fbeta_score
import seaborn as sns
from matplotlib import pyplot as plt
%matplotlib inline
def graph_roc(data, features, optimal_feature_num, model, title):
'''Build a ROC AUC curve graph with matplotlib'''... | from sklearn.metrics import confusion_matrix, precision_score, recall_score, precision_recall_curve,f1_score, fbeta_score
import seaborn as sns
from matplotlib import pyplot as plt
%matplotlib inline
def graph_roc(data, features, optimal_feature_num, model, title):
'''Build a ROC AUC curve graph with matplotlib'''... | en | 0.792006 | Build a ROC AUC curve graph with matplotlib Build confusion matrix with seaborn. Leverage the predict_proba function of models to adjust threshold Plot precision and recall curves for desired model | 2.85413 | 3 |
src/mission/task/lost_link.py | AuraUAS/aura-core | 8 | 6623913 | <reponame>AuraUAS/aura-core
# lost_link.py: monitors messages from the ground station and flags an
# alert when too much time has elapsed since the last received
# message. If airborne at this time, request the circle home task
# which sends the aircraft home to circle. The operator much chose
# the next course of ac... | # lost_link.py: monitors messages from the ground station and flags an
# alert when too much time has elapsed since the last received
# message. If airborne at this time, request the circle home task
# which sends the aircraft home to circle. The operator much chose
# the next course of action after link is successfu... | en | 0.880181 | # lost_link.py: monitors messages from the ground station and flags an # alert when too much time has elapsed since the last received # message. If airborne at this time, request the circle home task # which sends the aircraft home to circle. The operator much chose # the next course of action after link is successfu... | 2.714616 | 3 |
hackerrank/domain/algorithms/sorting/running_time.py | spradeepv/dive-into-python | 0 | 6623914 | <gh_stars>0
"""
"""
def insertionSort(ar):
length = len(ar)
stop = False
index = 1
running_time = 0
while not stop:
num = ar[index]
for i in range(index - 1, -1, -1):
if num < ar[i]:
ar[i + 1], ar[i] = ar[i], num
running_time += 1
... | """
"""
def insertionSort(ar):
length = len(ar)
stop = False
index = 1
running_time = 0
while not stop:
num = ar[index]
for i in range(index - 1, -1, -1):
if num < ar[i]:
ar[i + 1], ar[i] = ar[i], num
running_time += 1
index += 1
... | none | 1 | 3.693583 | 4 | |
beproductive/blocker.py | JohannesStutz/beproductive | 2 | 6623915 | # AUTOGENERATED! DO NOT EDIT! File to edit: 01_blocker.ipynb (unless otherwise specified).
__all__ = ['APP_NAME', 'REDIRECT', 'WIN_PATH', 'LINUX_PATH', 'NOTIFY_DURATION', 'ICON_PATH', 'host_fp', 'host_fp_copy',
'host_fp_blocked', 'Blocker']
# Cell
from pathlib import Path
from shutil import copy
im... | # AUTOGENERATED! DO NOT EDIT! File to edit: 01_blocker.ipynb (unless otherwise specified).
__all__ = ['APP_NAME', 'REDIRECT', 'WIN_PATH', 'LINUX_PATH', 'NOTIFY_DURATION', 'ICON_PATH', 'host_fp', 'host_fp_copy',
'host_fp_blocked', 'Blocker']
# Cell
from pathlib import Path
from shutil import copy
im... | en | 0.560087 | # AUTOGENERATED! DO NOT EDIT! File to edit: 01_blocker.ipynb (unless otherwise specified). # Cell # Cell # CHANGE TO 5 FOR PRODUCTION # Cell # TODO: refine, add www only if not in url, remove www if in url # Special case for Twitter which has a special API URL | 2.03647 | 2 |
doc/users/plotting/examples/anchored_box03.py | pierre-haessig/matplotlib | 16 | 6623916 | from matplotlib.patches import Ellipse
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid.anchored_artists import AnchoredAuxTransformBox
fig=plt.figure(1, figsize=(3,3))
ax = plt.subplot(111)
box = AnchoredAuxTransformBox(ax.transData, loc=2)
el = Ellipse((0,0), width=0.1, height=0.4, angle=30) # in data co... | from matplotlib.patches import Ellipse
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid.anchored_artists import AnchoredAuxTransformBox
fig=plt.figure(1, figsize=(3,3))
ax = plt.subplot(111)
box = AnchoredAuxTransformBox(ax.transData, loc=2)
el = Ellipse((0,0), width=0.1, height=0.4, angle=30) # in data co... | en | 0.566245 | # in data coordinates! | 2.808593 | 3 |
experiment_2_face_tasks/Doric/__init__.py | arcosin/Task-Detector | 0 | 6623917 | <reponame>arcosin/Task-Detector
from .ProgNet import ProgBlock
from .ProgNet import ProgMultiBlock
from .ProgNet import ProgColumnGenerator
from .ProgNet import ProgColumn
from .ProgNet import ProgNet
from .ProgBlocks import ProgDenseBlock
from .ProgBlocks import ProgDenseBNBlock
from .ProgBlocks import ProgMultiDen... | from .ProgNet import ProgBlock
from .ProgNet import ProgMultiBlock
from .ProgNet import ProgColumnGenerator
from .ProgNet import ProgColumn
from .ProgNet import ProgNet
from .ProgBlocks import ProgDenseBlock
from .ProgBlocks import ProgDenseBNBlock
from .ProgBlocks import ProgMultiDense
from .ProgBlocks import ProgMul... | fr | 0.346644 | #=============================================================================== | 1.25846 | 1 |
ex018.py | gabrieleliasdev/python-cev | 0 | 6623918 | from math import sin, cos, tan, radians
a = float(input('\nType the angle you want:\n>>> '))
s = sin(radians(a))
c = cos(radians(a))
t = tan(radians(a))
print('\nThe is Sine: {:.2f} | Cosine: {:.2f} | Tangent: {:.2f}\n'.format(s,c,t))
| from math import sin, cos, tan, radians
a = float(input('\nType the angle you want:\n>>> '))
s = sin(radians(a))
c = cos(radians(a))
t = tan(radians(a))
print('\nThe is Sine: {:.2f} | Cosine: {:.2f} | Tangent: {:.2f}\n'.format(s,c,t))
| none | 1 | 4.143839 | 4 | |
constants.py | kennjr/PasswordLocker | 0 | 6623919 | <gh_stars>0
database_name = "lockerdatabase.db"
create_login_table_str = """ CREATE TABLE IF NOT EXISTS Login (
id INTEGER PRIMARY KEY,
username TEXT NOT NULL,
password TEXT NOT NULL,
... | database_name = "lockerdatabase.db"
create_login_table_str = """ CREATE TABLE IF NOT EXISTS Login (
id INTEGER PRIMARY KEY,
username TEXT NOT NULL,
password TEXT NOT NULL,
... | en | 0.397143 | CREATE TABLE IF NOT EXISTS Login ( id INTEGER PRIMARY KEY, username TEXT NOT NULL, password TEXT NOT NULL, date_logged_in TEXT NOT NULL ... | 2.93713 | 3 |
gen_route.py | yang0/proxy | 0 | 6623920 | from haipproxy.utils.route_info import gen_route_updater
if __name__ == '__main__':
gen_route_updater() | from haipproxy.utils.route_info import gen_route_updater
if __name__ == '__main__':
gen_route_updater() | none | 1 | 1.189085 | 1 | |
mlxtend/mlxtend/image/utils.py | WhiteWolf21/fp-growth | 0 | 6623921 | # <NAME> 2014-2020
# contributor: <NAME>
# mlxtend Machine Learning Library Extensions
#
# A counter class for printing the progress of an iterator.
# Author: <NAME> <<EMAIL>>
#
# License: BSD 3 clause
import os
import tarfile
import zipfile
import bz2
import imageio
def check_exists(path):
path = os.path.expand... | # <NAME> 2014-2020
# contributor: <NAME>
# mlxtend Machine Learning Library Extensions
#
# A counter class for printing the progress of an iterator.
# Author: <NAME> <<EMAIL>>
#
# License: BSD 3 clause
import os
import tarfile
import zipfile
import bz2
import imageio
def check_exists(path):
path = os.path.expand... | en | 0.539263 | # <NAME> 2014-2020 # contributor: <NAME> # mlxtend Machine Learning Library Extensions # # A counter class for printing the progress of an iterator. # Author: <NAME> <<EMAIL>> # # License: BSD 3 clause | 2.683653 | 3 |
tests/typecheck/example_rat.py | yangdanny97/chocopy-python-compiler | 7 | 6623922 | class Rat(object):
n : int = 0
d : int = 0
def __init__(self : Rat):
pass
def new(self : Rat, n : int, d : int) -> Rat:
self.n = n
self.d = d
return self
def mul(self : Rat, other : Rat) -> Rat:
return Rat().new(self.n * other.n, self.d * other.d)
r1 : Rat = N... | class Rat(object):
n : int = 0
d : int = 0
def __init__(self : Rat):
pass
def new(self : Rat, n : int, d : int) -> Rat:
self.n = n
self.d = d
return self
def mul(self : Rat, other : Rat) -> Rat:
return Rat().new(self.n * other.n, self.d * other.d)
r1 : Rat = N... | none | 1 | 3.851952 | 4 | |
tests/cases/fib.py | MiguelMarcelino/py2many | 2 | 6623923 | #!/usr/bin/env python3
def fib(i: int) -> int:
if i == 0 or i == 1:
return 1
return fib(i - 1) + fib(i - 2)
if __name__ == "__main__":
assert fib(0) == 1
assert fib(1) == 1
assert fib(5) == 8
assert fib(30) == 1346269
print("OK")
| #!/usr/bin/env python3
def fib(i: int) -> int:
if i == 0 or i == 1:
return 1
return fib(i - 1) + fib(i - 2)
if __name__ == "__main__":
assert fib(0) == 1
assert fib(1) == 1
assert fib(5) == 8
assert fib(30) == 1346269
print("OK")
| fr | 0.221828 | #!/usr/bin/env python3 | 3.7587 | 4 |
ctf/models/Score.py | owenofengland/lCTF-Platform | 0 | 6623924 | <gh_stars>0
from . import User
from ctf import db
from sys import path
path.append("..")
class Score(db.Model):
id = db.Column(db.Integer, primary_key=True)
score = db.Column(db.Integer, default=0)
username = db.Column(db.String, db.ForeignKey('user.username'))
| from . import User
from ctf import db
from sys import path
path.append("..")
class Score(db.Model):
id = db.Column(db.Integer, primary_key=True)
score = db.Column(db.Integer, default=0)
username = db.Column(db.String, db.ForeignKey('user.username')) | none | 1 | 2.346419 | 2 | |
simulation-code/old_functions/Main_Sim_with_Kernel.py | young24/LFP-simulation-in-turtle-brain | 0 | 6623925 | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 08 13:46:08 2016
Main_Sim_with_Kernel
@author: superuser
"""
import os
from os.path import join
import time
import multiprocessing
import numpy as np
from scipy.interpolate import RegularGridInterpolator
def make_2D_to_3D(data,xLen,yLen):
'make linear xy index into 2d... | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 08 13:46:08 2016
Main_Sim_with_Kernel
@author: superuser
"""
import os
from os.path import join
import time
import multiprocessing
import numpy as np
from scipy.interpolate import RegularGridInterpolator
def make_2D_to_3D(data,xLen,yLen):
'make linear xy index into 2d... | en | 0.801362 | # -*- coding: utf-8 -*- Created on Fri Apr 08 13:46:08 2016 Main_Sim_with_Kernel @author: superuser # show the progress # z shift between stimulated neuron and cell layer # keep consistent with before ones | 2.341095 | 2 |
runtests.py | seatme/django-axes | 0 | 6623926 | <reponame>seatme/django-axes<filename>runtests.py
#!/usr/bin/env python
import os
import sys
import django
from django.conf import settings
from django.test.utils import get_runner
def run_tests(settings_module, *modules):
os.environ['DJANGO_SETTINGS_MODULE'] = settings_module
django.setup()
TestRunner ... | #!/usr/bin/env python
import os
import sys
import django
from django.conf import settings
from django.test.utils import get_runner
def run_tests(settings_module, *modules):
os.environ['DJANGO_SETTINGS_MODULE'] = settings_module
django.setup()
TestRunner = get_runner(settings)
test_runner = TestRunne... | ru | 0.26433 | #!/usr/bin/env python | 1.871243 | 2 |
georiviere/finances_administration/views.py | georiviere/Georiviere-admin | 7 | 6623927 | <filename>georiviere/finances_administration/views.py<gh_stars>1-10
from django.views import generic as generic_views
from django.utils.translation import gettext_lazy as _
from mapentity import views as mapentity_views
from geotrek.authent.decorators import same_structure_required
from rest_framework import permissio... | <filename>georiviere/finances_administration/views.py<gh_stars>1-10
from django.views import generic as generic_views
from django.utils.translation import gettext_lazy as _
from mapentity import views as mapentity_views
from geotrek.authent.decorators import same_structure_required
from rest_framework import permissio... | en | 0.547028 | # Override annotation done by MapEntityViewSet.get_queryset() | 2.02809 | 2 |
alibi_detect/utils/pytorch/misc.py | sugatoray/alibi-detect | 1,227 | 6623928 | import torch
def zero_diag(mat: torch.Tensor) -> torch.Tensor:
"""
Set the diagonal of a matrix to 0
Parameters
----------
mat
A 2D square matrix
Returns
-------
A 2D square matrix with zeros along the diagonal
"""
return mat - torch.diag(mat.diag())
def quantile(sa... | import torch
def zero_diag(mat: torch.Tensor) -> torch.Tensor:
"""
Set the diagonal of a matrix to 0
Parameters
----------
mat
A 2D square matrix
Returns
-------
A 2D square matrix with zeros along the diagonal
"""
return mat - torch.diag(mat.diag())
def quantile(sa... | en | 0.696233 | Set the diagonal of a matrix to 0 Parameters ---------- mat A 2D square matrix Returns ------- A 2D square matrix with zeros along the diagonal Estimate a desired quantile of a univariate distribution from a vector of samples Parameters ---------- sample A 1D vecto... | 3.119844 | 3 |
hardware.py | ntw1103/deployment-thing | 0 | 6623929 | from flask import Flask, request, jsonify
import sqlite3 as sql
import time
import random
application = Flask(__name__)
def slow_process_to_calculate_availability(provider, name):
time.sleep(5)
return random.choice(['HIGH', 'MEDIUM', 'LOW'])
@application.route('/hardware/')
def hardware():
con = sql.con... | from flask import Flask, request, jsonify
import sqlite3 as sql
import time
import random
application = Flask(__name__)
def slow_process_to_calculate_availability(provider, name):
time.sleep(5)
return random.choice(['HIGH', 'MEDIUM', 'LOW'])
@application.route('/hardware/')
def hardware():
con = sql.con... | none | 1 | 2.727624 | 3 | |
mod/onboardingapi/dcae_cli/catalog/mock/tests/test_mock_catalog.py | onap/dcaegen2-platform | 1 | 6623930 | # ============LICENSE_START=======================================================
# org.onap.dcae
# ================================================================================
# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved.
# =============================================================... | # ============LICENSE_START=======================================================
# org.onap.dcae
# ================================================================================
# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved.
# =============================================================... | en | 0.768562 | # ============LICENSE_START======================================================= # org.onap.dcae # ================================================================================ # Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. # =============================================================... | 1.600847 | 2 |
setup.py | tejaskannan/adaptive-sensor-security | 0 | 6623931 | <reponame>tejaskannan/adaptive-sensor-security
from setuptools import setup
with open('requirements.txt', 'r') as fin:
reqs = fin.read().split('\n')
setup(
name='adaptiveleak',
version='1.0.0',
author='<NAME>',
email='<EMAIL>',
description='Removing information leakage from adaptive sampling p... | from setuptools import setup
with open('requirements.txt', 'r') as fin:
reqs = fin.read().split('\n')
setup(
name='adaptiveleak',
version='1.0.0',
author='<NAME>',
email='<EMAIL>',
description='Removing information leakage from adaptive sampling protocols.',
packages=['adaptiveleak'],
... | none | 1 | 1.326685 | 1 | |
__init__.py | slaclab/LogBookClient | 1 | 6623932 | <filename>__init__.py<gh_stars>1-10
from LogBookClient.LogBookWebService import LogBookWebService
| <filename>__init__.py<gh_stars>1-10
from LogBookClient.LogBookWebService import LogBookWebService
| none | 1 | 1.076829 | 1 | |
projects/CT/CT/positinal_encoding.py | ronenroi/pytorch3d | 0 | 6623933 |
from typing import Tuple
import torch
from pytorch3d.renderer import RayBundle, ray_bundle_to_ray_points
from nerf.nerf.harmonic_embedding import HarmonicEmbedding
class PositionalEncoding(torch.nn.Module):
def __init__(
self,
n_harmonic_functions_xyz: int = 6,
n_harmonic_functions_d... |
from typing import Tuple
import torch
from pytorch3d.renderer import RayBundle, ray_bundle_to_ray_points
from nerf.nerf.harmonic_embedding import HarmonicEmbedding
class PositionalEncoding(torch.nn.Module):
def __init__(
self,
n_harmonic_functions_xyz: int = 6,
n_harmonic_functions_d... | en | 0.670844 | Args: n_harmonic_functions_xyz: The number of harmonic functions used to form the harmonic embedding of 3D point locations. n_harmonic_functions_dir: The number of harmonic functions used to form the harmonic embedding of the ray directions. # The harmonic embeddi... | 2.729544 | 3 |
rosalind/shared_motif.py | wojwarych/bioinf | 0 | 6623934 | #!/usr/bin/env python3
#! -*- coding: utf-8 -*-
import sys
import toolkit as tk
if __name__ == "__main__":
try:
assert len(sys.argv) > 1
except AssertionError:
print("Did not provide txt file with DNA sequence!")
else:
with open(sys.argv[1], "r") as f:
sequences = []
... | #!/usr/bin/env python3
#! -*- coding: utf-8 -*-
import sys
import toolkit as tk
if __name__ == "__main__":
try:
assert len(sys.argv) > 1
except AssertionError:
print("Did not provide txt file with DNA sequence!")
else:
with open(sys.argv[1], "r") as f:
sequences = []
... | en | 0.196817 | #!/usr/bin/env python3 #! -*- coding: utf-8 -*- | 3.560528 | 4 |
Beginner/2748.py | LorranSutter/URI-Online-Judge | 0 | 6623935 | <reponame>LorranSutter/URI-Online-Judge
line = '-'*39
blank = '|' + ' '*37 + '|'
blankRoberto = '|' + ' '*8 + 'Roberto' + ' '*22 + '|'
blankNum = '|' + ' '*8 + '5786' + ' '*25 + '|'
blankUNIFEI = '|' + ' '*8 + 'UNIFEI' + ' '*23 + '|'
print(line)
print(blankRoberto)
print(blank)
print(blankNum)
print(blank)
print(blank... | line = '-'*39
blank = '|' + ' '*37 + '|'
blankRoberto = '|' + ' '*8 + 'Roberto' + ' '*22 + '|'
blankNum = '|' + ' '*8 + '5786' + ' '*25 + '|'
blankUNIFEI = '|' + ' '*8 + 'UNIFEI' + ' '*23 + '|'
print(line)
print(blankRoberto)
print(blank)
print(blankNum)
print(blank)
print(blankUNIFEI)
print(line) | none | 1 | 2.659225 | 3 | |
ads/rest/__init__.py | MagnumOpuses/jobscanner.backend | 0 | 6623936 | from flask_restplus import Api, Namespace
api = Api(version='1.0', title='Backend Service for JobScanner',
description='Serving JobScanner',
default='Jobscanner Backend',
default_label="An API for searching and retrieving job ads.")
ns_alljobs = Namespace('All job ads',
... | from flask_restplus import Api, Namespace
api = Api(version='1.0', title='Backend Service for JobScanner',
description='Serving JobScanner',
default='Jobscanner Backend',
default_label="An API for searching and retrieving job ads.")
ns_alljobs = Namespace('All job ads',
... | none | 1 | 2.301912 | 2 | |
musicpro/views/reporteriaVentas.py | Felipeplz/MusicPro | 0 | 6623937 | from .conn import *
def viewVentas(request, **kwargs):
id = kwargs.get("id")
result = Conectar().execute("SELECT *"
"FROM [dbo].[VENTA]"
"ORDER BY id_venta ASC").fetchall()
return render(request, 'reporteriaVentas.html', {'SQLVentas':result}) | from .conn import *
def viewVentas(request, **kwargs):
id = kwargs.get("id")
result = Conectar().execute("SELECT *"
"FROM [dbo].[VENTA]"
"ORDER BY id_venta ASC").fetchall()
return render(request, 'reporteriaVentas.html', {'SQLVentas':result}) | none | 1 | 1.980076 | 2 | |
bronze/linear_evolve.py | HasanIjaz-HB/Quantum-Computing | 0 | 6623938 | <reponame>HasanIjaz-HB/Quantum-Computing
def linear_evolve(A,v):
| def linear_evolve(A,v): | none | 1 | 1.073046 | 1 | |
stereo/image/segmentation/seg_utils/models/SE_weight_module.py | nilsmechtel/stereopy | 120 | 6623939 | <reponame>nilsmechtel/stereopy
import torch.nn as nn
class SEWeightModule(nn.Module):
def __init__(self, channels, reduction=16):
super(SEWeightModule, self).__init__()
self.avg_pool = nn.AdaptiveAvgPool2d(1)
self.fc1 = nn.Conv2d(channels, channels//reduction, kernel_size=1, paddi... | import torch.nn as nn
class SEWeightModule(nn.Module):
def __init__(self, channels, reduction=16):
super(SEWeightModule, self).__init__()
self.avg_pool = nn.AdaptiveAvgPool2d(1)
self.fc1 = nn.Conv2d(channels, channels//reduction, kernel_size=1, padding=0)
self.relu = nn.ReL... | none | 1 | 2.721358 | 3 | |
libs/xss.py | N3w-elf/Hacking_Help | 14 | 6623940 | <filename>libs/xss.py
# BIBLIOTESCAS
# =============================
from os import system
from time import sleep
# =============================
#
#
# Funçao do XSS
def fun_xss():
while True:
system('clear')
print("""
═╗ ╦╔═╗╔═╗
╔╩╦╝╚═╗╚═╗
... | <filename>libs/xss.py
# BIBLIOTESCAS
# =============================
from os import system
from time import sleep
# =============================
#
#
# Funçao do XSS
def fun_xss():
while True:
system('clear')
print("""
═╗ ╦╔═╗╔═╗
╔╩╦╝╚═╗╚═╗
... | pt | 0.264971 | # BIBLIOTESCAS # ============================= # ============================= # # # Funçao do XSS ═╗ ╦╔═╗╔═╗ ╔╩╦╝╚═╗╚═╗ ╩ ╚═╚═╝╚═╝\n - Os Ataques Cross-site Scripting (Xss) São Um Tipo De Injeção, Na Qual Scripts Maliciosos São Injetados Em Sites Benignos E Confiáveis. O... | 3.370845 | 3 |
gamechangerml/src/search/evaluation/plotter.py | ekmixon/gamechanger-ml | 11 | 6623941 | <reponame>ekmixon/gamechanger-ml
import os
import json
import matplotlib.pyplot as plt
import logging
import argparse
logger = logging.getLogger(__name__)
def load_json(path):
"""
Load json file
Args:
path (str): Path to JSON file
Returns:
data (dict): Dictionary form of JSON fi... | import os
import json
import matplotlib.pyplot as plt
import logging
import argparse
logger = logging.getLogger(__name__)
def load_json(path):
"""
Load json file
Args:
path (str): Path to JSON file
Returns:
data (dict): Dictionary form of JSON file
"""
with open(path, "r... | en | 0.678856 | Load json file Args: path (str): Path to JSON file Returns: data (dict): Dictionary form of JSON file Load all `metrics.json` files in a directory. Args: data_path (str): Path of folder directory containing all tests Returns: all_data (dict): Dictionary form conta... | 3.036254 | 3 |
aqopa/cmd.py | lukaszkurantdev/AQoPA | 2 | 6623942 | '''
Created on 30-10-2013
@author: damian
'''
import optparse
import sys
import os
from aqopa import VERSION
from aqopa.bin import console, gui
def gui_command():
app = gui.AqopaApp(False)
app.MainLoop()
def console_command():
parser = optparse.OptionParser()
parser.usage = "%prog [options]"
... | '''
Created on 30-10-2013
@author: damian
'''
import optparse
import sys
import os
from aqopa import VERSION
from aqopa.bin import console, gui
def gui_command():
app = gui.AqopaApp(False)
app.MainLoop()
def console_command():
parser = optparse.OptionParser()
parser.usage = "%prog [options]"
... | en | 0.580341 | Created on 30-10-2013 @author: damian | 2.240026 | 2 |
tests/test_example.py | norwood867/trio-gpio | 0 | 6623943 | async def test_basic(foo):
assert foo == "bar"
| async def test_basic(foo):
assert foo == "bar"
| none | 1 | 1.327144 | 1 | |
frappe/__version__.py | indictranstech/Hospital-frappe | 0 | 6623944 | from __future__ import unicode_literals
__version__ = "6.27.18"
| from __future__ import unicode_literals
__version__ = "6.27.18"
| none | 1 | 1.056297 | 1 | |
amethyst/support/ops.py | medav/amethyst | 0 | 6623945 | from atlas import *
class BitOrReduceOperator(Operator):
"""Operator that reduces a bits signal via logic OR."""
#
# N.B. This is a good example of how extendable Atlas/Python is. It enables
# user code to create new synthesizable operations that generate custom
# Verilog code.
#
... | from atlas import *
class BitOrReduceOperator(Operator):
"""Operator that reduces a bits signal via logic OR."""
#
# N.B. This is a good example of how extendable Atlas/Python is. It enables
# user code to create new synthesizable operations that generate custom
# Verilog code.
#
... | en | 0.87989 | Operator that reduces a bits signal via logic OR. # # N.B. This is a good example of how extendable Atlas/Python is. It enables # user code to create new synthesizable operations that generate custom # Verilog code. # # Since Atlas doesn't currently have a good way of producing an OR reduction # tree, we can just make ... | 3.101837 | 3 |
splunkforwarder.py | iamnavpreet/httpsplunkforwarder | 0 | 6623946 | import json
import requests
class SplunkForwarder:
def __init__(self, authorization_token, splunk_ingester_domain, connection_port='443'):
assert 'http' in splunk_ingester_domain
assert authorization_token
self.token = authorization_token
self.ingester_url = "{}:{}{}".format(splunk... | import json
import requests
class SplunkForwarder:
def __init__(self, authorization_token, splunk_ingester_domain, connection_port='443'):
assert 'http' in splunk_ingester_domain
assert authorization_token
self.token = authorization_token
self.ingester_url = "{}:{}{}".format(splunk... | en | 0.486251 | # r = requests.post(self.ingester_url?, data=concatenated_payload, headers=headers) | 2.55287 | 3 |
xlstotex/utils.py | tjkessler/xlstotex | 0 | 6623947 | <gh_stars>0
from csv import DictReader
def construct_header(line: list) -> list:
keys = list(line.keys())
header = r'\hline \\[-3.6 ex] '
for idx, key in enumerate(keys):
header += key
if idx != len(keys) - 1:
header += ' & '
return header + r' \\' + r' [0.2 ex] \hline \\ ... | from csv import DictReader
def construct_header(line: list) -> list:
keys = list(line.keys())
header = r'\hline \\[-3.6 ex] '
for idx, key in enumerate(keys):
header += key
if idx != len(keys) - 1:
header += ' & '
return header + r' \\' + r' [0.2 ex] \hline \\ [-3 ex]'
d... | none | 1 | 3.204311 | 3 | |
tests/file/test_path.py | anchoranalysis/anchor-python-utilities | 0 | 6623948 | <reponame>anchoranalysis/anchor-python-utilities<gh_stars>0
"""Tests :mod:`file.path`"""
from anchor_python_utilities import file
import os
def test_path_same_directory() -> None:
assert file.path_same_directory("go/a", "b.txt") == os.path.join("go", "b.txt")
| """Tests :mod:`file.path`"""
from anchor_python_utilities import file
import os
def test_path_same_directory() -> None:
assert file.path_same_directory("go/a", "b.txt") == os.path.join("go", "b.txt") | en | 0.161376 | Tests :mod:`file.path` | 2.579949 | 3 |
AI_Tower_Defense/src/main.py | aasquier/AI_Tower_Defense | 0 | 6623949 | import pygame
from enum import Enum
from game.game import Game
from experiment.qLearning.serialQLearning import SerialQLearning
from experiment.qLearning.parallelQLearning import ParallelQLearning
from experiment.geneticAlgorithm.parallelGA import ParallelGeneticAlgorithm
from experiment.geneticAlgorithm.serialGA impo... | import pygame
from enum import Enum
from game.game import Game
from experiment.qLearning.serialQLearning import SerialQLearning
from experiment.qLearning.parallelQLearning import ParallelQLearning
from experiment.geneticAlgorithm.parallelGA import ParallelGeneticAlgorithm
from experiment.geneticAlgorithm.serialGA impo... | en | 0.853552 | # Select which mode to run the game in # Run a game on each processor core (only when visual_mode is off) # Game data collection for the GA # " " # Update Q table after every game # Display Graphics # Read model from file and continue training from it # Collect and store data # Prints graphs of score averages # the... | 2.536092 | 3 |
Zero_shot/hg_zero_shot.py | CDU-data-science-team/zero-shot | 0 | 6623950 | <reponame>CDU-data-science-team/zero-shot
import pandas as pd
import io
import requests
from transformers import pipeline
# Read clean data (rows code XX removed) file from GitHub repo pxtextmining
# https://stackoverflow.com/questions/32400867/pandas-read-csv-from-url
url = "https://raw.githubusercontent.com/CDU-data... | import pandas as pd
import io
import requests
from transformers import pipeline
# Read clean data (rows code XX removed) file from GitHub repo pxtextmining
# https://stackoverflow.com/questions/32400867/pandas-read-csv-from-url
url = "https://raw.githubusercontent.com/CDU-data-science-team/pxtextmining/development/dat... | en | 0.584223 | # Read clean data (rows code XX removed) file from GitHub repo pxtextmining # https://stackoverflow.com/questions/32400867/pandas-read-csv-from-url # Remove records with no feedback text # Zero-shot pipeline # https://colab.research.google.com/drive/1jocViLorbwWIkTXKwxCOV9HLTaDDgCaw?usp=sharing # A list of dicts with "... | 2.709579 | 3 |