hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
05546aa98f87a37a848e92fb7d15d9dab1ecc3bc | 154 | py | Python | parseCISAURL.py | cyberphreek/Python-Scripts | 316f49cdd9d1ccf81e5289522098f2a4ede4bb55 | [
"MIT"
] | null | null | null | parseCISAURL.py | cyberphreek/Python-Scripts | 316f49cdd9d1ccf81e5289522098f2a4ede4bb55 | [
"MIT"
] | null | null | null | parseCISAURL.py | cyberphreek/Python-Scripts | 316f49cdd9d1ccf81e5289522098f2a4ede4bb55 | [
"MIT"
] | null | null | null | url='https://us-cert.cisa.gov/ics/advisories/icsa-21-154-01'
advisory=url.replace('https://us-cert.cisa.gov/ics/advisories/','')
print(advisory)
| 22 | 68 | 0.694805 | url='https://us-cert.cisa.gov/ics/advisories/icsa-21-154-01'
advisory=url.replace('https://us-cert.cisa.gov/ics/advisories/','')
print(advisory)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bfc230d190f8f8ade9adbdd5980f7166d648d6d4 | 9,521 | py | Python | LightPipes/sources.py | opticspy/lightpipes-python | dbd66e46ca8263a6e9bf7690e5f2b2551f93f4cb | [
"BSD-3-Clause"
] | null | null | null | LightPipes/sources.py | opticspy/lightpipes-python | dbd66e46ca8263a6e9bf7690e5f2b2551f93f4cb | [
"BSD-3-Clause"
] | null | null | null | LightPipes/sources.py | opticspy/lightpipes-python | dbd66e46ca8263a6e9bf7690e5f2b2551f93f4cb | [
"BSD-3-Clause"
] | null | null | null | from .field import Field
from scipy import special
from .core import CircAperture
from .misc import Tilt
import numpy as _np
def AiryBeam1D(Fin, x0 = 0.001, a = 100):
"""
*Creates a 1D nonspreading Airy beam.*
:math:`F(x,y,z=0) = Ai\\left(\\dfrac{x}{x_0}\\right)e^{ax}`
:param Fin: input field
... | 35.394052 | 159 | 0.542905 | from .field import Field
from scipy import special
from .core import BeamMix, Phase, MultPhase, IntAttenuator, CircAperture, GaussHermite, GaussLaguerre, Interpol
from .misc import PI,Tilt, backward_compatible
import numpy as _np
def AiryBeam1D(Fin, x0 = 0.001, a = 100):
"""
*Creates a 1D nonspreading Airy bea... | 18 | 3,386 | 0 | 0 | 0 | 0 | 0 | 105 | 50 |
8aa0c1c3692a9e66840729c139f65257517dd257 | 511 | py | Python | preprocess_web/code/ravens_metadata_apps/content_pages/urls.py | TwoRavens/raven-metadata-service | 9461522219f5ef0f4877f24c8f5923e462bd9557 | [
"Apache-2.0"
] | null | null | null | preprocess_web/code/ravens_metadata_apps/content_pages/urls.py | TwoRavens/raven-metadata-service | 9461522219f5ef0f4877f24c8f5923e462bd9557 | [
"Apache-2.0"
] | 103 | 2018-03-13T20:43:59.000Z | 2021-02-06T19:27:16.000Z | preprocess_web/code/ravens_metadata_apps/content_pages/urls.py | TwoRavens/raven-metadata-service | 9461522219f5ef0f4877f24c8f5923e462bd9557 | [
"Apache-2.0"
] | 1 | 2019-09-11T22:36:14.000Z | 2019-09-11T22:36:14.000Z | from django.urls import path
from ravens_metadata_apps.content_pages import views
urlpatterns = (
path('monitoring/alive',
views.view_monitoring_alive,
name='view_monitoring_alive'),
path('test/err-500',
views.view_err_500_test,
name='view_err_500_test'),
path('test/e... | 21.291667 | 52 | 0.634051 | from django.urls import path
from ravens_metadata_apps.content_pages import views
urlpatterns = (
path('monitoring/alive',
views.view_monitoring_alive,
name='view_monitoring_alive'),
path('test/err-500',
views.view_err_500_test,
name='view_err_500_test'),
path('test/e... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c3285441eba7c33d7dd08b88c473fff45ed93128 | 2,080 | py | Python | src/s3_client_deeposm.py | dbdean/DeepOSM | 4361273723ba271105e2401ecc1707556816f20c | [
"MIT"
] | 1,365 | 2016-05-05T05:34:44.000Z | 2022-01-20T21:20:54.000Z | src/s3_client_deeposm.py | dbdean/DeepOSM | 4361273723ba271105e2401ecc1707556816f20c | [
"MIT"
] | 53 | 2016-05-08T21:10:14.000Z | 2018-06-22T00:31:45.000Z | src/s3_client_deeposm.py | dbdean/DeepOSM | 4361273723ba271105e2401ecc1707556816f20c | [
"MIT"
] | 215 | 2016-05-08T15:56:37.000Z | 2021-11-26T00:51:25.000Z | """Post data to S3."""
import boto3
import os
import pickle
from src.config import CACHE_PATH, FINDINGS_S3_BUCKET
from src.single_layer_network import list_findings
from src.training_data import load_all_training_tiles, tag_with_locations
from src.training_visualization import render_results_for_analysis
def post_f... | 42.44898 | 99 | 0.65625 | """Post data to S3."""
import boto3
import os
import pickle
from src.config import CACHE_PATH, FINDINGS_S3_BUCKET
from src.single_layer_network import list_findings
from src.training_data import load_all_training_tiles, tag_with_locations
from src.training_visualization import render_results_for_analysis
def post_f... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
59c929c8dc4930c9159d681841443544f7ecdb5e | 692 | py | Python | utils.py | Ximpatico/NabotPythonAPI | c536c07b2f6c11e9dc5b340d259dd71794310e1c | [
"MIT"
] | 6 | 2021-02-10T18:31:06.000Z | 2021-08-02T19:05:36.000Z | utils.py | Ximpatico/NabotPythonAPI | c536c07b2f6c11e9dc5b340d259dd71794310e1c | [
"MIT"
] | null | null | null | utils.py | Ximpatico/NabotPythonAPI | c536c07b2f6c11e9dc5b340d259dd71794310e1c | [
"MIT"
] | 2 | 2021-02-10T18:31:09.000Z | 2021-02-13T08:38:53.000Z | import matplotlib.pyplot as plt
cmap = plt.cm.viridis
| 27.68 | 125 | 0.657514 |
import numpy as np
import matplotlib.pyplot as plt
import math
cmap = plt.cm.viridis
def parse_command():
import argparse
parser.add_argument('--gpu', default='0', type=str, metavar='N', help="gpu id")
parser.add_argument('-m', '--model', default='resnet', type=str, help="name of the model to use: resne... | 0 | 0 | 0 | 0 | 0 | 559 | 0 | -13 | 91 |
1ca2a50df59c9538971321f9adafc5055071ff00 | 1,376 | py | Python | pruebas_estadisticas/main.py | binary-hideout/modelado-simulacion | f35d823716f6c033dde3252d63c3c692ef4f9d0f | [
"Unlicense"
] | 1 | 2020-02-11T18:22:27.000Z | 2020-02-11T18:22:27.000Z | pruebas_estadisticas/main.py | binary-hideout/modelado-simulacion | f35d823716f6c033dde3252d63c3c692ef4f9d0f | [
"Unlicense"
] | 1 | 2020-02-26T05:29:47.000Z | 2020-02-26T19:34:49.000Z | pruebas_estadisticas/main.py | binary-hideout/modelado-simulacion | f35d823716f6c033dde3252d63c3c692ef4f9d0f | [
"Unlicense"
] | null | null | null | '''
Mdulo para mandar a llamar las funciones de la tarea de Pruebas estadsticas.
'''
import os
import pathlib
from questionary import text, select, Choice
from validaciones import is_valid_chi
import abajo_arriba
import frecuencias
from ruta import get_file_path
def read_chi():
'''
Pide al usuario ingresar ... | 22.933333 | 113 | 0.615552 | '''
Módulo para mandar a llamar las funciones de la tarea de Pruebas estadísticas.
'''
import os
import pathlib
from questionary import text, select, Choice
from validaciones import is_valid_chi
import abajo_arriba
import frecuencias
from ruta import get_file_path
def read_chi():
'''
Pide al usuario ingresa... | 8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
576986df33f1d25e274acc767cd7258931f7e0b1 | 448 | py | Python | mtslib/update_gs_range.py | John-Ingles-gitH/Media-To-Sheets | fd31c1dd2be0aa050a0ec8adc89dc2ac0bdea075 | [
"MIT"
] | null | null | null | mtslib/update_gs_range.py | John-Ingles-gitH/Media-To-Sheets | fd31c1dd2be0aa050a0ec8adc89dc2ac0bdea075 | [
"MIT"
] | 7 | 2021-03-30T13:46:08.000Z | 2021-12-13T20:44:32.000Z | mtslib/update_gs_range.py | John-Ingles-gitH/Media-To-Sheets | fd31c1dd2be0aa050a0ec8adc89dc2ac0bdea075 | [
"MIT"
] | null | null | null | def update_gs_range(vals, sheet, cell_range):
"""Update range of cells in a google sheets sheet
Args:
vals (list:list:str): List of lists of movie attributes [[title,year,cover_url],...]
sheet (<class Sheet>): Google Sheets sheet object
cell_range (str): cell range in [A-Z][int]:[A-Z][int] style
"""
sheet.sp... | 37.333333 | 86 | 0.683036 | def update_gs_range(vals, sheet, cell_range):
"""Update range of cells in a google sheets sheet
Args:
vals (list:list:str): List of lists of movie attributes [[title,year,cover_url],...]
sheet (<class Sheet>): Google Sheets sheet object
cell_range (str): cell range in [A-Z][int]:[A-Z][int] style
"""
sheet.sp... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5ca054c595fbd5c2952ccc6f88eaae5857b4d711 | 536 | py | Python | app/feedreader/management/commands/update_unread_count.py | jawsper/feedreader | b2b4d8151a786c822e1b59e93d2d8e8959cd210d | [
"MIT"
] | null | null | null | app/feedreader/management/commands/update_unread_count.py | jawsper/feedreader | b2b4d8151a786c822e1b59e93d2d8e8959cd210d | [
"MIT"
] | 28 | 2017-03-16T14:39:53.000Z | 2022-02-10T09:52:58.000Z | app/feedreader/management/commands/update_unread_count.py | jawsper/feedreader | b2b4d8151a786c822e1b59e93d2d8e8959cd210d | [
"MIT"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
| 28.210526 | 83 | 0.677239 | import logging
from django.core.management.base import BaseCommand
from feedreader.models import Outline
from feedreader.functions import get_unread_count
logger = logging.getLogger(__name__)
class Command(BaseCommand):
def handle(self, *args, **options):
for outline in Outline.objects.all():
... | 0 | 0 | 0 | 317 | 0 | 0 | 0 | 74 | 91 |
a9f390e503027c156211efcadb03fa21690a2ea5 | 721 | py | Python | case1130/graph6.py | xierensong/learnPython | 33f9891d8a8ed39772ff9bcbeb1e5cff6f3b5455 | [
"MIT"
] | null | null | null | case1130/graph6.py | xierensong/learnPython | 33f9891d8a8ed39772ff9bcbeb1e5cff6f3b5455 | [
"MIT"
] | null | null | null | case1130/graph6.py | xierensong/learnPython | 33f9891d8a8ed39772ff9bcbeb1e5cff6f3b5455 | [
"MIT"
] | 1 | 2018-10-11T08:20:44.000Z | 2018-10-11T08:20:44.000Z | import matplotlib.pyplot as plt
import networkx as nx
from networkx.drawing.nx_pydot import graphviz_layout
G = nx.path_graph(8)
nx.draw(G)
plt.show()
G = nx.cycle_graph(24)
pos = nx.spring_layout(G, iterations=200)
nx.draw(G, pos, node_color=range(24), node_size=800, cmap=plt.cm.Blues)
plt.show()
G = nx.star_graph(... | 25.75 | 78 | 0.723994 | import matplotlib.pyplot as plt
import networkx as nx
import pydot
from networkx.drawing.nx_pydot import graphviz_layout
G = nx.path_graph(8)
nx.draw(G)
plt.show()
G = nx.cycle_graph(24)
pos = nx.spring_layout(G, iterations=200)
nx.draw(G, pos, node_color=range(24), node_size=800, cmap=plt.cm.Blues)
plt.show()
G = ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -9 | 23 |
40f1bc620cdc59e4699b119985884fafcd6c1ce3 | 169 | py | Python | power_of_two.py | aditya270520/100Daysofpython | a70d72bb8663947ccad1cc0cb6252f3d3624fb44 | [
"MIT"
] | 4 | 2020-12-12T11:49:02.000Z | 2021-02-09T14:10:17.000Z | power_of_two.py | aditya270520/100Daysofpython | a70d72bb8663947ccad1cc0cb6252f3d3624fb44 | [
"MIT"
] | null | null | null | power_of_two.py | aditya270520/100Daysofpython | a70d72bb8663947ccad1cc0cb6252f3d3624fb44 | [
"MIT"
] | null | null | null | terms = 11
result = list(map(lambda x: 2 ** x, range(terms)))
print("The total terms are:",terms)
for i in range(terms):
print("2 raised to power",i,"is",result[i]) | 24.142857 | 50 | 0.650888 | terms = 11
result = list(map(lambda x: 2 ** x, range(terms)))
print("The total terms are:",terms)
for i in range(terms):
print("2 raised to power",i,"is",result[i]) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
982c00a9ef69397991f6db148bb00b24263469dc | 1,679 | py | Python | SC_format.py | Offensive-Panda/ALL_SHELLCODE_FORMAT_COVERTOR | 216446b612f046de13320c59e7dfcbd974a0ca24 | [
"MIT"
] | 1 | 2022-03-25T02:38:34.000Z | 2022-03-25T02:38:34.000Z | SC_format.py | Offensive-Panda/ALL_SHELLCODE_FORMAT_COVERTOR | 216446b612f046de13320c59e7dfcbd974a0ca24 | [
"MIT"
] | null | null | null | SC_format.py | Offensive-Panda/ALL_SHELLCODE_FORMAT_COVERTOR | 216446b612f046de13320c59e7dfcbd974a0ca24 | [
"MIT"
] | null | null | null | #Cyber Security Engineer
#Offensive Specialist
import base64
import sys
#The commented one is bash script to convert shellcode into raw binary formate.
#You just need to change the input file and then run second command to convert into binary form.
#This script will run on linux distributions.
#Commented ... | 31.679245 | 143 | 0.645622 | #Cyber Security Engineer
#Offensive Specialist
import base64
import os
import sys
#The commented one is bash script to convert shellcode into raw binary formate.
#You just need to change the input file and then run second command to convert into binary form.
#This script will run on linux distributions.
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 23 |
d49554c4ffb998e7c89d8f294a4bda9e5ec1180f | 2,623 | py | Python | app.py | pastewka/token-generator-ldap | d12fbca42b3277f4a11c55f899dca221f2a4c4a9 | [
"MIT"
] | null | null | null | app.py | pastewka/token-generator-ldap | d12fbca42b3277f4a11c55f899dca221f2a4c4a9 | [
"MIT"
] | 1 | 2020-05-19T08:50:11.000Z | 2020-05-27T12:31:27.000Z | app.py | pastewka/token-generator-ldap | d12fbca42b3277f4a11c55f899dca221f2a4c4a9 | [
"MIT"
] | 3 | 2020-03-17T04:32:19.000Z | 2021-08-15T12:13:57.000Z |
from flask import Flask
from flask_cors import CORS
from flask_jwt_extended import JWTManager
from flask_ldap3_login import LDAP3LoginManager
app = Flask(__name__)
CORS(app)
app.config.from_envvar("FLASK_CONFIG_FILE")
app.config.from_object(Config)
# Initialise the JSON Web Token Manager.
jwt = JWTManager()
jwt.... | 26.23 | 78 | 0.671369 | import os
import click
from flask import Flask, abort, jsonify, request
from flask_cors import CORS
from flask_jwt_extended import JWTManager, create_access_token
from flask_ldap3_login import LDAP3LoginManager
def get_file_content(key, default=""):
file_path = os.environ.get(key, "")
if os.path.isfile(file... | 0 | 1,318 | 0 | 250 | 0 | 182 | 0 | 25 | 206 |
84051b95518369d12ed964967101af5c9db4e6e2 | 2,473 | py | Python | rbm_reconstruction.py | gugarosa/synthetic_rbms | a86c323e165a893810ac5bf79213f603ed86a8b3 | [
"MIT"
] | null | null | null | rbm_reconstruction.py | gugarosa/synthetic_rbms | a86c323e165a893810ac5bf79213f603ed86a8b3 | [
"MIT"
] | null | null | null | rbm_reconstruction.py | gugarosa/synthetic_rbms | a86c323e165a893810ac5bf79213f603ed86a8b3 | [
"MIT"
] | null | null | null | import argparse
import numpy as np
import torch
import utils.stream as s
def get_arguments():
"""Gets arguments from the command line.
Returns:
A parser with the input arguments.
"""
# Creates the ArgumentParser
parser = argparse.ArgumentParser(
usage='Reconstructs an RBM with... | 31.705128 | 117 | 0.682976 | import argparse
import numpy as np
import torch
import utils.stream as s
def get_arguments():
"""Gets arguments from the command line.
Returns:
A parser with the input arguments.
"""
# Creates the ArgumentParser
parser = argparse.ArgumentParser(
usage='Reconstructs an RBM with... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fa977bf0c5a5d70f43e378ecb8526e0b59d674ac | 5,790 | py | Python | snakemake/wrappers/.snakemake.fnd409gc.merge_bams_wrapper.py | saketkc/EE-546-project | fb7eacd90f6c0a2cb3061837ec5427a14f521aa5 | [
"BSD-2-Clause"
] | 1 | 2020-11-02T07:05:09.000Z | 2020-11-02T07:05:09.000Z | snakemake/wrappers/.snakemake.fnd409gc.merge_bams_wrapper.py | saketkc/EE-546-project | fb7eacd90f6c0a2cb3061837ec5427a14f521aa5 | [
"BSD-2-Clause"
] | null | null | null | snakemake/wrappers/.snakemake.fnd409gc.merge_bams_wrapper.py | saketkc/EE-546-project | fb7eacd90f6c0a2cb3061837ec5427a14f521aa5 | [
"BSD-2-Clause"
] | null | null | null |
######## Snakemake header ########
import sys; sys.path.append("/home/cmb-panasas2/skchoudh/software_frozen/anaconda27/envs/riboraptor/lib/python3.5/site-packages"); import pickle; snakemake = pickle.loads(b'\x80\x03csnakemake.script\nSnakemake\nq\x00)\x81q\x01}q\x02(X\x04\x00\x00\x00ruleq\x03X\n\x00\x00\x00merge_bams... | 263.181818 | 4,897 | 0.804145 |
######## Snakemake header ########
import sys; sys.path.append("/home/cmb-panasas2/skchoudh/software_frozen/anaconda27/envs/riboraptor/lib/python3.5/site-packages"); import pickle; snakemake = pickle.loads(b'\x80\x03csnakemake.script\nSnakemake\nq\x00)\x81q\x01}q\x02(X\x04\x00\x00\x00ruleq\x03X\n\x00\x00\x00merge_bams... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
07fafefc130f60166d8497137e9637c17b89f108 | 5,006 | py | Python | docker/pfsd/pfsd_supervisor.py | qiuyuhang/PolarDB-FileSystem | a18067ef9294c2f509decd80b2b9231c9f950e21 | [
"Apache-2.0"
] | 35 | 2021-11-08T03:24:50.000Z | 2022-03-24T12:39:12.000Z | docker/pfsd/pfsd_supervisor.py | qiuyuhang/PolarDB-FileSystem | a18067ef9294c2f509decd80b2b9231c9f950e21 | [
"Apache-2.0"
] | 2 | 2021-11-30T02:29:53.000Z | 2022-03-17T06:57:53.000Z | docker/pfsd/pfsd_supervisor.py | qiuyuhang/PolarDB-FileSystem | a18067ef9294c2f509decd80b2b9231c9f950e21 | [
"Apache-2.0"
] | 18 | 2021-11-08T08:43:06.000Z | 2022-02-28T09:38:09.000Z | # Copyright (c) 2017-2021, Alibaba Group Holding Limited
# 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 ... | 29.621302 | 134 | 0.651418 | # Copyright (c) 2017-2021, Alibaba Group Holding Limited
# 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 ... | 381 | 0 | 0 | 0 | 0 | 2,856 | 0 | 0 | 274 |
be3e83b46f13f54349977477f2ab1e02cc027300 | 1,195 | py | Python | fm_02_mnist.py | FMsunyh/mnist | 3f120ae003e4dac35807162943985ffcaac6fbde | [
"Apache-2.0"
] | null | null | null | fm_02_mnist.py | FMsunyh/mnist | 3f120ae003e4dac35807162943985ffcaac6fbde | [
"Apache-2.0"
] | null | null | null | fm_02_mnist.py | FMsunyh/mnist | 3f120ae003e4dac35807162943985ffcaac6fbde | [
"Apache-2.0"
] | null | null | null | from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
print(mnist.train.images.shape, mnist.train.labels.shape)
print(mnist.test.images.shape, mnist.test.labels.shape)
print(mnist.validation.images.shape,mnist.validation.label... | 31.447368 | 82 | 0.742259 | from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
print(mnist.train.images.shape, mnist.train.labels.shape)
print(mnist.test.images.shape, mnist.test.labels.shape)
print(mnist.validation.images.shape,mnist.validation.label... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
655fc83ccf76090c0908e7f46661cfb3037cc0bc | 484 | py | Python | impro/setup.py | super-resolution/Impro | 3e410a4e8d9b306f0761708136e0fd03039380ce | [
"MIT"
] | 2 | 2019-06-05T11:31:52.000Z | 2019-06-05T11:32:09.000Z | impro/setup.py | super-resolution/Impro | 3e410a4e8d9b306f0761708136e0fd03039380ce | [
"MIT"
] | null | null | null | impro/setup.py | super-resolution/Impro | 3e410a4e8d9b306f0761708136e0fd03039380ce | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(name='impro',
version='1.1',
description='Image analysis package',
author='Sebastian Reinhard',
author_email='sebastian.reinhard@stud-mail.uni-wuerzburg.de',
url='https://github.com/super-resolution',
packages=... | 34.571429 | 107 | 0.671488 | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(name='impro',
version='1.1',
description='Image analysis package',
author='Sebastian Reinhard',
author_email='sebastian.reinhard@stud-mail.uni-wuerzburg.de',
url='https://github.com/super-resolution',
packages=... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d4cfd65a193acfd3cd6d1722ac6e39d7bb63c787 | 1,121 | py | Python | test/test_chapters.py | peter88213/yWrestler | 32a152e8b814983ecaef6e9861df1d6b7008568d | [
"MIT"
] | null | null | null | test/test_chapters.py | peter88213/yWrestler | 32a152e8b814983ecaef6e9861df1d6b7008568d | [
"MIT"
] | null | null | null | test/test_chapters.py | peter88213/yWrestler | 32a152e8b814983ecaef6e9861df1d6b7008568d | [
"MIT"
] | null | null | null | """Integration tests for the pyWriter project.
Test the conversion of the chapter descriptions.
For further information see https://github.com/peter88213/PyWriter
Published under the MIT License (https://opensource.org/licenses/mit-license.php)
"""
if __name__ == '__main__':
main()
| 27.341463 | 82 | 0.694915 | """Integration tests for the pyWriter project.
Test the conversion of the chapter descriptions.
For further information see https://github.com/peter88213/PyWriter
Published under the MIT License (https://opensource.org/licenses/mit-license.php)
"""
from pywriter.html.html_chapterdesc import HtmlChapterDesc
fr... | 0 | 0 | 0 | 559 | 0 | 11 | 0 | 105 | 142 |
00fd3b6a91548932f71b3904b1dc1c6c07f77079 | 6,500 | py | Python | libvvtest/argutil.py | rrdrake/vvtest | 875aaa81d2fac5986554b7b4fbeb2aebb3b57ac6 | [
"Unlicense"
] | 7 | 2021-03-26T21:33:09.000Z | 2022-03-01T17:06:55.000Z | libvvtest/argutil.py | rrdrake/vvtest | 875aaa81d2fac5986554b7b4fbeb2aebb3b57ac6 | [
"Unlicense"
] | null | null | null | libvvtest/argutil.py | rrdrake/vvtest | 875aaa81d2fac5986554b7b4fbeb2aebb3b57ac6 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# Copyright 2018 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
# Government retains certain rights in this software.
import os
import textwrap
import re
try:
from argparse import HelpFormatter
from arg... | 29.816514 | 76 | 0.539077 | #!/usr/bin/env python
# Copyright 2018 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
# Government retains certain rights in this software.
import sys, os
import textwrap
import re
try:
from argparse import ArgumentParser
fr... | 0 | 0 | 0 | 2,797 | 0 | 0 | 0 | 78 | 266 |
68177aba1effc0e18a74a0efb4d3229b25fd24cf | 3,263 | py | Python | hmmlearn3.py | Niveditha-kumaran/Part-fo-speech-tagging-Viterbi-Algorithm | 0fa782808f9a3305613dd2c89097c89e9ec52576 | [
"MIT"
] | null | null | null | hmmlearn3.py | Niveditha-kumaran/Part-fo-speech-tagging-Viterbi-Algorithm | 0fa782808f9a3305613dd2c89097c89e9ec52576 | [
"MIT"
] | null | null | null | hmmlearn3.py | Niveditha-kumaran/Part-fo-speech-tagging-Viterbi-Algorithm | 0fa782808f9a3305613dd2c89097c89e9ec52576 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Mar 6 00:57:37 2019
@author: nov28
"""
from __future__ import division
import sys
from collections import Counter, defaultdict
import json
if __name__=='__main__':
path=sys.argv[1]
#initialization
tags=[]
data=[]
vocab=[]
tagsdisti... | 27.420168 | 81 | 0.524977 | # -*- coding: utf-8 -*-
"""
Created on Wed Mar 6 00:57:37 2019
@author: nov28
"""
from __future__ import division
import os
import sys
import numpy as np
import glob
import collections
from collections import Counter, defaultdict
import re
import json
import io
import codecs
if __name__=='__main_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -60 | 161 |
8f3a9959aff25557068d26b12bbd8fc95f2f6b9e | 3,146 | py | Python | tests/evaluator/test_evaluator.py | Irlirion/ocp | 6fb3e794eef31559db990300198eca20f41d8f37 | [
"MIT",
"BSD-3-Clause"
] | 242 | 2020-10-14T11:10:43.000Z | 2022-03-29T07:50:18.000Z | tests/evaluator/test_evaluator.py | Irlirion/ocp | 6fb3e794eef31559db990300198eca20f41d8f37 | [
"MIT",
"BSD-3-Clause"
] | 100 | 2020-10-13T23:27:04.000Z | 2022-03-23T16:50:26.000Z | tests/evaluator/test_evaluator.py | Irlirion/ocp | 6fb3e794eef31559db990300198eca20f41d8f37 | [
"MIT",
"BSD-3-Clause"
] | 86 | 2020-10-15T05:56:28.000Z | 2022-03-16T16:11:45.000Z | """
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
| 29.12963 | 72 | 0.635092 | """
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
import numpy as np
import pytest
import torch
from ocpmodels.modules.evaluator import (
Evaluator,
cosine_similarity,
magnitude_... | 0 | 2,086 | 0 | 563 | 0 | 0 | 0 | 61 | 251 |
7f68a24f1b97a4d3c69d1d3044cdd5299f1720df | 1,976 | py | Python | example.py | JoveIC/Grad-CAM | 8cc26d51a82ca3384444fe44d3a4dd0555081e78 | [
"MIT"
] | null | null | null | example.py | JoveIC/Grad-CAM | 8cc26d51a82ca3384444fe44d3a4dd0555081e78 | [
"MIT"
] | null | null | null | example.py | JoveIC/Grad-CAM | 8cc26d51a82ca3384444fe44d3a4dd0555081e78 | [
"MIT"
] | null | null | null | # Example
if __name__ == '__main__':
main()
| 32.933333 | 78 | 0.584008 | # Example
import os
import cv2
import pathlib
import argparse
from PIL import Image
from torchvision import models
from torchvision import transforms
from torchvision.transforms import Resize, ToTensor, Normalize
from gradcam import GradCam
from misc import fuse_heatmap_image
class VGGGradCam(GradCam):
"""
... | 0 | 0 | 0 | 1,277 | 0 | 332 | 0 | 47 | 269 |
c156bebebed786c00c2de0d4bf9507e25726e7d3 | 1,890 | py | Python | cflearn/misc/internal_/callbacks/models/clip_vqgan_aligner.py | carefree0910/carefree-learn | 2043812afbe9c56f01ec1639961736313ee062ba | [
"MIT"
] | 400 | 2020-07-05T18:55:49.000Z | 2022-02-21T02:33:08.000Z | cflearn/misc/internal_/callbacks/models/clip_vqgan_aligner.py | carefree0910/carefree-learn | 2043812afbe9c56f01ec1639961736313ee062ba | [
"MIT"
] | 82 | 2020-08-01T13:29:38.000Z | 2021-10-09T07:13:44.000Z | cflearn/misc/internal_/callbacks/models/clip_vqgan_aligner.py | carefree0910/carefree-learn | 2043812afbe9c56f01ec1639961736313ee062ba | [
"MIT"
] | 34 | 2020-07-05T21:15:34.000Z | 2021-12-20T08:45:17.000Z |
__all__ = [
"CLIPWithVQGANAlignerCallback",
]
| 34.363636 | 87 | 0.655556 | import os
import cv2
import torch
from PIL import Image
from tqdm import tqdm
from .....trainer import Trainer
from .....trainer import TrainerCallback
from .....misc.toolkit import eval_context
@TrainerCallback.register("clip_vqgan_aligner")
class CLIPWithVQGANAlignerCallback(TrainerCallback):
def __init__(sel... | 0 | 1,617 | 0 | 0 | 0 | 0 | 0 | 19 | 201 |
5bcdcccd5ca168cddaee8a38b198c5b298f9aa8f | 17,010 | py | Python | gcloud/datastore/connection.py | olala7846/gcloud-python | f33e557f94f304b38049b5f9b5082ed58dcf295a | [
"Apache-2.0"
] | null | null | null | gcloud/datastore/connection.py | olala7846/gcloud-python | f33e557f94f304b38049b5f9b5082ed58dcf295a | [
"Apache-2.0"
] | null | null | null | gcloud/datastore/connection.py | olala7846/gcloud-python | f33e557f94f304b38049b5f9b5082ed58dcf295a | [
"Apache-2.0"
] | null | null | null | """Connections to gcloud datastore API servers."""
| 37.46696 | 79 | 0.6301 | """Connections to gcloud datastore API servers."""
from gcloud import connection
from gcloud.datastore import datastore_v1_pb2 as datastore_pb
from gcloud.datastore import helpers
from gcloud.datastore.dataset import Dataset
class Connection(connection.Connection):
"""A connection to the Google Cloud Datastore v... | 0 | 1,110 | 0 | 15,650 | 0 | 0 | 0 | 86 | 112 |
9e89e744906447fc7a7a5bd2005d254e6a65b14b | 3,225 | py | Python | shareka/shareka_v3.py | vaaaaanquish/dajare-detector | e8f2d6c861dc0e03b6bc38ba64463bf95376f949 | [
"MIT"
] | 14 | 2020-12-11T01:42:53.000Z | 2021-06-22T06:14:03.000Z | shareka/shareka_v3.py | vaaaaanquish/dajare-detector | e8f2d6c861dc0e03b6bc38ba64463bf95376f949 | [
"MIT"
] | null | null | null | shareka/shareka_v3.py | vaaaaanquish/dajare-detector | e8f2d6c861dc0e03b6bc38ba64463bf95376f949 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
Shareka('').dajarewake()
| 37.941176 | 143 | 0.537054 | import MeCab
from collections import Counter
import re
import alkana
class Shareka:
alpha_regex = re.compile(r'[a-zA-Z]+')
def __init__(self, sentence, n=3):
self.replace_words = [
['。', ''], ['、', ''], [', ', ''], ['.', ''], ['!', ''],
['!', ''], ['・', ''], ['「', ''], ['」', '... | 216 | 0 | 0 | 3,002 | 0 | 0 | 0 | -19 | 111 |
9fce755d09a68cda75a58c9a852b2303a6f490db | 1,186 | py | Python | model/medical_imaging_test_result.py | IDRISSOUM/hospital_management | 56a768f29269a77bc890d40479a8aacb90867189 | [
"Unlicense"
] | null | null | null | model/medical_imaging_test_result.py | IDRISSOUM/hospital_management | 56a768f29269a77bc890d40479a8aacb90867189 | [
"Unlicense"
] | null | null | null | model/medical_imaging_test_result.py | IDRISSOUM/hospital_management | 56a768f29269a77bc890d40479a8aacb90867189 | [
"Unlicense"
] | null | null | null | #-*- coding: utf-8 -*-
#Part of BrowseInfo. See LICENSE file for full copyright and licensing details.
| 42.357143 | 101 | 0.737774 | #-*- coding: utf-8 -*-
#Part of BrowseInfo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields, api, _
from datetime import date,datetime
class medical_imaging_test_result(models.Model):
_name = 'medical.imaging.test.result'
name = fields.Char(string="Name",default='IMGR')
... | 0 | 247 | 0 | 736 | 0 | 0 | 0 | 31 | 68 |
d5683beedf534c565fc39f4bcaf9aaf81bd15c9e | 3,951 | py | Python | indra/tests/test_bel.py | RohitChattopadhyay/indra | a688e8cd46e876a299824c60cf4f6af8618f03da | [
"BSD-2-Clause"
] | null | null | null | indra/tests/test_bel.py | RohitChattopadhyay/indra | a688e8cd46e876a299824c60cf4f6af8618f03da | [
"BSD-2-Clause"
] | null | null | null | indra/tests/test_bel.py | RohitChattopadhyay/indra | a688e8cd46e876a299824c60cf4f6af8618f03da | [
"BSD-2-Clause"
] | null | null | null | from __future__ import absolute_import, print_function, unicode_literals
import os
concept_prefix = 'http://www.openbel.org/bel/namespace//'
entity_prefix = 'http://www.openbel.org/bel/'
path_this = os.path.dirname(os.path.abspath(__file__))
test_rdf_nfkb = os.path.join(path_this, 'bel_rdfs', 'NFKB1_neighborhood.rdf'... | 36.925234 | 77 | 0.643635 | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import os
from indra.util import unicode_strs
from indra.sources import bel
from indra.sources.bel.rdf_processor import BelRdfProcessor
from indra.statements import RegulateAmount, BioContext, RefContext
from nose.pl... | 0 | 1,592 | 0 | 0 | 0 | 1,486 | 0 | 153 | 315 |
f817cf1b4d74655e70d67b2c217add407804d3b6 | 1,219 | py | Python | thermite/__main__.py | A-UNDERSCORE-D/thermite | a8fa11e800059e57b9f4a35e2fd06cccfacaa855 | [
"MIT"
] | 4 | 2021-12-17T20:17:27.000Z | 2021-12-24T00:29:23.000Z | thermite/__main__.py | A-UNDERSCORE-D/thermite | a8fa11e800059e57b9f4a35e2fd06cccfacaa855 | [
"MIT"
] | null | null | null | thermite/__main__.py | A-UNDERSCORE-D/thermite | a8fa11e800059e57b9f4a35e2fd06cccfacaa855 | [
"MIT"
] | 1 | 2022-01-27T19:34:44.000Z | 2022-01-27T19:34:44.000Z | import asyncio
from argparse import ArgumentParser
from .config import load as config_load
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("config")
args = parser.parse_args()
config = config_load(args.config)
asyncio.run(main(config))
| 28.348837 | 82 | 0.722724 | import asyncio
from argparse import ArgumentParser
from ircrobots import ConnectionParams
from ircrobots.security import TLSVerifySHA512
from . import Bot
from .config import Config, load as config_load
from .database import Database
async def main(config: Config):
bot = Bot(
config,
await Datab... | 0 | 0 | 766 | 0 | 0 | 0 | 0 | 55 | 113 |
8a6e83686a2219fe5e7410af682fc0185f9c32a6 | 3,362 | py | Python | ngraph/frontends/neon/data/cifar10.py | NervanaSystems/ngraph-python | ac032c83c7152b615a9ad129d54d350f9d6a2986 | [
"Apache-2.0"
] | 18 | 2018-03-19T04:16:49.000Z | 2021-02-08T14:44:58.000Z | ngraph/frontends/neon/data/cifar10.py | rsumner31/ngraph | 5e5c9bb9f24d95aee190b914dd2d44122fc3be53 | [
"Apache-2.0"
] | 2 | 2019-04-16T06:41:49.000Z | 2019-05-06T14:08:13.000Z | ngraph/frontends/neon/data/cifar10.py | rsumner31/ngraph | 5e5c9bb9f24d95aee190b914dd2d44122fc3be53 | [
"Apache-2.0"
] | 11 | 2018-06-16T15:59:08.000Z | 2021-03-06T00:45:30.000Z | # ******************************************************************************
# Copyright 2017-2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | 39.552941 | 93 | 0.537775 | # ******************************************************************************
# Copyright 2017-2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | 0 | 0 | 0 | 2,471 | 0 | 0 | 0 | 31 | 111 |
6f9578461756921a4b777b81ac325884ecd7fda3 | 13,933 | py | Python | Detection_and_control/ASUM-GUI-with-detection-and-control/main-asum-gui-final.py | kebijuelun/ASUM | 125a0d5db76e6adce360ee897f2a3c3445f7d138 | [
"MIT"
] | 2 | 2021-12-12T09:35:43.000Z | 2021-12-21T15:38:02.000Z | Detection_and_control/ASUM-GUI-with-detection-and-control/main-asum-gui-final.py | kebijuelun/ASUM | 125a0d5db76e6adce360ee897f2a3c3445f7d138 | [
"MIT"
] | null | null | null | Detection_and_control/ASUM-GUI-with-detection-and-control/main-asum-gui-final.py | kebijuelun/ASUM | 125a0d5db76e6adce360ee897f2a3c3445f7d138 | [
"MIT"
] | null | null | null | import sys
from PyQt5.QtWidgets import QApplication
import os
current_dir = os.path.dirname(os.path.abspath(__file__))
os.chdir(current_dir)
import argparse
import serial
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Single Shot MultiBox Detection")
parser.add_argument(
"-... | 38.38292 | 111 | 0.533769 | import sys
from PyQt5.QtWidgets import QApplication, QMainWindow
import os
current_dir = os.path.dirname(os.path.abspath(__file__))
os.chdir(current_dir)
from PyQt5.QtWidgets import QMessageBox
from PyQt5.QtWidgets import QWidget
from PyQt5.QtGui import QImage
from PyQt5.QtGui import QPixmap
from PyQt5.QtCore import ... | 273 | 0 | 0 | 12,505 | 0 | 0 | 0 | 96 | 290 |
82ec122055428c351de973ef8a0d5cf1318926a0 | 13,364 | py | Python | habitat/core/dataset.py | Sapio-S/habitat-lab | 47985177d6e6932db98ee6698371253182cf96fb | [
"MIT"
] | null | null | null | habitat/core/dataset.py | Sapio-S/habitat-lab | 47985177d6e6932db98ee6698371253182cf96fb | [
"MIT"
] | null | null | null | habitat/core/dataset.py | Sapio-S/habitat-lab | 47985177d6e6932db98ee6698371253182cf96fb | [
"MIT"
] | 2 | 2021-08-20T13:39:53.000Z | 2022-02-12T07:47:34.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
r"""Implements dataset functionality to be used ``habitat.EmbodiedTask``.
``habitat.core.dataset`` abstracts over a colle... | 36.917127 | 79 | 0.616956 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
r"""Implements dataset functionality to be used ``habitat.EmbodiedTask``.
``habitat.core.dataset`` abstracts over a colle... | 0 | 1,335 | 0 | 11,197 | 0 | 0 | 0 | 86 | 225 |
1f754bd4cbd150bcb7029a2d281cff2f448adf3b | 1,419 | py | Python | boiler/controller.py | rudineirk/faculdade_boiler | 9e796d8c2603f37799fc02dc7bd01827b28164df | [
"MIT"
] | null | null | null | boiler/controller.py | rudineirk/faculdade_boiler | 9e796d8c2603f37799fc02dc7bd01827b28164df | [
"MIT"
] | null | null | null | boiler/controller.py | rudineirk/faculdade_boiler | 9e796d8c2603f37799fc02dc7bd01827b28164df | [
"MIT"
] | null | null | null | from __future__ import print_function
__all__ = [
'WaterColumnController',
'WaterTempController',
]
KC_LEVEL = 1200.0
HREF = 1.5
WATER_CAPACITANCE = 50000000.0
KC_TEMP = 0.15 * WATER_CAPACITANCE
TREF = 50.0
| 21.830769 | 52 | 0.604651 | from __future__ import print_function
__all__ = [
'WaterColumnController',
'WaterTempController',
]
KC_LEVEL = 1200.0
HREF = 1.5
WATER_CAPACITANCE = 50000000.0
KC_TEMP = 0.15 * WATER_CAPACITANCE
TREF = 50.0
class BaseController(object):
def __init__(self, conn, queue, kc, ref):
self.conn = con... | 0 | 0 | 0 | 1,129 | 0 | 0 | 0 | 0 | 69 |
6bb393a71c7da235f2aedb3776c78c9a3065fd79 | 877 | py | Python | sort/binary_tree_sort.py | jayzane/leetcodePy | 27fbad4a4a94a60bed6cfa89cbef6ce17fa5e7d5 | [
"Apache-2.0"
] | null | null | null | sort/binary_tree_sort.py | jayzane/leetcodePy | 27fbad4a4a94a60bed6cfa89cbef6ce17fa5e7d5 | [
"Apache-2.0"
] | null | null | null | sort/binary_tree_sort.py | jayzane/leetcodePy | 27fbad4a4a94a60bed6cfa89cbef6ce17fa5e7d5 | [
"Apache-2.0"
] | null | null | null | """
2020-12-09: 16:12.99;05:30.08;02:39.92;
2020-12-10: 06:03.32;02:41.62;
"""
from sort import validatetool
if __name__ == '__main__':
validatetool.validate(sort)
| 19.488889 | 50 | 0.403649 | """
二叉树排序
2020-12-09: 16:12.99;05:30.08;02:39.92;
2020-12-10: 06:03.32;02:41.62;
"""
from sort import validatetool
def sort(data):
class N:
def __init__(self, v):
self.v, self.l, self.r = v, None, None
def insert(n, v):
if n:
if v > n.v:
if n.r:
... | 15 | 0 | 0 | 69 | 0 | 608 | 0 | 0 | 23 |
c1dca944ceaf373dcd233952dc978d17172d6168 | 1,863 | py | Python | home/migrations/0006_auto_20170118_1736.py | registerguard/celebrate | 2fb5c0fb495160f72b3841172b03ae8500ba4ef4 | [
"MIT"
] | null | null | null | home/migrations/0006_auto_20170118_1736.py | registerguard/celebrate | 2fb5c0fb495160f72b3841172b03ae8500ba4ef4 | [
"MIT"
] | 1 | 2017-02-16T21:53:38.000Z | 2017-02-16T21:53:38.000Z | home/migrations/0006_auto_20170118_1736.py | registerguard/celebrate | 2fb5c0fb495160f72b3841172b03ae8500ba4ef4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-19 01:36
from __future__ import unicode_literals
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtaildocs.blocks
| 62.1 | 1,188 | 0.721417 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-19 01:36
from __future__ import unicode_literals
from django.db import migrations
import home.models
import wagtail.wagtailcore.blocks
import wagtail.wagtailcore.fields
import wagtail.wagtaildocs.blocks
import wagtail.wagtailimages.blocks
class Migratio... | 0 | 0 | 0 | 1,535 | 0 | 0 | 0 | 22 | 90 |
f8ce76139da6908e4ade21174183f6cc82802ea1 | 4,355 | py | Python | algro/sort.py | soongxin/lint | 2ca5c2d53500a585f839bd4a492ba0c5cf20fd91 | [
"MIT"
] | null | null | null | algro/sort.py | soongxin/lint | 2ca5c2d53500a585f839bd4a492ba0c5cf20fd91 | [
"MIT"
] | null | null | null | algro/sort.py | soongxin/lint | 2ca5c2d53500a585f839bd4a492ba0c5cf20fd91 | [
"MIT"
] | 1 | 2018-06-25T05:05:20.000Z | 2018-06-25T05:05:20.000Z |
TEST_ARR_LENGTH = 200
if __name__ == '__main__':
#
test_arr = [n for n in range(TEST_ARR_LENGTH, -1, -1)]
print(test_arr)
sort = Sort(test_arr)
result = sort.merge_sort()
print(result)
| 29.033333 | 82 | 0.505855 | from random import randint
from copy import deepcopy
TEST_ARR_LENGTH = 200
class Sort(object):
"""Sort class contains some sort methods"""
def __init__(self, arr):
self.arr = deepcopy(arr)
def fast_sort(self, arr):
# 在类表中找一个基点
mid_index = len(arr) // 2
# 将列表中小于基准点的项放到基准左侧... | 225 | 1,954 | 0 | 2,036 | 0 | 0 | 0 | 9 | 67 |
1241a3edfd5dcbd491b5e955c8d6151e5bd6093c | 984 | py | Python | examples/example.py | hellais/txsocksx | a9003c2d50036d6dd11688047f1595e143eefeb9 | [
"BSD-2-Clause"
] | 1 | 2015-03-11T13:11:28.000Z | 2015-03-11T13:11:28.000Z | examples/example.py | hellais/txsocksx | a9003c2d50036d6dd11688047f1595e143eefeb9 | [
"BSD-2-Clause"
] | null | null | null | examples/example.py | hellais/txsocksx | a9003c2d50036d6dd11688047f1595e143eefeb9 | [
"BSD-2-Clause"
] | null | null | null | from twisted.internet import reactor
from twisted.internet.endpoints import TCP4ClientEndpoint
from txsocksx.client import SOCKS5ClientEndpoint
socks_addr = '127.0.0.1'
socks_port = 9050
TCPPoint = TCP4ClientEndpoint(reactor, socks_addr, socks_port)
dst_addr = 'checkip.dyndns.com'
dst_port = 80
SOCKSPoint = SOCKS5Cl... | 24 | 62 | 0.723577 | from twisted.internet import reactor
from twisted.internet.protocol import Protocol, Factory
from twisted.internet.endpoints import TCP4ClientEndpoint
from txsocksx.client import SOCKS5ClientEndpoint
class GETSlash(Protocol):
def connectionMade(self):
self.transport.write("GET / HTTP/1.1\n\r\n\r")
de... | 0 | 81 | 0 | 345 | 0 | 0 | 0 | 34 | 90 |
984e8d64fd14db279ed5d1abd6b514fa9c378a15 | 2,363 | py | Python | Machines/INTENSE/exploit/pwn_server.py | limitedeternity/HackTheBox | ed8d6fc7ff7b880b1961098bedca1fc5fdf7fd09 | [
"MIT"
] | null | null | null | Machines/INTENSE/exploit/pwn_server.py | limitedeternity/HackTheBox | ed8d6fc7ff7b880b1961098bedca1fc5fdf7fd09 | [
"MIT"
] | null | null | null | Machines/INTENSE/exploit/pwn_server.py | limitedeternity/HackTheBox | ed8d6fc7ff7b880b1961098bedca1fc5fdf7fd09 | [
"MIT"
] | 3 | 2021-12-29T10:39:01.000Z | 2022-03-29T22:56:40.000Z | #!/usr/bin/env python
context(os='linux', arch='amd64')
host = '127.0.0.1'
port = 9999
fd = 4
(rbp, canary, rip) = stage1()
libc_write_leak = stage2(rbp, canary, rip)
stage3(canary, rbp, libc_write_leak)
| 23.868687 | 87 | 0.610664 | #!/usr/bin/env python
from pwn import *
context(os='linux', arch='amd64')
host = '127.0.0.1'
port = 9999
fd = 4
def write_note(io, note, length=None):
if length is None:
length = len(note)
io.send(p8(1))
io.send(p8(length))
io.send(note)
def copy_note(io, offset, copySize):
io.send(p8(2... | 0 | 0 | 0 | 0 | 0 | 1,954 | 0 | -4 | 206 |
6d011388353b801d3f77dd708929c17b8c137d60 | 4,240 | py | Python | musestudio/import_raw_files.py | miguelascifo/MuseStudio | 10e4beb8a6e478fdc66bc55b0ede9c082ec88025 | [
"MIT"
] | 1 | 2021-11-16T13:42:29.000Z | 2021-11-16T13:42:29.000Z | musestudio/import_raw_files.py | miguelascifo/MuseStudio | 10e4beb8a6e478fdc66bc55b0ede9c082ec88025 | [
"MIT"
] | null | null | null | musestudio/import_raw_files.py | miguelascifo/MuseStudio | 10e4beb8a6e478fdc66bc55b0ede9c082ec88025 | [
"MIT"
] | 1 | 2021-11-16T13:42:33.000Z | 2021-11-16T13:42:33.000Z | import ntpath
from glob import glob
from platform import system
from pyxdf import load_xdf
def read_raw_xdf(filename = None):
'''Import a single XDF file format that contains one recording.
Args:
filename : string
full path to a single recording
Returns:
Four arrays containing ... | 33.92 | 105 | 0.617689 | import ntpath
from glob import glob
from platform import system
from pyxdf import load_xdf
def read_raw_xdf(filename = None):
'''Import a single XDF file format that contains one recording.
Args:
filename : string
full path to a single recording
Returns:
Four arrays containing ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a029da0a40143c5f2ed1e1f9e8a617e16ea53e55 | 5,989 | py | Python | planar_mpc/utils.py | enhatem/quadrotor_mpc_acados | 9ca50ecc0a852ba5f9464df0ccd5d40e3ebfc295 | [
"Apache-2.0"
] | null | null | null | planar_mpc/utils.py | enhatem/quadrotor_mpc_acados | 9ca50ecc0a852ba5f9464df0ccd5d40e3ebfc295 | [
"Apache-2.0"
] | null | null | null | planar_mpc/utils.py | enhatem/quadrotor_mpc_acados | 9ca50ecc0a852ba5f9464df0ccd5d40e3ebfc295 | [
"Apache-2.0"
] | 1 | 2021-12-29T03:37:01.000Z | 2021-12-29T03:37:01.000Z | import numpy as np
import casadi as cs
def unit_quat(q):
"""
Normalizes a quaternion to be unit modulus.
:param q: 4-dimensional numpy array or CasADi object
:return: the unit quaternion in the same data format as the original one
"""
if isinstance(q, np.ndarray):
# if (q == np.zeros(... | 35.43787 | 135 | 0.599265 | import numpy as np
import pyquaternion
import casadi as cs
import pandas as pd
from sklearn.metrics import mean_squared_error
def quaternion_to_euler(q):
q = pyquaternion.Quaternion(w=q[0], x=q[1], y=q[2], z=q[3])
yaw, pitch, roll = q.yaw_pitch_roll
return [roll, pitch, yaw]
def euler_to_quaternion(roll,... | 0 | 0 | 0 | 0 | 0 | 5,159 | 0 | 21 | 320 |
555bbf4ca0ba587296410f2d28977d419647e1f4 | 362 | py | Python | zlzzlzz2l/0222/1676.py | Kwak-JunYoung/154Algoritm-5weeks | fa18ae5f68a1ee722a30a05309214247f7fbfda4 | [
"MIT"
] | 3 | 2022-01-24T03:06:32.000Z | 2022-01-30T08:43:58.000Z | zlzzlzz2l/0222/1676.py | Kwak-JunYoung/154Algoritm-5weeks | fa18ae5f68a1ee722a30a05309214247f7fbfda4 | [
"MIT"
] | null | null | null | zlzzlzz2l/0222/1676.py | Kwak-JunYoung/154Algoritm-5weeks | fa18ae5f68a1ee722a30a05309214247f7fbfda4 | [
"MIT"
] | 2 | 2022-01-24T02:27:40.000Z | 2022-01-30T08:57:03.000Z |
N = int(input())
result = 1
cnt = 0
total = factorial(result, N)
for i in range(len(total)-1, 0, -1):
if total[i] == '0':
cnt += 1
if cnt > 0:
if total[i] != '0':
break
print(cnt) | 18.1 | 39 | 0.508287 | def factorial(result, num):
if num == 0:
return str(result)
else:
result *= num
return factorial(result, num-1)
N = int(input())
result = 1
cnt = 0
total = factorial(result, N)
for i in range(len(total)-1, 0, -1):
if total[i] == '0':
cnt += 1
if cnt > 0:
if tota... | 0 | 0 | 0 | 0 | 0 | 122 | 0 | 0 | 22 |
badffb23de9c721cafd42980c201bf7beb8cb56d | 1,166 | py | Python | sheslcrypto/LFSR/MatrixCrackLfsr.py | shesl-meow/shesl-crypto | d6caf4fe13a15fa6700c1fef5667816f9d9a03d6 | [
"Apache-2.0"
] | 2 | 2019-11-30T17:29:11.000Z | 2019-12-12T15:42:01.000Z | sheslcrypto/LFSR/MatrixCrackLfsr.py | shesl-meow/shesl-crypto | d6caf4fe13a15fa6700c1fef5667816f9d9a03d6 | [
"Apache-2.0"
] | null | null | null | sheslcrypto/LFSR/MatrixCrackLfsr.py | shesl-meow/shesl-crypto | d6caf4fe13a15fa6700c1fef5667816f9d9a03d6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2
#coding=utf-8
if __name__ == "__main__":
CL = MatrixCrackLfsr([1, 0, 1, 0, 0, 0, 1, 0])
print CL.crack_by_matrix()
| 29.897436 | 90 | 0.572041 | #!/usr/bin/env python2
#coding=utf-8
from sage.all import *
class MatrixCrackLfsr:
"""
通过矩阵乘积的方式,求解 lfsr 的转移矩阵
:param seq: 已经捕获的比特流序列,一个 0,1 数字构成的列表
:param period: 用户可以指定序列的周期,如果周期不对,则会报出 Assert 错误
:return 序列对应的状态转移矩阵
"""
def __init__(self, seq, period=None):
self.period = period... | 219 | 0 | 0 | 898 | 0 | 0 | 0 | 1 | 45 |
ad34d1ecdd1fe6d26dab0dc79ed529d9275392cf | 6,730 | py | Python | intensivos/models.py | jonlatorre/MatriculaEIDE | 81508dc2aaf7276d781ce6787affea6273f4fd49 | [
"MIT"
] | null | null | null | intensivos/models.py | jonlatorre/MatriculaEIDE | 81508dc2aaf7276d781ce6787affea6273f4fd49 | [
"MIT"
] | 3 | 2020-02-10T22:34:11.000Z | 2021-06-10T21:04:34.000Z | intensivos/models.py | jonlatorre/MatriculaEIDE | 81508dc2aaf7276d781ce6787affea6273f4fd49 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.utils.translation import gettext_lazy as _
from django.conf import settings
#Para la autogneracin de passwd
#Para el envio del mail de confirmacion
# favour django-mailer but fall back to django.core.mail
if "mailer" in settings.INSTALLED_APPS:
from mailer import send_mail, mail... | 34.870466 | 239 | 0.661367 | # -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import gettext_lazy as _
import datetime
from django.conf import settings
#Para la autogneración de passwd
from random import choice
from string import letters
#Para el envio del mail de confirmacion
from django.core.mail import EmailM... | 30 | 0 | 0 | 5,204 | 0 | 0 | 0 | 100 | 229 |
2d18545af1774b05b1011329eccd0531e9261d66 | 9,852 | py | Python | lib_trainer/trainer_file_input.py | lakiw/improv | 232712e3d72ecc689741bce9a2c366a9f95096dc | [
"MIT"
] | 1 | 2021-06-22T15:30:01.000Z | 2021-06-22T15:30:01.000Z | lib_trainer/trainer_file_input.py | lakiw/improv | 232712e3d72ecc689741bce9a2c366a9f95096dc | [
"MIT"
] | null | null | null | lib_trainer/trainer_file_input.py | lakiw/improv | 232712e3d72ecc689741bce9a2c366a9f95096dc | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Contains all the file reading logic for the trainer
"""
def get_confirmation(warningtext):
"""
Prints a warning message and asks for user confirmation
Return Values:
True: User selected Yes
False: User selected No
"""
print()
... | 33.624573 | 96 | 0.572574 | #!/usr/bin/env python3
"""
Contains all the file reading logic for the trainer
"""
import codecs
def get_confirmation(warningtext):
"""
Prints a warning message and asks for user confirmation
Return Values:
True: User selected Yes
False: User selected No
""... | 0 | 0 | 0 | 4,675 | 0 | 0 | 0 | -8 | 50 |
c5cd945f8616482f777dfdad84cea742349d8468 | 2,735 | py | Python | dashboard_viewer/uploader/migrations/0011_country_alpha2.py | EHDEN/NetworkDashboards | 8f67debe0e62606c1067eea8f27f2935242c62b4 | [
"MIT"
] | 4 | 2021-05-24T15:12:44.000Z | 2022-03-13T11:51:36.000Z | dashboard_viewer/uploader/migrations/0011_country_alpha2.py | EHDEN/NetworkDashboards | 8f67debe0e62606c1067eea8f27f2935242c62b4 | [
"MIT"
] | 111 | 2020-07-27T14:48:31.000Z | 2022-01-06T17:40:11.000Z | dashboard_viewer/uploader/migrations/0011_country_alpha2.py | EHDEN/NetworkDashboards | 8f67debe0e62606c1067eea8f27f2935242c62b4 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.17 on 2021-04-20 21:52
| 34.1875 | 100 | 0.610603 | # Generated by Django 2.2.17 on 2021-04-20 21:52
import json
from os import path
from django.conf import settings
from django.db import migrations, models
def fill_apha2(apps, schema_editor):
changes = {
"Aland Islands": "Åland Islands",
"Bolivia (Plurinational State of)": "Bolivia, Plurinationa... | 2 | 0 | 0 | 758 | 0 | 1,771 | 0 | 18 | 136 |
87692db4913a1faaedab0fb86d31af831a1e3cf1 | 1,121 | py | Python | meeting/api.py | kiko0217/frappe-app-1 | b2f354803aeac679c6dddc54b8fdba9ccc3b8868 | [
"MIT"
] | null | null | null | meeting/api.py | kiko0217/frappe-app-1 | b2f354803aeac679c6dddc54b8fdba9ccc3b8868 | [
"MIT"
] | null | null | null | meeting/api.py | kiko0217/frappe-app-1 | b2f354803aeac679c6dddc54b8fdba9ccc3b8868 | [
"MIT"
] | null | null | null | import frappe
from frappe.utils.data import add_days, nowdate
def make_orientation_meeting(doc, method):
"""Create Orintate"""
meeting = frappe.get_doc({
"doctype": "Meeting",
"title": "Orientation for {0}".format(doc.first_name),
"date": add_days(nowdate(), 1),
"from_time": "0... | 28.74359 | 65 | 0.611954 | import frappe
from frappe import _
from frappe.utils.data import add_days, nowdate
@frappe.whitelist()
def send_invitation_emails(meeting):
meeting = frappe.get_doc("Meeting", meeting)
meeting.check_permission("email")
if meeting.status == "Planned":
# frappe.sendmail(
# recipients=[d.... | 0 | 678 | 0 | 0 | 0 | 0 | 0 | -1 | 45 |
7269b8b8b8c449946a7c9a3e7aadecf5dbc89cd8 | 6,453 | py | Python | rl_sandbox/algorithms/sac_x/schedulers.py | chanb/rl_sandbox_public | e55f954a29880f83a5b0c3358badda4d900f1564 | [
"MIT"
] | 14 | 2020-11-09T22:05:37.000Z | 2022-02-11T12:41:33.000Z | rl_sandbox/algorithms/sac_x/schedulers.py | chanb/rl_sandbox_public | e55f954a29880f83a5b0c3358badda4d900f1564 | [
"MIT"
] | null | null | null | rl_sandbox/algorithms/sac_x/schedulers.py | chanb/rl_sandbox_public | e55f954a29880f83a5b0c3358badda4d900f1564 | [
"MIT"
] | null | null | null |
# TODO: Add Q-table if we want
| 32.923469 | 178 | 0.618317 | import copy
import numpy as np
import torch
from collections import OrderedDict
from torch.distributions import Categorical
import rl_sandbox.constants as c
class Scheduler:
def __init__(self, max_schedule, num_tasks):
self._max_schedule = max_schedule
self._num_tasks = num_tasks
@property
... | 0 | 53 | 0 | 6,090 | 0 | 0 | 0 | 25 | 248 |
563307c8ad2e5edb9862f53cf452cf15ff0906cf | 829 | py | Python | myweb/myproject/main/models.py | dchacca/DjangoOnline | be470e5784f71da367d987464f83dc8929ee2f70 | [
"MIT"
] | null | null | null | myweb/myproject/main/models.py | dchacca/DjangoOnline | be470e5784f71da367d987464f83dc8929ee2f70 | [
"MIT"
] | null | null | null | myweb/myproject/main/models.py | dchacca/DjangoOnline | be470e5784f71da367d987464f83dc8929ee2f70 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
# Create your models here.
| 27.633333 | 58 | 0.680338 | from __future__ import unicode_literals
from django.db import models
# Create your models here.
class Main(models.Model):
name = models.CharField(max_length=30)
about = models.TextField()
abouttxt = models.TextField(default="")
fb = models.CharField(default="-",max_length=30)
tw = models.CharFie... | 0 | 0 | 0 | 703 | 0 | 0 | 0 | 7 | 45 |
9cd83fc2a28d90b0a61c992ae0fabfb9d4490b84 | 820 | py | Python | wws_and_jl/database/control.py | SaltFishPr/embedded-system-experiment | 15c8701bd5089dce0f6bfcd0c943906e36d4f03a | [
"MIT"
] | 1 | 2020-09-19T16:03:56.000Z | 2020-09-19T16:03:56.000Z | wws_and_jl/database/control.py | SaltFishPr/embedded-system-experiment | 15c8701bd5089dce0f6bfcd0c943906e36d4f03a | [
"MIT"
] | null | null | null | wws_and_jl/database/control.py | SaltFishPr/embedded-system-experiment | 15c8701bd5089dce0f6bfcd0c943906e36d4f03a | [
"MIT"
] | null | null | null | # !/usr/bin/env python3
# -*- coding: utf-8 -*-
# @author: SaltFish
# @file: control.py
# @date: 2020/07/15
import os
import sqlite3
database_dir = os.path.join(os.getcwd(), "instance", "database.sqlite")
def execute_sql(sql, choice):
"""
sql
:param sql:
:param choice: 'select' 'update', 'insert', '... | 20.5 | 77 | 0.6 | # !/usr/bin/env python3
# -*- coding: utf-8 -*-
# @author: SaltFish
# @file: control.py
# @date: 2020/07/15
import os
import sqlite3
import time
database_dir = os.path.join(os.getcwd(), "instance", "database.sqlite")
def execute_sql(sql, choice):
"""
执行sql语句
:param sql:
:param choice: 'select', 'upd... | 15 | 0 | 0 | 0 | 0 | 155 | 0 | -10 | 45 |
ea068628d0b26c53ce0d8556d2fa0db8454a940c | 589 | py | Python | program/templatetags/content_boxes.py | Dumbaz/autoradio-pv | 8aae293e58b2e79a05956c535bb109f74edc89c3 | [
"BSD-3-Clause"
] | null | null | null | program/templatetags/content_boxes.py | Dumbaz/autoradio-pv | 8aae293e58b2e79a05956c535bb109f74edc89c3 | [
"BSD-3-Clause"
] | null | null | null | program/templatetags/content_boxes.py | Dumbaz/autoradio-pv | 8aae293e58b2e79a05956c535bb109f74edc89c3 | [
"BSD-3-Clause"
] | null | null | null | from django import template
register = template.Library()
| 23.56 | 61 | 0.741935 | from django import template
from program.models import Type, MusicFocus, Category, Topic
register = template.Library()
@register.inclusion_tag('boxes/type.html')
def type():
return {'type_list': Type.objects.filter(is_active=True)}
@register.inclusion_tag('boxes/musicfocus.html')
def musicfocus():
return ... | 0 | 373 | 0 | 0 | 0 | 0 | 0 | 39 | 115 |
be67d94603586560c8000b7c50b9d8816d978b18 | 68 | py | Python | example_snippets/multimenus_snippets/Snippets/SciPy/Physical and mathematical constants/CODATA physical constants/H/helion mass energy equivalent in MeV.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | null | null | null | example_snippets/multimenus_snippets/Snippets/SciPy/Physical and mathematical constants/CODATA physical constants/H/helion mass energy equivalent in MeV.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | null | null | null | example_snippets/multimenus_snippets/Snippets/SciPy/Physical and mathematical constants/CODATA physical constants/H/helion mass energy equivalent in MeV.py | kuanpern/jupyterlab-snippets-multimenus | 477f51cfdbad7409eab45abe53cf774cd70f380c | [
"BSD-3-Clause"
] | 1 | 2021-02-04T04:51:48.000Z | 2021-02-04T04:51:48.000Z | constants.physical_constants["helion mass energy equivalent in MeV"] | 68 | 68 | 0.852941 | constants.physical_constants["helion mass energy equivalent in MeV"] | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5ef3b0f4baff6451e2c2f602124970bd6da3608a | 11,661 | py | Python | src/sysl/core/syslloader.py | anz-rfc/sysl | a145361fb17f17f36c483128a2eac42d08232870 | [
"Apache-2.0"
] | 2 | 2021-11-12T03:18:18.000Z | 2021-11-12T14:51:05.000Z | src/sysl/core/syslloader.py | anz-rfc/sysl | a145361fb17f17f36c483128a2eac42d08232870 | [
"Apache-2.0"
] | null | null | null | src/sysl/core/syslloader.py | anz-rfc/sysl | a145361fb17f17f36c483128a2eac42d08232870 | [
"Apache-2.0"
] | 1 | 2020-02-18T21:50:52.000Z | 2020-02-18T21:50:52.000Z | """sysl module loader"""
import codecs
import os
import re
import sys
from sysl.proto import sysl_pb2
from sysl.core import syslalgo
from sysl.core import syslparse
from sysl.core import syslx
def fmt_app_name(appname):
"""Format a sysl_pb2.AppName as a syntactically valid string."""
return ' :: '.join(app... | 33.222222 | 88 | 0.52414 | """sysl module loader"""
import codecs
import os
import re
import sys
from sysl.proto import sysl_pb2
from sysl.core import syslalgo
from sysl.core import syslparse
from sysl.core import syslx
def fmt_app_name(appname):
"""Format a sysl_pb2.AppName as a syntactically valid string."""
return ' :: '.join(app... | 0 | 0 | 0 | 0 | 0 | 4,740 | 0 | 0 | 135 |
799c7c4c663e68b97fc20d1a23453cc6437db94f | 3,493 | py | Python | ironic_python_agent/extensions/attestation.py | DanNiESh/ironic-python-agent | 4f421295f1de77f42069cf8628c639fb574981ad | [
"Apache-2.0"
] | null | null | null | ironic_python_agent/extensions/attestation.py | DanNiESh/ironic-python-agent | 4f421295f1de77f42069cf8628c639fb574981ad | [
"Apache-2.0"
] | null | null | null | ironic_python_agent/extensions/attestation.py | DanNiESh/ironic-python-agent | 4f421295f1de77f42069cf8628c639fb574981ad | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | 37.967391 | 78 | 0.632408 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | 0 | 2,584 | 0 | 31 | 0 | 0 | 0 | 53 | 228 |
cf0ffa45a9bd29241f19d1e95c36323e29033dab | 4,065 | py | Python | hw4/get_solve.py | Cherrybruin/201605130098LiYunkai | f15da46a824c8722c73e996dd225dc26530b4230 | [
"Apache-2.0"
] | null | null | null | hw4/get_solve.py | Cherrybruin/201605130098LiYunkai | f15da46a824c8722c73e996dd225dc26530b4230 | [
"Apache-2.0"
] | null | null | null | hw4/get_solve.py | Cherrybruin/201605130098LiYunkai | f15da46a824c8722c73e996dd225dc26530b4230 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# import spacy
import re, json
# nlp = spacy.load('en',disable=["tagger", "parser", "ner"])
re_word = re.compile(r"\w+")
import json
tweets = {}
posting_list = {}
avdl = 0
with open("../hw3/tweets.txt",'r',encoding='utf-8') as fp:
for i in fp:
tweet = json.loads(i)
tweetId = int(twee... | 33.875 | 121 | 0.559164 | # coding=utf-8
# import spacy
import re, json
from math import log
# nlp = spacy.load('en',disable=["tagger", "parser", "ner"])
re_word = re.compile(r"\w+")
import json
tweets = {}
posting_list = {}
def re_get_word_count(text:str):
'''
params:
text: str
文本
return type:
... | 6 | 0 | 0 | 0 | 471 | 269 | 0 | -1 | 105 |
8954e49cf3cde346f643d32e27e67034f8594f24 | 512 | py | Python | webscraping_forexlive_sessionwraps.py | LtheKid/webscraping | 7cdf11b198b1cb7d51ce2bbdb9c633c7e6002336 | [
"CC0-1.0"
] | null | null | null | webscraping_forexlive_sessionwraps.py | LtheKid/webscraping | 7cdf11b198b1cb7d51ce2bbdb9c633c7e6002336 | [
"CC0-1.0"
] | null | null | null | webscraping_forexlive_sessionwraps.py | LtheKid/webscraping | 7cdf11b198b1cb7d51ce2bbdb9c633c7e6002336 | [
"CC0-1.0"
] | null | null | null |
from bs4 import BeautifulSoup
import requests
Print_title = True
#Forexlive
url = "http://www.forexlive.com/SessionWraps" #put URL here
r = requests.get(url)
data = r.text
soup = BeautifulSoup(data,"lxml") #Doing it like this prevents some weird error
if Print_title == True:
print ("FOREXLIVE LATEST SESSION WRA... | 23.272727 | 79 | 0.703125 |
from bs4 import BeautifulSoup
import requests
import lxml
Print_title = True
#Forexlive
url = "http://www.forexlive.com/SessionWraps" #put URL here
r = requests.get(url)
data = r.text
soup = BeautifulSoup(data,"lxml") #Doing it like this prevents some weird error
if Print_title == True:
print ("FOREXLIVE LATEST... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -10 | 22 |
c9fef8795241e77ed65aa8d9d2e653e5c1d80087 | 217 | py | Python | PyUdemy/Day8/CreatingFunction.py | JoseArtur/phyton-exercices | f3da4447044e445222233960f991fb2e36311131 | [
"MIT"
] | null | null | null | PyUdemy/Day8/CreatingFunction.py | JoseArtur/phyton-exercices | f3da4447044e445222233960f991fb2e36311131 | [
"MIT"
] | null | null | null | PyUdemy/Day8/CreatingFunction.py | JoseArtur/phyton-exercices | f3da4447044e445222233960f991fb2e36311131 | [
"MIT"
] | null | null | null | # Review:
# Create a function called greet().
# Write 3 print statements inside the function.
# Call the greet() function and run your code.
greet() | 24.111111 | 47 | 0.663594 | # Review:
# Create a function called greet().
# Write 3 print statements inside the function.
# Call the greet() function and run your code.
def greet():
print("Hi")
print("Salut")
print("Hallo")
greet() | 0 | 0 | 0 | 0 | 0 | 45 | 0 | 0 | 22 |
d6ed74249e72c494b3595ad23a72463fa2424ccf | 16,039 | py | Python | latest-wired-micropython.py | Hagb/micropython-drcom | f6ba8725301a3ade90a34cd200ce5e1ce112dd15 | [
"PSF-2.0"
] | 1 | 2020-09-07T17:16:52.000Z | 2020-09-07T17:16:52.000Z | latest-wired-micropython.py | Hagb/micropython-drcom | f6ba8725301a3ade90a34cd200ce5e1ce112dd15 | [
"PSF-2.0"
] | null | null | null | latest-wired-micropython.py | Hagb/micropython-drcom | f6ba8725301a3ade90a34cd200ce5e1ce112dd15 | [
"PSF-2.0"
] | null | null | null | #!/usr/bin/env micropython
# -*- coding: utf-8 -*-
import socket_drcom as socket
import sys
import binascii
# CONFIG
server = "192.168.100.150"
username = ""
password = ""
host_name = "LIYUANYUAN"
host_os = "8089D"
host_ip = "10.30.22.17"
PRIMARY_DNS = "114.114.114.114"
dhcp_server = "0.0.0.0"
mac = 0xb888e3051680
CON... | 31.697628 | 90 | 0.566432 | #!/usr/bin/env micropython
# -*- coding: utf-8 -*-
import socket_drcom as socket
import struct
import time
from md5_drcom import MD5Type as md5
import sys
import os
import random_drcom as random
import binascii
import uerrno
# CONFIG
server = "192.168.100.150"
username = ""
password = ""
host_name = "LIYUANYUAN"
host_... | 0 | 0 | 0 | 100 | 0 | 10,113 | 0 | -15 | 500 |
2ae07f6a440db23baa190d7375fa5d946b9a1101 | 2,090 | py | Python | titlelab.py | frenchie16/TitleLab | 5957b89aece956e3e61ee03a1fe3c2534543f30d | [
"Unlicense"
] | null | null | null | titlelab.py | frenchie16/TitleLab | 5957b89aece956e3e61ee03a1fe3c2534543f30d | [
"Unlicense"
] | 1 | 2018-02-28T04:11:21.000Z | 2018-02-28T06:12:05.000Z | titlelab.py | frenchie16/TitleLab | 5957b89aece956e3e61ee03a1fe3c2534543f30d | [
"Unlicense"
] | null | null | null |
if __name__ == '__main__':
main() | 35.423729 | 112 | 0.633971 | import argparse
from pythonosc import osc_message_builder
from pythonosc import udp_client
def send_msg(client, address, *args):
msg = osc_message_builder.OscMessageBuilder(address=address)
for arg in args:
msg.add_arg(arg)
client.send(msg.build())
def main():
parser = argparse.ArgumentPars... | 0 | 0 | 0 | 0 | 0 | 1,911 | 0 | 25 | 113 |
0f359758ec2f9a676ec5e03d99c5b228efddbe29 | 557 | py | Python | bokio/route/profile/profile.py | mahdikhashan/bokio | 6f2651067a9e7b1dcdf91a64f4fa84595f545278 | [
"MIT"
] | 3 | 2020-07-06T19:39:17.000Z | 2020-07-07T18:21:30.000Z | bokio/route/profile/profile.py | mahdikhashan/bokio | 6f2651067a9e7b1dcdf91a64f4fa84595f545278 | [
"MIT"
] | null | null | null | bokio/route/profile/profile.py | mahdikhashan/bokio | 6f2651067a9e7b1dcdf91a64f4fa84595f545278 | [
"MIT"
] | null | null | null | from flask import Blueprint
router = Blueprint('profile_route', __name__,
template_folder='templates',
static_folder='static',
static_url_path='/profile/static')
| 25.318182 | 70 | 0.691203 | from flask import abort
from flask import Blueprint
from flask import render_template
from jinja2 import TemplateNotFound
from flask_login import login_required, current_user
router = Blueprint('profile_route', __name__,
template_folder='templates',
static_folder='static',
... | 0 | 161 | 0 | 0 | 0 | 0 | 0 | 59 | 112 |
ef5dfd304623f9cd21c49fe10dad5b661348fb8e | 1,567 | py | Python | modeling/__init__.py | NewLuminous/Zalo-Vietnamese-Wiki-QA | 77ebee07d4555c9ee91a65921eec4adeb86a24c0 | [
"MIT"
] | null | null | null | modeling/__init__.py | NewLuminous/Zalo-Vietnamese-Wiki-QA | 77ebee07d4555c9ee91a65921eec4adeb86a24c0 | [
"MIT"
] | null | null | null | modeling/__init__.py | NewLuminous/Zalo-Vietnamese-Wiki-QA | 77ebee07d4555c9ee91a65921eec4adeb86a24c0 | [
"MIT"
] | null | null | null |
MODELS = [
'naive_bayes',
'rocchio', 'knn',
'logit', 'logit-embedding',
'svc', 'linear_svc',
'random-forest', 'extra_trees', 'lightgbm', 'xgboost',
'bagging',
'crnn', 'crnn-attention',
] | 27.982143 | 98 | 0.658583 | from .logit import Logit
from .logit_embedding import LogitWithEmbedding
from .crnn import CRNN
from .crnn_attention import AttentionCRNN
from .naive_bayes import naiveBayes
from .rocchio import Rocchio
from .knn import KNN
from .svc import SVC_
from .linear_svc import LinearSVC_
from .random_forest import randomForest... | 0 | 0 | 0 | 0 | 0 | 883 | 0 | 138 | 331 |
da31d5226f1019805ae1fc36a877d97bfa45cc3b | 5,467 | py | Python | decoder.py | bencarletonn/Compression- | 348695168a413a17aea5d0bda4bc8f91cb4f2b4e | [
"MIT"
] | null | null | null | decoder.py | bencarletonn/Compression- | 348695168a413a17aea5d0bda4bc8f91cb4f2b4e | [
"MIT"
] | null | null | null | decoder.py | bencarletonn/Compression- | 348695168a413a17aea5d0bda4bc8f91cb4f2b4e | [
"MIT"
] | null | null | null | import sys
inputFile = sys.argv[1]
# Read file and turn into string
with open(inputFile, 'rb') as file:
data = file.read()
# break bit stream down to consituent parts
encoded = (bin(int.from_bytes(data, byteorder="big")))[2:] # remove 0b
garbage = encoded[:8]
if garbage == "100000... | 26.410628 | 104 | 0.640937 | import sys
def bitsToBytes(bit_array): # Assume len(bit_array) % 8 == 0
byte_array = bytearray()
for i in range(0, len(bit_array), 8):
byte = bit_array[i:i+8]
byte_array.append(int(byte, 2))
return byte_array
class Node():
def __init__(self, left=None, right=None):
self.left = ... | 0 | 0 | 0 | 2,776 | 0 | 489 | 0 | 0 | 101 |
4495480541ea1c7274abf83dbd975ed852acb063 | 776 | py | Python | heritage/overlay-layers.py | stewardshiptools/stewardshiptools | ee5d27e7b0d5d4947f34ad02bdf63a06ad0a5c3e | [
"MIT"
] | null | null | null | heritage/overlay-layers.py | stewardshiptools/stewardshiptools | ee5d27e7b0d5d4947f34ad02bdf63a06ad0a5c3e | [
"MIT"
] | 11 | 2020-03-24T15:29:46.000Z | 2022-03-11T23:14:48.000Z | heritage/overlay-layers.py | stewardshiptools/stewardshiptools | ee5d27e7b0d5d4947f34ad02bdf63a06ad0a5c3e | [
"MIT"
] | null | null | null | from maps.utils.layers import register_overlay_layer
register_overlay_layer('Species observations', SpeciesObservations)
register_overlay_layer('Species observations by interview', SpeciesObservationsFilteredByInterview)
| 36.952381 | 99 | 0.795103 | from maps.plugins import OverlayLayer
from maps.utils.layers import register_overlay_layer
from rest_framework.reverse import reverse
class SpeciesObservations(OverlayLayer):
name = 'All species observations.'
ajax_url = reverse('heritage:api:species-observation-list')
ajax_filters = None
register_overla... | 0 | 0 | 0 | 425 | 0 | 0 | 0 | 37 | 91 |
334e1b69a24fba5ce765ca949cbe946b4e65eafb | 92 | py | Python | 020_factorial_digit_sum/solve.py | kopwei/euler | 8b1bdc3f8162819d44f3f40121a5ad8e14a3f5ba | [
"Unlicense"
] | null | null | null | 020_factorial_digit_sum/solve.py | kopwei/euler | 8b1bdc3f8162819d44f3f40121a5ad8e14a3f5ba | [
"Unlicense"
] | null | null | null | 020_factorial_digit_sum/solve.py | kopwei/euler | 8b1bdc3f8162819d44f3f40121a5ad8e14a3f5ba | [
"Unlicense"
] | null | null | null | import math
res = str(math.factorial(100))
digits = [int(c) for c in res]
print(sum(digits)) | 23 | 30 | 0.706522 | import math
res = str(math.factorial(100))
digits = [int(c) for c in res]
print(sum(digits)) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
692ee74845159dd4e66a642119e01997949c3cf0 | 4,757 | py | Python | wagtail_resume/migrations/0008_auto_20220211_1557.py | danihodovic/wagtail-resume | a4283bd37f2ea8137f4d9ab84f066397112287de | [
"MIT"
] | null | null | null | wagtail_resume/migrations/0008_auto_20220211_1557.py | danihodovic/wagtail-resume | a4283bd37f2ea8137f4d9ab84f066397112287de | [
"MIT"
] | 1 | 2019-12-10T09:30:26.000Z | 2019-12-10T09:30:26.000Z | wagtail_resume/migrations/0008_auto_20220211_1557.py | danihodovic/wagtail-resume | a4283bd37f2ea8137f4d9ab84f066397112287de | [
"MIT"
] | null | null | null | # Generated by Django 3.2.12 on 2022-02-11 15:57
import wagtail.core.blocks
| 176.185185 | 3,757 | 0.734707 | # Generated by Django 3.2.12 on 2022-02-11 15:57
from django.db import migrations, models
import wagtail.core.blocks
import wagtail.core.fields
import wagtailmarkdown.blocks
class Migration(migrations.Migration):
dependencies = [
('wagtail_resume', '0007_baseresumepage_pdf_generation_visibility'),
]... | 0 | 0 | 0 | 4,558 | 0 | 0 | 0 | 32 | 90 |
07af777b9f6f45964f599f6c051bc92bd8ac361c | 2,748 | py | Python | src/1-Phenotype-web/ext/wgetdl/backend/make_csv_reports.py | glasgowm148/osgenome_rccx | 08f82ddf85253f3911ca5f7ccfdc5ef6cd2b3220 | [
"MIT",
"Unlicense"
] | 8 | 2019-09-17T10:22:40.000Z | 2022-03-30T22:22:19.000Z | src/1-Phenotype-web/ext/wgetdl/backend/make_csv_reports.py | glasgowm148/osgenome_rccx | 08f82ddf85253f3911ca5f7ccfdc5ef6cd2b3220 | [
"MIT",
"Unlicense"
] | 4 | 2021-02-02T10:36:55.000Z | 2021-11-30T13:17:52.000Z | src/1-Phenotype-web/ext/wgetdl/backend/make_csv_reports.py | glasgowm148/osgenome_rccx | 08f82ddf85253f3911ca5f7ccfdc5ef6cd2b3220 | [
"MIT",
"Unlicense"
] | 2 | 2019-09-11T00:10:26.000Z | 2021-01-21T22:38:01.000Z | from collections import OrderedDict
import os
JSON_REPORTS_DIR = 'genomes_final'
CSV_REPORTS_DIR = 'csv_genome_reports'
# CSV_MAP: an OrderedDict defining CSV header and corresponding JSON data.
# The values in this OrderedDict are functions that generate the needed value,
# given a Variant dict from the JSON-formatt... | 41.636364 | 78 | 0.626638 | from collections import OrderedDict
import csv
import json
import os
JSON_REPORTS_DIR = 'genomes_final'
CSV_REPORTS_DIR = 'csv_genome_reports'
# CSV_MAP: an OrderedDict defining CSV header and corresponding JSON data.
# The values in this OrderedDict are functions that generate the needed value,
# given a Variant dic... | 0 | 0 | 0 | 0 | 0 | 806 | 0 | -21 | 67 |
459f489516bb7118fe1f7af1a23c4fa4c32e22bb | 315 | py | Python | sorting_visualizer/variables.py | debdutgoswami/sorting-visualizer | e39e805acf22339b8ee06f8c8cd483e9c03ba3a4 | [
"MIT"
] | 3 | 2020-01-07T15:47:32.000Z | 2020-09-13T14:05:32.000Z | sorting_visualizer/variables.py | debdutgoswami/sorting-visualizer | e39e805acf22339b8ee06f8c8cd483e9c03ba3a4 | [
"MIT"
] | 3 | 2020-10-04T18:03:36.000Z | 2020-10-08T07:13:40.000Z | sorting_visualizer/variables.py | debdutgoswami/sorting-visualizer | e39e805acf22339b8ee06f8c8cd483e9c03ba3a4 | [
"MIT"
] | 3 | 2020-10-04T18:15:54.000Z | 2021-01-20T19:43:49.000Z | sortname = {
'bubblesort': f'Bubble Sort O(n\N{SUPERSCRIPT TWO})', 'insertionsort': f'Insertion Sort O(n\N{SUPERSCRIPT TWO})',
'selectionsort': f'Selection Sort O(n\N{SUPERSCRIPT TWO})', 'mergesort': 'Merge Sort O(n log n)',
'quicksort': 'Quick Sort O(n log n)', 'heapsort': 'Heap Sort O(n log n)'
} | 63 | 118 | 0.647619 | sortname = {
'bubblesort': f'Bubble Sort O(n\N{SUPERSCRIPT TWO})', 'insertionsort': f'Insertion Sort O(n\N{SUPERSCRIPT TWO})',
'selectionsort': f'Selection Sort O(n\N{SUPERSCRIPT TWO})', 'mergesort': 'Merge Sort O(n log n)',
'quicksort': 'Quick Sort O(n log n)', 'heapsort': 'Heap Sort O(n log n)'
} | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cc597a2a48b31e905ef81fd83370cf809a8085de | 224 | py | Python | dotted/__init__.py | freywaid/dotted | 7781eec26a0169dc8b3e098cc2c79fbd38eb5f97 | [
"MIT"
] | 2 | 2020-05-05T18:15:22.000Z | 2021-03-24T09:03:24.000Z | dotted/__init__.py | freywaid/dotted | 7781eec26a0169dc8b3e098cc2c79fbd38eb5f97 | [
"MIT"
] | null | null | null | dotted/__init__.py | freywaid/dotted | 7781eec26a0169dc8b3e098cc2c79fbd38eb5f97 | [
"MIT"
] | null | null | null | """
"""
| 32 | 79 | 0.691964 | """
"""
from .api import \
parse, is_pattern, build, expand, match, get, has, update, remove, apply, \
register, transform, assemble, ANY, is_inverted, get_multi, update_multi, \
remove_multi, match_multi, quote
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 194 | 22 |
9fe751b1125f9336770bd58baf9e18d3c434dfd9 | 285 | py | Python | authors/apps/articles/migrations/0025_merge_20190130_0506.py | andela/Ah-backend-guardians | cc84c18f7c222bc69cf4a263a1c2296b6d335c8b | [
"BSD-3-Clause"
] | null | null | null | authors/apps/articles/migrations/0025_merge_20190130_0506.py | andela/Ah-backend-guardians | cc84c18f7c222bc69cf4a263a1c2296b6d335c8b | [
"BSD-3-Clause"
] | 32 | 2019-01-09T07:52:32.000Z | 2022-01-13T01:01:55.000Z | authors/apps/articles/migrations/0025_merge_20190130_0506.py | andela/Ah-backend-guardians | cc84c18f7c222bc69cf4a263a1c2296b6d335c8b | [
"BSD-3-Clause"
] | 3 | 2019-01-03T12:05:53.000Z | 2019-09-24T11:41:14.000Z | # Generated by Django 2.1.5 on 2019-01-30 05:06
| 19 | 58 | 0.663158 | # Generated by Django 2.1.5 on 2019-01-30 05:06
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('articles', '0020_articledislikes_articlelikes'),
('articles', '0024_auto_20190130_0421'),
]
operations = [
]
| 0 | 0 | 0 | 179 | 0 | 0 | 0 | 11 | 46 |
84867b5607e5c4ff59b2fdf4653955465433cb0c | 1,279 | py | Python | geolocations_service/service/brumadinho/serializers.py | JBezerra/brumadinho_location | 360969bce9a153fbd1deeec55763bca65f37b6cc | [
"MIT"
] | 666 | 2019-01-28T00:32:43.000Z | 2019-01-30T22:16:41.000Z | geolocations_service/service/brumadinho/serializers.py | CoronaTrack/brumadinho_location | b9a94fd9295ba5759b93ba7def584c1f39b7dde0 | [
"MIT"
] | 68 | 2019-01-28T13:17:26.000Z | 2019-01-30T22:04:30.000Z | geolocations_service/service/brumadinho/serializers.py | sosbrumadinhodevs/brumadinho_location | b9a94fd9295ba5759b93ba7def584c1f39b7dde0 | [
"MIT"
] | 142 | 2019-01-27T21:19:45.000Z | 2019-01-30T22:09:58.000Z | # from django.contrib.auth.models import Group
| 26.645833 | 71 | 0.680219 | # from django.contrib.auth.models import Group
from brumadinho.models import Geolocation, VisitedLocation, FoundPeople
from rest_framework import serializers
class GeolocationSerializer(serializers.ModelSerializer):
class Meta:
model = Geolocation
fields = "__all__"
class VisitedLocationSerializ... | 0 | 0 | 0 | 1,050 | 0 | 0 | 0 | 67 | 113 |
f4c99f62a8f4b876bf3899982fc90bc0e5b922f0 | 916 | py | Python | hackerrank-python/any-or-all.py | fmelihh/competitive-programming-solutions | c15c2f7d90153f35f9bd9ffcea20ac921564eacf | [
"MIT"
] | 2 | 2021-09-06T22:13:12.000Z | 2021-11-22T08:50:04.000Z | hackerrank-python/any-or-all.py | fmelihh/competitive-programming-solutions | c15c2f7d90153f35f9bd9ffcea20ac921564eacf | [
"MIT"
] | null | null | null | hackerrank-python/any-or-all.py | fmelihh/competitive-programming-solutions | c15c2f7d90153f35f9bd9ffcea20ac921564eacf | [
"MIT"
] | null | null | null |
# https://www.hackerrank.com/challenges/any-or-all/problem
if __name__ == '__main__':
N = int(input())
usr_list = input().split()
positive_condition = list(map(lambda x: x[0] != "-", usr_list))
palindromic_condition = list(map(lambda x: "".join(reversed(x)) == x, usr_list))
lenght = ... | 7.447154 | 84 | 0.433406 |
# https://www.hackerrank.com/challenges/any-or-all/problem
if __name__ == '__main__':
N = int(input())
usr_list = input().split()
positive_condition = list(map(lambda x: x[0] != "-", usr_list))
palindromic_condition = list(map(lambda x: "".join(reversed(x)) == x, usr_list))
lenght = ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cb79e580057d1143f2e0270be6e2e9fefd2f99a8 | 3,240 | py | Python | components/esp_eth/test_apps/pytest_esp_eth.py | HubertXie/esp-idf | a7032feeaa2f5a600b8e0b37f80fd52538d22145 | [
"Apache-2.0"
] | 1 | 2022-02-04T19:26:55.000Z | 2022-02-04T19:26:55.000Z | components/esp_eth/test_apps/pytest_esp_eth.py | HubertXie/esp-idf | a7032feeaa2f5a600b8e0b37f80fd52538d22145 | [
"Apache-2.0"
] | null | null | null | components/esp_eth/test_apps/pytest_esp_eth.py | HubertXie/esp-idf | a7032feeaa2f5a600b8e0b37f80fd52538d22145 | [
"Apache-2.0"
] | 1 | 2022-02-09T12:41:20.000Z | 2022-02-09T12:41:20.000Z | # SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
| 30.566038 | 161 | 0.640123 | # SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import contextlib
import logging
import os
import socket
from typing import Iterator
import pytest
from pytest_embedded import Dut
@contextlib.contextmanager
def configure_eth_if() -> Iterator[socket.socket]:
#... | 0 | 1,054 | 0 | 0 | 0 | 1,831 | 0 | -23 | 271 |
808b74601a3834fa80016a6b2658146271635871 | 219 | py | Python | scenes/menu_main.py | EemeliSyynimaa/picross | 691d4a8a81656d48239d7fa1fa6b9566728a4a9f | [
"MIT"
] | null | null | null | scenes/menu_main.py | EemeliSyynimaa/picross | 691d4a8a81656d48239d7fa1fa6b9566728a4a9f | [
"MIT"
] | null | null | null | scenes/menu_main.py | EemeliSyynimaa/picross | 691d4a8a81656d48239d7fa1fa6b9566728a4a9f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 21.9 | 55 | 0.593607 | # -*- coding: utf-8 -*-
from engine import scene
class MenuMain(scene.Scene):
""" The main menu scene. """
def __init__(self, *args, **kwargs):
super(MenuMain, self).__init__(*args, **kwargs)
| 0 | 0 | 0 | 138 | 0 | 0 | 0 | 3 | 46 |
88cb78cc36efd6e0ac79368f4de0301a371530e0 | 5,331 | py | Python | image-processing/obsolete/photo_analysis.py | twf2360/Industrial-Group-Project | a2a879d82a3ce7e714bbd30a34cd14e88cb22293 | [
"MIT"
] | 1 | 2020-12-17T22:50:49.000Z | 2020-12-17T22:50:49.000Z | image-processing/obsolete/photo_analysis.py | mjrevell/Industrial-Group-Project | 422367508093dfbb904c8a9aaa63a1ac12d1c82c | [
"MIT"
] | 5 | 2020-12-17T17:25:40.000Z | 2021-02-04T15:54:19.000Z | image-processing/obsolete/photo_analysis.py | twf2360/Industrial-Group-Project | a2a879d82a3ce7e714bbd30a34cd14e88cb22293 | [
"MIT"
] | 4 | 2020-11-19T09:28:33.000Z | 2021-02-04T16:15:33.000Z | from skimage import transform, exposure
import numpy as np
from scipy import fftpack
from scipy.signal import argrelextrema
'''
This method would be a collection of the other code, but to compare the photos instead of the scans
As well as trying to see if any lines are detected, this will also compare how the b... | 32.907407 | 124 | 0.681486 | import math
import skimage
from skimage import io, transform, viewer, color, data, filters, feature, morphology, exposure
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
from scipy import fftpack
from matplotlib.colors import LogNorm
from scipy import ndimage
from scipy.signal impo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 71 | 139 |
eaab12394212aecb195e1d8b0f4c982dad08d1de | 5,287 | py | Python | models/model_factory.py | haohlin/pointgmm-primitive-detection | 08ff42271a1d5b85d6b25de0f54be4e50fddff3e | [
"MIT"
] | 38 | 2020-04-13T13:11:14.000Z | 2022-03-24T17:28:21.000Z | models/model_factory.py | haohlin/pointgmm-primitive-detection | 08ff42271a1d5b85d6b25de0f54be4e50fddff3e | [
"MIT"
] | 1 | 2020-07-05T17:02:18.000Z | 2020-07-05T17:02:18.000Z | models/model_factory.py | haohlin/pointgmm-primitive-detection | 08ff42271a1d5b85d6b25de0f54be4e50fddff3e | [
"MIT"
] | 8 | 2020-07-14T15:08:34.000Z | 2022-01-04T05:29:43.000Z |
DEBUG = False
| 34.331169 | 116 | 0.623605 | import torch
from process_data.files_utils import init_folders
import shutil
from models.encoders.pointnet import PointNet, PointNetDual
from models.model_gm import PointGMM
from custom_types import *
from tqdm import tqdm
import os
import pickle
import options
DEBUG = False
def is_model_clean(model) -> bool:
f... | 0 | 777 | 0 | 1,848 | 0 | 2,288 | 0 | 42 | 312 |
e2875681b7503e5b2fe51a821d876693f5e58392 | 2,111 | py | Python | shedule_01iter.py | Gandifil/EvolutionTask | 28b6b45148ed8b820cbaa7a2cf1711f152edb97d | [
"Apache-2.0"
] | null | null | null | shedule_01iter.py | Gandifil/EvolutionTask | 28b6b45148ed8b820cbaa7a2cf1711f152edb97d | [
"Apache-2.0"
] | null | null | null | shedule_01iter.py | Gandifil/EvolutionTask | 28b6b45148ed8b820cbaa7a2cf1711f152edb97d | [
"Apache-2.0"
] | null | null | null |
import sheduling
cellsCount = 6 * 2 * len(sheduling.times)
maxFitness = -1000000000
theBestShedule = None
i = 0
# . , ( )
cells = list(filter(isBestCell, range(cellsCount)))
rcells = list(filter(isBestCell, range(cellsCount - 1, -1, -1)))
print(cells)
print(rcells)
shedule = shed... | 28.917808 | 94 | 0.629086 | import signal
import sys
from math import factorial
import sheduling
from itertools import *
cellsCount = 6 * 2 * len(sheduling.times)
def convert(lessonsPrint, indexes):
assert len(lessonsPrint) == len(indexes)
lessons = [None for _ in range(cellsCount)]
for i in range(len(lessonsPrint)):
... | 122 | 0 | 0 | 0 | 0 | 596 | 0 | -12 | 192 |
8be405719a8a9292f3a3d57b74c14e0205dc024e | 460 | py | Python | tests/test_core.py | pnowk/poket | b0927b73d7a65c771a2f5c49cb59a306c813de36 | [
"MIT"
] | null | null | null | tests/test_core.py | pnowk/poket | b0927b73d7a65c771a2f5c49cb59a306c813de36 | [
"MIT"
] | null | null | null | tests/test_core.py | pnowk/poket | b0927b73d7a65c771a2f5c49cb59a306c813de36 | [
"MIT"
] | null | null | null |
from os.path import join
| 27.058824 | 68 | 0.726087 |
from os.path import join
from poket.core import create_profile, Configmap
from poket.conf import settings
from os.path import join
def test_profile_created(mocker):
profile = create_profile('test')
assert profile.name == 'test'
assert profile.path == join(settings.get_profiles_dir(), 'test')
def test_c... | 0 | 0 | 0 | 0 | 0 | 281 | 0 | 40 | 112 |
10f714b5fbe04253e969f75514440ed4e1505728 | 823 | py | Python | sipack/word_int.py | malhotravasu/sipack | 2207a39b750d9af5c5b09088ca3ca8f487602c85 | [
"MIT"
] | null | null | null | sipack/word_int.py | malhotravasu/sipack | 2207a39b750d9af5c5b09088ca3ca8f487602c85 | [
"MIT"
] | null | null | null | sipack/word_int.py | malhotravasu/sipack | 2207a39b750d9af5c5b09088ca3ca8f487602c85 | [
"MIT"
] | null | null | null | """Let's learn Python"""
| 29.392857 | 72 | 0.552855 | """Let's learn Python"""
import string
class StrManipulator(object):
"""First Class"""
def process_string(self, unsan_str):
"""Process string into useful list"""
table = str.maketrans({key: None for key in string.punctuation})
return unsan_str.translate(table).lower().split()
def ... | 0 | 0 | 0 | 761 | 0 | 0 | 0 | -8 | 45 |
cdc9b97235b50da549ea7490dc38d30cd1a652e5 | 539 | py | Python | LED.py | bor8/blinken-leds | 218aba28eb4a07f10b18b6f4a67225855646d2e6 | [
"MIT"
] | null | null | null | LED.py | bor8/blinken-leds | 218aba28eb4a07f10b18b6f4a67225855646d2e6 | [
"MIT"
] | null | null | null | LED.py | bor8/blinken-leds | 218aba28eb4a07f10b18b6f4a67225855646d2e6 | [
"MIT"
] | null | null | null | import argparse
import RPi.GPIO as GPIO
parser = argparse.ArgumentParser()
parser.add_argument('k', type=int, help='GPIO number')
args = parser.parse_args()
main(args.k)
| 23.434783 | 54 | 0.638219 | import argparse
import random
import RPi.GPIO as GPIO
import time
def main(k):
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(k, GPIO.OUT)
try:
while True:
GPIO.output(k, GPIO.HIGH)
time.sleep(random.random()*0.4)
GPIO.output(k, GPIO.LOW)
... | 0 | 0 | 0 | 0 | 0 | 319 | 0 | -18 | 67 |
af884e36b2dec88cd60b0d6f54da154fa61ccaeb | 319 | py | Python | src/countries_code.py | abeakkas/ipho-unofficial.org | 803ab3cc20670304f7be899ecc48b753765c2ddc | [
"MIT"
] | 5 | 2020-04-10T19:32:43.000Z | 2021-05-08T23:39:21.000Z | src/countries_code.py | abeakkas/ipho-unofficial.org | 803ab3cc20670304f7be899ecc48b753765c2ddc | [
"MIT"
] | 5 | 2016-09-01T04:38:53.000Z | 2019-01-31T15:51:39.000Z | src/countries_code.py | abeakkas/ipho-unofficial.org | 803ab3cc20670304f7be899ecc48b753765c2ddc | [
"MIT"
] | 7 | 2016-08-10T10:30:59.000Z | 2020-02-21T14:12:35.000Z | import sys
if __name__ == "__main__":
run(sys.argv[1])
| 22.785714 | 42 | 0.705329 | import sys
import util
import countries_code_index
import countries_code_individual
def run(code):
print("Creating countries/" + code)
util.makedirs("../countries/" + code)
countries_code_index.run(code)
countries_code_individual.run(code)
if __name__ == "__main__":
run(sys.argv[1])
| 0 | 0 | 0 | 0 | 0 | 154 | 0 | 7 | 94 |
1074b08bdc6a437a739be0f5e3f9fae3d408634b | 2,591 | py | Python | tests/test_refocus.py | RI-imaging/qpimage | e572f0ece5b0a33b031e44ce390c2d40a1975851 | [
"MIT"
] | 1 | 2022-02-13T15:14:21.000Z | 2022-02-13T15:14:21.000Z | tests/test_refocus.py | RI-imaging/qpimage | e572f0ece5b0a33b031e44ce390c2d40a1975851 | [
"MIT"
] | 13 | 2017-10-10T11:23:56.000Z | 2021-12-06T00:02:46.000Z | tests/test_refocus.py | RI-imaging/qpimage | e572f0ece5b0a33b031e44ce390c2d40a1975851 | [
"MIT"
] | 2 | 2018-04-05T04:21:34.000Z | 2020-07-21T11:57:04.000Z |
if __name__ == "__main__":
# Run all tests
_loc = locals()
for _key in list(_loc.keys()):
if _key.startswith("test_") and hasattr(_loc[_key], "__call__"):
_loc[_key]()
| 30.845238 | 72 | 0.551139 | import numpy as np
import nrefocus
from scipy.ndimage import gaussian_filter
import pytest
import qpimage
def test_refocus():
nrkw = {"res": 2,
"nm": 1,
"method": "helmholtz",
"padding": True,
"d": 5.5}
meta = {"wavelength": 1e-6,
"pixel size": 1e-... | 0 | 0 | 0 | 0 | 0 | 2,233 | 0 | -4 | 158 |
8caf0ebbcd5e1684dd13449e003b5532488ee2a3 | 1,374 | py | Python | edopt/main.py | maxschommer/edopt | 1fc4e6da8dca53565033d737484f6f609bd72bee | [
"MIT"
] | null | null | null | edopt/main.py | maxschommer/edopt | 1fc4e6da8dca53565033d737484f6f609bd72bee | [
"MIT"
] | null | null | null | edopt/main.py | maxschommer/edopt | 1fc4e6da8dca53565033d737484f6f609bd72bee | [
"MIT"
] | null | null | null | import networkx as nx
n = Node()
G = nx.Graph()
G.add_node(n)
print(G.nodes)
# G.add_nodes_from([2, 3])
# G.add_edge(1, 2)
# G.add_edge(1, 3)
# G.add_edge(2, 3)
# nx.draw(G, with_labels=True, node_size=1500, node_color="skyblue",
# node_shape="s", alpha=0.5, linewidths=40)
# plt.show()
| 19.083333 | 75 | 0.63246 | import networkx as nx
import matplotlib.pyplot as plt
class Node():
"""This is the base class for a nx node
It has basic electrical properties like
Voltage (All nodes have voltage)
Charge (Pins can collect charge, like capacitors)
Nodes compute functions as well, which based on the
e... | 0 | 0 | 0 | 876 | 0 | 0 | 0 | 10 | 183 |
df5b09d31ab3997244eb04d0dd3f98b98064b154 | 4,354 | py | Python | api.py | mpcarolin/pokedex-flex-api | 2ed38792aa53848d4445d66630663b4d32b30815 | [
"Apache-2.0"
] | 1 | 2020-01-14T02:14:05.000Z | 2020-01-14T02:14:05.000Z | api.py | mpcarolin/pokedex-flex-api | 2ed38792aa53848d4445d66630663b4d32b30815 | [
"Apache-2.0"
] | 2 | 2018-06-02T18:40:59.000Z | 2020-03-10T00:03:50.000Z | api.py | mpcarolin/pokedex-flex-api | 2ed38792aa53848d4445d66630663b4d32b30815 | [
"Apache-2.0"
] | null | null | null | from flask import request
from functools import partial
from constants import APIS
from constants import CACHE_NAME, CACHE_DB, SYNC_INTERVAL
import requests_cache as cache
import pdb
import re
dbreak = pdb.set_trace
# initialize the request caching
cache.install_cache(
cache_name = CACHE_NAME,
backend = CACHE... | 32.492537 | 102 | 0.655949 | from flask_api import FlaskAPI
from flask import request
from functools import partial, reduce
from mapping import ResponseMapper
from constants import PROJECT_NAME, APIS
from constants import CACHE_NAME, CACHE_DB, SYNC_INTERVAL
import requests_cache as cache
import requests
import json
import pdb
import os
import re
... | 0 | 206 | 0 | 868 | 0 | 564 | 0 | 16 | 182 |
fd24d904edcb763175640b8d015d59d7b39fe509 | 460 | py | Python | Sprint2/test_output_sprint2.py | Eziowrf/projectGedcom | c5f321723013d9bcc68c618ae54e03b5f0c9efe1 | [
"MIT"
] | null | null | null | Sprint2/test_output_sprint2.py | Eziowrf/projectGedcom | c5f321723013d9bcc68c618ae54e03b5f0c9efe1 | [
"MIT"
] | 7 | 2018-09-25T19:50:09.000Z | 2018-09-26T23:40:46.000Z | Sprint2/test_output_sprint2.py | Eziowrf/projectGedcom | c5f321723013d9bcc68c618ae54e03b5f0c9efe1 | [
"MIT"
] | null | null | null | import userStory03
import userStory04
(listOfPeople,listOfFamilies)= project3.gedComParse('error.ged')
project3.present(listOfPeople,listOfFamilies)
# (listOfPeople1,listOfFamilies1)= project3.gedComParse('correct.ged')
# project3.present(listOfPeople1,listOfFamilies1)
userStory03.userStory03(listOfPeople)
... | 32.857143 | 71 | 0.830435 | import userStory03
import userStory04
(listOfPeople,listOfFamilies)= project3.gedComParse('error.ged')
project3.present(listOfPeople,listOfFamilies)
# (listOfPeople1,listOfFamilies1)= project3.gedComParse('correct.ged')
# project3.present(listOfPeople1,listOfFamilies1)
userStory03.userStory03(listOfPeople)
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
07e3ee28b7403a19b7ae926bbc045b8a2e7f37a0 | 4,238 | py | Python | AdityaGilraMOOSEnC/pythonScripts/RunTests.py | OpenSourceBrain/PyloricNetwork | 858bfcb2a030edbbf53fd4d1765cdee7454e2f3b | [
"MIT"
] | 1 | 2018-06-22T22:21:06.000Z | 2018-06-22T22:21:06.000Z | AdityaGilraMOOSEnC/pythonScripts/RunTests.py | OpenSourceBrain/PyloricNetwork | 858bfcb2a030edbbf53fd4d1765cdee7454e2f3b | [
"MIT"
] | 1 | 2018-12-05T14:54:41.000Z | 2018-12-06T16:50:00.000Z | AdityaGilraMOOSEnC/pythonScripts/RunTests.py | OpenSourceBrain/PyloricNetwork | 858bfcb2a030edbbf53fd4d1765cdee7454e2f3b | [
"MIT"
] | 1 | 2020-08-11T12:30:36.000Z | 2020-08-11T12:30:36.000Z | #
#
# File to test current configuration of Pyloric project.
#
# To execute this type of file, type 'nC.bat -python XXX.py' (Windows)
# or 'nC.sh -python XXX.py' (Linux/Mac). Note: you may have to update the
# NC_HOME and NC_MAX_MEMORY variables in nC.bat/nC.sh
#
# Author: Padraig Gleeson
#
# This... | 43.244898 | 714 | 0.586833 | #
#
# File to test current configuration of Pyloric project.
#
# To execute this type of file, type 'nC.bat -python XXX.py' (Windows)
# or 'nC.sh -python XXX.py' (Linux/Mac). Note: you may have to update the
# NC_HOME and NC_MAX_MEMORY variables in nC.bat/nC.sh
#
# Author: Padraig Gleeson
#
# This... | 0 | 0 | 0 | 0 | 0 | 2,804 | 0 | 0 | 25 |
60cec8b185ad7319db3515afd43cb50f5926a7ce | 8,302 | py | Python | bot/extensions/mod.py | cosmic-team/bellatrix | 59f2fce4f40bf953065fa357d18a9065d26653a3 | [
"MIT"
] | 3 | 2021-01-05T23:16:21.000Z | 2021-01-24T00:47:18.000Z | bot/extensions/mod.py | webkaiyo/sirius | 59f2fce4f40bf953065fa357d18a9065d26653a3 | [
"MIT"
] | 1 | 2021-01-06T22:59:29.000Z | 2021-01-06T22:59:29.000Z | bot/extensions/mod.py | webkaiyo/sirius | 59f2fce4f40bf953065fa357d18a9065d26653a3 | [
"MIT"
] | 1 | 2021-04-20T03:49:55.000Z | 2021-04-20T03:49:55.000Z | '''
MIT License
Copyright (c) 2021 Caio Alexandre
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, publish... | 35.32766 | 119 | 0.648037 | '''
MIT License
Copyright (c) 2021 Caio Alexandre
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, publish... | 78 | 4,527 | 558 | 1,453 | 0 | 26 | 0 | 54 | 315 |
2eb28186769049a7366b6c7f4cbe0bf29e3272b8 | 5,619 | py | Python | Browser/assertion_engine.py | Snooz82/robotframework-browser | 89488d4940df5288cf35a5bc9bceec9f34a49707 | [
"Apache-2.0"
] | null | null | null | Browser/assertion_engine.py | Snooz82/robotframework-browser | 89488d4940df5288cf35a5bc9bceec9f34a49707 | [
"Apache-2.0"
] | null | null | null | Browser/assertion_engine.py | Snooz82/robotframework-browser | 89488d4940df5288cf35a5bc9bceec9f34a49707 | [
"Apache-2.0"
] | null | null | null | import re
from typing import Callable, Dict, Tuple, TypeVar
from robot.libraries.BuiltIn import BuiltIn # type: ignore
from .utils import AssertionOperator
NumericalOperators = [
AssertionOperator["=="],
AssertionOperator["!="],
AssertionOperator[">="],
AssertionOperator[">"],
AssertionOperator["... | 32.293103 | 88 | 0.639082 | import re
import time
from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar, cast
import wrapt # type: ignore
from robot.libraries.BuiltIn import BuiltIn # type: ignore
from robot.utils import timestr_to_secs # type: ignore
from .utils import AssertionOperator, is_truthy, logger
NumericalOperator... | 0 | 525 | 0 | 0 | 0 | 3,174 | 0 | 45 | 283 |
e49849bf9679c2ac4f01c6719c17106df42e032e | 7,468 | py | Python | mindmeld/models/model_factory.py | Zozman/mindmeld | d86cc823c9b36dbafc8fc8f8ea04085ca1ffdeb5 | [
"Apache-2.0"
] | 1 | 2022-02-09T13:39:41.000Z | 2022-02-09T13:39:41.000Z | mindmeld/models/model_factory.py | Zozman/mindmeld | d86cc823c9b36dbafc8fc8f8ea04085ca1ffdeb5 | [
"Apache-2.0"
] | null | null | null | mindmeld/models/model_factory.py | Zozman/mindmeld | d86cc823c9b36dbafc8fc8f8ea04085ca1ffdeb5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Cisco Systems, Inc. and others. 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... | 38.694301 | 100 | 0.664971 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Cisco Systems, Inc. and others. 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... | 0 | 5,489 | 0 | 869 | 0 | 0 | 0 | 124 | 134 |
fc8ac923e24c2887578743f8bf48d6672c29d320 | 12,809 | py | Python | python/2021/day17.py | SylvainDe/aoc | b8a4609327831685ef94c9960350ff7bb5ace1a5 | [
"MIT"
] | null | null | null | python/2021/day17.py | SylvainDe/aoc | b8a4609327831685ef94c9960350ff7bb5ace1a5 | [
"MIT"
] | null | null | null | python/2021/day17.py | SylvainDe/aoc | b8a4609327831685ef94c9960350ff7bb5ace1a5 | [
"MIT"
] | null | null | null | # vi: set shiftwidth=4 tabstop=4 expandtab:
import datetime
target_area_re = r"^target area: x=([-0-9]+)..([-0-9]+), y=([-0-9]+)..([-0-9]+)$"
# Analysis of the x position
#############################
# step is [0, 1, 2, 3, ..., n
# x-velocity is [vx, vx-1, vx-2, vx-3, ..., vx - ... | 25.824597 | 84 | 0.416504 | # vi: set shiftwidth=4 tabstop=4 expandtab:
import datetime
import re
import math
target_area_re = r"^target area: x=([-0-9]+)..([-0-9]+), y=([-0-9]+)..([-0-9]+)$"
def get_target_area_from_string(s):
m = re.match(target_area_re, s)
return [int(v) for v in m.group(1, 2, 3, 4)]
def get_target_area_from_file(... | 8 | 0 | 0 | 0 | 2,844 | 7,449 | 0 | -22 | 479 |
60eedd43cfeb30178017ce5de73c721550bd0cf2 | 4,751 | py | Python | build_product_images.py | stackabletech/docker-images | acd69b7f634fcf05ee6580f8b1437cb4645982d9 | [
"Apache-2.0"
] | 1 | 2022-01-21T11:24:25.000Z | 2022-01-21T11:24:25.000Z | build_product_images.py | stackabletech/docker-images | acd69b7f634fcf05ee6580f8b1437cb4645982d9 | [
"Apache-2.0"
] | 34 | 2021-10-20T13:57:07.000Z | 2022-03-30T12:19:52.000Z | build_product_images.py | stackabletech/docker-images | acd69b7f634fcf05ee6580f8b1437cb4645982d9 | [
"Apache-2.0"
] | null | null | null | #!/bin/env python
"""
Build and possibly publish product images. It doesn't login to any registry when publishing
but it assumes a `docker login` has been performed before.
Usage: build_product_images.py --help
Example:
build_product_images.py --product zookeeper,kafka -image_version 0.1 --push
This whill build... | 34.427536 | 137 | 0.64176 | #!/bin/env python
"""
Build and possibly publish product images. It doesn't login to any registry when publishing
but it assumes a `docker login` has been performed before.
Usage: build_product_images.py --help
Example:
build_product_images.py --product zookeeper,kafka -image_version 0.1 --push
This whill build... | 0 | 0 | 0 | 0 | 0 | 1,111 | 0 | -16 | 114 |
6a037582fc8f8889431bc0e7b852993429b0b822 | 8,713 | py | Python | tests/test_utils.py | Jasha10/hydra-zen | c229ab37f9ab6be4d1c64cabb646df99d0308027 | [
"MIT"
] | null | null | null | tests/test_utils.py | Jasha10/hydra-zen | c229ab37f9ab6be4d1c64cabb646df99d0308027 | [
"MIT"
] | null | null | null | tests/test_utils.py | Jasha10/hydra-zen | c229ab37f9ab6be4d1c64cabb646df99d0308027 | [
"MIT"
] | null | null | null | # Copyright (c) 2022 Massachusetts Institute of Technology
# SPDX-License-Identifier: MIT
import collections.abc as abc
import sys
from typing import TypeVar
T = TypeVar("T")
current_module: str = sys.modules[__name__].__name__
NoneType = type(None)
# II renders a string in omegaconf's interpola... | 28.106452 | 88 | 0.633192 | # Copyright (c) 2022 Massachusetts Institute of Technology
# SPDX-License-Identifier: MIT
import collections.abc as abc
import enum
import random
import string
import sys
from dataclasses import dataclass, field as dataclass_field
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, TypeVar, Union
... | 0 | 5,437 | 0 | 84 | 0 | 1,537 | 0 | 454 | 860 |
d1cdbc4a1fca884210a1fb02dffcc803c01019c6 | 334 | py | Python | pyautogui__keyboard__examples/hotkey.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 117 | 2015-12-18T07:18:27.000Z | 2022-03-28T00:25:54.000Z | pyautogui__keyboard__examples/hotkey.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 8 | 2018-10-03T09:38:46.000Z | 2021-12-13T19:51:09.000Z | pyautogui__keyboard__examples/hotkey.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 28 | 2016-08-02T17:43:47.000Z | 2022-03-21T08:31:12.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# pip install keyboard
import keyboard
keyboard.add_hotkey('shift', lambda: keyboard.write('on'))
keyboard.add_hotkey('shift', lambda: keyboard.write('off'), trigger_on_release=True)
# Block forever.
keyboard.wait()
# OR, wait Escape:
# keyboar... | 19.647059 | 84 | 0.712575 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# pip install keyboard
import keyboard
keyboard.add_hotkey('shift', lambda: keyboard.write('on'))
keyboard.add_hotkey('shift', lambda: keyboard.write('off'), trigger_on_release=True)
# Block forever.
keyboard.wait()
# OR, wait Escape:
# keyboar... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
10d7d12b77403075618869cc35bda5a7d9d578b9 | 1,455 | py | Python | scitbx/math/tests/tst_clustering.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | scitbx/math/tests/tst_clustering.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | scitbx/math/tests/tst_clustering.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | from __future__ import division
if __name__ == '__main__':
run()
| 28.529412 | 64 | 0.674914 | from __future__ import division
from scitbx.math import clustering
from scitbx.array_family import flex
def exercise_two_means_clustering():
data = flex.double((0.21947204867684716, 0.21947204867684716,
0.21947204867684716, 0.21947204867684714))
c = clustering.two_means(data)
assert c.cut =... | 0 | 0 | 0 | 0 | 0 | 1,246 | 0 | 28 | 113 |
95e053b693847088eeed92013a6b6f163fcdcf33 | 486 | py | Python | Python/swap_case.py | not4YU5H/hacktoberfest2021-2 | ae3d17f8bef81aa79231ee07db46a79841b4b06b | [
"CC0-1.0"
] | 81 | 2021-10-01T13:19:13.000Z | 2021-10-06T08:43:35.000Z | Python/swap_case.py | not4YU5H/hacktoberfest2021-2 | ae3d17f8bef81aa79231ee07db46a79841b4b06b | [
"CC0-1.0"
] | 67 | 2021-10-01T13:43:46.000Z | 2021-10-06T13:55:49.000Z | Python/swap_case.py | not4YU5H/hacktoberfest2021-2 | ae3d17f8bef81aa79231ee07db46a79841b4b06b | [
"CC0-1.0"
] | 394 | 2021-10-01T11:55:24.000Z | 2021-10-06T13:45:57.000Z | s=input("Enter a string:")
swap_case(s) #Calling the function
| 44.181818 | 96 | 0.666667 | def swap_case(s): #Defining a function called swap_case
res=''
for letter in s:
if(letter.islower()): #Returns true if the characters in the string are in lowercase
res=res+letter.upper() #Converting the lowercase characters to uppercase characters
else:
res... | 0 | 0 | 0 | 0 | 0 | 394 | 0 | 0 | 22 |
e78773d384028036541cb2d6b7311f197a6eebdf | 1,297 | py | Python | textblob/src/textblob_inference.py | arsalanc-v2/mailsense | 36e4c00c6fc26f0aa334a3f46b6d77f2306bf814 | [
"Unlicense"
] | 1 | 2019-08-13T06:40:18.000Z | 2019-08-13T06:40:18.000Z | textblob/src/textblob_inference.py | arsalanc-v2/mailsense | 36e4c00c6fc26f0aa334a3f46b6d77f2306bf814 | [
"Unlicense"
] | null | null | null | textblob/src/textblob_inference.py | arsalanc-v2/mailsense | 36e4c00c6fc26f0aa334a3f46b6d77f2306bf814 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
import argparse
from textblob.en.sentiments import NaiveBayesAnalyzer
import nltk
def initialize_model():
'''Initializes a textblob naive bayes sentiment analysis model.
'''
nltk.download('movie_reviews')
nltk.download('punkt')
# prevent exposing the learner
global analyzer
analyzer = N... | 25.94 | 133 | 0.752506 | #!/usr/bin/env python3
import argparse
from textblob import TextBlob
from textblob.en.sentiments import NaiveBayesAnalyzer
import nltk
def initialize_model():
'''Initializes a textblob naive bayes sentiment analysis model.
'''
nltk.download('movie_reviews')
nltk.download('punkt')
# prevent exposing the learner... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 23 |
97539967a2d495df3d91856351876bf6945b8a5c | 1,434 | py | Python | hooks/post_gen_project.py | imankulov/cookiecutter-pypackage | 324df28244f0a5b72c6c6ff509030821dae643f1 | [
"BSD-3-Clause"
] | null | null | null | hooks/post_gen_project.py | imankulov/cookiecutter-pypackage | 324df28244f0a5b72c6c6ff509030821dae643f1 | [
"BSD-3-Clause"
] | null | null | null | hooks/post_gen_project.py | imankulov/cookiecutter-pypackage | 324df28244f0a5b72c6c6ff509030821dae643f1 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import os
import subprocess
PROJECT_DIRECTORY = os.path.realpath(os.path.curdir)
def remove_file(filepath):
"""Remove a file if it exists."""
try:
os.remove(os.path.join(PROJECT_DIRECTORY, filepath))
except FileNotFoundError:
pass
def execute(*args, suppress_except... | 24.724138 | 69 | 0.640865 | #!/usr/bin/env python
import os
import subprocess
PROJECT_DIRECTORY = os.path.realpath(os.path.curdir)
def remove_file(filepath):
"""Remove a file if it exists."""
try:
os.remove(os.path.join(PROJECT_DIRECTORY, filepath))
except FileNotFoundError:
pass
def execute(*args, suppress_except... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2d7d3a10691e6366de51c95869974e931558d3a9 | 3,768 | py | Python | NeoML/Python/neoml/Dnn/Lrn.py | sergesk/neoml | cca05584ef3d892cb00d23a105bac6674b3d50ef | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | NeoML/Python/neoml/Dnn/Lrn.py | sergesk/neoml | cca05584ef3d892cb00d23a105bac6674b3d50ef | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | NeoML/Python/neoml/Dnn/Lrn.py | sergesk/neoml | cca05584ef3d892cb00d23a105bac6674b3d50ef | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | """ Copyright (c) 2017-2021 ABBYY Production LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... | 33.345133 | 163 | 0.617569 | """ Copyright (c) 2017-2021 ABBYY Production LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... | 0 | 797 | 0 | 2,146 | 0 | 0 | 0 | 22 | 67 |
9870a55ca362a207d07de3d5671c002a7657fc1e | 23,726 | py | Python | order-1_voronoi/voronoi.py | bzliu94/algorithms | 43ccefd7ea1fd88339bf2afa0b35b0a3bdf6acff | [
"MIT"
] | null | null | null | order-1_voronoi/voronoi.py | bzliu94/algorithms | 43ccefd7ea1fd88339bf2afa0b35b0a3bdf6acff | [
"MIT"
] | null | null | null | order-1_voronoi/voronoi.py | bzliu94/algorithms | 43ccefd7ea1fd88339bf2afa0b35b0a3bdf6acff | [
"MIT"
] | null | null | null | # 2015-05-22
# rgba_value is a four-tuple
import time
time1 = time.clock()
# for event queue, we are using a priority queue
# we may have site events and circle events with same priority
# from core.priority_queue.PriorityQueue import *
# planar straight-line graph
# vertices have distinct locat... | 32.412568 | 6,016 | 0.608784 | # 2015-05-22
def drawCircleEvent(draw, left_arc, arc, right_arc, l_y, color_triple):
location = CircleEvent.getIntersectionHelper(l_y, left_arc, arc, right_arc)
radius = CircleEvent.distanceFromBisectorIntersectionToContributingSite(l_y, left_arc, arc, right_arc)
# print "radius:", radius
(x, y) ... | 0 | 0 | 0 | 34 | 0 | 2,418 | 0 | 113 | 300 |
db1cf9381b20dc50f9497817357ba99f88e6c0ef | 365 | py | Python | Demo/branch/migrations/0003_auto_20181204_1533.py | 106626/Practical | b0a834a80558048defccf7a27da752b79c43d1fe | [
"Apache-2.0"
] | null | null | null | Demo/branch/migrations/0003_auto_20181204_1533.py | 106626/Practical | b0a834a80558048defccf7a27da752b79c43d1fe | [
"Apache-2.0"
] | null | null | null | Demo/branch/migrations/0003_auto_20181204_1533.py | 106626/Practical | b0a834a80558048defccf7a27da752b79c43d1fe | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.0.5 on 2018-12-04 07:33
| 19.210526 | 49 | 0.575342 | # Generated by Django 2.0.5 on 2018-12-04 07:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('branch', '0002_shop_m'),
]
operations = [
migrations.AlterField(
model_name='shop',
name='m',
field=mode... | 0 | 0 | 0 | 251 | 0 | 0 | 0 | 19 | 46 |
0167343c21281a26ff48df3fdfeaed47c5892e24 | 6,366 | py | Python | FinalProject/EVS_GUI/resources/text/python_template.py | CAP1Sup/SieskoPythonLabs | 3a0525b4feb88ad865db3f0bc30ce4e3290358f7 | [
"MIT"
] | null | null | null | FinalProject/EVS_GUI/resources/text/python_template.py | CAP1Sup/SieskoPythonLabs | 3a0525b4feb88ad865db3f0bc30ce4e3290358f7 | [
"MIT"
] | null | null | null | FinalProject/EVS_GUI/resources/text/python_template.py | CAP1Sup/SieskoPythonLabs | 3a0525b4feb88ad865db3f0bc30ce4e3290358f7 | [
"MIT"
] | null | null | null |
# Constant for the default confidence (0 being 0% sure and 1 being 100% sure)
default_conf_thres = .75
# TODO: Order the predictions in terms of priority (proximity?)
if __name__ == "__main__":
main() | 36.586207 | 174 | 0.55011 | import time
import edgeiq
import pyfrc
from networktables import NetworkTables
import logging
import numpy as np
# Constant for the default confidence (0 being 0% sure and 1 being 100% sure)
default_conf_thres = .75
# TODO: Order the predictions in terms of priority (proximity?)
def main():
# Allow Rio to boot a... | 0 | 0 | 0 | 0 | 0 | 6,022 | 0 | -19 | 155 |
0e0d28b9238de2847acd048be139c0f913e7d6f9 | 1,044 | py | Python | ratings/tests/runtests.py | atheiste/django-generic-ratings | 2ea43877630bce56b9f0c7d20de1c7850dba8403 | [
"MIT"
] | null | null | null | ratings/tests/runtests.py | atheiste/django-generic-ratings | 2ea43877630bce56b9f0c7d20de1c7850dba8403 | [
"MIT"
] | null | null | null | ratings/tests/runtests.py | atheiste/django-generic-ratings | 2ea43877630bce56b9f0c7d20de1c7850dba8403 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
This script is a trick to setup a fake Django environment, since this reusable
app will be developed and tested outside any specifiv Django project.
Via ``settings.configure`` you will be able to set all necessary settings
for your app and run the tests as if you were calling ``./manage.py te... | 23.2 | 78 | 0.719349 | #!/usr/bin/env python
"""
This script is a trick to setup a fake Django environment, since this reusable
app will be developed and tested outside any specifiv Django project.
Via ``settings.configure`` you will be able to set all necessary settings
for your app and run the tests as if you were calling ``./manage.py te... | 0 | 0 | 0 | 229 | 0 | 119 | 0 | 22 | 69 |
154ced56da08e4c21bb70b3e6ca95d5794d94f20 | 690 | py | Python | 8.py | eliascmaciiel/infosatc-lp-avaliativo-02 | 0d873907438b05b1eb7c28238cf287bad0de9f83 | [
"MIT"
] | null | null | null | 8.py | eliascmaciiel/infosatc-lp-avaliativo-02 | 0d873907438b05b1eb7c28238cf287bad0de9f83 | [
"MIT"
] | null | null | null | 8.py | eliascmaciiel/infosatc-lp-avaliativo-02 | 0d873907438b05b1eb7c28238cf287bad0de9f83 | [
"MIT"
] | null | null | null | lista_pc = []
lista_pc.append ("Processador Intel Core i9 11900K 11 gerao")
lista_pc.append ("Placa de vdeo NVIDIA GeForce RTX 2080TI 11 GB")
lista_pc.append ("Memria 2x 32GB DDR4 3000Mhz")
lista_pc.append ("HD 4TB Seagate 7200 RPM")
lista_pc.append ("SSD 2TB NVME SN850 Leitura 7000MB/s - Gravao 5300MB/s")
lista_... | 20.294118 | 75 | 0.733333 | lista_pc = []
lista_pc.append ("Processador Intel Core i9 11900K 11ª geração")
lista_pc.append ("Placa de vídeo NVIDIA GeForce RTX 2080TI 11 GB")
lista_pc.append ("Memória 2x 32GB DDR4 3000Mhz")
lista_pc.append ("HD 4TB Seagate 7200 RPM")
lista_pc.append ("SSD 2TB NVME SN850 Leitura 7000MB/s - Gravação 5300MB/s")
... | 18 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |