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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
69c7ae601334d32514bf5fb28a43b03b07fc3933 | 1,364 | py | Python | echidna/urls.py | liyao2598330/echidna | 145c1345ea8ee25cfcc5d3eff867ae06ddea39e8 | [
"MIT"
] | null | null | null | echidna/urls.py | liyao2598330/echidna | 145c1345ea8ee25cfcc5d3eff867ae06ddea39e8 | [
"MIT"
] | null | null | null | echidna/urls.py | liyao2598330/echidna | 145c1345ea8ee25cfcc5d3eff867ae06ddea39e8 | [
"MIT"
] | 1 | 2020-10-19T14:13:41.000Z | 2020-10-19T14:13:41.000Z | """echidna URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based... | 34.1 | 86 | 0.701613 | """echidna URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0 |
abc010200bfbe9d32bd3da10e6be427930c5d42d | 10,438 | py | Python | src/review/management/commands/sendinterview.py | dssg/appy-reviews | 626d0fdb4648334ec59adaaa6ac9a022051c266b | [
"MIT"
] | 3 | 2019-02-14T17:53:02.000Z | 2019-03-07T11:41:19.000Z | src/review/management/commands/sendinterview.py | dssg/appy-reviews | 626d0fdb4648334ec59adaaa6ac9a022051c266b | [
"MIT"
] | 13 | 2018-12-26T19:30:36.000Z | 2022-02-01T20:35:33.000Z | src/review/management/commands/sendinterview.py | dssg/appy-reviews | 626d0fdb4648334ec59adaaa6ac9a022051c266b | [
"MIT"
] | 1 | 2022-01-16T21:34:32.000Z | 2022-01-16T21:34:32.000Z | import collections
import itertools
import re
INCLUDE = 0
EXCLUDE = 1
def split_every(iterable, n, remainder=INCLUDE):
"""Slice an iterable into batches/chunks of n elements
Each generated chunk is of type tuple.
:type iterable: Iterable
:type n: int
:type remainder: int
:rtype: Iterator
... | 34.448845 | 99 | 0.571661 | import argparse
import collections
import enum
import itertools
import re
from django.conf import settings
from django.db import connection
from django.db.models.functions import Now
from terminaltables import AsciiTable
from review.models import InterviewAssignment
from . import base
def round_ordinal(n):
if ... | 0 | 850 | 0 | 7,417 | 58 | 101 | 0 | 64 | 340 |
ebb49714e03f6790e05d91a6b28e7d4aad5b5bbd | 2,103 | py | Python | ufoa_polynom_tool.py | lkangas/python-tycho2 | a82ca329341cd6e60868dfa2958ef783cbe20e74 | [
"MIT"
] | null | null | null | ufoa_polynom_tool.py | lkangas/python-tycho2 | a82ca329341cd6e60868dfa2958ef783cbe20e74 | [
"MIT"
] | null | null | null | ufoa_polynom_tool.py | lkangas/python-tycho2 | a82ca329341cd6e60868dfa2958ef783cbe20e74 | [
"MIT"
] | 1 | 2017-12-26T16:25:48.000Z | 2017-12-26T16:25:48.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 10 21:32:20 2018
@author: vostok
"""
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider
fig = plt.figure(1)
fig.clf()
axarr = fig.subplots(2,2)
ax0, ax1, ax2, ax3 = axarr.flatten()
ax1.set_ylim(-.5, .5)
ax2.... | 22.37234 | 94 | 0.60485 | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 10 21:32:20 2018
@author: vostok
"""
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider
def polynoms(k3, k2):
return [k3, k2, 1-k3-k2, 0], \
[k3, k2, -k3-k2, 0], \
[k3, k2, -k3-k2], \
[3*k3, 2... | 0 | 0 | 0 | 0 | 0 | 945 | 0 | 0 | 92 |
1b83cea9c949197682450ff58d559cd7d22cd43d | 18,499 | py | Python | Extraction/Unsupervised/prediction_unsupervised.py | evamok/knowledge-extraction-recipes-forms | d42dc5a728d72fabc6a0c568834ef6786deb9116 | [
"MIT"
] | 93 | 2020-08-03T10:23:43.000Z | 2022-03-23T15:41:22.000Z | Extraction/Unsupervised/prediction_unsupervised.py | ciph3rwoman/knowledge-extraction-recipes-forms | ce1adbb0515d1b598ba89a4a06dd3cf554230565 | [
"MIT"
] | 11 | 2020-08-05T06:49:21.000Z | 2022-02-01T10:00:25.000Z | Extraction/Unsupervised/prediction_unsupervised.py | ciph3rwoman/knowledge-extraction-recipes-forms | ce1adbb0515d1b598ba89a4a06dd3cf554230565 | [
"MIT"
] | 39 | 2020-08-05T14:48:43.000Z | 2022-02-12T05:12:11.000Z | #!/usr/bin/python
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import json
import os
import random
import shutil
import sys
import pandas as pd
from azure.storage.blob import (BlockBlobService)
from dotenv import load_dotenv
from requests import get, post
from .commo... | 41.292411 | 115 | 0.606303 | #!/usr/bin/python
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import json
import os
import random
import shutil
import sys
import pandas as pd
from azure.storage.blob import (
BlockBlobService
)
from dotenv import load_dotenv
from requests import get, post
from ... | 0 | 0 | 0 | 2,057 | 0 | 0 | 0 | 6 | 23 |
5ba32c99beb1257746e86c236774e73d97f3b88a | 716 | py | Python | via_cms/model/internal/_id_manager.py | jeanjacquesp/via-cms | 12b212f8005e3d667c23ffc4da831e4d3e653999 | [
"MIT"
] | null | null | null | via_cms/model/internal/_id_manager.py | jeanjacquesp/via-cms | 12b212f8005e3d667c23ffc4da831e4d3e653999 | [
"MIT"
] | null | null | null | via_cms/model/internal/_id_manager.py | jeanjacquesp/via-cms | 12b212f8005e3d667c23ffc4da831e4d3e653999 | [
"MIT"
] | null | null | null | # Copyright 2020 Pax Syriana Foundation. Licensed under the Apache License, Version 2.0
#
#
| 21.69697 | 88 | 0.698324 | # Copyright 2020 Pax Syriana Foundation. Licensed under the Apache License, Version 2.0
#
#
from via_cms.extension import db
from via_cms.model._database import Model
class IdManagerPost(Model):
__tablename__ = 'id_manager_post_tbl'
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
@cl... | 0 | 205 | 0 | 294 | 0 | 0 | 0 | 31 | 91 |
2cba049c2d17b86f57a70f18e203ece562ed4306 | 1,116 | py | Python | laborathory/NeronHelloWorld.py | aposum23/Laborathory2-Sem2 | b28f026a1b9b5998a5e668c6ff9707ddbb57c070 | [
"MIT"
] | null | null | null | laborathory/NeronHelloWorld.py | aposum23/Laborathory2-Sem2 | b28f026a1b9b5998a5e668c6ff9707ddbb57c070 | [
"MIT"
] | null | null | null | laborathory/NeronHelloWorld.py | aposum23/Laborathory2-Sem2 | b28f026a1b9b5998a5e668c6ff9707ddbb57c070 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
n_samples, batch_size, num_steps = 1000, 100, 20000
x_data = np.random.uniform(1, 10, (n_samples, 1))
y_data = 2 * x_data + 1 + np.random.normal(0, 2, (n_samples, 1))
x = tf.placeholder(tf.float32, shape = (batch_size, 1))
y = tf.placeholde... | 41.333333 | 107 | 0.663082 | import numpy as np
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
n_samples, batch_size, num_steps = 1000, 100, 20000
x_data = np.random.uniform(1, 10, (n_samples, 1))
y_data = 2 * x_data + 1 + np.random.normal(0, 2, (n_samples, 1))
x = tf.placeholder(tf.float32, shape = (batch_size, 1))
y = tf.placeholde... | 10 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
13209f2c2136190fa14e9ab61f0d553e80ae142f | 232 | py | Python | listings/urls.py | mishrakeshav/Django-Real-Estate-Website | 4f6146ad8d13003f890677c2c1af82b26c69678b | [
"MIT"
] | null | null | null | listings/urls.py | mishrakeshav/Django-Real-Estate-Website | 4f6146ad8d13003f890677c2c1af82b26c69678b | [
"MIT"
] | 7 | 2021-04-08T20:21:35.000Z | 2022-01-13T03:27:33.000Z | listings/urls.py | mishrakeshav/Django-Real-Estate-Website | 4f6146ad8d13003f890677c2c1af82b26c69678b | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name = 'listings'),
path('<int:listing_id>', views.listing, name = 'listing'),
path('search', views.search, name = 'search'),
] | 25.777778 | 62 | 0.633621 | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name = 'listings'),
path('<int:listing_id>', views.listing, name = 'listing'),
path('search', views.search, name = 'search'),
] | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9bdcafae8e55871a181ce0851ee2a5eef300759d | 51 | py | Python | src/python/lib/__init__.py | dhavalmetrani/amibot | a3d9ecc52f7b6ef2bdece6e0ad36318f721d0353 | [
"MIT"
] | null | null | null | src/python/lib/__init__.py | dhavalmetrani/amibot | a3d9ecc52f7b6ef2bdece6e0ad36318f721d0353 | [
"MIT"
] | 2 | 2021-04-30T21:08:14.000Z | 2021-06-02T01:06:16.000Z | src/python/lib/__init__.py | dhavalmetrani/amibot | a3d9ecc52f7b6ef2bdece6e0ad36318f721d0353 | [
"MIT"
] | 1 | 2019-03-05T14:04:00.000Z | 2019-03-05T14:04:00.000Z | """
Library for helping with python gre tools.
"""
| 12.75 | 42 | 0.686275 | """
Library for helping with python gre tools.
"""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
17c5afcea1c32632c483f706cb3a971112efd836 | 1,981 | py | Python | aws_embedded_metrics/config/environment_configuration_provider.py | scorphus/aws-embedded-metrics-python | a878b553dc330ea08f97422c34f164a1c40dcd80 | [
"Apache-2.0"
] | null | null | null | aws_embedded_metrics/config/environment_configuration_provider.py | scorphus/aws-embedded-metrics-python | a878b553dc330ea08f97422c34f164a1c40dcd80 | [
"Apache-2.0"
] | null | null | null | aws_embedded_metrics/config/environment_configuration_provider.py | scorphus/aws-embedded-metrics-python | a878b553dc330ea08f97422c34f164a1c40dcd80 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Amazon.com, Inc. or its affiliates.
# 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... | 33.576271 | 74 | 0.706714 | # Copyright 2019 Amazon.com, Inc. or its affiliates.
# 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... | 0 | 345 | 0 | 624 | 0 | 0 | 0 | 34 | 68 |
990709caac4ec23e6af193ec2ff65f6c90ec989b | 2,477 | py | Python | CAAPR/CAAPR_AstroMagic/PTS/pts/do/core/unretrieve.py | wdobbels/CAAPR | 50d0b32642a61af614c22f1c6dc3c4a00a1e71a3 | [
"MIT"
] | 7 | 2016-05-20T21:56:39.000Z | 2022-02-07T21:09:48.000Z | CAAPR/CAAPR_AstroMagic/PTS/pts/do/core/unretrieve.py | wdobbels/CAAPR | 50d0b32642a61af614c22f1c6dc3c4a00a1e71a3 | [
"MIT"
] | 1 | 2019-03-21T16:10:04.000Z | 2019-03-22T17:21:56.000Z | CAAPR/CAAPR_AstroMagic/PTS/pts/do/core/unretrieve.py | wdobbels/CAAPR | 50d0b32642a61af614c22f1c6dc3c4a00a1e71a3 | [
"MIT"
] | 1 | 2020-05-19T16:17:17.000Z | 2020-05-19T16:17:17.000Z | #!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** Astronomical Observatory, Ghent University **
# *****************************************************************
## ... | 36.970149 | 151 | 0.627776 | #!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 0 |
b205ba3c0f0887298502c3de950e4e7759206c93 | 1,206 | py | Python | app.py | chuckedfromspace/carspy-dash | 5db6c5ba82d8c3ca64d9accaff3a572f51213163 | [
"MIT"
] | null | null | null | app.py | chuckedfromspace/carspy-dash | 5db6c5ba82d8c3ca64d9accaff3a572f51213163 | [
"MIT"
] | null | null | null | app.py | chuckedfromspace/carspy-dash | 5db6c5ba82d8c3ca64d9accaff3a572f51213163 | [
"MIT"
] | null | null | null | import dash_bootstrap_components as dbc
ICONS = 'https://use.fontawesome.com/releases/v5.15.3/css/all.css'
CUSTOM_CSS = "assets/custom.css"
app = CustomDash(__name__,
suppress_callback_exceptions=True,
external_stylesheets=[dbc.themes.COSMO, ICONS])
app.title = 'CARSpy'
FLUID_STATE ... | 28.046512 | 66 | 0.499171 | import dash
import dash_bootstrap_components as dbc
class CustomDash(dash.Dash):
def interpolate_index(self, **kwargs):
return '''
<!DOCTYPE html>
<html>
<head>
{metas}
<meta name="viewport" content="width=device-width,
initial-sc... | 0 | 0 | 0 | 844 | 0 | 0 | 0 | -10 | 45 |
18323187ccc308d8f149914252b9fac92da8ae6e | 428 | py | Python | buttonwithcommand.py | Babar-Awan/CP19_05 | 5d852cc4bac724aba3acec6bcefc2e3a1d3b0a58 | [
"MIT"
] | null | null | null | buttonwithcommand.py | Babar-Awan/CP19_05 | 5d852cc4bac724aba3acec6bcefc2e3a1d3b0a58 | [
"MIT"
] | null | null | null | buttonwithcommand.py | Babar-Awan/CP19_05 | 5d852cc4bac724aba3acec6bcefc2e3a1d3b0a58 | [
"MIT"
] | null | null | null | import tkinter as tk
root = tk.Tk()
frame = tk.Frame(root)
frame.pack()
button = tk.Button(frame,
text="QUIT",
fg="red",
command=quit)
button.pack(side=tk.LEFT)
slogan = tk.Button(frame,
text="Hello",
command=write_s... | 19.454545 | 40 | 0.537383 | import tkinter as tk
def write_slogan():
print("Tkinter is easy to use!")
root = tk.Tk()
frame = tk.Frame(root)
frame.pack()
button = tk.Button(frame,
text="QUIT",
fg="red",
command=quit)
button.pack(side=tk.LEFT)
slogan = tk.Button(frame,
... | 0 | 0 | 0 | 0 | 0 | 35 | 0 | 0 | 23 |
6512c31775899848232a1163f4a3ead729875bf8 | 2,877 | py | Python | licenses.py | godiard/pack_act | 6f669b2b8689ce2461528319a7a70b4634f9a646 | [
"Apache-2.0"
] | null | null | null | licenses.py | godiard/pack_act | 6f669b2b8689ce2461528319a7a70b4634f9a646 | [
"Apache-2.0"
] | null | null | null | licenses.py | godiard/pack_act | 6f669b2b8689ce2461528319a7a70b4634f9a646 | [
"Apache-2.0"
] | null | null | null | # this file provides templates for the license summaries
# parameters: year, name of author, gpl number version
GPL = """
Copyright (C) %s %s
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either v... | 42.308824 | 74 | 0.789016 | # this file provides templates for the license summaries
# parameters: year, name of author, gpl number version
GPL = """
Copyright (C) %s %s
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either v... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cde0b2a645aaa64b071e013ddf1c6c3caaeb4ca4 | 12,161 | py | Python | sis_provisioner/models/enrollment.py | uw-it-aca/canvas-sis-provisioner | 28f54ce101704a8feaaea1e514618aba5a330a25 | [
"Apache-2.0"
] | null | null | null | sis_provisioner/models/enrollment.py | uw-it-aca/canvas-sis-provisioner | 28f54ce101704a8feaaea1e514618aba5a330a25 | [
"Apache-2.0"
] | 451 | 2016-10-25T22:08:19.000Z | 2022-03-23T20:27:52.000Z | sis_provisioner/models/enrollment.py | uw-it-aca/canvas-sis-provisioner | 28f54ce101704a8feaaea1e514618aba5a330a25 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from logging import getLogger
logger = getLogger(__name__)
enrollment_log_prefix = 'ENROLLMENT:'
| 42.372822 | 79 | 0.60324 | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from django.db import models, IntegrityError
from django.db.models import F
from django.conf import settings
from django.utils.timezone import utc, localtime
from sis_provisioner.models import Import, ImportResource
from sis_provisi... | 0 | 0 | 0 | 11,260 | 0 | 0 | 0 | 355 | 357 |
78ef4e065c83c1bd6d453f0fac35190320c1d356 | 4,378 | py | Python | src/main.py | DGU-DAI-Lab/Detect-of-Brick-Cracktion-on-CheomSeongDae | 69b4a52eff5b0513aeda759769cf4d0e53773c2f | [
"MIT"
] | null | null | null | src/main.py | DGU-DAI-Lab/Detect-of-Brick-Cracktion-on-CheomSeongDae | 69b4a52eff5b0513aeda759769cf4d0e53773c2f | [
"MIT"
] | null | null | null | src/main.py | DGU-DAI-Lab/Detect-of-Brick-Cracktion-on-CheomSeongDae | 69b4a52eff5b0513aeda759769cf4d0e53773c2f | [
"MIT"
] | null | null | null |
# --------------------------------
ENABLE_CREATING_DATASET = False # True , .
# --------------------------------
dataset_path_format = '../asset/dataset/{class_id}/{file}'
class_path = {
None: mkdir('../asset/dataset'),
0: mkdir('../asset/dataset/0'),
1: mkdir('../asset/dataset/1')}
# ----------... | 35.306452 | 122 | 0.619918 | import numpy as np
import cv2
import functools
import time
import os
import glob
import collections
from tensorflow.keras.models import load_model
from tensorflow.keras.utils import to_categorical
from module.gui import CV2_UI_ImageWindow
from module.web import get_image, sample_image_urls
from core.determine_possib... | 846 | 0 | 0 | 0 | 0 | 3,218 | 0 | 75 | 382 |
31d219a8be4842cee8a624738b9691ba52369397 | 10,566 | py | Python | ninfs/mount/nandtwl.py | ihaveamac/fuse-3ds | dfc80b9590e60444bd620711ef458a3abda3155b | [
"MIT"
] | 108 | 2017-08-15T05:08:32.000Z | 2019-04-17T18:37:59.000Z | ninfs/mount/nandtwl.py | ihaveamac/fuse-3ds | dfc80b9590e60444bd620711ef458a3abda3155b | [
"MIT"
] | 35 | 2018-03-24T03:20:09.000Z | 2019-04-08T21:02:43.000Z | ninfs/mount/nandtwl.py | ihaveamac/fuse-3ds | dfc80b9590e60444bd620711ef458a3abda3155b | [
"MIT"
] | 6 | 2017-10-12T19:54:59.000Z | 2019-04-15T21:43:28.000Z | # This file is a part of ninfs.
#
# Copyright (c) 2017-2021 Ian Burgwin
# This file is licensed under The MIT License (MIT).
# You can find the full license text in LICENSE.md in the root of this project.
"""
Mounts Nintendo DSi NAND images, creating a virtual filesystem of decrypted partitions.
"""
# _common imports ... | 40.953488 | 116 | 0.564073 | # This file is a part of ninfs.
#
# Copyright (c) 2017-2021 Ian Burgwin
# This file is licensed under The MIT License (MIT).
# You can find the full license text in LICENSE.md in the root of this project.
"""
Mounts Nintendo DSi NAND images, creating a virtual filesystem of decrypted partitions.
"""
import logging
im... | 0 | 2,459 | 0 | 5,669 | 0 | 1,571 | 0 | 147 | 313 |
ef937b5b0a0fb99f13743ab2a6b4f92e77546d5c | 132 | py | Python | Python/Mod Divmod/solution.py | arpitran/HackerRank_solutions | a3a77c858edd3955ea38530916db9051b1aa93f9 | [
"MIT"
] | null | null | null | Python/Mod Divmod/solution.py | arpitran/HackerRank_solutions | a3a77c858edd3955ea38530916db9051b1aa93f9 | [
"MIT"
] | null | null | null | Python/Mod Divmod/solution.py | arpitran/HackerRank_solutions | a3a77c858edd3955ea38530916db9051b1aa93f9 | [
"MIT"
] | null | null | null | a = int(input("enter first number"))
b = int(input("enter second number"))
res = divmod(a,b)
print(res[0])
print(res[1])
print(res) | 18.857143 | 37 | 0.666667 | a = int(input("enter first number"))
b = int(input("enter second number"))
res = divmod(a,b)
print(res[0])
print(res[1])
print(res) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e0aeb8d1632fc81f2c2d54211b79001872a24897 | 442 | py | Python | blog/app/__init__.py | frsierrag/accesoriesStoreApp | e5822a0a9b7218b75d678a6eaeb20a69e6ee86a5 | [
"MIT"
] | null | null | null | blog/app/__init__.py | frsierrag/accesoriesStoreApp | e5822a0a9b7218b75d678a6eaeb20a69e6ee86a5 | [
"MIT"
] | null | null | null | blog/app/__init__.py | frsierrag/accesoriesStoreApp | e5822a0a9b7218b75d678a6eaeb20a69e6ee86a5 | [
"MIT"
] | 1 | 2020-12-09T22:43:01.000Z | 2020-12-09T22:43:01.000Z | from flask import Flask
from app.settings.config import Ajustes
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
app = Flask(__name__)
app.config.from_object(Ajustes)
bdd = SQLAlchemy(app)
migrar = Migrate(app,bdd)
login = LoginManager(app)
login.login_view... | 23.263158 | 75 | 0.80543 | from flask import Flask
from app.settings.config import Ajustes
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
app = Flask(__name__)
app.config.from_object(Ajustes)
bdd = SQLAlchemy(app)
migrar = Migrate(app,bdd)
login = LoginManager(app)
login.login_view... | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 23 |
70b35f20073c9ba8fe42c6def788cce12b065106 | 5,972 | py | Python | safechicken/iocontrol.py | ClNo/safe-chicken | 8ee6d6746f9a660ae7f1ffb6a5483b459307e19e | [
"MIT"
] | 2 | 2021-01-21T17:45:31.000Z | 2021-01-31T01:51:51.000Z | safechicken/iocontrol.py | ClNo/safe-chicken | 8ee6d6746f9a660ae7f1ffb6a5483b459307e19e | [
"MIT"
] | null | null | null | safechicken/iocontrol.py | ClNo/safe-chicken | 8ee6d6746f9a660ae7f1ffb6a5483b459307e19e | [
"MIT"
] | null | null | null | # https://gpiozero.readthedocs.io/en/stable/
from gpiozero import Device
from gpiozero.pins.mock import MockFactory
import os
if not os.uname()[4].startswith("arm"):
Device.pin_factory = MockFactory()
# https://gpiozero.readthedocs.io/en/stable/api_output.html#base-classes
# class gpiozero.DigitalOutputDevice... | 41.762238 | 138 | 0.660918 | # https://gpiozero.readthedocs.io/en/stable/
import copy
from datetime import datetime
from gpiozero import LED, DigitalOutputDevice, DigitalInputDevice, Device
from gpiozero.pins.mock import MockFactory
import threading
import logging
import os
if not os.uname()[4].startswith("arm"):
Device.pin_factory = MockFac... | 0 | 0 | 0 | 5,443 | 0 | 0 | 0 | 32 | 111 |
00d0d6e8055b705270173da2c0ba03c8679e8c80 | 2,074 | py | Python | camcalib/cameras.py | ostapstephan/SeniorProject | f0d3f8067dec98474641c6ec3696dbd86f066a51 | [
"MIT"
] | 1 | 2018-10-03T00:30:34.000Z | 2018-10-03T00:30:34.000Z | camcalib/cameras.py | ostapstephan/SeniorProject | f0d3f8067dec98474641c6ec3696dbd86f066a51 | [
"MIT"
] | null | null | null | camcalib/cameras.py | ostapstephan/SeniorProject | f0d3f8067dec98474641c6ec3696dbd86f066a51 | [
"MIT"
] | null | null | null | # This is a collection of all the intrinsic parameters of our pi and web cameras.
# cam0mat = [
# [517.03587615, 0, 317.22014251], [0., 514.36431945, 241.10158634], [0., 0., 1.]
# ]
# cam0dcoef = [
# [3.49228875e-02, -1.15295747e-01, 1.90697426e-04, 2.13302740e-05, 4.17554877e-02]
# ]
# cam1mat = [
# [517.... | 37.035714 | 87 | 0.552073 | # This is a collection of all the intrinsic parameters of our pi and web cameras.
# cam0mat = [
# [517.03587615, 0, 317.22014251], [0., 514.36431945, 241.10158634], [0., 0., 1.]
# ]
# cam0dcoef = [
# [3.49228875e-02, -1.15295747e-01, 1.90697426e-04, 2.13302740e-05, 4.17554877e-02]
# ]
# cam1mat = [
# [517.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8e6f37bf8849aa6ca2ab21a075d6773b61d1350b | 1,845 | py | Python | tests/test_summary_real_urls.py | svven/summary | 1cd7cb9ab89782c729bfd768df0c6d1483131dc3 | [
"MIT"
] | 12 | 2015-10-15T13:27:27.000Z | 2020-02-22T05:38:33.000Z | tests/test_summary_real_urls.py | svven/summary | 1cd7cb9ab89782c729bfd768df0c6d1483131dc3 | [
"MIT"
] | 10 | 2015-01-09T13:37:06.000Z | 2021-12-13T19:45:35.000Z | tests/test_summary_real_urls.py | svven/summary | 1cd7cb9ab89782c729bfd768df0c6d1483131dc3 | [
"MIT"
] | 3 | 2015-12-19T07:42:21.000Z | 2020-04-03T14:44:38.000Z |
# Need to find a better way to skip tests
| 25.625 | 160 | 0.695393 | from summary import Summary
# Need to find a better way to skip tests
def ignore_test_summary_gv_com():
# Given
url = 'http://www.gv.com/lib/the-product-design-sprint-a-five-day-recipe-for-startups'
# When
summ = Summary(url)
summ.extract()
# Then
assert summ.image.url == 'http://img.... | 0 | 0 | 0 | 0 | 0 | 1,652 | 0 | 6 | 137 |
31dfb9795598742f07798af24f995d6c63d2dfff | 7,708 | py | Python | src/adorn/orchestrator/base.py | pyadorn/adorn | a34a9a20c1a80c7bdbee0fa641c2bd17e20e60e6 | [
"Apache-2.0"
] | 3 | 2021-12-11T03:52:57.000Z | 2022-03-22T20:42:56.000Z | src/adorn/orchestrator/base.py | pyadorn/adorn | a34a9a20c1a80c7bdbee0fa641c2bd17e20e60e6 | [
"Apache-2.0"
] | 12 | 2021-12-31T19:22:09.000Z | 2022-03-21T03:49:13.000Z | src/adorn/orchestrator/base.py | pyadorn/adorn | a34a9a20c1a80c7bdbee0fa641c2bd17e20e60e6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Jacob Baumbach
#
# 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 writin... | 38.929293 | 94 | 0.603918 | # Copyright 2021 Jacob Baumbach
#
# 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 writin... | 0 | 0 | 0 | 6,733 | 0 | 0 | 0 | 126 | 244 |
12959020796de1a7ed29e824d8f32ae51837e222 | 272 | py | Python | Projetos Python/Aulas Python/Aula07/DESAFIO07.py | robertdahmer/Exercicios-Python | ba5bcfac17dc7355db5abae23d701004c34fb068 | [
"MIT"
] | 1 | 2020-04-28T01:57:05.000Z | 2020-04-28T01:57:05.000Z | Projetos Python/Aulas Python/Aula07/DESAFIO07.py | robertdahmer/Exercicios-Python | ba5bcfac17dc7355db5abae23d701004c34fb068 | [
"MIT"
] | null | null | null | Projetos Python/Aulas Python/Aula07/DESAFIO07.py | robertdahmer/Exercicios-Python | ba5bcfac17dc7355db5abae23d701004c34fb068 | [
"MIT"
] | null | null | null | largura = float(input('Qual a largura da parede em metros? '))
altura = float(input('Qual a altura da parede em metros? '))
area = largura * altura
tinta = area / 2
print('Voc precisar de aproximadamente {} litros de tinta para pintar esta parede'.format(tinta))
| 30.222222 | 99 | 0.720588 | largura = float(input('Qual é a largura da parede em metros? '))
altura = float(input('Qual é a altura da parede em metros? '))
area = largura * altura
tinta = area / 2
print('Você precisará de aproximadamente {} litros de tinta para pintar esta parede'.format(tinta))
| 8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
de34e64970d2ed62b83fcef2f28506090881c67c | 2,987 | py | Python | tests/test_check_equal_int.py | cmarqu/checkv | ead86d930a2e6fba823f3f875cc8f6a051d8c6c8 | [
"BSD-3-Clause"
] | 1 | 2019-02-24T17:57:05.000Z | 2019-02-24T17:57:05.000Z | tests/test_check_equal_int.py | cmarqu/checkv | ead86d930a2e6fba823f3f875cc8f6a051d8c6c8 | [
"BSD-3-Clause"
] | 2 | 2019-02-24T17:42:08.000Z | 2019-03-01T09:23:29.000Z | tests/test_check_equal_int.py | cmarqu/checkv | ead86d930a2e6fba823f3f875cc8f6a051d8c6c8 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
"""Tests for ``check_equal()`` for other values."""
# Copyright checkv contributors
# Licensed under the Revised BSD License, see LICENSE for details.
# SPDX-License-Identifier: BSD-3-Clause
my_checker = "FIXME"
| 29 | 75 | 0.700033 | #!/usr/bin/env python3
"""Tests for ``check_equal()`` for other values."""
# Copyright checkv contributors
# Licensed under the Revised BSD License, see LICENSE for details.
# SPDX-License-Identifier: BSD-3-Clause
import checkv
def test_check_equal_int_0_0_pass(caplog):
checkv.check_equal(0, 0)
for record... | 0 | 0 | 0 | 0 | 0 | 2,469 | 0 | -8 | 276 |
19f73d3f50326f9f44416152a099a620657013c1 | 657 | py | Python | setup.py | QBatista/SVARBlockMC.py | 025dfa30e10ac551acc4ae2f9752c1a1cc3d228f | [
"BSD-3-Clause"
] | null | null | null | setup.py | QBatista/SVARBlockMC.py | 025dfa30e10ac551acc4ae2f9752c1a1cc3d228f | [
"BSD-3-Clause"
] | null | null | null | setup.py | QBatista/SVARBlockMC.py | 025dfa30e10ac551acc4ae2f9752c1a1cc3d228f | [
"BSD-3-Clause"
] | 3 | 2019-05-24T11:30:45.000Z | 2020-04-05T04:34:11.000Z | # Use setuptools in preference to distutils
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
DESCRIPTION = "A package for doing exact Bayesian inference on structural VAR"
setup(name='svar_block_mc',
packages=['svar_block_mc'],
version=0.1,
description=D... | 27.375 | 78 | 0.656012 | # Use setuptools in preference to distutils
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import os
DESCRIPTION = "A package for doing exact Bayesian inference on structural VAR"
setup(name='svar_block_mc',
packages=['svar_block_mc'],
version=0.1,
des... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 22 |
a976741ac6a82375e30cd6a539332beec2f4eda5 | 91 | py | Python | my_classes/ScopesClosuresAndDecorators/.history/Decoraators2_20210716214923.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/ScopesClosuresAndDecorators/.history/Decoraators2_20210716214923.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/ScopesClosuresAndDecorators/.history/Decoraators2_20210716214923.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | """ Decorator Parametors
In the previous ideos we saw some built-in decorator
""" | 18.2 | 52 | 0.681319 | """ Decorator Parametors
In the previous ideos we saw some built-in decorator
""" | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d0ddc4c1ffab2385e8823346f0df7b9f791e0499 | 305 | py | Python | pastepwn/database/abstractdb.py | bajubullet/pastepwn | 641afb3174c999a2f8a18d522791227a3a3b8189 | [
"MIT"
] | 113 | 2018-09-06T22:14:52.000Z | 2022-02-17T01:32:29.000Z | pastepwn/database/abstractdb.py | bajubullet/pastepwn | 641afb3174c999a2f8a18d522791227a3a3b8189 | [
"MIT"
] | 199 | 2018-09-15T22:17:58.000Z | 2022-01-23T23:45:09.000Z | pastepwn/database/abstractdb.py | bajubullet/pastepwn | 641afb3174c999a2f8a18d522791227a3a3b8189 | [
"MIT"
] | 88 | 2018-09-09T13:02:06.000Z | 2022-01-23T22:56:09.000Z | # -*- coding: utf-8 -*-
| 19.0625 | 47 | 0.593443 | # -*- coding: utf-8 -*-
class AbstractDB(object):
def __init__(self):
pass
def store(self, paste):
"""Stores a paste in the database"""
raise NotImplementedError
def get(self, key):
"""Fetches a paste from the database"""
raise NotImplementedError
| 0 | 0 | 0 | 257 | 0 | 0 | 0 | 0 | 23 |
9c0ac77513a21317bdbabe9538c4e719d9e1adc8 | 1,338 | py | Python | commercialoperator/components/bookings/context_processors.py | wilsonc86/ledger | a60a681e547f37e4ac81cb93dffaf90aea8c8151 | [
"Apache-2.0"
] | null | null | null | commercialoperator/components/bookings/context_processors.py | wilsonc86/ledger | a60a681e547f37e4ac81cb93dffaf90aea8c8151 | [
"Apache-2.0"
] | null | null | null | commercialoperator/components/bookings/context_processors.py | wilsonc86/ledger | a60a681e547f37e4ac81cb93dffaf90aea8c8151 | [
"Apache-2.0"
] | null | null | null |
def template_context(request):
"""Pass extra context variables to every template.
"""
context = commercialoperator_url(request)
return context
| 31.116279 | 74 | 0.685351 | from django.conf import settings
from commercialoperator import helpers
def commercialoperator_url(request):
web_url = request.META['HTTP_HOST']
template_group = 'commercialoperator'
TERMS = "/know/online-commercialoperator-booking-terms-and-conditions"
is_officer = False
is_admin = False
is_c... | 0 | 0 | 0 | 0 | 0 | 1,079 | 0 | 28 | 67 |
70d373bace4ec298c95078ffd9c126321bcfcda8 | 4,076 | py | Python | src/run_single.py | SaraJakubiak/covid19-caribbean-educational-model | aa1a8f1df4b8935d633e525314fcfe56d08c9a53 | [
"BSD-2-Clause"
] | 1 | 2020-08-17T11:14:37.000Z | 2020-08-17T11:14:37.000Z | src/run_single.py | magicicada/covid19-caribbean-educational-model | aa1a8f1df4b8935d633e525314fcfe56d08c9a53 | [
"BSD-2-Clause"
] | null | null | null | src/run_single.py | magicicada/covid19-caribbean-educational-model | aa1a8f1df4b8935d633e525314fcfe56d08c9a53 | [
"BSD-2-Clause"
] | 1 | 2020-08-17T12:24:36.000Z | 2020-08-17T12:24:36.000Z | """
Runs the simulation once based on the files provided
"""
import argparse
import json
import os
from datetime import datetime
from src.simulation import Simulation
parser = argparse.ArgumentParser(
description="Runs the simulation once based on the files provided")
parser.add_argument("-i", "--input_spec_fil... | 38.819048 | 106 | 0.64843 | """
Runs the simulation once based on the files provided
"""
import argparse
import json
import os
from datetime import datetime
from src.simulation import Simulation
parser = argparse.ArgumentParser(
description="Runs the simulation once based on the files provided")
parser.add_argument("-i", "--input_spec_fil... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d174e9d39373edf782e150360ae42b3eef983430 | 463 | py | Python | examples/cifar10/solve_quick.py | neopenx/Dragon | 0e639a7319035ddc81918bd3df059230436ee0a1 | [
"BSD-2-Clause"
] | 212 | 2015-07-05T07:57:17.000Z | 2022-02-27T01:55:35.000Z | examples/cifar10/solve_quick.py | neopenx/Dragon | 0e639a7319035ddc81918bd3df059230436ee0a1 | [
"BSD-2-Clause"
] | 6 | 2016-07-07T14:31:56.000Z | 2017-12-12T02:21:15.000Z | examples/cifar10/solve_quick.py | neopenx/Dragon | 0e639a7319035ddc81918bd3df059230436ee0a1 | [
"BSD-2-Clause"
] | 71 | 2016-03-24T09:02:41.000Z | 2021-06-03T01:52:41.000Z | # --------------------------------------------------------
# Cifar-10 for Dragon
# Copyright(c) 2017 SeetaTech
# Written by Ting Pan
# --------------------------------------------------------
""" Train a cifar-10 net """
import dragon.vm.caffe as caffe
if __name__ == '__main__':
# init
caffe.set_mode_gpu()
... | 22.047619 | 61 | 0.50324 | # --------------------------------------------------------
# Cifar-10 for Dragon
# Copyright(c) 2017 SeetaTech
# Written by Ting Pan
# --------------------------------------------------------
""" Train a cifar-10 net """
import dragon.vm.caffe as caffe
if __name__ == '__main__':
# init
caffe.set_mode_gpu()
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d9d69549a74e1d2e5dc00a9eb09bc361df1b078d | 20,797 | py | Python | tests/test_bin.py | vihangd/hy | 781dc35d96258b6e88400ef1eb29c8591d08dcaa | [
"MIT"
] | null | null | null | tests/test_bin.py | vihangd/hy | 781dc35d96258b6e88400ef1eb29c8591d08dcaa | [
"MIT"
] | null | null | null | tests/test_bin.py | vihangd/hy | 781dc35d96258b6e88400ef1eb29c8591d08dcaa | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import re
from importlib.util import cache_from_source
hy_dir = os.environ.get('HY_DIR', '')
def test_bin_hy_error_parts_length():
"""Confirm that exception messages print arrows surrounding the affected
expression."""
prg_str = """
(import hy.errors
... | 32.699686 | 101 | 0.614608 | #!/usr/bin/env python
import os
import re
import shlex
import subprocess
import builtins
from importlib.util import cache_from_source
import pytest
hy_dir = os.environ.get('HY_DIR', '')
def pyr(s=""):
return "hy --repl-output-fn=repr " + s
def run_cmd(cmd, stdin_data=None, expect=0, dontwritebytecode=False... | 0 | 1,749 | 0 | 0 | 0 | 11,259 | 0 | -27 | 1,059 |
df4d53e8f5818d8625847d22d1f6e837538c2f21 | 1,587 | py | Python | backend/app.py | Dowsley/graph-tool | 0ac4eb2afb0aec652eec9a6603ae180f5f588ff9 | [
"MIT"
] | null | null | null | backend/app.py | Dowsley/graph-tool | 0ac4eb2afb0aec652eec9a6603ae180f5f588ff9 | [
"MIT"
] | null | null | null | backend/app.py | Dowsley/graph-tool | 0ac4eb2afb0aec652eec9a6603ae180f5f588ff9 | [
"MIT"
] | null | null | null | from flask import Flask
from flask_cors import CORS
app = Flask(__name__)
cors = CORS(app, resources={r'/': {"origins": "http://localhost:3000"}})
if __name__ == '__main__':
app.run(debug=True) | 29.388889 | 74 | 0.575299 | from flask import Flask, request, jsonify
from flask_cors import CORS, cross_origin
from model import Graph
app = Flask(__name__)
cors = CORS(app, resources={r'/': {"origins": "http://localhost:3000"}})
@app.route('/', methods=['POST', ])
@cross_origin()
def handle_graph():
data = request.get_json()
graph = ... | 0 | 1,304 | 0 | 0 | 0 | 0 | 0 | 34 | 45 |
61f98fa0b49a6ca23709c2bd16996b9fc13ac925 | 1,553 | py | Python | LeetCode/LeetCode_Python-master/LeetCode_Python-master/Algorithm-Easy/202_Happy_Number.py | Sycamore-City-passerby/ML | 605cfc70bdda2c99e5f1c16b25812b59c98a72ad | [
"MIT"
] | null | null | null | LeetCode/LeetCode_Python-master/LeetCode_Python-master/Algorithm-Easy/202_Happy_Number.py | Sycamore-City-passerby/ML | 605cfc70bdda2c99e5f1c16b25812b59c98a72ad | [
"MIT"
] | null | null | null | LeetCode/LeetCode_Python-master/LeetCode_Python-master/Algorithm-Easy/202_Happy_Number.py | Sycamore-City-passerby/ML | 605cfc70bdda2c99e5f1c16b25812b59c98a72ad | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
print(Soluiton().isHappy(19))
"""
Time Complexity = O(k), k is the number of steps to get the happy number
Space Complexity = O(k)
Write an algorithm to determine if a number is "happy".
A happy number is a number defined by... | 28.759259 | 111 | 0.504185 | class Solution:
def isHappy(self, n):
"""
:type n: int
:rtype: bool
"""
seen_numbers = set()
while n > 1 and n not in seen_numbers:
seen_numbers.add(n)
n = sum(map(lambda x: int(x) * int(x), list(str(n))))
return n == 1
def isHappy... | 0 | 0 | 0 | 615 | 0 | 0 | 0 | 0 | 22 |
6e49c1314f3bd55028f8d83f8fcdec7fdec79101 | 264 | py | Python | bentoml/mlflow.py | francoisserra/BentoML | 213e9e9b39e055286f2649c733907df88e6d2503 | [
"Apache-2.0"
] | 1 | 2021-06-12T17:04:07.000Z | 2021-06-12T17:04:07.000Z | bentoml/mlflow.py | francoisserra/BentoML | 213e9e9b39e055286f2649c733907df88e6d2503 | [
"Apache-2.0"
] | 4 | 2021-05-16T08:06:25.000Z | 2021-11-13T08:46:36.000Z | bentoml/mlflow.py | francoisserra/BentoML | 213e9e9b39e055286f2649c733907df88e6d2503 | [
"Apache-2.0"
] | null | null | null | from ._internal.frameworks.mlflow import load
from ._internal.frameworks.mlflow import save
from ._internal.frameworks.mlflow import load_runner
from ._internal.frameworks.mlflow import import_from_uri
__all__ = ["import_from_uri", "load", "load_runner", "save"]
| 37.714286 | 60 | 0.814394 | from ._internal.frameworks.mlflow import load
from ._internal.frameworks.mlflow import save
from ._internal.frameworks.mlflow import load_runner
from ._internal.frameworks.mlflow import import_from_uri
__all__ = ["import_from_uri", "load", "load_runner", "save"]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a92d524e9ff8ae636219154d4240c08c6d321088 | 1,434 | py | Python | floodgate/client_state_machine/layer2_decoration_event/reply.py | muzudho/e-gov-vote-kifuwarabe-player-client | f33987ce5ffa4fc51f625787ed0e300fd9a2f02a | [
"MIT"
] | null | null | null | floodgate/client_state_machine/layer2_decoration_event/reply.py | muzudho/e-gov-vote-kifuwarabe-player-client | f33987ce5ffa4fc51f625787ed0e300fd9a2f02a | [
"MIT"
] | null | null | null | floodgate/client_state_machine/layer2_decoration_event/reply.py | muzudho/e-gov-vote-kifuwarabe-player-client | f33987ce5ffa4fc51f625787ed0e300fd9a2f02a | [
"MIT"
] | null | null | null |
def create():
""""""
return _DecoratedState()
| 29.265306 | 131 | 0.620642 | from app import app
from floodgate.client_state_machine.layer1_transition_map.reply import ReplyState as _TransitionState
from floodgate.client_state_machine.layer2_decoration_event.clean_up_vote import clean_up_vote
def create():
"""ステート生成"""
return _DecoratedState()
class _DecoratedState(_TransitionState)... | 222 | 0 | 0 | 1,063 | 0 | 0 | 0 | 151 | 89 |
0f0d69e486720439ae2c784d7d18f8c9f2cdfb50 | 12,815 | py | Python | openmdao/core/test/test_fileref.py | colinxs/OpenMDAO | a9a52be29281a23a102c64b577066ee5fc70f4b4 | [
"Apache-2.0"
] | 17 | 2018-01-11T20:13:59.000Z | 2022-03-22T03:46:05.000Z | openmdao/core/test/test_fileref.py | colinxs/OpenMDAO | a9a52be29281a23a102c64b577066ee5fc70f4b4 | [
"Apache-2.0"
] | 6 | 2017-10-19T23:14:14.000Z | 2020-11-22T17:30:57.000Z | openmdao/core/test/test_fileref.py | colinxs/OpenMDAO | a9a52be29281a23a102c64b577066ee5fc70f4b4 | [
"Apache-2.0"
] | 10 | 2018-04-12T22:13:33.000Z | 2020-05-07T10:02:59.000Z | import unittest
if __name__ == '__main__':
unittest.main()
| 35.796089 | 126 | 0.561764 |
import os
import unittest
import struct
from tempfile import mkdtemp
from shutil import rmtree
import errno
from openmdao.api import Problem, Component, Group, ExecComp, FileRef
from openmdao.util.file_util import build_directory
class FileSrc(Component):
def __init__(self, path=''):
super(FileSrc, self)... | 0 | 0 | 0 | 12,347 | 0 | 0 | 0 | 60 | 340 |
5b5ecf92ed951d2a7402fe90f2499c383dcd19e2 | 3,254 | py | Python | plugins/pypi.py | Kermitofx/dexty | c3d9c2edc993ab14e814c1a285992a59db5efe46 | [
"MIT"
] | 2 | 2019-08-12T20:24:53.000Z | 2019-08-14T03:20:59.000Z | plugins/pypi.py | Kermitofx/dexty | c3d9c2edc993ab14e814c1a285992a59db5efe46 | [
"MIT"
] | null | null | null | plugins/pypi.py | Kermitofx/dexty | c3d9c2edc993ab14e814c1a285992a59db5efe46 | [
"MIT"
] | null | null | null | # Copyright (C) 2018-2019 Amano Team <contact@amanoteam.ml>
#
# 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, modi... | 47.852941 | 111 | 0.59158 | # Copyright (C) 2018-2019 Amano Team <contact@amanoteam.ml>
#
# 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, modi... | 0 | 0 | 1,668 | 0 | 0 | 274 | 0 | 12 | 182 |
7777119e07099e95c4c1980b847c34277ae5fb72 | 2,362 | py | Python | nectar/nectar/theanoutil/treelstm.py | jiangycTarheel/Adversarial-MultiHopQA | 159c85fa67d2d4ea52c69579f04c3920821e7ceb | [
"MIT"
] | 8 | 2019-06-25T23:54:03.000Z | 2020-10-20T02:39:49.000Z | nectar/theanoutil/treelstm.py | robinjia/nectar | bdd4f3374ce6341e8e51382b5ef3a8e1dfd3bda3 | [
"MIT"
] | 2 | 2019-08-26T08:17:50.000Z | 2020-09-09T05:54:59.000Z | nectar/theanoutil/treelstm.py | robinjia/nectar | bdd4f3374ce6341e8e51382b5ef3a8e1dfd3bda3 | [
"MIT"
] | 1 | 2021-07-05T09:52:02.000Z | 2021-07-05T09:52:02.000Z | """Tree-LSTM encoder.
Based on Tai et al., 2015,
"Improved Semantic Representations From
Tree-Structured Long Short-Term Memory Networks."
Actually works on any DAG.
By convention, the root of the tree has only outgoing edges.
In DAG terminology, this means we start at sink nodes
and end at source nodes.
"""
import ... | 36.338462 | 92 | 0.624894 | """Tree-LSTM encoder.
Based on Tai et al., 2015,
"Improved Semantic Representations From
Tree-Structured Long Short-Term Memory Networks."
Actually works on any DAG.
By convention, the root of the tree has only outgoing edges.
In DAG terminology, this means we start at sink nodes
and end at source nodes.
"""
import ... | 0 | 0 | 0 | 0 | 0 | 1,165 | 0 | 12 | 69 |
b864473543316352c09101b6765e64771cd09218 | 594 | py | Python | setup.py | thibsej/unbalanced-ot-functionals | bfd098e98ed10b90a36e0dbe7b099c1c31770931 | [
"MIT"
] | 14 | 2019-12-04T12:41:12.000Z | 2022-03-30T11:37:00.000Z | setup.py | thibsej/unbalanced-ot-functionals | bfd098e98ed10b90a36e0dbe7b099c1c31770931 | [
"MIT"
] | 1 | 2022-01-14T16:35:18.000Z | 2022-01-18T09:15:03.000Z | setup.py | thibsej/unbalanced-ot-functionals | bfd098e98ed10b90a36e0dbe7b099c1c31770931 | [
"MIT"
] | 3 | 2020-10-09T08:24:22.000Z | 2022-02-18T15:48:35.000Z | #! /usr/bin/env python
from setuptools import setup
setup(
name="unbalancedot",
distname="",
version='0.0.1',
description="Functionals derived from the theory of entropically "
"regularized unbalanced optimal transport ",
author='Thibault Sejourne',
author_email='thibault.sejour... | 27 | 70 | 0.602694 | #! /usr/bin/env python
from setuptools import setup
setup(
name="unbalancedot",
distname="",
version='0.0.1',
description="Functionals derived from the theory of entropically "
"regularized unbalanced optimal transport ",
author='Thibault Sejourne',
author_email='thibault.sejour... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e5db96a994443ca75a20a1e328acc6be74c3c3c7 | 7,288 | py | Python | BB2_PHYSICS_SIM_PANEL.py | EthanHolleman/BioBlender21 | d1843373f0d827be06ea3e1467d5e57284112217 | [
"BSD-2-Clause"
] | null | null | null | BB2_PHYSICS_SIM_PANEL.py | EthanHolleman/BioBlender21 | d1843373f0d827be06ea3e1467d5e57284112217 | [
"BSD-2-Clause"
] | null | null | null | BB2_PHYSICS_SIM_PANEL.py | EthanHolleman/BioBlender21 | d1843373f0d827be06ea3e1467d5e57284112217 | [
"BSD-2-Clause"
] | null | null | null | # Blender modules
# 2020-03-28
import bpy
import bpy.path
# Python standard modules
geList = []
global Parents
Parents = {}
bpy.utils.register_class(bb2_operator_interactive)
bpy.utils.register_class(bb2_operator_ge_refresh)
if __name__ == "__main__":
print("PHYSICS_SIM module... | 33.431193 | 148 | 0.58905 | # Blender modules
# 2020-03-28
import bpy
from bpy import *
import bpy.path
from bpy.path import abspath
from mathutils import *
# Python standard modules
from urllib.parse import urlencode
from urllib.request import *
from html.parser import *
from smtplib import *
from email.mime.text import MIMEText
i... | 0 | 0 | 0 | 3,410 | 0 | 2,722 | 0 | 28 | 796 |
dd69de4dd67bf1904196124e47b129b9b9f4bb64 | 23,096 | py | Python | mp/data_manager/models.py | Ecotrust/COMPASS | 42ee113e4d66767300cfab0d6ce1f35847f447ed | [
"Apache-2.0"
] | 1 | 2017-09-06T14:05:48.000Z | 2017-09-06T14:05:48.000Z | mp/data_manager/models.py | Ecotrust/COMPASS | 42ee113e4d66767300cfab0d6ce1f35847f447ed | [
"Apache-2.0"
] | 118 | 2015-01-05T19:52:11.000Z | 2021-11-30T18:33:35.000Z | mp/data_manager/models.py | Ecotrust/COMPASS | 42ee113e4d66767300cfab0d6ce1f35847f447ed | [
"Apache-2.0"
] | null | null | null | #from sorl.thumbnail import ImageField
| 42.77037 | 353 | 0.626039 | from django.db import models
from django.contrib.auth.models import User
from utils import get_domain
from django.template.defaultfilters import slugify
import settings
#from sorl.thumbnail import ImageField
class TOCTheme(models.Model):
display_name = models.CharField(max_length=100)
name = mod... | 0 | 8,283 | 0 | 14,359 | 0 | 0 | 0 | 59 | 337 |
e7acb16eb9e9f4004493000378796e0795d84cd5 | 3,471 | py | Python | main.py | lidq92/pytorch-dynamic-routing-between-capsules | 4388cd36193348cbb10035008360330e67acdd41 | [
"MIT"
] | 10 | 2018-09-17T02:14:34.000Z | 2021-06-17T12:16:35.000Z | main.py | lidq92/pytorch-dynamic-routing-between-capsules | 4388cd36193348cbb10035008360330e67acdd41 | [
"MIT"
] | null | null | null | main.py | lidq92/pytorch-dynamic-routing-between-capsules | 4388cd36193348cbb10035008360330e67acdd41 | [
"MIT"
] | 2 | 2019-08-06T20:40:02.000Z | 2020-01-02T08:24:39.000Z | import torchvision.transforms as transforms
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='PyTorch Capsules Networks')
parser.add_argument('-c', '--config', default='config.yaml', type=str,
help='config file path (default: config.yaml)')
pa... | 39.896552 | 77 | 0.576203 | import os
import torch
import torchvision
import torchvision.transforms as transforms
from trainer import CapsNetTrainer
import yaml, argparse
from utils.util import ensure_dir
from logger.logger import Logger #
def main(args):
conf = yaml.load(open(args.config))
conf.update(conf[conf['model']])
if args... | 0 | 0 | 0 | 0 | 0 | 2,456 | 0 | 18 | 158 |
35eae6753de44556babbbffc5fbb12b43e29816a | 3,024 | py | Python | build/transform_config_hw.py | timgates42/subversion | 0f088f530747140c6783c2eeb77ceff8e8613c42 | [
"Apache-2.0"
] | 7 | 2018-01-18T06:13:21.000Z | 2020-07-09T03:46:16.000Z | build/transform_config_hw.py | timgates42/subversion | 0f088f530747140c6783c2eeb77ceff8e8613c42 | [
"Apache-2.0"
] | 4 | 2015-01-12T22:23:41.000Z | 2015-01-12T22:33:52.000Z | build/transform_config_hw.py | timgates42/subversion | 0f088f530747140c6783c2eeb77ceff8e8613c42 | [
"Apache-2.0"
] | 6 | 2015-10-24T06:23:10.000Z | 2022-03-07T11:25:05.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 28.528302 | 78 | 0.660384 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 0 | 0 | 0 | 0 | 0 | 1,188 | 0 | -6 | 91 |
4137033420b2208607589ce75e102f663cdf6d7f | 562 | py | Python | property/migrations/0009_complaint_complainant.py | hyperfield/realtor | 27e60c8148562ac2bb0ddbffcfe91902368dbec1 | [
"MIT"
] | null | null | null | property/migrations/0009_complaint_complainant.py | hyperfield/realtor | 27e60c8148562ac2bb0ddbffcfe91902368dbec1 | [
"MIT"
] | null | null | null | property/migrations/0009_complaint_complainant.py | hyperfield/realtor | 27e60c8148562ac2bb0ddbffcfe91902368dbec1 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.4 on 2021-01-12 15:15
| 26.761905 | 128 | 0.663701 | # Generated by Django 2.2.4 on 2021-01-12 15:15
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('property', '0008_complaint'),
]
operations = [
... | 24 | 0 | 0 | 403 | 0 | 0 | 0 | 30 | 68 |
7457569a744f3939584d2298b920784164dbf500 | 265 | py | Python | Python/Sets/setmutation.py | ukirderohit/Python-Hacker-rank-solutions | de3b60b00d864c15a452977225b33ead19c878a5 | [
"MIT"
] | null | null | null | Python/Sets/setmutation.py | ukirderohit/Python-Hacker-rank-solutions | de3b60b00d864c15a452977225b33ead19c878a5 | [
"MIT"
] | null | null | null | Python/Sets/setmutation.py | ukirderohit/Python-Hacker-rank-solutions | de3b60b00d864c15a452977225b33ead19c878a5 | [
"MIT"
] | null | null | null | a = int(raw_input())
seta = set(map(int,raw_input().split()))
n = int(raw_input())
for every in range(n):
operation = (raw_input() + " ").split(" ")
temp=set(map(int,raw_input().split()))
eval("seta.{0}(temp)".format(operation[0]))
print sum(seta) | 26.5 | 47 | 0.603774 | a = int(raw_input())
seta = set(map(int,raw_input().split()))
n = int(raw_input())
for every in range(n):
operation = (raw_input() + " ").split(" ")
temp=set(map(int,raw_input().split()))
eval("seta.{0}(temp)".format(operation[0]))
print sum(seta) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
068ae679044aaa5db675e5e097f2815b9e824bcf | 447 | py | Python | 074 - Maior e Menor com Tupla.py | Rprjunior/PraticandoPython | cad85e2f05703986b2ee47d8a475ac67c8909b88 | [
"MIT"
] | null | null | null | 074 - Maior e Menor com Tupla.py | Rprjunior/PraticandoPython | cad85e2f05703986b2ee47d8a475ac67c8909b88 | [
"MIT"
] | null | null | null | 074 - Maior e Menor com Tupla.py | Rprjunior/PraticandoPython | cad85e2f05703986b2ee47d8a475ac67c8909b88 | [
"MIT"
] | null | null | null | '''074 - MAIOR E MENOR COM TUPLA.
PROGRAMA QUE MOSTRE 05 VALORES QUE TEM NA TUPLA DE FORMA ALEATRIA E DIGA QUAL O MENOR E O MAIOR.'''
from random import randint
numeros = (randint(0, 10), randint(0, 10), randint(0, 10), randint(0, 10), randint(0, 10))
print('Os valores gerados foram: ', end='')
for n in numeros:
p... | 40.636364 | 100 | 0.680089 | '''074 - MAIOR E MENOR COM TUPLA.
PROGRAMA QUE MOSTRE 05 VALORES QUE TEM NA TUPLA DE FORMA ALEATÓRIA E DIGA QUAL O MENOR E O MAIOR.'''
from random import randint
numeros = (randint(0, 10), randint(0, 10), randint(0, 10), randint(0, 10), randint(0, 10))
print('Os valores gerados foram: ', end='')
for n in numeros:
... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
de1d48d20461aad1a4998cf73b86074e42c07755 | 583 | py | Python | Python/empire/python/stdin.py | Tombmyst/Empire | f28782787c5fa9127e353549b73ec90d3c82c003 | [
"Apache-2.0"
] | null | null | null | Python/empire/python/stdin.py | Tombmyst/Empire | f28782787c5fa9127e353549b73ec90d3c82c003 | [
"Apache-2.0"
] | null | null | null | Python/empire/python/stdin.py | Tombmyst/Empire | f28782787c5fa9127e353549b73ec90d3c82c003 | [
"Apache-2.0"
] | null | null | null |
__all__ = ['read_input']
| 24.291667 | 83 | 0.530017 | import time
import msvcrt
__all__ = ['read_input']
def read_input(timeout_ms: float = 1000) -> str:
start_time: int = int(time.time() * 1000)
input_str: str = ''
while True:
if msvcrt.kbhit():
byte_arr = msvcrt.getche()
if ord(byte_arr) == 13: # enter_key
... | 0 | 0 | 0 | 0 | 0 | 498 | 0 | -18 | 71 |
942cb213bff4c89e927ccaf7d6f29cb10ecf9226 | 1,677 | py | Python | freedm/data/memory.py | DerekRoy/free.dm-Common | 83ba7521e0df1c10076c1ffe4427ef22ac23f5f0 | [
"MIT"
] | 1 | 2017-05-23T21:36:31.000Z | 2017-05-23T21:36:31.000Z | freedm/data/memory.py | DerekRoy/free.dm-Common | 83ba7521e0df1c10076c1ffe4427ef22ac23f5f0 | [
"MIT"
] | 13 | 2017-11-04T15:54:39.000Z | 2019-02-11T12:01:29.000Z | freedm/data/memory.py | wandth/free.dm-Common | c3b7353e9211f0c99c4b761ef891f0cb53a7d18b | [
"MIT"
] | null | null | null | '''
This module provides a DataStore based on in-memory dictionaries.
@author: Thomas Wanderer
'''
# free.dm Imports
| 31.641509 | 94 | 0.642815 | '''
This module provides a DataStore based on in-memory dictionaries.
@author: Thomas Wanderer
'''
# free.dm Imports
from freedm.data.store import DataStore
from freedm.data.object import DataObject
from typing import Union, Any, Type
class MemoryStore(DataStore):
'''
A data store which reads and writes its ... | 0 | 0 | 0 | 1,418 | 0 | 0 | 0 | 52 | 89 |
f020202f9c45072fa93833ff1b90fb3582c3d081 | 1,566 | py | Python | src/backend/trelloclone/core/views.py | splashai/Mock1_Trello_Clone | 041ca222db95ab6cef7fcd2da49e739231666f0e | [
"MIT"
] | null | null | null | src/backend/trelloclone/core/views.py | splashai/Mock1_Trello_Clone | 041ca222db95ab6cef7fcd2da49e739231666f0e | [
"MIT"
] | 1 | 2018-07-13T17:55:24.000Z | 2018-07-13T17:55:24.000Z | src/backend/trelloclone/core/views.py | splashai/Mock1_Trello_Clone | 041ca222db95ab6cef7fcd2da49e739231666f0e | [
"MIT"
] | null | null | null |
#
| 32.625 | 174 | 0.770115 | from rest_framework import generics
from django.http import JsonResponse
from .serializers import BoardSerializer, CardSerializer, TaskListSerializer, BoardUserRelationshipSerializer, BoardDetailSerializer, TaskListDetailSerializer, UserSerializer
from .models import Board, TaskList, Card, BoardUserRelationship, User
... | 0 | 0 | 0 | 1,078 | 0 | 0 | 0 | 231 | 249 |
15f5f4aaa7862316b1634d9fe860237aa0d8c22a | 845 | py | Python | conftest.py | malthe/astro | 61036ab08b2826136f64fdbfc6ca21b61643a8a0 | [
"Apache-2.0"
] | null | null | null | conftest.py | malthe/astro | 61036ab08b2826136f64fdbfc6ca21b61643a8a0 | [
"Apache-2.0"
] | null | null | null | conftest.py | malthe/astro | 61036ab08b2826136f64fdbfc6ca21b61643a8a0 | [
"Apache-2.0"
] | null | null | null |
# Import Operator
| 29.137931 | 76 | 0.701775 | import os
import pathlib
import pytest
# Import Operator
import yaml
from airflow.models import Connection, DagRun
from airflow.models import TaskInstance as TI
from airflow.utils.session import create_session
from astro import sql as aql
@pytest.fixture(scope="session", autouse=True)
def create_database_connectio... | 0 | 579 | 0 | 0 | 0 | 0 | 0 | 45 | 201 |
e19951054fa615d27456ef6304be48c83e376151 | 5,991 | py | Python | lib/reda/eis/test_convert.py | j-hase/reda | b6419c39842cfbdd9380a27a5c6e9a04ccaeb294 | [
"MIT"
] | 12 | 2017-12-11T08:32:46.000Z | 2021-06-09T05:41:57.000Z | lib/reda/eis/test_convert.py | j-hase/reda | b6419c39842cfbdd9380a27a5c6e9a04ccaeb294 | [
"MIT"
] | 58 | 2017-11-12T11:10:42.000Z | 2021-06-11T13:52:44.000Z | lib/reda/eis/test_convert.py | geophysics-ubonn/REDA | 8f0399031121f5a937171231a25f9ab03a3c8873 | [
"MIT"
] | 11 | 2017-11-12T12:02:35.000Z | 2021-02-16T06:54:04.000Z | # -*- coding: utf-8 -*-
""" Tests for converter functions
Run with
nosetests test_convert.py -s -v
"""
# from nose.tools import *
import reda.eis.convert as sip_convert
from_keys = sip_convert.from_converters.keys()
| 32.737705 | 78 | 0.588383 | # -*- coding: utf-8 -*-
""" Tests for converter functions
Run with
nosetests test_convert.py -s -v
"""
import pytest
# from nose.tools import *
import numpy as np
import reda.eis.convert as sip_convert
import numpy.testing
from_keys = sip_convert.from_converters.keys()
class TestClass_input_styles(object):
"""
... | 0 | 28 | 0 | 5,643 | 0 | 0 | 0 | -12 | 112 |
9101f6d41228a9b580fddce5ecea7dc6cb44994e | 8,106 | py | Python | minedeep_crawler/network_crawler.py | Brillone/MineDeep-Final-Project | 8a46f5db292d88e54ff2db976d9835d41f16d125 | [
"Apache-2.0"
] | null | null | null | minedeep_crawler/network_crawler.py | Brillone/MineDeep-Final-Project | 8a46f5db292d88e54ff2db976d9835d41f16d125 | [
"Apache-2.0"
] | null | null | null | minedeep_crawler/network_crawler.py | Brillone/MineDeep-Final-Project | 8a46f5db292d88e54ff2db976d9835d41f16d125 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3.5
import os
import argparse
import sys
if __name__ == '__main__':
initialize_logger(os.path.join(sys.path[0], 'logging'))
parser = argparse.ArgumentParser(description='This a social network site crawler')
parser.add_argument('-t',
action='store',
... | 37.878505 | 110 | 0.584135 | #!/usr/bin/env python3.5
import datetime
import time
import os
import argparse
import json
import logging
import sys
from queue_manager import QueuesManager
from api_controller import WorkersManager
from sql_builder import DBExtractor
from classification.ml_classifier import UserClassifier
class Crawler:
def __i... | 0 | 0 | 0 | 5,304 | 0 | 1,395 | 0 | 53 | 246 |
887766840c4cdd8a601a838aa8b7494ef748b617 | 435 | py | Python | Course_2/Assignments/Assignment 8.4.py | GundaHrushinath/Python_for_Everybody.github.io | ff6cc41636c1fc1ee3a717552b387f7c8a77ef4f | [
"MIT"
] | null | null | null | Course_2/Assignments/Assignment 8.4.py | GundaHrushinath/Python_for_Everybody.github.io | ff6cc41636c1fc1ee3a717552b387f7c8a77ef4f | [
"MIT"
] | null | null | null | Course_2/Assignments/Assignment 8.4.py | GundaHrushinath/Python_for_Everybody.github.io | ff6cc41636c1fc1ee3a717552b387f7c8a77ef4f | [
"MIT"
] | null | null | null | #file used is romeo.txt
fname = input("Enter file name: ")
fh = open(fname)
lst = list()
for line in fh:
for i in line.split():
if not i in lst:
lst.append(i)
lst.sort()
print(lst)
#Output
#['Arise', 'But', 'It', 'Juliet', 'Who', 'already', 'and', 'breaks', 'east', 'envious', 'fair', 'grief', '... | 31.071429 | 220 | 0.556322 | #file used is romeo.txt
fname = input("Enter file name: ")
fh = open(fname)
lst = list()
for line in fh:
for i in line.split():
if not i in lst:
lst.append(i)
lst.sort()
print(lst)
#Output
#['Arise', 'But', 'It', 'Juliet', 'Who', 'already', 'and', 'breaks', 'east', 'envious', 'fair', 'grief', '... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
04322ea58c95e170caaaf09e675486cf11f3ea54 | 2,397 | py | Python | lib/matplotlib/tests/test_transforms.py | f0k/matplotlib | b33a031deeb6a69533449d38d82ccf5a8246c959 | [
"MIT",
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | lib/matplotlib/tests/test_transforms.py | f0k/matplotlib | b33a031deeb6a69533449d38d82ccf5a8246c959 | [
"MIT",
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | lib/matplotlib/tests/test_transforms.py | f0k/matplotlib | b33a031deeb6a69533449d38d82ccf5a8246c959 | [
"MIT",
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
| 36.318182 | 73 | 0.614518 | from __future__ import print_function
from nose.tools import assert_equal
from numpy.testing import assert_almost_equal
from matplotlib.transforms import Affine2D, BlendedGenericTransform
from matplotlib.path import Path
from matplotlib.scale import LogScale
import numpy as np
def test_Affine2D_from_values():
poin... | 0 | 0 | 0 | 0 | 0 | 2,073 | 0 | 108 | 178 |
6b2372c1dac9dc43fc31f77e4bf32d3d3f4d2748 | 1,929 | py | Python | src/sage/rings/polynomial/pbori/easy_polynomials.py | sensen1/sage | d6c5cd9be78cc448ee4c54bac93385b1244a234c | [
"BSL-1.0"
] | 1 | 2021-03-15T21:45:56.000Z | 2021-03-15T21:45:56.000Z | src/sage/rings/polynomial/pbori/easy_polynomials.py | sensen1/sage | d6c5cd9be78cc448ee4c54bac93385b1244a234c | [
"BSL-1.0"
] | null | null | null | src/sage/rings/polynomial/pbori/easy_polynomials.py | sensen1/sage | d6c5cd9be78cc448ee4c54bac93385b1244a234c | [
"BSL-1.0"
] | null | null | null | from .interpolate import variety_lex_leading_terms, nf_lex_points
from .PyPolyBoRi import easy_linear_factors
def easy_linear_polynomials(p):
r"""
Get linear polynomials implied by given polynomial.
EXAMPLES::
sage: from sage.rings.polynomial.pbori.frontend import x
sage: from sage.rings... | 33.842105 | 112 | 0.616382 | from .interpolate import variety_lex_leading_terms, nf_lex_points
from .PyPolyBoRi import easy_linear_factors
def easy_linear_polynomials(p):
r"""
Get linear polynomials implied by given polynomial.
EXAMPLES::
sage: from sage.rings.polynomial.pbori.frontend import x
sage: from sage.rings... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9a1db89aea20d3ce47b26dae3c9987a3d12e108a | 1,213 | py | Python | kelte/maths/bresenham.py | brianbruggeman/rl | 6dd8a53da07697ffc87e62aa397be7b3b08f0aa0 | [
"MIT"
] | null | null | null | kelte/maths/bresenham.py | brianbruggeman/rl | 6dd8a53da07697ffc87e62aa397be7b3b08f0aa0 | [
"MIT"
] | null | null | null | kelte/maths/bresenham.py | brianbruggeman/rl | 6dd8a53da07697ffc87e62aa397be7b3b08f0aa0 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
cli()
| 27.568182 | 66 | 0.510305 | def bresenham(start, end):
"""Yield a line ray from start to end
"""
((x0, y0), (x1, y1)) = (start, end)
dx, dy = (x1 - x0), (y1 - y0)
x_step, dx = (1, dx) if dx >= 0 else (-1, -dx)
y_step, dy = (1, dy) if dy >= 0 else (-1, -dy)
if dx > dy:
xx, xy, yx, yy = x_step, 0, 0, y_step
... | 0 | 443 | 0 | 0 | 626 | 0 | 0 | 3 | 101 |
e965dca81dbf50c402a16aea902d0799c875df5c | 836 | py | Python | load_trg.py | lamvinh1001/NLP | 6b8ab84266cc345cd064d9c58bae780e2edf99e9 | [
"MIT"
] | null | null | null | load_trg.py | lamvinh1001/NLP | 6b8ab84266cc345cd064d9c58bae780e2edf99e9 | [
"MIT"
] | null | null | null | load_trg.py | lamvinh1001/NLP | 6b8ab84266cc345cd064d9c58bae780e2edf99e9 | [
"MIT"
] | null | null | null | import pathlib
temp = pathlib.PosixPath
pathlib.PosixPath = pathlib.WindowsPath
| 26.967742 | 84 | 0.564593 | import re
import spacy
import pathlib
import torch
import dill
temp = pathlib.PosixPath
pathlib.PosixPath = pathlib.WindowsPath
class tokenize(object):
def __init__(self, lang):
self.nlp = spacy.load(lang)
def tokenizer(self, sentence):
sentence = re.sub(
r"[\*\"“”\n\\…\+\-\/\=\(... | 18 | 0 | 0 | 519 | 0 | 135 | 0 | -40 | 134 |
2378b09cb0cc68141d4a9b289f78f7afd8d529f5 | 1,663 | py | Python | teleportation/quantum_teleport.py | Project-Fare/quantum_computation | fc182007d0cf7cca170efdbcb442576fde5927ff | [
"MIT"
] | 27 | 2020-04-15T18:45:43.000Z | 2022-03-29T10:28:42.000Z | teleportation/quantum_teleport.py | Project-Fare/quantum_computation | fc182007d0cf7cca170efdbcb442576fde5927ff | [
"MIT"
] | 1 | 2021-08-23T01:59:34.000Z | 2021-08-24T05:22:08.000Z | teleportation/quantum_teleport.py | Project-Fare/quantum_computation | fc182007d0cf7cca170efdbcb442576fde5927ff | [
"MIT"
] | 10 | 2021-01-30T15:20:36.000Z | 2022-03-29T10:28:51.000Z | import cirq
qubits = [cirq.GridQubit(0, i) for i in range(3)]
alice = qubits[:2]
bob = [qubits[-1]]
x = 0.2
y = 0.4
q0 = cirq.LineQubit(0)
sim = cirq.Simulator(seed=3)
c = cirq.Circuit([cirq.X(q0)**x, cirq.Y(q0)**y])
message = sim.simulate(c)
c.append(cirq.measure(q0, key='test'))
#print(c)
run(c, 'test', 1000)
print(... | 31.377358 | 75 | 0.660854 | import cirq
import numpy as np
def mom(x):
return [cirq.Moment(x)]
def bell_state(qubit1, qubit2, circuit):
circuit.append([cirq.H(qubit1)])
circuit.append([cirq.CNOT(qubit1, qubit2)])
def teleport(qubits, circuit, x, y):
circuit.append([cirq.X(qubits[0])**x, cirq.Y(qubits[0])**y])
circuit.append... | 0 | 0 | 0 | 0 | 0 | 1,067 | 0 | -3 | 137 |
1c59f08c93c0ba7080668f25ae7bf6c678dbf09c | 247 | py | Python | challenge_4/app/views/views.py | drcrook1/minecraft_hack | 39404b841ccb8a94279887ff7f290354b47d26e0 | [
"MIT"
] | null | null | null | challenge_4/app/views/views.py | drcrook1/minecraft_hack | 39404b841ccb8a94279887ff7f290354b47d26e0 | [
"MIT"
] | null | null | null | challenge_4/app/views/views.py | drcrook1/minecraft_hack | 39404b841ccb8a94279887ff7f290354b47d26e0 | [
"MIT"
] | null | null | null | from flask import Blueprint
views = Blueprint('views', __name__) | 30.875 | 113 | 0.753036 | from flask import render_template, url_for, Blueprint, redirect, flash, request, current_app, send_from_directory
views = Blueprint('views', __name__)
@views.route('/')
@views.route('/index')
def index():
return render_template('index.html') | 0 | 73 | 0 | 0 | 0 | 0 | 0 | 86 | 23 |
efa53e12b52fbdcb018c8b6c60d615c729ba6b62 | 203 | py | Python | deepinpy/models/__init__.py | han20192019/deepinpy | 0fbdfc9cd81f4d698bb1d5e361ef1223a2c8dd1d | [
"MIT"
] | 30 | 2020-03-07T04:36:03.000Z | 2021-12-15T06:28:12.000Z | deepinpy/models/__init__.py | han20192019/deepinpy | 0fbdfc9cd81f4d698bb1d5e361ef1223a2c8dd1d | [
"MIT"
] | 13 | 2020-03-14T06:12:20.000Z | 2021-05-20T04:33:58.000Z | deepinpy/models/__init__.py | han20192019/deepinpy | 0fbdfc9cd81f4d698bb1d5e361ef1223a2c8dd1d | [
"MIT"
] | 22 | 2020-02-28T18:20:54.000Z | 2022-02-16T11:21:58.000Z | """
Deep inverse problems in Python
models submodule
A Model object transforms a variable z to a new variable w
"""
| 20.3 | 58 | 0.788177 | """
Deep inverse problems in Python
models submodule
A Model object transforms a variable z to a new variable w
"""
from .resnet.resnet import ResNet5Block, ResNet
from .unroll.unroll import UnrollNet
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 41 | 45 |
2077026e184ac9a8acb0de6157a030dbe3638412 | 8,202 | py | Python | Covidinfo/Covidinfo.py | Dhanush-E/Covidinfo | 8b67701ce4a8e5de6ef76dfc3c95aefde46d07b0 | [
"MIT"
] | 1 | 2021-06-14T14:41:06.000Z | 2021-06-14T14:41:06.000Z | Covidinfo/Covidinfo.py | Dhanush-E/Covidinfo | 8b67701ce4a8e5de6ef76dfc3c95aefde46d07b0 | [
"MIT"
] | null | null | null | Covidinfo/Covidinfo.py | Dhanush-E/Covidinfo | 8b67701ce4a8e5de6ef76dfc3c95aefde46d07b0 | [
"MIT"
] | null | null | null | #importing required modules
import requests
from bs4 import BeautifulSoup
import os
#scraping india covid data
URL_india = "https://www.mygov.in/covid-19/"
r_india = requests.get(URL_india)
htmlContent_india = r_india.content
soup_india = BeautifulSoup(htmlContent_india,'html.parser')
#scraping covid n... | 34.902128 | 219 | 0.705194 | #importing required modules
import requests
from bs4 import BeautifulSoup
import json
import os
import datetime
import itertools
from requests import ConnectionError
#scraping india covid data
URL_india = "https://www.mygov.in/covid-19/"
r_india = requests.get(URL_india)
htmlContent_india = r_india.con... | 3 | 0 | 0 | 0 | 0 | 5,119 | 0 | -6 | 599 |
8a3a44c910b9398895b664555b62cba9a16c76fe | 185 | py | Python | puzzles/triangles_printing/python.py | shaunak27/al-go-rithms | 138af1c8cfbc86c9c6c1d496e724c1a80b1ac1b4 | [
"CC0-1.0"
] | null | null | null | puzzles/triangles_printing/python.py | shaunak27/al-go-rithms | 138af1c8cfbc86c9c6c1d496e724c1a80b1ac1b4 | [
"CC0-1.0"
] | null | null | null | puzzles/triangles_printing/python.py | shaunak27/al-go-rithms | 138af1c8cfbc86c9c6c1d496e724c1a80b1ac1b4 | [
"CC0-1.0"
] | null | null | null | # range
r = 9
bound = round(r/2)
for y in range(r):
for x in range(r):
if (x >= bound-y AND x <= bound+y):
print("*", end='')
else:
print(" ", end='')
print();
| 15.416667 | 39 | 0.47027 | # range
r = 9
bound = round(r/2)
for y in range(r):
for x in range(r):
if (x >= bound-y AND x <= bound+y):
print("*", end='')
else:
print(" ", end='')
print();
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a7b477d3a9217e74b09238ac526d07042db306f1 | 15,720 | py | Python | src/model_builder.py | davidandym/wikilinks-ned | fbb3c37dd08191365ab731687d2433c97ae65de0 | [
"MIT"
] | 1 | 2020-06-27T15:49:40.000Z | 2020-06-27T15:49:40.000Z | src/model_builder.py | davidandym/wikilinks-ned | fbb3c37dd08191365ab731687d2433c97ae65de0 | [
"MIT"
] | 9 | 2020-03-06T22:11:26.000Z | 2022-02-10T01:44:39.000Z | src/model_builder.py | davidandym/wikilinks-ned | fbb3c37dd08191365ab731687d2433c97ae65de0 | [
"MIT"
] | null | null | null | """ class which builds most of our basic models """
import keras.layers as layers
import keras.backend as K
# pylint: disable=too-many-locals,too-many-instance-attributes
# pylint: disable=too-many-arguments,too-many-branches,too-many-statements
# pylint: disable=cell-var-from-loop
#############################
# M... | 39.3 | 92 | 0.554389 | """ class which builds most of our basic models """
import keras.layers as layers
import keras.backend as K
from keras.models import Model
import tensorflow as tf
from ball import MAX_CTX_CHAR_LENGTH, MAX_TITLE_CHAR_LNGTH
# pylint: disable=too-many-locals,too-many-instance-attributes
# pylint: disable=too-many-argum... | 0 | 0 | 0 | 13,979 | 0 | 0 | 0 | 48 | 90 |
39c95f676ac1eed4d27b44c8523cb4c524d37007 | 7,477 | py | Python | Winter 2017/2048/logic.py | hyunjaemoon/pythonteaching | ee4da847cab548b9a39767d22b2586de927d8513 | [
"CECILL-B"
] | null | null | null | Winter 2017/2048/logic.py | hyunjaemoon/pythonteaching | ee4da847cab548b9a39767d22b2586de927d8513 | [
"CECILL-B"
] | null | null | null | Winter 2017/2048/logic.py | hyunjaemoon/pythonteaching | ee4da847cab548b9a39767d22b2586de927d8513 | [
"CECILL-B"
] | null | null | null |
#######
#Task 1a#
#######
#Question 1
def new_game(n):
"""Returns a nxn matrix with all entries of zeros
Purpose: To initiate the 2048 game!
>>> new_game(1)
[[0]]
>>> new_game(2)
[[0, 0], [0, 0]]
>>> new_game(3)
[[0, 0, 0], [0, 0, 0], [0, 0, 0]]
"""
"***YOUR CODE HERE***"
##... | 32.508696 | 106 | 0.527484 |
from random import *
#######
#Task 1a#
#######
#Question 1
def new_game(n):
"""Returns a nxn matrix with all entries of zeros
Purpose: To initiate the 2048 game!
>>> new_game(1)
[[0]]
>>> new_game(2)
[[0, 0], [0, 0]]
>>> new_game(3)
[[0, 0, 0], [0, 0, 0], [0, 0, 0]]
"""
"***... | 0 | 0 | 0 | 0 | 0 | 1,217 | 0 | -1 | 136 |
486eadc187ddd02a9506366ee96f526d0a3c0915 | 24,630 | py | Python | tet.py | achiwa912/tet | 21c74d812e731ff4034831d2730fff83695d4513 | [
"MIT"
] | null | null | null | tet.py | achiwa912/tet | 21c74d812e731ff4034831d2730fff83695d4513 | [
"MIT"
] | 1 | 2020-07-18T13:06:58.000Z | 2020-07-22T01:12:50.000Z | tet.py | achiwa912/tet | 21c74d812e731ff4034831d2730fff83695d4513 | [
"MIT"
] | 1 | 2020-07-18T12:42:39.000Z | 2020-07-18T12:42:39.000Z | # Zen Tetris - Tetris clone with two-player battle mode
# Uses Python arcade library: https://arcade.academy/index.html
# Background images are from https://pixabay.com/
# Sound data are from at https://maoudamashii.jokersounds.com/
import os
WIDTH = 800 # window width in pixel
HEIGHT = 600 # window height in pixel... | 38.971519 | 79 | 0.540682 | # Zen Tetris - Tetris clone with two-player battle mode
# Uses Python arcade library: https://arcade.academy/index.html
# Background images are from https://pixabay.com/
# Sound data are from 魔王魂 at https://maoudamashii.jokersounds.com/
import arcade
from arcade import Matrix3x3
import random
import os
import timeit
... | 9 | 0 | 0 | 23,057 | 0 | 391 | 0 | -17 | 204 |
fe8690d0248bdec9c0f2ce19ef19c91f23a757a2 | 453 | py | Python | tests/test_response_getter.py | nietzscheson/python-skeleton-library | 9e1f6987c536842174b216ab6291d6eb3f7fe337 | [
"MIT"
] | 1 | 2020-10-29T14:01:24.000Z | 2020-10-29T14:01:24.000Z | tests/test_response_getter.py | nietzscheson/python-skeleton-library | 9e1f6987c536842174b216ab6291d6eb3f7fe337 | [
"MIT"
] | null | null | null | tests/test_response_getter.py | nietzscheson/python-skeleton-library | 9e1f6987c536842174b216ab6291d6eb3f7fe337 | [
"MIT"
] | null | null | null | import unittest
if __name__ == "__main__":
unittest.main()
| 28.3125 | 70 | 0.763797 | import unittest
from src.response_getter import ResponseGetter
from unittest.mock import MagicMock
class ResponseGetterTestCase(unittest.TestCase):
def test_response_getter(self):
requestObject = ResponseGetter()
requestObject.retrieveStatusCode = MagicMock(return_value=200)
responseStatus... | 0 | 0 | 0 | 281 | 0 | 0 | 0 | 39 | 67 |
7c8f0c5de38a7330b60b37a236a186f3de65bc18 | 1,875 | py | Python | errant/en/sorter.py | yuanxun-yx/errant | 360ce465f5621583cedf30701a4fe29d4fa54d71 | [
"MIT"
] | null | null | null | errant/en/sorter.py | yuanxun-yx/errant | 360ce465f5621583cedf30701a4fe29d4fa54d71 | [
"MIT"
] | null | null | null | errant/en/sorter.py | yuanxun-yx/errant | 360ce465f5621583cedf30701a4fe29d4fa54d71 | [
"MIT"
] | null | null | null |
conts_expanded = {
"would": "'d",
"will": "'ll",
"am": "'m",
"not": "n't",
"are": "'re",
"is": "'s",
"has": "'s",
"have": "'ve",
}
# Input: An Edit object
# Output: Whether the Edit adds apostrophe to a contraction token
# e.g. nt -> n't
# its -> it 's
# Input: An Edit object
# O... | 30.241935 | 88 | 0.611733 | from errant.en.classifier import conts
conts_expanded = {
"would": "'d",
"will": "'ll",
"am": "'m",
"not": "n't",
"are": "'re",
"is": "'s",
"has": "'s",
"have": "'ve",
}
# Input: An Edit object
# Output: Whether the Edit adds apostrophe to a contraction token
# e.g. nt -> n't
# it... | 0 | 0 | 0 | 0 | 0 | 1,102 | 0 | 17 | 88 |
bfc4424c1f6800ad44ee62b0b2f30181947ee7d1 | 3,680 | py | Python | tests/transformers/test_rebind_lambda_to_spark_df_transformer.py | spark-root/func_adl_spark | f1e492637e67e2ba57a5662492c9792e8bcfebd6 | [
"MIT"
] | null | null | null | tests/transformers/test_rebind_lambda_to_spark_df_transformer.py | spark-root/func_adl_spark | f1e492637e67e2ba57a5662492c9792e8bcfebd6 | [
"MIT"
] | null | null | null | tests/transformers/test_rebind_lambda_to_spark_df_transformer.py | spark-root/func_adl_spark | f1e492637e67e2ba57a5662492c9792e8bcfebd6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Tests for `func_adl_spark` package."""
import unittest
if __name__ == "__main__":
unittest.main()
| 38.333333 | 134 | 0.626359 | #!/usr/bin/env python
"""Tests for `func_adl_spark` package."""
import unittest
from func_adl_spark import func_adl_spark
import ast, qastle, astpretty, ast_scope
from func_adl_spark.spark_translation import (
generate_python_source,
python_ast_to_python_source,
)
from func_adl_spark.transformers import (
... | 0 | 0 | 0 | 3,222 | 0 | 0 | 0 | 212 | 113 |
ea2519de00d4c8e96d1b5e93baef1e91f95c3ae6 | 10,095 | py | Python | source/objects/paraviewClass.py | THREDgroup/WEC-Sim-Python | c04ef42724cbf72419713970bf9ae63658a4d1b3 | [
"Apache-2.0"
] | 2 | 2020-12-15T08:42:05.000Z | 2021-09-14T08:28:17.000Z | source/objects/paraviewClass.py | THREDgroup/WEC-Sim-Python | c04ef42724cbf72419713970bf9ae63658a4d1b3 | [
"Apache-2.0"
] | 1 | 2020-09-14T03:08:46.000Z | 2020-10-19T05:47:42.000Z | source/objects/paraviewClass.py | THREDgroup/WEC-Sim-Python | c04ef42724cbf72419713970bf9ae63658a4d1b3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat May 30 16:28:49 2020
@author: logical
"""
import os
import waveClass
def write_paraview_vtp_wave(self, t, numPointsX, numPointsY, domainSize, model, simdate, mooring):
"""
Write vtp files for visualization using Paraview ... | 41.714876 | 136 | 0.473997 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat May 30 16:28:49 2020
@author: logical
"""
import os
import waveClass
class ParaviewClass:
def waveElevationGrid(self, t, X, Y):
"""
Parameters
----------
t : int
the current time
X : ... | 0 | 0 | 0 | 1,250 | 0 | 424 | 0 | 0 | 53 |
1f45519c16a6e71014d315593c2c170c4eeb6934 | 5,761 | py | Python | scenarios/perfs/main.py | DataDog/system-tests | 04f94312fddb135830dbe2df6d51d9246561ea6e | [
"Apache-2.0"
] | 3 | 2021-11-15T20:28:25.000Z | 2022-01-27T18:33:15.000Z | scenarios/perfs/main.py | DataDog/system-tests | 04f94312fddb135830dbe2df6d51d9246561ea6e | [
"Apache-2.0"
] | 25 | 2021-11-08T15:50:38.000Z | 2022-03-29T12:16:17.000Z | scenarios/perfs/main.py | DataDog/system-tests | 04f94312fddb135830dbe2df6d51d9246561ea6e | [
"Apache-2.0"
] | 1 | 2021-11-15T20:28:28.000Z | 2021-11-15T20:28:28.000Z | from os import environ
MAX_CONCURRENT_REQUEST = 5
TOTAL_REQUEST_COUNT = 10000
WARMUP_REQUEST_COUNT = 100
WARMUP_LAST_SLEEP_DURATION = 30
WEBLOG_URL = environ["WEBLOG_URL"] if "WEBLOG_URL" in environ else "http://weblog:7777"
LOG_FOLDER = environ["LOG_FOLDER"] if "LOG_FOLDER" in environ else "/app/logs"
TESTED_PATHS =... | 34.497006 | 119 | 0.559972 | import json
from aiohttp import ClientTimeout, ClientSession, UnixConnector, client_exceptions
import asyncio
from datetime import datetime
from os import environ
import time
import requests
MAX_CONCURRENT_REQUEST = 5
TOTAL_REQUEST_COUNT = 10000
WARMUP_REQUEST_COUNT = 100
WARMUP_LAST_SLEEP_DURATION = 30
WEBLOG_URL = ... | 0 | 0 | 2,121 | 2,879 | 0 | 0 | 0 | 36 | 154 |
6048919255585bde425d18f2357b3913c69ce3f7 | 7,533 | py | Python | tools/linker_config/apollo3p/linker_config.py | vaxradius/Apollo3-Apollo4-SDK-2020.08.10 | 933059a13b91fc598301358ab24ae912247bde8c | [
"BSD-3-Clause"
] | 25 | 2019-09-26T18:30:40.000Z | 2022-01-21T07:42:04.000Z | tools/linker_config/apollo3p/linker_config.py | vaxradius/Apollo3-Apollo4-SDK-2020.08.10 | 933059a13b91fc598301358ab24ae912247bde8c | [
"BSD-3-Clause"
] | 23 | 2020-01-20T17:25:02.000Z | 2021-11-16T21:06:42.000Z | tools/linker_config/apollo3p/linker_config.py | vaxradius/Apollo3-Apollo4-SDK-2020.08.10 | 933059a13b91fc598301358ab24ae912247bde8c | [
"BSD-3-Clause"
] | 23 | 2020-04-04T18:35:35.000Z | 2022-03-15T07:34:02.000Z | # <TextAddressRange></TextAddressRange>
# <DataAddressRange></DataAddressRange>
import yaml
# Linker file locations.
IAR_LD_SCRIPT = "iar/linker_script.icf"
KEIL_LD_SCRIPT = "keil/linker_script.sct"
KEIL_DEBUG_FILE = "keil/Dbg_RAM.ini"
GCC_LD_SCRIPT = "gcc/linker_script.ld"
KEIL_STARTUP_FILE = "... | 33.48 | 93 | 0.627506 | # <TextAddressRange></TextAddressRange>
# <DataAddressRange></DataAddressRange>
import argparse
import yaml
from . import iar_link
from . import gcc_link
from . import keil_link
# Linker file locations.
IAR_LD_SCRIPT = "iar/linker_script.icf"
KEIL_LD_SCRIPT = "keil/linker_script.sct"
KEIL_DEBUG_F... | 0 | 0 | 0 | 23 | 0 | 2,291 | 0 | -2 | 225 |
0c66c5fb31792e6c3ea0291adc118c49bd2107f4 | 1,977 | py | Python | datasets/cifar10.py | mdca-aux-loss/MDCA-Calibration | de8d0986a3b8b5794df316b577bc21c8c501ef36 | [
"MIT"
] | 8 | 2022-03-09T07:23:12.000Z | 2022-03-15T04:48:59.000Z | datasets/cifar10.py | mdca-aux-loss/MDCA-Calibration | de8d0986a3b8b5794df316b577bc21c8c501ef36 | [
"MIT"
] | null | null | null | datasets/cifar10.py | mdca-aux-loss/MDCA-Calibration | de8d0986a3b8b5794df316b577bc21c8c501ef36 | [
"MIT"
] | null | null | null | from torchvision import transforms
transform_train = transforms.Compose([
transforms.RandomCrop(32, padding=4),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.Normalize((0.4914, 0.4822, 0.4465), (0.2023, 0.1994, 0.2010)),
])
transform_test = transforms.Compose([
transforms.To... | 39.54 | 138 | 0.746586 | import random
from torchvision import datasets
from torchvision import transforms
from torch.utils import data
transform_train = transforms.Compose([
transforms.RandomCrop(32, padding=4),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.Normalize((0.4914, 0.4822, 0.4465), (0.2023, ... | 0 | 0 | 0 | 0 | 0 | 1,365 | 0 | 10 | 135 |
f1aaabe5a6ec3990de5b5809a551d919cfff7a15 | 289 | py | Python | relay_in2.py | octopusgen/light_control_raspberrypi | d178cfa214c432935c2e719068314ecf9b9cf5c9 | [
"Apache-2.0"
] | null | null | null | relay_in2.py | octopusgen/light_control_raspberrypi | d178cfa214c432935c2e719068314ecf9b9cf5c9 | [
"Apache-2.0"
] | null | null | null | relay_in2.py | octopusgen/light_control_raspberrypi | d178cfa214c432935c2e719068314ecf9b9cf5c9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
gpoList = [27]
for i in gpoList:
GPIO.setup(i, GPIO.OUT)
#GPIO.output(i, GPIO.HIGH)
try:
GPIO.output(27, GPIO.LOW)
print "Pin 27 On IN2"
except KeyboardInterrupt:
print "Saliendo ..."
GPIO.cleanup()
| 13.136364 | 27 | 0.695502 | #!/usr/bin/python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
gpoList = [27]
for i in gpoList:
GPIO.setup(i, GPIO.OUT)
#GPIO.output(i, GPIO.HIGH)
try:
GPIO.output(27, GPIO.LOW)
print "Pin 27 On IN2"
except KeyboardInterrupt:
print "Saliendo ..."
GPIO.cleanup()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cb99103eaa7b5aa452fd0501bf5a2fbd045ed503 | 2,452 | py | Python | src/api/authentification.py | ThMountainMan/Invoice_Tracking | d90d3c701ab3bdb746b7b2f6124789018a5d2fbd | [
"MIT"
] | null | null | null | src/api/authentification.py | ThMountainMan/Invoice_Tracking | d90d3c701ab3bdb746b7b2f6124789018a5d2fbd | [
"MIT"
] | 1 | 2022-01-10T17:19:51.000Z | 2022-01-10T17:19:51.000Z | src/api/authentification.py | ThMountainMan/Invoice_Tracking | d90d3c701ab3bdb746b7b2f6124789018a5d2fbd | [
"MIT"
] | null | null | null | from flask import Blueprint
import logging
auth = Blueprint("auth", __name__)
log = logging.getLogger(__name__)
| 32.263158 | 105 | 0.670881 | from database import DbConnection, NotExists, User
from flask import Blueprint, flash, redirect, render_template, request, url_for
from flask_login import login_user, logout_user, login_required
from werkzeug.security import check_password_hash, generate_password_hash
import logging
auth = Blueprint("auth", __name__)
... | 0 | 1,978 | 0 | 0 | 0 | 0 | 0 | 175 | 181 |
1be0d84debe3a7c439200c83ac7fd87c881503a2 | 741 | py | Python | HackerRank_InterviewPrepKit/Arrays/2D_Array-DS.py | nosy0411/problem_solving | 4526010680732c80e2581c3f803dc603070edac0 | [
"MIT"
] | null | null | null | HackerRank_InterviewPrepKit/Arrays/2D_Array-DS.py | nosy0411/problem_solving | 4526010680732c80e2581c3f803dc603070edac0 | [
"MIT"
] | null | null | null | HackerRank_InterviewPrepKit/Arrays/2D_Array-DS.py | nosy0411/problem_solving | 4526010680732c80e2581c3f803dc603070edac0 | [
"MIT"
] | null | null | null | import os
# Complete the hourglassSum function below.
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
arr = []
for _ in range(6):
arr.append(list(map(int, input().rstrip().split())))
result = hourglassSum(arr)
fptr.write(str(result) + '\n')
fptr.close()
| 18.525 | 62 | 0.537112 | import math
import os
import random
import re
import sys
# Complete the hourglassSum function below.
def hourglassSum(arr):
max_val=0
dx=[-1,0,1,0,-1,0,1]
dy=[-1,-1,-1,0,1,1,1]
for y in range(1,5):
for x in range(1,5):
gls_sum=sum([arr[y+j][x+i] for i,j in zip(dx,dy)])
... | 0 | 0 | 0 | 0 | 0 | 356 | 0 | -41 | 110 |
eece055d95a6f62852fc453209e2d18f385a6a11 | 2,540 | py | Python | plugins/lookup/files_attributes.py | manala/ansible-roles | 30dc7d0bcea10ac4b38c6ad85ad66dbd098131f4 | [
"MIT"
] | 138 | 2017-05-18T13:45:45.000Z | 2022-03-23T02:33:45.000Z | plugins/lookup/files_attributes.py | manala/ansible-roles | 30dc7d0bcea10ac4b38c6ad85ad66dbd098131f4 | [
"MIT"
] | 159 | 2017-05-11T09:05:26.000Z | 2022-03-04T07:36:59.000Z | plugins/lookup/files_attributes.py | manala/ansible-roles | 30dc7d0bcea10ac4b38c6ad85ad66dbd098131f4 | [
"MIT"
] | 35 | 2017-06-29T09:01:42.000Z | 2021-11-18T11:35:00.000Z | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
name: files_attributes
author: Manala (@manala)
short_description: returns a curated attributes list
description:
- Takes a attributes list and returns it curated.
'''
| 28.222222 | 84 | 0.51811 | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
name: files_attributes
author: Manala (@manala)
short_description: returns a curated attributes list
description:
- Takes a attributes list and returns it curated.
'''
from ansible.plugins... | 0 | 0 | 0 | 2,119 | 0 | 0 | 0 | 30 | 91 |
07c4d0c681e50507942aa240fdd19fc1bf6dd7c3 | 147 | py | Python | mul/recipe/appengine/__init__.py | michaellenaghan/mul.recipe.appengine | f3515124671784b962fe0a746af8b932911cf6e0 | [
"BSD-3-Clause"
] | 1 | 2015-05-31T22:21:40.000Z | 2015-05-31T22:21:40.000Z | mul/recipe/appengine/__init__.py | michaellenaghan/mul.recipe.appengine | f3515124671784b962fe0a746af8b932911cf6e0 | [
"BSD-3-Clause"
] | null | null | null | mul/recipe/appengine/__init__.py | michaellenaghan/mul.recipe.appengine | f3515124671784b962fe0a746af8b932911cf6e0 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
mul.recipe.appengine
"""
__author__ = 'Michael Lenaghan'
__email__ = 'metamul -@- gmail.com'
__version__ = '0.4.0'
| 12.25 | 35 | 0.619048 | # -*- coding: utf-8 -*-
"""
mul.recipe.appengine
"""
__author__ = 'Michael Lenaghan'
__email__ = 'metamul -@- gmail.com'
__version__ = '0.4.0'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
faf0f6b2b6a1ed2f01940078299c6b5456c1e20b | 2,256 | py | Python | pylark/api_service_hire_resume_sources_get.py | chyroc/pylark | a54cce6b814935fd3c72668b262b54c8ee461484 | [
"Apache-2.0"
] | 7 | 2021-08-18T00:42:05.000Z | 2022-03-14T09:49:15.000Z | pylark/api_service_hire_resume_sources_get.py | chyroc/pylark | a54cce6b814935fd3c72668b262b54c8ee461484 | [
"Apache-2.0"
] | null | null | null | pylark/api_service_hire_resume_sources_get.py | chyroc/pylark | a54cce6b814935fd3c72668b262b54c8ee461484 | [
"Apache-2.0"
] | 1 | 2022-03-14T09:49:20.000Z | 2022-03-14T09:49:20.000Z | # Code generated by lark_sdk_gen. DO NOT EDIT.
| 36.983607 | 128 | 0.646277 | # Code generated by lark_sdk_gen. DO NOT EDIT.
from pylark.lark_request import RawRequestReq, _new_method_option
from pylark import lark_type, lark_type_sheet, lark_type_approval
import attr
import typing
import io
@attr.s
class GetHireResumeSourceReq(object):
page_size: int = attr.ib(
default=0, metadat... | 516 | 1,385 | 0 | 0 | 0 | 387 | 0 | 58 | 203 |
799812b1798a6b0eab5df82cc9aae2a886f27d01 | 1,016 | py | Python | catalog/urls.py | ershad-ra/locallibrary | 0fa5591f018b50540e5a122a6916596144033bb3 | [
"MIT"
] | null | null | null | catalog/urls.py | ershad-ra/locallibrary | 0fa5591f018b50540e5a122a6916596144033bb3 | [
"MIT"
] | null | null | null | catalog/urls.py | ershad-ra/locallibrary | 0fa5591f018b50540e5a122a6916596144033bb3 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = 'catalog'
urlpatterns = [
path('', views.Index.as_view(), name='index'),
path('books/', views.BookListView.as_view(), name='books'),
path('<int:pk>/books/', views.BookDetailView.as_view(), name='book-detail'),
path('authors/', views.AuthorLis... | 50.8 | 91 | 0.684055 | from django.urls import path
from . import views
app_name = 'catalog'
urlpatterns = [
path('', views.Index.as_view(), name='index'),
path('books/', views.BookListView.as_view(), name='books'),
path('<int:pk>/books/', views.BookDetailView.as_view(), name='book-detail'),
path('authors/', views.AuthorLis... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6d8a96607ba9a22641603ad2010defbe833b3281 | 14,658 | py | Python | feature/steps/endorser_util.py | rameshthoomu/ansible-tests | 2666723209f54ef6f3272561cf9290af62020184 | [
"CC-BY-4.0"
] | null | null | null | feature/steps/endorser_util.py | rameshthoomu/ansible-tests | 2666723209f54ef6f3272561cf9290af62020184 | [
"CC-BY-4.0"
] | null | null | null | feature/steps/endorser_util.py | rameshthoomu/ansible-tests | 2666723209f54ef6f3272561cf9290af62020184 | [
"CC-BY-4.0"
] | null | null | null | #
# Copyright IBM Corp All Rights Reserved
#
# SPDX-License-Identifier: Apache-2.0
#
import sys
try:
pbFilePath = "../fabric/bddtests"
sys.path.insert(0, pbFilePath)
except:
print("ERROR! Unable to import the protobuf libraries from the ../fabric/bddtests directory: {0}".format(sys.exc_info()[0]))
sys.... | 47.436893 | 166 | 0.578046 | #
# Copyright IBM Corp All Rights Reserved
#
# SPDX-License-Identifier: Apache-2.0
#
import config_util
import json
import os
import shutil
import subprocess
import sys
import time
import common_util
try:
pbFilePath = "../fabric/bddtests"
sys.path.insert(0, pbFilePath)
from peer import chaincode_pb2
excep... | 0 | 0 | 0 | 14,001 | 0 | 0 | 0 | -41 | 273 |
b6382fe1320ada05615f2726bb42f96d94185626 | 233 | py | Python | tests/cases/build/method2.py | 3e45/minpiler | 993bdb38d1e4709a412bb551f7eb213376bfe7d2 | [
"MIT"
] | null | null | null | tests/cases/build/method2.py | 3e45/minpiler | 993bdb38d1e4709a412bb551f7eb213376bfe7d2 | [
"MIT"
] | 5 | 2022-02-12T19:53:08.000Z | 2022-03-02T04:30:32.000Z | tests/cases/build/method2.py | 3e45/minpiler | 993bdb38d1e4709a412bb551f7eb213376bfe7d2 | [
"MIT"
] | null | null | null |
c = C(20)
c.f(1, 2)
# > print 23.0
| 12.944444 | 39 | 0.515021 | from minpiler.std import M, inline
class C:
@inline
def __init__(self, n: int) -> None:
self.n = n
@inline
def f(self, x: int, y: int):
M.print(self.n + x + y)
c = C(20)
c.f(1, 2)
# > print 23.0
| 0 | 96 | 0 | -13 | 0 | 0 | 0 | 13 | 98 |
c0f62237a261b83f48e3fd62111a658f265d5bc6 | 26,167 | py | Python | 4-dccphase_2/src/4_manipulatingDataFramesPandas.py | brown9804/ML_TrainingPath | f016c46d52c18d3d03a1f01e7fd93c46da7d882b | [
"Apache-2.0"
] | null | null | null | 4-dccphase_2/src/4_manipulatingDataFramesPandas.py | brown9804/ML_TrainingPath | f016c46d52c18d3d03a1f01e7fd93c46da7d882b | [
"Apache-2.0"
] | null | null | null | 4-dccphase_2/src/4_manipulatingDataFramesPandas.py | brown9804/ML_TrainingPath | f016c46d52c18d3d03a1f01e7fd93c46da7d882b | [
"Apache-2.0"
] | null | null | null | # #-- -- -- -- Manipulating DataFrames with pandas
# # Used for Data Scientist Training Path
# #FYI it's a compilation of how to work
# #with different commands.
# ### --------------------------------------------------------
# # # # ------>>>>Index ordering In this
# exercise, the DataFrame
# election ... | 37.978229 | 110 | 0.603661 | # #-- -- -- -- Manipulating DataFrames with pandas
# # Used for Data Scientist Training Path
# #FYI it's a compilation of how to work
# #with different commands.
# ### --------------------------------------------------------
# # # # ------>>>>Index ordering In this
# exercise, the DataFrame
# election ... | 0 | 0 | 0 | 0 | 0 | 108 | 0 | 0 | 69 |
f3c5c8dd9a663a834c6e870880a0318c8749de9e | 4,005 | py | Python | src/morphforge/simulation/base/biophysics/channelapplicators.py | mikehulluk/morphforge | 2a95096f144ed4ea487decb735ce66706357d3c7 | [
"BSD-2-Clause"
] | 1 | 2021-01-21T11:31:59.000Z | 2021-01-21T11:31:59.000Z | src/morphforge/simulation/base/biophysics/channelapplicators.py | mikehulluk/morphforge | 2a95096f144ed4ea487decb735ce66706357d3c7 | [
"BSD-2-Clause"
] | null | null | null | src/morphforge/simulation/base/biophysics/channelapplicators.py | mikehulluk/morphforge | 2a95096f144ed4ea487decb735ce66706357d3c7 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Copyright (c) 2012 Michael Hull.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are m... | 43.064516 | 174 | 0.70437 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Copyright (c) 2012 Michael Hull.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are m... | 0 | 0 | 0 | 2,416 | 0 | 0 | 0 | 0 | 46 |
827719a739a78134fa84d4c1e4da8d33379776e3 | 201 | py | Python | Aula07/Ex015.py | FlaYukari/Exerc-cios-Python-3--Mundo-01 | 4b7e3149806d851209edc9bf643b5abd072e9bc8 | [
"MIT"
] | null | null | null | Aula07/Ex015.py | FlaYukari/Exerc-cios-Python-3--Mundo-01 | 4b7e3149806d851209edc9bf643b5abd072e9bc8 | [
"MIT"
] | null | null | null | Aula07/Ex015.py | FlaYukari/Exerc-cios-Python-3--Mundo-01 | 4b7e3149806d851209edc9bf643b5abd072e9bc8 | [
"MIT"
] | null | null | null | print('='*20, 'DESAFIO 016', '='*20) #ok
d=int(input('Quantos dias alugados? '))
km=float(input('Quantos km rodados? '))
at= (60 * d) + (0.15*km)
print(f'O total a pagar de R$ {at:.2f}.') | 22.333333 | 43 | 0.562189 | print('='*20, 'DESAFIO 016', '='*20) #ok
d=int(input('Quantos dias alugados? '))
km=float(input('Quantos km rodados? '))
at= (60 * d) + (0.15*km)
print(f'O total a pagar é de R$ {at:.2f}.') | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
70a50769b819f10bbde79005526c44316c390cac | 1,463 | py | Python | rhoci/DFG/constants.py | ahmedmagdyawaad/redhat-ci-dashboard | a9c0445add4e99bb44a8075752a62176968278df | [
"Apache-2.0"
] | 8 | 2017-06-29T19:38:40.000Z | 2021-07-25T18:55:37.000Z | rhoci/DFG/constants.py | ahmedmagdyawaad/redhat-ci-dashboard | a9c0445add4e99bb44a8075752a62176968278df | [
"Apache-2.0"
] | 39 | 2017-06-21T07:35:02.000Z | 2018-02-26T11:25:03.000Z | rhoci/DFG/constants.py | ahmedmagdyawaad/redhat-ci-dashboard | a9c0445add4e99bb44a8075752a62176968278df | [
"Apache-2.0"
] | 7 | 2018-01-24T10:31:00.000Z | 2021-09-18T12:27:46.000Z | # Copyright 2019 Arie Bregman
#
# 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 agree... | 47.193548 | 78 | 0.613807 | # Copyright 2019 Arie Bregman
#
# 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 agree... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
86516d68347b46ca7dff714f421f85356f1d6bea | 676 | py | Python | wagtail/tests/testapp/migrations/0024_advertwithtabbedinterface.py | yohanlebret/wagtail | 03c623b467ef8ed3849872273ebad13d48f755ac | [
"BSD-3-Clause"
] | null | null | null | wagtail/tests/testapp/migrations/0024_advertwithtabbedinterface.py | yohanlebret/wagtail | 03c623b467ef8ed3849872273ebad13d48f755ac | [
"BSD-3-Clause"
] | null | null | null | wagtail/tests/testapp/migrations/0024_advertwithtabbedinterface.py | yohanlebret/wagtail | 03c623b467ef8ed3849872273ebad13d48f755ac | [
"BSD-3-Clause"
] | 1 | 2019-03-05T15:37:22.000Z | 2019-03-05T15:37:22.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
| 28.166667 | 114 | 0.587278 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('tests', '0023_mycustompage'),
]
operations = [
migrations.CreateModel(
name='AdvertWithTabbedInterface',
... | 0 | 0 | 0 | 546 | 0 | 0 | 0 | 19 | 46 |
6e3ca3d99fc0012cf9bc917d76f2e2663b99785a | 682 | py | Python | src/level1/wikipedia.py | sntwandy/webscraping-py | ac0b56619e96f2601eac7747231acde617213489 | [
"MIT"
] | null | null | null | src/level1/wikipedia.py | sntwandy/webscraping-py | ac0b56619e96f2601eac7747231acde617213489 | [
"MIT"
] | null | null | null | src/level1/wikipedia.py | sntwandy/webscraping-py | ac0b56619e96f2601eac7747231acde617213489 | [
"MIT"
] | null | null | null | import requests
from lxml import html
headers = {
"user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36"
}
# URL root
url = "https://www.nba.com/"
# Requirements
r = requests.get(url, headers=headers)
# Parse the html response
parser = html.froms... | 26.230769 | 125 | 0.734604 | import requests
from lxml import html
headers = {
"user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36"
}
# URL root
url = "https://www.nba.com/"
# Requirements
r = requests.get(url, headers=headers)
# Parse the html response
parser = html.froms... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
915dea636a13c5fef881110ece3c64ba9b54b598 | 4,694 | py | Python | tests/parsing_test.py | fossabot/telegram-click | c4982a59b2a6c63de37f247f77e998872ab030ae | [
"MIT"
] | null | null | null | tests/parsing_test.py | fossabot/telegram-click | c4982a59b2a6c63de37f247f77e998872ab030ae | [
"MIT"
] | null | null | null | tests/parsing_test.py | fossabot/telegram-click | c4982a59b2a6c63de37f247f77e998872ab030ae | [
"MIT"
] | null | null | null | # Copyright (c) 2019 Markus Ressel
# .
# 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, publis... | 33.769784 | 104 | 0.629953 | # Copyright (c) 2019 Markus Ressel
# .
# 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, publis... | 0 | 0 | 0 | 3,417 | 0 | 0 | 0 | 69 | 90 |
9f33d22d789ecd545b2fc9c4d9ade867ac8db409 | 608 | py | Python | KristaBackup/web/webapp/WebAppRunner.py | javister/krista-backup | f8852c20afdf483e842ff22497bdd80eedc30c78 | [
"Apache-2.0"
] | 7 | 2020-07-28T06:53:02.000Z | 2022-03-18T05:23:03.000Z | KristaBackup/web/webapp/WebAppRunner.py | javister/krista-backup | f8852c20afdf483e842ff22497bdd80eedc30c78 | [
"Apache-2.0"
] | 1 | 2020-11-25T16:13:26.000Z | 2020-11-25T16:13:26.000Z | KristaBackup/web/webapp/WebAppRunner.py | javister/krista-backup | f8852c20afdf483e842ff22497bdd80eedc30c78 | [
"Apache-2.0"
] | 1 | 2020-07-28T13:47:09.000Z | 2020-07-28T13:47:09.000Z | #!/usr/bin/python3
# -*- coding: UTF-8 -*-
from .app import app
if __name__ == '__main__':
app = WebApp()
print(app.name)
app.run()
| 23.384615 | 86 | 0.664474 | #!/usr/bin/python3
# -*- coding: UTF-8 -*-
from common.Logging import get_generic_logger
from ..AppRunner import AppRunner
from .app import app
from .WebAppConfig import webappconf
class WebApp(AppRunner):
name = 'web'
def run_app(self):
app.logger = get_generic_logger()
app.config.from_obj... | 0 | 0 | 0 | 320 | 0 | 0 | 0 | 51 | 90 |
baf57cb579f6e4038eddd035ca911b02ff9ed15b | 639 | py | Python | src/scripts/src/closestVolPose.py | BCLab-UNM/SC2 | 3e476a529ca9c6c650b921a749ae496671cca6a8 | [
"MIT"
] | null | null | null | src/scripts/src/closestVolPose.py | BCLab-UNM/SC2 | 3e476a529ca9c6c650b921a749ae496671cca6a8 | [
"MIT"
] | null | null | null | src/scripts/src/closestVolPose.py | BCLab-UNM/SC2 | 3e476a529ca9c6c650b921a749ae496671cca6a8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
if __name__ == '__main__':
main()
| 33.631579 | 118 | 0.70266 | #!/usr/bin/env python3
from gazebo_msgs.srv import GetModelState
import rospy
import math
def main():
model_coordinates = rospy.ServiceProxy('/gazebo/get_model_state', GetModelState)
cur_pose = model_coordinates("small_scout_1", 'world').pose.position
all_vols_poses =[ model_coordinates("vol_"+str(num), "w... | 0 | 0 | 0 | 0 | 0 | 486 | 0 | 1 | 89 |
3a5c581d8fa7f9ea38f547c35a8d8961bb4d9f81 | 53 | py | Python | tests/errors/test_zero_division.py | akshanshbhatt/lpython | 70fef49dbbb6cbb0447f7013231171e5c8b8e5df | [
"BSD-3-Clause"
] | 31 | 2022-01-07T23:56:33.000Z | 2022-03-29T16:09:02.000Z | tests/errors/test_zero_division.py | akshanshbhatt/lpython | 70fef49dbbb6cbb0447f7013231171e5c8b8e5df | [
"BSD-3-Clause"
] | 197 | 2021-12-29T19:01:41.000Z | 2022-03-31T15:58:25.000Z | tests/errors/test_zero_division.py | akshanshbhatt/lpython | 70fef49dbbb6cbb0447f7013231171e5c8b8e5df | [
"BSD-3-Clause"
] | 17 | 2022-01-06T15:34:36.000Z | 2022-03-31T13:55:33.000Z |
f()
| 7.571429 | 17 | 0.339623 | def f():
i: i32
i = 4
print(i // 0)
f()
| 0 | 0 | 0 | 0 | 0 | 26 | 0 | 0 | 22 |
2ba462e086c78285ae47a83b3a6a1cc80023260a | 882 | py | Python | validator/helper/kmfs.py | CCMi-FIT/dtl-dsw | 8fd047d598cc28a328761783a57a1fc366eee3a5 | [
"Apache-2.0"
] | 3 | 2019-01-02T21:12:37.000Z | 2019-05-21T09:43:42.000Z | validator/helper/kmfs.py | CCMi-FIT/dtl-dsw | 8fd047d598cc28a328761783a57a1fc366eee3a5 | [
"Apache-2.0"
] | 9 | 2018-04-10T09:40:31.000Z | 2018-07-19T08:43:32.000Z | validator/helper/kmfs.py | ds-wizard/ds-km | 8fd047d598cc28a328761783a57a1fc366eee3a5 | [
"Apache-2.0"
] | 3 | 2018-03-28T14:13:09.000Z | 2018-05-22T08:03:09.000Z |
if __name__ == '__main__':
kmfs = kmfs2dict('./datamodel')
print(kmfs)
print(extract_chapterid('datamodel/core/chapter1.json'))
| 24.5 | 67 | 0.585034 | import os
def extract_chapterid(filepath):
try:
filename = os.path.split(filepath)[-1]
if filename[0:7] == 'chapter' and filename[-5:] == '.json':
return int(filename[7:-5])
else:
return 0
except ValueError:
return -1
def is_chapter(filepath):
retu... | 0 | 0 | 0 | 0 | 0 | 658 | 0 | -12 | 91 |
cc640c5cb208f5d10c2d3f2e5caf9aac4b49d07f | 5,526 | py | Python | k8s_functions/functions.py | ade8850/krules-subjects-storage-k8s | 98dabcededdb52d48459ba26be14f9a16cd51023 | [
"Apache-2.0"
] | null | null | null | k8s_functions/functions.py | ade8850/krules-subjects-storage-k8s | 98dabcededdb52d48459ba26be14f9a16cd51023 | [
"Apache-2.0"
] | null | null | null | k8s_functions/functions.py | ade8850/krules-subjects-storage-k8s | 98dabcededdb52d48459ba26be14f9a16cd51023 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The KRules Authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,... | 31.942197 | 96 | 0.584148 | # Copyright 2019 The KRules Authors
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,... | 0 | 0 | 0 | 3,997 | 0 | 0 | 0 | 26 | 137 |
a3489e95cc9a4de0d9ada79afc873e9ad00245e5 | 22,623 | py | Python | fatf/utils/models/models.py | So-Cool/fat-forensics | 6fa252a1d90fe543242ef030a5f8a3f9c9f692fe | [
"BSD-3-Clause"
] | 48 | 2019-09-12T04:54:48.000Z | 2022-02-27T01:49:55.000Z | fatf/utils/models/models.py | So-Cool/fat-forensics | 6fa252a1d90fe543242ef030a5f8a3f9c9f692fe | [
"BSD-3-Clause"
] | 4 | 2018-09-20T10:37:53.000Z | 2018-09-26T23:57:48.000Z | fatf/utils/models/models.py | So-Cool/fat-forensics | 6fa252a1d90fe543242ef030a5f8a3f9c9f692fe | [
"BSD-3-Clause"
] | 11 | 2019-09-17T13:39:43.000Z | 2021-07-27T11:04:33.000Z | """
The :mod:`fatf.utils.models.models` module holds custom models.
The models implemented in this module are mainly used for used for
FAT Forensics package testing and the examples in the documentation.
"""
# Author: Kacper Sokol <k.sokol@bristol.ac.uk>
# License: new BSD
__all__ = ['KNN']
| 41.058076 | 79 | 0.582328 | """
The :mod:`fatf.utils.models.models` module holds custom models.
The models implemented in this module are mainly used for used for
FAT Forensics package testing and the examples in the documentation.
"""
# Author: Kacper Sokol <k.sokol@bristol.ac.uk>
# License: new BSD
import abc
from typing import Optional
imp... | 0 | 715 | 0 | 21,267 | 0 | 0 | 0 | 140 | 205 |
5e42d4ea17e7d03b4d319ef266dbf4b7cbd7758d | 6,550 | py | Python | test/e2e/tests/test_nodegroup.py | acornett21/ack-eks-controller | 7733cb522bba0b3f2123c354d8431620e927bc5f | [
"Apache-2.0"
] | 10 | 2021-07-08T23:36:02.000Z | 2022-02-11T16:39:39.000Z | test/e2e/tests/test_nodegroup.py | acornett21/ack-eks-controller | 7733cb522bba0b3f2123c354d8431620e927bc5f | [
"Apache-2.0"
] | 33 | 2021-07-08T16:53:46.000Z | 2022-03-31T22:30:57.000Z | test/e2e/tests/test_nodegroup.py | acornett21/ack-eks-controller | 7733cb522bba0b3f2123c354d8431620e927bc5f | [
"Apache-2.0"
] | 11 | 2021-07-08T16:50:30.000Z | 2022-03-28T21:39:24.000Z | # Copyright Amazon.com Inc. or its affiliates. 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. A copy of the
# License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying... | 33.418367 | 93 | 0.648855 | # Copyright Amazon.com Inc. or its affiliates. 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. A copy of the
# License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying... | 0 | 4,772 | 0 | 0 | 0 | 358 | 0 | 180 | 294 |
1da2c3992128743c85f763aa9967ad976f0aa59a | 1,073 | py | Python | tests/unit/api/test_redshit_disable_comment_edit.py | worldwise001/amundsenmetadatalibrary | 9914c8b51d38b8bd76d3249eb4f7fcce3e198d09 | [
"Apache-2.0"
] | 1 | 2021-04-10T14:08:57.000Z | 2021-04-10T14:08:57.000Z | tests/unit/api/test_redshit_disable_comment_edit.py | worldwise001/amundsenmetadatalibrary | 9914c8b51d38b8bd76d3249eb4f7fcce3e198d09 | [
"Apache-2.0"
] | 1 | 2019-09-21T23:59:46.000Z | 2019-09-21T23:59:46.000Z | tests/unit/api/test_redshit_disable_comment_edit.py | worldwise001/amundsenmetadatalibrary | 9914c8b51d38b8bd76d3249eb4f7fcce3e198d09 | [
"Apache-2.0"
] | 1 | 2019-09-21T23:56:40.000Z | 2019-09-21T23:56:40.000Z | import unittest
if __name__ == '__main__':
unittest.main()
| 37 | 105 | 0.722274 | import unittest
from http import HTTPStatus
from mock import patch
from metadata_service.api.table import TableDescriptionAPI
from metadata_service.api.column import ColumnDescriptionAPI
class RedshiftCommentEditDisableTest(unittest.TestCase):
def test_table_comment_edit(self) -> None:
with patch('metada... | 0 | 0 | 0 | 812 | 0 | 0 | 0 | 83 | 112 |
d08e5eae9ee9c13f94122348b2ff6b9e53a0c3a6 | 636 | py | Python | fuse-mdsplus/wsgi/var/www/html/mdsplus_wsgi_config.py | fuse-energy/DockerizedMDSplus | 2420fbb7543a93075194da7feb66eefb48637784 | [
"MIT"
] | null | null | null | fuse-mdsplus/wsgi/var/www/html/mdsplus_wsgi_config.py | fuse-energy/DockerizedMDSplus | 2420fbb7543a93075194da7feb66eefb48637784 | [
"MIT"
] | null | null | null | fuse-mdsplus/wsgi/var/www/html/mdsplus_wsgi_config.py | fuse-energy/DockerizedMDSplus | 2420fbb7543a93075194da7feb66eefb48637784 | [
"MIT"
] | null | null | null | # %%
import subprocess, os
os.environ["UDP_EVENTS"] = "yes"
os.environ["MDS_PATH"] = "/usr/local/mdsplus/tdi;/tdi"
os.environ["PATH"] = "/usr/local/mdsplus/bin:" + os.environ["PATH"]
os.environ["LD_LIBRARY_PATH"] = "/usr/local/mdsplus/lib"
# os.environ["mdsip_server_host"] =
# Get tree path environment variables confi... | 26.5 | 77 | 0.654088 | # %%
import subprocess, os
os.environ["UDP_EVENTS"] = "yes"
os.environ["MDS_PATH"] = "/usr/local/mdsplus/tdi;/tdi"
os.environ["PATH"] = "/usr/local/mdsplus/bin:" + os.environ["PATH"]
os.environ["LD_LIBRARY_PATH"] = "/usr/local/mdsplus/lib"
# os.environ["mdsip_server_host"] =
# Get tree path environment variables confi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
df507a1d43c94867d46e40b0c7cbf4d1fb7c37ac | 178 | py | Python | tools/tpcc_delivery.py | EvilMcJerkface/hyrise-v1 | d97fa0df5b9e2b9aaa78865c010e93173404086d | [
"MIT"
] | 7 | 2017-11-13T11:02:59.000Z | 2022-02-05T11:49:35.000Z | tools/tpcc_delivery.py | EvilMcJerkface/hyrise-v1 | d97fa0df5b9e2b9aaa78865c010e93173404086d | [
"MIT"
] | null | null | null | tools/tpcc_delivery.py | EvilMcJerkface/hyrise-v1 | d97fa0df5b9e2b9aaa78865c010e93173404086d | [
"MIT"
] | 6 | 2017-10-19T13:34:08.000Z | 2020-11-30T13:14:47.000Z | #!/bin/env python2
from client import Connection
c = Connection()
response = c.stored_procedure("TPCC-Delivery", """{ "W_ID": 1, "D_ID": 1, "O_CARRIER_ID": 1}""")
print response
| 29.666667 | 96 | 0.691011 | #!/bin/env python2
from client import Connection
c = Connection()
response = c.stored_procedure("TPCC-Delivery", """{ "W_ID": 1, "D_ID": 1, "O_CARRIER_ID": 1}""")
print response
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
619798760eeb160b516221b2b3ff4e9c54e20cc9 | 5,663 | py | Python | dgen_utils.py | Wilhdan/dgen | 13599f2d3ed2747e90326d6c785e55e5783bf508 | [
"Apache-2.0"
] | null | null | null | dgen_utils.py | Wilhdan/dgen | 13599f2d3ed2747e90326d6c785e55e5783bf508 | [
"Apache-2.0"
] | null | null | null | dgen_utils.py | Wilhdan/dgen | 13599f2d3ed2747e90326d6c785e55e5783bf508 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import sys
import errno
import shutil
import os
import traceback
import yaml
DEBUG = False
REFRESH_TEMPLATE = False
WORK_OFFLINE = False
def eprint(*args, **kwargs):
'''
Print to std error.
'''
print(*args, file=sys.stderr, **kwargs)
def log_warn(*string, **kwarg... | 29.041026 | 80 | 0.609571 | from __future__ import print_function
import sys
import errno
import shutil
import os
import traceback
import subprocess
import io
import glob
import re
import git
import yaml
DEBUG = False
REFRESH_TEMPLATE = False
WORK_OFFLINE = False
def eprint(*args, **kwargs):
'''
Print to std error.
'''
print(*a... | 0 | 0 | 0 | 126 | 0 | 2,699 | 0 | -49 | 318 |
379f1245bd05d9d85ae65b06e8697263fa5ad57e | 769 | py | Python | nori/dbms/__init__.py | ocsw/nori | 1e6e910f6dff4254cd8fef2542df3ff0fec09d6b | [
"BSD-2-Clause"
] | null | null | null | nori/dbms/__init__.py | ocsw/nori | 1e6e910f6dff4254cd8fef2542df3ff0fec09d6b | [
"BSD-2-Clause"
] | null | null | null | nori/dbms/__init__.py | ocsw/nori | 1e6e910f6dff4254cd8fef2542df3ff0fec09d6b | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
"""
This is the initialization module for the nori library's DBMS subsystem;
see ../__main__.py for license and usage information.
"""
########################################################################
# IMPORTS
#############################################... | 19.717949 | 72 | 0.517555 | #!/usr/bin/env python
"""
This is the initialization module for the nori library's DBMS subsystem;
see ../__main__.py for license and usage information.
"""
########################################################################
# IMPORTS
#############################################... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 107 |